# Macro shifts to the right

Every time I'm using this macro it shifts to the right. Why?

\begin{tikzpicture}[overlay, remember picture]
\coordinate (x) at (#1,0);
\draw [open triangle 45-] (0,0) -- (x);
\end{tikzpicture}
}

Edit

Well, I adapted my real macro (I just provided a smaller example for the sake of demonstration), but I still have a little gap:

\begin{tikzpicture}[overlay, remember picture]%
\coordinate (x) at (#2,0);
\coordinate (a) at ($(x)!(#1.north)!($(x)+(0,1)$)$);
\coordinate (b) at ($(a)+(0.5,0)$);
\coordinate (c) at ($(b)+(0,#3)$);
\draw [open triangle 45-] (a) -- (b) -- (c);
\node[right] at (c) {\bf\sffamily\smaller#4};
\end{tikzpicture}%
}
-
Try \newcommand*{addLine}[1]{% and \end{tikzpicture}%. I'm not sure what packages are required to get your example to compile, so I can't test. Possibly also a % after remember picture]% –  Scott H. Dec 10 '12 at 19:31

Your macro is introducing spurious spaces. See Why the end-of-line % in macro definitions

With comment chars:

Without comment chars:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\newcommand*{\addLine}[1]{% <--- a space is introduced without this %
\begin{tikzpicture}[overlay, remember picture]
\coordinate (x) at (#1,0);
\draw [open triangle 45-] (0,0) -- (x);
\end{tikzpicture}% <--- a space is introduced without this %
}
\begin{document}