summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/caption/caption3.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/caption/caption3.sty')
-rw-r--r--Master/texmf-dist/tex/latex/caption/caption3.sty101
1 files changed, 55 insertions, 46 deletions
diff --git a/Master/texmf-dist/tex/latex/caption/caption3.sty b/Master/texmf-dist/tex/latex/caption/caption3.sty
index f6e1f859bab..1957aa5167c 100644
--- a/Master/texmf-dist/tex/latex/caption/caption3.sty
+++ b/Master/texmf-dist/tex/latex/caption/caption3.sty
@@ -6,7 +6,7 @@
%%
%% caption3.dtx (with options: `package')
%%
-%% Copyright (C) 1994-2022 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%% Copyright (C) 1994-2023 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
%%
%% https://gitlab.com/axelsommerfeldt/caption
%%
@@ -45,7 +45,8 @@
\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}[2022/03/17 v2.3b caption3 kernel (AR)]
+\ProvidesPackage{caption3}[2023/03/12 v2.4 caption3 kernel (AR)]
+\@ifundefined{kernel@ifnextchar}{\let\kernel@ifnextchar\@ifnextchar}{}
\providecommand*\@nameundef[1]{%
\expandafter\let\csname #1\endcsname\@undefined}
\providecommand\l@addto@macro[2]{%
@@ -155,7 +156,7 @@
{\def\caption@tempa{*}\caption@@withoptargs{#1}}%
{\def\caption@tempa{}\caption@@withoptargs{#1}}}
\def\caption@@withoptargs#1{%
- \@ifnextchar[%]
+ \kernel@ifnextchar[%]
{\caption@@@withoptargs{#1}}%
{\caption@@@@withoptargs{#1}}}
\def\caption@@@withoptargs#1[#2]{%
@@ -234,28 +235,27 @@
\KV@err{No value allowed for #1}%
\expandafter\@gobble
\fi}
-\newif\ifcaptionsetup@star
\newcommand*\captionsetup{%
\caption@teststar@\@captionsetup\@gobble\@firstofone}
\newcommand*\@captionsetup[1]{%
- \captionsetup@startrue#1\captionsetup@starfalse
- \@ifnextchar[%]
- \caption@setup@options\caption@setup}
+ \kernel@ifnextchar[%]
+ {\caption@setup@options#1}%
+ {\caption@setup}}
\newcommand*\caption@setup{%
\caption@setkeys{caption}}
-\def\caption@setup@options[#1]{%
- \@ifnextchar[%]
+\def\caption@setup@options#1[#2]{%
+ \kernel@ifnextchar[%]
{\caption@stepthecounter
- \@expandtwoargs\caption@setup@options@@{#1}{@\caption@thecounter}}%
- {\caption@setup@options@{#1}}}
-\def\caption@setup@options@@#1#2[#3]#4{%
- \caption@declare@option{#2}[]{\caption@setup@options@{#3}{#4}}%
- \caption@setup@options@{#1}{#2}}
-\newcommand*\caption@setup@options@[2]{%
+ \@expandtwoargs\caption@setup@options@@{#2}{@\caption@thecounter}#1}%
+ {\caption@setup@options@#1{#2}}}
+\def\caption@setup@options@@#1#2#3[#4]#5{%
+ \caption@declare@option{#2}[]{\caption@setup@options@\@gobble{#4}{#5}}%
+ \caption@setup@options@#3{#1}{#2}}
+\newcommand*\caption@setup@options@[3]{%
\@bsphack
- \ifcaptionsetup@star\captionsetup@starfalse\else\caption@addtooptlist{#1}\fi
- \caption@checkoptions{#2}%
- \expandafter\caption@l@addto@list\csname caption@opt@#1\endcsname{#2}%
+ #1{\caption@addtooptlist{#2}}%
+ \caption@checkoptions{#3}%
+ \expandafter\caption@l@addto@list\csname caption@opt@#2\endcsname{#3}%
\@esphack}
\newcommand*\caption@checkoptions[1]{%
\begingroup
@@ -363,7 +363,6 @@
\expandafter\let\expandafter\KV@err\csname ORI@KV@err\caption@keydepth\endcsname
\expandafter\let\expandafter\KV@errx\csname ORI@KV@errx\caption@keydepth\endcsname
\expandafter\let\expandafter\XKV@err\csname ORI@XKV@err\caption@keydepth\endcsname
- \ifx\caption@keydepth\@empty \captionsetup@starfalse \fi
\@esphack}
\let\caption@keydepth\@empty
\newcommand*\caption@ExecuteOptions[2]{%
@@ -480,7 +479,7 @@
{\caption@@set{#1}{#2@fallback}{#3}}}
\@onlypreamble\caption@@setfallback
\newcommand*\caption@decl@package[2]{%
- \@ifnextchar[%]
+ \kernel@ifnextchar[%]
{\caption@declare@package{#1}{#2}}%
{\caption@declarepackage{#1}{#2}}}
\@onlypreamble\caption@decl@package
@@ -577,7 +576,8 @@
\newcommand*\caption@stepthecounter{%
\@tempcnta\caption@thecounter
\advance\@tempcnta\@ne\relax
- \xdef\caption@thecounter{\the\@tempcnta}}
+ \xdef\caption@thecounter{\the\@tempcnta}%
+ \global\let\caption@ifoddpage\caption@ifoddpage@}
\newcommand*\caption@newlabel{\@newl@bel{caption@r}}
\newcommand*\caption@thepage{\the\c@page}
\newcommand*\caption@label[1]{%
@@ -591,20 +591,20 @@
\newcommand*\caption@pageref[1]{%
\expandafter\ifx\csname caption@r@#1\endcsname\relax
\G@refundefinedtrue % => 'There are undefined references.'
- \@latex@warning{Reference `#1' on page \thepage \space undefined}%
+ \@latex@warning{Reference `caption@#1' on page \thepage \space undefined}%
\else
\expandafter\let\expandafter\caption@thepage\csname caption@r@#1\endcsname
\fi}
-\newcommand*\caption@ifoddpage{%
+\newcommand*\caption@ifoddpage@{%
\caption@iftwoside{%
\caption@label\caption@thecounter
\caption@pageref\caption@thecounter
\ifodd\caption@thepage
- \let\caption@ifoddpage\@firstoftwo
+ \global\let\caption@ifoddpage\@firstoftwo
\else
- \let\caption@ifoddpage\@secondoftwo
+ \global\let\caption@ifoddpage\@secondoftwo
\fi
- }{\let\caption@ifoddpage\@firstoftwo}%
+ }{\global\let\caption@ifoddpage\@firstoftwo}%
\caption@ifoddpage}
\newcommand*\caption@setoptcmd[2]{%
\caption@ifinlist{#2}{0,false,no,off}{\let#1\@undefined}{\def#1{#2}}}
@@ -1607,36 +1607,36 @@
\let\glsunset\@gobble
}
\newcommand*\caption@footnote{%
- \@ifnextchar[%]
+ \kernel@ifnextchar[%]
\@xfootnote
{\caption@l@stepcounter\@mpfn
\protected@xdef\@thefnmark{\thempfn}%
\@footnotemark\@footnotetext}}
\newcommand*\caption@footnotemark{%
- \@ifnextchar[%]
+ \kernel@ifnextchar[%]
\@xfootnotemark
{\caption@l@stepcounter{footnote}%
\protected@xdef\@thefnmark{\thefootnote}%
\@footnotemark}}
\newcommand*\caption@footnotetext{%
- \@ifnextchar[%]
+ \kernel@ifnextchar[%]
\@xfootnotenext
{\protected@xdef\@thefnmark{\thempfn}%
\@footnotetext}}
\newcommand*\caption@endnote{%
- \@ifnextchar[%]
+ \kernel@ifnextchar[%]
\@xendnote
{\caption@l@stepcounter{endnote}%
\protected@xdef\@theenmark{\theendnote}%
\@endnotemark\@endnotetext}}
\newcommand*\caption@endnotemark{%
- \@ifnextchar[%]
+ \kernel@ifnextchar[%]
\@xendnotemark
{\caption@l@stepcounter{endnote}%
\protected@xdef\@theenmark{\theendnote}%
\@endnotemark}}
\newcommand*\caption@endnotetext{%
- \@ifnextchar[%]
+ \kernel@ifnextchar[%]
\@xendnotenext
{\protected@xdef\@theenmark{\theendnote}%
\@endnotetext}}
@@ -1761,7 +1761,7 @@
\caption@teststar\caption@declaresubtype\@firstoftwo\@secondoftwo}
\@onlypreamble\DeclareCaptionSubType
\newcommand*\caption@declaresubtype[1]{%
- \@testopt{\caption@@declaresubtype{#1}}{alph}}
+ \@testopt{\caption@@declaresubtype#1}{alph}}
\@onlypreamble\caption@declaresubtype
\def\caption@@declaresubtype#1[#2]#3{%
\@ifundefined{c@#3}%
@@ -1770,23 +1770,26 @@
\@onlypreamble\caption@@declaresubtype
\newcommand*\caption@@@declaresubtype[4]{%
\caption@ifdefined@subtype{#4}%
- {\caption@Debug{Modify subtype `#4'}}%
- {\caption@Debug{New subtype `#4'}%
- \newcounter{#4}[{#3}]%
- \@namedef{ext@#4}{\csname ext@#3\endcsname}%
- \caption@declaresublistentry{#3}%
- \caption@l@addto@list\caption@subtypelist{#4}%
- \caption@subtype@hook{#4}}%
- \caption@ifdefined\contentsuse{%
- \contentsuse{#4}{\csname ext@#4\endcsname}}{}%
- \@namedef{#4name}{}%
- \@namedef{#4autorefname}{\csname #3autorefname\endcsname}%
- #1% is \@firstoftwo in star form, and \@secondoftwo otherwise
+ {\caption@Info{Modify subtype `#4'}}%
+ {\caption@Info{New subtype `#4'}%
+ \@ifundefined{c@#4}%
+ {\newcounter{#4}[#3]%
+ \@namedef{#4name}{}%
+ \@namedef{#4autorefname}{\csname #3autorefname\endcsname}%
+ \@namedef{ext@#4}{\csname ext@#3\endcsname}%
+ \caption@declaresublistentry{#3}%
+ \caption@ifdefined\contentsuse{%
+ \contentsuse{#4}{\csname ext@#4\endcsname}}{}%
+ \caption@l@addto@list\caption@subtypelist{#4}%
+ \caption@subtype@hook{#4}}%
+ {\caption@subtypesource\caption@subtype@source{#4}%
+ \caption@Error{The counter `#4' was already defined by\MessageBreak\caption@subtype@source}}}%
+ #1% is \@firstoftwo in star form, and \@secondoftwo otherwise
{\@namedef{p@#4}{}%
\@namedef{the#4}{\csname the#3\endcsname.\@nameuse{#2}{#4}}}%
{\@namedef{p@#4}{\csname the#3\endcsname}%
\@namedef{the#4}{\@nameuse{#2}{#4}}}%
- \@namedef{theH#4}{\csname theH#3\endcsname.\arabic{#4}}}
+ \@namedef{theH#4}{\csname theH#3\endcsname.\arabic{#4}}}
\@onlypreamble\caption@@@declaresubtype
\newcommand*\caption@declaresublistentry{%
\caption@ifdefined\l@chapter
@@ -1833,6 +1836,12 @@
\newcommand*\caption@subtypelist{}
\newcommand*\caption@ifdefined@subtype{%
\caption@ifin@list\caption@subtypelist}
+\newcommand*\caption@subtypesource[2]{%
+ \caption@ifdefined@subtype{#2}%
+ {\def#1{\noexpand\DeclareCaptionSubType (offered by the caption package)}}%
+ {\caption@ifin@list\sf@counterlist{#2}%
+ {\def#1{\noexpand\newsubfloat (offered by the subfig package)}}%
+ {\def#1{an unknown document class or package}}}}
\newcommand*\ForEachCaptionSubType{%
\@ifstar
{\caption@foreach@subtype\@gobble}%