Is there a way to have tikz ignore the white space produced by a node's inner sep when calculating the picture's bounding box?
Consider the following MWE:
\documentclass{article}
\usepackage[showframe,pass]{geometry}
\usepackage{tikz}
\begin{document}
\noindent \begin{tikzpicture}
\node[inner sep=0pt] (X) {X};
\draw (X) -- ++ (0.5, 0);
\draw[gray] (current bounding box.south west) rectangle (current bounding box.north east);
\end{tikzpicture}
\noindent X
\noindent \begin{tikzpicture}
\node[inner sep=2pt] (X) {X};
\draw (X) -- ++ (0.5, 0);
\draw[gray] (current bounding box.south west) rectangle (current bounding box.north east);
\end{tikzpicture}
\end{document}
Here's the output:

In this example, the inner sep is useful when drawing lines from/to the node (see the horizontal line in the example), but on the other side, it indents the second X with regard to the normal text. Some way of specifying the bounding box as the smallest rectangle containing all "ink" (and thereby clipping all inner seps and possibly other white spaces that needlessly extend the bounding box) would be great here...


trim left=##ptkey to shave off the amount you like – percusse Nov 18 '13 at 09:38outer sepfor a node. You have to make it 0 too. – Nov 18 '13 at 09:43