It's not possible to draw nodes through \foreach
if nodes have node contents
option.
Minimal not working example (with TikZ 3.0)
%---------------------------------------
\documentclass[tikz,border=2mm]{standalone}
\begin{document}
\begin{tikzpicture}
\foreach \i in {1,2,3}
\node[node contents=a] at (\i,0) ;
\end{tikzpicture}
\end{document}
%---------------------------------------
It finishes with:
! Use of \@next doesn't match its definition.
\pgffor@body ->\node [node contents=a] at
(\i ,0) ;
l.6 \node[node contents=a] at (\i,0) ;
Complete .log file is attached
Quoting the manual;
When using node contents, node location requires at=<(coord or name)> syntax as an option. The following works;
However, as far as I can see, there is no need to use node contents in this context if you would like to keep the at <(coord or name)> syntax on the path.
In fact I needed to specify
node contents
in .style declaration. I didn't know thatat
was also possible in node options.Issue solved from my point of view.
Thanks for the comments. Closing issue accordingly.