I have the following problem: Into a \pgfdeclareshape I have the following code for a saved dimension:
\saveddimen{\long@sal}{
\pgf@x=\pgfkeysvalueof{/tikz/longitud salidas}\unidad@medicion
\advance\pgf@x\y@colect
}
Then, when I try to use in:
\foreach \n in {1,...,7}{
\xdef\doanchor{
\noexpand\anchor{o\n}{
\@tempdima=2\x@colect % \sep@sal
\divide\@tempdima\pgfkeysvalueof{/tikz/salidas}
\noexpand\pgfpoint{
-\x@colect + 0.5\@tempdima + (\n-1)*\@tempdima
}{\long@sal}
}
}
\doanchor
}
I get the error: ! Undefined control sequence.
The problem is due to \long@sal, I'm sure. Please, someone can help me?
\foreachis executed in a group, so nothing local is persistent between iterations. You have different choices, for example: define things globally, or use a loop from another package. – Kpym Mar 19 '19 at 19:56\loop \repeattex and it doesn't work. Defining globaly\long@salneither works because its value can't be modified into\pgfdeclareshape. – aguivald Mar 19 '19 at 22:22\newdimen\long@salbefore\pfgdeclareshape. – aguivald Mar 20 '19 at 04:43