summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/pgfplots/tex/pgfplotsutil.code.tex
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf/contrib/pgfplots/tex/pgfplotsutil.code.tex')
-rw-r--r--graphics/pgf/contrib/pgfplots/tex/pgfplotsutil.code.tex22
1 files changed, 22 insertions, 0 deletions
diff --git a/graphics/pgf/contrib/pgfplots/tex/pgfplotsutil.code.tex b/graphics/pgf/contrib/pgfplots/tex/pgfplotsutil.code.tex
index 353a04ea94..5a014d44f2 100644
--- a/graphics/pgf/contrib/pgfplots/tex/pgfplotsutil.code.tex
+++ b/graphics/pgf/contrib/pgfplots/tex/pgfplotsutil.code.tex
@@ -412,6 +412,28 @@
\pgfplotslistcopy\pgfplots@glob@TMPa\to#2\relax
}
+% converts a foreach list to a fully expanded comma-separated list and assigns the result to \pgfplotsretval
+\long\def\pgfplots@foreach@to@list@macro#1{%
+ \begingroup
+ \pgfplotsapplistXnewempty\pgfplots@tmpa
+ \pgfplots@loc@tmptrue
+ \pgfkeys{/pgf/fpu}%
+ %
+ \pgfplotsforeachungrouped \pgfplots@i in {#1} {%
+ \ifpgfplots@loc@tmp
+ \pgfplots@loc@tmpfalse
+ \else
+ \pgfplotsapplistXpushback,\to\pgfplots@tmpa
+ \fi
+ \pgfmathfloattosci\pgfplots@i
+ \expandafter\pgfplotsapplistXpushback\pgfmathresult\to\pgfplots@tmpa
+ }%
+ \pgfplotsapplistXlet\pgfplots@loc@TMPa=\pgfplots@tmpa
+ \global\let\pgfplots@glob@TMPa=\pgfplots@loc@TMPa
+ \endgroup
+ \let\pgfplotsretval=\pgfplots@glob@TMPa
+}
+
% Removes duplicates in a comma separated list and creates a new list
% into the macro \pgfplotsretval. The list doesn't need to be sorted,