diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/macrolist/macrolist.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/macrolist/macrolist.sty | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/latex/macrolist/macrolist.sty b/Master/texmf-dist/tex/latex/macrolist/macrolist.sty index 36397cc9175..1fd3fe0f32d 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/23 v1.2.0 Create lists of macros and perform operations on them] +\ProvidesPackage{macrolist}[2021/07/25 v1.2.1 Create lists of macros and perform operations on them] \RequirePackage{pgffor} @@ -35,24 +35,28 @@ \newcommand{\listindexof}[2]{% \def\macrolist@listindex{0}% \macrolist@exists{#1}% - \def\macrolist@el{#2}% - \listforeach{#1}{\macrolist@listindexel}[\listsize{#1}][1]{% - \ifx\macrolist@el\macrolist@listindexel - \xdef\macrolist@listindex{\macrolist@index}% - \fi - }% + \ifnum\listsize{#1}>0\relax + \def\macrolist@el{#2}% + \listforeach{#1}{\macrolist@listindexel}[\listsize{#1}][1]{% + \ifx\macrolist@el\macrolist@listindexel + \xdef\macrolist@listindex{\macrolist@index}% + \fi + }% + \fi \macrolist@listindex% \let\macrolist@listindex\relax% } \newcommand{\listcontains}[4]{% \def\macrolist@listindex{0}% \macrolist@exists{#1}% - \def\macrolist@el{#2}% - \listforeach{#1}{\macrolist@listindexel}[\listsize{#1}][1]{% - \ifx\macrolist@el\macrolist@listindexel - \xdef\macrolist@listindex{\macrolist@index}% - \fi - }% + \ifnum\listsize{#1}>0\relax + \def\macrolist@el{#2}% + \listforeach{#1}{\macrolist@listindexel}[\listsize{#1}][1]{% + \ifx\macrolist@el\macrolist@listindexel + \xdef\macrolist@listindex{\macrolist@index}% + \fi + }% + \fi \ifnum\macrolist@listindex>0\relax #3% \else |