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.sty71
1 files changed, 48 insertions, 23 deletions
diff --git a/Master/texmf-dist/tex/latex/caption/caption3.sty b/Master/texmf-dist/tex/latex/caption/caption3.sty
index 4bc31c25115..7d89e2f142e 100644
--- a/Master/texmf-dist/tex/latex/caption/caption3.sty
+++ b/Master/texmf-dist/tex/latex/caption/caption3.sty
@@ -28,7 +28,7 @@
%% caption-eng.tex, and caption-rus.tex.
%%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption3}[2007/09/22 v3.1b caption3 kernel (AR)]
+\ProvidesPackage{caption3}[2007/10/17 v3.1c caption3 kernel (AR)]
\providecommand*\@nameundef[1]{%
\expandafter\let\csname #1\endcsname\@undefined}
\providecommand\l@addto@macro[2]{%
@@ -153,12 +153,16 @@
\caption@@begindocumenthook
\let\caption@@begindocumenthook\@undefined
\PackageInfo{caption}{End \noexpand\AtBeginDocument code\@gobble}}
+\newcommand*\caption@Warning[1]{\caption@WarningNoLine{#1\on@line}}
+\newcommand*\caption@WarningNoLine[1]{\PackageWarning{caption}{#1.^^J\caption@wh\@gobbletwo}}
\newcommand*\caption@Error[1]{\PackageError{caption}{#1}\caption@eh}
\let\caption@KV@err\caption@Error
+\newcommand*\caption@wh{%
+ See the caption package documentation for explanation.}
\newcommand*\caption@eh{%
If you do not understand this error, please take a closer look\MessageBreak
- at the documentation of the `caption' package.\MessageBreak
- \@ehc}
+ at the documentation of the `caption' package, especially the\MessageBreak
+ section about errors.\MessageBreak\@ehc}
\RequirePackage{keyval}[1997/11/10]
\providecommand*\undefine@key[2]{%
\@nameundef{KV@#1@#2}\@nameundef{KV@#1@#2@default}}
@@ -171,6 +175,20 @@
\newcommand*\caption@declareoption[2]{%
#1{\undefine@key{caption}{#2}}\define@key{caption}{#2}}
\@onlypreamble\caption@declareoption
+\newcommand*\DeclareCaptionOptionNoValue{%
+ \caption@teststar\caption@declareoption@novalue\AtEndOfPackage\@gobble}
+\@onlypreamble\DeclareCaptionOptionNoValue
+\newcommand\caption@declareoption@novalue[3]{%
+ \caption@declareoption{#1}{#2}[\KV@err]{%
+ \caption@option@novalue{#2}{##1}{#3}}}
+\@onlypreamble\caption@declareoption@novalue
+\newcommand*\caption@option@novalue[2]{%
+ \ifx\KV@err#2%
+ \expandafter\@firstofone
+ \else
+ \KV@err{No value allowed for #1}%
+ \expandafter\@gobble
+ \fi}
\newcommand*\captionsetup{%
\caption@teststar\@captionsetup\@gobble\@firstofone}
\newcommand*\@captionsetup[1]{%
@@ -187,7 +205,7 @@
\@testopt\@@clearcaptionsetup{}}
\def\@@clearcaptionsetup[#1]#2{%
\expandafter\caption@ifempty@list\csname caption@opt@#2\endcsname
- {\caption@tempa{\PackageWarning{caption}{Option list `#2' undefined}}}%
+ {\caption@tempa{\caption@Warning{Option list `#2' undefined}}}%
{\ifx,#1,%
\caption@clearsetup{#2}%
\else
@@ -215,9 +233,8 @@
\fi}%
\expandafter\caption@ifempty@list\csname caption@opt@#2\endcsname
{\caption@removefromoptlist{#2}}{}%
- \caption@tempa{%
- \PackageWarning{caption}{%
- Option `#1' was not in list `#2'\MessageBreak}}}
+ \caption@tempa{\caption@Warning{%
+ Option `#1' was not in list `#2'\MessageBreak}}}
\newcommand*\showcaptionsetup[2][\@firstofone]{%
\GenericWarning{}{%
#1 Caption Info: KV list on `#2'\MessageBreak
@@ -327,7 +344,7 @@
\newcommand*\caption@pageref[1]{%
\expandafter\ifx\csname caption@r@#1\endcsname\relax
\G@refundefinedtrue % => 'There are undefined references.'
- \PackageWarning{caption}{Reference on page \thepage \space undefined}%
+ \caption@Warning{Reference on page \thepage \space undefined}%
\else
\expandafter\let\expandafter\caption@thepage\csname caption@r@#1\endcsname
\fi}
@@ -414,24 +431,29 @@
singlelinecheck=1,strut=1}%
\caption@clearsetup{SingleLine}}
\DeclareCaptionStyle{base}[indent=0pt,justification=centering]{}
-\DeclareCaptionStyle{default}[indent=0pt,justification=centering,format=plain]{%
+\DeclareCaptionStyle{default}[indent=0pt,justification=centering]{%
format=default,labelsep=default,textformat=default,%
justification=default,font=default,labelfont=default,textfont=default}
-\newcommand\DeclareCaptionFormat{%
+\newcommand*\DeclareCaptionFormat{%
\caption@teststar\caption@declareformat\@gobble\@firstofone}
\@onlypreamble\DeclareCaptionFormat
-\newcommand\caption@declareformat[3]{%
- \global\expandafter\let\csname caption@ifh@#2\endcsname#1%
- \global\long\@namedef{caption@fmt@#2}##1##2##3{#3}}
+\newcommand*\caption@declareformat[2]{%
+ \@dblarg{\caption@@declareformat#1{#2}}}
\@onlypreamble\caption@declareformat
+\long\def\caption@@declareformat#1#2[#3]#4{%
+ \global\expandafter\let\csname caption@ifh@#2\endcsname#1%
+ \global\long\@namedef{caption@slfmt@#2}##1##2##3{#3}%
+ \global\long\@namedef{caption@fmt@#2}##1##2##3{#4}}
+\@onlypreamble\caption@@declareformat
\DeclareCaptionOption{format}{\caption@setformat{#1}}
\newcommand*\caption@setformat[1]{%
\@ifundefined{caption@fmt@#1}%
{\caption@Error{Undefined format `#1'}}%
{\expandafter\let\expandafter\caption@ifh\csname caption@ifh@#1\endcsname
+ \expandafter\let\expandafter\caption@slfmt\csname caption@slfmt@#1\endcsname
\expandafter\let\expandafter\caption@fmt\csname caption@fmt@#1\endcsname}}
\DeclareCaptionFormat{plain}{#1#2#3\par}
-\DeclareCaptionFormat{hang}{%
+\DeclareCaptionFormat{hang}[#1#2#3\par]{%
\caption@ifin@list\caption@lsepcrlist\caption@lsepname
{\caption@Error{%
The option `labelsep=\caption@lsepname' does not work\MessageBreak
@@ -604,7 +626,7 @@
\caption@AtBeginDocument{%
\@ifundefined{caption@r@ragged2e}{%
\newcommand*\caption@@ragged{%
- \PackageWarning{caption}{%
+ \caption@Warning{%
`ragged2e' support has been changed.\MessageBreak
Rerun to get captions right}%
\global\let\caption@ragged\@secondoftwo % suppress further warnings
@@ -617,7 +639,7 @@
}{%
\newcommand*\caption@@ragged[2]{%
\@ifundefined{caption\string#1}{%
- \PackageWarning{caption}{%
+ \caption@Warning{%
`ragged2e' package not loaded, therefore\MessageBreak
substituting \string#2 for \string#1\MessageBreak}%
\global\@namedef{caption\string#1}}{}%
@@ -771,7 +793,7 @@
\fi
\relax
}}
- \let\captionmargin\captionindent
+ \let\captionmargin\captionindent % set to 3pc by AMS class
\begingroup\edef\@tempa{\endgroup
\noexpand\caption@g@addto@list\noexpand\caption@sty@default
{margin=\the\captionmargin
@@ -831,7 +853,7 @@
\else
\vskip\belowcaptionskip
\fi}}
- \DeclareCaptionFormat{default}{%
+ \DeclareCaptionFormat{default}[#1#2#3\par]{%
\ifdofullc@p
\caption@ifin@list\caption@lsepcrlist\caption@lsepname
{\caption@Error{%
@@ -967,8 +989,7 @@
\captionmargin\caption@minmargin\relax
\fi
\fi
- \caption@ifslc{\caption@ifempty@list\caption@opt@SingleLine{}{%
- \caption@slc{#1}{#2}\captionwidth\relax}}{}%
+ \caption@ifslc{\caption@slc{#1}{#2}\captionwidth\relax}{}%
\caption@calcmargin
\@tempdima\captionmargin
\ifdim\captionmargin@=\z@ \else
@@ -1017,7 +1038,7 @@
\newcommand\caption@slc[4]{%
\caption@Debug{Begin SLC}%
\begingroup
- \expandafter\caption@setup\expandafter{\caption@opt@SingleLine}%
+ \caption@SingleLine
\let\caption@hj\@empty
\caption@calcmargin % calculate #3 if necessary
\caption@prepareslc
@@ -1026,15 +1047,19 @@
\endgroup
\else
\endgroup
- \expandafter\caption@setup\expandafter{\caption@opt@SingleLine}%
+ \caption@SingleLine
#4%
\fi
\caption@Debug{End SLC}}
+\newcommand*\caption@SingleLine{%
+ \expandafter\caption@setup\expandafter{\caption@opt@SingleLine}%
+ \let\caption@fmt\caption@slfmt}
\newcommand*\caption@prepareslc{%
\let\@footnotetext\@gobble\let\@endnotetext\@gobble
\def\label{\caption@withoptargs\@gobbletwo}%
- \def\stepcounter##1{\advance\csname c@##1\endcsname\@ne\relax}%
+ \let\stepcounter\caption@l@stepcounter
\let\refstepcounter\stepcounter\let\H@refstepcounter\stepcounter}
+\newcommand*\caption@l@stepcounter[1]{\advance\csname c@#1\endcsname\@ne\relax}
\newcommand*\captionbox{\parbox[b]}
\newcommand\caption@@@make[2]{%
\sbox\@tempboxa{#1}%