summaryrefslogtreecommitdiff
path: root/graphics/pgf/base/doc/text-en/pgfmanual-en-pgffor.tex
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf/base/doc/text-en/pgfmanual-en-pgffor.tex')
-rw-r--r--graphics/pgf/base/doc/text-en/pgfmanual-en-pgffor.tex21
1 files changed, 21 insertions, 0 deletions
diff --git a/graphics/pgf/base/doc/text-en/pgfmanual-en-pgffor.tex b/graphics/pgf/base/doc/text-en/pgfmanual-en-pgffor.tex
index 34f3aab738..94a41fbfe2 100644
--- a/graphics/pgf/base/doc/text-en/pgfmanual-en-pgffor.tex
+++ b/graphics/pgf/base/doc/text-en/pgfmanual-en-pgffor.tex
@@ -372,6 +372,27 @@ This section describes the package |pgffor|, which is loaded automatically by
\end{codeexample}
%
\end{key}
+
+ \begin{key}{/pgf/foreach/expand list=\marg{boolean} (default false)}
+ If this key is set to true the contents of the list are fully expanded
+ with |\edef| before further processing. This allows using complex
+ macros which generate a list upon expansion without having to use an
+ intermediate macro.
+ %
+\begin{codeexample}[]
+\def\Iota#1#2{%
+ \ifnum\numexpr#1\relax<\numexpr#2\relax
+ \the\numexpr#1\relax,%
+ \expandafter\Iota\expandafter{\the\numexpr(#1)+1\relax}{#2}%
+ \else
+ \the\numexpr#2\relax
+ \fi}
+\foreach [expand list=true] \x in {\Iota{1}{5}} {
+ \x
+}
+\end{codeexample}
+ %
+ \end{key}
\end{command}
\begin{command}{\breakforeach}