diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/labelcas/labelcas.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/labelcas/labelcas.sty | 91 |
1 files changed, 44 insertions, 47 deletions
diff --git a/Master/texmf-dist/tex/latex/labelcas/labelcas.sty b/Master/texmf-dist/tex/latex/labelcas/labelcas.sty index 71dc998e541..dc542bd871d 100644 --- a/Master/texmf-dist/tex/latex/labelcas/labelcas.sty +++ b/Master/texmf-dist/tex/latex/labelcas/labelcas.sty @@ -20,12 +20,12 @@ %% and version 1.3 or later is part of all distributions of LaTeX version %% 2003/12/01 or later. %% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\NeedsTeXFormat{LaTeX2e} \ProvidesPackage{labelcas} - [2006/04/27 v1.07 check label-existence and fork accordingly] + [2006/08/14 v1.12 check label-existence and fork accordingly] +\begingroup \DeclareOption{DefineLabelcase}% {\global\let\DefineLabelcase\DefineLabelcase}% -\begingroup \newcommand\DefineLabelcase[4]{% \expandafter\@ifdefinable\csname#3lc@remtrailspace\endcsname{% \expandafter\long @@ -40,7 +40,17 @@ \else \expandafter\@secondoftwo \fi - {\csname#3lc@remleadspace\endcsname#2##1#1#2#2}% + {% + {\toks@{##1}\edef\@tempa{\the\toks@}% + \toks@{#2}\edef\@tempb{\the\toks@}% + \expandafter}% + \ifx\@tempa\@tempb + \expandafter\@gobble + \else + \expandafter\@firstofone + \fi + {\csname#3lc@remleadspace\endcsname#2##1#1#2#2}% + }% {\csname#3lc@remtrailspace\endcsname##1#2#1#2#2#1}% }% }% @@ -65,31 +75,20 @@ \expandafter\long \expandafter\def \csname#3lc@iterate\endcsname##1#2{% - \toks@{#1}% \begingroup - \long\def\@tempa#2####1#2{\toks@{####1}\edef\@tempa{\the\toks@}}% - \csname#3lc@remleadspace\endcsname#2##1#2#1#2#2% \toks@{##1}% - \edef\@tempb{\the\toks@}% + \edef\@tempa{\the\toks@}% \toks@{#1\@nil}% - \edef\@tempc{\the\toks@}% - \toks@{\csname#3lc@remtrailspace\endcsname##1#2#1#2#2#1}% - \edef\@tempd{\the\toks@}% - \ifx\@tempb\@tempc - \expandafter\endgroup + \edef\@tempb{\the\toks@}% + \expandafter\endgroup\ifx\@tempa\@tempb + \expandafter\@gobble \else - \ifx\@tempa\@empty - \expandafter\endgroup - \else - \expandafter\expandafter - \expandafter \endgroup - \expandafter\@tempd - \fi - \csname#3lc@iterate\expandafter\expandafter - \expandafter\endcsname - \expandafter\the - \expandafter\toks@ + \expandafter\@firstofone \fi + {% + \csname#3lc@remtrailspace\endcsname##1#2#1#2#2#1% + \csname#3lc@iterate\endcsname#1% + }% }% }% \expandafter\@ifdefinable\csname#3eachlabelcase\endcsname{% @@ -189,29 +188,27 @@ \ifx\@tempa\@empty \else \@temptokena\expandafter{% - \expandafter\begingroup - \expandafter\toks@ - \expandafter\expandafter - \expandafter {% - \expandafter\expandafter - \expandafter \@temptokena - \expandafter\expandafter - \expandafter {% - \expandafter\the - \expandafter\@temptokena - \expandafter}% - \expandafter}% - \expandafter\@temptokena - \expandafter{% - \expandafter\@temptokena - \expandafter{% - \the\@temptokena}% - \@ifdefinable#1{\edef#1{\the\@temptokena}}}% - \expandafter\expandafter - \expandafter \endgroup - \expandafter\the - \expandafter\@temptokena - \the\toks@ + \expandafter\begingroup + \expandafter\toks@ + \expandafter\expandafter + \expandafter {% + \expandafter\expandafter + \expandafter \@temptokena + \expandafter\expandafter + \expandafter {% + \expandafter\the + \expandafter\@temptokena + \expandafter}% + \expandafter}% + \expandafter\@temptokena + \expandafter{% + \expandafter\@temptokena + \expandafter{% + \the\@temptokena}% + \@ifdefinable#1{\edef#1{\the\@temptokena}}}% + \expandafter\endgroup + \the\expandafter\@temptokena + \the\toks@ }% \fi }% |