summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/xfor/xfor.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/xfor/xfor.sty')
-rw-r--r--Master/texmf-dist/tex/latex/xfor/xfor.sty10
1 files changed, 9 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/latex/xfor/xfor.sty b/Master/texmf-dist/tex/latex/xfor/xfor.sty
index b1992383595..77a81d5fe86 100644
--- a/Master/texmf-dist/tex/latex/xfor/xfor.sty
+++ b/Master/texmf-dist/tex/latex/xfor/xfor.sty
@@ -26,12 +26,14 @@
%% Right bracket \] Circumflex \^ Underscore \_
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
+%% last iteration
+%% not last iteration
%% store new list in \toks@
%% test current value against new value
%% append new stuff to new list
%% check to see if for loop was prematurely terminated
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{xfor}[2007/07/11 v1.01 (NLCT)]
+\ProvidesPackage{xfor}[2007/08/16 v1.02 (NLCT)]
\newif\if@endfor
\long\def\@for#1:=#2\do#3{%
\@endforfalse
@@ -47,6 +49,7 @@
\def#4{#1}%
\ifx#4\@nnil
\else
+ \@xfor@storenext#2,#3\@@%
#5%
\if@endfor
\@iforgatherrest#2,#3%
@@ -54,6 +57,7 @@
\def#4{#2}%
\ifx#4\@nnil
\else
+ \@xfor@storenext#3,\@nil\@@%
#5%
\if@endfor
\@iforgatherrest#3%
@@ -64,6 +68,9 @@
\fi
\fi
}
+\def\@xfor@storenext#1,#2\@@{%
+\def\@xfor@nextelement{#1}%
+}
\long\def\@forgatherrest#1,\@nil,\@nil{\def\@forremainder{#1}}
\long\def\@iforgatherrest#1\@nil,\@nil{%
\def\@fortmp{#1}%
@@ -78,6 +85,7 @@
\ifx#3\@nnil
\let\@ifornext\@fornoop
\else
+ \@xfor@storenext#2,\@nil\@@%
#4\relax
\if@endfor
\@iforgatherrest#2\relax