In trying answer Is it possible to use a macro to name a TikZ node?, I attempted to use the solution provided at pgfmath expansion - call a command from within a pgfmath environment, but this yielded the error message
Incomplete \iffalse; all text was ignored after line 67.
<inserted text>
\fi
from the example
\documentclass{article}
\usepackage{tikz}
\newcommand{\mathresult}[1]{%
\pgfmathparse{#1}\pgfmathsetmacro\mymathresult{\pgfmathresult}%
}
\newcommand{\mymacro}[2]{%
\mathresult{#1}%
\pgfmathparse{#2 + \mymathresult}%
\pgfmathsetmacro\mymathresult{\pgfmathresult}\mathresult%
}%
\begin{document}
\begin{tikzpicture}
\node (0) at (0,0) {X};
\node (\mymacro{2}{3}) at (1,2) {Y};
\draw (\mymacro{2}{3}) -- (0);
\draw (5) -- +(3,0) {Z};
\end{tikzpicture}
\end{document}
5.0as computed in the MWE needed to be converted to integer, but was not aware that5.0as a label would not work. – Peter Grill Sep 08 '11 at 05:355.0works as a label, it just can't be used again as a coordinate because there is a step in the coordinate parser that looks for the syntaxname.anchorso5.0gets interpreted as "the anchor which is at angle 0 on the boundary of the node called '5'". – Andrew Stacey Sep 08 '11 at 07:06