summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/caption/caption.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/caption/caption.sty')
-rw-r--r--Master/texmf-dist/tex/latex/caption/caption.sty159
1 files changed, 85 insertions, 74 deletions
diff --git a/Master/texmf-dist/tex/latex/caption/caption.sty b/Master/texmf-dist/tex/latex/caption/caption.sty
index efabb8d19d0..26e461fd682 100644
--- a/Master/texmf-dist/tex/latex/caption/caption.sty
+++ b/Master/texmf-dist/tex/latex/caption/caption.sty
@@ -40,9 +40,9 @@
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\def\caption@tempa$Id: #1 #2 #3-#4-#5 #6${%
\def\caption@tempa{#3/#4/#5 }\def\caption@tempb{#2 }}
-\caption@tempa $Id: caption.sty 73 2013-04-14 19:40:46Z sommerfeldt $
+\caption@tempa $Id: caption.dtx 89 2013-05-02 07:05:20Z sommerfeldt $
\ProvidesPackage{caption}[\caption@tempa v3.3-\caption@tempb Customizing captions (AR)]
-\RequirePackage{caption3}[2012/12/26] % needs v1.5 or newer
+\RequirePackage{caption3}[2013/05/01] % needs v1.6 or newer
\caption@ifbool{documentclass}{}{%
\caption@WarningNoLine{%
Unsupported document class (or package) detected,\MessageBreak
@@ -709,6 +709,10 @@
}
\caption@AtBeginDocument{\caption@redefine}
\let\@makecaption\caption@makecaption
+\newcommand\phantomcaption{%
+ \caption@iftype
+ {\caption@refstepcounter\@captype}%
+ {\caption@Error{\noexpand\phantomcaption outside float}}}%
\caption@AtBeginDocument{%
\DeclareCaptionOption{type}{\setcaptiontype{#1}}%
\DeclareCaptionOption{type*}{\setcaptiontype*{#1}}%
@@ -764,12 +768,7 @@
\newcommand*\caption@typehook{}
\newcommand*\caption@iftype{%
\caption@ifundefined\@captype\@secondoftwo\@firstoftwo}
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname currentgrouplevel\endcsname\relax
- \caption@Debug{TeX engine: TeX}
- \let\caption@checkgrouplevel\@gobbletwo
-\else
- \caption@Debug{TeX engine: e-TeX}
+\caption@ifeTeX{%
\newcommand*\caption@checkgrouplevel[2]{%
\@ifundefined{#1caption@grouplevel}{%
\caption@ifundefined\caption@grouplevel{\let\caption@grouplevel\z@}{}%
@@ -779,8 +778,10 @@
\else
\caption@Warning{\string#2\MessageBreak outside box or environment}%
\fi
- }{}}
-\fi
+ }{}}%
+}{%
+ \let\caption@checkgrouplevel\@gobbletwo
+}
\newcommand*\caption@undefinedlabel{%
\protect\caption@xref{\caption@labelname}{\on@line}}
\DeclareRobustCommand*\caption@xref[2]{%
@@ -861,6 +862,7 @@
\newcommand*\caption@Continued@Float[1]{%
\edef\caption@tempa{#1}%
\ifx\caption@tempa\caption@CFtype
+ \caption@restorecounters
\caption@@ContinuedFloat{#1}%
\else
\caption@Error{Continued `#1' after `\caption@CFtype'}%
@@ -883,10 +885,8 @@
\newcommand*\caption@resetContinuedFloat[1]{%
\xdef\caption@CFtype{#1}%
\@stpelt{ContinuedFloat}}
-\newcommand\phantomcaption{%
- \caption@iftype
- {\caption@refstepcounter\@captype}%
- {\caption@Error{\noexpand\phantomcaption outside float}}}%
+\caption@ifundefined\donemaincaptionfalse{}{%
+ \g@addto@macro\donemaincaptionfalse\caption@savesubcounters}
\newcommand*\caption@refstepcounter[1]{%
\@ifundefined{c@#1}%
{\caption@Error{No float type '#1' defined}}%
@@ -1007,11 +1007,19 @@
\fi
\c@ContinuedFloat=0\relax
\let\caption@setfloatcapt\@firstofone
- \caption@setbox{parbox}%
+ \caption@setbox{none}%
\caption@clearmargin
\caption@iflist{}{\let\caption@setlist\@gobble}%
\caption@setoptions{sub}%
\caption@setoptions{subfloat}% for subfig-package compatibility
+ \def\caption@settype{\caption@withoptargs\caption@sub@settype}%
+ \def\caption@sub@settype##1##2{%
+ \def\caption@tempa{##2}%
+ \ifx\caption@tempa\@captype
+%%% \caption@setsubtype##1\relax
+ \else
+ \caption@Error{##2 inside \@subcaptype}%
+ \fi}%
\let\caption\caption@subcaption
\let\phantomcaption\caption@subphantom
\if@subfloatrow
@@ -1162,61 +1170,63 @@
\caption@setbool{needfreeze}{0}
\caption@AtBeginDocument*{%
\caption@ifneedfreeze{%
- \newcommand*\caption@freeze[1]{%
- \caption@settype*{#1}%
- \captionsetup*[sub]{hypcap=true}% Note: This is just a (q&d) workaround!
- \let\caption@frozen@ContinuedFloat\ContinuedFloat
- \def\ContinuedFloat{%
- \caption@@freeze{\caption@@@ContinuedFloat\@captype}%
- \caption@frozen@ContinuedFloat}%
- \let\caption@frozen@setup\caption@setup
- \def\caption@setup##1{%
- \caption@@freeze{\caption@setup{##1}}%
- \caption@frozen@setup{##1}}%
- \let\caption@frozen@caption\caption
- \def\caption{%
+ \newcommand*\caption@freezetype[1]{%
+ \caption@settype*{#1}%
+ \captionsetup*[sub]{hypcap=true}% Note: This is just a (q&d) workaround!
+ \caption@freeze}%
+ \newcommand*\caption@freeze{%
+ \let\caption@frozen@ContinuedFloat\ContinuedFloat
+ \def\ContinuedFloat{%
+ \caption@@freeze{\caption@@@ContinuedFloat\@captype}%
+ \caption@frozen@ContinuedFloat}%
+ \let\caption@frozen@setup\caption@setup
+ \def\caption@setup##1{%
+ \caption@@freeze{\caption@setup{##1}}%
+ \caption@frozen@setup{##1}}%
+ \let\caption@frozen@caption\caption
\def\caption{%
- \caption@Error{%
- Only one \noexpand\caption can be placed in this environment}%
- \caption@gobble}%
- \@ifstar
- {\caption@SC@caption*}%
- {\let\@currentlabel\caption@SClabel
- \caption@withoptargs\caption@SC@caption}}%
- \long\def\caption@SC@caption##1##2{%
- \caption@@freeze{\caption##1{##2}}%
- \ignorespaces}%
- \let\caption@frozen@label\label
- \def\label{%
- \caption@withoptargs\caption@SC@label}%
- \def\caption@SC@label##1##2{%
- \ifx\@currentlabel\caption@SClabel
- \@bsphack
- \caption@freeze@label{##1}{##2}%
- \@esphack
- \else
- \caption@frozen@label##1{##2}%
- \fi}%
- \def\caption@SClabel{\caption@undefinedlabel}%
- \def\caption@freeze@label##1##2{%
- \caption@@freeze{\label##1{##2}}}%
- \global\let\caption@frozen@content\@empty
- \long\def\caption@@freeze{%
- \g@addto@macro\caption@frozen@content}%
- \def\caption@warmup{%
- \let\ContinuedFloat\caption@frozen@ContinuedFloat
- \let\caption@setup\caption@frozen@setup
- \let\caption\caption@frozen@caption
- \let\label\caption@frozen@label}}%
+ \def\caption{%
+ \caption@Error{%
+ Only one \noexpand\caption can be placed in this environment}%
+ \caption@gobble}%
+ \@ifstar
+ {\caption@SC@caption*}%
+ {\let\@currentlabel\caption@SClabel
+ \caption@withoptargs\caption@SC@caption}}%
+ \long\def\caption@SC@caption##1##2{%
+ \caption@@freeze{\caption##1{##2}}%
+ \ignorespaces}%
+ \let\caption@frozen@label\label
+ \def\label{%
+ \caption@withoptargs\caption@SC@label}%
+ \def\caption@SC@label##1##2{%
+ \ifx\@currentlabel\caption@SClabel
+ \@bsphack
+ \caption@freeze@label{##1}{##2}%
+ \@esphack
+ \else
+ \caption@frozen@label##1{##2}%
+ \fi}%
+ \def\caption@SClabel{\caption@undefinedlabel}%
+ \def\caption@freeze@label##1##2{%
+ \caption@@freeze{\label##1{##2}}}%
+ \global\let\caption@frozen@content\@empty
+ \long\def\caption@@freeze{%
+ \g@addto@macro\caption@frozen@content}%
+ \def\caption@warmup{%
+ \let\ContinuedFloat\caption@frozen@ContinuedFloat
+ \let\caption@setup\caption@frozen@setup
+ \let\caption\caption@frozen@caption
+ \let\label\caption@frozen@label}}%
\newcommand*\caption@prepare@defrost{%
\let\caption@settype\caption@set@type}
- \newcommand*\caption@defrost{%
- \ifx\caption@frozen@caption\@undefined
- \caption@frozen@content
- \else
- \caption@Error{Internal Error:\MessageBreak
- \noexpand\caption@defrost in same group as \string\caption@freeze}%
- \fi}%
+ \newcommand*\caption@defrost{%
+ \ifx\caption@frozen@caption\@undefined
+ \caption@frozen@content
+ \else
+ \caption@Error{Internal Error:\MessageBreak
+ \noexpand\caption@defrost in same group as \string\caption@freeze}%
+ \fi}%
}{}%
\caption@undefbool{needfreeze}}
\let\caption@warmup\relax
@@ -1303,7 +1313,7 @@
\def\FP@captype{#1}%
\begin{lrbox}{\FP@floatCorpusBOX}%
\minipage\hsize % changes from LR mode to vertical mode
- \caption@freeze{#1}%
+ \caption@freezetype{#1}%
\ignorespaces}%
\renewcommand*\FP@floatEnd{%
\endminipage
@@ -1601,7 +1611,8 @@
\rotatebox{90}{%
\ifdim\captionwidth=\z@
\setcaptionwidth{.8\vsize}%
- \l@addto@macro\caption@singleline{\caption@setbox{none}}%
+ \l@addto@macro\caption@singleline{%
+ \caption@setup{parbox=none}}%
\fi
\let\caption@calcmargin\relax
\caption@@make{#1}{#2}}%
@@ -1613,7 +1624,7 @@
\def\SC@zfloat#1#2#3[#4]{%
\caption@ORI@SC@zfloat{#1}{#2}{#3}[#4]%
\SC@RestoreCommands
- \caption@freeze{#2}%
+ \caption@freezetype{#2}%
\let\SC@label\label}%
\providecommand*\SC@RestoreCommands{%
\let\caption=\SC@orig@caption \let\label=\SC@orig@label}%
@@ -1700,15 +1711,15 @@
\let\caption@ORI@threeparttable\threeparttable
\renewcommand*\threeparttable{%
\caption@settype{table}%
- \caption@setposition a% ?
- \caption@clearmargin
+ \caption@setposition a% ?
+ \caption@clearmargin
\caption@setoptions{threeparttable}%
\caption@ORI@threeparttable}%
\let\caption@ORI@measuredfigure\measuredfigure
\renewcommand*\measuredfigure{%
\caption@settype{figure}%
- \caption@setposition a% ?
- \caption@clearmargin
+ \caption@setposition a% ?
+ \caption@clearmargin
\caption@setoptions{measuredfigure}%
\caption@ORI@measuredfigure}%
\def\TPT@caption#1[#2]#3{%