I'm having trouble incrementing a variable in TikZ and then using the result as part of a node name:
\def\x{2}
\begin{figure}[H]
\begin{tikzpicture}
\pgfmathsetmacro{\xplusone}{add(\x,1)}
\node (X\xplusone1) at (0,0) {};
\path (1, 1) edge (X\xplusone1);
\end{tikzpicture}
\end{figure}
seems to be parsing the final line as "X3" instead of "X31".
\node (X\xplusone0)...
should be\node (X\xplusone1)...
? Also, for questions like this, please post complete compilable minimal files. In this case, you don't need thefigure
environment, but it would save others some work if you included the preamble and thedocument
environment. – Jake Sep 26 '11 at 6:23