summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/macrolist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-07-18 20:25:02 +0000
committerKarl Berry <karl@freefriends.org>2021-07-18 20:25:02 +0000
commitc4a74847d2193721779800f07394a4bc67f3cbe2 (patch)
treecc49f3e8687d59606c67bcd907734f7cd6c7805a /Master/texmf-dist/tex/latex/macrolist
parent0ab1a48fc36a3cae860b6320503fd78bf46a9d6b (diff)
macrolist (18jul21)
git-svn-id: svn://tug.org/texlive/trunk@59980 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/macrolist')
-rw-r--r--Master/texmf-dist/tex/latex/macrolist/macrolist.sty31
1 files changed, 13 insertions, 18 deletions
diff --git a/Master/texmf-dist/tex/latex/macrolist/macrolist.sty b/Master/texmf-dist/tex/latex/macrolist/macrolist.sty
index 5d15abe6634..03cf5a54166 100644
--- a/Master/texmf-dist/tex/latex/macrolist/macrolist.sty
+++ b/Master/texmf-dist/tex/latex/macrolist/macrolist.sty
@@ -86,49 +86,44 @@
\csname themacrolist@list@#1\endcsname
}
\newcommand{\listforeach}[2]
-{
- \def\macrolist@foreachstart{0} % Reset
+{%
+ \def\macrolist@foreachstart{0}% Reset
% This is used to make optional arguments line up correctly
-
- \def\macrolist@start{1}
- \def\macrolist@end{\listsize{#1}}
- \def\macrolist@listname{#1}
- \def\macrolist@element{#2}
+ \def\macrolist@start{1}%
+ \def\macrolist@end{\listsize{#1}}%
+ \def\macrolist@listname{#1}%
+ \def\macrolist@element{#2}%
\macrolist@listforeachi
}
-\newcommand{\macrolist@listforeachi}[1][]{
+\newcommand{\macrolist@listforeachi}[1][]{%
\if\relax\detokenize{#1}\relax
\else
- \def\macrolist@start{#1}
- \def\macrolist@foreachstart{1}
+ \def\macrolist@start{#1}%
+ \def\macrolist@foreachstart{1}%
\fi
\macrolist@listforeachii
}
-\newcommand{\macrolist@listforeachii}[1][]{
+\newcommand{\macrolist@listforeachii}[1][]{%
\if\relax\detokenize{#1}\relax
\ifnum\macrolist@foreachstart=1
\PackageError{macrolist}{You must either pass in both a starting and ending position or neither}{}
\fi
\else
- \def\macrolist@end{#1}
+ \def\macrolist@end{#1}%
\fi
\macrolist@listforeachaction
}
-\newcommand{\macrolist@listforeachaction}[1]{
-
- \macrolist@exists{\macrolist@listname}
-
+\newcommand{\macrolist@listforeachaction}[1]{%
+ \macrolist@exists{\macrolist@listname}%
\ifnum\numexpr\macrolist@start\relax>\listsize{\macrolist@listname}%
\PackageError{macrolist}{The starting index of the loop is out of the bounds of list '\macrolist@listname'}{}
\fi
-
\ifnum\numexpr\macrolist@end\relax>\listsize{\macrolist@listname}
\PackageError{macrolist}{The ending index of the loop is out of the bounds of list '\macrolist@listname'}{}
\fi
-
\foreach \macrolist@index in {\the\numexpr\macrolist@start\relax, ..., \the\numexpr\macrolist@end\relax} {%
\expandafter\expandafter\expandafter\let\expandafter\expandafter\macrolist@element\csname macrolist@list@\macrolist@listname\macrolist@index\endcsname
#1%