Upon creating some graphs with TikZ, I noticed that the border at one side was much larger than it needed to be. The cause seems to be the \pgfmathsetmacro command:
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
%\pgfmathsetmacro{\a}{0}
%\pgfmathsetmacro{\b}{0}
%\pgfmathsetmacro{\c}{0}
%\pgfmathsetmacro{\d}{0}
%\pgfmathsetmacro{\e}{0}
\begin{tikzpicture}
\draw (0, 0) rectangle (1, 1);
\end{tikzpicture}
\end{document}
Without any defined macros, the output looks like this (Adobe reader background is gray):

With each macro, the size increases. With all five macros defined, it looks like this:

How can this behaviour be explained? Am I using the \pgfmathsetmacro in a wrong way? I did this a lot in the past and never had such a problem. The following did not help, the border didn't change at all:
\documentclass[border=0pt]{standalone}
%after the\pgfmathsetmacro{\?}{0}lines. If these macros are only for the nexttikzpictureput them behind\begin{tikzpicture}. This keeps them local to this picture and you get rid of any white-space problems. – Qrrbrbirlbel Apr 26 '15 at 16:11\begin{tikzpicture}or use PGFmath function but can only be used in places which are parsed by PGFmath (most places with-in TikZ). For example:declare function={a=0; b=0; c(\i)=\i^2;}. – Qrrbrbirlbel Apr 26 '15 at 16:20