diff options
author | Karl Berry <karl@freefriends.org> | 2021-07-18 20:25:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-07-18 20:25:02 +0000 |
commit | c4a74847d2193721779800f07394a4bc67f3cbe2 (patch) | |
tree | cc49f3e8687d59606c67bcd907734f7cd6c7805a /Master/texmf-dist/source/latex/macrolist | |
parent | 0ab1a48fc36a3cae860b6320503fd78bf46a9d6b (diff) |
macrolist (18jul21)
git-svn-id: svn://tug.org/texlive/trunk@59980 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/macrolist')
-rw-r--r-- | Master/texmf-dist/source/latex/macrolist/macrolist.dtx | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/Master/texmf-dist/source/latex/macrolist/macrolist.dtx b/Master/texmf-dist/source/latex/macrolist/macrolist.dtx index beaadec98dc..7a564fc4485 100644 --- a/Master/texmf-dist/source/latex/macrolist/macrolist.dtx +++ b/Master/texmf-dist/source/latex/macrolist/macrolist.dtx @@ -30,9 +30,13 @@ \begin{document} \DocInput{macrolist.dtx} \PrintIndex + \PrintChanges \end{document} %</driver> % \fi +% +% \changes{v1.0.2}{2021/07/17}{Print changelog in documentation} +% \changes{v1.0.2}{2021/07/17}{Added comment markers to remove pars and fix spacing in listforeach} % \changes{v1.0.1}{2021/07/16}{Make a couple of defs and lets global to prevent scoping issues} % \changes{v1.0.1}{2021/07/16}{Add ``scope is always global'' to documentation} % \changes{v1.0.1}{2021/07/16}{Fix date in initial version changes entry} @@ -185,49 +189,49 @@ % % \iffalse \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% |