diff options
author | Karl Berry <karl@freefriends.org> | 2021-08-01 20:37:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-08-01 20:37:02 +0000 |
commit | 9f6f0d1fd20f6010188013cbef1b8a9aa65576df (patch) | |
tree | 1a7379689544c8195450f9700f2746ee2e4bdce8 /Master/texmf-dist/tex/latex | |
parent | 65317a9dc9ff76702305df532d23e0c514b79ed7 (diff) |
macrolist (1aug21)
git-svn-id: svn://tug.org/texlive/trunk@60139 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/macrolist/macrolist.sty | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/latex/macrolist/macrolist.sty b/Master/texmf-dist/tex/latex/macrolist/macrolist.sty index 6d7dd6f5b4a..528a9020719 100644 --- a/Master/texmf-dist/tex/latex/macrolist/macrolist.sty +++ b/Master/texmf-dist/tex/latex/macrolist/macrolist.sty @@ -15,7 +15,7 @@ %% version 2005/12/01 or later. \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{macrolist}[2021/07/29 v2.0.0 Create lists of macros and perform operations on them] +\ProvidesPackage{macrolist}[2021/07/31 v2.1.0 Create lists of macros and perform operations on them] \RequirePackage{pgffor} @@ -86,6 +86,28 @@ \fi \fi } +\newcommand{\macrolisteadd}[1]{ + \macrolist@exists{#1} + \def\macrolist@currlist{#1} + \macrolist@listeadd +} +\newcommand{\macrolist@listeadd}[2][]{ + \stepcounter{macrolist@list@\macrolist@currlist} + + \if\relax\detokenize{#1}\relax + \expandafter\xdef\csname macrolist@list@\macrolist@currlist\macrolistsize{\macrolist@currlist}\endcsname{#2} + \else + \expandafter\ifnum\csname themacrolist@list@\macrolist@currlist\endcsname=#1 + \expandafter\gdef\csname macrolist@list@\macrolist@currlist\macrolistsize{\macrolist@currlist}\endcsname{#2} + \else + \macrolist@inbounds{\macrolist@currlist}{#1} + \foreach \macrolist@index in {\macrolistsize{\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\xdef\csname macrolist@list@\macrolist@currlist#1\endcsname{#2} + \fi + \fi +} \newcommand{\macrolistremove}[2]{ \macrolist@inbounds{#1}{#2} |