summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/macrolist
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-07-18 03:00:52 +0000
committerNorbert Preining <norbert@preining.info>2021-07-18 03:00:52 +0000
commitba3d555da29f2da7ca04bf225218e22c8d12d7f8 (patch)
tree9445559f439b402707e57e21eca6516269741cf6 /macros/latex/contrib/macrolist
parent59d62d23cea172fbad8d928adf81755656d4e7e3 (diff)
CTAN sync 202107180300
Diffstat (limited to 'macros/latex/contrib/macrolist')
-rw-r--r--macros/latex/contrib/macrolist/README.md2
-rw-r--r--macros/latex/contrib/macrolist/macrolist.dtx64
-rw-r--r--macros/latex/contrib/macrolist/macrolist.pdfbin183759 -> 188569 bytes
3 files changed, 38 insertions, 28 deletions
diff --git a/macros/latex/contrib/macrolist/README.md b/macros/latex/contrib/macrolist/README.md
index ee73093939..61ac3d679d 100644
--- a/macros/latex/contrib/macrolist/README.md
+++ b/macros/latex/contrib/macrolist/README.md
@@ -1,4 +1,4 @@
-# The LaTeX package macrolist - version 1.0.0 (2021/07/12)
+# The LaTeX package macrolist - version 1.0.2 (2021/07/17)
> Copyright (C) 2021 Dennis Chen <proofprogram@gmail.com>
>
diff --git a/macros/latex/contrib/macrolist/macrolist.dtx b/macros/latex/contrib/macrolist/macrolist.dtx
index 9c0ee6eb62..7a564fc448 100644
--- a/macros/latex/contrib/macrolist/macrolist.dtx
+++ b/macros/latex/contrib/macrolist/macrolist.dtx
@@ -16,7 +16,7 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{macrolist}[2021/07/09 v1.0.0 Create lists of macros and perform operations on them]
+\ProvidesPackage{macrolist}[2021/07/16 v1.0.1 Create lists of macros and perform operations on them]
\RequirePackage{pgffor}
%</package>
@@ -30,16 +30,24 @@
\begin{document}
\DocInput{macrolist.dtx}
\PrintIndex
+ \PrintChanges
\end{document}
%</driver>
% \fi
-% \changes{v1.0.0}{2021/07/01}{Initial version}
+%
+% \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}
+% \changes{v1.0.1}{2021/07/16}{Fix v. appearing in front of date in document title}
+% \changes{v1.0.0}{2021/07/12}{Initial version}
%
% \GetFileInfo{macrolist.sty}
%
% \title{\textsf{macrolist} -- Create lists of macros and manipulate them}
% \author{Dennis Chen \\ proofprogram@gmail.com}
-% \date{\fileversion, v. \filedate\thanks{\url{https://github/com/chennisden/macrolist}}}
+% \date{\fileversion, \filedate\thanks{\url{https://github/com/chennisden/macrolist}}}
%
% \maketitle
%
@@ -49,6 +57,8 @@
%
% \section{Usage}
%
+% The scope of lists is always global. This seems to provide the most
+%
% \DescribeMacro{\newlist}
% To create a list, pass in |\newlist{listname}| to create a list with the name \textsf{listname}.
%
@@ -93,16 +103,16 @@
\stepcounter{macrolist@list@\macrolist@currlist}
\if\relax\detokenize{#1}\relax
- \expandafter\def\csname macrolist@list@\macrolist@currlist\listsize{\macrolist@currlist}\endcsname{#2}
+ \expandafter\gdef\csname macrolist@list@\macrolist@currlist\listsize{\macrolist@currlist}\endcsname{#2}
\else
\expandafter\ifnum\csname themacrolist@list@\macrolist@currlist\endcsname=#1
- \expandafter\def\csname macrolist@list@\macrolist@currlist\listsize{\macrolist@currlist}\endcsname{#2}
+ \expandafter\gdef\csname macrolist@list@\macrolist@currlist\listsize{\macrolist@currlist}\endcsname{#2}
\else
\macrolist@inbounds{\macrolist@currlist}{#1}
\foreach \macrolist@index in {\listsize{\macrolist@currlist}, ...,\the\numexpr #1+1\relax} {
\global\expandafter\let\csname macrolist@list@\macrolist@currlist\macrolist@index\expandafter\endcsname\csname macrolist@list@\macrolist@currlist\the\numexpr\macrolist@index-1\relax\endcsname
}
- \expandafter\def\csname macrolist@list@\macrolist@currlist#1\endcsname{#2}
+ \expandafter\gdef\csname macrolist@list@\macrolist@currlist#1\endcsname{#2}
\fi
\fi
}
@@ -123,7 +133,7 @@
}
\fi
- \expandafter\let\csname macrolist@list@#1\listsize{#1}\endcsname\relax
+ \global\expandafter\let\csname macrolist@list@#1\listsize{#1}\endcsname\relax
\addtocounter{macrolist@list@#1}{-1}
}
% \fi
@@ -135,7 +145,7 @@
% \iffalse
\newcommand{\listremovelast}[1]{
\macrolist@exists{#1}
- \expandafter\let\csname macrolist@list@#1\listsize{#1}\endcsname\relax
+ \global\expandafter\let\csname macrolist@list@#1\listsize{#1}\endcsname\relax
\addtocounter{macrolist@list@#1}{-1}
}
% \fi
@@ -149,7 +159,7 @@
\macrolist@inbounds{#1}{#2}
\foreach \macrolist@index in {1, ..., \listsize{#1}} {
- \expandafter\let\csname \macrolist@list@#1\macrolist@index\endcsname\relax
+ \global\expandafter\let\csname \macrolist@list@#1\macrolist@index\endcsname\relax
}
\setcounter{macrolist@list@#1}{0}
@@ -179,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%
diff --git a/macros/latex/contrib/macrolist/macrolist.pdf b/macros/latex/contrib/macrolist/macrolist.pdf
index c3e16e2634..1f5be69f8b 100644
--- a/macros/latex/contrib/macrolist/macrolist.pdf
+++ b/macros/latex/contrib/macrolist/macrolist.pdf
Binary files differ