diff --git a/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex b/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex index 31202cddb..f50463f0e 100644 --- a/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex +++ b/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex @@ -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 @@ -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{}%