Closed psparkmath closed 6 months ago
This is actually well-known. See, for example: https://tex.stackexchange.com/a/75152/47927
As documented.
There is an undocumented option foreach[scope iterations=false]
but it's undocumented for a reason, namely that in most of the cases it's broken.
Would be fixed by #1304 too?
Yes. It's also a duplicate of https://github.com/pgf-tikz/pgf/issues/356 and https://github.com/pgf-tikz/pgf/issues/1303 and closely related to https://github.com/pgf-tikz/pgf/issues/1047.
Brief outline of the bug
I found that
foreach
command does not work well for\node
.I wrote the code
\draw (P1) foreach \n in {2,3}{ -- (P\i) };
to draw lines connecting nodes P1, P2, P3, consecutively. But, this code draw lines connecting P1 and P2 and connecting P1 and P3.If you change
\node
part to\coordinate
, thenforeach
command works well.Minimal working example (MWE)