Sujet : Re: [LaTeX][PGF/TikZ] Undefined control sequence error for PGF intersections.
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.text.texDate : 30. Aug 2024, 23:26:28
Autres entêtes
Organisation : Stefan Ram
Message-ID : <loop-20240830232543@ram.dialup.fu-berlin.de>
References : 1
Annada Behera <
segfault@tilde.green> wrote or quoted:
% Mark intersection points and draw dashed lines
\foreach \n in {1,...,\t} {
\path ({i-\n}) coordinate (i\n); % <--- Error Here
\fill[black] (i\n) circle (2pt);
\draw[dashed] (i\n) -- (i\n |- 0,0);
\draw[dashed] (i\n) -- (0,0 -| i\n);
}
Plain TeX to the rescue! What also works here is:
% Mark intersection points and draw dashed lines
\newcount\n
\n=1
\loop
\path ({i-\the\n}) coordinate (i\the\n);
\fill[black] (i\the\n) circle (2pt);
\draw[dashed] (i\the\n) -- (i\the\n |- 0,0);
\draw[dashed] (i\the\n) -- (0,0 -| i\the\n);
\advance\n by 1
\ifnum\n<5
\repeat