Skip to content

Commit

Permalink
Keys for remembering macros/dimensions in foreach interations
Browse files Browse the repository at this point in the history
The keys are `remember macro` and `remember dimension`.

Also `\tikz@foreach` was erroneously called `\tikz@patched@foreach`
(copied from my original testing file).

Signed-off-by: Andrew Stacey <[email protected]>
  • Loading branch information
loopspace committed Apr 2, 2024
1 parent 7eb346a commit 5fb6ca9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tex/generic/pgf/frontendlayer/tikz/tikz.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2580,6 +2580,11 @@

\def\tikz@fchar oreach{\tikz@foreach}%


%
% These are to allow \foreach to remember macros and dimensions between iterations
%

\def\tikzforeach@smugglers@cove{}
\let\tikztostart=\relax

Expand Down Expand Up @@ -2622,8 +2627,16 @@
%
}

\tikzset{
remember macro/.code={
\tikzforeach@smuggle@macro#1
},
remember dimension/.code={
\tikzforeach@smuggle@dimen#1
}
}

\def\tikz@patched@foreach{%
\def\tikz@foreach{%
\def\pgffor@beginhook{%
\tikzforeach@smugglers@cove%
\gdef\tikzforeach@smugglers@cove{}%
Expand Down

0 comments on commit 5fb6ca9

Please sign in to comment.