diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/caption/caption3.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/caption/caption3.sty | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/Master/texmf-dist/tex/latex/caption/caption3.sty b/Master/texmf-dist/tex/latex/caption/caption3.sty index f02d4dca24b..aa618a68df9 100644 --- a/Master/texmf-dist/tex/latex/caption/caption3.sty +++ b/Master/texmf-dist/tex/latex/caption/caption3.sty @@ -45,7 +45,7 @@ \DeclareRelease{v1.13}{2019-11-24}{caption3_2020-07-29.sty} % for caption v3.4 \DeclareRelease{v2.0} {2020-08-30}{caption3_2020-10-26.sty} % for caption v3.5 \DeclareCurrentRelease{v2.3}{2022-02-20} % for caption v3.6 -\ProvidesPackage{caption3}[2023/07/28 v2.4c caption3 kernel (AR)] +\ProvidesPackage{caption3}[2023/07/31 v2.4d caption3 kernel (AR)] \@ifundefined{kernel@ifnextchar}{\let\kernel@ifnextchar\@ifnextchar}{} \providecommand*\@nameundef[1]{% \expandafter\let\csname #1\endcsname\@undefined} @@ -167,6 +167,12 @@ \expandafter\caption@tempb\expandafter{\caption@tempa}} \DeclareRobustCommand*\caption@gobble{% \caption@withoptargs\@gobbletwo} +\newcommand\caption@iftokens[1]{% + \if\relax\detokenize{#1}\relax + \expandafter\@secondoftwo + \else + \expandafter\@firstoftwo + \fi} \let\caption@begindocumenthook\@empty \let\caption@@begindocumenthook\@empty \def\caption@AtBeginDocument{% @@ -540,18 +546,12 @@ #1{\caption@width\z@}% \caption@@@@setmargin#2,#2,\@nil} \def\caption@@@@setmargin#1,#2,#3\@nil{% - \def\caption@tempa{#1#2}% - \ifx\caption@tempa\@empty - \caption@Error{Missing number}% - \else - \caption@@@@@setmargin{left}{#1}% - \caption@@@@@setmargin{right}{#2}% - \fi} + \caption@iftokens{#1#2}% + {\caption@@@@@setmargin{left}{#1}% + \caption@@@@@setmargin{right}{#2}}% + {\caption@Error{Missing number}}} \newcommand*\caption@@@@@setmargin[2]{% - \def\caption@tempa{#2}% - \ifx\caption@tempa\@empty \else - \caption@setlength{#1margin}{#2}% - \fi} + \caption@iftokens{#2}{\caption@setlength{#1margin}{#2}}{}} \newcommand*\caption@setwidth{% \caption@resetcalcmargin \caption@@setwidth} @@ -788,12 +788,7 @@ \caption@get@label#1\caption@makeanchor{}\@nil \caption@thelabel\caption@clrlabel} \long\def\caption@get@label#1\caption@makeanchor#2#3\@nil{% - \def\caption@tempa{#2}% - \ifx\caption@tempa\@empty - \caption@getlabel{#1}% - \else - \caption@getlabel{#2}% - \fi} + \caption@iftokens{#2}{\caption@getlabel{#2}}{\caption@getlabel{#1}}} \DeclareCaptionTextFormat{simple}{#1} \DeclareCaptionTextFormat{period}{#1.} \SetCaptionDefault{textformat}{simple} @@ -1818,12 +1813,9 @@ \fi} \@onlypreamble\caption@@declaresublistentry \long\def\caption@@@declaresublistentry#1\@dottedtocline#2\caption@nil#3{% - \def\@tempa{#1}% - \ifx\@tempa\@empty - \caption@@@@declaresublistentry{#3}#2\caption@nil - \else - \caption@@@@declaresublistentry{#3}@{3.8em}{3.2em}\caption@nil - \fi} + \caption@iftokens{#1}% + {\caption@@@@declaresublistentry{#3}@{3.8em}{3.2em}\caption@nil}% + {\caption@@@@declaresublistentry{#3}#2\caption@nil}} \@onlypreamble\caption@@@declaresublistentry \def\caption@@@@declaresublistentry#1#2#3#4#5\caption@nil{% \expandafter\caption@@@@@declaresublistentry\expandafter |