When I use \pgfresult
to get a node label in a \foreach
, I have no problem.
However, I can't seem to get the syntax right to create a coordinate with the same method.
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\def\pinlabel{{"SCL","SDA"}}
\foreach \x in {0,1}{
\node at (\x,0){\pgfmathparse{\pinlabel[\x]}\pgfmathresult}; %<==== works!
%\node at (\x,0){\pgfmathparse{\pinlabel[\x]}\pgfmathresult} coordinate ({\pgfmathparse{\pinlabel[\x]}\pgfmathresult}); %<====== doesnt't work
}
\end{tikzpicture}
\end{document}
The commented line fails with: incomplete \iffalse
; all text was ignored after line 15.
I've tried doing the parse earlier, and just using the \pgfmathresult
alone, but that also fails.