Trying to use \foreach
for node placement and coloring fails. Node label becomes e.g. redredcaptionA
where red
is the desired color and captionA
is the node label text.
Desired result would be a node with captionA
as label text in red font color.
MWE
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\foreach \i/\text/\color in {{1,1}/captionA/{red},{2,2}/captionB/{blue}}
{\node[text=\color] at (\i) {\text};}
\end{tikzpicture}
\end{document}
I have seen some related posts, where the node definition needs to be in an \edef definition but it's not solving the problem.