summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/caption
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/caption')
-rw-r--r--Master/texmf-dist/source/latex/caption/bicaption.dtx1132
-rw-r--r--Master/texmf-dist/source/latex/caption/caption-ams-smf.dtx6
-rw-r--r--Master/texmf-dist/source/latex/caption/caption-beamer.dtx33
-rw-r--r--Master/texmf-dist/source/latex/caption/caption-deu.tex4624
-rw-r--r--Master/texmf-dist/source/latex/caption/caption-elsarticle.dtx6
-rw-r--r--Master/texmf-dist/source/latex/caption/caption-eng.tex4458
-rw-r--r--Master/texmf-dist/source/latex/caption/caption-koma.dtx6
-rw-r--r--Master/texmf-dist/source/latex/caption/caption-light.dtx36
-rw-r--r--Master/texmf-dist/source/latex/caption/caption-memoir.dtx36
-rw-r--r--Master/texmf-dist/source/latex/caption/caption-ntg.dtx6
-rw-r--r--Master/texmf-dist/source/latex/caption/caption-rus.tex6226
-rw-r--r--Master/texmf-dist/source/latex/caption/caption-thesis.dtx6
-rw-r--r--Master/texmf-dist/source/latex/caption/caption.dtx6208
-rw-r--r--Master/texmf-dist/source/latex/caption/caption.ins28
-rw-r--r--Master/texmf-dist/source/latex/caption/caption2.dtx396
-rw-r--r--Master/texmf-dist/source/latex/caption/caption3.dtx761
-rw-r--r--Master/texmf-dist/source/latex/caption/fallback/v1/caption.dtx489
-rw-r--r--Master/texmf-dist/source/latex/caption/fallback/v2.0/caption2.dtx606
-rw-r--r--Master/texmf-dist/source/latex/caption/fallback/v2.1/caption2.dtx1329
-rw-r--r--Master/texmf-dist/source/latex/caption/fallback/v3.0/caption.dtx5077
-rw-r--r--Master/texmf-dist/source/latex/caption/fallback/v3.1/caption.dtx7985
-rw-r--r--Master/texmf-dist/source/latex/caption/fallback/v3.2/caption.dtx4521
-rw-r--r--Master/texmf-dist/source/latex/caption/fallback/v3.2/caption3.dtx3668
-rw-r--r--Master/texmf-dist/source/latex/caption/fallback/v3.3/caption.dtx4968
-rw-r--r--Master/texmf-dist/source/latex/caption/fallback/v3.3/caption3.dtx4176
-rw-r--r--Master/texmf-dist/source/latex/caption/fallback/v3.4/caption.dtx4538
-rw-r--r--Master/texmf-dist/source/latex/caption/fallback/v3.4/caption3.dtx4231
-rw-r--r--Master/texmf-dist/source/latex/caption/fallback/v3.5/caption.dtx4292
-rw-r--r--Master/texmf-dist/source/latex/caption/fallback/v3.5/caption3.dtx4680
-rw-r--r--Master/texmf-dist/source/latex/caption/ltcaption.dtx30
-rw-r--r--Master/texmf-dist/source/latex/caption/subcaption.dtx1868
31 files changed, 59111 insertions, 17315 deletions
diff --git a/Master/texmf-dist/source/latex/caption/bicaption.dtx b/Master/texmf-dist/source/latex/caption/bicaption.dtx
index 5bba05cb2ff..fba7724ff39 100644
--- a/Master/texmf-dist/source/latex/caption/bicaption.dtx
+++ b/Master/texmf-dist/source/latex/caption/bicaption.dtx
@@ -2,7 +2,7 @@
%
% This is file `bicaption.dtx'.
%
-% Copyright (C) 2010-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+% Copyright (C) 2010-2021 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
%
% --------------------------------------------------------------------------
%
@@ -27,17 +27,16 @@
% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
-% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
-% and the user manuals
-% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty.
%
% \fi
-% \CheckSum{457}
+%
+% \CheckSum{626}
%
% \iffalse
%<*driver>
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesFile{bicaption.drv}[2020/10/25 v1.3 Adds a bilingual caption feature to the caption package]
+\ProvidesFile{bicaption.drv}[2022/01/07 v1.5 Adds a bilingual caption feature to the caption package]
\hbadness=9999 \newcount\hbadness \hfuzz=74pt % Make TeX shut up.
%\errorcontextlines=3
%
@@ -54,7 +53,8 @@
%
\usepackage[T1]{fontenc}
\usepackage[german,english]{babel}
-\usepackage{selinput}\SelectInputMappings{adieresis={ä},germandbls={ß}}
+%\usepackage{selinput}\SelectInputMappings{adieresis={ä},germandbls={ß}}
+\usepackage[utf8]{inputenc}
%
\usepackage[bottom]{footmisc}
%
@@ -85,8 +85,11 @@
\newenvironment{background}{\par\bigskip\csname background*\endcsname}{\csname endbackground*\endcsname}
\newenvironment{background*}{\small\MARGINSYM{\Mountain}\ignorespaces}{\par}
%
+\makeatletter
\newcommand*\MARGINSYM[1]{\hskip 1sp \marginpar{\raggedleft\textcolor{blue}{{#1}}}}
-\newcommand*\NEW[2]{\MARGINSYM{\vskip2pt\footnotesize#1\\#2}}
+\newcommand*\NEW[1]{\@ifstar{\@NEW{#1}{\vskip2pt}}{\@NEW{#1}{}}}
+\newcommand*\@NEW[3]{\MARGINSYM{#2\footnotesize#1\\#3}}
+\makeatother
%
\newenvironment{Options}[1]%
{\list{}{\renewcommand\makelabel[1]{\texttt{##1}\hfil}%
@@ -135,7 +138,6 @@
% \section{Loading the package}
% \label{sec:loading}
%
-% \DescribeMacro{\usepackage}
% This package will be loaded by
% \begin{quote}
% |\usepackage|\oarg{options}|{bicaption}|\quad.
@@ -160,7 +162,7 @@
% \section{Setting options}
% \label{sec:options}
%
-% \DescribeMacro{\captionsetup}
+% \DescribeMacro\captionsetup
% The command
% \begin{quote}
% |\captionsetup[bi]|\marg{options}
@@ -266,14 +268,14 @@
% will swap the primary and secondary language,
% making the first language the second one and vice versa. (The default is |false|.)
%
-% \NEWfeature{v1.3}
% \item[bi-separator=]
% \begin{quote}|\captionsetup{bi-separator=|\meta{name}|}|\end{quote}
+% \NEWfeature{v1.3}
% will select a separator between first and second bilingual caption.
% You could choose one of the following: `none' (which is the default one
% and could also be addressed as `default'), `smallskip', `medskip',
% `largeskip', or a self-defined one using
-% \DescribeMacro{\DeclareBiCaptionSeparator}
+% \DescribeMacro{\DeclareBiCaption-\\Separator}
% \begin{quote}|\DeclareBiCaptionSeparator|\marg{name}\marg{code}\end{quote}
% Examples:
% \begin{quote}
@@ -321,9 +323,430 @@
% \cs{captionbox}.)
% \endgroup
%
-% \bigskip
+% \pagebreak[3]
+% \section{Customising lists}
+% \label{sec:lists}
+%
+% \DescribeMacro{list=}
+% As default both caption texts will be insert into the List of Figures resp. List of Tables.
+% To suppress the second entry just pass the option |list=off| to the \package{bicaption}
+% package, e.g.:
+% \begin{quote}
+% |\usepackage[lang=english,|\ldots|,list=off]{bicaption}|
+% \end{quote}
+%
+% \pagebreak[3]
+% \DescribeMacro{listtype+=}
+% Another option is separating the lists. For that purpose the option
+% \begin{quote}
+% |listtype+=|\meta{list type extension}
+% \end{quote}
+% can be used to tell the \package{bicaption} package to use a different list
+% for the second caption text.
+% The given value will be appended to the current environment type;
+% for example with |listtype+=X| the list entries will be put into the list
+% responsible for the types
+% |figureX| ($=$ |figure| $+$ |X|), |tableX| ($=$ |table| $+$ |X|) etc.
+%
+% Such a \meta{list type} can be defined using |\Declare|\-|Floating|\-|Environment|
+% offered by the \package{newfloat} package, but some document classes
+% or other packages offer macros for defining new floating environment types
+% (and their corresponding lists) as well.
+%
+% A sample document:
+% \begin{quote}
+% |\documentclass[a4paper]{article}|\\
+% ||\\
+% |% Use "ngerman" as 1st language, "english" as 2nd one|\\
+% |\usepackage[english,ngerman]{babel}|\\
+% ||\\
+% |% Load the bicaption package with 2nd language set to|\\
+% |% "english", and list type "figureEng" resp. "tableEng"|\\
+% |\usepackage[lang=english,listtype+=Eng]{bicaption}|\\
+% ||\\
+% |\usepackage{newfloat}|\\
+% |% Define type "figureEng" and \listoffigureEng|\\
+% |\DeclareFloatingEnvironment[fileext=lof2]{figureEng}|\\
+% | [Figure][List of Figures]|\\
+% |% Define type "tableEng" and \listoftableEng|\\
+% |\DeclareFloatingEnvironment[fileext=lot2]{tableEng}|\\
+% | [Table][List of Tables]|\\
+% ||\\
+% |\begin{document}|\\
+% ||\\
+% |\listoffigures % typeset "Abbildungsverzeichnis"|\\
+% |\listoffigureEng % typeset "List of Figures"|\\
+% ||\\
+% |\begin{figure}|\\
+% | \centering|\\
+% | A placeholder for an image or whatever|\\
+% | \bicaption{Deutscher Text}{English text}|\\
+% |\end{figure}|\\
+% ||\\
+% |\end{document}|
+% \end{quote}
+%
+% \pagebreak[3]
+% A different approach is using one list for both languages, but with different formatting.
+% Since the \package{caption} package does not offer options and commands for
+% customising the format of the lists, one need an additional package for this purpose,
+% for example the \package{titletoc} package:
+%
+% \begin{quote}
+% |\documentclass[a4paper]{article}|\\
+% ||\\
+% |% Use "ngerman" as 1st language, "english" as 2nd one|\\
+% |\usepackage[english,ngerman]{babel}|\\
+% ||\\
+% |% Load the bicaption package with 2nd language set to|\\
+% |% "english", and list type "figure2" resp. "table2"|\\
+% |\usepackage[lang=english,listtype+=2]{bicaption}|\\
+% ||\\
+% |% We load the titletoc package for customizing lists|\\
+% |% Note: Loading titletoc should be done prior|\\
+% |% defining additional floating environments with|\\
+% |% \DeclareFloatingEnvironment|\\
+% |\usepackage{titletoc}|\\
+% ||\\
+% |\usepackage{newfloat}|\\
+% |% Define the new floating environment type "figure2"|\\
+% |% Use the same file extension as for "figure" (.lof) here|\\
+% |\DeclareFloatingEnvironment[fileext=lof]{figure2}|\\
+% |% Define the new floating environment type "table2"|\\
+% |% Use the same file extension as for "table" (.lot) here|\\
+% |\DeclareFloatingEnvironment[fileext=lot]{table2}|\\
+% ||\\
+% |% We use the titletoc package for customizing "figure2"|\\
+% |% which is appropriate for the second language captions|\\
+% \iffalse
+% |\contentsuse{figure2}{lof}|\\
+% \fi
+% |\titlecontents{figure2}[3.8em]|\\
+% | {} % no above code|\\
+% | {} % empty numbered entry format|\\
+% | {} % empty numberless entry format|\\
+% | {} % empty filler page format|\\
+% ||\\
+% |\begin{document}|\\
+% ||\\
+% |\renewcommand\listfigurename|\\
+% | {Abbildungsverzeichnis / List of Figures}|\\
+% |\listoffigures|\\
+% ||\\
+% |\begin{figure}|\\
+% | \centering|\\
+% | A placeholder for an image or whatever|\\
+% | \bicaption{Deutscher Text}{English text}|\\
+% |\end{figure}|\\
+% ||\\
+% |\end{document}|
+% \end{quote}
+%
+% \section{Language Selection}
+% \label{sec:babel}
+%
+% For language selection \thispackage\ uses two macros internally:
+%
+% \medskip
+%
+% \DescribeMacro\captionmainlanguage
+% |\caption|\-|main|\-|lan|\-|guage| contains the main language, for example
+% `french' or `german'.
+% If not set manually, \thispackage\ will try to obtain this setting from
+% the \package{babel} or \package{polyglossia} package after the preamble of
+% the document, i.e.~at |\begin{doc|\-|u|\-|ment}|.
+%
+% So if you are using either \package{babel} or \package{polyglossia}, and want to inherit
+% the main language setting from it, then simply forget about the
+% |\caption|\-|main|\-|lan|\-|guage| stuff and skip the rest of the section.
+%
+% \pagebreak[3]
+% Otherwise one can define |\caption|\-|main|\-|lan|\-|guage| manually, e.g.:
+% \begin{quote}
+% |\newcommand\captionmainlanguage{french}|\\
+% |\usepackage[lang=english]{bicaption}|
+% \end{quote}
+%
+% \pagebreak[3]
+% Note: Prior to \version{1.5} |\caption|\-|main|\-|language| needed to be defined
+% \emph{before} loading \thispackage. Since \version{1.5} is could be defined either
+% before or after loading \thispackage.
+%
+% \medskip
+%
+% \DescribeMacro\selectcaptionlanguage
+% \NEWfeature*{v1.1}
+% |\select|\-|caption|\-|lan|\-|guage| will be used internally to select the language:
+% \begin{quote}
+% |\selectcaptionlanguage|\marg{font-or-list-entry}\marg{language}
+% \end{quote}
+% For setting the language of the caption \meta{font-or-list-entry} will be |\@first|\-|of|\-|two|,
+% for setting the language of the list entry \meta{font-or-list-entry} will be
+% |\@second|\-|of|\-|two|.~\footnote{\cs{@firstoftwo} and \cs{@secondoftwo} are defined
+% in the \LaTeX\ kernel and simply pick either the 1st or 2nd argument.}
+% It defaults to |\select@lan|\-|guage| (caption) resp.~|\select|\-|lan|\-|guage| (list entry)
+% offered by the \package{babel} and \package{polyglossia} package:
+% \begin{quote}
+% |\providecommand*\selectcaptionlanguage[2]{%|\\
+% | #1{\select@language}{\selectlanguage}{#2}}|
+% \end{quote}
+% If you need to alter this, just either define |\select|\-|caption|\-|lan|\-|guage| prior
+% loading \thispackage, or redefine it afterwards.
+%
+% \pagebreak[3]
+% Example document using \package{babel}:
+% \begin{quote}
+% |\documentclass[a4paper]{article}|\\
+% ||\\
+% |% Use "ngerman" as 1st language, "english" as 2nd one|\\
+% |\usepackage[english,ngerman]{babel}|\\
+% ||\\
+% |% Add custom translations to babel|\\
+% |\addto\captionsgerman{%|\\
+% |% \renewcommand\whatevername{Wasauchimmer}%|\\
+% |% |\ldots\\
+% |}|\\
+% |\addto\captionsenglish{%|\\
+% |% \renewcommand\whatevername{Whatever}%|\\
+% |% |\ldots\\
+% |}|\\
+% ||\\
+% |% Load the bicaption package with 2nd language set to|\\
+% |% "english"|\\
+% |\usepackage[lang=english]{bicaption}|\\
+% ||\\
+% |\begin{document}|\\
+% ||\\
+% |\begin{figure}|\\
+% | \centering|\\
+% | A placeholder for an image or whatever|\\
+% | \bicaption{Deutscher Text}{English text}|\\
+% |\end{figure}|\\
+% ||\\
+% |\end{document}|
+% \end{quote}
+%
+% \pagebreak[3]
+% The same example document but using a custom implementation of
+% |\caption|\-|main|\-|language| and |\select|\-|caption|\-|language|
+% instead of \package{babel}:
+% \begin{quote}
+% |\documentclass[a4paper]{article}|\\
+% ||\\
+% |% Load the bicaption package with 2nd language set to|\\
+% |% "english"|\\
+% |\usepackage[lang=english]{bicaption}|\\
+% ||\\
+% |% Set "german" as main bi-caption language|\\
+% |\newcommand\captionmainlanguage{german}|\\
+% ||\\
+% |% Declare an own language switching mechanism|\\
+% |% for bi-captions (instead of using babel)|\\
+% |\renewcommand\selectcaptionlanguage[2]{%|\\
+% | \csname captions#2\endcsname}|\\
+% |\newcommand\captionsgerman{%|\\
+% | \renewcommand\figurename{Abbildung}%|\\
+% | \renewcommand\tablename{Tabelle}%|\\
+% |% \renewcommand\whatevername{Wasauchimmer}%|\\
+% |% |\ldots\\
+% |}|\\
+% |\newcommand\captionsenglish{%|\\
+% | \renewcommand\figurename{Figure}%|\\
+% | \renewcommand\tablename{Table}%|\\
+% |% \renewcommand\whatevername{Whatever}%|\\
+% |% |\ldots\\
+% |}|\\
+% ||\\
+% |\begin{document}|\\
+% ||\\
+% |\begin{figure}|\\
+% | \centering|\\
+% | A placeholder for an image or whatever|\\
+% | \bicaption{Deutscher Text}{English text}|\\
+% |\end{figure}|\\
+% ||\\
+% |\end{document}|
+% \end{quote}
+%
+% \pagebreak[3]
+% \NEWfeature{v1.5}
+% Since \version{1.5} a warning is issued if the main language could neither be
+% detected automatically nor was it set explicitly by the user.
+% If you really don't want to set languages for bi-captions but are annoyed by
+% the warning you could trick the \package{bicaption} by defining a custom
+% dummy language-selection mechanism, e.g.:
+% \begin{quote}
+% |\newcommand\captionmainlanguage{dummy}|\\
+% |\renewcommand\selectcaptionlanguage[2]{}|\\
+% \end{quote}
+%
+% \medskip
+%
+% \DescribeMacro{\DeclareCaption-\\LangOption}
+% \NEWfeature*{v1.2}
+% For internal implementation reasons the selection of language will be done delayed,
+% i.e.~not done immediately at |lang=|\meta{language}. So if you do
+% \begin{quote}
+% |\captionsetup[bi-second]{lang=ngerman,labelsep=quad}|
+% \end{quote}
+% the language |ngerman| will only be stored internally, and the label separator will
+% be set to |quad| afterwards. Some time later, right before the caption is actually
+% typeset, the language will be set to |ngerman|.
+%
+% Usually this is no problem, but think of options which will be overwritten by the
+% language selection, or options which act on the language currently set, for example
+% \begin{quote}
+% |\captionsetup[bi-second]{lang=ngerman,name=Bild}|\quad.
+% \end{quote}
+% |lang=ngerman| changes the environment name to ``Abbildung'', and |name=Bild|
+% changes the environment name to ``Bild''. One would expect that the name is
+% finally ``Bild'', but because of the delayed nature of |lang=ngerman| it will
+% be ``Abbildung'' instead, at least if we don't take action about this.
+%
+% For that reason the command
+% \begin{quote}
+% |\DeclareCaptionLangOption|\marg{caption option name}
+% \end{quote}
+% is offered. Options handled this way will be applied twice if used after the |lang=|
+% option, when the option is actually used, and right after the language is selected.
+%
+% \begin{quote}
+% |\DeclareCaptionLangOption{name}|
+% \end{quote}
+% will be done by \thispackage\ automatically, since the environment name will usually
+% be overwritten by a language selection. So actually
+% \begin{quote}
+% |\captionsetup[bi-second]{lang=ngerman,name=Bild}|
+% \end{quote}
+% will give the expected result, i.e. the environment name is typeset as ``Bild''.
+%
+% \section{Required packages}
+% \label{sec:caption}
+%
+% \NEWfeature{v1.4}
+% Starting with version $1.4$ the \package{bicaption} package requires at least version $3.2$
+% of the \package{caption} package and loads it automatically.
+% (Older versions of the \package{bicaption} package have required exactly the version of the
+% \package{caption} package which was released with it.)
+%
+% \pagebreak[3]
+% If you need to use a specific version of the \package{caption} package you need to load it
+% \emph{before} the \package{bicaption} package, e.g.:
+% \begin{quote}
+% |\usepackage[| \ldots |]{caption}[=v3.5]|\\
+% |\usepackage[| \ldots |]{bicaption}|
+% \end{quote}
+%
+% \pagebreak[3]
+% Note that there are limitations if an older version of the \package{caption} package
+% is used:
+% \begin{itemize}
+% \item Full support of list entries of the \env{lstlisting} environment
+% (offered by the \package{listings} package) needs at least \package{caption} \version{3.6}.
+% \end{itemize}
+%
+% \section{Supported packages}
+% \label{sec:packages}
+%
+% The \package{bicaption} package was adapted to the following packages which deals with captions, too:
+% \package{listings}~\cite{listings}, \package{longtable}~\cite{longtable}, and \package{subcaption}~\cite{subcaption}.
%
-% If the \package{subcaption} package is loaded, these commands are available
+% \subsection{Support of the listings package}
+% \label{sec:listings}
+%
+% \NEWfeature{v1.5}
+% If the \package{listings} package~\cite{listings} is loaded, the \package{listings} options \opt{caption1}
+% and \opt{caption2} are available additionally, where option \opt{caption1} specifies the
+% caption of the first language and \opt{caption2} of the second one.
+%
+% Example document, using distinctive lists for each language:
+% \begin{quote}
+% |\documentclass[a4paper]{article}|\\
+% |\usepackage{graphicx}|\\
+% ||\\
+% |% Use "ngerman" as 1st language, "english" as 2nd one|\\
+% |\usepackage[english,ngerman]{babel}|\\
+% ||\\
+% |% Load the bicaption package with 2nd language set to|\\
+% |% "english", and list type "figureEng" resp. "tableEng"|\\
+% |\usepackage[lang=english,listtype+=Eng,font=it]{bicaption}|\\
+% |\captionsetup{slc=off} % do not center short captions|\\
+% ||\\
+% |\usepackage{listings}|\\
+% ||\\
+% |% Set German names|\\
+% |\addto\captionsgerman{%|\\
+% | \renewcommand\lstlistingname{Quelltext}%|\\
+% | \renewcommand\lstlistlistingname{Quelltextverzeichnis}%|\\
+% |}|\\
+% |\AtBeginDocument{\captionsgerman}% or load listings before babel|\\
+% ||\\
+% |% Set English names|\\
+% |\addto\captionsenglish{%|\\
+% | \renewcommand\lstlistingname{Listing}%|\\
+% | \renewcommand\lstlistlistingname{List of Listings}%|\\
+% |}|\\
+% ||\\
+% |\usepackage{newfloat}|\\
+% |% Define the new floating environment type "lstlistingEng"|\\
+% |% (just to get an extra list for English listing captions)|\\
+% |\DeclareFloatingEnvironment[fileext=lol2]{lstlistingEng}|\\
+% | [Listing][List of Listings]|\\
+% ||\\
+% |\begin{document}|\\
+% ||\\
+% |\lstlistoflistings % German|\\
+% |\listoflstlistingEng % English|\\
+% ||\\
+% |\clearpage|\\
+% ||\\
+% |\begin{lstlisting}|\\
+% | [language=C,|\\
+% | caption1=Deutscher Titel,|\\
+% | caption2=English Title]|\\
+% | int main()|\\
+% | {|\\
+% | printf( "Hello world!\n" );|\\
+% | return 0;|\\
+% | }|\\
+% |\end{lstlisting}|\\
+% ||\\
+% |\end{document}|
+% \end{quote}
+%
+% \subsection{Support of the longtable package}
+% \label{sec:longtable}
+%
+% If the \package{longtable} package~\cite{longtable} is loaded, |\bicaption| is available
+% in the \env{longtable} environment as well, e.g.:
+% \begin{quote}
+% |\documentclass[a4paper]{article}|\\
+% ||\\
+% |% Use "ngerman" as 1st language, "english" as 2nd one|\\
+% |\usepackage[english,ngerman]{babel}|\\
+% ||\\
+% |% Load the bicaption package with 2nd language set to|\\
+% |% "english"|\\
+% |\usepackage[lang=english]{bicaption}|\\
+% ||\\
+% |\usepackage{longtable}|\\
+% ||\\
+% |\begin{document}|\\
+% ||\\
+% |\begin{longtable}{ll}|\\
+% | \bicaption{Deutscher Titel}{English Title}\\|\\
+% | A & B \\|\\
+% | C & D \\|\\
+% | |\ldots\\
+% |\end{longtable}|\\
+% ||\\
+% |\end{document}|
+% \end{quote}
+%
+% \subsection{Support of the subcaption package}
+% \label{sec:subcaption}
+%
+% If the \package{subcaption} package~\cite{subcaption} is loaded, these commands are available
% additionally:
%
% \smallskip
@@ -355,8 +778,7 @@
% \endgroup
%
% \pagebreak[3]
-% \section{A sample document}
-% \label{sec:example}
+% \subsubsection{A sample document}
%
% \begin{quote}
% |\documentclass[english,ngerman]{article}|\\
@@ -424,7 +846,7 @@
% | {Short English heading}|\\
% |\end{figure}|\\
% ||\\
-% |\captionsetup{bi-slc=0}|\\
+% |\captionsetup{bi-slc=off}|\\
% ||\\
% |\begin{figure}[!htb]|\\
% | \centering|\\
@@ -441,7 +863,7 @@
% | {Short English heading}|\\
% |\end{figure}|\\
% ||\\
-% |\captionsetup{slc=0}|\\
+% |\captionsetup{slc=off}|\\
% ||\\
% |\begin{figure}[!htb]|\\
% | \centering|\\
@@ -471,7 +893,8 @@
% \bigskip
% \fi
%
-% \begin{figure}[!htb]
+% \begin{minipage}{\linewidth}
+% \setcaptiontype{figure}
% \centering
% \bisubcaptionbox
% {Teilabbildung A\label{fig:test:A}}
@@ -482,12 +905,14 @@
% {Subfigure long title B}[0.4\textwidth]{IMAGE}%
% \bicaption{Deutscher Titel}{English Title}
% \label{fig:test}
-% \end{figure}
+% \end{minipage}
%
% \iffalse
+% \bigskip
% \captionsetup{bi-lang=2nd}
%
-% \begin{figure}[!htb]
+% \begin{minipage}{\linewidth}
+% \setcaptiontype{figure}
% \centering
% \bisubcaptionbox
% {Teilabbildung A\label{fig:test2:A}}
@@ -498,12 +923,14 @@
% {Subfigure long title B}[0.4\textwidth]{IMAGE}%
% \bicaption{Deutscher Titel}{English Title}
% \label{fig:test2}
-% \end{figure}
+% \end{minipage}
% \fi
%
+% \bigskip
% \captionsetup{bi-lang=both}
%
-% \begin{figure}[!htb]
+% \begin{minipage}{\linewidth}
+% \setcaptiontype{figure}
% \centering
% \bisubcaptionbox[A]
% {Und eine gaaaanz lange Caption: Teilabbildung A}
@@ -516,11 +943,13 @@
% {Und eine noch viel viel viel
% längere deutsche Beschriftung: Deutscher Titel}
% {Short English heading}
-% \end{figure}
+% \end{minipage}
%
-% \captionsetup{bi-slc=0}
+% \bigskip
+% \captionsetup{bi-slc=off}
%
-% \begin{figure}[!htb]
+% \begin{minipage}{\linewidth}
+% \setcaptiontype{figure}
% \centering
% \bisubcaptionbox[A]
% {Und eine gaaaanz lange Caption: Teilabbildung A}
@@ -533,11 +962,13 @@
% {Und eine noch viel viel viel
% längere deutsche Beschriftung: Deutscher Titel}
% {Short English heading}
-% \end{figure}
+% \end{minipage}
%
-% \captionsetup{slc=0}
+% \bigskip
+% \captionsetup{slc=off}
%
-% \begin{figure}[!htb]
+% \begin{minipage}{\linewidth}
+% \setcaptiontype{figure}
% \centering
% \bisubcaptionbox[A]
% {Und eine gaaaanz lange Caption: Teilabbildung A}
@@ -550,224 +981,40 @@
% {Und eine noch viel viel viel
% längere deutsche Beschriftung: Deutscher Titel}
% {Short English heading}
-% \end{figure}
-%
-% \pagebreak[3]
-% \section{Customising lists}
-% \label{sec:lists}
-%
-% \DescribeMacro{list=}
-% As default both caption texts will be insert into the List of Figures resp. List of Tables.
-% To suppress the second entry just pass the option |list=off| to the \package{bicaption}
-% package, e.g.:
-% \begin{quote}
-% |\usepackage[lang=english,|\ldots|,list=off]{bicaption}|
-% \end{quote}
-%
-% \pagebreak[3]
-% \DescribeMacro{listtype+=}
-% Another option is separating the lists. For that purpose the option
-% \begin{quote}
-% |listtype+=|\meta{list type extension}
-% \end{quote}
-% can be used to tell the \package{bicaption} package to use a different list
-% for the second caption text.
-% The given value will be appended to the current environment type;
-% for example with |listtype+=X| the list entries will be put into the list
-% responsible for the types
-% |figureX| ($=$ |figure| $+$ |X|), |tableX| ($=$ |table| $+$ |X|) etc.
-%
-% Such a \meta{list type} can be defined using |\Declare|\-|Floating|\-|Environment|
-% offered by the \package{newfloat} package, but some document classes
-% or other packages offer macros for defining new floating environment types
-% (and their corresponding lists) as well.
-%
-% A sample document:
-% \begin{quote}
-% |\documentclass[a4paper]{article}|\\
-% ||\\
-% |% Use "ngerman" as 1st language, "english" as 2nd one|\\
-% |\usepackage[english,ngerman]{babel}|\\
-% ||\\
-% |% Load the bicaption package with 2nd language set to|\\
-% |% "english", and list type "figureEng" resp. "tableEng"|\\
-% |\usepackage[lang=english,listtype+=Eng]{bicaption}|\\
-% ||\\
-% |\usepackage{newfloat}|\\
-% |% Define the new floating environment type "figureEng"|\\
-% |\DeclareFloatingEnvironment[fileext=lof2]{figureEng}|\\
-% | [Figure][List of Figures]|\\
-% |% Define the new floating environment type "tableEng"|\\
-% |\DeclareFloatingEnvironment[fileext=lot2]{tableEng}|\\
-% | [Table][List of Tables]|\\
-% ||\\
-% |\begin{document}|\\
-% |\listoffigures % typeset "Abbildungsverzeichnis"|\\
-% |\listoffigureEnges % typeset "List of Figures"|\\
-% ||\\
-% |\begin{figure}|\\
-% | \centering|\\
-% | A placeholder for an image or whatever|\\
-% | \bicaption{Deutscher Text}{English text}|\\
-% |\end{figure}|\\
-% ||\\
-% |\end{document}|
-% \end{quote}
-%
-% \pagebreak[3]
-% A different approach is using one list for both languages, but with different formatting.
-% Since the \package{caption} package does not offer options and commands for
-% customising the format of the lists, one need an additional package for this purpose,
-% for example the \package{titletoc} package:
-%
-% \begin{quote}
-% |\documentclass[a4paper]{article}|\\
-% ||\\
-% |% Use "ngerman" as 1st language, "english" as 2nd one|\\
-% |\usepackage[english,ngerman]{babel}|\\
-% ||\\
-% |% Load the bicaption package with 2nd language set to|\\
-% |% "english", and list type "figure2" resp. "table2"|\\
-% |\usepackage[lang=english,listtype+=2]{bicaption}|\\
-% ||\\
-% |% We load the titletoc package for customizing lists|\\
-% |% Note: Loading titletoc should be done prior|\\
-% |% defining additional floating environments with|\\
-% |% \DeclareFloatingEnvironment|\\
-% |\usepackage{titletoc}|\\
-% ||\\
-% |\usepackage{newfloat}|\\
-% |% Define the new floating environment type "figure2"|\\
-% |% Use the same file extension as for "figure" (.lof) here|\\
-% |\DeclareFloatingEnvironment[fileext=lof]{figure2}|\\
-% |% Define the new floating environment type "table2"|\\
-% |% Use the same file extension as for "table" (.lot) here|\\
-% |\DeclareFloatingEnvironment[fileext=lot]{table2}|\\
-% ||\\
-% |% We use the titletoc package for customizing "figure2"|\\
-% |% which is appropriate for the second language captions|\\
-% \iffalse
-% |\contentsuse{figure2}{lof}|\\
-% \fi
-% |\titlecontents{figure2}[3.8em]|\\
-% | {} % no above code|\\
-% | {} % empty numbered entry format|\\
-% | {} % empty numberless entry format|\\
-% | {} % empty filler page format|\\
-% ||\\
-% |\begin{document}|\\
-% |\renewcommand\listfigurename|\\
-% | {Abbildungsverzeichnis / List of Figures}|\\
-% |\listoffigures|\\
-% ||\\
-% |\begin{figure}|\\
-% | \centering|\\
-% | A placeholder for an image or whatever|\\
-% | \bicaption{Deutscher Text}{English text}|\\
-% |\end{figure}|\\
-% ||\\
-% |\end{document}|
-% \end{quote}
-%
-% \section{Language Selection}
-% \label{sec:babel}
-%
-% For language selection \thispackage\ uses two macros internally:
-%
-% \medskip
-%
-% \DescribeMacro\captionmainlanguage
-% |\caption|\-|main|\-|lan|\-|guage| contains the main language, e.g. |english| or |german|.
-% If not set prior to loading \thispackage, \thispackage\ will try to obtain this setting from
-% the \package{babel} or \package{polyglossia} package.
-%
-% So if you are using either \package{babel} or \package{polyglossia}, and want to adopt
-% the main language setting from it, then just load \thispackage\ \emph{after} it,
-% and simply forget about the |\caption|\-|main|\-|lan|\-|guage| stuff.
-%
-% Otherwise one can either define |\caption|\-|main|\-|lan|\-|guage| prior to
-% loading \thispackage, e.g.:
-% \begin{quote}
-% |\newcommand\captionmainlanguage{french}|\\
-% |\usepackage|\oarg{options}|{bicaption}|
-% \end{quote}
-% Or one can specify the main language via |\caption|\-|setup| after loading \thispackage, e.g.:
-% \begin{quote}
-% |\usepackage|\oarg{options}|{bicaption}|\\
-% |\captionsetup[bi-first]{lang=french}|
-% \end{quote}
-% When not using the \package{babel} or \package{polyglossia} package both approaches
-% will have exactly the same effect.
-% But when using the \package{babel} or \package{polyglossia} package, and one want to
-% specify the main caption language manually, the first approach is preferable since
-% defining |\caption|\-|main|\-|lan|\-|guage| will suppress the automatic detection mechanism.
-%
-% \medskip
-%
-% \DescribeMacro\selectcaptionlanguage
-% \NEWfeature{v1.1}
-% |\select|\-|caption|\-|lan|\-|guage| will be used internally to select the language:
-% \begin{quote}
-% |\selectcaptionlanguage|\marg{font-or-list-entry}\marg{language}
-% \end{quote}
-% For setting the language of the caption \meta{font-or-list-entry} will be |\@first|\-|of|\-|two|,
-% for setting the language of the list entry \meta{font-or-list-entry} will be
-% |\@second|\-|of|\-|two|.~\footnote{\cs{@firstoftwo} and \cs{@secondoftwo} are defined
-% in the \LaTeX\ kernel and simply pick either the 1st or 2nd argument.}
-% It defaults to |\select@lan|\-|guage| (caption) resp.~|\select|\-|lan|\-|guage| (list entry)
-% offered by the \package{babel} and \package{polyglossia} package:
-% \begin{quote}
-% |\providecommand*\selectcaptionlanguage[2]{%|\\
-% | #1{\select@language}{\selectlanguage}{#2}}|
-% \end{quote}
-% If you need to alter this, just either define |\select|\-|caption|\-|lan|\-|guage| prior
-% loading \thispackage, or redefine it afterwards.
-%
-% \medskip
-%
-% \DescribeMacro\DeclareCaptionLangOption
-% \NEWfeature{v1.2}
-% For internal implementation reasons the selection of language will be done delayed,
-% i.e.~not done immediately at |lang=|\meta{language}. So if you do
-% \begin{quote}
-% |\captionsetup[bi-second]{lang=ngerman,labelsep=quad}|
-% \end{quote}
-% the language |ngerman| will only be stored internally, and the label separator will
-% be set to |quad| afterwards. Some time later, right before the caption is actually
-% typeset, the language will be set to |ngerman|.
-%
-% Usually this is no problem, but think of options which will be overwritten by the
-% language selection, or options which act on the language currently set, for example
-% \begin{quote}
-% |\captionsetup[bi-second]{lang=ngerman,name=Bild}|\quad.
-% \end{quote}
-% |lang=ngerman| changes the environment name to ``Abbildung'', and |name=Bild|
-% changes the environment name to ``Bild''. One would expect that the name is
-% finally ``Bild'', but because of the delayed nature of |lang=ngerman| it will
-% be ``Abbildung'' instead, at least if we don't take action about this.
-%
-% For that reason the command
-% \begin{quote}
-% |\DeclareCaptionLangOption|\marg{caption option name}
-% \end{quote}
-% is offered. Options handled this way will be applied twice if used after the |lang=|
-% option, when the option is actually used, and right after the language is selected.
-%
-% \begin{quote}
-% |\DeclareCaptionLangOption{name}|
-% \end{quote}
-% will be done by \thispackage\ automatically, since the environment name will usually
-% be overwritten by a language selection. So actually
-% \begin{quote}
-% |\captionsetup[bi-second]{lang=ngerman,name=Bild}|
-% \end{quote}
-% will give the expected result, i.e. the environment name is typeset as ``Bild''.
+% \end{minipage}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \StopEventually{%^^A
+% \begin{thebibliography}{99}
+%
+% \bibitem{caption}
+% Axel Sommerfeldt:\\
+% \href{http://www.ctan.org/pkg/caption}%
+% {\emph{Customizing captions of floating environments}},\\
+% 2022/01/07
+%
+% \bibitem{listings}
+% Carsten Heinz \& Brooks Moses:\\
+% \href{http://www.ctan.org/pkg/listings}%
+% {\emph{The Listings Package}},\\
+% 2007/02/22
+%
+% \bibitem{longtable}
+% David Carlisle:\\
+% \href{http://www.ctan.org/pkg/longtable}%
+% {\emph{The longtable package}},\\
+% 2004/02/01
+%
+% \bibitem{subcaption}
+% Axel Sommerfeldt:\\
+% \href{http://www.ctan.org/pkg/subcaption}%
+% {\emph{The subcaption package}},\\
+% 2022/01/07
+%
+% \end{thebibliography}
% }
%
% \iffalse
@@ -796,6 +1043,7 @@
% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\kernel@ifnextchar}
% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
@@ -840,18 +1088,38 @@
%
% \clearpage
% \section{The implementation}
+%
% \iffalse
%<*package>
% \fi
%
% \subsection{Identification}
%
+% We need at least \LaTeX2e\ version 1994/12/01.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{bicaption}[2020/10/25 v1.3 Bilingual Captions (AR)]
% \end{macrocode}
+%
+% Bypass the release declarations in case the \LaTeX\ kernel doesn’t know how to deal with them
+% (as suggested by \url{https://www.latex-project.org/publications/2018-FMi-TUB-tb122mitt-version-rollback.pdf}).
+% \begin{macrocode}
+\providecommand\DeclareRelease[3]{}
+\providecommand\DeclareCurrentRelease[2]{}
+% \end{macrocode}
+%
+% Declare all supported releases.
+% \begin{macrocode}
+\DeclareCurrentRelease{v1}{2011/07/13}
+% \end{macrocode}
+%
+% Identify the current version of the package.
% \begin{macrocode}
-\RequirePackage{caption}[2020/08/23] % needs v3.5 or newer
+\ProvidesPackage{bicaption}[2021/05/02 v1.5b Bilingual Captions (AR)]
+% \end{macrocode}
+%
+% Since we base on the \package{caption} package we load it here.
+% \begin{macrocode}
+\RequirePackage{caption}[2011/11/10] % we need at least v3.2e
% \end{macrocode}
%
% \bigskip
@@ -892,7 +1160,7 @@
% \end{macrocode}
% \begin{macrocode}
\newcommand*\bicaption@wh{%
- See the bicaption package documentation for explanation.}
+ See the `bicaption' package documentation for explanation.}
% \end{macrocode}
% \end{macro}
%
@@ -900,37 +1168,13 @@
% |\bicaption@Error|\marg{message}
% \begin{macrocode}
\newcommand*\bicaption@Error[1]{%
- \PackageError{bicaption}{#1}\bicaption@eh}
-%\let\bicaption@KV@err\bicaption@Error
+ \PackageError{bicaption}{#1}{\caption@@eh{bicaption}}}
% \end{macrocode}
% \begin{macrocode}
-\newcommand*\bicaption@eh{%
+\providecommand*\caption@@eh[1]{%
If you do not understand this error, please take a closer look\MessageBreak
- at the documentation of the `bicaption' package.\MessageBreak\@ehc}
-% \end{macrocode}
-% \end{macro}
-%
-% \pagebreak[3]
-% \subsection{Compatibility check}
-%
-% \begin{macro}{\bicaption@CheckCompatibility}
-% \changes{v1.0}{2011/09/01}{Compatibility error added}
-% \changes{v1.2a}{2020/08/01}{Error text adapted to \package{caption} package~\version{4.0}}
-% \begin{macrocode}
-\newcommand*\bicaption@CheckCompatibility{%
-% \end{macrocode}
-% \begin{macrocode}
- \caption@ifcompatibility{%
- \bicaption@Error
- {This package does not work with\MessageBreak
- caption option `compatibility=v1'}%
- \endinput}{}}
-% \end{macrocode}
-% \begin{macrocode}
-\bicaption@CheckCompatibility
-\caption@AtBeginDocument{%
- \bicaption@CheckCompatibility
- \let\bicaption@CheckCompatibility\@undefined}
+ at the documentation of the `#1' package, especially the\MessageBreak
+ section about errors.\MessageBreak\@ehc}
% \end{macrocode}
% \end{macro}
%
@@ -976,6 +1220,12 @@
\DeclareCaptionOption{bi-separator}[1]{%
\caption@set{biseparator}{#1}}
% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\caption@set[2]{%
+ \@ifundefined{caption@#1@#2}%
+ {\caption@Error{Undefined #1 `#2'}}%
+ {\expandafter\let\csname caption@#1\expandafter\endcsname\csname caption@#1@#2\endcsname}}
+% \end{macrocode}
%
% \begin{macro}{\DeclareBiCaptionSeparator}
% \changes{v1.3}{2020/10/25}{This macro added}
@@ -985,6 +1235,10 @@
\caption@decl{biseparator}{#1}{#2}}
\@onlypreamble\DeclareBiCaptionSeparator
% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\caption@decl[2]{%
+ \global\long\expandafter\def\csname caption@#1@#2\endcsname}
+% \end{macrocode}
% \end{macro}
%
% There are four pre-defined separators, called `none',
@@ -998,7 +1252,9 @@
%
% The default separator usually maps to `none'.
% \begin{macrocode}
-\SetCaptionDefault{biseparator}{none}
+\caption@ifundefined\SetCaptionDefault
+ {\def\caption@biseparator@default{\caption@biseparator@none}}
+ {\SetCaptionDefault{biseparator}{none}}
% \end{macrocode}
%
% The option |lang=|\meta{language} will setup the language of the caption.
@@ -1013,8 +1269,9 @@
\caption@ifundefined\bicaption@language
\bicaption@language@setupkeys
\relax
- \def\bicaption@language{#1}%
- \let\bicaption@language@setoptions\@empty}
+ \edef\bicaption@language{#1}%
+ \let\bicaption@language@setoptions\@empty
+ \global\let\bicaption@language@value\bicaption@language}
% \end{macrocode}
% Map |language=| to |lang=|.
% \begin{macrocode}
@@ -1107,29 +1364,51 @@
% \end{macrocode}
%
% Set the language for the first caption.
+% (Since \version{1.5a} we do this |\At|\-|Begin|\-|Document| so
+% |\caption|\-|main|\-|language| could be defined \emph{after} loading the
+% \package{bicaption} package resp.~\package{babel} or \package{polyglossia}
+% could be loaded \emph{after} the \package{bicaption} package.)
% \begin{macrocode}
-\ifcsname captionmainlanguage\endcsname
- \bicaption@InfoNoLine{%
- main language is set to \captionmainlanguage}
-\else\ifcsname bbl@main@language\endcsname
- \bicaption@InfoNoLine{%
- babel found, main language is \bbl@main@language}
- \let\captionmainlanguage\bbl@main@language
-\else\ifcsname xpg@main@language\endcsname
- \bicaption@InfoNoLine{%
- polyglossia found, main language is \xpg@main@language}
- \let\captionmainlanguage\xpg@main@language
-\else
- \bicaption@InfoNoLine{main language is not set}
-\fi\fi\fi
-% \end{macrocode}
-% \begin{macrocode}
-\ifcsname captionmainlanguage\endcsname
- \edef\@tempa{%
- \noexpand\captionsetup[bi-first]{lang=\captionmainlanguage}}
- \@tempa
-\fi
+\AtBeginDocument{%
+ \ifcsname captionmainlanguage\endcsname
+ \bicaption@InfoNoLine{%
+ Main language is set to \captionmainlanguage}%
+ \else
+ \bicaption@setmainlanguage
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \ifcsname captionmainlanguage\endcsname
+ \captionsetup[bi-first]{lang=\captionmainlanguage}%
+ \else
+ \ifcsname bicaption@language@value\endcsname % option "lang=" was used
+ \expandafter\bicaption@Warning
+ \else
+ \expandafter\bicaption@Info
+ \fi
+ {Main language is not set}%
+ \fi}
% \end{macrocode}
+%
+% \begin{macro}{\bicaption@setmainlanguage}
+% \changes{v1.5a}{2011/08/31}{This macro added as encapsulation of setting \cs{captionmainlanguage}}
+% |\bicaption@setmainlanguage| is used to define
+% |\caption|\-|main|\-|language| if not already done.
+% \begin{macrocode}
+\newcommand*\bicaption@setmainlanguage{%
+ \ifcsname bbl@main@language\endcsname
+ \bicaption@InfoNoLine{%
+ babel found, main language is \bbl@main@language}%
+ \let\captionmainlanguage\bbl@main@language
+ \else\ifcsname xpg@main@language\endcsname
+ \bicaption@InfoNoLine{%
+ polyglossia found, main language is \xpg@main@language}%
+ \let\captionmainlanguage\xpg@main@language
+ \fi\fi}
+\@onlypreamble\bicaption@setmainlanguage
+% \end{macrocode}
+% \end{macro}
+%
% We use |\caption@Process|\-|Options| here to add the options to the `|bi-second|' option
% list instead of executing them immediately.
% \begin{macrocode}
@@ -1208,9 +1487,15 @@
% \end{macro}
%
% \begin{macro}{\caption@@make}
+% \changes{v1.4}{2020/12/25}{Fallback code of \cs{caption@@make@} added}
% We redefine |\caption@@make| (of the \package{caption} package kernel)
% so |\bi|\-|caption@@make| will be used for bilingual captions instead.
% \begin{macrocode}
+\caption@ifundefined\caption@@make@
+ {\let\caption@@make@\caption@@make}
+ {}
+% \end{macrocode}
+% \begin{macrocode}
\renewcommand\caption@@make[2]{%
\caption@ifundefined\bicaption@text
{\begingroup
@@ -1221,13 +1506,15 @@
\global\let\bicaption@text\@undefined}%
% \end{macrocode}
% \begin{macrocode}
- \caption@@make@epilogue}
+ \@nameuse{caption@@make@epilogue}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bicaption@@make}
% \changes{v1.1}{2015/09/16}{\cs{bicaption@label} replaced by \cs{caption@thelabel}}
% \changes{v1.3}{2020/10/25}{Usage of \cs{caption@biseparator} added}
+% \changes{v1.4}{2020/12/25}{Definitions of \cs{bicaption@slc} and \cs{caption@setsinglelinecheck} added (fallback)}
+% \changes{v1.4a}{2020/12/26}{Clearance of \cs{caption@thelabel} replaced by \cs{bicaption@clrlabel}}
% |\bicaption@@make|\marg{text \#2}\marg{label}\marg{text \#1}\par
% Typeset both captions using the original version of \cs{caption@@make}.
% \begin{macrocode}
@@ -1241,8 +1528,8 @@
% \begin{macrocode}
\ifnum\bicaption@lang=0\relax
\bicaption@ifslc
- {\caption@slc{#2}{#3}{}{\caption@setsinglelinecheck0}%
- \caption@slc{#2}{#1}{}{\caption@setsinglelinecheck0}}%
+ {\bicaption@slc{#2}{#3}{}{\caption@setsinglelinecheck0}%
+ \bicaption@slc{#2}{#1}{}{\caption@setsinglelinecheck0}}%
{}%
\fi
% \end{macrocode}
@@ -1251,7 +1538,6 @@
% \begin{macrocode}
\ifnum\bicaption@lang=2\relax
\caption@thelabel
- \global\let\caption@thelabel\relax
\let\bicaption@tempa\relax
\else
\begingroup
@@ -1271,11 +1557,22 @@
\caption@@make@{#2}{#1}%
\endgroup
\fi
-}
+% \end{macrocode}
+% \begin{macrocode}
+ \global\bicaption@clrlabel}
% \end{macrocode}
% \begin{macrocode}
\newcommand*\bicaption@separator{\par}
% \end{macrocode}
+% \begin{macrocode}
+\caption@ifundefined\caption@@slc
+ {\newcommand\bicaption@slc{\caption@slc}}
+ {\newcommand\bicaption@slc[2]{\caption@@slc{#1}{#2}{\captionwidth}}}
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\caption@setsinglelinecheck{%
+ \caption@set@bool\caption@ifslc}
+% \end{macrocode}
% \end{macro}
%
% \pagebreak[3]
@@ -1317,6 +1614,7 @@
% \begin{macro}{\@bicaption}
% \changes{v1.0}{2011/08/31}{Optional parameter \meta{list entry \#2} added}
% \changes{v1.1}{2015/09/16}{\cs{bicaption@getlabel} replaced by \cs{caption@getlabel}}
+% \changes{v1.4}{2020/12/25}{Usage of \cs{caption@getlabel} replaced by \cs{bicaption@getlabel}}
% |\@bicaption|\marg{cmd}*\oarg{entry \#1}\marg{text \#1}\oarg{entry \#2}\marg{text \#2}\ldots
% \begin{macrocode}
\newcommand*\@bicaption[1]{%
@@ -1336,7 +1634,7 @@
% \end{macrocode}
% \begin{macrocode}
\long\def\@@@@bicaption#1#2[#3]#4{%
- \caption@getlabel{#2}%
+ \bicaption@getlabel{#2}%
\bicaption@ifswap
{\bicaption@setup{#1}{#2}%
\bicaption@cmd[{#3}]{#4}}%
@@ -1348,63 +1646,109 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\LT@bicaption}
-% \changes{v1.1}{2016/01/31}{Adaption to \package{longtable} package added}
-% Same as |\@bicaption| but for |longtable| (offered by the \package{longtable} package).
-% |\bicaption@LTsetup| will be executed later on, inside |\LT@makecaption| offered by the \package{caption} package.
+% \begin{macro}{\bicaption@getlabel}
+% \changes{v1.0}{2011/09/03}{\cs{label} can have optional arguments now}
+% \changes{v1.4}{2020/12/25}{This macro re-added}
+% |\bicaption@getlabel|\marg{text}\\
+% gets the label command out of the given caption text and stores it to |\caption@the|\-|label|.
+% It uses |\caption@get|\-|label| for this purpose which interface unfortunately has changed over time.
+% (Changing the interface was a bad idea in the first place but now it is as it is).
% \begin{macrocode}
-\newcommand\LT@bicaption{%
- \noalign\bgroup
- \@ifstar
- {\gdef\bicaption@cmd{\LT@c@ption\@gobble}%
- \LT@@bicaption}%
- {\gdef\bicaption@cmd{\LT@c@ption\@firstofone}%
- \caption@dblarg\LT@@@bicaption}}
-\newcommand\LT@@bicaption[1]{%
- \LT@@@@bicaption{}{#1}[]}
+\@ifundefined{caption@getlabel}{%
% \end{macrocode}
% \begin{macrocode}
-\long\def\LT@@@bicaption[#1]#2{%
- \caption@dblarg{\LT@@@@bicaption{#1}{#2}}}
+ \newcommand\bicaption@getlabel[1]{% caption3 < v1.7
+ \bicaption@@getlabel#1\label{}\@nil}
% \end{macrocode}
% \begin{macrocode}
-\long\def\LT@@@@bicaption#1#2[#3]#4{%
- \gdef\bicaption@LTsetup{%
- \caption@getlabel{#2}%
- \bicaption@LT@setup}%
- \gdef\bicaption@LT@setup{%
- \bicaption@ifswap
- {\bicaption@setup{#1}{#2}}%
- {\bicaption@setup{#3}{#4}}}%
- \bicaption@ifswap
- {\egroup\bicaption@cmd[{#3}]{#4}}%
- {\egroup\bicaption@cmd[{#1}]{#2}}}
+ \long\def\bicaption@@getlabel#1\label#2#3\@nil{%
+ \def\@tempa{#2}%
+ \ifx\@tempa\@empty
+ \let\caption@thelabel\relax
+ \else
+ \def\@tempb{*}%
+ \ifx\@tempa\@tempb
+ \def\caption@thelabel{\label*}%
+ \bicaption@@@getlabel#3\@nil
+ \else
+ \def\caption@thelabel{\label}%
+ \bicaption@@@getlabel{#2}#3\@nil
+ \fi
+ \fi}
% \end{macrocode}
% \begin{macrocode}
-\let\bicaption@LTsetup\relax
-\let\bicaption@LT@setup\relax
+ \long\def\bicaption@@@getlabel#1#2\@nil{%
+ \def\@tempa{#1}%
+ \def\@tempb{[}%
+ \ifx\@tempa\@tempb
+ \bicaption@@@@getlabel#1#2\@nil
+ \else
+ \l@addto@macro\caption@thelabel{{#1}}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+ \long\def\bicaption@@@@getlabel[#1]#2\@nil{%
+ \l@addto@macro\caption@thelabel{[{#1}]}%
+ \bicaption@@@getlabel#2\@nil}
+% \end{macrocode}
+% \begin{macrocode}
+}{\@ifundefined{caption@@@@getlabel}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand\bicaption@getlabel[1]{% caption3 >= v1.7
+ \caption@getlabel#1\label{}\@nil}
+% \end{macrocode}
+% \begin{macrocode}
+}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\bicaption@getlabel{% caption3 >= v2.0
+ \caption@getlabel}
+% \end{macrocode}
+% \begin{macrocode}
+}}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\caption@LT@setup}
-% \changes{v1.1}{2016/01/31}{Adaption to \package{longtable} package added}
-% Execute the stuff defined by \cs{LT@bicaption} to prepare the typesetting
-% of the \package{longtable} bilingual caption.
+% \begin{macro}{\bicaption@clrlabel}
+% \changes{v1.4a}{2020/12/26}{This macro added}
+% |\bicaption@clrlabel|\\
+% resets |\caption@the|\-|label| to |\relax|.
+% \begin{macrocode}
+\@ifundefined{caption@clrlabel}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\bicaption@clrlabel{\let\caption@thelabel\relax} % caption3 < v2.3
+% \end{macrocode}
% \begin{macrocode}
-\g@addto@macro\caption@LT@setup{%
- \bicaption@LTsetup
- \global\let\bicaption@LTsetup\relax}
+}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\bicaption@clrlabel{\caption@clrlabel} % caption3 >= v2.3
+% \end{macrocode}
+% \begin{macrocode}
+}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bicaption@setup}
-% |\bicaption@setup|\marg{list-entry}\marg{text}\par
-% Initiates the bilingual caption typesetting by storing the extra texts into
+% |\bicaption@setup|\marg{list-entry}\marg{text}\\
+% initiates the bilingual caption typesetting by storing the extra texts into
% |\bi|\-|caption@l|\-|entry| and |\bi|\-|caption@text|.
% \begin{macrocode}
\newcommand\bicaption@setup[2]{%
\def\bicaption@lentry{#1}%
- \def\bicaption@text{\ignorespaces#2}}
+ \def\bicaption@text{\ignorespaces #2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bicaption@clear}
+% |\bicaption@clear|\\
+% clears the stuff stored by |\bicaption@setup|.
+% \begin{macrocode}
+\newcommand*\bicaption@clear{%
+ \let\bicaption@lentry\@undefined
+ \let\bicaption@text\@undefined}
% \end{macrocode}
% \end{macro}
%
@@ -1437,11 +1781,117 @@
%
% \changes{v1.1}{2013/05/02}{Definition of \cs{bicaption@listof} removed}
%
+% \subsection{Support of the listings package}
+% \changes{v1.5}{2021/01/04}{Support of the \package{listings} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{listings}[2004/02/13 v1.2]{%
+% \end{macrocode}
+%
+% If the \package{listings} package is loaded, we define the new options `caption1' and `caption2'.
+% \begin{macrocode}
+ \lst@Key{caption1}\relax{%
+ \lstKV@OptArg[{#1}]{#1}{%
+ \bicaption@ifswap
+ {\bicaption@setup{##1}{##2}}%
+ {\def\lst@@caption{##1}\def\lst@caption{##2}}}%
+ \let\lst@title\@empty}%
+% \end{macrocode}
+% \begin{macrocode}
+ \lst@Key{caption2}\relax{%
+ \lstKV@OptArg[{#1}]{#1}{%
+ \bicaption@ifswap
+ {\def\lst@@caption{##1}\def\lst@caption{##2}}%
+ {\bicaption@setup{##1}{##2}}}%
+ \let\lst@title\@empty}%
+% \end{macrocode}
+% \begin{macrocode}
+ \lst@AddToHookExe{TextStyle}{%
+ \bicaption@clear}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{Support of the longtable package}
+%
+% \begin{macro}{\LT@bicaption}
+% \changes{v1.1}{2016/01/31}{Adaption to \package{longtable} package added}
+% Same as |\@bicaption| but for |longtable| (offered by the \package{longtable} package).
+% |\bi|\-|caption@LT|\-|setup| will be executed later on, inside |\LT@make|\-|caption|
+% offered by the \package{caption} package.
+% \begin{macrocode}
+\newcommand\LT@bicaption{%
+ \noalign\bgroup
+ \@ifstar
+ {\gdef\bicaption@cmd{\LT@c@ption\@gobble}%
+ \LT@@bicaption}%
+ {\gdef\bicaption@cmd{\LT@c@ption\@firstofone}%
+ \caption@dblarg\LT@@@bicaption}}
+\newcommand\LT@@bicaption[1]{%
+ \LT@@@@bicaption{}{#1}[]}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\LT@@@bicaption[#1]#2{%
+ \caption@dblarg{\LT@@@@bicaption{#1}{#2}}}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\LT@@@@bicaption#1#2[#3]#4{%
+ \gdef\bicaption@LTsetup{%
+ \bicaption@getlabel{#2}%
+ \bicaption@LT@setup}%
+ \gdef\bicaption@LT@setup{%
+ \bicaption@ifswap
+ {\bicaption@setup{#1}{#2}}%
+ {\bicaption@setup{#3}{#4}}}%
+ \bicaption@ifswap
+ {\egroup\bicaption@cmd[{#3}]{#4}}%
+ {\egroup\bicaption@cmd[{#1}]{#2}}}
+% \end{macrocode}
+% \begin{macrocode}
+\let\bicaption@LTsetup\relax
+\let\bicaption@LT@setup\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@LT@setup}
+% \changes{v1.1}{2016/01/31}{Adaption to \package{longtable} package added}
+% \changes{v1.4}{2020/12/25}{Fallback code for \package{caption} package \version{3.2} added}
+% Execute the stuff defined by \cs{LT@bicaption} to prepare the typesetting
+% of the \package{longtable} bilingual caption.
+% \begin{macrocode}
+\caption@ifundefined\caption@LT@setup{%
+ % Fallback code for caption v3.2
+ \captionsetup*[longtable]{bicaption-lt-setup}
+ \DeclareCaptionOptionNoValue{bicaption-lt-setup}{%
+ \bicaption@LTsetup
+ \global\let\bicaption@LTsetup\relax}
+}{%
+ \g@addto@macro\caption@LT@setup{%
+ \bicaption@LTsetup
+ \global\let\bicaption@LTsetup\relax}
+}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{thebibliography}{9}
% \bibitem{TLC2}
% Frank Mittelbach and Michel Goossens:\\
-% \newblock {\em The {\LaTeX} Companion (2nd.~Ed.)},
+% \newblock {\em The {\LaTeX} Companion (2nd.~Ed.)},\\
% \newblock Addison-Wesley, 2004.
+%
+% \bibitem{listings}
+% Carsten Heinz \& Brooks Moses:\\
+% \href{http://www.ctan.org/pkg/listings}%
+% {\emph{The Listings Package}},\\
+% 2007/02/22
+%
+% \bibitem{longtable}
+% David Carlisle:\\
+% \href{http://www.ctan.org/pkg/longtable}%
+% {\emph{The longtable package}},\\
+% 2004/02/01
% \end{thebibliography}
%
% \iffalse
diff --git a/Master/texmf-dist/source/latex/caption/caption-ams-smf.dtx b/Master/texmf-dist/source/latex/caption/caption-ams-smf.dtx
index cc036505c66..f0f8cebe431 100644
--- a/Master/texmf-dist/source/latex/caption/caption-ams-smf.dtx
+++ b/Master/texmf-dist/source/latex/caption/caption-ams-smf.dtx
@@ -27,11 +27,10 @@
% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
-% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
-% and the user manuals
-% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty.
%
% \fi
+%
% \CheckSum{21}
%
% \iffalse
@@ -144,6 +143,7 @@
% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\kernel@ifnextchar}
% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
diff --git a/Master/texmf-dist/source/latex/caption/caption-beamer.dtx b/Master/texmf-dist/source/latex/caption/caption-beamer.dtx
index 934f489f4a5..64d215bb035 100644
--- a/Master/texmf-dist/source/latex/caption/caption-beamer.dtx
+++ b/Master/texmf-dist/source/latex/caption/caption-beamer.dtx
@@ -2,7 +2,7 @@
%
% This is file `caption-beamer.dtx'.
%
-% Copyright (C) 2007-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+% Copyright (C) 2007-2022 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
%
% --------------------------------------------------------------------------
%
@@ -27,12 +27,11 @@
% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
-% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
-% and the user manuals
-% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty.
%
% \fi
-% \CheckSum{104}
+%
+% \CheckSum{113}
%
% \iffalse
%<*driver>
@@ -139,6 +138,7 @@
% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\kernel@ifnextchar}
% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
@@ -188,7 +188,7 @@
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesFile{caption-beamer.sto}[2020/08/22 v2.0 Adaption of the caption package to the beamer document classes (AR)]
+\ProvidesFile{caption-beamer.sto}[2022/01/06 v2.0c Adaption of the caption package to the beamer document classes (AR)]
% \end{macrocode}
%
% \section{Helper macros}
@@ -219,7 +219,7 @@
\@firstoftwo} % \@firstoftwo -> singlelinecheck=on
% \end{macrocode}
%
-% \begin{macro}{\caption@prepareslc}
+% \begin{macro}{\footnote}
% \changes{v1.12b}{2020/07/20}{Special adaption to \class{beamer} added}
% The patch of \cs{footnote} provided by the \package{caption3} package assumes
% that the optional arguments of \cs{footnote} and \cs{footnotemark} match.
@@ -230,7 +230,9 @@
% \cs{beamer@footnotetext}. (Unfortunately \cs{footnote} is defined too monolithic
% in \class{beamer} to offer a less dirty patch.)
% \begin{macrocode}
-\g@addto@macro\caption@prepareslc{%
+\providecommand*\AtCaptionSingleLineCheck{\g@addto@macro\caption@prepareslc} % for caption v3.5
+\let\caption@footnote@ORI\footnote
+\AtCaptionSingleLineCheck{%
\def\footnote{%
\begingroup
\let\stepcounter\caption@l@stepcounter
@@ -334,12 +336,13 @@
% \section{Adaption of figure and table environment}
%
% \begin{macrocode}
-\AtCaptionPackage{%
+\AfterCaptionPackage{%
% \end{macrocode}
%
% \begin{macro}{\figure}
% \changes{v1.1f}{2007/12/17}{This re-definition for \class{beamer} document class added}
% \changes{v1.8d}{2019/09/01}{This re-definition for \class{beamer} document class revised}
+% We re-define |figure| so our type-specific options will be used etc.
% \begin{macrocode}
\expandafter\let\expandafter\caption@beamer@figure
\csname\string\figure\endcsname
@@ -353,7 +356,7 @@
% \changes{v1.1f}{2007/12/17}{This re-definition for \class{beamer} document class added}
% \changes{v1.8d}{2019/09/01}{This re-definition for \class{beamer} document class revised}
% \changes{v1.8e}{2019/10/18}{Bug fixed which was introduced in previous revision}
-% We redefine |figure| \& |table| so our type-specific options will be used etc.
+% We re-define |table| as well so our type-specific options will be used etc.
% \begin{macrocode}
\expandafter\let\expandafter\caption@beamer@table
\csname\string\table\endcsname
@@ -363,6 +366,16 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\caption@nobreak}
+% \changes{v2.0c}{2022/01/06}{This re-definition for \class{beamer} document class added}
+% We re-define |\caption@nobreak| to activate the usage of |\nobreak| inside |\caption|.
+% |\caption@nobreak| is only available since \version{3.6} of the \package{caption}
+% package, for this reason we use |\def| instead of |\renewcommand|.
+% \begin{macrocode}
+ \def\caption@nobreak{\nobreak}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macrocode}
}
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/caption/caption-deu.tex b/Master/texmf-dist/source/latex/caption/caption-deu.tex
deleted file mode 100644
index 7d84184285d..00000000000
--- a/Master/texmf-dist/source/latex/caption/caption-deu.tex
+++ /dev/null
@@ -1,4624 +0,0 @@
-%
-% This is file `caption-deu.tex'.
-%
-% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
-%
-% --------------------------------------------------------------------------
-%
-% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
-% of this license or (at your option) any later version.
-% The latest version of this license is in
-% http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
-% version 2003/12/01 or later.
-%
-% This work has the LPPL maintenance status "maintained".
-%
-% This Current Maintainer of this work is Axel Sommerfeldt.
-%
-% This work consists of the files
-% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
-% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
-% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
-% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
-% the derived files
-% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
-% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
-% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
-% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
-% and the user manuals
-% caption-deu.tex, caption-eng.tex, caption-rus.tex.
-%
-\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesFile{caption-deu.tex}[2020/08/22 v3.4 Das caption-Paket]
-\hbadness=9999 \newcount\hbadness \hfuzz=20pt % Make TeX shut up.
-%\errorcontextlines=3
-
-\RequirePackage{fix-cm}
-\documentclass[german]{ltxdoc}
-\setlength\parindent{0pt}
-\setlength\parskip{\smallskipamount}
-\setlength\leftmargini{2em}% default = 2.5em
-\makeatletter\g@addto@macro\MacroFont{\normalcolor}\makeatother
-
-\newcommand\LineBreak{\linebreak[3]}
-\newcommand\PageBreak{\pagebreak[3]}
-\usepackage{ifpdf}
-\ifpdf
- \usepackage{mathptmx,courier}
- \usepackage[scaled=0.90]{helvet}
- \addtolength\marginparwidth{15pt}
- \ifdim\paperheight=297mm % a4paper
- \renewcommand\LineBreak{\\}
- \renewcommand\PageBreak{\clearpage}
- \fi
-\fi
-
-\usepackage[T1]{fontenc}
-\usepackage[german]{babel}
-%\selectlanguage{german}
-%\input dehyphtex.tex
-\usepackage{selinput}\SelectInputMappings{adieresis={ä},germandbls={ß}}
-
-\usepackage[bottom]{footmisc}
-\usepackage{graphicx,longtable,setspace}
-
-\usepackage{hypdoc}
-\ifpdf\usepackage{hypdestopt}\fi
-\hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}}
-\hypersetup{breaklinks=true}
-
-\usepackage[listof=0,hypcap=false]{caption}[2008/04/01]
-
-\DeclareRobustCommand*\eTeX{\texorpdfstring
- {\leavevmode\hbox{$\varepsilon$}-\TeX}%
- {e-TeX}}
-\DeclareRobustCommand*\AmS{\texorpdfstring
- {{\protect\usefont{OMS}{cmsy}{m}{n}A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}%
- {AMS}}
-\DeclareRobustCommand*\KOMAScript{\texorpdfstring
- {\textsf{K\kern.05em O\kern.05em M\kern.05em A\kern.1em-\kern.1em Script}}%
- {KOMA-Script}}
-\DeclareRobustCommand*\NTG{NTG}
-\DeclareRobustCommand*\SmF{SMF}
-
-\usepackage{marvosym}
-\makeatletter
-\newcommand*\INFO{\@ifstar{\@INFO{}}{\@INFO{\vbox to \ht\strutbox}}}
-\newcommand*\@INFO[1]{\MARGINSYM{#1{\LARGE\Info}}}
-\makeatother
-
-\newcommand*\MARGINSYM[1]{\hskip 1sp \marginpar{\raggedleft\textcolor{blue}{{#1}}}}
-\newcommand*\NEW[2]{}%\hskip 1sp \marginpar{\footnotesize\sffamily\raggedleft#1\\#2}}
-
-% \ContinuedFloat
-\DeclareCaptionLabelFormat{continued1}{#1~#2 (Fortsetzung)}
-\DeclareCaptionLabelFormat{continued2}{#1~#2\alph{ContinuedFloat}}
-% \DeclareCaptionLabelFormat
-\DeclareCaptionLabelFormat{bf-parens}{(\textbf{#2})}
-% \DeclareCaptionStyle
-\DeclareCaptionStyle{mystyle}[margin=5mm,justification=centering]%
- {font=footnotesize,labelfont=sc,margin={10mm,0mm}}
-% Example 1
-\DeclareCaptionFormat{myformat1}{#1#2\\#3}
-\newlength\myindention
-\DeclareCaptionFormat{myformat2}{#1#2\\\hspace*\myindention#3}
-\DeclareCaptionOption{myindention}{\setlength\myindention{#1}}
-% Example 2
-\DeclareCaptionFormat{reverse}{#3#2#1}
-\DeclareCaptionLabelFormat{fullparens}{(\bothIfFirst{#1}{~}#2)}
-\DeclareCaptionLabelSeparator{fill}{\hfill}
-% Example 3
-\DeclareCaptionFormat{llap}{\llap{#1#2}#3\par}
-\DeclareCaptionFormat{llapx}{\llap{\makebox[2.5cm][l]{#1}}#3\par}
-% Example 4
-\DeclareCaptionLabelFormat{andtable}{#1~#2 \& \tablename~\thetable}
-
-\newcommand*\purerm[1]{{\upshape\mdseries\rmfamily #1}}
-\newcommand*\puresf[1]{{\upshape\mdseries\sffamily #1}}
-\newcommand*\purett[1]{{\upshape\mdseries\ttfamily #1}}
-\let\class\puresf \let\package\puresf
-
-\newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
-\newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
-\newcommand*\version[2][]{$v#2$}
-\newcommand*\x{\discretionary{}{}{}}
-
-\newenvironment{Annotation}%
- {\ifvmode\else\unskip\par\fi\pagebreak[2]%
- \smallskip
- \small(\ignorespaces}{\unskip)\par}
-\newenvironment{Annotation*}%
- {\ifvmode\else\unskip\par\fi\pagebreak[2]%
- \small(\ignorespaces}{\unskip)\par}
-
-\newenvironment{Example}%
- {\ifvmode\else\unskip\par\fi\pagebreak[2]%
- \minipage{\linewidth}\smallskip}%
- {\smallskip\endminipage\par}
-
-\makeatletter
-\newcommand\example{\@ifstar
- {\@example{belowskip=\abovecaptionskip}}%
- {\@example{}}}
-\def\@example#1{%
- \@testopt{\@@example{#1}}{figure}}
-\long\def\@@example#1[#2]#3#4{%
- \begingroup
- \captionsetup{#1,size=small,margin={\leftmargini,10pt},#3}%
- \captionof{#2}[]{#4}%
- \endgroup}
-\makeatother
-
-\newenvironment{Expert}%
- {\ifvmode\else\unskip\par\fi\pagebreak[3]%
- \smallskip
- \footnotesize\ignorespaces}{\par}
-\newenvironment{Expert*}%
- {\ifvmode\else\unskip\par\fi\pagebreak[3]%
- \footnotesize\ignorespaces}{\par}
-
-\newenvironment{Note}[1][\DefaultNoteText]%
- {\ifvmode\else\unskip\par\fi
- \smallskip
- \small\emph{#1:}~\ignorespaces}{\par}
-\newenvironment{Note*}[1][\DefaultNoteText]%
- {\ifvmode\else\unskip\par\fi
- \small\emph{#1:}~\ignorespaces}{\par}
-
-\newenvironment{Options}[1]%
- {\list{}{\renewcommand\makelabel[1]{\texttt{##1}\hfil}%
- \settowidth\labelwidth{\texttt{#1\space}}%
- \setlength\leftmargin{10pt}%
- \addtolength\leftmargin{\labelwidth}%
- \addtolength\leftmargin{\labelsep}}}%
- {\endlist}
-
-\makeatletter
-\def\Ref{\@ifstar{\@Ref\ref}{\@Ref\autoref}}
-\def\@Ref#1#2{#1{#2}: \textit{\nameref{#2}}}
-\newcommand*\SEE[3][]{\nopagebreak{#1(#2 #3)}}
-\newcommand*\SeeUserDefined[1][]{\See{\Ref{declare}#1}}
-\makeatother
-
-\begin{document}
-\let\subsectionautorefname\sectionautorefname
-\let\subsubsectionautorefname\sectionautorefname
-
-\def\thispackage{das \package{caption}"=Paket}
-\def\Thispackage{Das \package{caption}"=Paket}
-
-\newcommand*\DefaultNoteText{Hinweis}
-\newcommand*\NEWfeature{\NEW{Neues Feature}}
-\newcommand*\NEWdescription{\NEW{Neue Beschreibung}}
-\makeatletter
-\newcommand*\See{\@ifstar{\SEE{Siehe}}{\SEE[\small]{Siehe}}}
-\newcommand*\see{\@ifstar{\SEE{siehe}}{\SEE[\small]{siehe}}}
-\makeatother
-
-% --------------------------------------------------------------------------- %
-
-\GetFileInfo{caption-deu.tex}
-\let\docdate\filedate
-\let\docdate\filedate
-\let\docversion\fileversion
-\GetFileInfo{caption.sty}
-
-\title{Anpassen der Abbildungs- und Tabellenbeschriftungen\texorpdfstring{%
- \thanks{Dieses Paket hat Versionsnummer \docversion.}}{}}
-\author{Axel Sommerfeldt\\
- \url{https://gitlab.com/axelsommerfeldt/caption}}
-\date{\docdate}
-\maketitle
-
-% --------------------------------------------------------------------------- %
-
-\begin{abstract}
-\Thispackage\ bietet einem Mittel und Wege, das Erscheinungsbild der Bild-
-und Tabellenbeschriftungen den eigenen Wünschen bzw.\ Vorgaben anzupassen.
-Hierbei wurde Wert auf die reibungslose Zusammenarbeit mit zahlreichen
-Dokumentenklassen und Paketen gelegt.
-\iffalse
-\par\smallskip
-\textit{Bitte beachten Sie:} Viele Dokumentenklassen bieten bereits
-Optionen und Befehle, um das Erscheinungsbild der Abbildungs- und
-Tabellenbeschriftungen individuell anzupassen.
-Wenn diese Möglichkeiten für Sie ausreichend sind, gibt es in der Regel
-keinen Grund, \thispackage\ zu benutzen. Und falls Sie lediglich an dem
-Befehl |\caption|\-|of| interessiert sind, ist in der Regel das Laden des
-kleinen aber feinen \package{capt-of}"=Paketes hierzu völlig ausreichend.
-\fi
-\end{abstract}
-
-\newcommand\exampletext{%
- Die auf die Rotationsfrequenz des Innenzylinders normierten Eigenfrequenzen
- der gefundenen Grundmoden der Taylor"=Strömung f"ur \mbox{$\eta = 0.5$}. %\\
- (Die azimutale Wellenzahl ist mit $m$ bezeichnet.)}
-
-% --------------------------------------------------------------------------- %
-
-\section*{Status dieses Dokumentes}
-
-Diese Dokumentation ist veraltet.
-
-Sie dokumentiert die in Version \version{3.1} des \package{caption}"=Paketes
-verfügbaren Optionen und Befehle, jedoch nicht, was in folgenden Versionen
-hinzugefügt wurde. Warum?
-\begin{itemize}
-\item
- Ich war nicht glücklich mit der Struktur der Dokumentation und wollte sie daher
- neu schreiben. Warum also eine aufgegebene Version der Dokumentation pflegen?
- (Leider hatte ich aber nie die Zeit gefunden, die neue Version zu schreiben.)
-\item
- Da meine Freizeit seit dem Release der Version \version{3.1} nur spärlich
- vorhanden war, wollte ich die Veröffentlichung von Verbesserungen und
- Erweiterungen nicht aufgrund fehlender Dokumentation um Monate verzögern.
-\item
- Da ich früher Fehlerkorrekturen nur in der aktuellen Entwicklungsversion
- vorgenommen hatte, wollte ich die Veröffentlichung von Korrekturen nicht
- aufgrund fehlender Dokumentation um Monate verzögern.
- (Seit 2015 werden Fehler in der Regel auch für die letzte Release"=Version
- behoben und auf CTAN veröffentlicht.)
-\end{itemize}
-
-Wie geht es nun weiter?
-\begin{itemize}
-\item
- Ich werde in den nächsten Wochen starten, die Dokumentation (endlich) zu aktualisieren.
-\item
- Bis die überarbeitete Version fertig und auf CTAN zu finden ist,
- kann jederzeit der aktuelle Zwischenstand über
- \url{https://gitlab.com/axelsommerfeldt/caption/-/blob/master/doc/caption-eng.pdf}
- bezogen werden. (Zunächst wird die englischsprachige Dokumentation überarbeitet,
- und erst anschließend die deutschsprachige.)
-\end{itemize}
-
-% --------------------------------------------------------------------------- %
-
-\section*{Einleitung}
-
-Mit |\caption| gesetzte Bildunterschriften und Tabellenüberschriften werden
-von den Standard"=Dokumentenklassen eher stiefmütterlich behandelt.
-In der Regel schlicht als ganz normaler Absatz gesetzt, ergibt sich keine
-signifikante optische Abgrenzung vom eigentlichen Text, wie z.B. hier:
-
-\example*{size=normalsize,margin=0pt}{\exampletext}
-
-Es sollte aber eine Möglichkeit geben, diesem Umstand abzuhelfen. Es wäre
-zum Beispiel nett, wenn man den Text der Unterschrift etwas kleiner gestalten,
-extra Ränder festlegen oder den Zeichensatz des Bezeichners dem der
-Kapitelüberschriften anpassen könnte. So in etwa:
-
-\example*{size=small,margin=10pt,labelfont=bf,labelsep=endash}{\exampletext}
-
-Mit Hilfe dieses Paketes können Sie dies leicht bewerkstelligen; es sind viele
-vorgegebene Parameter einstellbar, Sie können aber auch eigene
-Gestaltungsmerkmale einfließen lassen.
-
-\bigskip
-
-\INFO\begin{minipage}[t]{\textwidth}
-\small
-Bitte beachten Sie, daß \thispackage\ nur das Aussehen der Beschriftungen
-kontrolliert. Es kontrolliert \emph{nicht} den Ort der Beschriftung;
-dieser kann aber mit anderen Paketen wie etwa dem
-\package{floatrow}"=Paket\cite{floatrow} variiert werden.
-\end{minipage}
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\tableofcontents
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\section{Verwendung des Paketes}
-\label{usage}
-
-\DescribeMacro{\usepackage}
-Durch
-\begin{quote}
- |\usepackage|\oarg{Optionen}|{caption}[|\texttt{\filedate}|]|
-\end{quote}
-in dem Vorspann des Dokumentes wird das \thispackage\ Paket eingebunden, die
-Optionen legen hierbei das Aussehen der Ãœber- und Unterschriften fest. So
-würde z.B.
-\begin{quote}
- |\usepackage[margin=10pt,font=small,labelfont=bf,|\\
- | labelsep=endash]{caption}|%
- %|[|\texttt{\filedate}|]|
-\end{quote}
-zu dem obrigen Ergebnis mit Rand, kleinerem Zeichensatz und fetter Bezeichnung
-führen.
-
-\DescribeMacro{\captionsetup}
-Eine Änderung der Parameter ist auch zu einem späteren Zeitpunkt jederzeit
-mit dem Befehl
-\begin{quote}
- |\captionsetup|\oarg{Typ}\marg{Optionen}
-\end{quote}
-möglich. So sind z.B. die Befehlssequenzen
-\begin{quote}
- |\usepackage[margin=10pt,font=small,labelfont=bf]{caption}|
-\end{quote}
-und
-\begin{quote}
- |\usepackage{caption}|\\
- |\captionsetup{margin=10pt,font=small,labelfont=bf}|
-\end{quote}
-in ihrer Wirkung identisch.
-
-Es ist zu beachten, daß sich die Verwendung von |\caption|\-|setup|
-innerhalb von Umgebungen nur auf die Umgebung selber auswirkt, nicht aber auf
-den Rest des Dokumentes.
-Möchte man also z.B. die automatische Zentrierung der Abbildungsunterschrift
-nur in einem konkreten Falle ausschalten, so kann dies mit
-\begin{quote}
- |\begin{figure}|\\
- | |\ldots\\
- | \captionsetup{singlelinecheck=off}|\\
- | \caption{|\ldots|}|\\
- |\end{figure}|
-\end{quote}
-geschehen, ohne daß die restlichen Abbildungsunterschriften hiervon
-beeinträchtigt werden.
-
-\begin{Annotation}
-Der optionale Parameter \meta{Typ} von |\caption|\-|setup| wird in
-\Ref{captionsetup} behandelt.
-\end{Annotation}
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\section{Optionen}
-\label{options}
-
-\def\OptionLabel{RaggedRight}
-\def\UserDefined{\ldots}
-
-% --------------------------------------------------------------------------- %
-
-\subsection{Formatierung}
-\label{formats}
-
-\DescribeMacro{format=}
-Eine Abbildungs- oder Tabellenbeschriftung besteht im wesentlichen aus drei
-Teilen: Dem Bezeichner (etwa "`Abbildung 3"'), dem Trenner
-(etwa "`:\textvisiblespace"') und dem eigentlichen Text.
-
-Mit der Option
-\begin{quote}
- |format=|\meta{Name}
-\end{quote}
-wird festgelegt, wie diese drei Teile zusammengesetzt werden.
-
-Für \meta{Name} sind folgende Möglichkeiten verfügbar:%~\footnote{Es gibt
-%hier wie auch bei vielen anderen Optionen die Möglichkeit, auch eigene
-%Formate, Zeichensätze etc.\ zu definieren. Wie dies geht wird in Abschnitt
-%\Ref{declare} dargelegt.}
-
-\begin{Options}{\OptionLabel}
- \item[plain]%\NEWdescription{v3.0h}
- Die Beschriftung wird als gewöhnlicher Absatz gesetzt.
-
- \item[hang]
- Der Text wird so gesetzt, daß er an dem Bezeichner "`hängt"', d.h.~der
- Platz unter dem Bezeichner und dem Trenner bleibt leer.
-
- \item[\UserDefined]
- Eigene Formate können mit |\Declare|\-|Caption|\-|Format| definiert werden.
- \SeeUserDefined
-\end{Options}
-
-\begin{Example}
- Ein Beispiel: Die Angabe der Option
- \begin{quote}
- |format=hang|
- \end{quote}
- führt zu Abbildungsunterschriften der Art
- \example{format=hang}{\exampletext}
-\end{Example}
-
-\pagebreak[3]
-\DescribeMacro{indention=}
-Bei beiden Formaten (\texttt{plain} und \texttt{hang}) kann der Einzug der
-Beschriftung ab der zweiten Textzeile angepasst werden, dies geschieht mit
-\begin{quote}
- |indention=|\meta{Einzug}\quad,
-\end{quote}
-wobei anstelle von \meta{Einzug} jedes beliebige feste Maß angegeben werden
-kann.
-
-Zwei Beispiele:
-
-\begin{Example}
- \begin{quote}
- |format=plain,indention=.5cm|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=plain,indention=.5cm}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |format=hang,indention=-0.5cm|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=hang,indention=-0.5cm}{\exampletext}
-\end{Example}
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{labelformat=}
-Mit der Option
-\nopagebreak[3]
-\begin{quote}
- |labelformat=|\meta{Name}
-\end{quote}
-\nopagebreak[3]
-%\NEWdescription{v3.0e}
-wird die Zusammensetzung des Bezeichners festgelegt.
-Für \meta{Name} sind folgende Möglichkeiten verfügbar:
-
-\begin{Options}{\OptionLabel}
- \item[default]
- Der Bezeichner wird wie von der verwendeten Dokumentenklasse vorgegeben gesetzt,
- üblicherweise ist dies der Name und die Nummer, getrennt durch ein Leerzeichen
- (wie \texttt{simple}).
- (Dies ist das Standardverhalten.)
-
- \item[empty]
- Der Bezeichner ist leer.
-\iffalse
- (Diese Option macht in der Regel nur in Verbindung mit
- anderen Optionen -- wie etwa \texttt{labelsep=none} -- Sinn.)
-\fi
-
- \item[simple]
- Der Bezeichner ist aus dem Namen und der Nummer zusammengesetzt.
-
- \item[brace]\NEWfeature{v3.1f}
- Der Bezeichner wird mit einer einzelnen (rechten) Klammer abgeschlossen.
-
- \item[parens]
- Die Nummer des Bezeichners wird in runde Klammern gesetzt.
-
- \item[\UserDefined]
- Eigene Formate können mit |\Declare|\-|Caption|\-|Label|\-|Format|
- definiert werden.
- \SeeUserDefined
-\end{Options}
-
-\begin{Example}
- Ein Beispiel: Die Optionen
- \begin{quote}
- |format=plain,labelformat=parens,labelsep=quad|
- \end{quote}
- führen zu Abbildungsunterschriften der Art
- \example{format=plain,labelformat=parens,labelsep=quad}{\exampletext}
-\end{Example}
-
-\medskip
-
-\begin{Note*}
-Manche Umgebungen, wie z.B.~die vom \package{algorithm2e}"=Paket angebotende
-|al|\-|go|\-|rithm|"=Umgebung, reagieren allergisch auf eine Änderung des
-Bezeichnerformats.
-\end{Note*}
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{labelsep=}
-Mit der Option
-\begin{quote}
- |labelsep=|\meta{Name}
-\end{quote}
-wird die Zusammensetzung des Trenners festgelegt.\footnote{%
- Wenn der Bezeichner oder der Text der Beschriftung leer ist,
- wird kein Trenner verwendet.}
-Für \meta{Name} sind folgende Möglichkeiten verfügbar:
-
-\begin{Options}{\OptionLabel}
- \item[none]
- Der Trenner ist leer.
-\iffalse
- (Diese Option macht in der Regel nur in Verbindung
- mit anderen Optionen -- wie etwa \texttt{labelformat=empty} -- Sinn.)
-\fi
-
- \item[colon]
- Der Trenner besteht aus einem Doppelpunkt und einem Leerzeichen.
-
- \item[period]
- Der Trenner besteht aus einem Punkt und einem Leerzeichen.
-
- \item[space]
- Der Trenner besteht lediglich aus einem einzelnen Leerzeichen.
-
- \item[quad]
- Der Trenner besteht aus einem |\quad|.
-
- \item[newline]
- Als Trenner wird ein Zeilenumbruch (|\\|) verwendet.
- Bitte beachten Sie, daß dieser Trenner nicht mit allen Formaten
- (z.B.~|format=|\x|hang|) zusammenarbeitet; ggf. erhalten Sie
- deswegen eine Fehlermeldung.
-
- \item[endash]\NEWfeature{v3.0h}
- Als Trenner wird ein Gedankenstrich (\verb*| -- |) verwendet.
-
- \item[\UserDefined]
- Eigene Trenner können mit |\Declare|\-|Caption|\-|Label|\-|Sep|\-|a|\-|ra|\-|tor|
- definiert werden.
- \SeeUserDefined
-\end{Options}
-
-Drei Beispiele:
-\begin{Example}
- \begin{quote}
- |format=plain,labelsep=period|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=plain,labelsep=period}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |format=plain,labelsep=newline,singlelinecheck=false|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=plain,labelsep=newline,singlelinecheck=false}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |format=plain,labelsep=endash|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=plain,labelsep=endash}{\exampletext}
-\end{Example}
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{textformat=}\NEWfeature{v3.0l}
-Mit der Option
-\nopagebreak[3]
-\begin{quote}
- |textformat=|\meta{Name}
-\end{quote}
-\nopagebreak[3]
-wird das Format des eigentlichen Textes festgelegt.
-Für \meta{Name} sind folgende Möglichkeiten verfügbar:
-
-\begin{Options}{\OptionLabel}
- \item[empty]
- Es wird kein Text ausgegeben.
-
- \item[simple]
- Der Text wird nicht verändert.
-
- \item[period]
- Dem Text wird ein Punkt angehängt.
-
- \item[\UserDefined]
- Eigene Textformate können mit |\Declare|\-|Caption|\-|Text|\-|Format|
- definiert werden.
- \SeeUserDefined
-\end{Options}
-
-% --------------------------------------------------------------------------- %
-
-\PageBreak
-\subsection{Textausrichtung}
-\label{justification}
-
-\DescribeMacro{justification=}
-Mit der Option
-\begin{quote}
- |justification=|\meta{Name}
-\end{quote}
-wird die Ausrichtung des Textes festgelegt.
-Für \meta{Name} sind folgende Möglichkeiten verfügbar:
-
-\begin{Options}{\OptionLabel}
- \item[justified]
- Der Text wird als Blocksatz gesetzt.
-
- \item[centering]
- Der Text wird zentriert gesetzt.
-
-% \item[Centering]
-% Der Text wird zentriert gesetzt. Hierfür wird jedoch im Gegensatz
-% zu \texttt{centering} der Befehl |\Centering| des \package{ragged2e}-Paketes
-% verwendet, der \LaTeX\ das Trennen der Worte erlaubt.
-
- \item[centerlast]
- Lediglich die letzte Zeile des Absatzes wird zentriert gesetzt.
-
- \item[centerfirst]
- Lediglich die erste Zeile des Textes wird zentriert gesetzt.
-
- \item[raggedright]
- Der Text wird linksbündig gesetzt.
-
-\iffalse
- \item[RaggedRight]
- Der Text wird linksbündig mit Hilfe des \package{ragged2e}-Paketes gesetzt.
-\else
- \item[RaggedRight]
- Der Text wird ebenfalls linksbündig gesetzt.
- Hierfür wird jedoch im Gegensatz zur Option |raggedright| der Befehl
- |\RaggedRight| des \package{ragged2e}-Paketes verwendet,
- der \LaTeX\ das Trennen der Worte erlaubt.\footnote{%
- Ob das \package{ragged2e}"=Paket benötigt wird oder nicht,
- wird zur Laufzeit ermittelt, d.h.~ggf.~ist ein weiterer \LaTeX"=Lauf
- erforderlich, wenn diese Option erstmalig eingesetzt wird.}
-\fi
-
- \item[raggedleft]
- Der Text wird rechtsbündig gesetzt.
-
-% \item[RaggedLeft]
-% Der Text wird rechtsbündig mit Hilfe des \package{ragged2e}-Paketes gesetzt.
-
-%\showhyphens{justification}
- \item[\UserDefined]
- Eigene Ausrichtungen können mit |\Declare|\-|Caption|\-|Jus|\-|ti|\-|fi|\-|ca|\-|tion|
- definiert werden.
- \SeeUserDefined
-\end{Options}
-
-Drei Beispiele:
-\begin{Example}
- \begin{quote}
- |format=plain,justification=centerlast|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=plain,justification=centerlast}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |format=hang,justification=raggedright|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=hang,justification=raggedright}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |format=plain,labelsep=newline,justification=centering|
- \end{quote}
- \captionsetup{skip=0pt}
- \example*{format=plain,labelsep=newline,justification=centering}{\exampletext}
-\end{Example}
-
-\smallskip
-
-\PageBreak
-\DescribeMacro{singlelinecheck=}
-In den Standard"=Dokumentenklassen von \LaTeX\ (\class{article},
-\class{report} und \class{book}) sind die Ab\-bildungs- und
-Tabellenbeschriftungen so realisiert, daß sie automatisch zentriert werden,
-wenn sie lediglich aus einer einzigen Textzeile bestehen:
-
-\example*{}{Eine kurze Beschriftung.}
-
-\INFO
-Diesen Mechanismus übernimmt \thispackage\ und ignoriert damit
-in der Regel bei solch kurzen Beschriftungen die mit den Optionen
-|justification=| und |indention=| eingestellte Textausrichtung.
-Dieses Verhalten kann jedoch mit der Option
-\begin{quote}
- |singlelinecheck=|\meta{bool}
-\end{quote}
-reguliert werden.
-Setzt man für \meta{bool} entweder |false|, |no|, |off| oder |0| ein,
-so wird der automatische Zentrierungsmechnismus außer Kraft gesetzt.
-Die obrige, kurze Abbildungsunterschrift würde z.B.~nach Angabe der Option
-\begin{quote}
- |singlelinecheck=false|
-\end{quote}
-so aussehen:
-
-\begingroup
- \captionsetup{type=figure}
- \ContinuedFloat
- \example*{singlelinecheck=false}{Eine kurze Beschriftung.}
-\endgroup
-
-Setzt man für \meta{bool} hingegen |true|, |yes|, |on| oder |1| ein, so
-wird die automatische Zentrierung wieder eingeschaltet. (Standardmäßig
-ist sie eingeschaltet.)
-
-% --------------------------------------------------------------------------- %
-
-\subsection{Zeichensätze}
-\label{fonts}
-
-\DescribeMacro{font=}
-\DescribeMacro{labelfont=}
-\DescribeMacro{textfont=}
-\Thispackage\ kennt drei Zeichensätze: Denjenigen für die gesammte
-Beschriftung (|font|), denjenigen, der lediglich auf den Bezeichner und den
-Trenner angewandt wird (|label|\-|font|), sowie denjenigen, der lediglich auf
-den Text wirkt (|text|\-|font|).
-So lassen sich die unterschiedlichen Teile der Beschriftung individuell mit
-\begin{quote}\begin{tabular}{@{}r@{}ll}
- |font=| & \marg{Zeichensatzoptionen} & ,\\
- |labelfont=| & \marg{Zeichensatzoptionen} & und\\
- |textfont=| & \marg{Zeichensatzoptionen} & \\
-\end{tabular}\end{quote}
-\nopagebreak[3]
-anpassen.
-\pagebreak[3]
-
-Als \meta{Zeichensatzoptionen} sind Kombinationen aus folgenden (durch Komma
-getrennte) Optionen möglich:
-
-\begin{Options}{stretch=\meta{amount}}
- \item[scriptsize] {\scriptsize Sehr kleine Schrift}
- \item[footnotesize] {\footnotesize Fußnotengröße}
- \item[small] {\small Kleine Schrift}
- \item[normalsize] {\normalsize Normalgroße Schrift}
- \item[large] {\large Große Schrift}
- \item[Large] {\Large Größere Schrift}
-\end{Options}
-\vspace{0pt}\pagebreak[3]
-\begin{Options}{stretch=\meta{amount}}
- \item[normalfont] {\normalfont Normale Schriftart \& -serie \& -familie}
-
- \item[up] {\upshape Upright Schriftart}
- \item[it] {\itshape Italic Schriftart}
- \item[sl] {\slshape Slanted Schriftart}
- \item[sc] {\scshape Small Caps Schriftart}
-
- \item[md] {\mdseries Medium Schriftserie}
- \item[bf] {\bfseries Bold Schriftserie}
-
- \item[rm] {\rmfamily Roman Schriftfamilie}
- \item[sf] {\sffamily Sans Serif Schriftfamilie}
- \item[tt] {\ttfamily Typewriter Schriftfamilie}
-\end{Options}
-\vspace{0pt}\pagebreak[3]
-\begin{Options}{stretch=\meta{amount}}
- \item[singlespacing] Einfacher Zeilenabstand \See{\Ref{setspace}}
- \item[onehalfspacing] Eineinhalbfacher Zeilenabstand \See{\Ref{setspace}}
- \item[doublespacing] Doppelter Zeilenabstand \See{\Ref{setspace}}
- \item[stretch=\meta{amount}] |\setstretch|\marg{amount} \See{\Ref{setspace}}
-\end{Options}
-\vspace{0pt}\pagebreak[3]
-\begin{Options}{stretch=\meta{amount}}
- \item[normalcolor] |\normalcolor|
- \item[color=\meta{colour}] |\color|\marg{colour}
- {\small(Sofern das \package{color}- oder das \package{xcolor}"=Paket
- geladen ist; für ein Beispiel siehe \Ref{declare})}
-\end{Options}
-\vspace{0pt}\pagebreak[3]
-\begin{Options}{stretch=\meta{amount}}
- \item[normal] Die Kombination aus den Optionen |normal|\-|color|,
- |normal|\-|font|, |normal|\-|size| und |single|\-|spacing|
-
- \item[\UserDefined]
- Eigene Zeichensatzoptionen können mit |\Declare|\-|Caption|\-|Font|
- definiert werden.
- \SeeUserDefined
-\end{Options}
-
-Wird lediglich eine einzelne Zeichensatzoption ausgewählt, können die
-geschweiften Klammern entfallen, d.h.~die Optionen
-%\begin{quote}
- |font={small}|
-%\end{quote}
-und
-%\begin{quote}
- |font=small|
-%\end{quote}
-sind identisch.
-
-Drei Beispiele:
-\begin{Example}
- \begin{quote}
- |font=it,labelfont=bf|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{font=it,labelfont=bf}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |labelfont=bf,textfont=it|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{labelfont=bf,textfont=it}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |font={small,stretch=0.80}|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{font={small,stretch=0.80}}{\exampletext}
-\end{Example}
-
-\medskip
-
-\pagebreak[3]
-\DescribeMacro{font+=}
-\DescribeMacro{labelfont+=}
-\DescribeMacro{textfont+=}
-\NEWfeature{v3.1f}
-Es ist auch möglich, Zeichensatzoptionen zu den bisher ausgewählten
-hinzuzufügen, so ist zum Beispiel
-\begin{quote}
- |\captionsetup{font=small}|\\
- |\captionsetup{font+=it}|
-\end{quote}
-mit
-\begin{quote}
- |\captionsetup{font={small,it}}|
-\end{quote}
-\nopagebreak[3]
-identisch.
-\pagebreak[3]
-
-% --------------------------------------------------------------------------- %
-
-\subsection{Ränder und Absätze}
-\label{margins}
-
-\DescribeMacro{margin=}
-\DescribeMacro{width=}
-Für die Abbildungs- und Tabellenbeschriftungen kann \emph{entweder} ein extra
-Rand \emph{oder} eine feste Breite festgelegt werden:~\footnote{Nur feste Maße
-sind hier gestattet. Suchen Sie nach einem Weg, die Breite automatisch auf die
-Breite der Abbildung oder Tabelle zu begrenzen, schauen Sie sich bitte das
-\package{floatrow}\cite{floatrow} oder
-\package{threeparttable}"=Paket\cite{threeparttable} an.}
-\begin{quote}\begin{tabular}{@{}r@{}ll}
- |margin=| & \meta{Rand} & \emph{-- oder --}\\
- |margin=| & |{|\meta{Linker Rand}|,|\meta{Rechter Rand}|}| & \emph{-- oder --}\\
- |width=| & \meta{Breite} & \\
-\end{tabular}\end{quote}
-\NEWfeature{v3.1}
-Wird nur ein Wert für den Rand angegeben, so wird er für beide Ränder
-(links und rechts) verwendet, so ist z.B.~|margin=|\x|10pt| identisch mit
-|margin=|\x|{10pt,10pt}|.
-In zweiseitigen Dokumenten wird der linke und rechte Rand auf geraden Seiten
-vertauscht.
-\DescribeMacro{oneside}
-\DescribeMacro{twoside}
-Dies kann jedoch mit der zusätzlichen Option |oneside| abgeschaltet werden,
-z.B.~|\caption|\-|setup{margin=|\x|{0pt,10pt},|\x|oneside}|.\par
-Wird hingegen eine \meta{Breite} angegeben, wird die Beschriftung zentriert,
-d.h.~der linke und rechte Rand sind in diesem Falle immer gleich groß.
-
-Drei Beispiele illustrieren dies:
-\begin{Example}
- \begin{quote}
- |margin=10pt|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{margin=10pt}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |margin={1cm,0cm}|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{margin={1cm,0cm}}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |width=.75\textwidth|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{width=.75\textwidth}{\exampletext}
-\end{Example}
-
-\begin{Note}
-Wird die Beschriftung neben der Abbildung bzw.~Tabelle angebracht (z.B.~mit
-Hilfe der |SC|\-|figure|"=Umgebung des \package{sidecap}"=Paketes\cite{sidecap}),
-oder wird die Abbildung bzw.~Tabelle innerhalb eines Absatzes gesetzt (z.B.~mit
-Hilfe der |wrap|\-|figure|"=Umgebung des \package{wrapfig}"=Paketes\cite{wrapfig}),
-dann wird der Rand am Anfang der Umgebung automatisch auf |0pt| zurückgesetzt.
-Soll hier ebenfalls ein extra Rand gesetzt werden, so kann dieser Rand entweder
-innerhalb der Umgebung neu gesetzt werden, oder aber global für bestimmte
-Umgebungen, z.B.~mit |\caption|\-|setup[SC|\-|figure]{margin=|\x|10pt}|.
-\end{Note}
-
-\begin{Expert}
-\DescribeMacro{margin*=}\NEWfeature{v3.1}
-Neben der Option |margin=| gibt es auch die Option |margin*=|, die nur dann
-einen Rand neu setzt, wenn keine Breite mit |width=| gesetzt wurde.
-\end{Expert}
-
-\begin{Expert}
-\DescribeMacro{minmargin=}
-\DescribeMacro{maxmargin=}\NEWfeature{v3.1}
-Weiterhin kann auch ein minimaler bzw.~maximaler Rand gesetzt werden.
-Dies kann z.B.~sinnvoll sein, um in schmaleren Umgebungen wie |minipage|s
-den Rand prozentual zu begrenzen.
-So begrenzen z.B.~die \SmF"=Dokumentenklassen den Rand auf
-|maxmargin=|\x|0.1\linewidth|. (Siehe \Ref{SMF})
-\end{Expert}
-
-\medskip
-
-\pagebreak[3]
-\DescribeMacro{parskip=}
-Diese Option wirkt auf Abbildungs- oder Tabellenbeschriftungen, die
-aus mehr als einem Absatz bestehen; sie legt den Abstand zwischen den
-Absätzen fest:
-\begin{quote}
- |parskip=|\meta{Abstand zwischen Absätzen}
-\end{quote}
-Ein Beispiel hierzu:
-\begin{Example}
- \begin{quote}
- |margin=10pt,parskip=5pt|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{margin=10pt,parskip=5pt}{%
- Erster Absatz der Beschriftung; dieser enthält einigen Text, so daß die
- Auswirkungen der Optionen deutlich werden.\par
- Zweiter Absatz der Beschriftung; dieser enthält ebenfalls einigen Text,
- so daß die Auswirkungen der Optionen deutlich werden.}
-\end{Example}
-
-\pagebreak[3]
-\DescribeMacro{hangindent=}
-Die Option
-\begin{quote}
- |hangindent=|\meta{Einzug}
-\end{quote}
-legt einen Einzug für alle Zeilen außer der jeweils ersten des Absatzes fest.
-Besteht die Beschriftung lediglich aus einem einzelnen Absatz, so ist die
-Wirkung mit der Option |indention=|\meta{Einzug} identisch, bei mehreren
-Absätzen zeigt sich jedoch der Unterschied:
-
-\begin{Example}
- \begin{quote}
- |format=hang,indention=-.5cm|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=hang,indention=-.5cm}{%
- Erster Absatz der Beschriftung; dieser enthält einigen Text, so daß die
- Auswirkungen der Optionen deutlich werden.\par
- Zweiter Absatz der Beschriftung; dieser enthält ebenfalls einigen Text,
- so daß die Auswirkungen der Optionen deutlich werden.}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |format=hang,hangindent=-.5cm|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=hang,hangindent=-.5cm}{%
- Erster Absatz der Beschriftung; dieser enthält einigen Text, so daß die
- Auswirkungen der Optionen deutlich werden.\par
- Zweiter Absatz der Beschriftung; dieser enthält ebenfalls einigen Text,
- so daß die Auswirkungen der Optionen deutlich werden.}
-\end{Example}
-
-\begin{Note}
-Enthält die Beschriftung mehr als einen Absatz, muß über das optionale
-Argument von |\caption| bzw.~|\caption|\-|of| eine alternative Beschriftung
-für das Abbildungs- bzw.~Tabellenverzeichnis angegeben werden;
-ansonsten kommt es zu einer Fehlermeldung.
-\end{Note}
-
-% --------------------------------------------------------------------------- %
-
-\pagebreak[3]
-\subsection{Stile}
-\label{style}
-
-\DescribeMacro{style=}
-Eine geeignete Kombination aus den bisher vorgestellten Optionen wird
-\textit{Stil} genannt; dies ist in etwa mit dem Seitenstil vergleichbar,
-den man mit |\page|\-|style| einstellen kann.
-
-Einen vordefinierten Abbildungs- bzw.~Tabellenbeschriftungsstil kann man mit der
-Option
-\begin{quote}
- |style=|\meta{Stil}
-\end{quote}
-auswählen. \Thispackage\ vordefiniert zwei Stile: |base| und |default|.
-
-\NEWfeature{v3.1}
-Der Stil |base| setzt alle bisher vorgestellten Optionen auf die Belegung
-zurück, die das Aussehen der Beschriftungen der Standard"=\LaTeX"=Dokumentenklassen
-|article|, |report| und |book| repräsentiert. D.h.~die Angabe der Option
-\begin{quote}
- |style=base|
-\end{quote}
-entspricht den Optionen
-\begin{quote}
- |format=plain,labelformat=default,labelsep=colon,|\\
- |justification=justified,font={},labelfont={},|\\
- |textfont={},margin=0pt,indention=0pt|\\
- |parindent=0pt,hangindent=0pt,singlelinecheck=true|\quad.
-\end{quote}
-\begin{Annotation*}
-Aber |justification=centering,indention=0pt| wird automatisch
-gewählt werden, wenn die Beschriftung in eine einzelne Zeile passt.
-\end{Annotation*}
-
-Der Stil |default| hingegen folgt den Standardwerten der verwendeten
-Dokumentenklasse. Dieser Stil wird vorausgewählt und entspricht den
-Optionen
-\begin{quote}
- |format=default,labelformat=default,labelsep=default,|\\
- |justification=default,font=default,labelfont=default,|\\
- |textfont=default,margin=0pt,indention=0pt|\\
- |parindent=0pt,hangindent=0pt,singlelinecheck=true|\quad.
-\end{quote}
-\begin{Annotation*}
-Auch hier wird |justification=centering,indention=0pt| automatisch
-gewählt werden, wenn die Beschriftung in eine einzelne Zeile passt.
-\end{Annotation*}
-
-Wenn also eine der drei Standard"=\LaTeX"=Dokumentenklassen verwendet wird,
-repräsentieren die Stile |base| und |default| (fast) die gleichen Einstellungen.
-
-\begin{Note}
-Eigene Stile können mit |\Declare|\-|Caption|\-|Style| definiert werden.
-\SeeUserDefined
-\end{Note}
-
-% --------------------------------------------------------------------------- %
-
-\subsection{Abstände}
-\label{skips}
-
-\DescribeMacro{skip=}\NEWfeature{v3.0d}
-Der vertikale Abstand zwischen der Beschriftung und der Abbildung
-bzw.~Tabelle wird über die Option
-\begin{quote}
- |skip=|\meta{Abstand}
-\end{quote}
-gesteuert.
-Die Standard"=\LaTeX"=Dokumentenklassen \class{article}, \class{report}
-und \class{book} belegen diesen Abstand auf |skip=|\x|10pt| vor,
-andere Dokumentenklassen ggf.~auf einen anderen Wert.
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{position=}
-Die von \LaTeX\ vorgegebene Implementierung von |\caption| birgt eine
-Design\-schwäche:
-Der |\caption| Befehl weiß dort nicht, ob er über oder unter der Abbildung
-bzw.~Tabelle steht, folglich weiß er auch nicht, wo er den Abstand zur
-Abbildung bzw.~Tabelle setzen soll.
-Während die Standard"=Implementierung den Abstand immer über die
-Beschriftung setzt (und inkonsequenterweise in |long|\-|table|"=Umgebungen
-unter die Beschriftung), handhabt es dieses Paket etwas flexibler:
-Nach Angabe der Option
-\begin{quote}
- |position=top|\quad oder\quad |position=above|
-\end{quote}
-wird angenommen, daß die Beschrifung am \emph{Anfang} der Umgebung
-steht, der mit |skip=|\x\meta{Abstand} gesetzte Abstand also unter die
-Beschriftung gesetzt wird.
-(Bitte beachten Sie, daß |position=|\x|top| keineswegs bedeutet, daß
-die Beschriftung an den Anfang der Gleitumgebung gesetzt wird.
-Stattdessen wird die Beschriftung gewöhnlich dort gesetzt, wo der
-|\caption|"=Befehl platziert wird.)
-Hingegen nach
-\begin{quote}
- |position=bottom|\quad oder\quad |position=below|
-\end{quote}
-wird angenommen, daß die Beschriftung am \emph{Ende} der Umgebung
-steht, der Abstand also über die Beschriftung gesetzt wird.
-Und letztendlich nach
-\begin{quote}
- |position=auto|\quad {\small(welches die Vorbelegung ist)}
-\end{quote}
-versucht \thispackage\ sein bestes, um die tatsächliche Position der
-Beschrifung selbst zu bestimmen. Bitte beachten Sie, daß dies zwar in
-der Regel gelingt, unter seltenen Umständen aber falsche Resultate
-liefern könnte.
-
-\medskip
-
-\pagebreak[3]
-\DescribeMacro{figureposition=}%\NEWfeature{v3.0a}
-\DescribeMacro{tableposition=}%\NEWfeature{v3.0a}
-Die Option |position| ist insbesondere in Verbindung mit dem optionalen
-Argument von |\caption|\-|setup| nützlich.
-\See{auch \Ref{captionsetup}}\par
-So führt zum Beispiel
-\begin{quote}
- |\captionsetup[table]{position=above}|
-\end{quote}
-dazu, daß alle Tabellenbeschriftungen als \emph{Überschriften} angesehen
-werden (zumindest was den Abstand zur Tabelle angeht).
-Weil dies eine übliche Einstellung ist, bietet einem \thispackage\ auch
-die Optionen |figure|\-|position=|\x\meta{Position} und
-|table|\-|position=|\x\meta{Position} als abkürzende Schreibweise.
-So ist z.B.
-\begin{quote}
- |\usepackage[|\ldots|,tableposition=top]{caption}|
-\end{quote}
-identisch mit
-\begin{quote}
- |\usepackage[|\ldots|]{caption}|\\
- |\captionsetup[table]{position=top}|\quad.
-\end{quote}
-
-\medskip
-
-\INFO
-Bitte beachten Sie, daß die Optionen |skip=|, |position=|,
-|figure|\-|position=| und |table|\-|position=| nicht immer einen Effekt haben.
-Da die Gleitumgebungen üblicherweise von den Dokumentenklassen bereitgestellt
-werden, kann es durchaus sein, daß diese ihre eigenen Abstandsregeln
-mitbringen.
-So befolgen z.B.~die \KOMAScript"=Dokumentenklassen die |skip=| Einstellung;
-Abbildungsbeschriftungen werden aber immer als Unterschriften behandelt,
-während die Tabellenbeschriftungen von dem Gebrauch der globalen
-Optionen |table|\-|captions|\-|above| bzw.\ |table|\-|captions|\-|below|
-abhängen.
-\See{\Ref{KOMA}}
-
-Weiterhin kontrollieren manche Pakete, wie etwa das \package{float}-, das
-\package{floatrow}- und das \package{supertabular}"=Paket, die Position
-ihrer Abstände selber.
-
-\bigskip
-
-\begin{Expert*}
-Intern wird der Abstand zwischen Beschriftung und Inhalt durch die Länge
-|\above|\-|caption|\-|skip| repräsentiert (welche die Implementation von
-\LaTeX\ immer über die Beschriftung setzt).
-Weiterhin gibt es eine zweite Länge, |\below|\-|caption|\-|skip|, die
-üblicherweise auf |0pt| vorbelegt ist und den Abstand auf der anderen
-Seite der Beschriftung regelt.
-Technisch gesprochen vertauscht also \thispackage\ die Bedeutungen dieser
-beiden Längen wenn |position=|\x|top| gesetzt ist.
-Bitte beachten Sie, daß diverse andere Pakete (wie etwa das \package{ftcap}-,
-das \package{nonfloat}- und das \package{topcap}"=Paket) den gleichen
-Kniff anwenden, so daß die Benutzung solcher Pakete zusammen mit der
-\package{caption}"=Option |position=| nicht unterstützt wird.
-\end{Expert*}
-
-% --------------------------------------------------------------------------- %
-
-\subsection{Listen}
-\label{lists}
-
-\DescribeMacro{list=}\NEWfeature{v3.1}
-Der Befehl |\caption| erzeugt normalerweise auch einen Eintrag in das
-Abbildungs- bzw.~Tabellenverzeichnis. Dies kann durch Angabe eines leeren
-optionalen Argumentes unterdrückt werden {\small(siehe \Ref{caption})},
-aber auch durch Angabe der Option
-\begin{quote}
- |list=no|\quad(oder |list=false| oder |list=off|)\quad.~\footnote{%
- Bitte beachten Sie, daß das \package{subfig}"=Paket\cite{subfig} diese
- Option nicht unterstützt, stattdessen sind dort ggf.~die Zähler
- \texttt{lofdepth} \& \texttt{lotdepth} anzupassen.}
-\end{quote}
-
-\pagebreak[3]
-\DescribeMacro{listformat=}\NEWfeature{v3.1}
-Mit der Option
-\nopagebreak[3]
-\begin{quote}
- |listformat=|\meta{Listformat}
-\end{quote}
-\nopagebreak[3]
-kann beeinflußt werden, wie die Abbildungs- bzw.~Tabellennummer im
-Abbildungs- bzw.~Tabellenverzeichnis erscheint.
-Es gibt fünf vordefinierte Listenformate:
-
-\begin{Options}{\OptionLabel}
- \item[empty]
- Es wird keine Nummer angegeben.
-
- \item[simple]
- Die Nummer wird (mit Zähler"=Prefix) angegeben.
-
- \item[parens]
- Die Nummer wird (mit Prefix) in Klammern angegeben.
-
- \item[subsimple]
- Wie |simple|, aber ohne Prefix. (Standard)
-
- \item[subparens]
- Wie |parens|, aber ohne Prefix.
-
- \item[\UserDefined]
- Eigene Listenformate können mit |\Declare|\-|Caption|\-|List|\-|Format|
- definiert werden.
- \SeeUserDefined
-\end{Options}
-
-Das Präfix ($=$|\p@figure| bzw.~|\p@table|), welches in Verzeichnissen (wie
-dem Abbildungs- und Tabellenverzeichnis) und bei Referenzen der Nummer
-($=$|\the|\-|figure| bzw.~|\the|\-|table|) vorangestellt wird,
-ist normalerweise leer, so daß die Listenformate |simple| und |subsimple|
-indentische Ergebnisse abliefern; ebenso |parens| und |subparens|.
-Aber dies kann z.B. bei Unterabbildungen anders sein.\footnote{%
- Unterabbildungen können z.B.~mit dem \package{subcaption}- oder
- \package{subfig}"=Paket gestaltet werden.}
-
-% --------------------------------------------------------------------------- %
-
-\subsection{Namen}
-\label{names}
-
-\DescribeMacro{name=}\NEWfeature{v3.1f}
-Die Option
-\begin{quote}
- |name=|\meta{name}
-\end{quote}
-ändert den Namen der \emph{aktuellen} Umgebung.
-Hiermit könnte man z.B.~den Bezeichner "`Abbildung"' in allen
-|wrap|\-|figure|"=Umgebungen nach "`Abb."' ändern (während woanders
-nach-wie-vor "`Abbildung"' stehen würde):
-\begin{quote}
- |\captionsetup[wrapfigure]{name=Abb.}|
-\end{quote}
-
-% --------------------------------------------------------------------------- %
-
-\subsection{Typen}
-\label{types}
-
-\DescribeMacro{type=}\NEWfeature{v3.0d}
-Der |\caption| Befehl kann verschiedene Gleitumgebungstypen beschriften,
-Abbildungen (|figure|) ebenso wie Tabellen (|table|).
-Außerhalb dieser Umgebungen führt die Verwendung von |\caption| jedoch zu
-einer Fehlermeldung, weil nicht klar ist, zu welchem Typ die Beschriftung
-gehören soll.
-In diesen Situationen kann man den Typ manuell mit
-\begin{quote}
- |type=|\meta{Typ}
-\end{quote}
-festlegen, so daß |\caption| (und andere Befehle wie |\Continued|\-|Float|
-oder |\sub|\-|caption|\-|box| des \package{subcaption}"=Paketes,
-oder |\sub|\-|float| des \package{subfig}"=Paketes\cite{subfig})
-das gewünschte Ergebnis liefern können;
-z.B.~innerhalb einer nicht-gleitenden Umgebung wie |minipage|:
-\begin{quote}
- |\noindent\begin{minipage}{\textwidth}|\\
- | \captionsetup{type=figure}|\\
- | \subfloat{|\ldots|}|\\
- | |\ldots\\
- | \caption{|\ldots|}|\\
- |\end{minipage}|
-\end{quote}
-
-\begin{Expert}
-Es existiert auch eine Stern"=Variante dieser Option, |type*=|\meta{Typ},
-die sich unterschiedlich verhält, wenn das
-\package{hyperref}"=Paket\cite{hyperref} geladen ist:
-Während |type=| einen Hyperlink"=Anker setzt (sofern |hypcap=|\x|true|
-gesetzt ist), tut dies |type*=| nicht.
-(Siehe auch \Ref{hyperref}\,)
-\end{Expert}
-\begin{Expert}
-\emph{\DefaultNoteText:} Bitte definieren Sie das interne Makro |\@captype|
-nicht, wie in manchen Dokumentationen vorgeschlagen wird, selber um,
-sondern verwenden Sie stattdessen immer |\caption|\-|setup{type=|\x\ldots|}|.
-\end{Expert}
-
-\medskip
-
-Eigene Typen können mit
- |\Declare|\-|Floating|\-|Environment| (angeboten vom \package{newfloat}"=Paket),
- |\new|\-|float| (angeboten vom \package{float}"=Paket\cite{float}) oder
- |\Declare|\-|New|\-|Float|\-|Type| (angeboten vom \package{floatrow}"=Paket\cite{floatrow}) definiert werden.
-
-\medskip
-
-\INFO % \NEWdescription{v3.1}
-Bitte verwenden Sie die Option |type=| nur \emph{innerhalb} von Boxen oder
-Umgebungen (wie |\par|\-|box| oder |mini|\-|page|), am besten solcher, wo
-kein Seitenumbruch innerhalb möglich ist, damit die Abbildung bzw.~Tabelle
-und die Beschriftung nicht durch einen solchen getrennt werden kann.
-Weiterhin können einige unschöne Nebeneffekte auftreten, wenn |type=|
-außerhalb einer Box oder Umgebung verwendet wird; daher wird in solchen
-Fällen eine Warnung ausgegeben.\footnote{%
-Sie erhalten diese Warnung nur dann, wenn Sie \eTeX\ verwenden.}
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\section{Befehle}
-
-\subsection{Setzen von Beschriftungen}
-\label{caption}
-\label{captionlistentry}
-
-\DescribeMacro{\caption}
-Der Befehl
-\begin{quote}
- |\caption|\oarg{Kurzform f"ur das Verzeichnis}\marg{Beschriftung}
-\end{quote}
-erzeugt eine Ãœber- bzw.~Unterschrift innerhalb einer gleitenden Umgebung
-wie |figure| oder |table|. Dies ist an sich nichts neues,
-hinzugekommen ist allerdings, daß kein Eintrag ins Abbildungs- oder
-Tabellenverzeichnis vorgenommen wird,
-wenn eine leere Kurzform angegeben wird, wie etwa hier:
-\begin{quote}
- |\caption[]{Dies ist eine Abbildung, die nicht ins|\\
- | Abbildungsverzeichnis aufgenommen wird}|
-\end{quote}
-
-\begin{Expert}
-Beachten Sie, daß die \meta{Beschriftung} ein \emph{wanderndes} Argument
-ist, solange keine \meta{Kurzform} angegeben ist. Ist hingegen eine
-\meta{Kurzform} angegeben, ist stattdessen diese wandernd.
-"`\emph{Wanderndes} Argument"' bedeutet, daß dieses Argument auch in die
-Datei geschrieben wird, die beim nächsten \LaTeX"=Lauf das Abbildungs-
-bzw. Tabellenverzeichnis bereitstellt.
-\emph{Wandernde} Argumente dürfen keine \emph{zerbrechliche} Befehle enthalten,
-alles muß hier \emph{robust} sein, ansonsten kann das Argument \emph{zerbrechen}
-und beim nächsten \LaTeX"=Lauf seltsame Fehlermeldungen hervorrufen.
-Einige \emph{zerbrechliche} Befehle können mit |\protect| vor dem
-\emph{Zerbrechen} geschützt werden; eigene Definitionen können mit
-|\Declare|\-|Robust|\-|Command| anstelle von |\new|\-|command| definiert werden,
-um sie \emph{robust} zu machen.
-
-Ein Beispiel: |\caption{${}^{137}_{\phantom{1}55}$Cs}| wird Fehlermeldungen
-zur Folge haben, da |\phantom| \emph{zerbrechlich} ist.
-Daher muß in so einem Fall entweder die \meta{Kurzform} bemüht werden
-(z.B.~|\caption[${}^|\x|{137}_|\x|{55}$|\x|Cs]|\x|{${}^|\x|{137}_|\x|{\phantom{1}55}$|\x|Cs}|)
-oder aber ein |\protect| ergänzt werden, um |\phantom| vor dem \emph{zerbrechen} zu schützen:
-|\caption{${}^|\x|{137}_|\x|{|\textcolor{blue}{\cs{protect}}|\phantom{1}55}$|\x|Cs}|.
-
-Manchmal ist dies allerdings nicht ausreichend. Der Grund ist darin zu finden,
-daß der Ein-Zeilen-Test die \meta{Beschriftung} in eine horizontale Box setzt,
-um die Breite zu bestimmen.
-Manche Umgebungen mögen dies nicht besonders und quittieren es mit einer
-Fehlermeldung.
-Ein Beispiel:
-|\caption{Ein| |Schema.| |\[V_{C}| |\sim| |\left| |\{| |\begin{array}{cc}|
-|E_{g}| |&| |\textrm{p-n}| |\\| |e\phi_{B}| |&| |\textrm{M-S}| |\end{array}|
-|\right.| |\]}|.
-Der Gebrauch des optionalen Argumentes \meta{Kurzform} mittels
-|\caption[Ein| |Schema]{|\ldots|}| ist hier nicht ausreichend, es kommt immer
-noch zu eine Fehlermeldung. (``\texttt{Missing \$ inserted.}'')
-Hier schafft es daher Abhilfe, den Ein-Zeilen-Test mittels
-|\caption|\-|setup{single|\-|line|\-|check=|\x|off}| direkt vor dem
-Betroffenen |\caption| Befehl auszuschalten.
-
-Mehr Informationen über \emph{wanderende} Argumente und \emph{zerbrechliche}
-\& \emph{robuste} Befehle finden sich in der gängigen \LaTeX"=Literatur, aber
-auch hier:
-\url{http://mirror.ctan.org/info/lshort/german/}
-und (in englischer Sprache) hier:
-\url{http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/teTeX/latex/latex2e-html/fragile.html}
-\end{Expert}
-
-\medskip
-
-\pagebreak[3]
-\DescribeMacro{\caption*}
-Das \package{longtable}"=Paket definiert zusätzlich zum Befehl |\caption| auch
-die Stern-Variante |\caption*|, die eine Beschriftung ohne Bezeichner und ohne
-Eintrag ins Tabellenverzeichnis erzeugt. So erzeugt z.B. der Code
-\begin{quote}
- |\begin{longtable}{|\ldots|}|\\
- | \caption*{Eine Tabelle}\\|\\
- | |\ldots\\
- |\end{longtable}|
-\end{quote}
-diese Tabelle:\par
-\DeleteShortVerb{\|}
-\vskip\intextsep
-\begin{minipage}{\linewidth}
- \captionsetup{type=table,position=t}
- \caption*{Eine Tabelle}
- \centering
- \begin{tabular}{r|rr}
- & x & y \\\hline
- a & 1 & 2 \\
- b & 3 & 4 \\
- \end{tabular}
-\end{minipage}
-\vskip\intextsep
-\MakeShortVerb{\|}
-\Thispackage\ bietet diesen Mechanismus auch für Abbildungs- und
-Tabellenbeschriftungen in Gleitumgebungen wie z.B. |table| an:
-\begin{quote}
- |\begin{table}|\\
- | \caption*{Eine Tabelle}|\\
-% | \begin{tabular}{|\ldots|}|\\
-% | |\ldots\\
-% | \end{tabular}|\\
- | |\ldots\\
- |\end{table}|
-\end{quote}
-
-\pagebreak[3]
-\DescribeMacro{\captionof}
-\DescribeMacro{\captionof*}
-Der Befehl |\caption| funktioniert in der Regel nur innerhalb von gleitenden
-Umgebungen, manchmal möchte man ihn jedoch auch außerhalb anwenden,
-etwa um eine Abbildung in eine nicht-gleitende Umgebung wie |mini|\-|page| zu
-setzen.\par
-Hierfür stellt \thispackage\ den Befehl
-\begin{quote}
- |\captionof|\marg{Umgebungstyp}\oarg{Kurzform}\marg{Langform}
-\end{quote}
-zur Verfügung. Die Angabe des Umgebungstypen ist hierbei notwendig, damit der
-gewünschte Bezeichner (wie z.B. "`Abbildung"' oder "`Tabelle"') gewählt wird
-und der Eintrag in das richtige Verzeichnis vorgenommen wird. Ein Beispiel:
-\begin{quote}
-% |\captionof{figure}{Eine Abbildung}|\\
- |\captionof{table}{Eine Tabelle}|
-\end{quote}
-führt zu folgendem Ergebnis:
-\begin{Example}
-% \begingroup
-% \captionof{figure}{Eine Abbildung}
-% \endgroup
- \captionsetup{position=top}
-% \begingroup
- \captionof{table}{Eine Tabelle}
-% \endgroup
-\end{Example}
-
-Analog zu |\caption*| gibt es auch den Befehl |\captionof*| für Beschriftungen
-ohne Bezeichner und ohne Verzeichniseintrag.
-
-\INFO % \NEWdescription{v3.1}
-Da |\caption|\-|of| intern die Option |type| verwendet, gelten hier die
-gleichen Einschränkungen wie für die Option |type|, d.h.~sowohl
-|\caption|\-|of| als auch |\caption|\-|of*| sollten nur \emph{innerhalb} von
-Boxen oder Umgebungen verwendet werden.
-\See{\Ref{types}}
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{\captionlistentry}\NEWfeature{v3.1}
-Unter gewissen Umständen kann es nützlich sein, lediglich einen Eintrag
-ins Abbildungs- bzw.~Tabellenverzeichnis vorzunehmen.
-Dies kann mit
-\begin{quote}
- |\captionlistentry|\oarg{Umgebungstyp}\marg{Verzeichniseintrag}
-\end{quote}
-bewerkstelligt werden.
-
-Ein Beispiel: Es ist recht einfach, eine |long|\-|table| anzulegen, die die
-Beschriftungen \emph{über} dem Tabelleninhalt hat, und wo der Listeneintrag
-auf die erste Seite der Tabelle verweist:
-\begin{quote}
- |\begin{longtable}{|\ldots|}|\\
- | \caption{|\ldots|}\\|\\
- |\endfirsthead|\\
- | \caption[]{|\ldots|}\\|\\
- |\endhead|\\
- | |\ldots
-\end{quote}
-Aber da das \package{longtable}"=Paket keinen |\end|\-|first|\-|foot| Befehl
-anbietet, kann dies nicht so einfach auf Beschritungen \emph{unter} dem
-Tabelleninhalt übertragen werden.
-Stattdessen kann man aber |\caption|\-|list|\-|entry| zum Einsatz bringen:
-\begin{quote}
- |\begin{longtable}{|\ldots|}|\\
- | \caption[]{|\ldots|}\\|\\
- |\endfoot|\\
- | \captionlistentry{|\ldots|}|\\
- | |\ldots
-\end{quote}
-
-\begin{Annotation*}
-Ein weiteres Anwendungsbeispiel findet sich in \Ref{examples}.
-\end{Annotation*}
-
-\begin{Expert}
-Es existiert auch eine Stern"=Variante, |\caption|\-|list|\-|entry*|, die
-den Umgebungszähler nicht erhöht.
-(Innerhalb von |long|\-|table| Umgebungen erhöht allerdings
-|\caption|\-|list|\-|entry| niemals den Tabellenzähler. Siehe auch
-\Ref{longtable}.)
-\end{Expert}
-
-\begin{Expert}
-Bitte beachten Sie, daß \meta{Verzeichniseintrag} ein \emph{wanderndes}
-Argument ist, hier also alles \emph{robust} sein muß.
-(Siehe auch Erklärung zu |\caption|)
-\end{Expert}
-
-\subsection{Anwenden von Optionen}
-\label{captionsetup}
-
-\DescribeMacro{\captionsetup}
-Den Befehl |\caption|\-|setup| haben wir ja schon im \Ref{usage} kennengelernt,
-uns dort allerdings die Bedeutung des optionalen Parameters
-\meta{Typ} aufgespart.
-Wir erinnern uns, die Syntax des Befehls lautet
-\begin{quote}
- |\captionsetup|\oarg{Typ}\marg{Optionen}\quad.
-\end{quote}
-Wird hier ein \meta{Typ} angegeben, so werden die Optionen nicht
-unmittelbar umgesetzt, sondern werden lediglich vermerkt und kommen erst dann
-zum Einsatz, wenn eine Ãœber- bzw.\ Unterschrift innerhalb der passenden
-(gleitenden) Umgebung gesetzt wird. So wirkt sich z.B. die Angabe
-\begin{quote}
- |\captionsetup[figure]|\marg{Optionen}
-\end{quote}
-lediglich auf die Unterschriften aus, die innerhalb der Umgebung |figure|
-gesetzt werden.
-
-Ein Beispiel:
-\begin{quote}
- |\captionsetup{font=small}|\\
- |\captionsetup[figure]{labelfont=bf,textfont=it}|
-\end{quote}
-liefert Abbildungs- und Tabellenunterschriften der Art:
-\begin{Example}
- \captionsetup{font=small}
- \captionsetup[figure]{labelfont=bf,textfont=it}
- \begingroup
- \captionof{figure}{Eine Abbildung}
- \endgroup
- \captionsetup{position=top}
- \begingroup
- \captionof{table}{Eine Tabelle}
- \endgroup
-\end{Example}
-Wie man sieht, führt das |\caption|\-|setup[figure]{|\ldots|}| dazu,
-daß lediglich die Abbildungsunterschriften mit fettem Bezeichner und kursivem
-Text gesetzt werden; alle anderen Unter- bzw.\ Ãœberschriften werden jedoch
-hiervon nicht beeinflusst.
-
-Als Umgebungstypen mit Unter- bzw.\ Ãœberschriften gibt es in der Regel nur
-zwei: |figure| und |table|. Wie wir jedoch später sehen werden, kommen durch die
-Verwendung spezieller \LaTeX-Pakete (wie etwa das \package{floatrow},
-\package{longtable} oder \package{sidecap}"=Paket) ggf.~weitere Typen hinzu,
-deren Beschriftungen ebenfalls derart individuell angepasst werden können.
-\See{\Ref{declare} und \Ref{packages}}
-
-\begin{Expert}
-\NEWfeature{v3.1}
-Es existiert auch eine Stern"=Variante von |\caption|\-|setup|:
-\begin{quote}
- |\captionsetup*|\oarg{Typ}\marg{Optionen}
-\end{quote}
-Während die Variante ohne Stern ggf.~zu Warnungen führt -- zum Beispiel wenn
-die \meta{Optionen} im Verlauf des Dokumentes nicht zum Einsatz kommen
-(wie z.B. |\caption|\-|setup[table]{font=|\x|sf}| ohne folgende |table|) --
-ist dies bei der Stern"=Variante nicht der Fall.
-\iffalse
-Dies kann sich z.B. bei der Entwicklung von generischen Designvorlagen als
-hilfreich erweisen.
-\fi
-\end{Expert}
-
-\medskip
-
-\pagebreak[3]
-\DescribeMacro{\clearcaptionsetup}
-Um vermerkte, typbezogene Parameter aus dem Gedächnis von \LaTeX\ zu löschen,
-gibt es den Befehl
-\begin{quote}
- |\clearcaptionsetup|\oarg{Option}\marg{Typ}\quad.
-\end{quote}
-
-|\clearcaptionsetup{figure}| würde z.B. die in dem obrigen Beispiel deklarierte
-Sonderbehandlung der Abbildungsunterschriften wieder aufheben:
-\begin{quote}
- |\captionsetup{font=small}|\\
- |\captionsetup[figure]{labelfont=bf,textfont=it}|\\
- \ldots\\
- | \caption{Eine Abbildung}|\\
- \ldots\\
- |\clearcaptionsetup{figure}|\\
- \ldots\\
- | \caption{Eine Abbildung}|\\
- \ldots
-\end{quote}
-\begin{Example}
- \captionsetup{font=small}
- \captionsetup[figure]{labelfont=bf,textfont=it}
- \begingroup
- \captionof{figure}{Eine Abbildung}
- \endgroup
- \captionsetup{position=top}
- \clearcaptionsetup{figure}
- \begingroup
- \captionof{figure}{Eine Abbildung}
- \endgroup
-\end{Example}
-
-\pagebreak[3]
-\NEWfeature{v3.1}
-Wird das optionale Argument \meta{Option} verwendet, werden nur die
-Einstellungen entfernt, die diese \meta{Option} betreffen.\footnote{%
-Es kann hier nur \emph{eine} Option angegeben werden; sollen mehrere
-Einstellungen entfernt werden, muß hierzu
-\cs{clear}\-\texttt{caption}\-\texttt{setup}
-mehrmals angewandt werden.}
-Während in dem obrigen Beispiel nicht nur die Optionen
-|labelfont=bf,|\x|textfont=it|
-für Abbildungen aufgehoben werden (sondern alle Einstellungen, die
-die Abbildungsbeschriftungen betreffen), würde der folgende Code
-nur die Einstellung |labelfont=bf| entfernen und alle anderen
-Einstellungen für Abbildungen intakt lassen:
-\begin{quote}
- |\captionsetup{font=small}|\\
- |\captionsetup[figure]{labelfont=bf,textfont=it}|\\
- \ldots\\
- | \caption{Eine Abbildung}|\\
- \ldots\\
- |\clearcaptionsetup[labelfont]{figure}|\\
- \ldots\\
- | \caption{Eine Abbildung}|\\
- \ldots
-\end{quote}
-\begin{Example}
- \captionsetup{font=small}
- \captionsetup[figure]{labelfont=bf,textfont=it}
- \begingroup
- \captionof{figure}{Eine Abbildung}
- \endgroup
- \captionsetup{position=top}
- \clearcaptionsetup[labelfont]{figure}
- \begingroup
- \captionof{figure}{Eine Abbildung}
- \endgroup
-\end{Example}
-\begin{Expert}
-Analog zu |\caption|\-|setup*| gibt es hier ebenfalls eine Stern"=Variante
-|\clear|\-|caption|\-|setup*|, die eventuell auftretende Warnungen unterdrückt,
-etwa wenn die angegebene \meta{Option} gar nicht für den angegebenen \meta{Typ}
-eingestellt war.
-\end{Expert}
-
-\medskip
-
-\pagebreak[3]
-\DescribeMacro{\showcaptionsetup}
-Für Debug"=Zwecke wird der Befehl
-\nopagebreak[3]
-\begin{quote}
- |\showcaptionsetup|\marg{Typ}
-\end{quote}
-\nopagebreak[3]
-bereitgestellt. Er erzeugt einen Eintrag in der Log"=Datei und zeigt dort
-die für den angegebenen \meta{Typ} eingestellten Optionen an.
-So gibt einem zum Beispiel
-\begin{quote}
- |\captionsetup[figure]{labelfont=bf,textfont=it}|\\
- |\showcaptionsetup{figure}|
-\end{quote}
-die Info:
-\begin{quote}\small
- |Caption Info: Option list on `figure'|\\
- |Caption Data: {labelfont=bf,textfont=it} on input line 5.|
-\end{quote}
-
-\pagebreak[3]
-\subsection{Fortlaufende Gleitumgebungen}
-\label{ContinuedFloat}
-
-\DescribeMacro{\ContinuedFloat}
-Manchmal möchte man Abbildungen oder Tabellen aufteilen, jedoch ohne den einzelnen
-Teilen eine eigene Abbildungs- oder Tabellennummer zu geben. Hierfür stellt
-\thispackage\ den Befehl
-\begin{quote}
- |\ContinuedFloat|
-\end{quote}
-zur Verfügung, der gleich als erstes innerhalb der nächsten (Gleit-)Umgebung(en)
-angewandt werden sollte.
-Er verhindert, daß die Zählung fortgeführt wird; eine Abbildung oder Tabelle,
-die ein |\Continued|\-|Float| enthält, bekommt also die gleiche Nummer
-wie die vorherige Abbildung oder Tabelle. Ein Beispiel:
-\begin{quote}
- |\begin{table}|\\
- | \caption{Eine Tabelle}|\\
- | |\ldots\\
- |\end{table}|\\
- \ldots\\
- |\begin{table}\ContinuedFloat|\\
- | \caption{Eine Tabelle (Fortsetzung)}|\\
- | |\ldots\\
- |\end{table}|
-\end{quote}
-ergibt als Ergebnis:
-\begin{Example}
- \captionsetup{type=table,position=b,skip=0pt}
- \caption{Eine Tabelle}
- \centerline{\ldots}
-\end{Example}
-\begin{Example}
- \captionsetup{type=table,position=b,skip=0pt}
- \ContinuedFloat
- \caption{Eine Tabelle (Fortsetzung)}
- \centerline{\ldots}
-\end{Example}
-
-\bigskip
-
-\NEWfeature{v3.1}
-Zusätzlich führt der |\Continued|\-|Float| Befehl auch Einstellungen aus, die
-mit dem Typ "`|Continued|\-|Float|"' verknüpft sind. Dies kann zum Beispiel
-verwendet werden, um automatisch für fortgesetzte Abbildungen oder Tabellen
-auf ein anderes Bezeichner- oder Textformat umzuschalten, wie etwa hier:
-\begin{quote}
- |\DeclareCaptionLabelFormat{continued}{#1~#2 (Fortsetzung)}|\\
- |\captionsetup[ContinuedFloat]{labelformat=continued}|\\
- \ldots\\
- |\begin{table}\ContinuedFloat|\\
- | \caption{Eine Tabelle}|\\
- | |\ldots\\
- |\end{table}|
-\end{quote}
-\begin{Example}
- \captionsetup{type=table,position=b,skip=0pt}
- \captionsetup[ContinuedFloat]{labelformat=continued1}
- \ContinuedFloat
- \caption{Eine Tabelle}\label{continued1}
- \centerline{\ldots}
-\end{Example}
-\smallskip
-\See{\Ref{declare} für die Erläuterung des Befehls
- \cs{Declare}\-\texttt{Caption}\-\texttt{Label}\-\texttt{Format}.}
-
-\medskip
-
-Weiterhin existiert auch ein \LaTeX"=Zähler namens |Continued|\-|Float|,
-der auch für eigene Zwecke eingesetzt werden kann.
-Für gewöhnliche (gleitende) Umgebungen ist er auf Null gesetzt, auf Eins
-in der ersten fortgeführten Umgebung, Zwei in der nächsten und so weiter.
-Jedes |\Continued|\-|Float| erhöht also diesen Zähler um Eins, während
-eine Gleitumgebung ohne |\Continued|\-|Float| den Zähler auf Null zurücksetzt.
-Ein Beispiel:
-\begin{quote}
- |\DeclareCaptionLabelFormat{cont}{#1~#2\alph{ContinuedFloat}}|\\
- |\captionsetup[ContinuedFloat]{labelformat=cont}|\\
- \ldots\\
- |\begin{table}\ContinuedFloat|\\
- | \caption{Eine Tabelle}|\\
- | |\ldots\\
- |\end{table}|
-\end{quote}
-\begin{Example}
- \captionsetup{type=table,position=b,skip=0pt}
- \captionsetup[ContinuedFloat]{labelformat=continued2}
- \ContinuedFloat
- \caption{Eine Tabelle}\label{continued2}
- \centerline{\ldots}
-\end{Example}
-\medskip
-Eine Referenz auf diese Tabelle würde "`\autoref{continued2}"' ergeben,
-da lediglich das Format der Tabellenbeschriftung geändert wurde.
-Sollen Referenzen ebenfalls diesen Zähler enthalten, so kann stattdessen der
-Befehl |\the|\-|Continued|\-|Float| passend umdefiniert werden.
-Dieser Befehl wird automatisch bei der Anwendung von |\Continued|\-|Float|
-dem Abbildungs- bzw.~Tabellenzähler angehängt und hat normalerweise einen
-leeren Inhalt.
-\begin{quote}
- |\renewcommand\theContinuedFloat{\alph{ContinuedFloat}}|\\
- \ldots\\
- |\begin{table}\ContinuedFloat|\\
- | \caption{Eine Tabelle}|\\
- | |\ldots\\
- |\end{table}|
-\end{quote}
-\begin{Example}
- \captionsetup{type=table,position=b,skip=0pt}
- \renewcommand\theContinuedFloat{\alph{ContinuedFloat}}
- \ContinuedFloat
- \caption{Eine Tabelle}\label{continued3}
- \centerline{\ldots}
-\end{Example}
-\medskip
-Eine Referenz auf diese Tabelle würde nun "`\autoref{continued3}"' ergeben.
-
-\pagebreak[3]
-\DescribeMacro{\ContinuedFloat*}
-Angenommen man möchte gerne die erste Abbildung oder Tabelle einer
-fortlaufenden Serie mit einer Beschriftung der Art "`Abbildung 7a"' und
-nicht mit "`Abbildung 7"' beschriften. (Und die zweite entsprechend mit
-"`Abbildung 7b"' statt "`Abbildung 7a"'.)
-Dies ist auch möglich, indem man die Stern"=Variante |\Continued|\-|Float*|
-anwendet.
-Diese führt genau wie |\ContinuedFloat| auch die mit "`|Continued|\-|Float|"'
-verknüpften Optionen aus und erhöht den \LaTeX"=Zähler |Continued|\-|Float|,
-markiert aber die erste Abbildung bzw.~Tabelle einer fortlaufenden Serie:
-\begin{quote}
- |\renewcommand\theContinuedFloat{\alph{ContinuedFloat}}|\\
- \ldots\\
- |\begin{figure}\ContinuedFloat*|\\
- | |\ldots\\
- | \caption{Erste Abbildung einer Serie}|\\
- |\end{figure}|\\
- \ldots\\
- |\begin{figure}\ContinuedFloat|\\
- | |\ldots\\
- | \caption{Zweite Abbildung einer Serie}|\\
- |\end{figure}|\\
- \ldots\\
- |\begin{figure}\ContinuedFloat|\\
- | |\ldots\\
- | \caption{Dritte Abbildung einer Serie}|\\
- |\end{figure}|
-\end{quote}
-\begin{Example}
- \captionsetup{type=figure,position=b,skip=0pt}
- \renewcommand\theContinuedFloat{\alph{ContinuedFloat}}
- \begingroup
- \ContinuedFloat*
- \centerline{\ldots}
- \caption{Erste Abbildung einer Serie}
- \endgroup
- \begingroup
- \ContinuedFloat
- \centerline{\ldots}
- \caption{Zweite Abbildung einer Serie}
- \endgroup
- \begingroup
- \ContinuedFloat
- \centerline{\ldots}
- \caption{Dritte Abbildung einer Serie}
- \endgroup
-\end{Example}
-\smallskip
-\Note{Leider ist \cs{ContinuedFloat*} nicht verfügbar, wenn das
- \package{subfig}"=Paket\cite{subfig} geladen ist.}
-
-\pagebreak[3]
-\subsubsection*{Eine Anmerkung zur longtable-Umgebung}
-Möchten Sie hingegen bei fortgeführten |long|\-|table|"=Umgebungen einen
-anderen Bezeichner (nach einem Seitenumbruch), so kann dies \emph{nicht}
-mit |\Continued|\-|Float| bewerkstelligt werden, aber mit Hilfe der vom
-\package{longtable}"=Paket\cite{longtable} bereitgestellten Befehle
-|\end|\-|first|\-|head| und |\end|\-|head|; in etwa so:
-\begin{quote}
- |\DeclareCaptionLabelFormat{continued}{#1~#2 (Fortsetzung)}|\\
- \ldots\\
- |\begin{longtable}{|\ldots|}|\\
- | \caption{Eine mehrseitige Tabelle}\\|\\
- |\endfirsthead|\\
- | \captionsetup{labelformat=continued}|\\
- | \caption[]{Eine mehrseitige Tabelle}\\|\\
- |\endhead|\\
- | |\ldots\\
- |\end{longtable}|
-\end{quote}
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\section{Eigene Erweiterungen}
-\label{declare}
-
-Wem die vorhandenen Formate, Trenner, Textausrichtungen, Zeichensätze und Stile
-nicht ausreichen, der hat die Möglichkeit, sich eigene zu definieren. Hierzu
-gibt es eine Reihe von Befehlen, die in der Prämbel des Dokumentes (das ist der
-Teil zwischen |\document|\-|class| und |\begin{document}|) zum Einsatz kommen.
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\Format}
-Eigene Formate können mit dem Befehl
-\begin{quote}
- |\DeclareCaptionFormat|\marg{Name}\marg{Code mit \#1, \#2 und \#3}
-\end{quote}
-definiert werden.
-Für \#1 wird später der Bezeichner, für \#2 der Trenner
-und für \#3 der Text eingesetzt. So ist z.B. das Standardformat |plain|,
-welches die Beschriftung als gewöhnlichen Absatz formatiert,
-in diesem Paket so vordefiniert:
-\begin{quote}
- |\DeclareCaptionFormat{plain}{#1#2#3\par}|
-\end{quote}
-\begin{Expert}
-Es gibt auch eine Stern"=Variante, |\Declare|\-|Caption|\-|Format*|, die den
-Code nicht in \TeX s horizontalem Modus, sondern im vertikalen Modus setzt,
-aber die |indention=| Option nicht unterstützt.
-\end{Expert}
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\LabelFormat}
-Ähnlich können auch eigene Bezeichnerformate definiert werden:
-\begin{quote}
- |\DeclareCaptionLabelFormat|\marg{Name}\marg{Code mit \#1 und \#2}
-\end{quote}
-Bei den Bezeichnerformaten wird hierbei für \#1 der Name (also z.B.
-"`Abbildung"'), für \#2 die Nummer (also z.B. "`12"') eingesetzt.
-Ein Beispiel:
-\begin{quote}
- |\DeclareCaptionLabelFormat{bf-parens}{(\textbf{#2})}|\\
- |\captionsetup{labelformat=bf-parens,labelsep=quad}|
-\end{quote}
-\example*{labelformat=bf-parens,labelsep=quad}{\exampletext}
-
-\pagebreak[3]
-\DescribeMacro{\bothIfFirst}
-\DescribeMacro{\bothIfSecond}
-Bei der Definition von eigenen Bezeichnerformaten gibt es eine Besonderheit zu
-beachten: Wird das Bezeichnerformat auch in Verbindung mit dem
-\package{subcaption} oder \package{subfig}"=Paket\cite{subfig} verwendet,
-so kann der Bezeichnername (also \#1) auch leer sein.
-Um dies flexibel handhaben zu können, stellt \thispackage\ die Befehle
-\begin{quote}
- |\bothIfFirst|\marg{Erstes Argument}\marg{Zweites Argument}\quad und\\
- |\bothIfSecond|\marg{Erstes Argument}\marg{Zweites Argument}
-\end{quote}
-zur Verfügung.
-|\bothIfFirst| testet, ob das erste Argument nicht leer ist,
-|\bothIfSecond|, ob das zweite Argument nicht leer ist.
-Nur wenn dies der Fall ist, werden beide Argumente ausgegeben,
-ansonsten werden beide unterdrückt.
-
-\smallskip
-
-\pagebreak[3]
-So ist z.B. das Standard"=Bezeichnerformat |simple| nicht, wie man
-naiverweise annehmen könnte, als
-\begin{quote}
- |\DeclareCaptionLabelFormat{simple}{#1~#2}|
-\end{quote}
-definiert, weil dies zu einem störendem führenden Leerzeichen führen würde,
-sollte \#1 leer sein. Stattdessen kommt folgende Definition zum Einsatz,
-die sowohl mit |\caption| als auch mit |\sub|\-|caption| bzw.~|\sub|\-|float|
-harmoniert:
-\begin{quote}
- |\DeclareCaptionLabelFormat{simple}%|\\
- | {\bothIfFirst{#1}{~}#2}|\mbox{\quad,}
-\end{quote}
-d.h.~das Leerzeichen kommt nur dann zum Einsatz, wenn \#1 nicht leer ist.
-
-\smallskip
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\TextFormat}\NEWfeature{v3.0l}
-Ebenso können eigene Textformate definitiert werden:
-\begin{quote}
- |\DeclareCaptionTextFormat|\marg{Name}\marg{Code mit \#1}
-\end{quote}
-An die Stelle von \#1 wird später der Beschriftungstext eingesetzt.
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\LabelSeparator}
-Eigene Trenner werden mit
-\begin{quote}
- |\DeclareCaptionLabelSeparator|\marg{Name}\marg{Code}
-\end{quote}
-definiert. Auch hier wieder als einfaches Beispiel eine Definition innerhalb
-des \package{caption}"=Paketes selber:
-\begin{quote}
- |\DeclareCaptionLabelSeparator{colon}{: }|
-\end{quote}
-\begin{Expert}
-Es gibt auch eine Stern"=Variante, |\Declare|\-|Caption|\-|Label|\-|Separator*|,
-die den Code ohne den mit |label|\-|font=| eingestellten Zeichensatz setzt.
-Auf diese Art sind z.B. die Trenner |quad|, |new|\-|line| und |en|\-|dash|
-vordefiniert.
-\end{Expert}
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\Justification}
-Eigene Textausrichtungen können mit
-\begin{quote}
- |\DeclareCaptionJustification|\marg{Name}\marg{Code}
-\end{quote}
-definiert werden.
-Der \meta{Code} wird dann der Beschriftung vorangestellt,
-so führt z.B. die Verwendung der bereits vordefinierten Ausrichtung
-\begin{quote}
- |\DeclareCaptionJustification{raggedright}{\raggedright}|
-\end{quote}
-dazu, daß alle Zeilen der Beschriftung linksbündig ausgegeben werden.
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\Font}
-Eigene Zeichensatzoptionen können mit
-\begin{quote}
- |\DeclareCaptionFont|\marg{Name}\marg{Code}
-\end{quote}
-definiert werden.
-So sind z.B. die Optionen |small| und |bf| folgendermaßen vordefiniert:
-\begin{quote}
- |\DeclareCaptionFont{small}{\small}|\quad und\\
- |\DeclareCaptionFont{bf}{\bfseries}|\quad.
-\end{quote}
-\iffalse
-Die Zeilenabstände ließen sich z.B.~über das \package{setspace}"=Paket
-regeln:%\NEWdescription{v3.0h}
-\begin{quote}
- |\usepackage{setspace}|\\
- |\DeclareCaptionFont{singlespacing}{\setstretch{1}}|~\footnote{%
- \emph{\DefaultNoteText:} \cs{singlespacing} kann hier nicht benutzt werden,
- da es ein \cs{vskip} Kommando enthält.}\\
- |\DeclareCaptionFont{onehalfspacing}{\onehalfspacing}|\\
- |\DeclareCaptionFont{doublespacing}{\doublespacing}|\\
- |\captionsetup{font={onehalfspacing,small},labelfont=bf}|
-\end{quote}
-\example{font={onehalfspacing,small},labelfont=bf,singlelinecheck=off}{\exampletext}
-\fi
-Ein Beispiel, welches Farbe ins Spiel bringt:
-\begin{quote}
- |\usepackage{color}|\\
- |\DeclareCaptionFont{red}{\color{red}}|\\
- |\DeclareCaptionFont{green}{\color{green}}|\\
- |\DeclareCaptionFont{blue}{\color{blue}}|\\
- |\captionsetup{labelfont={blue,bf},textfont=green}|
-\end{quote}
-\example*{labelfont={color=blue,bf},textfont={color=green},singlelinecheck=off}{\exampletext}
-Aber da \thispackage\ schon die pfiffige Definition
-\begin{quote}
- |\DeclareCaptionFont{color}{\color{#1}}|
-\end{quote}
-beinhaltet, kann man das selbe Resultat auch einfach mit
-\begin{quote}
- |\usepackage{color}|\\
- |\captionsetup{labelfont={color=blue,bf},|\\
- | textfont={color=green}}|
-\end{quote}
-erreichen.
-
-\medskip
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\Style}
-Eigene Stile werden folgendermaßen definiert:
-\begin{quote}
- |\DeclareCaptionStyle|\marg{Name}\oarg{zusätzliche Optionen}\marg{Optionen}
-\end{quote}
-Stile sind einfach eine Ansammlung von geeigneten Einstellungen, die unter
-einem eigenen Namen zusammengefasst werden und mit der Paketoption
-|style=|\meta{Name} zum Leben erweckt werden können.
-
-Hierbei ist zu beachten, daß die so definierten Stile immer auf dem Stil |base|
-basieren (siehe auch \Ref{style}), es brauchen also nur davon abweichende
-Optionen angegeben werden.
-
-Sind \meta{zusätzliche Optionen} angegeben, so kommen diese automatisch
-zusätzlich zum Einsatz, sofern die Beschreibung in eine einzelne Zeile passt
-und diese Abfrage nicht mit |single|\-|line|\-|check=off| ausgeschaltet wurde.
-
-Als Beispiel muß mal wieder eine einfache Definition innerhalb dieses Paketes
-herhalten: Der Stil |base| ist vordefiniert als
-\begin{quote}
- |\DeclareCaptionStyle{base}%|\\
- | [justification=centering,indention=0pt]{}|\quad.
-\end{quote}
-
-Etwas spannenderes:
-\begin{quote}
- |\DeclareCaptionStyle{mystyle}%|\\
- | [margin=5mm,justification=centering]%|\\
- | {font=footnotesize,labelfont=sc,margin={10mm,0mm}}|\\
- |\captionsetup{style=mystyle}|
-\end{quote}
-liefert einem Beschriftungen wie diese hier:
-\begin{Example}
- \captionsetup{type=figure,style=mystyle,position=b}
- \caption{Eine kurze Beschriftung.}
- \caption{Eine sehr sehr sehr sehr sehr sehr sehr sehr sehr
- sehr sehr sehr sehr sehr sehr sehr sehr sehr
- sehr sehr sehr sehr sehr sehr sehr sehr lange Beschriftung.}
-\end{Example}
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\ListFormat}\NEWfeature{v3.1}
-Eigene Listenformate können mit
-\begin{quote}
- |\DeclareCaptionListFormat|\marg{Name}\marg{Code mit \#1 und \#2}
-\end{quote}
-definiert werden.
-Im Laufe des Dokumentes wird \#1 dann mit dem Bezeichner"=Präfix
-(z.B.~|\p@figure|), und \#2 mit der Referenznummer (z.B.~|\the|\-|figure|) ersetzt.
-
-% --------------------------------------------------------------------------- %
-
-\pagebreak[3]
-\subsection{Weiterführende Beispiele}
-\label{examples}
-
-\subsubsection*{Beispiel 1}
-
-%\NEWdescription{v3.1}
-Möchte man die Bezeichnung (inkl. Trenner wie Doppelpunkt) vom Text mit einem
-Zeilenumbruch getrennt haben, so ließe sich das (auch) so bewerkstelligen:
-\begin{quote}
- |\DeclareCaptionFormat{myformat}{#1#2\\#3}|
-\end{quote}
-Wählt man anschließend dieses Format mit |\caption|\-|setup{format=|\x|myformat}| aus,
-so erhält man Beschriftungen der Art:
-%\begin{Example}
-% \captionsetup{skip=0pt}
- \example{format=myformat1,labelfont=bf}{\exampletext}
-%\end{Example}
-Auch einen Einzug könnte man diesem Format mit auf den Weg geben:
-\begin{quote}
- |\captionsetup{format=myformat,indention=1cm}|
-\end{quote}
-führt zu Beschriftungen wie:
-%\begin{Example}
-% \captionsetup{skip=0pt}
- \example{format=myformat1,indention=1cm,labelfont=bf}{\exampletext}
-%\end{Example}
-Aber Sie möchten den Einzug nur auf die erste Zeile des Texts anwenden?
-Kein Problem, so würde z.B.~die Definition
-\begin{quote}
- |\newlength\myindention|\\
- |\DeclareCaptionFormat{myformat}%|\\
- | {#1#2\\\hspace*{\myindention}#3}|\\
- \ldots\\
- |\setlength\myindention{1cm}|\\
- |\captionsetup{format=myformat}|
-\end{quote}
-zu Beschriftungen dieser Art führen:
-%\begin{Example}
-% \captionsetup{skip=0pt}
- \example{format=myformat2,myindention=1cm,labelfont=bf}{\exampletext}
-%\end{Example}
-Zu der Länge |\myindention| hätten Sie gerne eine Option, so daß man diesen
-Einzug auch z.B.~mit |\caption|\-|setup|\x|[figure]|\x|{myindention=|\ldots|}| setzen kann?
-Auch dies läßt sich bewerkstelligen, z.B.~folgendermaßen:
-\begin{quote}
- |\newlength\myindention|\\
- |\DeclareCaptionOption{myindention}%|\\
- | {\setlength\myindention{#1}}|\\
- |\DeclareCaptionFormat{myformat}%|\\
- | {#1#2\\\hspace*{\myindention} #3}|\\
- \ldots\\
- |\captionsetup{format=myformat,myindention=1cm}|
-\end{quote}
-
-\subsubsection*{Beispiel 2}
-
-Die Beschriftungen sollen wie folgt aussehen:
-%\begin{Example}
-% \captionsetup{skip=0pt}
- \example{format=reverse,labelformat=fullparens,labelsep=fill,labelfont=it}{\exampletext}
-%\end{Example}
-\pagebreak[2]
-Dies ließe sich beispielsweise wie folgt realisieren:
-\nopagebreak[3]
-\begin{quote}
- |\DeclareCaptionFormat{reverse}{#3#2#1}|\\
- |\DeclareCaptionLabelFormat{fullparens}%|\\
- | {(\bothIfFirst{#1}{~}#2)}|\\
- |\DeclareCaptionLabelSeparator{fill}{\hfill}|\\
- |\captionsetup{format=reverse,labelformat=fullparens,|\\
- | labelsep=fill,font=small,labelfont=it}|
-\end{quote}
-
-\subsubsection*{Beispiel 3}
-
-Der Bezeichner soll in den linken Rand verlagert werden,
-so daß die komplette Absatzbreite der Beschriftung selber zugute kommt:
-\begin{quote}
- |\DeclareCaptionFormat{llap}{\llap{#1#2}#3\par}|\\
- |\captionsetup{format=llap,labelsep=quad,singlelinecheck=no}|
-\end{quote}
-Das Ergebnis wären Beschriftungen wie diese:
-\example{format=llap,labelsep=quad,singlelinecheck=no,margin=0pt}{\exampletext}
-
-\medskip
-
-Soll der Einzug in den Rand eine feste Größe sein (z.B.~$2.5$\,cm),
-so könnte hierfür eine Kombination aus |\llap| und |\makebox| angewandt werden,
-zum Beispiel:
-\begin{quote}
- |\DeclareCaptionFormat{llapx}%|\\
- | {\llap{\makebox[2.5cm][l]{#1}}#3\par}|\\
- |\captionsetup{format=llapx,singlelinecheck=off}|
-\end{quote}
-\example{format=llapx,singlelinecheck=off,skip=0pt,margin=0pt}{\exampletext}
-
-\subsubsection*{Beispiel 4}
-
-Dieses Beispiel setzt eine Abbildung neben eine Tabelle, aber verwendet eine
-einzige, kombinierte Beschriftung für beide. Dies wird durch eine Kombination
-aus |\Declare|\-|Caption|\-|Label|\-|Format| und |\caption|\-|list|\-|entry|
-realisiert:
-\begin{quote}
- |\DeclareCaptionLabelFormat{andtable}%|\\
- | {#1~#2 \& \tablename~\thetable}|\\
- \ldots\\
- |\begin{figure}|\\
- | \centering|\\
- | \includegraphics{|\ldots|}%|\\
- | \qquad|\\
- | \begin{tabular}[b]{\ldots}|\\
- | |\ldots\\
- | \end{tabular}|\\
- | \captionlistentry[table]{|\ldots|}|\\
- | \captionsetup{labelformat=andtable}|\\
- | \caption{|\ldots|}|\\
- |\end{figure}|
-\end{quote}
-\DeleteShortVerb{\|}%
-\noindent\begin{minipage}{\linewidth}
- \captionsetup{type=figure}
- \centering
- \includegraphics[width=30pt]{cat}%
- \qquad
- \begin{tabular}[b]{r|rr}
- & x & y \\\hline
- a & 1 & 2 \\
- b & 3 & 4 \\
- \end{tabular}
- \captionlistentry[table]{Eine Abbildung und Tabelle mit gemeinsamer Beschriftung}
- \captionsetup{labelformat=andtable}
- \caption{Eine Abbildung und Tabelle mit gemeinsamer Beschriftung~\footnotemark}
-\end{minipage}
-\footnotetext{Das Katzenbild wurde den Beispielen zum \LaTeX"=Begleiter\cite{TLC2}
- entnommen, die Erlaubnis hierzu wurde eingeholt.}
-\MakeShortVerb{\|}
-
-(Beachten Sie, daß |\caption|\-|list|\-|entry| den Abbildungs- bzw.~Tabellenzähler
- erhöht.)
-
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\section{Dokumentenklassen \& Babel-Unterstützung}
-\label{classes}
-
-%\NEWdescription{v3.1}
-Dieser Teil der Dokumentation wird Ihnen einen Überblick über diejenigen
-Dokumentenklassen geben, an welche \thispackage\ angepasst ist:
-Welche Möglichkeiten zur Beschriftungsgestaltung sie bereits verfügen,
-mit welchen Seiteneffekten Sie rechnen müssen, wenn Sie dieses Paket verwenden,
-und mit welchen Standardwerten die Optionen belegt werden.
-
-\NEWfeature{v3.1}
-Die Standardwerte namens "`default"' hängen von der verwendeten
-Dokumentenklasse ab; sie repräsentieren quasi das Aussehen, wie es vom Autor
-der Klasse vorgesehen war.
-So kann z.B.~die Einstellung |format=|\x|default| je nach verwendeter Klasse
-unterschiedliche Aussehen der Beschriftungen hervorbringen.
-
-\begingroup\setlength\leftmargini{0.3em}% default = 2.5em
-\INFO
-Sollten Sie Ihre Dokumentenklasse nicht in diesem Abschnitt finden, so haben Sie
-trotzdem oftmals keinen Grund zur Sorge: Viele Dokumentenklassen (wie z.B.~die
-\class{octavo} Klasse) sind von einer der Standardklassen \class{article},
-\class{report} oder \class{book} abgeleitet und verhalten sich bezüglich der
-Abbildungs- und Tabellenbeschriftungen gleich.
-\Thispackage\ überprüft automatisch die Kompatibilität zur Dokumentenklasse und
-gibt Ihnen die Warnung
-\begin{quote}\footnotesize
- |Package caption Warning: Unsupported document class (or package) detected,|\\
- |(caption) usage of the caption package is not recommended.|\\
- |See the caption package documentation for explanation.|
-\end{quote}
-aus, wenn es eine Unverträglichkeit entdeckt.
-Wenn Sie keine solche Warnung erhalten, ist alles bestens, falls aber doch,
-wird der Einsatz des \package{caption}"=Paketes nicht empfohlen und
-insbesondere nicht unterstützt.
-\endgroup
-
-\begin{Expert}
-Sollten Sie trotz der angemahnten Inkompatibilität \thispackage{}
-nutzen wollen, sollten Sie gründlich auf Seiteneffekte achten; gewöhnlich
-ändert sich alleine durch das Einbinden des \package{caption}"=Paketes
-ohne Optionen bereits das von der Dokumentenklasse vorgegebene Aussehen der
-Beschriftungen.
-Wenn dies für Sie in Ordnung ist, sollten Sie als erstes die Option
-|style=|\x|base| mittels |\use|\-|package[style=|\x|base]{caption}| oder
-|\caption|\-|setup{style=|\x|base}| angeben, um \thispackage\ in einen
-wohldefinierten Grundstatus zu versetzen.
-Anschließend können Sie anfangen, mit zusätzlichen Optionen erste
-Anpassungen vorzunehmen und dabei die Daumen gedrückt zu halten.
-\end{Expert}
-
-\newcommand*\Option{Option}
-\newcommand*\defaultvalue{Standard-Belegung (\texttt{default})}
-\newcommand*\uses{\textit{verwendet}}
-\newcommand*\settings{\textit{Einstellungen}}
-\newcommand*\nofont{\textit{keiner}}
-
-\subsection{Standard \LaTeX: article, report und book}
-
-\begin{tabular}{ll}
-\Option & \defaultvalue \\\hline
-|format=| & |plain| \\
-|labelformat=| & |simple| \\
-|labelsep=| & |colon| \\
-|justification=| & |justified| \\
-|font=| & \nofont \\
-|labelfont=| & \nofont \\
-|textfont=| & \nofont \\
-\end{tabular}
-
-\begin{Annotation}
-Dies gilt auch für von \class{article}, \class{report} und \class{book}
-abgeleitete Dokumentenklassen.
-\end{Annotation}
-
-\subsection{\AmS: amsart, amsproc und amsbook}
-\label{AMS}
-
-\begin{tabular}{ll}
-\Option & \defaultvalue \\\hline
-|format=| & |plain| \\
-|labelformat=| & |simple| \\
-|labelsep=| & |.\enspace| \\
-|justification=| & |justified| \\
-|font=| & |\@captionfont| \\
-|labelfont=| & |\@captionheadfont| \\
-|textfont=| & |\@captionfont\upshape| \\
-\end{tabular}
-
-\begin{Annotation*}
-|\@caption|\-|font| wird von den \AmS\ Dokumentenklassen auf |\normal|\-|font|
-vorbelegt, und |\@caption|\-|head|\-|font| auf |\sc|\-|shape|.
-\end{Annotation*}
-
-Weiterhin wird der Rand für mehrzeilige Abbildungs- bzw.~Tabellenbeschriftungen
-auf |\caption|\-|indent| gesetzt, bei einzeiligen Beschriftungen wird lediglich
-die Hälfte davon verwendet. (|\caption|\-|indent| wird von den \AmS\ Klassen
-auf |3pc| vorbelegt.)
-Möchten Sie einen einheitlichen Rand, so fügen Sie bitte
-|\clear|\-|caption|\-|setup[margin*]{single|\-|line}|
-in Ihren Dokumentenvorspann ein, nachdem Sie \thispackage\ geladen haben.
-
-Zusätzlich werden automatisch die Optionen |figure|\-|position=b,|\x|table|\-|position=t|
-gesetzt. Dies können Sie überschreiben, indem Sie beim Laden des
-\package{caption}"=Paketes einfach andere Werte für
-|figure|\-|position=| und |table|\-|position=| angeben.
-
-\subsection{beamer}
-\label{beamer}
-
-\begin{tabular}{ll}
-\Option & \defaultvalue \\\hline
-|format=| & |plain| \\
-|labelformat=| & \textit{nicht nummeriert} \\
-|labelsep=| & |colon| \\
-|justification=| & |raggedright| \\
-|font=| & \class{beamer} "`|caption|"' \settings \\
-|labelfont=| & \class{beamer} "`|caption name|"' \settings \\
-|textfont=| & \nofont \\
-\end{tabular}
-
-\subsubsection*{Von der Klasse angebotene Befehle und deren Seiteneffekte}
-Die Zeichensatz- und Farbeinstellungen können mit
-|\set|\-|beamer|\-|font{caption}|\marg{Optionen} und
-|\set|\-|beamer|\-|font{caption name}|\marg{Optionen} vorgenommen werden.
-Dies wird auch mit dem \package{caption}"=Paket noch funktionieren,
-zumindest solange Sie keinen anderen Zeichensatz mit
-|\caption|\-|setup{font=|\x\meta{Optionen}|}| oder
-|\caption|\-|setup{label|\-|font=|\x\meta{Optionen}|}| einstellen.\par
-Weiterhin bietet die \package{beamer}"=Klasse verschiedene "`Templates"' für
-die Beschriftungen an, diese können mit
-|\set|\-|beamer|\-|template|\x|{caption}|\x|[|\meta{Template}|]|
-ausgewählt werden.
-Da \thispackage\ diesen Mechanismus ersetzt, haben
-|\def|\-|beamer|\-|template*|\x|{caption}|\x\marg{Template Code}
-und
-|\set|\-|beamer|\-|template|\x|{caption}|\x|[|\meta{Template}|]|
-keine Funktion mehr, wenn \thispackage\ verwendet wird.
-(Au"snahme: Die Auswahl des Templates |default|, |num|\-|bered| oder
-|caption| |name| |own| |line| wird automatisch erkannt und auf dem \package{caption}"=Paket
-entsprechende Optionen umgesetzt, sofern diese nicht explizit durch den Anwender
-mit anderen Einstellungen "uberschrieben worden sind.)
-
-\subsection{\KOMAScript: scrartcl, scrreprt und scrbook}
-\label{KOMA}
-
-\begin{tabular}{ll}
-\Option & \defaultvalue \\\hline
-|format=| & \uses\ |\setcapindent| \textit{\&} |\setcaphanging| \settings \\
-|labelformat=| & \textit{wie \purett{simple}, aber mit ``autodot'' Feature}\\
-|labelsep=| & |\captionformat| \\
-|justification=| & |justified| \\
-|font=| & |\setkomafont{caption}| \settings \\
-|labelfont=| & |\setkomafont{captionlabel}| \settings \\
-|textfont=| & \nofont \\
-\end{tabular}
-
-\subsubsection*{Von der Klasse angebotene Befehle}
-Die \KOMAScript"=Dokumentenklassen bietet sehr viele Möglichkeiten, das Design
-der Abbildungs- und Tabellenbeschriftungen anzupassen. Für eine Übersicht schauen
-Sie bitte in die sehr gute \KOMAScript"=Dokumentation, Abschnitt "`Tabellen
-und Abbildungen"'.
-
-\subsubsection*{Seiteneffekte}
-Das optionale Argument von |\set|\-|cap|\-|width| wird nicht vom
-\package{caption}"=Paket unterstützt und daher ignoriert.
-Weiterhin überschreiben die \KOMAScript"=Optionen |table|\-|caption|\-|above|
-\& |table|\-|caption|\-|below| sowie die dazugehörigen Befehle
-|\caption|\-|above| \& |\caption|\-|below| die mit |position=| getätigten
-Einstellungen.
-
-\subsection{\NTG: artikel, rapport und boek}
-\label{NTG}
-
-\begin{tabular}{ll}
-\Option & \defaultvalue \\\hline
-|format=| & |plain| \\
-|labelformat=| & |simple| \\
-|labelsep=| & |colon| \\
-|justification=| & |justified| \\
-|font=| & \nofont \\
-|labelfont=| & |\CaptionLabelFont| \\
-|textfont=| & |\CaptionTextFont| \\
-\end{tabular}
-
-\subsubsection*{Von der Klasse angebotene Befehle und deren Seiteneffekte}
-|\Caption|\-|Label|\-|Font| und |\Caption|\-|Text|\-|Font| können entweder
-direkt oder indirekt über |\Caption|\-|Fonts| definiert werden.
-Beides funktioniert auch weiterhin, zumindest solange kein anderer
-Zeichensatz mit den \package{caption}"=Paketoptionen
-|label|\-|font=| und |text|\-|font=| festgelegt wird.
-
-\subsection{\SmF: smfart und smfbook}
-\label{SMF}
-
-Da die \SmF\ Dokumentenklassen von den \AmS\ Klassen abgeleitet wurden,
-gelten hier dieselben Standardbelegungen wie dort.
-
-Zusätzlich ist der Rand auf den zehnten Teil von |\line|\-|width| limiert.
-Mögen Sie diese Limitierung nicht, kann sie mit der Option
-|max|\-|margin=|\x|off| oder |max|\-|margin=|\x|false| ausgeschaltet werden.
-
-\subsection{thesis}
-\label{thesis}
-
-\begin{tabular}{ll}
-\Option & \defaultvalue \\\hline
-|format=| & |hang| \\
-|labelformat=| & \textit{wie \purett{simple}, aber mit kurzem Namen}\\
-|labelsep=| & |colon| \\
-|justification=| & |justified| \\
-|font=| & \nofont \\
-|labelfont=| & |\captionheaderfont| \\
-|textfont=| & |\captionbodyfont| \\
-\end{tabular}
-
-\subsubsection*{Von der Klasse angebotene Befehle und deren Seiteneffekte}
-Der Zeichensatz des Bezeichners kann hier mit |\caption|\-|header|\-|font|,
-derjenige des Textes mit |\caption|\-|body|\-|font| gesetzt werden.
-Beides funktioniert auch weiterhin, zumindest solange kein anderer
-Zeichensatz mit den \package{caption}"=Paketoptionen
-|label|\-|font=| und |text|\-|font=| gesetzt wird.
-
-\subsection{Babel-Option frenchb}
-\label{frenchb}
-
-Wird die Option \package{frenchb} des \package{babel}"=Paketes mit einer
-der drei Standardklassen (oder einer davon abgeleiteten) verwendet,
-dann wird |label|\-|sep=| auf |\Caption|\-|Sep|\-|a|\-|ra|\-|tor| vorbelegt
-und damit die Vorbelegung der Dokumentenklasse überschrieben.
-In diesem Falle wird eine Umdefinition von |\Caption|\-|Sep|\-|a|\-|ra|\-|tor|
-auch weiterhin funktionieren, zumindest solange kein anderer Trenner mit
-der Option |label|\-|sep=| gesetzt wird.
-
-\INFO*
-Bitte laden Sie \thispackage\ \emph{nach} dem \package{babel}"=Paket.
-
-\subsection{Pakete frenchle und frenchpro}
-\label{frenchpro}
-
-Wird das \package{frenchle}- oder \package{frenchpro}"=Paket verwendet,
-dann wird |label|\-|sep=| auf |\caption|\-|sep|\-|a|\-|ra|\-|tor| plus
-\cs{space} vorbelegt und damit die Vorbelegung der Dokumentenklasse
-überschrieben.
-Eine Umdefinition von |\caption|\-|sep|\-|a|\-|ra|\-|tor| wird auch weiterhin
-funktionieren, zumindest solange kein anderer Trenner mit der Option
-|label|\-|sep=| gesetzt wird.
-
-Weiterhin wird |text|\-|font=| auf |text|\-|font=|\x|it| vorbelegt,
-um das Standardverhalten des \package{frenchle}- bzw.~\package{frenchpro}"=Paketes
-bzgl.~des Beschriftungstext"=Zeichensatzes zu emulieren.
-Bitte beachten Sie, daß der Befehl |\caption|\-|font| auch intern vom
-\package{caption}"=Paket verwendet wird, und zwar auf eine andere Art und Weise
-als das \package{frenchle}- bzw.~\package{frenchpro}"=Paket ihn verwendet;
-daher sollten Sie ihn nicht (mehr) verwenden.
-
-Der Befehl |\un|\-|numbered|\-|captions|\marg{figure \emph{oder} table} wird
-weiterhin seinen Dienst tun, aber nur solange Sie kein anderes Bezeichnerformat
-mit |label|\-|format=| auswählen.
-
-\INFO*
-Bitte laden Sie \thispackage\ \emph{nach} dem \package{frenchle}
-oder \package{frenchpro}"=Paket.
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\section{Unterstützung anderer Pakete}
-\label{packages}
-\label{compatibility}
-
-%\NEWdescription{v3.1}
-\Thispackage\ ist an folgende Pakete, die ebenfalls Abbildungs- oder
-Tabellenbeschriftungen anbieten, angepasst:
-\begin{quote}
- \package{float}, \package{floatflt}, \package{fltpage},
- \package{hyperref}, \package{hypcap}, \package{listings},
- \package{longtable}, \package{picinpar}, \package{picins},
- \package{rotating}, \package{setspace}, \package{sidecap},
- \package{subfigure}, \package{supertabular}, \package{threeparttable},
- \package{wrapfig} und \package{xtab}
-\end{quote}
-
-Weiterhin arbeitet das \package{floatrow}"=Paket\cite{floatrow},
-das \package{subcaption}"=Paket (welches Bestandteil der
-\package{caption}"=Paketfamilie ist), sowie das \package{subfig}"=Paket\cite{subfig}
-aktiv mit diesem Paket zusammen und verwenden dessen |\caption|\-|setup|"=Schnittstelle.
-
-\bigskip
-
-\begingroup\setlength\leftmargini{0.3em}% default = 2.5em
-\INFO
-Definiert ein anderes Paket (oder eine Dokumentenklasse), welches \thispackage{}
-nicht kennt, ebenfalls den Befehl |\caption| um, so wird diese Umdefinition
-bevorzugt, um maximale Kompatibilität zu gewährleisten und Konflikte
-zu vermeiden.
-Wird solch eine potentielle Inkompatiblität erkannt, wird diese Warnung
-ausgegeben:~\footnote{%
- Diese Warnung kann durch Angabe der Option \texttt{compatibility=true}
- beim Laden des \package{caption}"=Paketes abgeschaltet werden.}
-\begin{quote}\footnotesize
- |Package caption Warning: \caption will not be redefined since it's already|\\
- |(caption) redefined by a document class or package which is|\\
- |(caption) unknown to the caption package.|\\
- |See the caption package documentation for explanation.|
-\end{quote}
-\endgroup
-
-Als Folge stehen diese Ausstattungsmerkmale des \package{caption}"=Paketes nicht
-zur Verfügung:
-\begin{itemize}
- \item die Optionen |labelformat=|, |position=auto|, |list=| und |listformat=|
- \item |\caption*| (um eine Beschrifung ohne Bezeichner zu setzen)
- \item |\caption[]{|\ldots|}| (um den Eintrag ins Verzeichnis zu unterbinden)
- \item |\caption{}| (um eine leere Beschriftung ohne Trenner zu setzen)
- \item |\ContinuedFloat|
- \item korrekt ausgerichtete Beschriftungen in Umgebungen wie \texttt{wide} und
- \texttt{addmargin}, die die Seitenränder verändern
- \item das sog.~\textsf{hypcap}"=Feature \See{\Ref{hyperref}\,}
- \item Setzen von Unter-Beschriftungen \See{\package{subcaption}"=Paketdokumentation}
-\end{itemize}
-
-\DescribeMacro{compatibility=}
-Dieser Kompatibilitäts"=Modus kann durch die Angabe der Option
-\begin{quote}
- |compatibility=false|
-\end{quote}
-beim Laden des \package{caption}"=Paketes ausgeschaltet werden.
-Aber bitte beachten Sie, daß die Anwendung dieser Option weder empfohlen noch
-unterstützt wird, da hierdurch unerwünschte Nebeneffekte oder Fehler auftreten
-können. (Aus diesem Grunde wird hier ebenfalls eine Warnung ausgegeben.)
-
-\newcommand\packagedescription[1]{%
- \ifvmode\else\par\fi
- \nopagebreak
- \parbox[b]{\linewidth}{\footnotesize\leftskip=10pt\rightskip=10pt\relax#1}\par
- \nopagebreak\smallskip\nopagebreak}
-
-\PageBreak
-\subsection{algorithms}
-\label{algorithms}
-\packagedescription{%
-Die \package{algorithms}"=Paketfamilie\cite{algorithms} bietet zwei Umgebungen
-an: Die Umgebung \texttt{algorithmic} bietet eine Möglichkeit, Algorithmen
-zu beschreiben, und die Umgebung \texttt{algorithm} bietet eine passende
-Gleitumgebung an.}
-
-Da die \texttt{algorithm}"=Umgebung intern mittels |\new|\-|float| realisiert
-ist, welches vom \package{float}"=Paket\cite{float} bereitgestellt wird,
-schauen Sie bitte in \Ref{float} nach.
-
-\iffalse
-\pagebreak[3]
-\subsection{algorithm2e}
-\label{algorithm2e}
-\packagedescription{%
-The \package{algorithm2e} package\cite{algorithm2e} offers an environment for
-writing algorithms in LaTeX2e.}
-
-Since the \package{algorithm2e} package does not use some kind of standard
-interface for defining its floating environment (e.g.~|\newfloat| of the
-\package{float} package) and typesetting its caption,
-the \package{algorithm2e} package is \emph{not} supported by \thispackage.
-
-So if you want to customize the captions using \thispackage,
-you have to build a new environment which uses a supported interface regarding
-floats (e.g. using the \package{float} or \package{floatrow} package),
-and combine this environment with the internal \package{algorithm2e} code.
-
-As first step you could define a non-floating environment \texttt{algorithmic},
-for example:
-\begin{quote}
- |\usepackage{algorithm2e}|\\
- |% save the "algorithm" environment from the algorithm2e package|\\
- |\let\ORIGalgorithm\algorithm|\\
- |\let\ORIGendalgorithm\endalgorithm|\\
- |% define the algorithmic environment|\\ % , based on the saved environment
- |\newenvironment{algorithmic}%|\\
- | {\renewenvironment{algocf}[1][h]{}{}% pass over floating stuff|\\
- | \ORIGalgorithm}%|\\
- | {\ORIGendalgorithm}|\\
- \ldots
-\end{quote}
-Having defined this non-floating environment, you could define your own new
-floating environment with |\newfloat| of the \package{float} package
-(or |\DeclareNewFloatType| of the \package{floatrow} package),
-and use the combination of this floating environment and \texttt{algorithmic}
-in its body, just like you would do when you use the
-\package{algorithm}/\package{algorithmic} package tandem.
-
-You could even use the \package{algorithm} package for this purpose, for example:
-\begin{quote}
- \ldots\\
- |% load the algorithm package to re-define the|\\
- |% floating environment "algorithm" and \listofalgorithms|\\
- |\let\listofalgorithms\undefined|\\
- |\usepackage{algorithm}|\\
- \ldots\\
- |% Example usage:|\\
- |\begin{algorithm}|\\
- |\caption{An algorithm}|\\
- |\begin{algorithmic}|\\
- | \SetVline|\\
- | \eIf{cond1}{|\\
- | a line\;|\\
- | }{|\\
- | another line\;|\\
- | }|\\
- |\end{algorithmic}|
-\end{quote}
-Now you are finally able to customize the float and caption layout like every
-other floating environment defined with the \package{float} package\cite{float},
-please see \Ref{float}.
-
-\begin{Annotation}
-An alternative would be using the \package{algorithmicx} package.
-\end{Annotation}
-\fi
-
-\pagebreak[3]
-\subsection{float}
-\label{float}
-\packagedescription{%
-Das \package{float}"=Paket\cite{float} bietet den Befehl \cs{restylefloat} an,
-der bestehende Gleitumgebungen zu einem neuen Design verhilft, ferner
-\cs{newfloat} um neue Gleitumgebungen zu definieren.
-Weiterhin wird die Platzierungs-Option "`\texttt{H}"' angeboten, die bei
-Gleitumgebungen das Gleiten unterbindet.}
-
-Bei Gleitumgebungen, die mit \cs{newfloat} oder \cs{restylefloat} definiert
-wurden, hat die Option |po|\-|si|\-|tion=| keinen Effekt auf die Beschriftung,
-da die Platzierung und die Abstände von dem gewählten Gleitumgebungs"=Stil
-festgelegt werden.
-
-Ein Beschriftungs"=Stil und Beschriftungs"=Optionen mit demselben Namen
-wie der Gleitumgebungs"=Stil werden zusätzlich zu den normalen Optionen
-ausgewählt.
-Mit diesem Mechanismus emuliert \thispackage\ das Aussehen der Beschriftungen
-vom Stil "`|ruled|"': Es definiert den Beschriftungs"=Stil
-\begin{quote}
- |\DeclareCaptionStyle{ruled}%|\\
- | {labelfont=bf,labelsep=space,strut=off}|\mbox{\quad.}
-\end{quote}
-Um dies zu ändern, müssen Sie entweder einen eigenen Stil namens "`|ruled|"'
-definieren, oder aber mit |\caption|\-|setup[ruled]|\marg{Optionen} zusätzliche
-Optionen angeben.%,
-%z.B.~|\caption|\-|setup[ruled]{labelsep=|\x|colon}|.
-
-Dieser Mechanismus wird ebenso benutzt, um den Abstand zwischen einer
-Gleitumgebung vom Stil "`|boxed|"' und seiner Beschriftung individuell
-festzulegen:
-\begin{quote}
- |\captionsetup[boxed]{skip=2pt}|
-\end{quote}
-Um dies zu ändern, geben Sie einfach mit
-|\caption|\-|setup[boxed]{skip=|\x\meta{Wert}|}|
-einen anderen Wert an.
-Oder wenn Sie stattdessen die globale Einstellung der Option |skip=| verwenden
-wollen, können Sie die individuelle Abstandseinstellung mit
-|\clear|\-|caption|\-|setup[skip]{boxed}| entfernen.
-
-\begin{Note}
-Es kann immer nur \emph{eine} Beschriftung innerhalb der Gleitumgebungen
-gesetzt werden, die mit |\new|\-|float| oder |\re|\-|style|\-|float|
-definiert werden; außerdem verhalten sich diese Gleitumgebungen auch in
-anderen Belangen nicht exakt wie die Umgebungen |figure| und |table|.
-Als Konsequenz arbeiten viele Pakete nicht sehr gut mit diesen zusammen.
-Weiterhin hat das \package{float}"=Paket einige Fallstricke und Schwächen,
-weswegen ich als Alternative das \package{newfloat}"=Paket
-anbiete, um neue Gleitumgebungen zu definieren, die sich wie |figure|
-und |table| verhalten sollen.
-Und für die Definition von mächtigeren Gleitumgebungen bzw.~der
-stilistischen Umgestaltung von vorhandenen Gleitumgebungen empfehle ich als
-Alternative den Befehl |\Declare|\-|New|\-|Float|\-|Type| des
-moderneren \package{floatrow}"=Paketes\cite{floatrow}.
-\end{Note}
-
-\iffalse
-Please also note that you \emph{don't} need a |\restyle|\-|float| for using
-the ``|H|'' float placement specifier. Some docs say so, but they are
-wrong.
-And |\restyle|\-|float{table}| is a very good method to shoot yourself
-in the foot, since many packages using |table| internally are not working
-correctly afterwards.
-\fi
-
-\pagebreak[3]
-\subsection{floatflt}
-\label{floatflt}
-\packagedescription{%
-Das \package{floatflt}"=Paket\cite{floatflt} bietet Umgebungen zum Setzen von
-Abbildungen und Tabellen an, die nicht die Gesamtbreite der Seite einnehmen,
-sondern stattdessen vom Text umflossen werden.}
-
-\NEWfeature{v3.1}
-Spezielle Optionen für die Umgebungen |float|\-|ing|\-|figure| und
-|float|\-|ing|\-|table| können mit
-\begin{quote}
- |\captionsetup[floatingfigure]|\marg{Optionen}\quad\emph{und}\\
- |\captionsetup[floatingtable]|\marg{Optionen}
-\end{quote}
-festgelegt werden.
-Diese Einstellungen werden dann zusätzlich zu denjenigen für |figure|
-bzw.~|table| berücksichtigt.
-
-\begin{Note}
-Die Einstellungen |margin=| bzw.~|width=| werden nicht auf diese Abbildungen
-bzw.~Tabellen angewandt, solange sie nicht explizit mit
-|\caption|\-|setup[floating|\-|figure]{|\ldots|}|
-bzw.~|\caption|\-|setup[floating|\-|table]{|\ldots|}| gesetzt werden.
-\end{Note}
-
-\pagebreak[3]
-\subsection{fltpage}
-\label{fltpage}
-\packagedescription{%
-Das \package{fltpage}"=Paket\cite{fltpage} bietet die Ausgliederung der
-Beschriftung für Abbildungen und Tabellen, die die gesamte Seitenhöhe
-einnehmen, an. Hierbei wird die Beschriftung ans Ende der vorherigen
-oder nächsten Seite verschoben.}
-
-\iffalse
-\NEWfeature{v3.1}
-Zwei Optionen regeln die Verweise auf die Umgebungen |FPfigure| und |FPtable|:
-\begin{description}
-\item{\texttt{FPlist=caption} oder \texttt{FPlist=figure}}\\[\smallskipamount]
-Auf "`|caption|"' gesetzt, wird der Verzeichniseintrag auf die Beschriftung
-der Abbildung bzw.~Tabelle verweisen, auf "`|figure|"' gesetzt auf den Inhalt
-der Abbildung.
-(Die Vorbelegung ist |FP|\-|list=|\x|caption|.)
-\item{\texttt{FPref=caption} oder \texttt{FPref=figure}}\\[\smallskipamount]
-Auf "`|caption|"' gesetzt, werden die mit \cs{ref}, \cs{pageref}, \cs{autoref}
-oder \cs{nameref} plazierten Referenzen auf die Beschriftung der Abbildung
-bzw.~Tabelle verweisen, auf "`|figure|"' gesetzt auf den Inhalt der Abbildung.
-(Die Vorbelegung ist |FP|\-|ref=|\x|figure|.)
-\end{description}
-\fi
-
-Spezielle Einstellungen für die Umgebungen |FPfigure| und |FPtable| können mit
-\begin{quote}
- |\captionsetup[FPfigure]|\marg{Optionen}\quad\emph{und}\\
- |\captionsetup[FPtable]|\marg{Optionen}
-\end{quote}
-getätigt werden.
-Diese Einstellungen werden dann zusätzlich zu denjenigen für |figure|
-bzw.~|table| berücksichtigt.
-
-\pagebreak[3]
-\subsection{hyperref}
-\label{hyperref}
-\packagedescription{%
-Das \package{hyperref}"=Paket\cite{hyperref} behandelt \LaTeX"=Querverweise
-derart, daß sie zusätzlich Hyperlinks im Dokument erzeugen.}
-
-\NEWfeature{v3.1}
-Zwei Optionen regeln das Setzen von Hyperlinks:~\footnote{Diese Optionen sind
-nach dem \package{hypcap}"=Paket benannt, welches sie ersetzen.}
-\begin{description}
-\item{\texttt{hypcap=true} oder \texttt{hypcap=false}}\\[\smallskipamount]
-Auf |true| gesetzt, werden alle Hyperlink"=Anker -- wohin Einträge im
-Abbildungs- und Tabellenverzeichnis, sowie |\ref| und |\auto|\-|ref|
-verweisen -- an den Anfang der (gleitenden) Umgebungen wie Abbildung
-oder Tabelle plaziert.\par
-Auf |false| gesetzt zeigen hingegen alle Hyperlink"=Anker auf die
-Beschriftung.\par
-(Die Voreinstellung ist |hypcap=true|.)
-\item{\texttt{hypcapspace=}\meta{Abstand}}\\[\smallskipamount]
-Da es nicht sehr ästhetisch wirkt, wenn der Hyperlink exakt auf den Beginn der
-Abbildung bzw.~Tabelle springt, kann ein vertikaler Abstand zwischen dem
-Hyperlink"=Anker und der (gleitenden) Umgebung gesetzt werden, z.B.~entfernt
-|hyp|\-|cap|\-|space=|\x|0pt| diesen Abstand.\par
-(Die Voreinstellung ist |hyp|\-|cap|\-|space=|\x|0.5\base|\-|line|\-|skip|.)
-\end{description}
-
-Beide Optionen haben keine Auswirkung in den Umgebungen |lst|\-|listing|
-(vom \package{listings}"=Paket bereitgestellt), |long|\-|table| (vom
-\package{longtable}"=Paket bereitgestellt, |super|\-|tabular| (vom
-\package{supertabular}"=Paket bereitgestellt), und |x|\-|tabular| (vom
-\package{xtab}"=Paket bereitgestellt);
-innerhalb dieser Umgebungen werden Hyperlink"=Anker immer so gesetzt, als sei
-|hyp|\-|cap=|\x|true| und |hyp|\-|cap|\-|space=|\x|0pt| eingestellt.
-
-\pagebreak[3]Bitte beachten Sie:\nopagebreak
-\begin{description}
-\item{\cs{captionof}\marg{Typ}\csmarg{\purerm\ldots}
- vs.~\cs{captionsetup}\csmarg{type=\textrm{\meta{Typ}}}$+$\cs{caption}\csmarg{\purerm\ldots}}%
-\\[\smallskipamount]
-Ohne geladenes \package{hyperref}"=Paket bekommen Sie hier identische Resultate.
-Aber mit \package{hyperref} geladen und mit der Einstellung |hyp|\-|cap=|\x|true|
-versehen wird der Hyperlink"=Anker unterschiedlich gesetzt.
-So plaziert zum Beispiel
-\begin{quote}
-|\begin{minipage}{\linewidth}|\\
-| |\ldots\\
-| \captionof{figure}{Eine Abbildung}|\\
-|\end{minipage}|
-\end{quote}
-den Anker bei der Beschriftung.
-(Und wenn |hyp|\-|cap=|\x|true| gesetzt ist, wird deswegen eine Warnung ausgegeben.)
-\begin{quote}
-|\begin{minipage}{\linewidth}|\\
-| \captionsetup{type=figure}|\\
-| |\ldots\\
-| \caption{Eine Abbildung}|\\
-|\end{minipage}|
-\end{quote}
-hingegen plaziert den Anker an den Anfang der |mini|\-|page|,
-da die Anweisung |\caption|\-|setup{type=|\x|figure}| nicht nur den Typ der
-Beschriftung auf "`figure"' festlegt, sondern auch einen Hyperlink"=Anker setzt.
-
-\item{\cs{caption}\csoarg{}\csmarg{\purerm\ldots}
- vs.~\cs{captionsetup}\csmarg{list=false}$+$\cs{caption}\csmarg{\purerm\ldots}}\\[\smallskipamount]
-Wiederum bekommen Sie ohne geladenes \package{hyperref}"=Paket identische Resultate.
-Aber mit \package{hyperref} geladen liegen die Unterschiede in den Feinheiten:
-So wird z.B.~das optionale Argument von |\caption| auch in die |aux|-Datei
-geschrieben und vom |\name|\-|ref| Befehl verwendet.
-Wenn Sie also |\caption| mit leerem Argument angeben, wird ein auf diese
-Abbildung oder Tabelle angewandtes |\name|\-|ref| nicht das erwünschte,
-sondern stattdessen ein leeres Resultat zur Folge haben.
-Daher ist es besser, |\caption|\-|setup{list=|\x|false}| zu verwenden,
-wenn Sie keinen Eintrag in dem Abbildungs- oder Tabellenverzeichnis wünschen.
-\end{description}
-
-\pagebreak[3]
-\subsection{hypcap}
-\label{hypcap}
-\packagedescription{%
-Das \package{hyp\-cap}"=Paket\cite{hypcap} bietet eine Lösung zu dem Problem
-an, daß Hyperlinks auf Gleitumgebungen nicht auf die Abbildung bzw.~Tabelle
-verweisen, sondern stattdessen auf die Beschriftung.
-Die Version $3.1$ des \package{caption}"=Paketes löst dieses Problem bereits
-auf seine eigene Art und Weise, so daß das \package{hypcap}"=Paket in der
-Regel nicht mehr zusätzlich benötigt wird.}
-
-Wird das \package{hypcap}"=Paket zusätzlich zum \package{hyperref}"=Paket
-geladen, so übernimmt es die Kontrolle über die Platzierung der
-Hyperlink"=Anker, und die Optionen |hyp|\-|cap=| und |hyp|\-|cap|\-|space=|
-verlieren ihre Wirkung.
-
-Außerdem ist zu beachten, daß dann |\caption|\-|setup{type=|\x\meta{Typ}|}|
-keinen Hyperlink"=Anker mehr setzt; dies muß dann ggf.~mit dem Befehl
-|\cap|\-|start|, welcher vom \package{hypcap}"=Paket angeboten wird,
-geschehen.
-
-Weiterhin hat das Laden des \package{hypcap}"=Paketes den Nebeneffekt, daß
-die Hyperlink"=Anker innerhalb der Umgebungen
-|floating|\-|figure| (vom \package{float\-flt}"=Paket bereitgestellt),
-|FP|\-|figure| \& |FPtable| (vom \package{flt\-page}"=Paket bereitgestellt),
-|fig|\-|window| (vom \package{pic\-in\-par}"=Paket bereitgestellt),
-|par|\-|pic| (vom \package{pic\-ins}"=Paket bereitgestellt),
-|SC|\-|figure| (vom \package{side\-cap}"=Paket bereitgestellt),
-|three|\-|part|\-|table| (vom \package{three\-part\-table}"=Paket
-bereitgestellt) und |wrap|\-|figure| (vom \package{wrap\-fig}"=Paket
-bereitgestellt) nicht mehr optimal platziert werden.
-
-\pagebreak[3]
-\subsection{listings}
-\label{listings}
-\packagedescription{%
-Das \package{listings}"=Paket\cite{listings} bietet Möglichkeiten,
-Programmcode zu setzen.}
-
-Spezielle Einstellungen für die Umgebung |lst|\-|listing| können mit
-\begin{quote}
- |\captionsetup[lstlisting]|\marg{Optionen}
-\end{quote}
-getätigt werden.
-
-Bitte beachten Sie, daß das \package{listings}"=Paket seine eigenen
-Optionen für die Kontrolle der Position und Abstände der Beschriftungen
-mitbringt:
-|caption|\-|pos=|, |above|\-|caption|\-|skip=| und |below|\-|caption|\-|skip=|.
-\See{Dokumentation des \package{listings}"=Paketes.}
-Diese Optionen überschreiben diejenigen des \package{caption}"=Paketes,
-können aber wiederum mit |\caption|\-|setup[lst|\-|listing]{|\ldots|}|
-überschrieben werden, z.B.~mit
-\begin{quote}|\caption|\-|setup[lst|\-|listing]{skip=|\x|10pt}|\quad.\end{quote}
-
-\pagebreak[3]
-\subsection{longtable}
-\label{longtable}
-\packagedescription{%
-Das \package{longtable}"=Paket\cite{longtable} bietet eine Umgebung an,
-die sich ähnlich wie die Umgebung \texttt{tabular} verhält, aber Seitenumbrüche
-innerhalb der Tabelle erlaubt.}
-
-Spezielle Einstellungen für die Umgebung |long|\-|table| können mit
-\begin{quote}
- |\captionsetup[longtable]|\marg{Optionen}
-\end{quote}
-getätigt werden.
-Diese Einstellungen werden dann zusätzlich zu denjenigen für |table|
-berücksichtigt.
-
-Die Optionen |margin=| und |width=| überschreiben gewöhnlich die Länge
-|\LT|\-|cap|\-|width|, so daß ein einheitliches Aussehen der
-Tabellenüberschriften gewährleistet wird.
-Wird aber |\LT|\-|cap|\-|width| auf einen anderen Wert als den Standardwert
-|4in| gesetzt, wird \thispackage\ dies berücksichtigen.
-(Aber |\LT|\-|cap|\-|width| wird wiederum von
-|\caption|\-|setup[long|\-|table]{width=|\x\meta{Breite}|}| überschrieben,
-auch wenn |\LT|\-|cap|\-|width| auf einen anderen Wert als |4in| gesetzt ist.)
-
-\begin{Note}
-Die Befehle |\caption|\-|of| und |\Continued|\-|Float| funktionieren
-\emph{nicht} innerhalb der Umgebung |long|\-|table|.
-Weiterhin erhöhen weder |\caption| noch |\caption|\-|list|\-|entry| den
-Tabellenzähler, er wird stattdessen von der Umgebung |long|\-|table| selbst
-erhöht.
-\NEWfeature{v3.1}
-Benötigen Sie eine Umgebung |long|\-|table|, die den Tabellenzähler
-nicht erhöht, so verwenden Sie bitte die Umgebung |long|\-|table*|
-(die das \package{ltcaption}"=Paket bereitstellt und als Bestandteil der
-\package{caption}"=Paketfamilie automatisch geladen wird).
-\end{Note}
-
-\pagebreak[3]
-\subsection{picinpar}
-\label{picinpar}
-\packagedescription{%
-Ähnlich wie das \package{floatflt}"=Paket stellt auch das
-\package{picinpar}"=Paket Umgebungen zum Setzen von Abbildungen und Tabellen
-zur Verfügung, die nicht die gesamte Seitenbreite ausfüllen und vom Text
-umflossen werden.
-Für eine detailierte Beschreibung der Unterschiede zwischen diesen Paketen
-schauen Sie bitte in den "`LaTeX Begleiter"'\cite{TLC2}.}
-
-\NEWfeature{v3.1}
-Spezielle Einstellungen für die Umgebungen |fig|\-|window| und |tab|\-|window|
-können mit
-\begin{quote}
- |\captionsetup[figwindow]|\marg{Optionen}\quad\emph{und}\\
- |\captionsetup[tabwindow]|\marg{Optionen}
-\end{quote}
-getätigt werden.
-Diese Einstellungen werden dann zusätzlich zu denjenigen für |figure|
-bzw.~|table| berücksichtigt.
-
-\begin{Note}
-Die Einstellungen |margin=| bzw.~|width=| werden nicht auf diese Abbildungen
-bzw.~Tabellen angewandt, solange sie nicht explizit mit
-|\caption|\-|setup[fig|\-|window]{|\ldots|}|
-bzw.~|\caption|\-|setup[tab|\-|window]{|\ldots|}| gesetzt werden.
-\end{Note}
-
-\pagebreak[3]
-\subsection{picins}
-\label{picins}
-\packagedescription{%
-Ähnlich wie das \package{floatflt}- und \package{picinpar}"=Paket stellt auch
-das \package{picins}"=Paket Umgebungen zum Setzen von Abbildungen und
-Tabellen zur Verfügung, die nicht die gesamte Seitenbreite ausfüllen und vom
-Text umflossen werden.
-Für eine detailierte Beschreibung der Unterschiede zwischen diesen Paketen
-schauen Sie bitte in den "`LaTeX Begleiter"'\cite{TLC2}.}
-
-\NEWfeature{v3.1}
-Spezielle Einstellungen für die Umgebung |par|\-|pic| können mit
-\begin{quote}
- |\captionsetup[parpic]|\marg{Optionen}
-\end{quote}
-getätigt werden.
-Diese Einstellungen werden dann zusätzlich zu denjenigen für |figure|
-bzw.~|table| berücksichtigt.
-
-Weiterhin erzeugt |\pic|\-|caption[]{|\ldots|}| keinen Verzeichniseintrag,
-und |\pic|\-|caption*{|\ldots|}| ergibt eine Beschriftung ohne Bezeichner und
-Nummerierung.
-
-\begin{Note}
-Die Einstellungen |margin=| bzw.~|width=| werden nicht auf diese Abbildungen
-bzw.~Tabellen angewandt, solange sie nicht explizit mit
-|\caption|\-|setup[par|\-|pic]{|\ldots|}| gesetzt werden.
-\end{Note}
-
-Wird ein |\pic|\-|caption| gewünscht, das keine Abbildungs-, sondern eine
-Tabellenbeschrifung erzeugt, so definieren Sie bitte \emph{nicht}
-|\@cap|\-|type| um, wie es von der Dokumentation zum \package{picins}"=Paket
-vorgeschlagen wird. Stattdessen benutzen Sie bitte den Befehl
-|\pic|\-|caption|\-|type|\marg{Typ}, der Ihnen vom \package{caption}"=Paket
-zu diesem Zweck bereitgestellt wird. Zum Beispiel:
-\begin{quote}
- |\piccaptiontype{table}|\\
- |\piccaption{Eine Beispieltabelle}|\\
- |\parpic(50mm,10mm)[s]{|\ldots|}|
-\end{quote}
-
-\pagebreak[3]
-\subsection{rotating}
-\label{rotating}
-\packagedescription{%
-Das \package{rotating}"=Paket\cite{rotating} bietet die Gleitumgebungen
-\texttt{side\-ways\-figure} und \texttt{side\-ways\-table},
-die sich wie \texttt{figure} und \texttt{table} verhalten, den Inhalt aber
-um 90 bzw. 270 Grad drehen.
-Weiterhin wird ein Befehl \cs{rot\-caption} bereitgestellt, der lediglich
-die Beschriftung dreht.}
-
-\iffalse % No, we don't do that
-If you want to setup special options for the |side|\-|ways|\-|figure| \&
-|side|\-|ways|\-|table| environments you can use
-\begin{quote}
- |\captionsetup[sidewaysfigure]|\marg{options}\\
- |\captionsetup[sidewaystable]|\marg{options}\quad.
-\end{quote}
-These options will be executed additionally to the regular ones for
-|figure| or |table|.
-\fi
-
-Der Befehl |\rot|\-|caption| wird vom \package{caption}"=Paket derart
-erweitert, daß |\rot|\-|caption*| und |\rot|\-|caption|\-|of| analog zu
-|\caption*| und |\caption|\-|of| verwendet werden können.
-
-\pagebreak[3]
-\subsection{setspace}
-\label{setspace}
-\packagedescription{%
-Das \package{setspace}"=Paket\cite{setspace} bietet Optionen und Befehle,
-um den Zeilenabstand festzulegen, so führt
-z.B.\ \cs{usepackage}\x\csoarg{one\-half\-spacing}\x\csmarg{set\-space}
-zu einem Dokument, welches einanhalbzeilig gesetzt wird.}
-
-Wird das \package{setspace}"=Paket zusammen mit dem \package{caption}"=Paket
-verwendet, sind alle Abbildungs- und Tabellenbeschriftungen auf "`einzeilig"'
-voreingestellt. Dies kann durch |font=|\x|one|\-|half|\-|spacing| (welches
-auf "`einanhalbzeilig"' umstellt), |font=|\x|double|\-|spacing| (welches
-auf "`zweizeilig"' umstellt) oder |font={stretch=|\x\meta{Wert}|}| geändert
-werden.
-\See{auch \Ref{fonts}}
-
-\pagebreak[3]
-\subsection{sidecap}
-\label{sidecap}
-\packagedescription{%
-Das \package{sidecap}"=Paket\cite{sidecap} bietet die Gleitumgebungen
-\texttt{SC\-figure} und \texttt{SC\-table}, die anders als \texttt{figure}
-und \texttt{table} die Beschriftung \emph{neben} den Inhalt setzen.}
-
-Spezielle Einstellungen für die Umgebungen |SC|\-|figure| und |SC|\-|table|
-können mit
-\begin{quote}
- |\captionsetup[SCfigure]|\marg{Optionen}\quad\emph{und}\\
- |\captionsetup[SCtable]|\marg{Optionen}
-\end{quote}
-getätigt werden.
-Diese Einstellungen werden dann zusätzlich zu denjenigen für |figure|
-bzw.~|table| berücksichtigt.
-
-\pagebreak[3]
-\begin{Note}
-Das \package{sidecap}"=Paket bietet eigene Optionen für die Ausrichtung der
-Beschriftung. Werden diese verwendet, so überschreiben sie die Einstellungen,
-die mit der Option |jus|\-|ti|\-|fi|\-|ca|\-|tion=| getätigt worden sind.
-\end{Note}
-
-\begin{Note}
-Die Einstellungen |margin=| bzw.~|width=| werden nicht auf diese Abbildungen
-bzw.~Tabellen angewandt, solange sie nicht explizit mit
-|\caption|\-|setup[SC|\-|figure]{|\ldots|}|
-bzw.~|\caption|\-|setup[SC|\-|table]{|\ldots|}| gesetzt werden.
-\end{Note}
-
-\medskip
-
-\begin{Annotation*}
-Anstelle des \package{sidecap}"=Paketes können Sie für Beschrifungen neben der
-Abbildung bzw.~Tabelle auch das leistungsfähigere und vielseitigere
-\package{floatrow}"=Paket\cite{floatrow} benutzen.
-\end{Annotation*}
-
-\pagebreak[3]
-\subsubsection*{Undokumentierte Eigenschaften}
-Das \package{sidecap}"=Paket \version{1.6} hat einige undokumentierte
-Paketoptionen und Befehle, die eine weitere Anpassung der Beschrifungen erlauben:
-
-\pagebreak[3]
-\DescribeMacro{margincaption}
-Die Paketoption
-\begin{quote}
- |margincaption|\qquad{\small(z.B.~|\usepackage[margincaption]{sidecap}|)}
-\end{quote}
-führt dazu, daß alle Beschriftungen in den Umgebungen |SC|\-|figure| und
-|SC|\-|table| in den Rand gesetzt werden.
-
-\pagebreak[3]
-\DescribeMacro{\sidecaptionvpos}
-Der Befehl
-\begin{quote}
- |\sidecaptionvpos|\marg{Typ}\marg{Position}
-\end{quote}
-legt die vertikale Ausrichtung der Beschriftung fest. \meta{Position} kann
-entweder `|t|' (für eine Ausrichtung am oberen Rand), `|b|' (für eine
-Ausrichtung am unteren Rand), oder `|c|' (für eine zentrierte Ausrichtung)
-sein.
-Die Vorbelegung für die Umgebung |table| ist `|t|', für |figure| und alle
-anderen, die mit |\Declare|\-|Floating|\-|Environment| definiert werden, `|b|'.
-
-\pagebreak[3]
-\subsection{subfigure}
-\label{subfigure}
-\packagedescription{%
-Das \package{subfigure}"=Paket\cite{subfigure} bietet Unterstützung für
-Unter"=Abbildungen und -Tabellen.
-Es ist veraltet und wurde vom Autor durch das modernere
-\package{subfig}"=Paket ersetzt.}
-
-Da das \package{subfigure}"=Paket veraltet ist, wird es vom
-\package{caption}"=Paket nur derart unterstützt, daß alte Dokumente (welche
-mit dem \package{caption}"=Paket \version{1.x} gesetzt wurden) noch
-übersetzbar sind und das erwartete Ergebnis liefern.
-
-Bitte verwenden Sie daher stattdessen das \package{subfig}- oder das
-\package{subcaption}"=Paket, welches
-\thispackage\ \version{3.x} aktiv unterstützt.
-
-\See{auch Dokumentation des \package{subfig}"=Paketes\cite{subfig}}
-
-\pagebreak[3]
-\subsection{supertabular und xtab}
-\label{supertabular}
-\packagedescription{%
-Die Pakete \package{supertabular}\cite{supertabular} und \package{xtab}\cite{xtab}
-bieten eine Umgebung, die ähnlich wie die Umgebung \texttt{long\-table} des
-\package{longtable}"=Paketes\cite{longtable} einen Seitenumbruch inmitten der
-Tabelle erlaubt.
-Für eine detailierte Beschreibung der Unterschiede zwischen diesen Paketen
-schauen Sie bitte in den "`LaTeX Begleiter"'\cite{TLC2}.}
-
-Spezielle Einstellungen für die Umgebung |super|\-|tabular| bzw.~|x|\-|tabular|
-können mit
-\begin{quote}
- |\captionsetup[supertabular]|\marg{Optionen}\quad\emph{bzw.}\\
- |\captionsetup[xtabular]|\marg{Optionen}
-\end{quote}
-getätigt werden.
-Diese Einstellungen werden dann zusätzlich zu denjenigen für |table|
-berücksichtigt.
-
-\begin{Note}
-Der Befehl |\Continued|\-|Float| funktioniert \emph{nicht} innerhalb der
-Umgebungen |super|\-|tabular| und |x|\-|tabular|.
-\end{Note}
-
-\pagebreak[3]
-\subsection{threeparttable}
-\label{threeparttable}
-\packagedescription{%
-Das \package{threeparttable}"=Paket\cite{threeparttable} bietet ein Schema
-für Tabellen, welches strukturierte Anmerkungen nach dem Tabelleninhalt
-erlaubt.
-Dieses Schema bietet eine Lösungsmöglichkeit für das alte Problem "`Fußnoten
-in Tabellen"'.}
-
-\NEWfeature{v3.1}
-Spezielle Einstellungen für die Umgebungen |three|\-|part|\-|table| und
-|measured|\-|figure| können mit
-\begin{quote}
- |\captionsetup[threeparttable]|\marg{Optionen}\quad\emph{und}\\
- |\captionsetup[measuredfigure]|\marg{Optionen}
-\end{quote}
-getätigt werden.
-Diese Einstellungen werden dann zusätzlich zu denjenigen für |figure|
-bzw.~|table| berücksichtigt.
-
-\begin{Note}
-Da die Breite der Beschriftung hier die gleiche Breite wie die Abbildung
-bzw.~Tabelle hat, werden die Einstellungen |margin=| bzw.~|width=| hier nicht
-angewandt, solange sie nicht explizit mit
-|\caption|\-|setup[three|\-|part|\-|table]{|\ldots|}| oder
-|\caption|\-|setup[measured|\-|figure]{|\ldots|}| gesetzt werden.
-\end{Note}
-
-\medskip
-
-\begin{Annotation*}
-Das \package{floatrow}"=Paket\cite{floatrow} bietet eine vergleichbare
-Funktionalität an.
-\end{Annotation*}
-
-\pagebreak[3]
-\subsection{wrapfig}
-\label{wrapfig}
-\packagedescription{%
-Ähnlich wie das \package{floatflt}-, \package{picinpar}- und
-\package{picins}"=Paket stellt auch das \package{wrapfig}"=Paket Umgebungen
-zum Setzen von Abbildungen und Tabellen zur Verfügung, die nicht die gesamte
-Seitenbreite ausfüllen und vom Text umflossen werden.
-Für eine detailierte Beschreibung der Unterschiede zwischen diesen Paketen
-schauen Sie bitte in den "`LaTeX Begleiter"'\cite{TLC2}.}
-
-\NEWfeature{v3.1}
-Spezielle Einstellungen für die Umgebungen |wrap|\-|figure| und
-|wrap|\-|table| können mit
-\begin{quote}
- |\captionsetup[wrapfigure]|\marg{Optionen}\quad\emph{und}\\
- |\captionsetup[wraptable]|\marg{Optionen}
-\end{quote}
-getätigt werden.
-Diese Einstellungen werden dann zusätzlich zu denjenigen für |figure|
-bzw.~|table| berücksichtigt.
-
-\begin{Note}
-Die Einstellungen |margin=| bzw.~|width=| werden nicht auf diese Abbildungen
-bzw.~Tabellen angewandt, solange sie nicht explizit mit
-|\caption|\-|setup[wrap|\-|figure]{|\ldots|}|
-bzw.~|\caption|\-|setup[wrap|\-|table]{|\ldots|}| gesetzt werden.
-\end{Note}
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\section{Weiterführende Dokumente}
-
-Folgende, im Internet verfügbare Dokumente möchte ich an dieser Stelle
-jedem ans Herz legen:
-
-\begin{itemize}
-\item
- Die \TeX\ FAQ -- "`Frequently Asked Questions"' über \TeX\ und \LaTeX:
- \begin{quote}\url{http://faq.tug.org/}\end{quote}
-
-\iffalse % Völlig veraltet, daher leider keine Empfehlung mehr wert
-\item
- Die DANTE-FAQ -- Oft gestellte Fragen \& deren Antworten:
- \begin{quote}\url{http://www.dante.de/faq/de-tex-faq/}\end{quote}
-\fi
-
-\item
- \emph{"`Hilfe für LaTeX-Einsteiger"'} von Christian Faulhammer:
- \begin{quote}\url{http://www.minimalbeispiel.de/}\end{quote}
-
-\item
- \emph{"`Bilder einfügen in \LaTeX: Ein How-To"'} von Dominik Bischoff
- beinhaltet die häufigsten Fragen und Antworten, die im Zusammenhang
- mit \LaTeX\ und Abbildungen auftreten:
- \begin{quote}
- \url{http://mirror.ctan.org/info/l2picfaq/german/l2picfaq.pdf}
- \end{quote}
-
-\item
- \emph{"`Gleitobjekte -- die richtige Schmierung"'} von Axel Reichert
- erl"autert den Umgang mit gleitenden Umgebungen und ist hier im Netz
- zu finden:
- \begin{quote}
- \url{http://mirror.ctan.org/info/german/gleitobjekte/}
- \end{quote}
-
-\item
- \textsf{epslatex} von Keith Reckdahl enth"alt viele n"utzliche Tips im
- Zusammenhang mit der Einbindung von Graphiken in \LaTeXe.
- Das Dokument ist in Englisch und unter
- \begin{quote}\url{http://mirror.ctan.org/info/epslatex/}\end{quote}
- zu finden.
-\end{itemize}
-
-% --------------------------------------------------------------------------- %
-
-\pagebreak[3]
-\section{Danksagungen}
-
-Von ganzem Herzen danke ich Katja Melzner,
-Steven D. Cochran, Frank Mittelbach, Olga Lapko,
-David Carlisle, Carsten Heinz, Keith Reckdahl, Markus Kohm,
-Heiko Oberdiek und Herbert Voß.
-
-Weiterhin möchte ich mich herzlich bei
-Harald Harders,
-Peter Löffler,
-Peng Yu,
-Alexander Zimmermann,
-Matthias Pospiech,
-Jürgen Wieferink,
-Christoph Bartoschek,
-Uwe Stöhr,
-Ralf Stubner,
-Geoff Vallis,
-Florian Keiler,
-Jürgen Göbel,
-Uwe Siart,
-Sang-Heon Shim,
-Henrik Lundell,
-David Byers,
-William Asquith,
-Prof.~Dr.~Dirk Hoffmann,
-Frank Martini,
-Danie Els,
-Philipp Woock,
-Fadi Semmo,
-Matthias Stevens und
-Leo Liu
-für ihre Hilfe beim stetigen Verbessern dieses Paketes bedanken.
-
-% --------------------------------------------------------------------------- %
-
-\clearpage\appendix
-\section{Alphabetische Referenz}
-
-%\newenvironment{Warnings}%
-% {\begin{trivlist}%
-% \def\Message{\pagebreak[3]\leftskip=0pt\relax\item[]\color{blue}}%
-% \def\Description{\nopagebreak\par\nopagebreak\color{black}\leftskip=1.5em\nopagebreak}%
-% }%
-% {\color{black}\end{trivlist}}
-\makeatletter
-\newenvironment{Warnings}{%
- \newif\ifMessage
- \def\Message{%
- \ifMessage\end{minipage}\par\vspace\itemsep\pagebreak[3]\fi
- \begin{minipage}{\linewidth}%
- \setlength\parindent{0pt}%
- \setlength\parskip{\smallskipamount}%
- \setlength\leftskip{0pt}%
- \color{blue}%
- \Messagetrue}%
- \def\Description{%
- \par\color{black}\leftskip=1.5em}%
- \def\Or{\@testopt\@Or{oder}}%
- \def\@Or[##1]{%
- \\{\small\color{black}\hspace{1.5em}\textit{-- ##1 --}}\\}%
-}{%
- \ifMessage\end{minipage}\par\fi
-}
-\makeatother
-
-\subsection{Optionen}
-\newcommand\preambleoption{~%
- \begingroup\def\thefootnote{\fnsymbol{footnote}}%
- \footnotemark[2]%
- \endgroup}
-\newcommand\preambleoptiontext{%
- \begingroup\def\thefootnote{\fnsymbol{footnote}}%
- \footnotetext[2]{Diese Optionen stehen nur in dem Dokumentenvorspann
- (Präambel) zur Verfügung.}%
- \endgroup}
-
-\begin{longtable*}{lll}
-Option & Kurzbeschreibung & Abschnitt \\
-\hline
-\endhead
-|aboveskip| & setzt den Abstand über der Beschriftung & \ref{skips} \\
-|belowskip| & setzt den Abstand unter der Beschriftung & \ref{skips} \\
-|compatibility|\preambleoption & erzwingt (Nicht-)Kompatibilität & \ref{compatibility} \\
-%|config| & & \ref{x} \\
-|figureposition|\preambleoption & gibt einen Hinweis auf die Position & \ref{skips} \\
-|font|(|+|) & wählt den Zeichensatz & \ref{fonts} \\
-|format| & wählt das Format & \ref{formats} \\
-\iffalse
-|FPlist| & Wohin soll der Listeneintrag einer FPfigure zeigen? & \ref{fltpage} \\
-|FPref| & Wohin soll ein |\ref| einer FPfigure zeigen? & \ref{fltpage} \\
-\fi
-|hangindent| & setzt den "`hängenden"' Einzug & \ref{margins} \\
-|hypcap| & wählt das "`hypcap"' Feature aus & \ref{hyperref} \\
-|hypcapspace| & setzt den Abstand über einem Hyperlink & \ref{hyperref} \\
-|indention| & setzt den Einzug & \ref{margins} \\
-|justification| & wählt die Ausrichtung & \ref{justification} \\
-|labelfont|(|+|) & wählt den Zeichensatz des Bezeichners & \ref{fonts} \\
-|labelformat| & wählt das Format des Bezeichners & \ref{formats} \\
-|labelsep| & wählt den Trenner zw. Bezeichner$+$Text & \ref{formats} \\
-|labelseparator| & -- identisch mit |labelsep| -- & \ref{formats} \\
-|list| & schaltet die Listeneinträge an bzw. aus & \ref{lists} \\
-|listformat| & wählt das Listenformat & \ref{lists} \\
-|margin| & setzt den Rand bzw. die Ränder & \ref{margins} \\
-|margin*| & setzt den Rand, sofern keine Breite gesetzt ist & \ref{margins} \\
-|maxmargin| & setzt den max. zu verwendenen Rand & \ref{margins} \\
-|minmargin| & setzt den min. zu verwendenen Rand & \ref{margins} \\
-|name| & setzt den Namen der aktuellen Umgebung & \ref{names} \\
-|oneside| & wählt den einseitigen Modus & \ref{margins} \\
-|options| & führt die angegebene Optionsliste aus & \\
-|parindent| & setzt den Absatzeinzug & \ref{margins} \\
-|parskip| & setzt den Absatzabstand & \ref{margins} \\
-|position| & gibt einen Hinweis auf die Position & \ref{skips} \\
-|singlelinecheck| & schaltet die "`Ein-Zeilen-Prüfung"' ein bzw. aus & \ref{justification} \\
-%|size| & wählt die Größe des Zeichensatzes & \ref{x} \\
-|skip| & setzt den Abstand zwischen Inhalt \& Beschriftung & \ref{skips} \\
-|strut| & schaltet die Verwendung von |\strut| ein bzw. aus & \ref{formats} \\
-|style| & wählt einen Stil aus & \ref{style} \\
-%|style*| & wählt einen Stil aus & \ref{style} \\
-|subtype| & setzt den Typ der Unterbeschriftungen & \phantom{t}--~\footnotemark \\
-|tableposition|\preambleoption & gibt einen Hinweis auf die Position & \ref{skips} \\
-|textfont|(|+|) & wählt den Zeichensatz des Textes & \ref{fonts} \\
-|textformat| & wählt das Format des Textes & \ref{formats} \\
-|twoside| & wählt den zweiseitigen Modus & \ref{margins} \\
-|type| & setzt den Typ \& setzt ggf.~einen Hyperlink-Anker & \ref{types} \\
-|type*| & setzt (nur) den Typ & \ref{types} \\
-|width| & setzt eine feste Breite & \ref{margins} \\
-\end{longtable*}
-\preambleoptiontext
-\footnotetext{Die Option \texttt{subtype} ist in der Dokumentation
- des \package{subcaption}"=Paketes beschrieben.}
-
-\nopagebreak\parbox[t]{\linewidth}{% prevent from page break
-\begin{Note*}
- Veraltete Optionen sind hier nicht gelistet; diese sind in
- \Ref{caption1} und
- \Ref{caption2} zu finden.
-\end{Note*}}
-
-\pagebreak[3]
-\subsection{Befehle}
-
-\begin{longtable*}{lll}
-Befehl & & Abschnitt \\
-\hline
-\endhead
-|\abovecaptionskip| & & \ref{skips} \\
-%|\AtBeginCaption| & & \ref{hooks} \\
-%|\AtEndCaption| & & \ref{hooks} \\
-|\belowcaptionskip| & & \ref{skips} \\
-|\caption| & & \ref{caption} \\
-|\caption*| & & \ref{caption} \\
-|\captionlistentry| & & \ref{captionlistentry} \\
-|\captionof| & & \ref{caption} \\
-|\captionof*| & & \ref{caption} \\
-|\captionsetup| & & \ref{captionsetup} \\
-|\captionsetup*| & & \ref{captionsetup} \\
-|\centerfirst| & & \ref{justification} \\
-|\centerlast| & & \ref{justification} \\
-|\clearcaptionsetup| & & \ref{captionsetup} \\
-|\clearcaptionsetup*| & & \ref{captionsetup} \\
-|\ContinuedFloat| & & \ref{ContinuedFloat} \\
-|\DeclareCaptionFont| & & \ref{declare} \\
-|\DeclareCaptionFormat| & & \ref{declare} \\
-|\DeclareCaptionFormat*| & & \ref{declare} \\
-|\DeclareCaptionJustification| & & \ref{declare} \\
-|\DeclareCaptionLabelFormat| & & \ref{declare} \\
-|\DeclareCaptionLabelSeparator| & & \ref{declare} \\
-|\DeclareCaptionLabelSeparator*| & & \ref{declare} \\
-|\DeclareCaptionListFormat| & & \ref{declare} \\
-|\DeclareCaptionOption| & & \ref{declare} \\
-|\DeclareCaptionStyle| & & \ref{declare} \\
-|\DeclareCaptionSubType| & & --~\footnotemark \\
-|\DeclareCaptionTextFormat| & & \ref{declare} \\
-|\showcaptionsetup| & & \ref{captionsetup} \\
-\end{longtable*}
-\footnotetext{\cs{DeclareCaptionSubType} ist in der Dokumentation
- des \package{subcaption}"=Paketes beschrieben.}
-
-\clearpage
-\subsection{Warnungen}
-
-\begin{Warnings}
-
-\Message
- |\caption outside box or environment.|
-\Or
- |\captionsetup{type=...} outside box or environment.|
-\Or
- |\captionsetup{type*=...} or \captionof outside box|\\
- | or environment.|
-\Description
- |\caption|, |\caption|\-|of| sowie |\caption|\-|setup{type=|\x\meta{type}|}|
- sind nur für die Anwendung \emph{innerhalb} einer Box, Gruppe oder Umgebung
- konzipiert. Außerhalb können unerwünschte Seiteneffekte auftreten.
- \par\See{\Ref{types} und \Ref{caption}}
-
-\Message
- |\caption will not be redefined since it's already|\\
- |redefined by a document class or package which is|\\
- |unknown to the caption package.|
-\Description
- Wenn \thispackage\ eine vorhandene (und unbekannte) Erweiterung des Befehls
- |\caption| erkannt hat, definiert es |\caption| nicht erneut um, da dies
- unweigerlich den Verlust der ursprünglichen Erweiterung zur Folge hätte.
- Daher funktionieren manche Features, wie |\caption*|,
- |\Continued|\-|Float|, das optionale Argument von |\caption|\-|setup|,
- sowie die Optionen |list=| und |hypcap=| nicht mehr; sie werden
- entweder ignoriert oder arbeiten nicht erwartungsgemäß.\par
- Wenn Sie an der ursprünglichen Erweiterung nicht interessiert sind
- und stattdessen den vollen Umfang des \package{caption}"=Paketes
- verwenden wollen, können Sie es mit der nicht supporteten(!)
- Option |compatibility=|\x|false| probieren und die Daumen drücken.
- (Aber Sie werden die nächste Warnung stattdessen bekommen.)
- \par\See{\Ref{classes} und \Ref{compatibility}}
-
-\Message
- |Forced redefinition of \caption since the|\\
- |unsupported(!) package option `compatibility=false'|\\
- |was given.|
-\Description
- Da Sie so mutig waren, die Option |compatibility=|\x|false| zu probieren,
- wird \thispackage\ sein bestes geben, um diesen Wunsch zu erfüllen.
- Aber je nach verwendeter Dokumentenklasse bzw.~Pakete sollten Sie sich
- auf Fehlfunktionen oder Fehlermeldungen einstellen.
- Also bitte die Daumen gedrückt halten!
- \par\See{\Ref{compatibility}}
-
-\Message
- |Hyperref support is turned off because hyperref has|\\
- |stopped early.|
-\Description
- Wenn das \package{hyperref}"=Paket vorzeitig seinen Dienst einstellt
- (den Grund hierfür teilt es Ihnen mit), ist auch die
- \package{hyperref}"=Unterstützung des \package{caption}"=Paketes nicht
- verfügbar. Als Folge werden Sie einige Warnungen des
- \package{hyperref}"=Paketes bekommen, ferner werden Hyperlinks
- auf Abbildungen und Tabellen nicht funktionsfähig sein.
- \par\See{\Ref{hyperref}\,}
-
-\Message
- |Ignoring optional argument [|\meta{pos}|] of \setcapwidth.|
-\Description
- \Thispackage\ bemüht sich, so gut es kann, die \KOMAScript"=Befehle
- bzgl.~Tabellen und Abbildungen zu emulieren. Aber das optionale Argument
- von |\setcapwidth| funktioniert (noch) nicht; wenn Sie es dennoch angeben,
- wird daher diese Warnung ausgegeben.
- \par\See{\Ref{KOMA}}
-
-\Message
- |Internal Warning: |\meta{warning message}|.|
-\Description
- Diese Warnung sollten Sie niemals sehen; entweder verwenden Sie ein Paket,
- welches |figure| und/oder |table| in einer dem \package{caption}"=Paket
- unbekannten Art \& Weise verändert, oder aber es ist ein Fehler im
- \package{caption}"=Paket.
- Bitte senden Sie mir einen Fehlerbericht diesbezüglich per E-Mail. Danke!
-
-\Message
- |\label without proper \caption|
-\Description
- Anders als bei den meisten nicht gleitenden Umgebungen wird bei den
- gleitenden Umgebungen die interne Referenz erst bei Anwendung des Befehls
- |\caption| erzeugt. Ein |\label| Befehl, der auf diese Abbildung
- bzw.~Tabelle verweisen soll, muß daher entweder direkt \emph{nach} oder innerhalb
- des Argumentes von |\caption| platziert werden.
-
-\Message
- |Option `|\meta{option}|' was not in list `|\meta{option list}|'.|
-\Description
- Wenn Sie versuchen, eine bestimmte Option aus einer Optionsliste zu
- entfernen, zum Beispiel mit |\clear|\-|caption|\-|setup[po|\-|si|\-|tion]{table}|,
- und die angegebene Option kann nicht in der Liste gefunden werden, so
- erhalten Sie die obenstehende Warnung.
- Liegt dies nicht an einem Schreibfehler Ihrerseits und möchten Sie ferner
- diese Warnung unterdrücken, so können Sie hierzu
- |\clear|\-|caption|\-|setup*| anstelle von |\clear|\-|caption|\-|setup|
- verwenden.
- \par\See{\Ref{captionsetup}}
-
-\Message
- |Option list `|\meta{option list}|' undefined.|
-\Description
- Wenn Sie versuchen, eine bestimmte Option aus einer Optionsliste zu
- entfernen, zum Beispiel mit |\clear|\-|caption|\-|setup[for|\-|mat]{figure}|,
- und die angegebene Optionsliste ist (noch) nicht definiert, so
- erhalten Sie die obenstehende Warnung.
- Liegt dies nicht an einem Schreibfehler Ihrerseits und möchten Sie ferner
- diese Warnung unterdrücken, so können Sie hierzu |\clear|\-|caption|\-|setup*|
- anstelle von |\clear|\-|caption|\-|setup| verwenden.
- \par\See{\Ref{captionsetup}}
-
-\Message
- |Obsolete option `ignoreLTcapwidth' ignored.|
-\Description
- Die Option |ignoreLTcapwidth| des \package{caption2}"=Paketes wird nicht von
- diesem Paket emuliert. In der Regel können Sie aber diese Option einfach
- ersatzlos entfernen.
- \par\See{\Ref{caption2} und \Ref{longtable}}
-
-\Message
- |`ragged2e' support has been changed. Rerun to get|\\
- |captions right.|
-\Description
- Das \package{ragged2e} wird nur dann vom \package{caption}"=Paket geladen,
- wenn es tatsächlich benötigt wird.
- Um dies zu gewährleisten, sind zwei \LaTeX"=Läufe notwendig, daher können Sie
- beim ersten Durchlauf diese Warnung bekommen.
- Mit dem nächsten \LaTeX"=Lauf sollte also diese Warnung verschwunden sein.
- \par\See{\Ref{justification}}
-
-\Message
- |Reference on page |\meta{page no.}| undefined.|
-\Description
- Ist ein zweiseitiges Dokumentenlayout gewählt, benötigt \thispackage\ zwei
- \LaTeX"=Läufe, um die Ränder korrekt zuordnen zu können;
- daher können Sie beim ersten Durchlauf diese Warnung bekommen.
- Mit dem nächsten \LaTeX"=Lauf sollte also diese Warnung verschwunden sein.
- \par\See{\Ref{margins}}
-
-\Message
- |The caption type was already set to `|\meta{type}|'.|
-\Description
- Diese Warnung informiert Sie über vermische \package{caption}"=Optionen.
- Wenn Sie z.B.~|\caption|\-|setup{type=|\x|table}| oder
- |\caption|\-|of{table}{|\ldots|}| in einer |figure| Umgebung verwenden,
- werden beide Optionssätze, sowohl derjenige für |figure|
- (mit |\caption|\-|setup[figure]{|\ldots|}| angegeben) als auch
- derjenige für |table| (mit |\caption|\-|setup[table]{|\ldots|}| angegeben),
- angewandt.
- {\small(Diese Warnung kann bei Bedarf durch Verwendung der Stern-Form
- |\caption|\-|setup*{type=|\x\ldots|}| unterdrückt werden.)\par}
- \par\See{\Ref{captionsetup}}
-
-\Message
- |The option `hypcap=true' will be ignored for this|\\
- |particular \caption.|
-\Description
- \Thispackage\ hat keinen geeigneten Hyperlink"=Anker für diese Beschriftung
- gefunden, daher hat es entschlossen, die Einstellung |hypcap=|\x|true| (die per
- Standard gesetzt ist) zu ignorieren.
- Als Folge werden Hyperlinks zu dieser Abbildung oder Tabelle (etwa über das
- Abbildungsverzeichnis, oder selber mit |\ref| oder |\auto|\-|ref| angelegt)
- nicht auf den Beginn der Abbildung oder Tabelle verweisen, sondern stattdessen
- auf deren Beschriftung.\par
- Dies kann zum Beispiel passieren, wenn eine Beschriftung mit |\caption|\-|of|
- innerhalb einer nicht-gleitenden Umgebung gesetzt wird, aber auch, wenn ein
- Sie ein Paket in Ihrem Dokument verwenden, welches die Umgebungen |figure|
- oder |table| umdefiniert hat, dieses Paket aber dem \package{caption}"=Paket
- unbekannt ist.\par
- Ist dies für Sie ok, aber die Warnung stört Sie, können Sie sie
- |\caption|\-|setup{hyp|\-|cap=|\x|false}| direkt vor dem betroffenen |\caption|
- oder |\caption|\-|of| Befehl platzieren.
- Ist dies hingegen nicht für Sie ok, können Sie selber an geeigneter Stelle mit
- |\caption|\-|setup{type=|\x\meta{float type}|}| einen Hyperlink"=Anker setzen.
- \par\See{\Ref{hyperref}\,}
-
-\Message
- |Unsupported document class (or package) detected,|\\
- |usage of the caption package is not recommended.|
-\Description
- Entweder ist die verwendete Dokumentenklasse dem \package{caption}"=Paket
- unbekannt, oder aber Sie haben ein Paket in Ihrem Dokument eingebunden,
- welches ebenfalls das interne Makro |\@make|\-|caption| (welches intern für
- das Setzen der Abbildungs- und Tabellenbeschriftungen zuständig ist)
- umdefiniert.
- Wie-auch-immer, \thispackage\ wird entweder das Design der Beschriftungen
- in einer ungewollten Art \& Weise verändern, oder aber es wird zu keinem
- geordneten Verhalten und/oder Fehlermeldungen kommen. Deswegen wird in
- diesem Falle die Verwendung des \package{caption}"=Paketes nicht empfohlen.
- \par\See{\Ref{classes} und \Ref{compatibility}}
-
-\Message
- |Unused \captionsetup[|\meta{type}|].|
-\Description
- Es wurden Optionen mit |\caption|\-|setup[|\meta{Typ}|]| definiert, die im
- weiteren Verlauf des Dokumentes aber nicht zur Anwendung gekommen sind.
- Dies kann zum einen an einem Schreibfehler im Argument \meta{Typ} liegen,
- aber auch daran, daß ein dem \package{caption}"=Paket unbekanntes Paket
- die Umgebungen |figure| und/oder |table| umdefiniert hat, oder auch einfach
- daran, daß Sie die angegebene Umgebung gar nicht im späteren Verlauf Ihres
- Dokumentes verwenden.
- (Möchten Sie diese Warnung unterdrücken, so verwenden Sie
- |\caption|\-|setup*| anstelle von |\caption|\-|setup|.)
- \par\See{\Ref{captionsetup}}
-
-\Message
- |Usage of the |\meta{package}| package together with the|\\
- |caption package is strongly not recommended.|\\
- |Instead of loading the |\meta{package}| package you should|\\
- |use the caption package option `tableposition=top'.|
-\Description
- Das angegebene Paket mischt sich ebenfalls in die Verwendung der Abstände
- über- und unterhalb der Beschriftungen ein. Viele Köche verderben den Brei,
- also ist es ratsam, sich für eines der Pakete -- das angegebene oder
- \thispackage\ -- zu entscheiden, um falsche Abstände zu vermeiden.
- \par\See{\Ref{skips}}
-
-\end{Warnings}
-
-\pagebreak[3]
-\subsection{Fehlermeldungen}
-
-\begin{Warnings}
-
-\Message
-
- |Argument of \@caption has an extra }.|
-\Or
- |Paragraph ended before \@caption was complete.|
-\Description
- Beim Setzen von Beschriftungen, die etwas spezielles wie z.B.~eine Tabelle
- enthalten, ist zu beachten, daß immer ein alternativer Listeneintrag als
- optionales Argument bei |\caption| bzw. |\caption|\-|of| mit angegeben
- werden muß, auch wenn Ihr Dokument gar kein Abbildungs- oder
- Tabellenverzeichnis beeinhaltet.
- \par\See{\Ref{caption}, \Ref{lists} und \Ref{hyperref}\,}
-
-\Message
- |\caption outside float.|
-\Description
- |\caption| ist (in der Regel) nur für die Anwendung in gleitenden
- Umgebungen wie |figure| oder |table|, oder für die Anwendung innerhalb
- |long|\-|table| oder |wrap|\-|figure| konzipiert, ansonsten bekommen Sie
- obenstehende Fehlermeldung.
- Um eine Beschriftung innerhalb einer anderen Umgebung zu setzen, verwenden
- Sie bitte entweder die Kombination |\caption|\-|setup{type=|\x\meta{type}|}|
- $+$ |\caption|, oder aber |\caption|\-|of|.
- \par\See{\Ref{caption}}
-
-\Message
- |\ContinuedFloat outside float.|
-\Description
- |\Continued|\-|Float| ist nur für die Anwendung innerhalb einer gleitenden
- Umgebung wie |figure| oder |table| konzipiert. %oder auch |long|\-|table|
- Für die Anwendung in einer Box, Gruppe oder nicht-gleitenden Umgebung
- bietet sich die Kombination
- |\caption|\-|setup{type=|\x\meta{type}|}| $+$ |\Continued|\-|Float| an.\par
- |\Continued|\-|Float| innerhalb einer |long|\-|table| ist nicht möglich,
- aber vielleicht ist die |longtable*| Umgebung, die eine longtable
- ohne Erhöhung des Tabellenzählers setzt, für Sie hilfreich.
- \par\See{\Ref{ContinuedFloat} und \Ref{longtable}}
-
-\Message
- |Continued `|\meta{type}|' after `|\meta{type}|'.|
-\Description
- Fortlaufende Abbildungen oder Tabellen dürfen nicht von anderen
- gleitenden Umgebungen (oder einer |long|\-|table|) unterbrochen werden,
- so ist z.B.~ eine Tabelle zwischen einer Abbildung und einer
- (mit |\Continued|\-|Float|) fortgesetzten Abbildung nicht möglich.
- \par\See{\Ref{ContinuedFloat}}
-
-\Message
- |For a successful cooperation we need at least version|\\
- |`|\meta{date}|' of package |\meta{package}|, but only version|\\
- |`|\meta{old-date}|' is available.|
-\Description
- Das aktuelle \package{caption}"=Paket kann nicht mit einem solch
- veralteten Paket zusammen betrieben werden.
- Bitte aktualisieren Sie das betroffene Paket, zumindest auf die
- angegebene Version.
-
-\Message
- |Internal Error: |\meta{error message}|.|
-\Description
- Diesen Fehler sollten Sie niemals sehen. Wenn doch, senden Sie mir bitte
- einen Fehlerbericht per E-Mail.
-
-\Message
- |No float type '|\meta{type}|' defined.|
-\Description
- Der in |\caption|\-|setup{type=|\x\meta{type}|}|,
- |\caption|\-|of|\marg{type}, oder |\Declare|\-|Caption|\-|Sub|\-|Type|
- angegebene \meta{type} ist unbekannt.
- \meta{type} sollte entweder `\texttt{figure}' oder `\texttt{table}', oder
- aber eine mit mit
- |\Declare|\-|Floating|\-|Environment|
- (vom \package{newfloat}"=Paket bereitgestellt),
- |\new|\-|float|
- (vom \package{float}"=Paket\cite{float} bereitgestellt) oder
- |\Declare|\-|NewFloat|\-|Type|
- (vom \package{floatrow}"=Paket\cite{floatrow} bereitgestellt)
- definierte Gleitumgebung sein.
-
-\Message
- |Not allowed in longtable* environment.|
-\Description
- Der Befehl |\caption| ist innerhalb einer |long|\-|table*| Umgebung
- nicht erlaubt. Verwenden Sie entweder |\caption*| für eine Beschriftung
- ohne Bezeichner oder benutzen Sie die reguläre |long|\-|table| Umgebung.
-
-\Message
- |Not available in compatibility mode.|
-\Description
- Das angeforderte Feature steht im sog.~Kompatibilitätsmodus nicht zur
- Verfügung, d.h.~\thispackage\ hat eine inkompatible Dokumentenklasse oder
- ein inkompatibles Paket entdeckt, welches ebenfalls |\caption| erweitert
- und damit die Anwendung dieses Features bzw.~Befehls verhindert.
- \par\See{\Ref{compatibility}}
-
-\Message
- |Only one \caption can be placed in this environment.|
-\Description
- Innerhalb der Umgebungen, die das \package{fltpage} oder \package{sidecap}
- Paket zur Verfügung stellt, kann nur eine einzige Bildbeschriftung gesetzt
- werden.
-
-\Message
- |Option clash for package caption.|
-\Or[aber manchmal auch]
- |Missing \begin{document}.|
-\Description
- Ein anderes \LaTeX-Paket hat \thispackage\ bereits geladen, Sie können es
- daher nicht noch einmal mit anderen Optionen laden.
- Als Verdächtiger kommt z.B.~das \package{ctable} oder das
- \package{subfig}"=Paket in Frage; sollte dies zutreffen,
- laden Sie bitte \thispackage\ \emph{vor} dem betreffenen Paket.
- Im Falle des \package{subfig}"=Paketes können Sie auch alternativ beim
- Laden des \package{subfig}"=Paketes die Option |caption=|\x|false| angeben.
- \par\See{Dokumentation des \package{subfig}"=Paketes\cite{subfig}}
-
-\Message
- |Paragraph ended before \caption@makecurrent was complete.|
-\Or
- |Paragraph ended before \caption@prepareanchor was complete.|
-\Description
- Beim Setzen von Beschriftungen, die mehr als aus einem Absatz bestehen,
- ist zu beachten, daß immer ein alternativer Listeneintrag als optionales
- Argument bei |\caption| bzw. |\caption|\-|of| mit angegeben werden muß,
- auch wenn Ihr Dokument gar kein Abbildungs- oder Tabellenverzeichnis
- beeinhaltet.
- \par\See{\Ref{caption}, \Ref{lists} und \Ref{hyperref}\,}
-
-\Message
- |Something's wrong--perhaps a missing \caption|\\
- |in the last figure or table.|
-\Description
- Sie scheinen den Befehl |\sub|\-|caption| (oder einen anderen,
- der eine Unter"=Beschriftung setzt) ohne eine zugehörige,
- mit |\caption| gesetzte, Beschriftung anzuwenden.
- Dies wird nicht unterstützt.
-
-\Message
- |The option `labelsep=|\meta{name}|' does not work|\\
- |with `format=hang'.|
-\Or
- |The option `labelsep=|\meta{name}|' does not work|\\
- |with \setcaphanging (which is set by default).|
-\Description
- Ein Bezeichnungstrenner, der ein |\\| Kommando enthält (wie etwa
- |labelsep=|\x|newline|), kann nicht mit einem Format kombiniert werden,
- welches "`hängende"' Beschriftungen liefert (wie etwa |format=|\x|hang|).
- Bitte wählen Sie entweder einen anderen Trenner (wie
- z.B.~|labelsep=|\x|colon|), oder aber ein anderes Beschriftungsformat
- (wie z.B.~|format=|\x|plain|) aus.
- \par\See{\Ref{formats} bzw.~\Ref{KOMA}}
-
-\Message
- |The package option `caption=false' is obsolete.|\\
- |Please pass this option to the subfig package instead|\\
- |and do *not* load the caption package anymore.|
-\Description
- Sie haben die Option |caption=|\x|false| angegeben. Diese war früher mal eine
- Krücke, um nicht das komplette \package{caption}"=Paket zu laden, sondern
- nur den für das \package{subfig}"=Paket zwingend benötigten Teil.
- Dieser Mechanismus ist veraltet und wird nicht mehr angeboten; stattdessen
- sollten Sie diese Option dem \package{subfig}"=Paket übergeben und
- \thispackage\ nicht mehr explizit laden.
- \par\See{Dokumentation des \package{subfig}"=Paketes\cite{subfig}}
-
-\Message
- |Undefined boolean value `|\meta{value}|'.|
-\Description
- Es wurde versucht, eine boolische Option (wie z.B.~|singlelinecheck=| oder
- |hypcap=|) auf einen unbekannten Wert zu setzen. Nur die Werte |false|, |no|,
- |off|, |0| bzw.~|true|, |yes|, |on| und |1| sind hier möglich.
-
-\Message
- |Undefined format `|\meta{name}|'.|
-\Description
- Es wurde versucht, ein Beschriftungsformat auszuwählen, welches nicht
- definiert ist. Vielleicht ein Schreibfehler!?
- \par\See{\Ref{formats}}
-
-\Message
- |Undefined label format `|\meta{name}|'.|
-\Description
- Es wurde versucht, ein Bezeichnungsformat auszuwählen, welches nicht
- definiert ist. Vielleicht ein Schreibfehler!?
- \par\See{\Ref{formats}}
-
-\Message
- |Undefined label separator `|\meta{name}|'.|
-\Description
- Es wurde versucht, ein Beschriftungstrenner auszuwählen, welcher nicht
- definiert ist. Vielleicht ein Schreibfehler!?
- \par\See{\Ref{formats}}
-
-\Message
- |Undefined list format `|\meta{name}|'.|
-\Description
- Es wurde versucht, ein Listenformat auszuwählen, welches nicht
- definiert ist. Vielleicht ein Schreibfehler!?
- \par\See{\Ref{lists}}
-
-\Message
- |Undefined position `|\meta{name}|'.|
-\Description
- Es wurde versucht, den Positionshinweis auf einen unbekannten Wert zu
- setzen. Vielleicht ein Schreibfehler!?
- \par\See{\Ref{skips}}
-
-\Message
- |Undefined style `|\meta{name}|'.|
-\Description
- Es wurde versucht, ein Beschriftungsstil auszuwählen, welcher nicht
- definiert ist. Vielleicht ein Schreibfehler!?
- \par\See{\Ref{style}}
-
-\Message
- |Undefined text format `|\meta{name}|'.|
-\Description
- Es wurde versucht, ein Textformat auszuwählen, welches nicht
- definiert ist. Vielleicht ein Schreibfehler!?
- \par\See{\Ref{formats}}
-
-\Message
- |Usage of the `position' option is incompatible|\\
- |to the `|\meta{package}|' package.|
-\Description
-% (ftcap,nonfloat,topcapt)
- Das angegebene Paket mischt sich ebenfalls in die Verwendung der
- Abstände über- und unterhalb der Beschriftungen ein.
- Sie müssen sich daher für \emph{einen} der Mechanismen entscheiden:
- Entweder Sie verwenden das angegebene Paket für die Anpassung
- der Abstände, oder aber die |position|"=Option des
- \package{caption}"=Paketes, beides geht nicht.
- \par\See{\Ref{skips}}
-
-\Message
- |You can't use both, the (obsolete) caption2 *and*|\\
- |the (current) caption package.|
-\Description
- Die Pakete \package{caption} und \package{caption2} können nicht
- innerhalb eines Dokumentes gleichzeitig verwendet werden.
- Verwenden Sie bitte nur das aktuelle \package{caption}"=Paket.
- \par\See{\Ref{caption2}}
-
-\end{Warnings}
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\section{Versionshistorie}
-\label{history}
-
-Die Version $1.0$ dieses Paketes wurde im Jahr 1994 veröffentlicht und bot
-eine Handvoll Optionen, um das Design der Abbildungs-
-bzw.~Tabellenbeschriftungen anzupassen.
-Ferner unterstützte diese Version bereits das \package{rotating} und
-\package{subfigure}"=Paket.
-Version $1.1$ führte die |center|\-|last| Option ein;
-in Version $1.2$ kam die Unterstützung des \package{float}"=Paketes hinzu.
-Die Version $1.3$ verfeinerte die Koorperation mit dem
-\package{subfigure}"=Paket; die Version $1.4$ bot die Option |nooneline|
-als Neuheit an.
-
-Die Version $2.0$ des sog.~\package{caption2}"=Paketes war ein
-experimenteller Seitenzweig der regulären Version des
-\package{caption}"=Paketes. Er wurde im Jahre 1995 als Beta"=Testversion
-öffentlich gemacht, um die Nachfrage nach neuen Features und der
-Anpassung an das \package{longtable}"=Paket kurzfristig zu befriedigen.
-(Eine Version $2.1$ wurde 2002 als Fehlerbereinigung nachgereicht.)
-
-Im Jahr 2003 hatte ich dann endlich wieder etwas Zeit gefunden, und so
-wurde im Dezember die neue reguläre Version $3.0$ in Zusammenarbeit mit
-Frank Mittelbach und Steven Cochran aus der Taufe gehoben, die endlich
-den arg vernachlässigten Seitenzweig namens \package{caption2}
-überflüssig machte.
-Weite Teile des Paketes wurden hierfür neu geschrieben, und auch das
-Benutzerinterface wurde gründlich renoviert.
-Außerdem kam die Unterstützung der Pakete \package{hyperref},
-\package{hypcap}, \package{listings}, \package{sidecap} und
-\package{supertabular} hinzu.
-
-Während all die vorangegangenen Versionen dafür ausgelegt waren, mit
-den \LaTeX"=Standarddokumentenklassen \class{article}, \class{report} und
-\class{book} benutzt zu werden, unterstützt die im Jahre 2007
-veröffentlichte Version $3.1$ auch die \AmS, die \KOMAScript, \NTG{} und
-\SmF{} Dokumentenklassen, ferner auch die \class{beamer}"=Klasse.
-Weiterhin kamen die Unterstützung der französischen Babel"=Option
-\package{frenchb} und des französischen Sprachpaketes \package{frenchle}
-bzw.~\package{frenchpro} hinzu;
-außerdem wurde die Anzahl der unterstützten Pakete um die Pakete
-\package{floatflt}, \package{fltpage}, \package{picinpar},
-\package{picins}, \package{setspace}, \package{threeparttable}
-und \package{wrapfig} erhöht.
-Neue Optionen und Befehle wurden ebenfalls eingeführt, unter anderem
-|font+|, |figure|\-|within| \& |table|\-|within|,
-|list| \& |list|\-|format|, |max|\-|margin| \& |min|\-|margin|,
-|\caption|\-|list|\-|entry|, |\Declare|\-|Caption|\-|List|\-|Format|.
-Einen weiteren Gewinn stellt der neu integrierte Kompatibilitätscheck
-\see*{\Ref{compatibility}}, das neue "`hypcap"' Feature
-\see*{\Ref{hyperref}\,}, und die Unterstützung von Teil"=Beschriftungen
-\see*{\package{subcaption}"=Paketdokumentation} dar.
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\section{Kompatibilität zu älteren Versionen}
-
-\subsection{caption v\texorpdfstring{$1.x$}{1.x}}
-\label{caption1}
-
-Diese Version des \package{caption}"=Paketes ist weitgehend kompatibel zu den
-älteren Versionen $1.0$ bis $1.4$ des Paketes; alte, vorhandene Dokumente
-sollten sich also in der Regel ohne Probleme weiterhin übersetzen lassen.
-Jedoch ist zu beachten, daß eine Mischung aus alten Befehlen und neueren
-Optionen bzw.~Befehlen zu unerwünschten Nebeneffekten führen kann.
-
-Hier eine kurze Übersicht über die alten, überholten Optionen und ihre
-aktuellen Entsprechungen:
-
-\begin{center}\small
-\begin{tabular}{ll}
-\package{caption} \version{1.x} & \package{caption} \version{3.x}\\
-\hline
-%\endhead
-|normal| & |format=plain|\\
-|hang| & |format=hang|\\
-|isu| & |format=hang|\\
-|center| & |justification=centering|\\
-|centerlast| & |justification=centerlast|\\
-|nooneline| & |singlelinecheck=off|\\
-|scriptsize| & |font=scriptsize|\\
-|footnotesize| & |font=footnotesize|\\
-|small| & |font=small|\\
-|normalsize| & |font=normalsize|\\
-|large| & |font=large|\\
-|Large| & |font=Large|\\
-|up| & |labelfont=up|\\
-|it| & |labelfont=it|\\
-|sl| & |labelfont=sl|\\
-|sc| & |labelfont=sc|\\
-|md| & |labelfont=md|\\
-|bf| & |labelfont=bf|\\
-|rm| & |labelfont=rm|\\
-|sf| & |labelfont=sf|\\
-|tt| & |labelfont=tt|\\
-\end{tabular}
-\end{center}
-
-Neben den Optionen zum Einstellen des Zeichensatzes gab es auch die Befehle
-|\caption|\-|size| bzw.~|\caption|\-|font| und |\caption|\-|label|\-|font|,
-die direkt mit |\re|\-|new|\-|command| umdefiniert werden konnten.
-Dieser Mechanismus wurde durch die Anweisungen
-\begin{quote}
- |\DeclareCaptionFont{|\ldots|}{|\ldots|}|\qquad und\\
- |\captionsetup{font=|\ldots|,labelfont=|\ldots|}|
-\end{quote}
-ersetzt. \SeeUserDefined
-
-Das Setzen eines Randes geschah in \version{1.x} mit
-\begin{quote}
- |\setlength{\captionmargin}{|\ldots|}|\quad.
-\end{quote}
-Dies wurde durch
-\begin{quote}
- |\captionsetup{margin=|\ldots|}|
-\end{quote}
-ersetzt.
-\See{\Ref{margins}}
-
-Zum Beispiel wäre
-\begin{quote}
- |\usepackage[hang,bf]{caption}|\\
- |\renewcommand\captionfont{\small\sffamily}|\\
- |\setlength\captionmargin{10pt}|
-\end{quote}
-in aktueller Notation
-\begin{quote}
- |\usepackage[format=hang,labelfont=bf,font={small,sf},|\\
- | margin=10pt]{caption}|
-\end{quote}
-bzw.
-\begin{quote}
- |\usepackage{caption}|\\
- |\captionsetup{format=hang,labelfont=bf,font={small,sf},|\\
- | margin=10pt}|\quad.
-\end{quote}
-
-Die etwas exotische Option |ruled|, die eine partielle Anwendung der
-eingestellten Parameter bei Umgebungen des Typs |ruled| aktivierte,
-wird ebenfalls emuliert, hat aber keine direkte Entsprechung in
-dieser Version des \package{caption}"=Paketes.
-Möchte man das Aussehen der Abbildungen des Stils |ruled|,
-der durch das \package{float}"=Paket zur Verfügung gestellt wird,
-verändern, so ist dies nun durch
-\begin{quote}
- |\DeclareCaptionStyle{ruled}{|\ldots|}|
-\end{quote}
-bzw.
-\begin{quote}
- |\captionsetup[ruled]{|\ldots|}|
-\end{quote}
-möglich.
-\SeeUserDefined[, \Ref{captionsetup} und \Ref{float}]
-
-\subsection{caption2 v\texorpdfstring{$2.x$}{2.x}}
-\label{caption2}
-
-Das Paket \package{caption} und seine experimentelle, nun veraltete
-Variante \package{caption2} sind vom internen Konzept
-her zu unterschiedlich, um hier eine vollständige Kompatibilität
-gewährleisten zu können.
-Daher liegt diesem Paket weiterhin die Datei |caption2.sty| bei, so daß
-ältere Dokumente, die das \package{caption2}"=Paket verwenden, weiterhin
-übersetzt werden können.
-
-Neue Dokumente sollten jedoch auf dem aktuellen \package{caption}"=Paket
-aufgesetzt werden. In den meisten Fällen ist es hierfür ausreichend,
-einfach die Anweisung
-\begin{quote}
- |\usepackage[...]{caption2}|
-\end{quote}
-durch
-\begin{quote}
- |\usepackage[...]{caption}|
-\end{quote}
-zu ersetzen. Einige Optionen und Befehle werden jedoch nicht emuliert,
-so daß Sie anschließend Fehlermeldungen erhalten können.
-Die folgenden Absätze werden Ihnen jedoch bei der Umsetzung dieser
-Optionen und Befehle helfen. Sollten darüberhinaus noch Fragen offen sein
-oder Probleme auftreten, dann zögern Sie bitte nicht, mich diesbezüglich
-per E-Mail zu kontaktieren.
-
-Zusätzlich zu den bereits im letzten Abschnitt vorgestellten Optionen
-werden ebenfalls emuliert:
-
-\begin{center}\small
-\begin{tabular}{ll}
-\package{caption2} \version{2.x} & \package{caption} \version{3.x}\\
-\hline
-%\endhead
-|flushleft| & |justification=raggedright|\\
-|flushright| & |justification=raggedleft|\\
-|oneline| & |singlelinecheck=on|\\
-\end{tabular}
-\end{center}
-
-Das Setzen eines Randes geschah in \version{2.x} mit
-\begin{quote}\leavevmode\hbox{%
- |\setcaptionmargin{|\ldots|}| bzw.
- |\setcaptionwidth{|\ldots|}|\quad.
-}\end{quote}
-Dies wurde durch
-\begin{quote}\leavevmode\hbox{%
- |\captionsetup{margin=|\ldots|}| bzw.
- |\captionsetup{width=|\ldots|}|
-}\end{quote}
-ersetzt. \See{\Ref{margins}}
-
-Das Setzen des Einzuges wurde in \version{2.x} mit
-\begin{quote}
- |\captionstyle{indent}|\\
- |\setlength\captionindent{|\ldots|}|
-\end{quote}
-\pagebreak[3]
-erledigt, dies geschieht nun stattdessen mit
-\nopagebreak[3]
-\begin{quote}
- |\captionsetup{format=plain,indention=|\ldots|}|\quad.
-\end{quote}
-
-Die Sonderbehandlung von einzeiligen Beschriftungen ließ sich in
-\version{2.x} mit |\oneline|\-|captions|\-|false| aus-
-bzw.~|\oneline|\-|captions|\-|true| wieder einschalten.
-Dies wurde durch
-|\caption|\-|setup{|\x|single|\-|line|\-|check=|\x|off}|
-bzw.
-|\caption|\-|setup{|\x|single|\-|line|\-|check=|\x|on}|
-ersetzt. \See{\Ref{justification}}
-
-Die Befehle
-\begin{quote}
- |\captionlabeldelim|, |\captionlabelsep|, |\captionstyle|,\\
- |\defcaptionstyle|, |\newcaptionstyle| und |\renewcaptionstyle|
-\end{quote}
-haben keine direkte Entsprechnung und werden daher durch diese
-Version des \package{caption}"=Paketes auch nicht emuliert.
-Sie führen also bei der Verwendung zu Fehlermeldungen und müssen daher
-zwingend umgesetzt werden. Die Umsetzung ist von Fall zu Fall verschieden,
-lesen Sie sich daher bitte diese Anleitung gründlich durch und suchen Sie
-sich die Optionen bzw.~Befehle als Ersatz heraus, die Ihren Bedürfnissen
-entsprechen.
-
-\iffalse
-Als kleine Hilfestellung hier die Beispiele aus der alten Anleitung zum
-\package{caption2}"=Paket und deren Umsetzung:
-
-\newenvironment{OldNew}%
- {\begin{minipage}\linewidth
- \def\Old{Alt:\begin{quote}}%
- \def\New{\end{quote}Neu:\begin{quote}}%
- \def\Or{\end{quote}\centerline{-- oder --}\begin{quote}}%
- }%
- {\end{quote}\end{minipage}}
-
-\begin{OldNew}
-\Old
- |\captionstyle{center}|
-\New
- |\captionsetup{justification=centering}|
-\end{OldNew}
-
-\hrule
-
-\begin{OldNew}
-\Old
- |\captionstyle{indent}|\\
- |\setlength{\captionindent}{1cm}|
-\New
- |\captionsetup{format=plain,indention=1cm}|
-\end{OldNew}
-
-\hrule
-
-\begin{OldNew}
-\Old
- |\renewcommand\captionfont{\small}|\\
- |\renewcommand\captionlabelfont{\itshape}|
-\New
- |\captionsetup{font=small,labelfont=it}|
-\end{OldNew}
-
-\hrule
-
-\begin{OldNew}
-\Old
- |\renewcommand\captionfont{\small\itshape}|\\
- |\renewcommand\captionlabelfont{\upshape}|
-\New
- |\captionsetup{font=small,textfont=it}|
-\end{OldNew}
-
-\hrule
-
-\begin{OldNew}
-\Old
- |\setcaptionwidth{.5\textwidth}|
-\New
- |\captionsetup{width=.5\textwidth}|
-\end{OldNew}
-
-\hrule
-
-\begin{OldNew}
-\Old
- |\setcaptionmargin{.25\textwidth}|
-\New
- |\captionsetup{margin=.25\textwidth}|
-\end{OldNew}
-
-\hrule
-
-\begin{OldNew}
-\Old
- |\newcaptionstyle{absatz}{\captionlabel: \exampletext\par}|\\
- |\captionstyle{absatz}|
-\New
- |\DeclareCaptionFormat{absatz}{#1: #3\par}|\\
- |\captionsetup{format=absatz,singlelinecheck=off}|
-\Or
- |\captionsetup{format=plain,singlelinecheck=off}|
-\end{OldNew}
-
-\hrule
-
-\begin{OldNew}
-\Old
- |\newcaptionstyle{fancy}{\textsf{\captionlabel}\\\exampletext\par}|\\
- |\captionstyle{fancy}|
-\New
- |\DeclareCaptionFormat{fancy}{\textsf{#1}\\#3\par}|\\
- |\captionsetup{format=fancy,singlelinecheck=off}|
-\Or
- |\captionsetup{format=plain,labelfont=sf,labelsep=newline}|
-\end{OldNew}
-
-\hrule
-
-\begin{OldNew}
-\Old
- |\newcaptionstyle{fancy2}{\exampletext\hfill\textit{(\captionlabel)}}|\\
- |\captionstyle{fancy2}|
-\New
- |\DeclareCaptionFormat{fancy2}{#3\hfill\textit{(#1)}}|\\
- |\captionsetup{format=fancy2,singlelinecheck=off}|
-\end{OldNew}
-
-\hrule
-
-\begin{OldNew}
-\Old
- |\newcaptionstyle{mystyle}{%|\\
- | \normalcaptionparams|\\
- | \renewcommand\captionlabelfont{\bfseries}%|\\
- | \renewcommand\captionlabeldelim{.}%|\\
- | \onelinecaptionsfalse|\\
- | \usecaptionstyle{centerlast}}|\\
- |\captionstyle{mystyle}|
-\New
- |\DeclareCaptionStyle{mystyle}{labelfont=bf,labelsep=period,justification=centerlast}|\\
- |\captionsetup{style=mystyle}|
-\end{OldNew}
-
-\hrule
-
-\begin{OldNew}
-\Old
- |\newcaptionstyle{hangandleft}{%|\\
- | \let\oldcaptiontext\exampletext|\\
- | \def\exampletext{\raggedright\oldcaptiontext}%|\\
- | \usecaptionstyle{hang}}|\\
- |\captionstyle{hangandleft}|
-\New
- |\captionsetup{format=hang,justification=raggedright}|
-\end{OldNew}
-
-\hrule
-
-\begin{OldNew}
-\Old
- |\newcaptionstyle{fancy}{%|\\
- | \usecaptionmargin\captionfont|\\
- | \onelinecaption|\\
- | {{\captionlabelfont\captionlabel\captionlabeldelim}%|\\
- | \captionlabelsep\exampletext}%|\\
- | {{\centering\captionlabelfont\captionlabel\par}%|\\
- | \centerlast\exampletext\par}}|\\
- |\captionstyle{fancy}|
-\New
- |\DeclareCaptionFormat{fancy}{\centering#1\par\centerlast#3\par}|\\
- |\DeclareCaptionStyle{fancy}|\\
- | [format=plain,justification=centering]|\\
- | {format=fancy}|\\
- |\captionsetup{style=fancy}|
-\Or
- |\DeclareCaptionFormat{fancy}{#1\par#3\par}|\\
- |\DeclareCaptionStyle{fancy}|\\
- | [format=plain,justification=centering]|\\
- | {format=fancy,justification=centerlast}|\\
- |\captionsetup{style=fancy}|
-\end{OldNew}
-
-\hrule
-
-\begin{OldNew}
-\Old
- |\renewcaptionstyle{longtable}{\usecaptionstyle{normal}}|
-\New
- |\captionsetup[longtable]{format=plain}|
-\end{OldNew}
-\fi
-
-Ebenfalls keine Entsprechung hat die Option |ignore|\-|LT|\-|cap|\-|width|
-der \version{2.x}.
-Deren Verwendung kann in der Regel einfach entfallen, da \thispackage\ den
-Wert von |\LT|\-|cap|\-|width| sowieso nicht beachtet, solange er nicht
-explizit auf einen anderen Wert als den Standardwert ($=$|4in|) gesetzt wird.
-\See{\Ref{longtable}}
-
-\subsection{caption v\texorpdfstring{$3.0$}{3.0}}
-\label{caption3}
-
-%\NEWdescription{v3.1}
-\Thispackage\ \version{3.0} hatte keine weiteren Dokumentenklassen
-unterstützt als die drei Standard"=Klassen, die \LaTeX\ selber mitbringt:
-\class{article}, \class{report} und \class{book}.
-Daher waren die Vorbelegungen der Einstellungsmöglichkeiten fest durch
-dieses Paket vorgegeben, sie repräsentierten das Aussehen bei Verwendung
-einer dieser Klassen.
-Nun aber unterstützt \thispackage\ mehr Dokumentenklassen aktiv, folglich
-kann die Vorbelegung nun von der verwendeten Dokumentenklasse abhängen.
-
-Ein Beispiel: Während in \version{3.0} die Vorbelegung der Ausrichtung
-immer |jus|\-|ti|\-|fi|\-|ca|\-|tion=|\x|jus|\-|ti|\-|fied| war,
-ist sie nun immer noch |jus|\-|ti|\-|fied| wenn eine der drei Standardklassen
-verwendet wird, aber |jus|\-|ti|\-|fi|\-|ca|\-|tion=|\x|ragged|\-|right|,
-wenn die \package{beamer}"=Klasse verwendet wird.
-
-Möchten Sie weiterhin die "`alten"' Vorbelegungen, so können Sie die Option
-|style=base| beim Laden des \package{caption}"=Paketes angeben oder später
-mit |\caption|\-|setup{style=|\x|base}| den alten Grundzustand wieder
-herstellen.
-
-\medskip
-
-Weiterhin prüft das \package{caption}"=Paket nun automatisch auf
-Inkompatibilitäten und gibt ggf.~eine Warnung aus.
-Sollte eine ernsthafte Inkompatibilität festgestellt werden, werden außerdem
-einige Features des \package{caption}"=Paketes abgeschaltet.
-Lediglich diese Prüfung ist neu, wenn Sie also neuerdings eine
-Kompatibilitätswarnung erhalten, so waren auch bereits vorangegangene Versionen
-des \package{caption}"=Paketes inkompatibel, dies hatte sich aber früher "`nur"'
-durch Seiteneffekte bzw.~nicht korrekt funktionierende Optionen oder Befehle
-geäußert.
-Die Kompatibilitätswarnungen sagen auch nicht aus, daß etwas schief gegangen ist,
-sondern lediglich, daß etwas schief gehen könnte. Sie sollten aber auf jeden Fall,
-wenn Sie \thispackage\ trotz einer solchen Warnung einsetzen, die Abbildungs-
-und Tabellenbeschriftungen bzgl.~ihres Aussehens genau im Auge behalten.
-
-\bigskip
-
-\begin{Note*}
-\Thispackage\ \version{3.0} hatte als Interimslösung die Option
-|caption=|\x|false| bereitgestellt, um nicht das ganze \package{caption}"=Paket
-zu laden, sondern nur denjenigen Teil, der für den Betrieb des
-\package{subfig}"=Paketes\cite{subfig} notwendig war.
-Dieser Mechanismus ist veraltet und wird nicht mehr angeboten; bitte
-übergeben Sie stattdessen bei Bedarf diese Option an das \package{subfig}"=Paket
-und laden Sie nicht mehr \thispackage.
-%\par\See{\package{subfig}"=Paketdokumentation}
-\end{Note*}
-
-% --------------------------------------------------------------------------- %
-
-\iffalse
-\TODO: subcaption-Anleitung
-\fi
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\begin{thebibliography}{99}
-
- \bibitem{TLC2}
- Frank Mittelbach und Michel Goossens:\\
- \newblock {\em Der {\LaTeX} Begleiter (2.\,Auflage)},\\
- \newblock Addison-Wesley, 2004.
-
- \bibitem{beamer}
- Till Tantau:\\
- \href{http://www.ctan.org/pkg/beamer}%
- {\emph{User Guide to the Beamer Class, Version 3.07}},\\
- March 11, 2007
-
- \bibitem{KOMAScript}
- Markus Kohm \& Jens-Uwe-Morawski:\\
- \href{http://www.ctan.org/pkg/koma-script}%
- {\emph{KOMA-Script -- ein wandelbares \LaTeXe-Paket}},\\
- 2007-03-02
-
- \bibitem{NTG}
- Victor Eijkhout:\\
- \href{http://www.ctan.org/pkg/ntgclass}%
- {\emph{An introduction to the Dutch \LaTeX\ document classes}},\\
- 3 September 1989
-
- \bibitem{algorithms}
- Rog\'erio Brito:\\
- \href{http://www.ctan.org/pkg/algorithms}%
- {\emph{Algorithms}},\\
- June 2, 2006
-
-\iffalse
- \bibitem{algorithm2e}
- Christophe Fiorio:\\
- \href{http://www.ctan.org/pkg/algorithm2e}%
- {\emph{algorithm2e.sty -- package for algorithms}},\\
- March 11, 2007
-\fi
-
- \bibitem{float}
- Anselm Lingnau:\\
- \href{http://www.ctan.org/pkg/float}%
- {\emph{An Improved Environment for Floats}},\\
- 2001/11/08
-
- \bibitem{floatflt}
- Mats Dahlgren:\\
- \href{http://www.ctan.org/pkg/floatflt}%
- {\emph{Welcome to the floatflt package}},\\
- 1998/06/05
-
- \bibitem{floatrow}
- Olga Lapko:\\
- \href{http://www.ctan.org/pkg/floatrow}%
- {\emph{The floatrow package documentation}},\\
- 2007/12/24
-
- \bibitem{fltpage}
- Sebastian Gross:\\
- \href{http://www.ctan.org/pkg/fltpage}%
- {\emph{Welcome to the beta test of fltpage package!}},\\
- 1998/11/13
-
- \bibitem{hyperref}
- Sebastian Rahtz \& Heiko Oberdiek:\\
- \href{http://www.ctan.org/pkg/hyperref}%
- {\emph{Hypertext marks in \LaTeX}},\\
- November 12, 2007
-
- \bibitem{hypcap}
- Heiko Oberdiek:\\
- \href{http://www.ctan.org/pkg/hypcap}%
- {\emph{The hypcap package -- Adjusting anchors of captions}},\\
- 2007/04/09
-
- \bibitem{listings}
- Carsten Heinz \& Brooks Moses:\\
- \href{http://www.ctan.org/pkg/listings}%
- {\emph{The Listings Package}},\\
- 2007/02/22
-
- \bibitem{longtable}
- David Carlisle:\\
- \href{http://www.ctan.org/pkg/longtable}%
- {\emph{The longtable package}},\\
- 2004/02/01
-
- \bibitem{picinpar}
- Friedhelm Sowa:\\
- \href{http://www.ctan.org/pkg/picinpar}%
- {\emph{Pictures in Paragraphs}},\\
- July 13, 1993
-
- \bibitem{picins}
- Joachim Bleser und Edmund Lang:\\
- \href{http://www.ctan.org/pkg/picins}%
- {\emph{PicIns-Benutzerhandbuch Version 3.0}},\\
- September~1992
-
- \bibitem{rotating}
- Sebastian Rahtz und Leonor Barroca:\\
- \href{http://www.ctan.org/pkg/rotating}%
- {\emph{A style option for rotated objects in \LaTeX}},\\
- 1997/09/26
-
- \bibitem{setspace}
- Erica M. S. Harris \& Geoffrey Tobin:\\
- \href{http://www.ctan.org/pkg/setspace}%
- {\emph{LaTeX Document Package ``setspace''}},\\
- 1 December 2000
-
- \bibitem{sidecap}
- Rolf Niepraschk \& Hubert G\"a\ss lein:\\
- \href{http://www.ctan.org/pkg/sidecap}%
- {\emph{The sidecap package}},\\
- 2003/06/06
-
- \bibitem{subfigure}
- Steven D. Cochran:\\
- \href{http://www.ctan.org/pkg/subfigure}%
- {\emph{The subfigure package}},\\
- 2002/07/02
-
- \bibitem{subfig}
- Steven D. Cochran:\\
- \href{http://www.ctan.org/pkg/subfig}%
- {\emph{The subfig package}},\\
- 2005/07/05
-
- \bibitem{supertabular}
- Johannes Braams und Theo Jurriens:\\
- \href{http://www.ctan.org/pkg/supertabular}%
- {\emph{The supertabular environment}},\\
- 2002/07/19
-
- \bibitem{threeparttable}
- Donald Arseneau:\\
- \href{http://www.ctan.org/pkg/threeparttable}%
- {\emph{Three part tables: title, tabular environment, notes}},\\
- 2003/06/13
-
- \bibitem{wrapfig}
- Donald Arseneau:\\
- \href{http://www.ctan.org/pkg/wrapfig}%
- {\emph{WRAPFIG.STY ver 3.6}},\\
- 2003/01/31
-
- \bibitem{xtab}
- Peter Wilson:\\
- \href{http://www.ctan.org/pkg/xtab}%
- {\emph{The xtab package}},\\
- 2004/05/24
-
-\end{thebibliography}
-
-% --------------------------------------------------------------------------- %
-
-\end{document}
diff --git a/Master/texmf-dist/source/latex/caption/caption-elsarticle.dtx b/Master/texmf-dist/source/latex/caption/caption-elsarticle.dtx
index 878e8550229..6fb731cf979 100644
--- a/Master/texmf-dist/source/latex/caption/caption-elsarticle.dtx
+++ b/Master/texmf-dist/source/latex/caption/caption-elsarticle.dtx
@@ -27,11 +27,10 @@
% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
-% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
-% and the user manuals
-% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty.
%
% \fi
+%
% \CheckSum{3}
%
% \iffalse
@@ -139,6 +138,7 @@
% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\kernel@ifnextchar}
% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
diff --git a/Master/texmf-dist/source/latex/caption/caption-eng.tex b/Master/texmf-dist/source/latex/caption/caption-eng.tex
deleted file mode 100644
index 21a61546bef..00000000000
--- a/Master/texmf-dist/source/latex/caption/caption-eng.tex
+++ /dev/null
@@ -1,4458 +0,0 @@
-%
-% This is file `caption-eng.tex'.
-%
-% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
-%
-% --------------------------------------------------------------------------
-%
-% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
-% of this license or (at your option) any later version.
-% The latest version of this license is in
-% http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
-% version 2003/12/01 or later.
-%
-% This work has the LPPL maintenance status "maintained".
-%
-% This Current Maintainer of this work is Axel Sommerfeldt.
-%
-% This work consists of the files
-% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
-% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
-% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
-% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
-% the derived files
-% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
-% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
-% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
-% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
-% and the user manuals
-% caption-deu.tex, caption-eng.tex, caption-rus.tex.
-%
-\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesFile{caption-eng.tex}[2020/09/21 v3.5 The caption package]
-\hbadness=9999 \newcount\hbadness \hfuzz=20pt % Make TeX shut up.
-%\errorcontextlines=3
-
-\documentclass[USenglish]{ltxdoc}
-\setlength\parindent{0pt}
-\setlength\parskip{\smallskipamount}
-\setlength\leftmargini{2em}% default = 2.5em
-\makeatletter\g@addto@macro\MacroFont{\normalcolor}\makeatother
-
-\newcommand\LineBreak{\linebreak[3]}
-\newcommand\PageBreak{\pagebreak[3]}
-\usepackage{ifpdf}
-\ifpdf
- \usepackage{mathptmx,courier}
- \usepackage[scaled=0.90]{helvet}
- \addtolength\marginparwidth{15pt}
- \ifdim\paperheight=297mm % a4paper
- \renewcommand\LineBreak{\\}
- \renewcommand\PageBreak{\clearpage}
- \fi
-\fi
-
-\usepackage[bottom]{footmisc}
-\usepackage{graphicx,longtable,setspace}
-
-\usepackage{hypdoc}
-\ifpdf\usepackage{hypdestopt}\fi
-\hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}}
-\hypersetup{breaklinks=true}
-
-\usepackage[listof=0,hypcap=false]{caption}[2008/04/01]
-
-\DeclareRobustCommand*\eTeX{\texorpdfstring
- {\leavevmode\hbox{$\varepsilon$}-\TeX}%
- {e-TeX}}
-\DeclareRobustCommand*\AmS{\texorpdfstring
- {{\protect\usefont{OMS}{cmsy}{m}{n}A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}%
- {AMS}}
-\DeclareRobustCommand*\KOMAScript{\texorpdfstring
- {\textsf{K\kern.05em O\kern.05em M\kern.05em A\kern.1em-\kern.1em Script}}%
- {KOMA-Script}}
-\DeclareRobustCommand*\NTG{NTG}
-\DeclareRobustCommand*\SmF{SMF}
-
-\usepackage{marvosym}
-\makeatletter
-\newcommand*\INFO{\@ifstar{\@INFO{}}{\@INFO{\vbox to \ht\strutbox}}}
-\newcommand*\@INFO[1]{\MARGINSYM{#1{\LARGE\Info}}}
-\makeatother
-
-\newcommand*\MARGINSYM[1]{\hskip 1sp \marginpar{\raggedleft\textcolor{blue}{{#1}}}}
-\newcommand*\NEW[2]{}%\hskip 1sp \marginpar{\footnotesize\sffamily\raggedleft#1\\#2}}
-
-% \ContinuedFloat
-\DeclareCaptionLabelFormat{continued1}{Continued #1~#2}
-\DeclareCaptionLabelFormat{continued2}{#1~#2\alph{ContinuedFloat}}
-% \DeclareCaptionLabelFormat
-\DeclareCaptionLabelFormat{bf-parens}{(\textbf{#2})}
-% \DeclareCaptionStyle
-\DeclareCaptionStyle{mystyle}[margin=5mm,justification=centering]%
- {font=footnotesize,labelfont=sc,margin={10mm,0mm}}
-% Example 1
-\DeclareCaptionFormat{myformat1}{#1#2\\#3}
-\newlength\myindention
-\DeclareCaptionFormat{myformat2}{#1#2\\\hspace*\myindention#3}
-\DeclareCaptionOption{myindention}{\setlength\myindention{#1}}
-% Example 2
-\DeclareCaptionFormat{reverse}{#3#2#1}
-\DeclareCaptionLabelFormat{fullparens}{(\bothIfFirst{#1}{~}#2)}
-\DeclareCaptionLabelSeparator{fill}{\hfill}
-% Example 3
-\DeclareCaptionFormat{llap}{\llap{#1#2}#3\par}
-\DeclareCaptionFormat{llapx}{\llap{\makebox[5em][l]{#1}}#3\par}
-% Example 4
-\DeclareCaptionLabelFormat{andtable}{#1~#2 \& \tablename~\thetable}
-
-\newcommand*\purerm[1]{{\upshape\mdseries\rmfamily #1}}
-\newcommand*\puresf[1]{{\upshape\mdseries\sffamily #1}}
-\newcommand*\purett[1]{{\upshape\mdseries\ttfamily #1}}
-\let\class\puresf \let\package\puresf
-
-\newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
-\newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
-\newcommand*\version[2][]{v$#2$}
-\newcommand*\x{\discretionary{}{}{}}
-
-\newenvironment{Annotation}%
- {\ifvmode\else\unskip\par\fi\pagebreak[2]%
- \smallskip
- \small(\ignorespaces}{\unskip)\par}
-\newenvironment{Annotation*}%
- {\ifvmode\else\unskip\par\fi\pagebreak[2]%
- \small(\ignorespaces}{\unskip)\par}
-
-\newenvironment{Example}%
- {\ifvmode\else\unskip\par\fi\pagebreak[2]%
- \minipage{\linewidth}\smallskip}%
- {\smallskip\endminipage\par}
-
-\makeatletter
-\newcommand\example{\@ifstar
- {\@example{belowskip=\abovecaptionskip}}%
- {\@example{}}}
-\def\@example#1{%
- \@testopt{\@@example{#1}}{figure}}
-\long\def\@@example#1[#2]#3#4{%
- \begingroup
- \captionsetup{#1,size=small,margin={\leftmargini,10pt},#3}%
- \captionof{#2}[]{#4}%
- \endgroup}
-\makeatother
-
-\newenvironment{Expert}%
- {\ifvmode\else\unskip\par\fi\pagebreak[3]%
- \smallskip
- \footnotesize\ignorespaces}{\par}
-\newenvironment{Expert*}%
- {\ifvmode\else\unskip\par\fi\pagebreak[3]%
- \footnotesize\ignorespaces}{\par}
-
-\newenvironment{Note}[1][\DefaultNoteText]%
- {\ifvmode\else\unskip\par\fi
- \smallskip
- \small\emph{#1:}~\ignorespaces}{\par}
-\newenvironment{Note*}[1][\DefaultNoteText]%
- {\ifvmode\else\unskip\par\fi
- \small\emph{#1:}~\ignorespaces}{\par}
-
-\newenvironment{Options}[1]%
- {\list{}{\renewcommand\makelabel[1]{\texttt{##1}\hfil}%
- \settowidth\labelwidth{\texttt{#1\space}}%
- \setlength\leftmargin{10pt}%
- \addtolength\leftmargin{\labelwidth}%
- \addtolength\leftmargin{\labelsep}}}%
- {\endlist}
-
-\makeatletter
-\def\Ref{\@ifstar{\@Ref\ref}{\@Ref\autoref}}
-\def\@Ref#1#2{#1{#2}: \textit{\nameref{#2}}}
-\newcommand*\SEE[3][]{\nopagebreak{#1(#2 #3)}}
-\newcommand*\SeeUserDefined[1][]{\See{\Ref{declare}#1}}
-\makeatother
-
-\begin{document}
-\let\subsectionautorefname\sectionautorefname
-\let\subsubsectionautorefname\sectionautorefname
-
-\def\thispackage{the \package{caption} package}
-\def\Thispackage{The \package{caption} package}
-
-\newcommand*\DefaultNoteText{Note}
-\newcommand*\NEWfeature{\NEW{New feature}}
-\newcommand*\NEWdescription{\NEW{New description}}
-\makeatletter
-\newcommand*\See{\@ifstar{\SEE{See}}{\SEE[\small]{See}}}
-\newcommand*\see{\@ifstar{\SEE{see}}{\SEE[\small]{see}}}
-\makeatother
-
-% --------------------------------------------------------------------------- %
-
-\GetFileInfo{caption-eng.tex}
-\let\docdate\filedate
-\let\docversion\fileversion
-\GetFileInfo{caption.sty}
-
-\title{Customizing captions of floating environments\texorpdfstring{%
- \thanks{This package has version number \docversion.}}{}}
-\author{Axel Sommerfeldt\\
- \url{https://gitlab.com/axelsommerfeldt/caption}}
-\date{\docdate}
-\maketitle
-
-% --------------------------------------------------------------------------- %
-
-\begin{abstract}
-\Thispackage\ offers customization of captions
-in floating environments such |figure| and |table| and cooperates with
-many other packages.
-\par\smallskip
-\textit{Please note:} Many document classes already have build-in options and
-commands for customizing captions.
-If these possibilities are sufficient for you, there is usually no need for
-you to use the \package{caption} package at all.
-And if you are only interested in using the command \cs{captionof}, loading of
-the very small \package{capt-of} package is usually sufficient.
-\end{abstract}
-
-\newcommand\exampletext{%
- White sand beaches. The pink smoothness of the conch shell. A sea abundant
- with possibilities. Duty-free shops filled with Europe's finest gifts and
- perfumes. Play your favorite game of golf amidst the tropical greens on one
- of the many championship courses.}
-
-% --------------------------------------------------------------------------- %
-
-\section*{State of this document}
-
-This documentation is outdated.
-
-It documents the options and commands available in version \version{3.1} of the
-\package{caption} package, but many things added later on is missing here. Why?
-\begin{itemize}
-\item
- I wasn't happy with the structure of the documentation, so I decided to write a new one.
- So why updating the abandoned documentation?
- (Unfortunately I never found the time to actually write the new one.)
-\item
- Since my spare time was extremly limited since version \version{3.1} I didn't
- wanted to hold improvements and enhancements back for months because of missing
- documentation.
-\item
- Since I used to fix bugs in the most recent development version only,
- I didn't wanted to hold bugfixes back for months because of missing
- documentation of features.
- (But since 2015 bugs will usually get fixed for the latest release version as well,
- and released to CTAN as bug-fixed version afterwards.)
-\end{itemize}
-
-What now?
-\begin{itemize}
-\item
- I will update this documentation in the next weeks, finally bringing it up-to-date.
-\item
- Until the revised documentation is ready the most recent version could be found at
- \url{https://gitlab.com/axelsommerfeldt/caption/-/blob/master/doc/caption-eng.pdf}
- since I will not upload every improvement of the documentation to CTAN immediately.
-\end{itemize}
-
-% --------------------------------------------------------------------------- %
-
-\section*{Introduction}
-
-Within the standard \LaTeX\ document classes captions haven't received the
-attention they deserve. Simply typeset as an ordinary paragraph there is no
-remarkable visual difference from the rest of the text, like here:
-
-\example*{size=normalsize,margin=0pt}{\exampletext}
-
-There should be possibilities to change this; for example, it would be nice
-to make the text of the caption a little bit smaller as the normal
-text, add an extra margin, typeset the caption label with the same font
-family and shape as your headings etc. Just like this one:
-
-\example*{size=small,margin=10pt,labelfont=bf,labelsep=endash}{\exampletext}
-
-You can do this easily with this package as there are many ready-to-use
-caption formatting options, but you are free to define your very own stuff, too.
-
-\bigskip
-
-\INFO\begin{minipage}[t]{\textwidth}
-\small
-Please note that \thispackage\ is only controlling the look \& feel of the
-captions. It does \emph{not} control the placement of the captions.
-(But you could do so by using other packages like the \package{floatrow}
- package\cite{floatrow}.)
-\end{minipage}
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\tableofcontents
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\section{Using this package}
-\label{usage}
-
-\DescribeMacro{\usepackage}
-Insert
-\begin{quote}
- |\usepackage|\oarg{options}|{caption}[|\texttt{\filedate}|]|
-\end{quote}
-into the preamble of your document, i.e.~the part of your document
-between |\document|\-|class| and |\begin{doc|\-|u|\-|ment}|.
-The options control how your captions will look like; e.g.,
-\begin{quote}
- |\usepackage[margin=10pt,font=small,labelfont=bf,|\\
- | labelsep=endash]{caption}|%
- %|[|\texttt{\filedate}|]|
-\end{quote}
-would result in captions looking like the second one in the introduction.
-
-\DescribeMacro{\captionsetup}
-For a later change of options \thispackage\ provides the command
-\begin{quote}
- |\captionsetup|\oarg{float type}\marg{options}\quad.
-\end{quote}
-So
-\begin{quote}
- |\usepackage[margin=10pt,font=small,labelfont=bf]{caption}|
-\end{quote}
-and
-\begin{quote}
- |\usepackage{caption}|\\
- |\captionsetup{margin=10pt,font=small,labelfont=bf}|
-\end{quote}
-are equal in their results.
-
-It's good to know that |\caption|\-|setup| has an effect on the current
-environment only. So if you want to change settings for the
-current |figure| or |table| only, just place the |\caption|\-|setup| command
-inside the |figure| or |table| right before the |\caption| command.
-For example
-\begin{quote}
- |\begin{figure}|\\
- | |\ldots\\
- | \captionsetup{singlelinecheck=off}|\\
- | \caption{|\ldots|}|\\
- |\end{figure}|
-\end{quote}
-switches the single-line-check off, but only for this |figure|,
-so all the other captions remain untouched.
-
-\begin{Annotation}
-For a detailed description of |\caption|\-|setup| see \Ref{captionsetup}.
-\end{Annotation}
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\section{Options}
-\label{options}
-
-\def\OptionLabel{RaggedRight}
-\def\UserDefined{\ldots}
-
-% --------------------------------------------------------------------------- %
-
-\subsection{Formatting}
-\label{formats}
-
-\DescribeMacro{format=}
-A figure or table caption mainly consists of three parts: the caption label,
-which says if this object is a `Figure' or `Table' and what number is
-associated with it, the caption text itself, which is normally a short
-description of contents, and the caption separator which separates the text
-from the label.
-
-The \textit{caption format} determines how this information will be presented;
-it is specified with the option
-\begin{quote}
- |format=|\meta{format name}\quad,
-\end{quote}
-having the name of the caption format as its argument.
-
-There are two standard caption formats:
-%\footnote{You have the option to
-%define your own ones, too. See section \ref{declare}:
-%\textit{``Do it yourself!''} for details.}
-
-\begin{Options}{\OptionLabel}
- \item[plain]%\NEWdescription{v3.0h}
- Typesets the captions as a normal paragraph.
-
- \item[hang]
- Indents the caption text, so it will `hang' under the first line of the text.
-
- \item[\UserDefined]
- Own formats can be defined using |\Declare|\-|Caption|\-|Format|.\LineBreak
- \SeeUserDefined
-\end{Options}
-
-\begin{Example}
- An example: Specifying the option
- \begin{quote}
- |format=hang|
- \end{quote}
- yields captions like this:
- \example{format=hang}{\exampletext}
-\end{Example}
-
-\pagebreak[3]
-\DescribeMacro{indention=}
-For both formats (\texttt{plain} and \texttt{hang}) you can setup an extra
-indention starting at the second line of the caption. You do this with the
-option
-\begin{quote}
- |indention=|\meta{amount}\quad.
-\end{quote}
-
-Two examples:
-
-\begin{Example}
- \begin{quote}
- |format=plain,indention=.5cm|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=plain,indention=.5cm}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |format=hang,indention=-0.5cm|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=hang,indention=-0.5cm}{\exampletext}
-\end{Example}
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{labelformat=}
-With the option
-\nopagebreak[3]
-\begin{quote}
- |labelformat=|\meta{label format name}
-\end{quote}
-\nopagebreak[3]
-%\NEWdescription{v3.0e}
-you specify how the caption label will be typeset.
-There are five standard caption label formats:
-
-\begin{Options}{\OptionLabel}
- \item[original]
- The caption label will be typeset as specified by the document class,
- usually this means the name and the number (like \texttt{simple}).
-
- Until \version{3.4} of \thispackage\ this label format was called `default'.
- Since \version{3.5} it is called `original' and usually is the default label
- format, so |label|\-|format=|\-|default| will still select this label format,
- unless the default was changed by either a document class or babel language package.
-
- \item[empty]
- The caption label will be empty.
-\iffalse
- (This option makes sense when used together with other options like
- \texttt{labelsep=none}.)
-\fi
-
- \item[simple]
- The caption label will be typeset as a name and a number.
-
- \item[brace]\NEWfeature{v3.1f}
- The caption label will be closed with a single (right) brace.
-
- \item[parens]
- The number of the caption label will be typeset in parentheses.
-
- \item[\UserDefined]
- Own label formats can be defined using |\Declare|\-|Caption|\-|Label|\-|Format|.
- \SeeUserDefined
-\end{Options}
-
-\begin{Example}
- An example: Using the options
- \begin{quote}
- |format=plain,labelformat=parens,labelsep=quad|
- \end{quote}
- gives captions like this one:
- \example{format=plain,labelformat=parens,labelsep=quad}{\exampletext}
-\end{Example}
-
-\medskip
-
-\begin{Note*}
-Some environments, e.g.~the |algorithm| environment offered by the
-\package{algorithm2e} package, might react allergic to a change of the
-caption label format.
-\end{Note*}
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{labelsep=}
-With the option
-\begin{quote}
- |labelsep=|\meta{label separator name}
-\end{quote}
-you specify what caption separator will be used.\footnote{%
- If the caption label or the caption text is empty,
- no separator will be used.}
-You can choose one of the following:
-
-\begin{Options}{\OptionLabel}
- \item[none]
- There is no caption separator.
-\iffalse
- (This option makes sense when used together with other options like
- \texttt{labelformat=empty}.)
-\fi
-
- \item[colon]
- The caption label and text will be separated by a colon and a space.
-
- \item[period]
- The caption label and text will be separated by a period and a space.
-
- \item[space]
- The caption label and text will be separated by a single space.
-
- \item[quad]
- The caption label and text will be separated by a |\quad|.
-
- \item[newline]
- The caption label and text will be separated by a line break (|\\|).
- Please note that this separator does not work with all caption
- formats (e.g.~|format=|\x|hang|), and you'll get an error message
- trying such combination of options.
-
- \item[endash]\NEWfeature{v3.0h}
- The caption label and text will be separated by an en-dash,
- surrounded by spaces (\verb*| -- |).
-
-%\showhyphens{separator}
- \item[\UserDefined]
- Own separators can be defined using |\Declare|\-|Caption|\-|Label|\-|Sep|\-|a|\-|ra|\-|tor|.
- \SeeUserDefined
-\end{Options}
-
-Three examples:
-\begin{Example}
- \begin{quote}
- |format=plain,labelsep=period|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=plain,labelsep=period}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |format=plain,labelsep=newline,singlelinecheck=false|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=plain,labelsep=newline,singlelinecheck=false}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |format=plain,labelsep=endash|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=plain,labelsep=endash}{\exampletext}
-\end{Example}
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{textformat=}\NEWfeature{v3.0l}
-With the option
-\nopagebreak[3]
-\begin{quote}
- |textformat=|\meta{text format name}
-\end{quote}
-\nopagebreak[3]
-you specify how the caption text will be typeset.
-There are two standard caption text formats:
-
-\begin{Options}{\OptionLabel}
- \item[empty]
- The caption text will be suppressed.
-
- \item[simple]
- The caption text will be typeset as it is.
-
- \item[period]
- The caption text will be followed by a period.
-
- \item[\UserDefined]
- Own text formats can be defined using |\Declare|\-|Caption|\-|Text|\-|Format|.
- \SeeUserDefined
-\end{Options}
-
-% --------------------------------------------------------------------------- %
-
-\PageBreak
-\subsection{Justification}
-\label{justification}
-
-\DescribeMacro{justification=}
-As addition to the caption format you could also specify a
-\emph{caption justification}; it is specified with the option
-\begin{quote}
- |justification=|\meta{justification name}\quad.
-\end{quote}
-
-You can choose one of the following:
-
-\begin{Options}{\OptionLabel}
- \item[justified]
- Typesets the caption as a normal paragraph.
-
- \item[centering]
- Each line of the caption will be centered.
-
-% \item[Centering]
-
- \item[centerlast]
- The last line of each paragraph of the caption text will be centered.
-
- \item[centerfirst]
- Only the first line of the caption will be centered.
-
- \item[raggedright]
- Each line of the caption will be moved to the left margin.
-
-\iffalse
- \item[RaggedRight]
- Each line of the caption will be moved to the left margin using
- the command |\RaggedRight| from the \package{ragged2e} package.
-\else
- \item[RaggedRight]
- Each line of the caption will be moved to the left margin, too.
- But this time the command |\RaggedRight| of the \package{ragged2e}
- package will be used to achieve this.
- The main difference to |raggedright| is that the word breaking
- algorithm of \TeX\ will work inside captions.\footnote{%
- The need for the \package{ragged2e} package will be detected at
- run-time, therefore you maybe need a second \LaTeX\ run if this
- option is used for the first time.}
-\fi
-
- \item[raggedleft]
- Each line of the caption will be moved to the right margin.
-
-% \item[RaggedLeft]
-% Each line of the caption will be moved to the right margin using
-% the command |\RaggedLeft| from the \package{ragged2e} package.
-
-%\showhyphens{justification}
- \item[\UserDefined]
- Own justifications can be defined using |\Declare|\-|Caption|\-|Jus|\-|ti|\-|fi|\-|ca|\-|tion|.
- \SeeUserDefined
-\end{Options}
-
-Three examples:
-\begin{Example}
- \begin{quote}
- |format=hang,justification=raggedright|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=hang,justification=raggedright}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |format=hang,justification=centerlast|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=hang,justification=centerlast}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |format=plain,labelsep=newline,justification=centering|
- \end{quote}
- \captionsetup{skip=0pt}
- \example*{format=plain,labelsep=newline,justification=centering}{\exampletext}
-\end{Example}
-
-\smallskip
-
-\PageBreak
-\DescribeMacro{singlelinecheck=}
-The standard \LaTeX\ document classes (\class{article}, \class{report}, and
-\class{book}) automatically center a caption if it fits in one single line:
-
-\example*{}{A short caption.}
-
-\INFO
-\Thispackage\ adapts this behavior and therefore usually ignores the
-justification \& indention you have set with |justification=| \&
-|indention=| in such case.
-But you can switch this special treatment of such short captions off
-with the option
-\begin{quote}
- |singlelinecheck=|\meta{bool}\quad.
-\end{quote}
-Using |false|, |no|, |off| or |0| for \meta{bool} switches the
-extra centering off:
-\begin{quote}
- |singlelinecheck=false|
-\end{quote}
-Doing so the above short caption would look like
-
-\begingroup
- \captionsetup{type=figure}
- \ContinuedFloat
- \example*{singlelinecheck=false}{A short caption.}
-\endgroup
-
-You switch the extra centering on again by using |true|, |yes|, |on| or |1|
-for \meta{bool}. (The default is on.)
-
-% --------------------------------------------------------------------------- %
-
-\subsection{Fonts}
-\label{fonts}
-
-\DescribeMacro{font=}
-\DescribeMacro{labelfont=}
-\DescribeMacro{textfont=}
-There are three font options which affects different parts of the caption:
-One affecting the whole caption (|font|), one which only affects the caption
-label and separator (|label|\-|font|) and at least one which only affects the
-caption text (|text|\-|font|).
-You set them up using the options
-\begin{quote}\begin{tabular}{@{}r@{}ll}
- |font=| & \marg{font options} & ,\\
- |labelfont=| & \marg{font options} & , and\\
- |textfont=| & \marg{font options} & ,\\
-\end{tabular}\end{quote}
-where \meta{font options} is a list of comma separated font options.
-
-And these are the available font options:
-
-\begin{Options}{stretch=\meta{amount}}
- \item[scriptsize] {\scriptsize Very small size}
- \item[footnotesize] {\footnotesize The size usually used for footnotes}
- \item[small] {\small Small size}
- \item[normalsize] {\normalsize Normal size}
- \item[large] {\large Large size}
- \item[Large] {\Large Even larger size}
-\end{Options}
-\vspace{0pt}\pagebreak[3]
-\begin{Options}{stretch=\meta{amount}}
- \item[normalfont] {\normalfont Normal shape \& series \& family}
-
- \item[up] {\upshape Upright shape}
- \item[it] {\itshape Italic shape}
- \item[sl] {\slshape Slanted shape}
- \item[sc] {\scshape Small Caps shape}
-
- \item[md] {\mdseries Medium series}
- \item[bf] {\bfseries Bold series}
-
- \item[rm] {\rmfamily Roman family}
- \item[sf] {\sffamily Sans Serif family}
- \item[tt] {\ttfamily Typewriter family}
-\end{Options}
-\vspace{0pt}\pagebreak[3]
-\begin{Options}{stretch=\meta{amount}}
- \item[singlespacing] Single spacing \See{\Ref{setspace}}
- \item[onehalfspacing] One-and-a-half spacing \See{\Ref{setspace}}
- \item[doublespacing] Double spacing \See{\Ref{setspace}}
- \item[stretch=\meta{amount}] |\setstretch|\marg{amount} \See{\Ref{setspace}}
-\end{Options}
-\vspace{0pt}\pagebreak[3]
-\begin{Options}{stretch=\meta{amount}}
- \item[normalcolor] |\normalcolor|
- \item[color=\meta{colour}] |\color|\marg{colour}
- {\small(If the \package{color} or \package{xcolor} package is loaded,
- see \Ref{declare} for an example)}
-\end{Options}
-\vspace{0pt}\pagebreak[3]
-\begin{Options}{stretch=\meta{amount}}
- \item[normal] The combination of the options |normal|\-|color|,
- |normal|\-|font|, |normal|\-|size|, and |single|\-|spacing|
-
- \item[\UserDefined]
- Own font options can be defined using |\Declare|\-|Caption|\-|Font|.
- \SeeUserDefined
-\end{Options}
-
-If you use only one of these options you can omit the braces;
-e.g., the options
-%\begin{quote}
- |font={small}|
-%\end{quote}
-and
-%\begin{quote}
- |font=small|
-%\end{quote}
-will give the same result.
-
-Three examples:
-\begin{Example}
- \begin{quote}
- |font=it,labelfont=bf|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{font=it,labelfont=bf}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |labelfont=sc,textfont=it|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{labelfont=sc,textfont=it}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |font={small,stretch=0.80}|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{font={small,stretch=0.80}}{\exampletext}
-\end{Example}
-
-\medskip
-
-\pagebreak[3]
-\DescribeMacro{font+=}
-\DescribeMacro{labelfont+=}
-\DescribeMacro{textfont+=}
-\NEWfeature{v3.1f}
-You can also add font options to the current ones, so for example
-\begin{quote}
- |\captionsetup{font=small}|\\
- |\captionsetup{font+=it}|
-\end{quote}
-is identical to
-\begin{quote}
- |\captionsetup{font={small,it}}|
-\end{quote}
-
-% --------------------------------------------------------------------------- %
-
-\subsection{Margins and further paragraph options}
-\label{margins}
-
-\DescribeMacro{margin=}
-\DescribeMacro{width=}
-For all captions you can specify \emph{either} an extra margin \emph{or}
-a fixed width:~\footnote{Only fixed widths are supported here; if you are
-looking for a way to limit the width of the caption to the width of the
-figure or table, please take a look at the \package{floatrow}\cite{floatrow}
-or \package{threeparttable}\cite{threeparttable} package.}
-\begin{quote}\begin{tabular}{@{}r@{}ll}
- |margin=| & \meta{amount} & \emph{--or--}\\
- |margin=| & |{|\meta{left amount}|,|\meta{right amount}|}| & \emph{--or--}\\
- |width=| & \meta{amount} & \\
-\end{tabular}\end{quote}
-\NEWfeature{v3.1}
-If you specify just one \meta{amount} for the margin, it will be used for
-both, the left and right margin, e.g.~|margin=|\x|10pt| is equivalent to
-|margin=|\x|{10pt,10pt}|.
-In two-side documents the left and right margin will be swapped on even pages.
-\DescribeMacro{oneside}
-\DescribeMacro{twoside}
-To prevent this you can specify the option |oneside| additionally,
-e.g.~|\caption|\-|setup{margin=|\x|{0pt,10pt},|\x|oneside}|.\par
-But if you are specifying a width, then both, the left and the right margin,
-will have the same amount.
-
-Three examples will illustrating this:
-\begin{Example}
- \begin{quote}
- |margin=10pt|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{margin=10pt}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |margin={1cm,0cm}|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{margin={1cm,0cm}}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |width=.75\textwidth|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{width=.75\textwidth}{\exampletext}
-\end{Example}
-
-\begin{Note}
-When the caption is placed beside the contents (for example in a |SC|\-|figure|
-environment offered by the \package{sidecap} package\cite{sidecap}) or the
-figure is an in-text figure (for example in a |wrap|\-|figure| environment
-offered by the \package{wrapfig} package\cite{wrapfig}), the margin setting
-will be automatically reset to |0pt| at the very beginning of the environment.
-But if you really want to setup an extra margin for these environments, you can
-do so by setting this margin either inside the environment itself, of by
-specifying a margin for this particular environment,
-e.g.~|\caption|\-|setup[SC|\-|figure]{margin=|\x|10pt}|.
-\end{Note}
-
-\begin{Expert}
-\DescribeMacro{margin*=}\NEWfeature{v3.1}
-There is also a starred variant of the |margin=| option, |margin*=|, which only
-changes the margin if no width was set.
-\end{Expert}
-
-\begin{Expert}
-\DescribeMacro{minmargin=}
-\DescribeMacro{maxmargin=}\NEWfeature{v3.1}
-You can also set a minimum or maximum margin amount. This can be useful for
-limiting the margin amount in smaller environments, e.g.~|minipage|s.
-For example the \SmF\ document classes limit the margin amount to
-|maxmargin=|\x|0.1\linewidth|. (See \Ref{SMF})
-\end{Expert}
-
-\medskip
-
-\pagebreak[3]
-\DescribeMacro{parskip=}
-This option is useful for captions containing more than one paragraph.
-It specifies the extra vertical space inserted between them:
-\begin{quote}
- |parskip=|\meta{amount}
-\end{quote}
-One example:
-\begin{Example}
- \begin{quote}
- |margin=10pt,parskip=5pt|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{margin=10pt,parskip=5pt}{%
- First paragraph of the caption. This one contains some test, just to
- show how these options affect the layout of the caption.\par
- Second paragraph of the caption. This one contains some text, too, to
- show how these options affect the layout of the caption.}
-\end{Example}
-
-\pagebreak[3]
-\DescribeMacro{hangindent=}
-The option
-\begin{quote}
- |hangindent=|\meta{amount}
-\end{quote}
-is for setting up a hanging indention starting from the second line of each
-paragraph. If the caption contains just a single paragraph, using this option
-leads to the same result as the option |indention=|\meta{amount} you already
-know about.
-But if the caption contains multiple paragraphs you will notice the difference:
-
-\begin{Example}
- \begin{quote}
- |format=hang,indention=-.5cm|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=hang,indention=-.5cm}{%
- First paragraph of the caption. This one contains some test, just to
- show how these options affect the layout of the caption.\par
- Second paragraph of the caption. This one contains some text, too, to
- show how these options affect the layout of the caption.}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |format=hang,hangindent=-.5cm|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=hang,hangindent=-.5cm}{%
- First paragraph of the caption. This one contains some test, just to
- show how these options affect the layout of the caption.\par
- Second paragraph of the caption. This one contains some text, too, to
- show how these options affect the layout of the caption.}
-\end{Example}
-
-\begin{Note}
-If your caption contains more than one paragraph, you have
-to specify an alternative caption for the list-of-figures using the
-optional argument of |\caption| or |\caption|\-|of|, otherwise you will
-get an error message.
-\end{Note}
-
-% --------------------------------------------------------------------------- %
-
-\PageBreak
-\subsection{Styles}
-\label{style}
-
-\DescribeMacro{style=}
-A suitable combination of caption options is called \emph{caption style}.
-You can compare them more or less to page styles which you set up with
-|\page|\-|style|;
-the caption style provides all settings for a whole caption layout.
-
-You switch to an already defined caption style with the option
-\begin{quote}
- |style=|\meta{style name}\quad.
-\end{quote}
-\Thispackage\ pre-defines two styles: |base| and |default|.
-
-\NEWfeature{v3.1}
-The |base| style puts all options you already know about to values reflecting
-the look of the captions when using one of the base \LaTeX\ document classes
-\class{article}, \class{report}, and \class{book}.
-This means that specifying the option
-\begin{quote}
- |style=base|
-\end{quote}
-has the same effect as specifying all these options:
-\begin{quote}
- |format=plain,labelformat=default,labelsep=colon,|\\
- |justification=justified,font={},labelfont={},|\\
- |textfont={},margin=0pt,indention=0pt|\\
- |parindent=0pt,hangindent=0pt,singlelinecheck=true|
-\end{quote}
-\begin{Annotation*}
-But |justification=centering,indention=0pt| will be set if
-the caption fits into a single line.
-\end{Annotation*}
-
-In contrast the |default| style follows the default values, reflecting
-the look of the captions given by the document class you actually use.
-This style is selected by default and represents these options:
-\begin{quote}
- |format=default,labelformat=default,labelsep=default,|\\
- |justification=default,font=default,labelfont=default,|\\
- |textfont=default,margin=0pt,indention=0pt|\\
- |parindent=0pt,hangindent=0pt,singlelinecheck=true|
-\end{quote}
-\begin{Annotation*}
-But again |justification=centering,indention=0pt| will be set if
-the caption fits into a single line.
-\end{Annotation*}
-
-So if you use one of the base \LaTeX\ document classes \class{article},
-\class{report}, or \class{book}, both caption styles, |base| and |default|,
-point to (nearly) the same settings.
-
-\begin{Note}
-Own caption styles can be defined using |\Declare|\-|Caption|\-|Style|.\LineBreak
-\SeeUserDefined
-\end{Note}
-
-% --------------------------------------------------------------------------- %
-
-\subsection{Skips}
-\label{skips}
-
-\DescribeMacro{skip=}\NEWfeature{v3.0d}
-The vertical space between the caption and the figure or table contents is
-controlled by the option
-\begin{quote}
- |skip=|\meta{amount}\quad.
-\end{quote}
-The standard \LaTeX\ document classes \class{article}, \class{report} and
-\class{book} preset it to |skip=|\x|10pt|, but other document classes may
-use a different amount.
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{position=}
-The |\caption| command offered by \LaTeX{} has a design flaw:
-The command does not know if it stands on the beginning of the figure or
-table, or at the end. Therefore it does not know where to put the space
-separating the caption from the content of the figure or table.
-While the standard implementation always puts the space above the caption
-in floating environments (and inconsistently below the caption in
-|long|\-|table|s), the implementation offered by this package is more
-flexible:
-By giving the option
-\begin{quote}
- |position=top|\quad or\quad |position=above|
-\end{quote}
-it's assumed that the caption is standing at the \emph{top} of the
-environment and therefore the space setup with |skip=|\x\meta{amount}
-is placed below the caption.
-(Please note that |position=|\x|top| does \emph{NOT} mean that the
-caption is actually placed at the top of the figure or table.
-Instead the caption is usually placed where you place the |\caption|
-command.)
-But with
-\begin{quote}
- |position=bottom|\quad or\quad |position=below|
-\end{quote}
-it's assumed that the caption is standing at the \emph{bottom} of the
-environment and therefore the space is placed above the caption.
-And finally with
-\begin{quote}
- |position=auto|\quad {\small(which is the default setting)}
-\end{quote}
-\thispackage\ tries its best to determine the actual position of
-the caption on its own. Please note that while this is successfully in
-most cases, it could give wrong results under rare circumstances.
-
-\medskip
-
-\pagebreak[3]
-\DescribeMacro{figureposition=}%\NEWfeature{v3.0a}
-\DescribeMacro{tableposition=}%\NEWfeature{v3.0a}
-The |position| option is especially useful when used together with the
-optional argument of the |\caption|\-|setup| command.
-\See{also \Ref{captionsetup}}\par
-For example
-\begin{quote}
- |\captionsetup[table]{position=above}|
-\end{quote}
-causes all captions within tables to be treated as captions \emph{above}
-the table (regarding spacing around it).
-Because this is a very common setting, \thispackage\ offers
-the abbreviating options |figure|\-|position=|\x\meta{pos} and
-|table|\-|position=|\x\meta{pos}, e.g.
-\begin{quote}
- |\usepackage[|\ldots|,tableposition=top]{caption}|
-\end{quote}
-is equivalent to
-\begin{quote}
- |\usepackage[|\ldots|]{caption}|\\
- |\captionsetup[table]{position=top}|
-\end{quote}
-
-\medskip
-
-\INFO
-Please note that the options |skip=|, |position=|, |figure|\-|position=|,
-and |table|\-|position=| do not always have an effect.
-Since it's a matter of the document class to supply the environments
-|figure| and |table|, it could use its very own spacing, and could
-decide for itself if the caption will be typeset as ``top'' or ``bottom''
-caption.
-For example the \KOMAScript\ document classes support the |skip=|
-setting, but will always typeset |figure| captions as ``bottom'' captions,
-and |table| captions are dependent on the global option
-|table|\-|captions|\-|above| resp.\ |table|\-|captions|\-|below|.
-\See{\Ref{KOMA}}
-
-Furthermore some packages control the behavior of the spacing above and
-below the caption for themself, e.g.~the \package{float}, the
-\package{floatrow}, and the \package{supertabular} package.
-
-\bigskip
-
-\begin{Expert*}
-Internally the skip between caption and contents is represented by
-|\above|\-|caption|\-|skip| (which is always set above the caption in
-\LaTeX{}s implementation).
-But there is a second value |\below|\-|caption|\-|skip| (usually set to
-|0pt| by default) which is set below the caption in \LaTeX{}s implementation,
-but on the other side than |\above|\-|caption|\-|skip| by this package.
-So technically speaking, this package swaps the meaning of these two skips
-when |position=|\x|top| is set.
-Please note that there are several packages around which do the same trick
-(like the \package{ftcap}, the \package{nonfloat}, and the \package{topcap}
-package), so the usage of the \package{caption} option |position=| is not
-supported if one of these packages will be used, too.
-\end{Expert*}
-
-% --------------------------------------------------------------------------- %
-
-\subsection{Lists}
-\label{lists}
-
-\DescribeMacro{list=}\NEWfeature{v3.1}
-The |\caption| command usually places an entry in the List of Figures
-resp.~List of Tables. You can either suppress that individually by giving an
-empty optional argument to |\caption| {\small(see \Ref{caption})}, or
-programmatically by saying
-\begin{quote}
- |list=no|\quad(or any other boolean value instead of |no|)\quad.~\footnote{%
- Please note that the \package{subfig} package\cite{subfig} is not supporting
- this option, it uses the counters \texttt{lofdepth} \& \texttt{lotdepth} for
- this purpose instead.}
-\end{quote}
-
-\pagebreak[3]
-\DescribeMacro{listformat=}\NEWfeature{v3.1}
-With the option
-\nopagebreak[3]
-\begin{quote}
- |listformat=|\meta{list format name}
-\end{quote}
-\nopagebreak[3]
-you can specify how the |figure| or |table| number will be typeset within
-the List of Figures resp.~List of Tables.
-There are five standard caption list formats:
-
-\begin{Options}{\OptionLabel}
- \item[empty]
- No number will be typeset.
-
- \item[simple]
- The number will be typeset with label prefix.
-
- \item[parens]
- The number will be typeset in parentheses, with label prefix.
-
- \item[subsimple]
- Same as |simple|, but without label prefix. (default)
-
- \item[subparens]
- Same as |parens|, but without label prefix.
-
- \item[\UserDefined]
- Own list formats can be defined using |\Declare|\-|Caption|\-|List|\-|Format|.
- \SeeUserDefined
-\end{Options}
-
-The prefix ($=$|\p@figure| resp.~|\p@table|), which runs ahead of the
-number ($=$|\the|\-|figure| resp.~|\the|\-|table|) in lists (e.g.~List of
-Figure/Table) and references, is usually empty,
-so the list formats |simple| and |subsimple| gives equal results;
-same with |parens| and |subparens|.
-But this can be different for sub-figures or sub-tables listed in the List of
-Figures resp.~List of Tables, or when the label prefix is redefined for a
-different purpose.\footnote{%
- Sub-figures and sub-tables can be typeset using the \package{subcaption}
- or \package{subfig} package.}
-
-% --------------------------------------------------------------------------- %
-
-\subsection{Names}
-\label{names}
-
-\DescribeMacro{name=}\NEWfeature{v3.1f}
-The option
-\begin{quote}
- |name=|\meta{name}
-\end{quote}
-changes the name of the \emph{current} environment.
-This could be useful in conjunction with the optional argument of
-|\caption|\-|setup|, e.g.
-\begin{quote}
- |\captionsetup[wrapfigure]{name=Fig.}|
-\end{quote}
-changes the name to ``Fig.'' for all |wrap|\-|figure|s (while all the other
-figure captions will still have ``Figure'' as name).
-
-% --------------------------------------------------------------------------- %
-
-\subsection{Types}
-\label{types}
-
-\DescribeMacro{type=}\NEWfeature{v3.0d}
-The |\caption| command can typeset captions for different types,
-e.g.~|figure| and |table|. If you try to use the |\caption| command outside
-these environments you will get an error message, because it does not know what
-kind of caption do you want to have here. But in such situations you can set
-the caption type manually with
-\begin{quote}
- |type=|\meta{float type}
-\end{quote}
-prior to the usage of the |\caption| command (and other commands like
-|\Continued|\-|Float|, or |\sub|\-|caption|\-|box| offered by the
-\package{subcaption} package, or |\sub|\-|float| offered by the
-\package{subfig} package\cite{subfig}),
-for example within an non-floating environment like |minipage|:
-\begin{quote}
- |\noindent\begin{minipage}{\textwidth}|\\
- | \captionsetup{type=figure}|\\
- | \subfloat{|\ldots|}|\\
- | |\ldots\\
- | \caption{|\ldots|}|\\
- |\end{minipage}|
-\end{quote}
-
-\begin{Expert}
-There is also a starred variant of this option, |type*=|\meta{float type},
-which behaves different than |type=|\meta{float type} if the
-\package{hyperref} package\cite{hyperref} is loaded: While |type=| sets an
-hyperlink anchor (if |hypcap=|\x|true| is set), |type*=| does not.
-(See also \Ref{hyperref}\,)
-\end{Expert}
-\begin{Expert}
-\emph{\DefaultNoteText:} Please don't re-define the internal macro |\@captype|
-for yourself, like suggested by some documentations, always use
-|\caption|\-|setup{type=|\x\ldots|}| instead.
-\end{Expert}
-
-\medskip
-
-Own float types can be defined with
- |\Declare|\-|Floating|\-|Environment| offered by the \package{newfloat} package,
- |\new|\-|float| offered by the \package{float} package\cite{float}, or
- |\Declare|\-|New|\-|Float|\-|Type| offered by the \package{floatrow} package\cite{float}.
-
-\medskip
-
-\INFO % \NEWdescription{v3.1}
-Please note that you should use the option |type=| only
-\emph{inside} boxes or environments (like |\par|\-|box| or |mini|\-|page|),
-at best one where no page break could happen between contents and caption.
-Furthermore some visual side-effects (e.g.~mixed-up figure and table settings
-regarding captions) could occur without using a box or environment,
-therefore a warning message will be issued if you try to do so.\footnote{%
-You only get this warning message if you use \eTeX\ as underlying \TeX\ engine.}
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\section{Commands}
-
-\subsection{Typesetting captions}
-\label{caption}
-\label{captionlistentry}
-
-\DescribeMacro{\caption}
-The command
-\begin{quote}
- |\caption|\oarg{list entry}\marg{heading}
-\end{quote}
-typesets the caption inside a floating environment like |figure| or |table|.
-Well, you already know this, but \thispackage\ offers an extension:
-If you leave the argument \meta{list entry} empty, no entry in the list of
-figures or tables will be made. For example:
-\begin{quote}
- |\caption[]{A figure without list entry.}|
-\end{quote}
-
-\begin{Expert}
-Please remember that the \meta{heading} is a so-called \emph{moving} argument,
-if no \meta{list entry} has been given. But if a \meta{list entry} is given,
-this argument is moving instead.
-``\emph{Moving} argument'' means that the argument will be written to the
-list-of file, make it appearing in the ``List of Figures'' resp.
-``List of Tables'', too.
-\emph{Moving} arguments are not allowed to contain \emph{fragile} commands,
-everything must be \emph{robust}, otherwise the argument could get
-\emph{broken}, resulting in strange errors at the next \LaTeX\ run.
-Some \emph{fragile} commands could be \emph{protected} by a leading |\protect|,
-own definitions could get defined with |\Declare|\-|Robust|\-|Command| instead of
-|\new|\-|command| to make them \emph{robust}.
-
-An example: |\caption{${}^{137}_{\phantom{1}55}$Cs}| will cause errors since
-|\phantom| is \emph{fragile}.
-So we have either have to use the optional argument \meta{list entry}
-(e.g.~|\caption[${}^|\x|{137}_|\x|{55}$|\x|Cs]|\x|{${}^|\x|{137}_|\x|{\phantom{1}55}$|\x|Cs}|)
-or add |\protect| to prevent the |\phantom| command from getting \emph{broken}:
-|\caption{${}^|\x|{137}_|\x|{|\textcolor{blue}{\cs{protect}}|\phantom{1}55}$|\x|Cs}|.
-
-But sometimes even this is not sufficient. The reason behind is the so-called
-single-line-check: It puts the \meta{heading} into a horizontal box to determine
-the width of the caption, and this could cause error messages, too.
-An example:
-|\caption{A| |scheme.| |\[V_{C}| |\sim| |\left| |\{| |\begin{array}{cc}|
-|E_{g}| |&| |\textrm{p-n}| |\\| |e\phi_{B}| |&| |\textrm{M-S}| |\end{array}|
-|\right.| |\]}|.
-Using |\caption[A| |scheme]{|\ldots|}| is not sufficient here, it's still
-leading to errors. (``\texttt{Missing \$ inserted.}'')
-So we have to put a |\caption|\-|setup{single|\-|line|\-|check=|\x|off}|
-just in front of the |\caption| command additionally.
-
-For more information about \emph{moving} arguments and \emph{fragile} \&
-\emph{robust} commands, take a closer look at your \LaTeX\ manual or visit
-\url{http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/teTeX/latex/latex2e-html/fragile.html}.
-\end{Expert}
-
-\medskip
-
-\pagebreak[3]
-\DescribeMacro{\caption*}
-The \package{longtable} package defines the command |\caption*| which
-typesets the caption without label and without entry in the list of tables.
-An example:
-\begin{quote}
- |\begin{longtable}{|\ldots|}|\\
- | \caption*{A table}\\|\\
- | |\ldots\\
- |\end{longtable}|
-\end{quote}
-looks like
-\DeleteShortVerb{\|}
-\vskip\intextsep
-\begin{minipage}{\linewidth}
- \captionsetup{type=table,position=t}
- \caption*{A table}
- \centering
- \begin{tabular}{r|rr}
- & x & y \\\hline
- a & 1 & 2 \\
- b & 3 & 4 \\
- \end{tabular}
-\end{minipage}
-\vskip\intextsep
-\MakeShortVerb{\|}
-\Thispackage\ offers this feature, too, so you can use this command now within
-every floating environment like |figure| or |table|, like:
-\begin{quote}
- |\begin{table}|\\
- | \caption*{A table}|\\
-% | \begin{tabular}{|\ldots|}|\\
-% | |\ldots\\
-% | \end{tabular}|\\
- | |\ldots\\
- |\end{table}|
-\end{quote}
-
-\pagebreak[3]
-\DescribeMacro{\captionof}
-\DescribeMacro{\captionof*}
-Sometimes you want to typeset a caption \emph{outside} a floating environment,
-putting a figure within a non-floating |mini|\-|page| for instance.
-For this purpose \thispackage\ offers the command
-\begin{quote}
- |\captionof|\marg{float type}\oarg{list entry}\marg{heading}\quad.
-\end{quote}
-Note that the first argument, the \meta{float type}, is mandatory here, because
-the |\captionof| command needs to know which name to put into the caption label
-(e.g. ``Figure'' or ``Table'') and in which list to put the contents entry.
-An example:
-\begin{quote}
-% |\captionof{figure}{A figure}|\\
- |\captionof{table}{A table}|
-\end{quote}
-typesets captions like this:
-\begin{Example}
-% \begingroup
-% \captionof{figure}{A figure}
-% \endgroup
- \captionsetup{position=top}
-% \begingroup
- \captionof{table}{A table}
-% \endgroup
-\end{Example}
-
-The star variant |\caption|\-|of*| has the same behavior as the |\caption*|
-command:
-It typesets the caption without label and without entry to the list of figures
-or tables.
-
-\INFO % \NEWdescription{v3.1}
-Since |\caption|\-|of| uses the option |type| internally, the same
-restrictions as for the |type| option apply here, so you should use both
-|\caption|\-|of| and |\caption|\-|of*| only \emph{inside} boxes or
-environments, too.
-\See{\Ref{types}}
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{\captionlistentry}\NEWfeature{v3.1}
-Under certain circumstances it could be useful to make a list-of-figure
-(or table) entry on its own.
-This could be achieved with
-\begin{quote}
- |\captionlistentry|\oarg{float type}\marg{list entry}\quad.
-\end{quote}
-
-One example: It's quite easy to have a |long|\-|table| with captions above the
-contents and a single list entry which points to the first page of the table:
-\begin{quote}
- |\begin{longtable}{|\ldots|}|\\
- | \caption{|\ldots|}\\|\\
- |\endfirsthead|\\
- | \caption[]{|\ldots|}\\|\\
- |\endhead|\\
- | |\ldots
-\end{quote}
-But since the \package{longtable} package does not offer an
-|\end|\-|first|\-|foot| command, you cannot easily have captions \emph{below}
-the table contents and a single list entry which points to the first page of
-the table.
-Here is were the |\caption|\-|list|\-|entry| command could be used:
-\begin{quote}
- |\begin{longtable}{|\ldots|}|\\
- | \caption[]{|\ldots|}\\|\\
- |\endfoot|\\
- | \captionlistentry{|\ldots|}|\\
- | |\ldots
-\end{quote}
-
-\begin{Annotation*}
-Another example can be found in \Ref{examples}.
-\end{Annotation*}
-
-\begin{Expert}
-There is also a starred variant, |\caption|\-|list|\-|entry*|, which does not
-increment the \meta{float type} counter.
-(Note that inside |long|\-|table| environments |\caption|\-|list|\-|entry|
-never increments the |table| counter. See also \Ref{longtable}.)
-\end{Expert}
-
-\begin{Expert}
-Please note that \meta{list entry} is a \emph{moving} argument, so everything
-it contains must be \emph{robust}. (See also explanation of |\caption|)
-\end{Expert}
-
-\subsection{Setting options}
-\label{captionsetup}
-
-\DescribeMacro{\captionsetup}
-We already know the |\caption|\-|setup| command (see \Ref{usage}),
-but this time we get enlighten about its optional argument
-\meta{float type}.
-
-Remember, the syntax of this command is
-\begin{quote}
- |\captionsetup|\oarg{float type}\marg{options}\quad.
-\end{quote}
-If a \meta{float type} gets specified, all the \meta{options} don't
-change anything at this time. Instead they only get marked for a later use,
-when a caption inside of a floating environment of the particular type
-\meta{float type} gets typeset.
-For example
-\begin{quote}
- |\captionsetup[figure]|\marg{options}
-\end{quote}
-forces captions within a |figure| environment to use the given \meta{options}.
-
-Here comes an example to illustrate this:
-\begin{quote}
- |\captionsetup{font=small}|\\
- |\captionsetup[figure]{labelfont=bf,textfont=it}|
-\end{quote}
-gives captions like this:
-\begin{Example}
- \captionsetup{font=small}
- \captionsetup[figure]{labelfont=bf,textfont=it}
- \begingroup
- \captionof{figure}{A figure}
- \endgroup
- \captionsetup{position=top}
- \begingroup
- \captionof{table}{A table}
- \endgroup
-\end{Example}
-As you see the command |\caption|\-|setup[figure]{|\ldots|}| only changes
-the look of the |figure| caption labels, not touching the other ones.
-
-As \meta{float type} you can usually give one of these two only:
-|figure| or |table|.
-But as we will see later some \LaTeX\ packages (like the \package{floatrow},
-\package{longtable}, and \package{sidecap} package for example) and also
-this package offer additional environments with captions and these two
-commands can also be used with them.
-\See{\Ref{declare} and \Ref{packages}}
-
-\begin{Expert}
-\NEWfeature{v3.1}
-There is also a starred variant of |\caption|\-|setup|:
-\begin{quote}
- |\captionsetup*|\oarg{float type}\marg{options}
-\end{quote}
-While the non-starred variant can give you warnings---for example if the
-\meta{options} are actually not used throughout the document
-(e.g.~a |\caption|\-|setup[table]{font=|\x|sf}| without a |table|)---the
-starred variant will not.
-\iffalse
-This can get quite useful when setting generic options which are independent
-of a specific document.
-\fi
-\end{Expert}
-
-\medskip
-
-\pagebreak[3]
-\DescribeMacro{\clearcaptionsetup}
-If you want to get rid of these parameters marked for an automatic use within
-a particular environment you can use the command
-\begin{quote}
- |\clearcaptionsetup|\oarg{option}\marg{float type}\quad.
-\end{quote}
-
-For example |\clearcaptionsetup{figure}| would clear all the extra handling
-for figures in the example above:
-\begin{quote}
- |\captionsetup{font=small}|\\
- |\captionsetup[figure]{labelfont=bf,textfont=it}|\\
- \ldots\\
- | \caption{A figure}|\\
- \ldots\\
- |\clearcaptionsetup{figure}|\\
- \ldots\\
- | \caption{A figure}|\\
- \ldots
-\end{quote}
-\begin{Example}
- \captionsetup{font=small}
- \captionsetup[figure]{labelfont=bf,textfont=it}
- \begingroup
- \captionof{figure}{A figure}
- \endgroup
- \captionsetup{position=top}
- \clearcaptionsetup{figure}
- \begingroup
- \captionof{figure}{A figure}
- \endgroup
-\end{Example}
-
-\pagebreak[3]
-\NEWfeature{v3.1}
-If an optional argument \meta{option} is given, only the settings regarding
-this particular \meta{option} are cleared.\footnote{You can only specify
-\emph{one} option here, not a list of options.
-If you want to clean more than one option, you need to use more than one
-\cs{clear}\-\texttt{caption}\-\texttt{setup}.}
-While the example above not only clears the options
-|labelfont=bf,|\x|textfont=it|
-for figures (but all options for figures instead),
-this one would only clear the |labelfont=bf| setting, leaving all other
-settings for figures intact:
-\begin{quote}
- |\captionsetup{font=small}|\\
- |\captionsetup[figure]{labelfont=bf,textfont=it}|\\
- \ldots\\
- | \caption{A figure}|\\
- \ldots\\
- |\clearcaptionsetup[labelfont]{figure}|\\
- \ldots\\
- | \caption{A figure}|\\
- \ldots
-\end{quote}
-\begin{Example}
- \captionsetup{font=small}
- \captionsetup[figure]{labelfont=bf,textfont=it}
- \begingroup
- \captionof{figure}{A figure}
- \endgroup
- \captionsetup{position=top}
- \clearcaptionsetup[labelfont]{figure}
- \begingroup
- \captionof{figure}{A figure}
- \endgroup
-\end{Example}
-\begin{Expert}
-Analogous to |\caption|\-|setup*| there is also a starred form
-|\clear|\-|caption|\-|setup*| which suppresses warnings if the given
-\meta{option} was not setup for the specified \meta{float type}.
-\end{Expert}
-
-\medskip
-
-\pagebreak[3]
-\DescribeMacro{\showcaptionsetup}
-For debugging purposes the command
-\nopagebreak[3]
-\begin{quote}
- |\showcaptionsetup|\marg{float type}
-\end{quote}
-\nopagebreak[3]
-is offered. It generates a log file entry, showing the given options
-for the specified \meta{float type}. For example
-\begin{quote}
- |\captionsetup[figure]{labelfont=bf,textfont=it}|\\
- |\showcaptionsetup{figure}|
-\end{quote}
-gives the info:
-\begin{quote}\small
- |Caption Info: Option list on `figure'|\\
- |Caption Data: {labelfont=bf,textfont=it} on input line 5.|
-\end{quote}
-
-\pagebreak[3]
-\subsection{Continued floats}
-\label{ContinuedFloat}
-
-\DescribeMacro{\ContinuedFloat}
-Sometimes you want to split figures or tables without giving them
-their own reference number. This is what the command
-\begin{quote}
- |\ContinuedFloat|
-\end{quote}
-is for; it should be used as first command inside the floating environment.
-It prevents the incrementation of the relevant counter (usually done by
-|\caption|), so a figure or table containing a |\Continued|\-|Float| inside
-gets the same reference number as the figure or table before.
-An example:
-\begin{quote}
- |\begin{table}|\\
- | \caption{A table}|\\
- | |\ldots\\
- |\end{table}|\\
- \ldots\\
- |\begin{table}\ContinuedFloat|\\
- | \caption{A table (cont.)}|\\
- | |\ldots\\
- |\end{table}|
-\end{quote}
-gives the following result:
-\begin{Example}
- \captionsetup{type=table,position=b,skip=0pt}
- \caption{A table}
- \centerline{\ldots}
-\end{Example}
-\begin{Example}
- \captionsetup{type=table,position=b,skip=0pt}
- \ContinuedFloat
- \caption{A table (cont.)}
- \centerline{\ldots}
-\end{Example}
-
-\bigskip
-
-\NEWfeature{v3.1}
-Furthermore the |\Continued|\-|Float| command executes options associated with
-the type name ``|Continued|\-|Float|''. For example this can be used to switch
-to a different label format for continued figures or tables, as shown here:
-\begin{quote}
- |\DeclareCaptionLabelFormat{continued}{Continued #1~#2}|\\
- |\captionsetup[ContinuedFloat]{labelformat=continued}|\\
- \ldots\\
- |\begin{table}\ContinuedFloat|\\
- | \caption{A table}|\\
- | |\ldots\\
- |\end{table}|
-\end{quote}
-\begin{Example}
- \captionsetup{type=table,position=b,skip=0pt}
- \captionsetup[ContinuedFloat]{labelformat=continued1}
- \ContinuedFloat
- \caption{A table}\label{continued1}
- \centerline{\ldots}
-\end{Example}
-\smallskip
-\See{\Ref{declare} for an explanation of
- \cs{Declare}\-\texttt{Caption}\-\texttt{Label}\-\texttt{Format}.}
-
-\medskip
-
-There is also a \LaTeX\ counter called |Continued|\-|Float| which could be
-used for own purposes.
-For ordinary (floating) environments it's set to zero, to one for the first
-continued float, to two inside the second one, and so on.
-So every |\Continued|\-|Float| increments this counter and a floating
-environment without |\Continued|\-|Float| command resets this counter to zero.
-An example:
-\begin{quote}
- |\DeclareCaptionLabelFormat{cont}{#1~#2\alph{ContinuedFloat}}|\\
- |\captionsetup[ContinuedFloat]{labelformat=cont}|\\
- \ldots\\
- |\begin{table}\ContinuedFloat|\\
- | \caption{A table}|\\
- | |\ldots\\
- |\end{table}|
-\end{quote}
-\begin{Example}
- \captionsetup{type=table,position=b,skip=0pt}
- \captionsetup[ContinuedFloat]{labelformat=continued2}
- \ContinuedFloat
- \caption{A table}\label{continued2}
- \centerline{\ldots}
-\end{Example}
-\medskip
-A reference to this table would still result in the output
-``\autoref{continued2}'' since only the caption label format was changed.
-If you would like to use the |Continued|\-|Float| counter for the references,
-too, you could redefine the command |\the|\-|Continued|\-|Float| instead,
-which will be appended to the figure or table counter automatically in
-continued floats and is preset to be empty.
-\begin{quote}
- |\renewcommand\theContinuedFloat{\alph{ContinuedFloat}}|\\
- \ldots\\
- |\begin{table}\ContinuedFloat|\\
- | \caption{A table}|\\
- | |\ldots\\
- |\end{table}|
-\end{quote}
-\begin{Example}
- \captionsetup{type=table,position=b,skip=0pt}
- \renewcommand\theContinuedFloat{\alph{ContinuedFloat}}
- \ContinuedFloat
- \caption{A table}\label{continued3}
- \centerline{\ldots}
-\end{Example}
-\medskip
-A reference to that table would result in the output ``\autoref{continued3}''.
-
-\pagebreak[3]
-\DescribeMacro{\ContinuedFloat*}
-Suppose you want to start the first figure or table of such a series with a
-kind of ``Figure 7a'' and not with ``Figure 7'' (and the second one with
-``Figure 7b'' instead of ``Figure 7a'').
-This is possible, too, by using the starred variant |\Continued|\-|Float*|
-which---just like |\Continued|\-|Float|---executes options associated with the
-type name ``|Continued|\-|Float|'' and increments the \LaTeX\ counter
-|Continued|\-|Float|, \emph{but} marks the first figure or table of a series
-instead:
-\begin{quote}
- |\renewcommand\theContinuedFloat{\alph{ContinuedFloat}}|\\
- \ldots\\
- |\begin{figure}\ContinuedFloat*|\\
- | |\ldots\\
- | \caption{First figure of a series}|\\
- |\end{figure}|\\
- \ldots\\
- |\begin{figure}\ContinuedFloat|\\
- | |\ldots\\
- | \caption{Second figure of a series}|\\
- |\end{figure}|\\
- \ldots\\
- |\begin{figure}\ContinuedFloat|\\
- | |\ldots\\
- | \caption{Third figure of a series}|\\
- |\end{figure}|
-\end{quote}
-\begin{Example}
- \captionsetup{type=figure,position=b,skip=0pt}
- \renewcommand\theContinuedFloat{\alph{ContinuedFloat}}
- \begingroup
- \ContinuedFloat*
- \centerline{\ldots}
- \caption{First figure of a series}
- \endgroup
- \begingroup
- \ContinuedFloat
- \centerline{\ldots}
- \caption{Second figure of a series}
- \endgroup
- \begingroup
- \ContinuedFloat
- \centerline{\ldots}
- \caption{Third figure of a series}
- \endgroup
-\end{Example}
-\smallskip
-\Note{Unfortunately \cs{ContinuedFloat*} is not available if the
- \package{subfig} package\cite{subfig} is loaded.}
-
-\pagebreak[3]
-\subsubsection*{A note about longtables}
-If you want to have a different caption label in |long|\-|table|s (offered
-by the \package{longtable} package\cite{longtable}) after a page break,
-this can \emph{not} be archived by using |\Continued|\-|Float|,
-but instead you could write something like:
-\begin{quote}
- |\DeclareCaptionLabelFormat{continued}{Continued #1~#2}|\\
- \ldots\\
- |\begin{longtable}{|\ldots|}|\\
- | \caption{A longtable}\\|\\
- |\endfirsthead|\\
- | \captionsetup{labelformat=continued}|\\
- | \caption[]{A longtable}\\|\\
- |\endhead|\\
- | |\ldots\\
- |\end{longtable}|
-\end{quote}
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\section{Own enhancements}
-\label{declare}
-
-A family of commands is provided to allow users to define their own formats
-etc.
-This enables information on separators, justification, fonts, and styles to
-be associated with a name and kept in one place.
-(These commands need to appear in the document preamble,
-this is the part between |\document|\-|class| and |\begin{document}|.)
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\Format}
-You can define your own caption formats using the command
-\begin{quote}
- |\DeclareCaptionFormat|\marg{name}\marg{code using \#1, \#2 and \#3}\mbox{\quad.}
-\end{quote}
-At usage the system replaces \#1 with the caption label, \#2 with the
-separator and \#3 with the text. So the standard format |plain| is
-pre-defined by \thispackage\ as
-\begin{quote}
- |\DeclareCaptionFormat{plain}{#1#2#3\par}|\quad.
-\end{quote}
-\begin{Expert}
-There is also a starred variant, |\Declare|\-|Caption|\-|Format*|,
-which causes the code being typeset in \TeX s vertical (instead of
-horizontal) mode, but does not support the |indention=| option.
-\end{Expert}
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\LabelFormat}
-Likewise you can define your own caption label formats:
-\begin{quote}
- |\DeclareCaptionLabelFormat|\marg{name}\marg{code using \#1 and \#2}
-\end{quote}
-At usage \#1 gets replaced with the name (e.g. ``figure'') and \#2
-gets replaced with the reference number (e.g. ``12'').
-An example:
-\begin{quote}
- |\DeclareCaptionLabelFormat{bf-parens}{(\textbf{#2})}|\\
- |\captionsetup{labelformat=bf-parens,labelsep=quad}|
-\end{quote}
-\example*{labelformat=bf-parens,labelsep=quad}{\exampletext}
-
-\pagebreak[3]
-\DescribeMacro{\bothIfFirst}
-\DescribeMacro{\bothIfSecond}
-If you define your own caption label formats and use the
-\package{subcaption} or \package{subfig}\cite{subfig} package,
-you should take care of empty caption label names.
-For this purpose the commands
-\begin{quote}
- |\bothIfFirst|\marg{first arg}\marg{second arg}\quad and\\
- |\bothIfSecond|\marg{first arg}\marg{second arg}
-\end{quote}
-are offered. |\bothIfFirst| tests if the first argument exists (means: is
-not empty), |\bothIfSecond| tests if the second argument exists. If yes,
-both arguments get typeset, otherwise none of them.
-
-\smallskip
-
-\pagebreak[3]
-For example the standard label format |simple| is \emph{not} defined as
-\begin{quote}
- |\DeclareCaptionLabelFormat{simple}{#1~#2}|\mbox{\quad,}
-\end{quote}
-because this could cause an extra space if \#1 is empty. Instead |simple|
-is defined as
-\begin{quote}
- |\DeclareCaptionLabelFormat{simple}%|\\
- | {\bothIfFirst{#1}{~}#2}|\mbox{\quad,}
-\end{quote}
-causing the space to appear only if the label name is present.
-
-\smallskip
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\TextFormat}\NEWfeature{v3.0l}
-Likewise you can define your own caption text formats:
-\begin{quote}
- |\DeclareCaptionTextFormat|\marg{name}\marg{code using \#1}
-\end{quote}
-At usage \#1 gets replaced with the caption text.
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\LabelSeparator}
-You can define your own caption label separators with
-\begin{quote}
- |\DeclareCaptionLabelSeparator|\marg{name}\marg{code}\mbox{\quad.}
-\end{quote}
-Again an easy example taken from \thispackage\ itself:
-\begin{quote}
- |\DeclareCaptionLabelSeparator{colon}{: }|
-\end{quote}
-\begin{Expert}
-There is also a starred variant, |\Declare|\-|Caption|\-|Label|\-|Separator*|,
-which causes the code being typeset without using the |label|\-|font=| setting.
-So for example the label separators |quad|, |new|\-|line|, and |en|\-|dash|
-are defined in this way.
-\end{Expert}
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\Justification}
-You can define your own caption justifications with
-\begin{quote}
- |\DeclareCaptionJustification|\marg{name}\marg{code}\mbox{\quad.}
-\end{quote}
-The \meta{code} simply gets typeset just before the caption.
-E.g.~using the justification |raggedright|, which is defined as
-\begin{quote}
- |\DeclareCaptionJustification{raggedright}{\raggedright}|\mbox{\quad,}
-\end{quote}
-typesets captions with all lines moved to the left margin.
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\Font}
-You can define your own caption fonts with
-\begin{quote}
- |\DeclareCaptionFont|\marg{name}\marg{code}\quad.
-\end{quote}
-For example this package defines the options |small| and |bf| as
-\begin{quote}
- |\DeclareCaptionFont{small}{\small}|\quad and\\
- |\DeclareCaptionFont{bf}{\bfseries}|\quad.
-\end{quote}
-\iffalse
-The line spacing could be customized using the \package{setspace} package,
-for example:%\NEWdescription{v3.0h}
-\begin{quote}
- |\usepackage{setspace}|\\
- |\DeclareCaptionFont{singlespacing}{\setstretch{1}}|~\footnote{%
- \emph{\DefaultNoteText:} Using \cs{singlespacing} does not work here since
- it contains a \cs{vskip} command.}\\
- |\DeclareCaptionFont{onehalfspacing}{\onehalfspacing}|\\
- |\DeclareCaptionFont{doublespacing}{\doublespacing}|\\
- |\captionsetup{font={onehalfspacing,small},labelfont=bf}|
-\end{quote}
-\example{font={onehalfspacing,small},labelfont=bf,singlelinecheck=off}{\exampletext}
-\fi
-An example which brings color into life:
-\begin{quote}
- |\usepackage{color}|\\
- |\DeclareCaptionFont{red}{\color{red}}|\\
- |\DeclareCaptionFont{green}{\color{green}}|\\
- |\DeclareCaptionFont{blue}{\color{blue}}|\\
- |\captionsetup{labelfont={blue,bf},textfont=green}|
-\end{quote}
-\example*{labelfont={color=blue,bf},textfont={color=green},singlelinecheck=off}{\exampletext}
-But since \thispackage\ already includes the tricky definition
-\begin{quote}
- |\DeclareCaptionFont{color}{\color{#1}}|
-\end{quote}
-you can get the same result simply with
-\begin{quote}
- |\usepackage{color}|\\
- |\captionsetup{labelfont={color=blue,bf},|\\
- | textfont={color=green}}|\quad.
-\end{quote}
-
-\medskip
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\Style}
-You can define your own caption styles with
-\begin{quote}
- |\DeclareCaptionStyle|\marg{name}\oarg{additional options}\marg{options}\mbox{\quad.}
-\end{quote}
-Remember, caption styles are just a collection of suitable options, saved
-under a given name. You can wake up these options at any time with the
-option |style=|\meta{style name}.
-
-All caption styles are based on the |base| set of options. (See \Ref{style}
-for a complete list.) So you only need to specify options which are different
-to them.
-
-If you specify \meta{additional options} they get used in addition when
-the caption fits into a single line and this check was not disabled with
-the option |single|\-|line|\-|check=off|.
-
-Again a very easy example taken from the core of this package: The
-caption style |base| is pre-defined as
-\begin{quote}
- |\DeclareCaptionStyle{base}%|\\
- | [justification=centering,indention=0pt]{}|\quad.
-\end{quote}
-
-Something more exciting:
-\begin{quote}
- |\DeclareCaptionStyle{mystyle}%|\\
- | [margin=5mm,justification=centering]%|\\
- | {font=footnotesize,labelfont=sc,margin={10mm,0mm}}|\\
- |\captionsetup{style=mystyle}|
-\end{quote}
-gives you caption like these ones:
-\begin{Example}
- \captionsetup{type=figure,style=mystyle,position=b}
- \caption{A short caption.}
- \caption{A long long long long long long long long long
- long long long long long long long long long
- long long long long long long long long long caption.}
-\end{Example}
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\ListFormat}\NEWfeature{v3.1}
-You can define your own caption list formats with
-\begin{quote}
- |\DeclareCaptionListFormat|\marg{name}\marg{code using \#1 and \#2}\mbox{\quad.}
-\end{quote}
-At usage \#1 gets replaced with the label prefix (e.g.~|\p@figure|),
-and \#2 gets replaced with the reference number (e.g.~|\thefigure|).
-
-% --------------------------------------------------------------------------- %
-
-\subsection{Further examples}
-\label{examples}
-
-\subsubsection*{Example 1}
-
-%\NEWdescription{v3.1}
-If you would like to have a line break between caption label and text
-you could define it this way:
-\begin{quote}
- |\DeclareCaptionFormat{myformat}{#1#2\\#3}|
-\end{quote}
-If you select this format with |\caption|\-|setup{format=|\x|myformat}|
-you get captions like this:
-%\begin{Example}
-% \captionsetup{skip=0pt}
- \example{format=myformat1,labelfont=bf}{\exampletext}
-%\end{Example}
-You could even use an indention with this caption format:
-\begin{quote}
- |\captionsetup{format=myformat,indention=1cm}|
-\end{quote}
-This would look like this:
-%\begin{Example}
-% \captionsetup{skip=0pt}
- \example{format=myformat1,indention=1cm,labelfont=bf}{\exampletext}
-%\end{Example}
-Instead, you would like to have an indention only of the first line of
-the caption text? No problem, e.g.
-\begin{quote}
- |\newlength\myindention|\\
- |\DeclareCaptionFormat{myformat}%|\\
- | {#1#2\\\hspace*{\myindention}#3}|\\
- \ldots\\
- |\setlength\myindention{1cm}|\\
- |\captionsetup{format=myformat}|
-\end{quote}
-would give you captions like
-%\begin{Example}
-% \captionsetup{skip=0pt}
- \example{format=myformat2,myindention=1cm,labelfont=bf}{\exampletext}
-%\end{Example}
-But you want to have an caption option for this indention, so you can use
-it for example with
-|\caption|\-|setup|\x|[figure]|\x|{my|\-|indention=|\x\ldots|}|?
-This could be done, too:
-\begin{quote}
- |\newlength\myindention|\\
- |\DeclareCaptionOption{myindention}%|\\
- | {\setlength\myindention{#1}}|\\
- |\DeclareCaptionFormat{myformat}%|\\
- | {#1#2\\\hspace*{\myindention} #3}|\\
- \ldots\\
- |\captionsetup{format=myformat,myindention=1cm}|
-\end{quote}
-would give the same result as the example above.
-
-\subsubsection*{Example 2}
-
-You want captions to look like this:
-%\begin{Example}
-% \captionsetup{skip=0pt}
- \example{format=reverse,labelformat=fullparens,labelsep=fill,labelfont=it}{\exampletext}
-%\end{Example}
-\pagebreak[2]
-You could do it this way:
-\nopagebreak[3]
-\begin{quote}
- |\DeclareCaptionFormat{reverse}{#3#2#1}|\\
- |\DeclareCaptionLabelFormat{fullparens}%|\\
- | {(\bothIfFirst{#1}{~}#2)}|\\
- |\DeclareCaptionLabelSeparator{fill}{\hfill}|\\
- |\captionsetup{format=reverse,labelformat=fullparens,|\\
- | labelsep=fill,font=small,labelfont=it}|
-\end{quote}
-
-\subsubsection*{Example 3}
-
-The caption text should go into the left margin? A possible solution would be:
-\begin{quote}
- |\DeclareCaptionFormat{llap}{\llap{#1#2}#3\par}|\\
- |\captionsetup{format=llap,labelsep=quad,singlelinecheck=no}|
-\end{quote}
-As a result you would get captions like this:
-\example{format=llap,labelsep=quad,singlelinecheck=no,margin=0pt}{\exampletext}
-
-\medskip
-
-If the indention into the margin shall be fixed, you could use a combination
-of |\llap| and |\makebox|, for example:
-\begin{quote}
- |\DeclareCaptionFormat{llapx}%|\\
- | {\llap{\makebox[5em][l]{#1}}#3\par}|\\
- |\captionsetup{format=llapx,singlelinecheck=off}|
-\end{quote}
-\example{format=llapx,singlelinecheck=off,skip=0pt,margin=0pt}{\exampletext}
-
-\subsubsection*{Example 4}
-
-This example puts a figure aside a table, but uses only one common caption for both.
-This will be achieved by a combination of
-|\Declare|\-|Caption|\-|Label|\-|Format| and |\caption|\-|list|\-|entry|:
-\begin{quote}
- |\DeclareCaptionLabelFormat{andtable}%|\\
- | {#1~#2 \& \tablename~\thetable}|\\
- \ldots\\
- |\begin{figure}|\\
- | \centering|\\
- | \includegraphics{|\ldots|}%|\\
- | \qquad|\\
- | \begin{tabular}[b]{\ldots}|\\
- | |\ldots\\
- | \end{tabular}|\\
- | \captionlistentry[table]{|\ldots|}|\\
- | \captionsetup{labelformat=andtable}|\\
- | \caption{|\ldots|}|\\
- |\end{figure}|
-\end{quote}
-\DeleteShortVerb{\|}%
-\noindent\begin{minipage}{\linewidth}
- \captionsetup{type=figure}
- \centering
- \includegraphics[width=30pt]{cat}%
- \qquad
- \begin{tabular}[b]{r|rr}
- & x & y \\\hline
- a & 1 & 2 \\
- b & 3 & 4 \\
- \end{tabular}
- \captionlistentry[table]{A figure and a table with a common caption}
- \captionsetup{labelformat=andtable}
- \caption{A figure and a table with a common caption~\footnotemark}
-\end{minipage}
-\footnotetext{The picture was taken with permission from the
- \LaTeX\ Companion\cite{TLC2} examples.}
-\MakeShortVerb{\|}
-
-(Please remember that |\caption|\-|list|\-|entry| increments the figure
- resp.~table counter.)
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\section{Supported document classes}
-\label{classes}
-
-%\NEWdescription{v3.1}
-This section will give you an overview of the document classes the
-\package{caption} supports, what do they already offer regarding captions,
-what side effects will occur when using the \package{caption} package with
-them, and what are the `default' settings for them.
-
-\NEWfeature{v3.1}
-The `default' settings depend on the document class you use; they represent
-how the class author wanted the captions to look like. So for example
-setting |format=|\x|default| can give you different visual designs when used
-with different document classes.
-
-\begingroup\setlength\leftmargini{0.3em}% default = 2.5em
-\INFO
-If you don't find the document class you use in this section, you usually
-don't have to worry: Many document classes (e.g.~the \class{octavo} class)
-are derived from one of the standard document classes \class{article},
-\class{report}, or \class{book}, and behave the same regarding captions.
-\Thispackage\ automatically does a compatibility check against the document
-class used and will give you the clear warning
-\begin{quote}\footnotesize
- |Package caption Warning: Unsupported document class (or package) detected,|\\
- |(caption) usage of the caption package is not recommended.|\\
- |See the caption package documentation for explanation.|
-\end{quote}
-if such an incompatibility was detected.
-If you don't get such warning everything is fine, but if you get it the
-usage of \thispackage\ is not recommended and especially not supported.
-\endgroup
-
-\begin{Expert}
-If you get such a compatibility warning but decide to use \thispackage{}
-anyway, you should watch carefully what side-effects occur, usually the
-look and feel of your captions will change by just including \thispackage{}
-without options, meaning they do not look like as intended by the author
-of the document class.
-If this is fine for you, you should first specify the option |style=|\x|base|
-via |\use|\-|package[style=|\x|base]{caption}| or
-|\caption|\-|setup{style=|\x|base}| to set \thispackage\ into a well-defined
-state.
-Afterwards you can start setting your own options additionally and
-keep your fingers crossed.
-\end{Expert}
-
-\newcommand*\Option{Option}
-\newcommand*\defaultvalue{\texttt{default} value}
-\newcommand*\uses{\textit{uses}}
-\newcommand*\settings{\textit{settings}}
-\newcommand*\nofont{\textit{none}}
-
-\subsection{Standard \LaTeX: article, report, and book}
-
-\begin{tabular}{ll}
-\Option & \defaultvalue \\\hline
-|format=| & |plain| \\
-|labelformat=| & |simple| \\
-|labelsep=| & |colon| \\
-|justification=| & |justified| \\
-|font=| & \nofont \\
-|labelfont=| & \nofont \\
-|textfont=| & \nofont \\
-\end{tabular}
-
-\begin{Annotation}
-This also applies to document classes derived from them.
-\end{Annotation}
-
-\subsection{\AmS: amsart, amsproc, and amsbook}
-\label{AMS}
-
-\begin{tabular}{ll}
-\Option & \defaultvalue \\\hline
-|format=| & |plain| \\
-|labelformat=| & |simple| \\
-|labelsep=| & |.\enspace| \\
-|justification=| & |justified| \\
-|font=| & |\@captionfont| \\
-|labelfont=| & |\@captionheadfont| \\
-|textfont=| & |\@captionfont\upshape| \\
-\end{tabular}
-
-\begin{Annotation*}
-|\@caption|\-|font| will be set to |\normal|\-|font|, and
-|\@caption|\-|head|\-|font| to |\sc|\-|shape| by the \AmS\ document classes.
-\end{Annotation*}
-
-Furthermore the margin will be set to |\caption|\-|indent| for
-more-than-one-line captions (which will be set to |3pc| by the \AmS\ classes),
-the margin for single-line captions will be set to the half of it instead.
-If you want to use a common margin for both, insert
-|\clear|\-|caption|\-|setup[margin*]{single|\-|line}|
-into the preamble of your document, after loading \thispackage.
-
-Additionally the options |figure|\-|position=b,|\x|table|\-|position=t|
-will be set. You can override these settings by specifying other values for
-|figure|\-|position=| or |table|\-|position=| in the option list while
-loading \thispackage.
-
-\subsection{beamer}
-\label{beamer}
-
-\begin{tabular}{ll}
-\Option & \defaultvalue \\\hline
-|format=| & |plain| \\
-|labelformat=| & \textit{not numbered} \\
-|labelsep=| & |colon| \\
-|justification=| & |raggedright| \\
-|font=| & \class{beamer} ``|caption|'' \settings \\
-|labelfont=| & \class{beamer} ``|caption name|'' \settings \\
-|textfont=| & \nofont \\
-\end{tabular}
-
-\subsubsection*{Build-in features, and side-effects}
-You can setup font and color settings with
-|\set|\-|beamer|\-|font{caption}|\marg{options} and
-|\set|\-|beamer|\-|font{caption name}|\marg{options}.
-This will still work, unless you set a different font with
-|\caption|\-|setup{font=|\x\meta{options}|}| or
-|\caption|\-|setup{label|\-|font=|\x\meta{options}|}|.\par
-Furthermore the \class{beamer} classes offer different caption templates
-which can be chosen with
-|\set|\-|beamer|\-|template|\x|{caption}|\x|[|\meta{template}|]|.
-Since \thispackage\ replaces this caption template mechanism,
-|\def|\-|beamer|\-|template*|\x|{caption}|\x\marg{template code}
-and
-|\set|\-|beamer|\-|template|\x|{caption}|\x|[|\meta{template}|]|
-will have no effect when \thispackage\ is used.
-(Exception: Selecting the template |default|, |num|\-|bered|, or
-|caption| |name| |own| |line| will be recognized by \thispackage and be mapped
-to corresponding options.)
-
-\subsection{\KOMAScript: scrartcl, scrreprt, and scrbook}
-\label{KOMA}
-
-\begin{tabular}{ll}
-\Option & \defaultvalue \\\hline
-|format=| & \uses\ |\setcapindent| \textit{\&} |\setcaphanging| \settings \\
-|labelformat=| & \textit{like \purett{simple}, but with support of ``autodot''}\\
-|labelsep=| & |\captionformat| \\
-|justification=| & |justified| \\
-|font=| & |\setkomafont{caption}| \settings \\
-|labelfont=| & |\setkomafont{captionlabel}| \settings \\
-|textfont=| & \nofont \\
-\end{tabular}
-
-\subsubsection*{Build-in features}
-The \KOMAScript\ document classes offer many ways to customize the look and
-feel of the captions. For an overview and a full description please take a
-look at the \KOMAScript\ documentation, section `Tables and Figures'.
-
-\subsubsection*{Side effects}
-The optional argument of |\set|\-|cap|\-|width| is not supported and
-will be ignored if used in conjunction with the \package{caption} package.
-Furthermore the \KOMAScript\ options |table|\-|caption|\-|above| \&
-|table|\-|caption|\-|below| and the commands |\caption|\-|above| \&
-|\caption|\-|below| are stronger than the |position=| setting offered by
-the \package{caption} package.
-
-\subsection{\NTG: artikel, rapport, and boek}
-\label{NTG}
-
-\begin{tabular}{ll}
-\Option & \defaultvalue \\\hline
-|format=| & |plain| \\
-|labelformat=| & |simple| \\
-|labelsep=| & |colon| \\
-|justification=| & |justified| \\
-|font=| & \nofont \\
-|labelfont=| & |\CaptionLabelFont| \\
-|textfont=| & |\CaptionTextFont| \\
-\end{tabular}
-
-\subsubsection*{Build-in features, and side-effects}
-|\Caption|\-|Label|\-|Font| and |\Caption|\-|Text|\-|Font| can be set either
-directly or by using |\Caption|\-|Fonts|.
-Both is still supported unless you use one of the two options
-|label|\-|font=| or |text|\-|font=| offered by \thispackage.
-
-\subsection{\SmF: smfart and smfbook}
-\label{SMF}
-
-Since the \SmF\ document classes are derived from the \AmS\ document classes
-the same default values are valid here.
-
-Additionally the margin is limited up to the tenth of the |\line|\-|width|.
-If you don't like this limitation, you can switch it off with the option
-|max|\-|margin=|\x|off| or |max|\-|margin=|\x|false|
-(which both means the same).
-
-\subsection{thesis}
-\label{thesis}
-
-\begin{tabular}{ll}
-\Option & \defaultvalue \\\hline
-|format=| & |hang| \\
-|labelformat=| & \textit{like \purett{simple}, but with short name}\\
-|labelsep=| & |colon| \\
-|justification=| & |justified| \\
-|font=| & \nofont \\
-|labelfont=| & |\captionheaderfont| \\
-|textfont=| & |\captionbodyfont| \\
-\end{tabular}
-
-\subsubsection*{Build-in features, and side-effects}
-The caption label font can be set with |\caption|\-|header|\-|font|,
-the caption text font with |\caption|\-|body|\-|font|.
-Both is still supported unless you use one of the two options
-|label|\-|font=| or |text|\-|font=| offered by \thispackage.
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\section{Supported babel package options}
-\label{babel}
-
-\NEWfeature{v3.5}
-Since version \version{3.5} of the \package{caption} package the support
-is independent on the load order of \package{caption} and \package{babel}.
-
-\subsection{french babel option}
-\label{french}
-
-If you use the \package{french} option of the \package{babel} package
-with one of the three standard \LaTeX{} classes (or a one derived from them)
-the default |label|\-|sep=| will be set to |\Caption|\-|Sep|\-|a|\-|ra|\-|tor|
-(offered by \package{french}), overriding the default value set by the
-document class.
-So redefining |\Caption|\-|Sep|\-|a|\-|ra|\-|tor| will still work, unless you
-don't select a different |label|\-|sep=| than the default one.
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\section{Supported packages}
-\label{packages}
-\label{compatibility}
-
-%\NEWdescription{v3.1}
-\Thispackage\ was adapted to the following packages which deals with
-captions, too:
-\begin{quote}
- \package{float}, \package{floatflt}, \package{fltpage},
- \package{hyperref}, \package{hypcap}, \package{listings},
- \package{longtable}, \package{picinpar}, \package{picins},
- \package{rotating}, \package{setspace}, \package{sidecap},
- \package{subfigure}, \package{supertabular}, \package{threeparttable},
- \package{wrapfig}, and \package{xtab}
-\end{quote}
-
-Furthermore the \package{floatrow} package\cite{floatrow}, the
-\package{subcaption} package (which is part of the \package{caption} package
-bundle), and the \package{subfig} package\cite{subfig} support \thispackage{}
-and use its |\caption|\-|setup| interface.
-
-\bigskip
-
-\begingroup\setlength\leftmargini{0.3em}% default = 2.5em
-\INFO
-If a package (or document class) unknown to \thispackage\ redefines
-the |\caption| command as well, this redefinition will be preferred
-over the one this package offers, providing maximum compatibility and
-avoiding conflicts.
-If such a potential incompatibility is detected, you will see this
-warning message:~\footnote{%
- You can suppress this warning by specifying the option
- \texttt{compatibility=true} when loading \thispackage.}
-\begin{quote}\footnotesize
- |Package caption Warning: \caption will not be redefined since it's already|\\
- |(caption) redefined by a document class or package which is|\\
- |(caption) unknown to the caption package.|\\
- |See the caption package documentation for explanation.|
-\end{quote}
-\endgroup
-
-As a result, the following features offered by \thispackage\ will not be available:
-\begin{itemize}
- \item the options |labelformat=|, |position=auto|, |list=|, and |listformat=|
- \item |\caption*| (to produce a caption without label)
- \item |\caption[]{|\ldots|}| (to produce no entry in the List of Figures or Tables)
- \item |\caption{}| (to produce an empty caption without label separator)
- \item |\ContinuedFloat|
- \item correctly justified captions in environments like \texttt{wide} and
- \texttt{addmargin} which add extra margins
- \item the \textsf{hypcap} feature \See{\Ref{hyperref}\,}
- \item the sub-caption feature \See{\package{subcaption} package documentation}
-\end{itemize}
-
-\DescribeMacro{compatibility=}
-You can override this compatibility mode by specifying the option
-\begin{quote}
- |compatibility=false|
-\end{quote}
-when loading \thispackage.
-But please note that using this option is neither recommended nor supported
-since unwanted side-effects or even errors could occur afterwards.
-(For that reason you will get a warning about this.)
-
-\newcommand\packagedescription[1]{%
- \ifvmode\else\par\fi
- \nopagebreak
- \parbox[b]{\linewidth}{\footnotesize\leftskip=10pt\rightskip=10pt\relax#1}\par
- \nopagebreak\smallskip\nopagebreak}
-
-\PageBreak
-\subsection{algorithms}
-\label{algorithms}
-\packagedescription{%
-The \package{algorithms} package bundle\cite{algorithms} provides two
-environments: The \texttt{algorithmic} environment provides a possibility
-for describing algorithms, and the \texttt{algorithm} environment provides
-a ``float'' wrapper for algorithms.}
-
-Since the \texttt{algorithm} environment is implemented via |\new|\-|float|
-provided by the \package{float} package\cite{float}, please see \Ref{float}.
-
-\iffalse
-\pagebreak[3]
-\subsection{algorithm2e}
-\label{algorithm2e}
-\packagedescription{%
-The \package{algorithm2e} package\cite{algorithm2e} offers an environment for
-writing algorithms in LaTeX2e.}
-
-Since the \package{algorithm2e} package does not use some kind of standard
-interface for defining its floating environment (e.g.~|\newfloat| of the
-\package{float} package) and typesetting its caption,
-the \package{algorithm2e} package is \emph{not} supported by \thispackage.
-
-So if you want to customize the captions using \thispackage,
-you have to build a new environment which uses a supported interface regarding
-floats (e.g. using the \package{float} or \package{floatrow} package),
-and combine this environment with the internal \package{algorithm2e} code.
-
-As first step you could define a non-floating environment \texttt{algorithmic},
-for example:
-\begin{quote}
- |\usepackage{algorithm2e}|\\
- |% save the "algorithm" environment from the algorithm2e package|\\
- |\let\ORIGalgorithm\algorithm|\\
- |\let\ORIGendalgorithm\endalgorithm|\\
- |% define the algorithmic environment|\\ % , based on the saved environment
- |\newenvironment{algorithmic}%|\\
- | {\renewenvironment{algocf}[1][h]{}{}% pass over floating stuff|\\
- | \ORIGalgorithm}%|\\
- | {\ORIGendalgorithm}|\\
- \ldots
-\end{quote}
-Having defined this non-floating environment, you could define your own new
-floating environment with |\newfloat| of the \package{float} package
-(or |\DeclareNewFloatType| of the \package{floatrow} package),
-and use the combination of this floating environment and \texttt{algorithmic}
-in its body, just like you would do when you use the
-\package{algorithm}/\package{algorithmic} package tandem.
-
-You could even use the \package{algorithm} package for this purpose, for example:
-\begin{quote}
- \ldots\\
- |% load the algorithm package to re-define the|\\
- |% floating environment "algorithm" and \listofalgorithms|\\
- |\let\listofalgorithms\undefined|\\
- |\usepackage{algorithm}|\\
- \ldots\\
- |% Example usage:|\\
- |\begin{algorithm}|\\
- |\caption{An algorithm}|\\
- |\begin{algorithmic}|\\
- | \SetVline|\\
- | \eIf{cond1}{|\\
- | a line\;|\\
- | }{|\\
- | another line\;|\\
- | }|\\
- |\end{algorithmic}|
-\end{quote}
-Now you are finally able to customize the float and caption layout like every
-other floating environment defined with the \package{float} package\cite{float},
-please see \Ref{float}.
-
-\begin{Annotation}
-An alternative would be using the \package{algorithmicx} package.
-\end{Annotation}
-\fi
-
-\pagebreak[3]
-\subsection{float}
-\label{float}
-\packagedescription{%
-The \package{float} package\cite{float} introduces the commands
-\cs{restylefloat} to give existing floating environments a new look \& feel
-and \cs{newfloat} to define new floating environments.
-It also provides the ``\texttt{H}'' float placement option which places
-the environments ``here'' instead of letting them floating around.}
-
-For floating environments defined with \cs{newfloat} or \cs{restylefloat} the
-|po|\-|si|\-|tion| option has no effect on the main caption anymore, since its
-placement and spacing will be controlled by the selected float style instead.
-
-A caption style and options defined with the name of the float style will be
-executed additionally to the regular ones.
-Using this mechanism \thispackage\ emulates the default look \& feel of the
-|ruled| captions: It defines the caption style
-\begin{quote}
- |\DeclareCaptionStyle{ruled}%|\\
- | {labelfont=bf,labelsep=space,strut=off}|\mbox{\quad.}
-\end{quote}
-So to change this you need either define your own caption style called
-|ruled| or use |\caption|\-|setup[ruled]|\marg{options} to specify additional
-options.%,
-%e.g.~|\caption|\-|setup[ruled]{labelsep=|\x|colon}|.
-
-Also by using this mechanism the skip between a |boxed| float and its caption
-is specified, overriding its global value:
-\begin{quote}
- |\captionsetup[boxed]{skip=2pt}|
-\end{quote}
-For changing this, just use |\caption|\-|setup[boxed]{skip=|\x\meta{value}|}|
-with an appropriate value. Or if you want to use the global |skip| setting
-instead, you can remove the usage of the local setting for these floats with
-|\clear|\-|caption|\-|setup[skip]{boxed}|.
-
-\begin{Note}
-Only one single caption can be typeset inside environments defined with
-|\new|\-|float| or |\re|\-|style|\-|float|, furthermore these environments
-are not behaving exactly like the pre-defined floats |figure| and |table|.
-As a consequence many packages do not cooperate well with these.
-Furthermore the \package{float} package has some caveats \& limitations,
-so if you just want to define a new simple floating environment---behaving
-like |figure| or |table|---I recommend using |\Declare|\-|Floating|\-|Environment|
-offered by the \package{newfloat} package instead.
-And for defining non-simple floating environments and customization I
-recommend using |\Declare|\-|New|\-|Float|\-|Type| offered by the
-\package{floatrow} package\cite{floatrow}.
-\end{Note}
-
-\iffalse
-Please also note that you \emph{don't} need a |\restyle|\-|float| for using
-the ``|H|'' float placement specifier. Some docs say so, but they are
-wrong.
-And |\restyle|\-|float{table}| is a very good method to shoot yourself
-in the foot, since many packages using |table| internally are not working
-correctly afterwards.
-\fi
-
-\pagebreak[3]
-\subsection{floatflt}
-\label{floatflt}
-\packagedescription{%
-The \package{floatflt} package\cite{floatflt} offers figures and tables
-which do not span the full width of a page and are float around by text.}
-
-\NEWfeature{v3.1}
-If you want to setup special options for the |float|\-|ing|\-|figure| and
-|float|\-|ing|\-|table| environments you can use
-\begin{quote}
- |\captionsetup[floatingfigure]|\marg{options}\quad\emph{and}\\
- |\captionsetup[floatingtable]|\marg{options}\quad.
-\end{quote}
-These options will be executed additionally to the regular ones for
-|figure| resp.~|table|.
-
-\begin{Note}
-The |margin| resp.~|width| setting will not be used for these figures resp.~tables,
-unless you set it explicit with |\caption|\-|setup[floating|\-|figure]{|\ldots|}|
-resp.~|\caption|\-|setup[floating|\-|table]{|\ldots|}|.
-\end{Note}
-
-\pagebreak[3]
-\subsection{fltpage}
-\label{fltpage}
-\packagedescription{%
-The \package{fltpage} package\cite{fltpage} offers the outhouse of the
-caption for |figure|s or |table|s which needs the whole page
-for its contents. This will be done by placing the caption on the bottom
-of the previous or next page.}
-
-\iffalse
-\NEWfeature{v3.1}
-Two options control the links to the environments |FPfigure| and |FPtable|:
-\begin{description}
-\item{\texttt{FPlist=caption} or \texttt{FPlist=figure}}\\[\smallskipamount]
-If set to |caption|, the list entry will link to the caption; if set to
-|figure|, it will link to the figure contents.
-(The default setting is |FP|\-|list=|\x|caption|.)
-\item{\texttt{FPref=caption} or \texttt{FPref=figure}}\\[\smallskipamount]
-If set to |caption|, a \cs{ref}, \cs{pageref}, \cs{autoref}, or \cs{nameref}
-will link to the caption; if set to |figure|, it will link to the figure contents.
-(The default setting is |FP|\-|ref=|\x|figure|.)
-\end{description}
-\fi
-
-If you want to setup special options for the |FPfigure| and |FPtable|
-environments you can use
-\begin{quote}
- |\captionsetup[FPfigure]|\marg{options}\quad\emph{and}\\
- |\captionsetup[FPtable]|\marg{options}\quad.
-\end{quote}
-These options will be executed additionally to the regular ones for
-|figure| or |table|.
-
-\pagebreak[3]
-\subsection{frenchle and frenchpro packages}
-\label{frenchpro}
-
-If you use the \package{frenchle} or \package{frenchpro} package,
-the default |label|\-|sep=| will be set to |\caption|\-|sep|\-|a|\-|ra|\-|tor|
-(offered by \package{frenchle/pro}) plus \cs{space}, overriding the default
-value set by the document class.
-So redefining |\caption|\-|sep|\-|a|\-|ra|\-|tor| will still work, unless you
-don't select a different |label|\-|sep=| than the default one.
-
-Furthermore the default |text|\-|font=| will be set to |text|\-|font=|\x|it|,
-since this emulates the default setting of |\caption|\-|font| defined by the
-\package{frenchle} or \package{frenchpro} package.
-%If you redefine |\captionfont| after loading the \package{frenchle} or
-%\package{frenchpro} package, this redefinition gets lost.
-Please note that the command |\caption|\-|font| is used by the
-\package{caption} package internally for a different purpose,
-so you should not change it (anymore).
-
-The command |\un|\-|numbered|\-|captions|\marg{figure \emph{or} table} will
-still work, but only unless you don't select a different |label|\-|format=|
-than the default one.
-
-\NEWfeature{v3.5}
-Since version \version{3.5} of the \package{caption} package the support
-is independent on the load order of \package{caption} and \package{frenchle}
-resp~.\package{frenchpro}.
-
-\pagebreak[3]
-\subsection{hyperref}
-\label{hyperref}
-\packagedescription{%
-The \package{hyperref} package\cite{hyperref} is used to handle cross
-referencing commands in LaTeX to produce hypertext links in the document.}
-
-\NEWfeature{v3.1}
-There are two options available to control the placement of hyperlink
-anchors:~\footnote{These options are named after the \package{hypcap} package
-which they supersede.}
-\begin{description}
-\item{\texttt{hypcap=true} or \texttt{hypcap=false}}\\[\smallskipamount]
-If set to |true| all hyperlink anchors -- where entries in the
-List of Figures, |\ref|, and |\auto|\-|ref| will link to -- are placed at
-the beginning of the (floating) environment.\par
-If set to |false| the hyperlink anchor is (usually) placed at the caption.\par
-(The default setting is |hypcap=|\x|true|.)
-\item{\texttt{hypcapspace=}\meta{amount}}\\[\smallskipamount]
-Because it looks poor if the hyperlink points exactly at the top of
-the figure or table, you can specify a vertical distance between
-the hyperlink anchor and the (floating) environment itself,
-e.g.~|hyp|\-|cap|\-|space=|\x|0pt| removes this distance.\par
-(The default setting is |hyp|\-|cap|\-|space=|\x|0.5\base|\-|line|\-|skip|.)
-\end{description}
-
-Both settings have no effect in |lst|\-|listing|s (provided by the
-\package{listings} package), |long|\-|table|s (provided by the
-\package{longtable} package), |super|\-|tabular|s (provided by the
-\package{supertabular} package), and |x|\-|tabular|s (provided by the
-\package{xtab} package), within these environments hyperlink
-anchors will always be placed as if |hyp|\-|cap=|\x|true| and
-|hyp|\-|cap|\-|space=|\x|0pt| would be set.
-
-\pagebreak[3]Please note:\nopagebreak
-\begin{description}
-\item{\cs{captionof}\marg{type}\csmarg{\purerm\ldots}
- vs.~\cs{captionsetup}\csmarg{type=\textrm{\meta{type}}}$+$\cs{caption}\csmarg{\purerm\ldots}}%
-\\[\smallskipamount]
-Without \package{hyperref} loaded, both will give you identical results.
-But with \package{hyperref} loaded, and with |hyp|\-|cap=|\x|true| requested,
-the hyperlink anchor will be placed different.
-For example:
-\begin{quote}
-|\begin{minipage}{\linewidth}|\\
-| |\ldots\\
-| \captionof{figure}{A figure}|\\
-|\end{minipage}|
-\end{quote}
-will place the hyperlink anchor at the caption.
-(And if |hyp|\-|cap=|\x|true| is set, you will get a warning about this.)
-But
-\begin{quote}
-|\begin{minipage}{\linewidth}|\\
-| \captionsetup{type=figure}|\\
-| |\ldots\\
-| \caption{A figure}|\\
-|\end{minipage}|
-\end{quote}
-will place the hyperlink anchor at the beginning of the |mini|\-|page|,
-since |\caption|\-|setup{type=|\x|figure}| does not only set the caption type
-to ``figure'' but does place a hyperlink anchor, too.
-
-\item{\cs{caption}\csoarg{}\csmarg{\purerm\ldots}
- vs.~\cs{captionsetup}\csmarg{list=false}$+$\cs{caption}\csmarg{\purerm\ldots}}\\[\smallskipamount]
-Again, without \package{hyperref} loaded, both will give you identical results.
-But with \package{hyperref} loaded, the difference is in the nuances.
-So for example the optional argument of |\caption| will also be written to
-the |aux| file, and will be used by the |\name|\-|ref| command.
-So if you choose to use |\caption| with empty optional argument,
-|\name|\-|ref| will also give you an empty result.
-So it's better to use |\caption|\-|setup{list=|\x|false}| if you don't
-want an entry in the List of Figures or List of Tables.
-\end{description}
-
-\pagebreak[3]
-\subsection{hypcap}
-\label{hypcap}
-\packagedescription{%
-The \package{hyp\-cap} package\cite{hypcap} offers a solution to the problem
-that links to a float using \package{hyper\-ref} may anchors to the caption
-rather than the beginning of the float.
-Since \thispackage\ \version{3.1} already solves this problem for itself,
-the \package{hypcap} package is usually not needed.}
-%, at least when you use \thispackage.}
-
-If the \package{hyp\-cap} package is loaded additionally to the
-\package{hyper\-ref} package, it takes over the control of the hyperlink
-anchor placement from \thispackage, overriding the options |hyp|\-|cap=|
-and |hyp|\-|cap|\-|space=|.
-
-So for a manual placement of hyperlink anchors
-|\caption|\-|setup{type=|\x\meta{type}|}| is not sufficient anymore,
-instead you need to use |\cap|\-|start| (provided by the \package{hyp\-cap}
-package) for this.
-
-Regarding the automatically placement the \package{hypcap} package offers good
-placement of hyperlink anchors for the floating environments |figure| and
-|table| only. In contrast the |hypcap=|\x|true| option of \thispackage\ also
-offers good placements of hyperlink anchors for
-|floating|\-|figure|s (provided by the \package{float\-flt} package),
-|FP|\-|figure|s \& |FPtable|s (provided by the \package{flt\-page} package),
-|fig|\-|window|s (provided by the \package{pic\-in\-par} package),
-|par|\-|pic|s (provided by the \package{pic\-ins} package),
-|SC|\-|figure|s (provided by the \package{side\-cap} package),
-|three|\-|part|\-|table|s (provided by the \package{three\-part\-table} package),
-and |wrapfigure|s (provided by the \package{wrap\-fig} package).%---%
-%so by loading the \package{hypcap} package additionally you will
-%loose that.
-
-\pagebreak[3]
-\subsection{listings}
-\label{listings}
-\packagedescription{%
-The \package{listings} package\cite{listings} typesets programming code.}
-
-If you want to setup special options for the |lst|\-|listing| environment
-you can use
-\begin{quote}
- |\captionsetup[lstlisting]|\marg{options}\quad.
-\end{quote}
-
-Please note that the \package{listings} package has its very own options
-for controlling the position and the skips of the caption:
-|caption|\-|pos=|, |above|\-|caption|\-|skip=|, and |below|\-|caption|\-|skip=|.
-\See{\package{listings} documentation for details.}
-These \package{listings} options override the \package{caption}'s ones, but
-can be again overwritten by |\caption|\-|setup[lst|\-|listing]{|\ldots|}|,
-e.g.%~
-\begin{quote}|\caption|\-|setup[lst|\-|listing]{skip=|\x|10pt}|\quad.\end{quote}
-
-\pagebreak[3]
-\subsection{longtable}
-\label{longtable}
-\packagedescription{%
-The \package{longtable} package\cite{longtable} offers an environment
-which behaves similar to the \texttt{tabular} environment, but the table
-itself can span multiple pages.}
-
-If you want to setup special options for the |long|\-|table| environment
-you can use
-\begin{quote}
- |\captionsetup[longtable]|\marg{options}\quad.
-\end{quote}
-These options will be executed additionally to the regular ones for
-|table|.
-
-The |margin| and |width| settings usually override |\LT|\-|cap|\-|width|,
-so you get an equal look \& feel of the captions in |table|s and
-|long|\-|table|s.
-But if you set |\LT|\-|cap|\-|width| to a value different than its default
-$=$ |4in|, \thispackage\ will follow that.
-(But |\LT|\-|cap|\-|width| will be overwritten by
-|\caption|\-|setup[long|\-|table]{width=|\x\meta{value}|}|,
-even if it is set to a value different than |4in|.)
-
-\begin{Note}
-|\caption|\-|of| and |\Continued|\-|Float| do \emph{not} work for |long|\-|table|s.
-Furthermore neither |\caption| nor |\caption|\-|list|\-|entry| will increment
-the |table| counter here; it's incremented by the |long|\-|table| environment
-instead.
-\NEWfeature{v3.1}
-If you need a |long|\-|table| which does not increment the |table| counter
-please use the |long|\-|table*| environment (offered by the
-\package{ltcaption} package which is part of \thispackage\ bundle and will be
-loaded automatically).
-\end{Note}
-
-\pagebreak[3]
-\subsection{picinpar}
-\label{picinpar}
-\packagedescription{%
-Similar to the \package{floatflt} package the \package{picinpar}
-package\cite{picinpar} offers figures and tables which do not span the full
-width of a page and are float around by text.
-For a detailed discussion about the differences between these packages
-please take a look at The \LaTeX\ Companion\cite{TLC2}.}
-
-\NEWfeature{v3.1}
-If you want to setup special options for the |fig|\-|window| and
-|tab|\-|window| environments you can use
-\begin{quote}
- |\captionsetup[figwindow]|\marg{options}\quad\emph{and}\\
- |\captionsetup[tabwindow]|\marg{options}\quad.
-\end{quote}
-These options will be executed additionally to the regular ones for
-|figure| or |table|.
-
-\begin{Note}
-The |margin| resp.~|width| setting will not be used for these figures and tables,
-unless you set it explicit with |\caption|\-|setup[fig|\-|window]{|\ldots|}| or
-|\caption|\-|setup[fig|\-|table]{|\ldots|}|.
-\end{Note}
-
-\pagebreak[3]
-\subsection{picins}
-\label{picins}
-\packagedescription{%
-Similar to the \package{floatflt} and \package{picinpar} package the
-\package{picins} package\cite{picins} offers figures and tables which do not
-span the full width of a page and are float around by text.
-For a detailed discussion about the differences between these packages
-please take a look at The \LaTeX\ Companion\cite{TLC2}.}
-
-\NEWfeature{v3.1}
-If you want to setup special options for the |par|\-|pic| environment you can use
-\begin{quote}
- |\captionsetup[parpic]|\marg{options}\quad.
-\end{quote}
-These options will be executed additionally to the regular ones for
-|figure| or |table|.
-
-Furthermore |\pic|\-|caption[]{|\ldots|}| produce no entry in the List of Figures,
-and |\pic|\-|caption*{|\ldots|}| gives an unlabeled \& unnumbered caption.
-
-\begin{Note}
-The |margin| resp.~|width| setting will not be used for these figures and tables.
-\iffalse
-if |pic|\-|caption|\-|side| or |pic|\-|caption|\-|top|\-|side| is used.
-The |width| setting will not be used (but the |margin| setting will) if
-|pic|\-|caption|\-|out|\-|side| or |pic|\-|caption|\-|in|\-|side| is used.
-\fi
-But you can override this by setting it explicit with
-|\caption|\-|setup[par|\-|pic]{|\ldots|}|.
-\end{Note}
-
-If you want to have a |\pic|\-|caption| of another type as |figure|, please
-do \emph{not} re-define |\@cap|\-|type| as suggested by the \package{picins}
-documentation. Please use the |\pic|\-|caption|\-|type|\marg{type} command
-which is offered by \thispackage\ instead, e.g.:
-\begin{quote}
- |\piccaptiontype{table}|\\
- |\piccaption{An example table}|\\
- |\parpic(50mm,10mm)[s]{|\ldots|}|
-\end{quote}
-
-\pagebreak[3]
-\subsection{rotating}
-\label{rotating}
-\packagedescription{%
-The \package{rotating} package\cite{rotating} offers the floating
-environments \texttt{side\-ways\-figure} and \texttt{side\-ways\-table} which
-are just like normal figures and tables but rotated by 90 resp.~270 degree.
-Furthermore a command \cs{rot\-caption} is offered for rotated captions only.}
-
-\iffalse % No, we don't do that
-If you want to setup special options for the |side|\-|ways|\-|figure| and
-|side|\-|ways|\-|table| environments you can use
-\begin{quote}
- |\captionsetup[sidewaysfigure]|\marg{options}\\
- |\captionsetup[sidewaystable]|\marg{options}\quad.
-\end{quote}
-These options will be executed additionally to the regular ones for
-|figure| or |table|.
-\fi
-
-The command |\rot|\-|caption| will be extended by \thispackage, so
-|\rot|\-|caption*| and |\rot|\-|caption|\-|of| can be used analogous to
-|\caption*| and |\caption|\-|of|.
-
-\pagebreak[3]
-\subsection{setspace}
-\label{setspace}
-\packagedescription{%
-The \package{setspace} package\cite{setspace} offers options and commands
-to change the spacing,
-e.g.\ \cs{usepackage}\x\csoarg{one\-half\-spacing}\x\csmarg{set\-space}
-causes the document to be typeset in one-and-a-half spacing.}
-
-If the \package{setspace} package is used in conjunction with \thispackage,
-the caption will be typeset with single spacing as default. This can be changed
-by specifying either |font=|\x|one|\-|half|\-|spacing|,
-|font=|\x|double|\-|spacing|, or |font={stretch=|\x\meta{amount}|}|.
-\See{also \Ref{fonts}}
-
-\pagebreak[3]
-\subsection{sidecap}
-\label{sidecap}
-\packagedescription{%
-The \package{sidecap} package\cite{sidecap} offers the floating environments
-\texttt{SC\-figure} and \texttt{SC\-table} which are like usual figures
-and tables but the caption will be put \emph{beside} the contents.}
-
-If you want to setup special options for the |SCfigure| and |SCtable|
-environments you can use
-\begin{quote}
- |\captionsetup[SCfigure]|\marg{options}\quad\emph{and}\\
- |\captionsetup[SCtable]|\marg{options}\quad.
-\end{quote}
-These options will be executed additionally to the regular ones for
-|figure| or |table|.
-
-\pagebreak[3]
-\begin{Note}
-The \package{sidecap} package offers its own options for justification.
-If set, they will override the one specified with the caption option
-|jus|\-|ti|\-|fi|\-|ca|\-|tion=| for captions beside their contents.
-\end{Note}
-
-\begin{Note}
-The |margin| resp.~|width| setting will not be used for these figures and tables,
-unless you set it explicit with |\caption|\-|setup[SC|\-|figure]{|\ldots|}|
-or |\caption|\-|setup[SC|\-|table]{|\ldots|}|.
-\end{Note}
-
-\medskip
-
-\begin{Annotation*}
-Instead of using the \package{sidecap} package you can also use the more
-powerful and flexible \package{floatrow} package\cite{floatrow} for typesetting
-captions beside the contents.
-\end{Annotation*}
-
-\pagebreak[3]
-\subsubsection*{Undocumented features}
-The \package{sidecap} package \version{1.6} has some undocumented package
-options and commands which allow further customization of the side-captions:
-
-\pagebreak[3]
-\DescribeMacro{margincaption}
-The package option
-\begin{quote}
- |margincaption|\qquad{\small(e.g.~|\usepackage[margincaption]{sidecap}|)}
-\end{quote}
-causes all side-captions to be placed into the margin.
-
-\pagebreak[3]
-\DescribeMacro{\sidecaptionvpos}
-The command
-\begin{quote}
- |\sidecaptionvpos|\marg{float type}\marg{pos}
-\end{quote}
-sets the vertical position of the side-caption. \meta{pos} can be either `|t|'
-(for top alignment), `|b|' (for bottom alignment), or `|c|' (for center alignment).
-The default setting for |table| is `|t|', for |figure| and all other ones
-defined with |\Declare|\-|Floating|\-|Environment| it's `|b|'.
-
-\pagebreak[3]
-\subsection{subfigure}
-\label{subfigure}
-\packagedescription{%
-The \package{subfigure} package\cite{subfigure} provides support for small or
-`sub' figures and tables within a single figure or table environment.
-This package is obsolete, new users should use \package{subfig} instead.}
-
-Since the \package{subfigure} package is obsolete it will only be supported in
-a way that old documents (which have used \thispackage\ \version{1.x} during
-development) should still compile as expected.
-
-Please use the \package{subfig} or \package{subcaption} package instead which both supports \thispackage\
-\version{3.x}.
-
-\See{the \package{subfig} package\cite{subfig} documentation for details.}
-
-\pagebreak[3]
-\subsection{supertabular and xtab}
-\label{supertabular}
-\packagedescription{%
-The \package{supertabular}\cite{supertabular} and \package{xtab}\cite{xtab}
-packages offer an environment which can span multiple pages and is quite
-similar to the \texttt{long\-table} environment provided by the
-\package{longtable} package\cite{longtable}.
-For a detailed discussion about the differences between these powerful
-packages please take a look at The \LaTeX\ Companion\cite{TLC2}.}
-
-If you want to setup special options for the |super|\-|tabular|
-resp.~|x|\-|tabular| environment you can use
-\begin{quote}
- |\captionsetup[supertabular]|\marg{options}\quad\emph{resp.}\\
- |\captionsetup[xtabular]|\marg{options}\quad.
-\end{quote}
-These options will be executed additionally to the regular ones for
-|table|.
-
-\begin{Note}
-|\Continued|\-|Float| does not work for |super|\-|tabular|s and |x|\-|tabular|s.
-\end{Note}
-
-\pagebreak[3]
-\subsection{threeparttable}
-\label{threeparttable}
-\packagedescription{%
-The \package{threeparttable} package\cite{threeparttable} provides a scheme
-for tables that have a structured note section after the table contents and
-the caption.
-This scheme provides an answer to the old problem of putting footnotes in
-tables---by making footnotes entirely unnecessary.}
-
-\NEWfeature{v3.1}
-If you want to setup special options for the |three|\-|part|\-|table| and
-|measured|\-|figure| environments you can use
-\begin{quote}
- |\captionsetup[threeparttable]|\marg{options}\quad\emph{and}\\
- |\captionsetup[measuredfigure]|\marg{options}\quad.
-\end{quote}
-These options will be executed additionally to the regular ones for
-|table| or |figure|.
-
-\begin{Note}
-Since the caption will have the same width as the contents here,
-the |margin| resp.~|width| setting will not be used for these figures and tables,
-at least unless you set it explicit with
-|\caption|\-|setup[three|\-|part|\-|table]{|\ldots|}| or
-|\caption|\-|setup[measured|\-|figure]{|\ldots|}|.
-\end{Note}
-
-\medskip
-
-\begin{Annotation*}
-Instead of using the \package{threeparttable} package you can
-also use the \package{floatrow} package\cite{floatrow} for this purpose.
-\end{Annotation*}
-
-\pagebreak[3]
-\subsection{wrapfig}
-\label{wrapfig}
-\packagedescription{%
-Similar to the \package{floatflt}, the \package{picinpar}, and the
-\package{picins} package the \package{wrapfig} package\cite{wrapfig} offers
-figures and tables which do not span the full width of a page and are float
-around by text.
-For a detailed discussion about the differences between these packages
-please take a look at The \LaTeX\ Companion\cite{TLC2}.}
-
-\NEWfeature{v3.1}
-If you want to setup special options for the |wrap|\-|figure| and
-|wrap|\-|table| environments you can use
-\begin{quote}
- |\captionsetup[wrapfigure]|\marg{options}\quad\emph{and}\\
- |\captionsetup[wraptable]|\marg{options}\quad.
-\end{quote}
-These options will be executed additionally to the regular ones for
-|figure| or |table|.
-
-\begin{Note}
-The |margin| resp.~|width| setting will not be used for these figures and
-tables, unless you set it explicit with
-|\caption|\-|setup[wrap|\-|figure]{|\ldots|}|
-or |\caption|\-|setup[wrap|\-|table]{|\ldots|}|.
-\end{Note}
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\section{Further reading}
-
-I recommend the following documents for further reading:
-
-\begin{itemize}
-\item
- The \TeX\ FAQ -- Frequently asked questions about \TeX\ and \LaTeX:
- \begin{quote}\url{http://faq.tug.org/}\end{quote}
-
-\item
- A French FAQ can be found at
- \begin{quote}\url{http://www.grappa.univ-lille3.fr/FAQ-LaTeX/}\end{quote}
-
-\item
- ``What is a minimal working example?'' from Christian Faulhammer and Ulrich Schwarz:
- \begin{quote}\url{http://www.minimalbeispiel.de/mini-en.html}\end{quote}
-
-\item
- \textsf{epslatex} from Keith Reckdahl contains many tips around
- including graphics in \LaTeXe\ documents.
- You will find this document in the directory
- \begin{quote}\url{http://mirror.ctan.org/info/epslatex/}\end{quote}
-\end{itemize}
-
-% --------------------------------------------------------------------------- %
-
-\pagebreak[3]
-\section{Thanks}
-
-I would like to thank Katja Melzner,
-Steven D. Cochran, Frank Mittelbach, Olga Lapko,
-David Carlisle, Carsten Heinz, Keith Reckdahl, Markus Kohm,
-Heiko Oberdiek, and Herbert Vo\ss.
-Thanks a lot for all your help, ideas, patience, spirit, and support!
-
-Also I would like to thank
-Harald Harders,
-Peter L\"offler,
-Peng Yu,
-Alexander Zimmermann,
-Matthias Pospiech,
-J\"urgen Wieferink,
-Christoph Bartoschek,
-Uwe St\"ohr,
-Ralf Stubner,
-Geoff Vallis,
-Florian Keiler,
-J\"urgen G\"obel,
-Uwe Siart,
-Sang-Heon Shim,
-Henrik Lundell,
-David Byers,
-William Asquith,
-Prof.~Dr.~Dirk Hoffmann,
-Frank Martini,
-Danie Els,
-Philipp Woock,
-Fadi Semmo,
-Matthias Stevens, and
-Leo Liu
-who all helped to make this package a better one.
-
-% --------------------------------------------------------------------------- %
-
-\clearpage\appendix
-\section{Alphabetical Reference}
-
-%\newenvironment{Warnings}%
-% {\begin{trivlist}%
-% \def\Message{\pagebreak[3]\leftskip=0pt\relax\item[]\color{blue}}%
-% \def\Description{\nopagebreak\par\nopagebreak\color{black}\leftskip=1.5em\nopagebreak}%
-% }%
-% {\color{black}\end{trivlist}}
-\makeatletter
-\newenvironment{Warnings}{%
- \newif\ifMessage
- \def\Message{%
- \ifMessage\end{minipage}\par\vspace\itemsep\pagebreak[3]\fi
- \begin{minipage}{\linewidth}%
- \setlength\parindent{0pt}%
- \setlength\parskip{\smallskipamount}%
- \setlength\leftskip{0pt}%
- \color{blue}%
- \Messagetrue}%
- \def\Description{%
- \par\color{black}\leftskip=1.5em}%
- \def\Or{\@testopt\@Or{or}}%
- \def\@Or[##1]{%
- \\{\small\color{black}\hspace{1.5em}\textit{-- ##1 --}}\\}%
-}{%
- \ifMessage\end{minipage}\par\fi
-}
-\makeatother
-
-\subsection{Options}
-%\enlargethispage{10ex}
-\newcommand\preambleoption{~%
- \begingroup\def\thefootnote{\fnsymbol{footnote}}%
- \footnotemark[2]%
- \endgroup}
-\newcommand\preambleoptiontext{%
- \begingroup\def\thefootnote{\fnsymbol{footnote}}%
- \footnotetext[2]{These options are only available in the preamble of the document.}%
- \endgroup}
-
-\begin{longtable*}{lll}
-Option & Short description & Section \\
-\hline
-\endhead
-|aboveskip| & sets the skip above caption & \ref{skips} \\
-|belowskip| & sets the skip below caption & \ref{skips} \\
-|compatibility|\preambleoption & force (non-)compatibility & \ref{compatibility} \\
-%|config| & & \ref{x} \\
-|figureposition|\preambleoption & gives a hint about the figure caption position & \ref{skips} \\
-|font|(|+|) & sets the font & \ref{fonts} \\
-|format| & sets the format & \ref{formats} \\
-\iffalse
-|FPlist| & To where the list entry of a FPfigure should link? & \ref{fltpage} \\
-|FPref| & To where a |\ref| to a FPfigure should link? & \ref{fltpage} \\
-\fi
-|hangindent| & sets the hang indention & \ref{margins} \\
-|hypcap| & selects `hypcap' feature & \ref{hyperref} \\
-|hypcapspace| & sets the distance between hyperlink and contents & \ref{hyperref} \\
-|indention| & sets the indention & \ref{margins} \\
-|justification| & sets the justification & \ref{justification} \\
-|labelfont|(|+|) & sets the font of the caption label & \ref{fonts} \\
-|labelformat| & sets the format of the caption label & \ref{formats} \\
-|labelsep| & sets the label separator & \ref{formats} \\
-|labelseparator| & --same as |labelsep|-- & \ref{formats} \\
-|list| & switches the entries in the List on or off & \ref{lists} \\
-|listformat| & sets the `List of Figure/Table' entry format & \ref{lists} \\
-|margin| & sets the margin & \ref{margins} \\
-|margin*| & sets the margin, but only if no width is set & \ref{margins} \\
-|maxmargin| & sets the max. margin & \ref{margins} \\
-|minmargin| & sets the min. margin & \ref{margins} \\
-|name| & sets the name of the current environment & \ref{names} \\
-|oneside| & selects the one-side mode & \ref{margins} \\
-|options| & executes the given option list & \\
-|parindent| & sets the paragraph indention & \ref{margins} \\
-|parskip| & sets the skip between paragraphs & \ref{margins} \\
-|position| & gives a hint about the caption position & \ref{skips} \\
-|singlelinecheck| & switches the single-line-check on or off & \ref{justification} \\
-%|size| & sets the size of font & \ref{x} \\
-|skip| & sets the skip between content and caption & \ref{skips} \\
-|strut| & switches the usage of |\strut|s on or off & \ref{formats} \\
-|style| & sets the caption style & \ref{style} \\
-%|style*| & sets the caption style & \ref{style} \\
-|subtype| & sets the sub-caption type & \phantom{t}--~\footnotemark \\
-|tableposition|\preambleoption & gives a hint about the table caption position & \ref{skips} \\
-|textfont|(|+|) & sets the font of the caption text & \ref{fonts} \\
-|textformat| & sets the format of the caption text & \ref{formats} \\
-|twoside| & selects the two-side mode & \ref{margins} \\
-|type| & sets the caption type \& places a hyperlink anchor & \ref{types} \\
-|type*| & sets the caption type only & \ref{types} \\
-|width| & sets a fixed caption width & \ref{margins} \\
-\end{longtable*}
-\preambleoptiontext
-\footnotetext{The option \texttt{subtype} is explained in the
- \package{subcaption} package documentation.}
-
-\nopagebreak\parbox[t]{\linewidth}{% prevent from page break
-\begin{Note*}
- Obsolete options are not listed here. See
- \Ref{caption1} and
- \Ref{caption2} for a list of these options.
-\end{Note*}}
-
-\pagebreak[3]
-\subsection{Commands}
-
-\begin{longtable*}{lll}
-Command & & Section \\
-\hline
-\endhead
-|\abovecaptionskip| & & \ref{skips} \\
-%|\AtBeginCaption| & & \ref{hooks} \\
-%|\AtEndCaption| & & \ref{hooks} \\
-|\belowcaptionskip| & & \ref{skips} \\
-|\caption| & & \ref{caption} \\
-|\caption*| & & \ref{caption} \\
-|\captionlistentry| & & \ref{captionlistentry} \\
-|\captionof| & & \ref{caption} \\
-|\captionof*| & & \ref{caption} \\
-|\captionsetup| & & \ref{captionsetup} \\
-|\captionsetup*| & & \ref{captionsetup} \\
-|\centerfirst| & & \ref{justification} \\
-|\centerlast| & & \ref{justification} \\
-|\clearcaptionsetup| & & \ref{captionsetup} \\
-|\clearcaptionsetup*| & & \ref{captionsetup} \\
-|\ContinuedFloat| & & \ref{ContinuedFloat} \\
-|\DeclareCaptionFont| & & \ref{declare} \\
-|\DeclareCaptionFormat| & & \ref{declare} \\
-|\DeclareCaptionFormat*| & & \ref{declare} \\
-|\DeclareCaptionJustification| & & \ref{declare} \\
-|\DeclareCaptionLabelFormat| & & \ref{declare} \\
-|\DeclareCaptionLabelSeparator| & & \ref{declare} \\
-|\DeclareCaptionLabelSeparator*| & & \ref{declare} \\
-|\DeclareCaptionListFormat| & & \ref{declare} \\
-|\DeclareCaptionOption| & & \ref{declare} \\
-|\DeclareCaptionStyle| & & \ref{declare} \\
-|\DeclareCaptionSubType| & & --~\footnotemark \\
-|\DeclareCaptionTextFormat| & & \ref{declare} \\
-|\showcaptionsetup| & & \ref{captionsetup} \\
-\end{longtable*}
-\footnotetext{\cs{DeclareCaptionSubType} is explained in the
- \package{subcaption} package documentation.}
-
-\clearpage
-\subsection{Warnings}
-
-\begin{Warnings}
-
-\Message
- |\caption outside box or environment.|
-\Or
- |\captionsetup{type=...} outside box or environment.|
-\Or
- |\captionsetup{type*=...} or \captionof outside box|\\
- | or environment.|
-\Description
- You have placed a |\caption|, |\caption|\-|of|, or
- |\caption|\-|setup{type=|\x\meta{type}|}| command outside an box, group,
- or environment.
- You should not do this since it could cause some bad side-effects.
- \par\See{\Ref{types} and \Ref{caption}}
-
-\Message
- |\caption will not be redefined since it's already|\\
- |redefined by a document class or package which is|\\
- |unknown to the caption package.|
-\Description
- If \thispackage\ detects that some (unknown) document class or
- package has enhanced |\caption|, it will not redefine
- |\caption|, too, since this would simply kill the enhancement.
- As a result some features, like |\caption*|, |\Continued|\-|Float|,
- using the optional argument of |\caption|\-|setup|,
- or the options |list=| and |hypcap=| will not be available.\par
- If you don't care about the original enhancements but would
- like to use the full range of features of \thispackage\ instead
- you can give the unsupported(!) option |compatibility=|\x|false|
- a try and keep your fingers crossed.
- (But you will get the next warning instead.)
- \par\See{\Ref{classes} and \Ref{compatibility}}
-
-\Message
- |Forced redefinition of \caption since the|\\
- |unsupported(!) package option `compatibility=false'|\\
- |was given.|
-\Description
- Since you were so keen to specify the option |compatibility=|\x|false|
- \thispackage\ will try to do its best to fulfill your wishes.
- But depending on the document class or other packages you use that
- can end in non-functional features or even errors. So keep your
- fingers crossed!
- \par\See{\Ref{compatibility}}
-
-\Message
- |Hyperref support is turned off because hyperref has|\\
- |stopped early.|
-\Description
- If the \package{hyperref} package stops early during loading
- (because of what-ever reason), the \package{hyperref} support of
- \thispackage\ will not be available. As a result you could get
- \package{hyperref} warnings and non-functional hyperlinks to figures
- or tables.
- \par\See{\Ref{hyperref}\,}
-
-\Message
- |Ignoring optional argument [|\meta{pos}|] of \setcapwidth.|
-\Description
- \Thispackage\ tries to emulate the \KOMAScript\ commands regarding
- captions as best as it can. But the optional argument of the
- \KOMAScript\ command |\setcapwidth| is not (yet) working if you use
- this package, so if you try to use it anyway, you will get this warning.
- \par\See{\Ref{KOMA}}
-
-\Message
- |Internal Warning: |\meta{warning message}|.|
-\Description
- You should never see this warning, either you use a package which redefines
- |figure| or |table| and which is unknown to \thispackage, or this is a bug
- in \thispackage.
- Please send me an e-mail reporting this issue.
-
-\Message
- |\label without proper \caption|
-\Description
- Regarding |\label| the floating environments behave differently than its
- non-floating counterparts: The internal reference will not be generated
- at the beginning of the environment, but at |\caption| instead.
- So you have to place the |\label| command either just \emph{after} or
- \emph{inside} the caption text (mandatory argument of |\caption|).
-
-\Message
- |Option `|\meta{option}|' was not in list `|\meta{option list}|'.|
-\Description
-%\showhyphens{position}
- If you try to remove a specific option of an option list,
- for example with |\clear|\-|caption|\-|setup[po|\-|si|\-|tion]{table}|,
- and this option can not be found inside the option list, you will
- get this warning. If this is not because of a typo and you would like
- to suppress this warning, use |\clear|\-|caption|\-|setup*| instead of
- |\clear|\-|caption|\-|setup|.
- \par\See{\Ref{captionsetup}}
-
-\Message
- |Option list `|\meta{option list}|' undefined.|
-\Description
-%\showhyphens{format}
- If you try to remove a specific option of an option list,
- for example with |\clear|\-|caption|\-|setup[for|\-|mat]{figure}|,
- and this option list is not defined (yet), you will
- get this warning. If this is not because of a typo and you would like
- to suppress this warning, use |\clear|\-|caption|\-|setup*| instead of
- |\clear|\-|caption|\-|setup|.
- \par\See{\Ref{captionsetup}}
-
-\Message
- |Obsolete option `ignoreLTcapwidth' ignored.|
-\Description
- The \package{caption2} package option |ignoreLTcapwidth| will not be
- emulated by this version of \thispackage, usually you can simply wipe it
- away.
- \par\See{\Ref{caption2} and \Ref{longtable}}
-
-\Message
- |`ragged2e' support has been changed. Rerun to get|\\
- |captions right.|
-\Description
- The \package{ragged2e} package will only be loaded by \thispackage\ if it
- is actually needed.
- At least two \LaTeX\ runs are needed for that, so on the first run you could
- get this warning.
- Just compile your document again and this warning should go away.
- \par\See{\Ref{justification}}
-
-\Message
- |Reference on page |\meta{page no.}| undefined.|
-\Description
- If you use a |twoside| page layout, \thispackage\ needs to track the
- page numbers to get the margins right.
- At least two \LaTeX\ runs are needed for that, on the first run you could get
- this warning.
- Just compile your document again and this warning should go away.
- \par\See{\Ref{margins}}
-
-\Message
- |The caption type was already set to `|\meta{type}|'.|
-\Description
- This warning informs you about mixed caption options. For example if
- you use a |\caption|\-|setup{type=|\x|table}| or
- |\caption|\-|of{table}{|\ldots|}| inside a |figure| environment,
- this would result in using both option sets for that specific caption,
- the one for |figure| (specified with |\caption|\-|setup[figure]{|\ldots|}|)
- and the one for |table| (specified with |\caption|\-|setup[table]{|\ldots|}|)
- as well.\par
- {\small(You can suppress this warning by using the starred form
- |\caption|\-|setup*{type=|\x\ldots|}|.)\par}
- \par\See{\Ref{captionsetup}}
-
-\Message
- |The option `hypcap=true' will be ignored for this|\\
- |particular \caption.|
-\Description
- \Thispackage\ hasn't found a proper hyperlink anchor for this particular
- caption, so it decides to ignore the setting |hypcap=|\x|true| (which is set by
- default). As a result a link to this caption (e.g.~in the List of Figures,
- or set by |\ref| or |\auto|\-|ref|) will link you to the caption of the figure
- or table, not to the figure or table itself.\par
- This can happen if you use |\caption|\-|of| inside a non-floating environment,
- but also if you use some package which redefines |figure| or |table|, and
- which is unknown to \thispackage.\par
- If this is ok for you but you want to suppress this warning, simply place a
- |\caption|\-|setup{hyp|\-|cap=|\x|false}| just before the |\caption| or
- |\caption|\-|of| command which is causing the warning.
- If this is not ok for you, you can set a hyperlink anchor with
- |\caption|\-|setup{type=|\x\meta{float type}|}| for yourself.
- \par\See{\Ref{hyperref}\,}
-
-\Message
- |Unsupported document class (or package) detected,|\\
- |usage of the caption package is not recommended.|
-\Description
- Either the document class you use is unknown to \thispackage, or you
- have included a package in your document which redefines |\@make|\-|caption|
- (which is responsible for typesetting the caption internally) as well.
- This means \thispackage\ will either change the design of captions in an
- unwanted way, or it even refuses to work correctly at all.
- \par\See{\Ref{classes} and \Ref{compatibility}}
-
-\Message
- |Unused \captionsetup[|\meta{type}|].|
-\Description
- You have specified options with |\caption|\-|setup[|\meta{type}|]| which are
- not used later on.
- This can be because of a typo in \meta{type},
- or because you use a package which redefines |figure| or |table| and
- which is unknown to \thispackage, or simply because you don't have any usage
- of the environment \meta{type} after this line.
- (If you want to suppress this warning you can use |\caption|\-|setup*|
- instead of |\caption|\-|setup|.)
- \par\See{\Ref{captionsetup}}
-
-\Message
- |Usage of the |\meta{package}| package together with the|\\
- |caption package is strongly not recommended.|\\
- |Instead of loading the |\meta{package}| package you should|\\
- |use the caption package option `tableposition=top'.|
-\Description
- The package \meta{package} is dealing with caption skips as well.
- Please decide which one do you actually want to use, \thispackage\ or the
- other one, using both can lead to wrong skips above or below the caption.
- \par\See{\Ref{skips}}
-
-\end{Warnings}
-
-\pagebreak[3]
-\subsection{Errors}
-
-\begin{Warnings}
-
-\Message
- |Argument of \@caption has an extra }.|
-\Or
- |Paragraph ended before \@caption was complete.|
-\Description
- If you want to typeset something special (like a tabular) as caption,
- you need to give an optional argument to |\caption| resp.~|\caption|\-|of|
- for the List of Figures resp.~List of Tables, too, even if you don't
- use such list.
- \par\See{\Ref{caption}, \Ref{lists}, and \Ref{hyperref}\,}
-
-\Message
- |\caption outside float.|
-\Description
- You have placed a |\caption| command outside a floating environment, or
- a |long|\-|table| or |wrap|\-|figure|.
- If this is what you want to, please use either
- |\caption|\-|setup{type=|\x\meta{type}|}| $+$ |\caption| or
- |\caption|\-|of|.
- \par\See{\Ref{caption}}
-
-\Message
- |\ContinuedFloat outside float.|
-\Description
- You have placed a |\Continued|\-|Float| command outside a floating
- environment. % or |long|\-|table|.
- If this is what you want to, please use the combination
- |\caption|\-|setup{type=|\x\meta{type}|}| $+$ |\Continued|\-|Float|.\par
- Please note that |\Continued|\-|Float| inside a |long|\-|table| is not
- working, but maybe using the |long|\-|table*| environment, which
- typesets a |long|\-|table| without incrementing the |table| counter,
- if sufficient for you.
- \par\See{\Ref{ContinuedFloat} and \Ref{longtable}}
-
-\Message
- |Continued `|\meta{type}|' after `|\meta{type}|'.|
-\Description
- Continued figures or tables are not allowed to be interrupted by a floating
- environment (or |long|\-|table|) of another type,
- e.g.~a table between a figure and a continued figure.
- \par\See{\Ref{ContinuedFloat}}
-
-\Message
- |For a successful cooperation we need at least version|\\
- |`|\meta{date}|' of package |\meta{package}|, but only version|\\
- |`|\meta{old-date}|' is available.|
-\Description
- \Thispackage\ does not work with such an outdated package, please update it
- to a more recent version, at least to the one requested.
-
-\Message
- |Internal Error: |\meta{error message}|.|
-\Description
- You should never see this error.
- Please send me an e-mail reporting this issue.
-
-\Message
- |No float type '|\meta{type}|' defined.|
-\Description
- The \meta{type} you have specified in |\caption|\-|setup{type=|\x\meta{type}|}|,
- |\caption|\-|of|\marg{type}, or |\Declare|\-|Caption|\-|Sub|\-|Type| is
- not defined.
- \meta{type} should be either `\texttt{figure}' or `\texttt{table}', or
- any other floating environment defined with
- |\Declare|\-|Floating|\-|Environment| offered by the \package{newfloat} package,
- |\new|\-|float| offered by the \package{float} package\cite{float}, or
- |\Declare|\-|New|\-|Float|\-|Type| offered by the \package{floatrow} package\cite{floatrow}.
-
-\Message
- |Not allowed in longtable* environment.|
-\Description
- The usage of |\caption| is not allowed inside the |long|\-|table*| environment.
- Please use either |\caption*| for a caption without label or use the regular
- |long|\-|table| environment instead.
-
-\Message
- |Not available in compatibility mode.|
-\Description
- The feature required is not supported in compatibility mode.
- `compatibility mode' means that \thispackage\ has detected either an
- incompatible document class or an incompatible package which also
- extents the |\caption| command. Leaving the original extension intact,
- some features of \thispackage\ are not supported.
- \par\See{\Ref{compatibility}}
-
-\Message
- |Only one \caption can be placed in this environment.|
-\Description
- Inside the environments offered by the \package{fltpage} and \package{sidecap}
- package only \emph{one} caption can be placed. (This is due implementation design.)
-
-\Message
- |Option clash for package caption.|
-\Or[but sometimes also]
- |Missing \begin{document}.|
-\Description
- \Thispackage\ has already been loaded by some other \LaTeX\ package,
- so you can't do that again specifying different options.
- A candidate causing this could be the \package{subfig} package; if this is
- the case, please load \thispackage\ \emph{before} the \package{subfig}
- package or specify the option |caption=|\x|false| while loading the
- \package{subfig} package.
- \par\See{the \package{subfig} package\cite{subfig} documentation}
-
-\Message
- |Paragraph ended before \caption@makecurrent was complete.|
-\Or
- |Paragraph ended before \caption@prepareanchor was complete.|
-\Description
- If you want to typeset multi-paragraph captions, you need to give an
- optional argument to |\caption| resp.~|\caption|\-|of| for the List of
- Figures resp.~List of Tables, too, even if you don't use such list.
- \par\See{\Ref{caption}, \Ref{lists}, and \Ref{hyperref}\,}
-
-\Message
- |Something's wrong--perhaps a missing \caption|\\
- |in the last figure or table.|
-\Description
- It seems that you have used a |\sub|\-|caption| command (or a different one
- which has typeset a sub-caption) without a corresponding |\caption| command.
- This is not supported.
-
-\Message
- |The option `labelsep=|\meta{name}|' does not work|\\
- |with `format=hang'.|
-\Or
- |The option `labelsep=|\meta{name}|' does not work|\\
- |with \setcaphanging (which is set by default).|
-\Description
- A caption label separator which contains a |\\| command (like
- |labelsep=|\x|newline|) can not be combined with a hanging caption format
- (like |format=|\x|hang|).
- Please select either another caption label separator
- (e.g.~|labelsep=|\x|colon|) or another caption format
- (e.g.~|format=|\x|plain|).
- \par\See{\Ref{formats} resp.~\Ref{KOMA}}
-
-\Message
- |The package option `caption=false' is obsolete.|\\
- |Please pass this option to the subfig package instead|\\
- |and do *not* load the caption package anymore.|
-\Description
- You have specified the option |caption=|\x|false|. This used to be a workaround
- for not using the whole \package{caption} package (leaving the caption stuff
- offered by the document class or other packages intact), but keeping the
- \package{subfig} package working. This mechanism is obsolete and not offered
- anymore, please pass this option to the \package{subfig} package instead and
- do not load \thispackage\ anymore.
- \par\See{the \package{subfig} package\cite{subfig} documentation}
-
-\Message
- |Undefined boolean value `|\meta{value}|'.|
-\Description
- You tried to set a boolean option (like |singlelinecheck=| or |hypcap=|)
- with an improper value. Only |false|, |no|, |off|, |0| or |true|, |yes|,
- |on|, |1| is allowed here.
-
-\Message
- |Undefined format `|\meta{name}|'.|
-\Description
- You tried to set a caption format which does not exists.
- Maybe a typo!?
- \par\See{\Ref{formats}}
-
-\Message
- |Undefined label format `|\meta{name}|'.|
-\Description
- You tried to set a caption label format which does not exists.
- Maybe a typo!?
- \par\See{\Ref{formats}}
-
-\Message
- |Undefined label separator `|\meta{name}|'.|
-\Description
- You tried to set a caption label separator which does not exists.
- Maybe a typo!?
- \par\See{\Ref{formats}}
-
-\Message
- |Undefined list format `|\meta{name}|'.|
-\Description
- You tried to set a caption list-of format which does not exists.
- Maybe a typo!?
- \par\See{\Ref{lists}}
-
-\Message
- |Undefined position `|\meta{name}|'.|
-\Description
- You tried to set a caption position with an improper value.
- Maybe a typo!?
- \par\See{\Ref{skips}}
-
-\Message
- |Undefined style `|\meta{name}|'.|
-\Description
- You tried to set a caption style which does not exists.
- Maybe a typo!?
- \par\See{\Ref{style}}
-
-\Message
- |Usage of the `position' option is incompatible|\\
- |to the `|\meta{package}|' package.|
-\Description
-% (ftcap,nonfloat,topcapt)
- The given package is dealing with caption skips as well.
- Please decide which one do you actually want to use: The |position=| option
- of \thispackage\ or the mechanism of the other one; using both this way
- would lead to wrong skips above or below the caption and is therefore
- not supported.
- \par\See{\Ref{skips}}
-
-\Message
- |Undefined text format `|\meta{name}|'.|
-\Description
- You tried to set a caption text format which does not exists.
- Maybe a typo!?
- \par\See{\Ref{formats}}
-
-\Message
- |You can't use both, the (obsolete) caption2 *and*|\\
- |the (current) caption package.|
-\Description
- This error message says it all, you simply can't do that.
- Please use only \thispackage.
- \par\See{\Ref{caption2}}
-
-\end{Warnings}
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\section{Version history}
-\label{history}
-
-The version $1.0$ was written in 1994 and was offering a handful of options
-to customize the look \& feel of the captions.
-Furthermore this version already supported the \package{rotating} and
-\package{subfigure} packages.
-Version $1.1$ introduced the |center|\-|last| option;
-version $1.2$ added the support of the \package{float} package.
-Version $1,3$ offered a better support of the \package{subfigure} package,
-while version $1.4$ came with the new option |nooneline|.
-
-The \package{caption2} package $2.0$ was an experimental side-version of
-the regular \package{caption} package. It was made public as beta test version
-without proper documentation in 1995 because of the strong demand for new
-features and adaptations to additional packages like the \package{longtable}
-package.
-Furthermore it offered a revised support of the \package{subfigure} package.
-(An improved version $2.1$ was offered in 2002.)
-
-In 2003 I finally found some time, so a new regular release $3.0$
-of the \package{caption} package could be build in cooperation with
-Frank Mittelbach and Steven Cochran.
-It was released in December 2003 and superseded the neglected
-\package{caption2} package.
-Main parts were re-written and it provided a complete re-work of
-the user interface.
-Furthermore it supported the \package{hyperref}, \package{hypcap},
-\package{listings}, \package{sidecap}, and \package{supertabular} packages
-additionally.
-
-While all the previous versions were designed for usage with the standard
-\LaTeX\ document classes \class{article}, \class{report}, and \class{book},
-the current version $3.1$ released in 2007 also supports the \AmS,
-\KOMAScript, \NTG, and \SmF\ document classes, and the \class{beamer} class
-as well.
-Furthermore it was adapted to the \package{french} Babel option,
-the \package{frenchle} \& \package{frenchpro} packages,
-and the \package{floatflt}, \package{fltpage}, \package{picinpar},
-\package{picins}, \package{setspace}, \package{threeparttable},
-and \package{wrapfig} packages.
-New options and commands were introduced as well, among other things
-|font+|, |figure|\-|within| \& |table|\-|within|,
-|list| \& |list|\-|format|, |max|\-|margin| \& |min|\-|margin|,
-|\caption|\-|list|\-|entry|, |\Declare|\-|Caption|\-|List|\-|Format|.
-Further benefits are the new compatibility check \see*{\Ref{compatibility}},
-the new ``hypcap'' feature \see*{\Ref{hyperref}\,}, and the sub-caption
-feature \see*{\package{subcaption} package documentation}.
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\section{Compatibility to older versions}
-
-\subsection{caption v\texorpdfstring{$1.x$}{1.x}}
-\label{caption1}
-
-This version of \thispackage\ still supports the old options
-and commands provided by the version $1.0$ to $1.4$ of this package.
-So there shouldn't occur any problems compiling old documents, but please
-don't mix old options and commands with the new ones. This isn't supported
-and can cause ugly side effects.
-
-Here comes a short oversight of the obsolete options and how
-they have been replaced within this version of \thispackage:
-
-\begin{center}\small
-\begin{tabular}{ll}
-\package{caption} \version{1.x} & \package{caption} \version{3.x}\\
-\hline
-%\endhead
-|normal| & |format=plain|\\
-|hang| & |format=hang|\\
-|isu| & |format=hang|\\
-|center| & |justification=centering|\\
-|centerlast| & |justification=centerlast|\\
-|nooneline| & |singlelinecheck=off|\\
-|scriptsize| & |font=scriptsize|\\
-|footnotesize| & |font=footnotesize|\\
-|small| & |font=small|\\
-|normalsize| & |font=normalsize|\\
-|large| & |font=large|\\
-|Large| & |font=Large|\\
-|up| & |labelfont=up|\\
-|it| & |labelfont=it|\\
-|sl| & |labelfont=sl|\\
-|sc| & |labelfont=sc|\\
-|md| & |labelfont=md|\\
-|bf| & |labelfont=bf|\\
-|rm| & |labelfont=rm|\\
-|sf| & |labelfont=sf|\\
-|tt| & |labelfont=tt|\\
-\end{tabular}
-\end{center}
-
-Beside the options for setting up the desired font there were also
-the commands |\caption|\-|size| resp.~|\caption|\-|font| and
-|\caption|\-|label|\-|font| who could be redefined with
-|\re|\-|new|\-|command| and allowed an alternate and more flexible way to
-change the font used for captions.
-This mechanism was replaced by the commands
-\begin{quote}
- |\DeclareCaptionFont{|\ldots|}{|\ldots|}|\qquad and\\
- |\captionsetup{font=|\ldots|,labelfont=|\ldots|}|\qquad.
-\end{quote}
-\SeeUserDefined
-
-Setting the margin for captions was done in \version{1.x} with
-\begin{quote}
- |\setlength{\captionmargin}{|\ldots|}|\quad.
-\end{quote}
-This was replaced by
-\begin{quote}
- |\captionsetup{margin=|\ldots|}|\qquad.
-\end{quote}
-\See{\Ref{margins}}
-
-For example the old-style code
-\begin{quote}
- |\usepackage[hang,bf]{caption}|\\
- |\renewcommand\captionfont{\small\sffamily}|\\
- |\setlength\captionmargin{10pt}|
-\end{quote}
-will still work fine, but should be written today as
-\begin{quote}
- |\usepackage[format=hang,labelfont=bf,font={small,sf},|\\
- | margin=10pt]{caption}|
-\end{quote}
-or
-\begin{quote}
- |\usepackage{caption}|\\
- |\captionsetup{format=hang,labelfont=bf,font={small,sf},|\\
- | margin=10pt}|\qquad.
-\end{quote}
-
-The quite exotic option |ruled| which allowed a partial usage of
-the caption settings for |ruled| floats defined with the
-\package{float} package will be emulated by this version of the
-caption package, too.
-But using this option is not recommended anymore since this
-version of \thispackage\ offers a more flexible way
-for changing the captions of these floating environments:
-\begin{quote}
- |\DeclareCaptionStyle{ruled}{|\ldots|}|
-\end{quote}
-resp.
-\begin{quote}
- |\captionsetup[ruled]{|\ldots|}|\qquad.
-\end{quote}
-\SeeUserDefined[, \Ref{captionsetup}, and \Ref{float}]
-
-\subsection{caption2 v\texorpdfstring{$2.x$}{2.x}}
-\label{caption2}
-
-Although they do very similar stuff, the packages \package{caption} and
-its experimental and now obsolete variant \package{caption2} have a
-very different implementation design.
-Therefore a full compatibility could not be offered.
-For that reason you will still find a file called |caption2.sty| in
-this package distribution, so old documents using the \package{caption2}
-package will still compile fine.
-
-Newly created documents should use the actual version of
-\thispackage\ instead. In most cases it's sufficient to replace the command
-\begin{quote}
- |\usepackage[...]{caption2}|
-\end{quote}
-by
-\begin{quote}
- |\usepackage[...]{caption}|\qquad.
-\end{quote}
-But some options and commands will not be emulated, so you can get
-error messages afterwards. This section will hopefully help you removing
-these errors. If you have problems migrating from \package{caption2}
-to \package{caption} please don't hesitate to send me an e-mail asking
-for help.
-
-In addition to the obsolete options shown in the last section
-these ones will be emulated, too:
-
-\begin{center}\small
-\begin{tabular}{ll}
-\package{caption2} \version{2.x} & \package{caption} \version{3.x}\\
-\hline
-%\endhead
-|flushleft| & |justification=raggedright|\\
-|flushright| & |justification=raggedleft|\\
-|oneline| & |singlelinecheck=on|\\
-\end{tabular}
-\end{center}
-
-Setting the margin for captions was done in \version{2.x} with
-\begin{quote}\leavevmode\hbox{%
- |\setcaptionmargin{|\ldots|}| resp.
- |\setcaptionwidth{|\ldots|}|\quad.
-}\end{quote}
-This was replaced by
-\begin{quote}\leavevmode\hbox{%
- |\captionsetup{margin=|\ldots|}| resp.
- |\captionsetup{width=|\ldots|}|\quad.
-}\end{quote}
-\See{\Ref{margins}}
-
-Setting an indention was done in \version{2.x} with
-\begin{quote}
- |\captionstyle{indent}|\\
- |\setlength\captionindent{|\ldots|}|\quad.
-\end{quote}
-\pagebreak[3]
-This is now done with
-\nopagebreak[3]
-\begin{quote}
- |\captionsetup{format=plain,indention=|\ldots|}|\quad.
-\end{quote}
-
-The so-called single-line-check was controlled by the commands
-|\oneline|\-|captions|\-|false| (for switching the check off) and
-|\oneline|\-|captions|\-|true| (for switching the check on).
-This was replaced by
-|\caption|\-|setup{single|\-|line|\-|check=|\x|off}|
-resp.
-|\caption|\-|setup{single|\-|line|\-|check=|\x|on}|\quad.
-\See{\Ref{justification}}
-
-The commands
-\begin{quote}
- |\captionlabeldelim|, |\captionlabelsep|, |\captionstyle|,\\
- |\defcaptionstyle|, |\newcaptionstyle|, and |\renewcaptionstyle|
-\end{quote}
-do not have a simple replacement and therefore will not be emulated
-by this version of \thispackage. (So using them will
-cause error messages.) Rewriting such code is not always easy and
-straight-ahead, but by conscientious reading of this manual you should
-be able to find appropriate options and commands instead.
-
-\iffalse
-... (some examples)
-\fi
-
-The \version{2.x} option |ignore|\-|LT|\-|cap|\-|width| do not have a
-replacement, too.
-But in most cases you can simply drop using that option because
-in this version of \thispackage\ the value of |\LT|\-|cap|\-|width|
-will be ignored anyway (unless you set it to a different value than the
-default one which is |4in|).
-\See{\Ref{longtable}}
-
-\subsection{caption v\texorpdfstring{$3.0$}{3.0}}
-\label{caption3}
-
-%\NEWdescription{v3.1}
-\Thispackage\ \version{3.0} did not support any document classes
-other than the standard \LaTeX\ ones: \class{article}, \class{report},
-and \class{book}.
-Therefore the default settings used to be fixed, but now \thispackage{}
-supports more classes, therefore they are now set in dependence on the
-document class used.
-
-For example: While in \version{3.0} the default caption
-|jus|\-|ti|\-|fi|\-|ca|\-|tion| used to be always |jus|\-|ti|\-|fied|,
-it's now still |jus|\-|ti|\-|fied| when using one of the standard document
-classes, but |ragged|\-|right| will be used as default format when used
-with the \class{beamer} document class.
-
-%An easy way to select the `old' defaults---if desired---is using the option
-An easy way to select the `old' defaults is using the option
-|style=base| when loading \thispackage\ (or later on using |\caption|\-|setup|).
-
-\medskip
-
-Another new feature is the automatic check for compatibility; if an
-incompatibility will be found, a warning message will be issued and if a strong
-incompatibility was found some features of \thispackage\ will be disabled.
-Please note that only this check was added to \thispackage, so if you get
-such warning message, the previous versions of \thispackage\ were incompatible
-as well, but did not issued such warning, they were ``only'' having
-side-effects or causing problems.
-So these warnings only say that some bad side effects or problems could
-happen, but not that they actually will happen.
-Anyway, if you use \thispackage\ in such circumstances,
-you should use it with care.
-
-\bigskip
-
-\begin{Note*}
-\Thispackage\ \version{3.0} offered the option |caption=|\x|false|,
-which used to be a workaround for not using the whole \package{caption} package
-(leaving the caption stuff offered by the document class or other packages
-intact), but keeping the \package{subfig} package\cite{subfig} working.
-This mechanism is obsolete and not offered anymore, please pass this option
-to the \package{subfig} package instead and do not load \thispackage\ anymore.
-%\par\See{the \package{subfig} package documentation}
-\end{Note*}
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\section{Commands for document class authors}
-
-A document class could simply load the \package{caption} package instead
-of defining an own variant of |\@make|\-|caption|. However if the author decides
-not to do this -- for whatever reason -- there is a second option:
-
-\NEWfeature{v3.5}
-If a document class defines |\caption@document|\-|class|, an adaption to the
-\package{caption} package will be loaded as |caption-|\meta{documentclass}|.sto|
-if the \package{caption} kernel is loaded.
-The goal of this adaption file is changing the default settings of the
-\package{caption} package so simply loading it (without any package options)
-will not make any harm to the look at feel of the captions.
-This gives end-users the opportunity to fine-tune certain aspects of the
-appearance of captions by adding package options, without unwanted
-side-effects on other aspects of the appearance.
-
-In both cases the command |\Set|\-|Caption|\-|Default|
-could be used to adapt the \package{caption} package default values:
-
-\DescribeMacro{\SetCaptionDefault}
-The command
-\begin{quote}
- |\SetCaptionDefault*|\marg{option}\marg{default value}
-\end{quote}
-changes the default value for the option \meta{option}, for example:
-\begin{quote}
- |\SetCaptionDefault{format}{hang}|\\
- |\SetCaptionDefault{justification}{raggedright}|\\
- |\DeclareCaptionLabelSeparator{silly}{ +++ }|\\
- |\SetCaptionDefault{labelseparator}{silly}|
-\end{quote}
-This command is available for the options
- |box|,
- |font|,
- |format|,
- |justification|,
- |label|\-|font|,
- |label|\-|format|,
- |label|\-|separator|,
- |list|\-|format|,
- |margin|,
- |parbox|,
- |position|,
- |single|\-|line|\-|check|,
- |text|\-|font|,
- |text|\-|format|, and
- |width|.
-
-The starred variant only makes a difference when setting the default length
-of either |margin| or |width|, in this case it will use |\def| internally
-instead of |\edef| to store the value so the actual margin will be calculated
-when used (and not when set).
-
-\DescribeMacro{\SetCaptionFallback}
-The command
-\begin{quote}
- |\SetCaptionFallback|\marg{option}\marg{fallback value}
-\end{quote}
-changes the fallback value for the option \meta{option}, for example:
-\begin{quote}
- |\SetCaptionFallback{labelformat}{simple}|
-\end{quote}
-Currently only the pre-defined label format `original' uses a fallback
-value when |\fnum@|\meta{environment} is not defined for the current (floating)
-environment.
-
-\DescribeMacro{\AtCaptionPackage}
-The adaption file will be loaded when the \package{caption} kernel |caption3.sty|
-will be loaded so the given adaptions will be done for the \package{floatrow}
-and \package{subfig} packages even if the \package{caption} package isn't loaded.
-
-But some adaptions have to be done for the \package{caption} package,
-and for this reason the hook
-\begin{quote}|\AtCaptionPackage|\marg{code}\end{quote}
-is offered to authors of adaption files.
-The \meta{code} inside the hook will be executed right before the given package
-options will be evaluated.
-
-For example the adaption file for the \KOMAScript\ document classes
-uses |\At|\-|Begin|\-|Caption| to re-define the \package{caption} package
-options |figure|\-|position| and |table|\-|position| to issue a warning
-that using these options have little effect here.
-
-\DescribeMacro{\AfterCaptionPackage}
-The additional hook
-\begin{quote}|\AfterCaptionPackage|\marg{code}\end{quote}
-is offered to authors of adaption files as well.
-The \meta{code} inside the hook will be executed at the very end of the
-\package{caption} package.
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\section{Commands for babel language package authors}
-
-\NEWfeature{v3.5}
-\DescribeMacro{\caption@switchdefault}
-If the \package{caption3} kernel package is loaded, the command
-\begin{quote}|\caption@switchdefault|\marg{option}\marg{code with \#1}\marg{new value}\end{quote}
-is available which saves the old default value of the given option using
-\meta{code} and sets the new default value afterwards.
-
-\DescribeMacro{\caption@restoredefault}
-The command
-\begin{quote}|\caption@restoredefault|\marg{option}\marg{old value}\end{quote}
-restores the old default value which was stored in \meta{old value} before.
-
-Example:
-\begin{quote}
- |\DeclareCaptionLabelSeparator{french}{|\ldots|}|\\
- |\addto\extrasfrench{%|\\
- | \caption@switchdefault{labelseparator}{\babel@save #1}{french}}|\\
- |% Note: \caption@restoredefault isn't needed here|
-\end{quote}
-
-Another example:
-\begin{quote}
- |\caption@switchdefault{font}{\let\original@captionfont#1}{it}%|\\
- \ldots\\
- |\caption@restoredefault{font}{\original@captionfont}%|\\
-\end{quote}
-
-Since boths commands are defined with |\def| inside the \package{caption3}
-kernel, they could be pre-defined with
-\begin{quote}
- |\providecommand\caption@switchdefault[3]{}|\\
- |\providecommand\caption@restoredefault[2]{}|
-\end{quote}
-inside the babel language package so their existence doesn't need to be tested
-prior use.
-
-Additionally babel language packages should not re-define |\@make|\-|caption|
-if the \package{caption} package is loaded, i.e.~if |\caption@makecaption| is
-defined. (Unfortunately one cannot use the \LaTeX{} kernel command
-|\@if|\-|package|\-|loaded{caption}| here since it's only available in the
-document preamble.)
-
-Please note that code like
-\begin{quote}
- |\addto\extraswhatever{%|\\
- | \@ifundefined{caption@makecaption}{%|\\
- | \babel@save\@makecaption|\\
- | \let\@makecaption\my@makecaption|\\
- | }{%|\\
- | \caption@switchdefault{|\ldots|}{\babel@save #1}{|\ldots|}%|\\
- | }}|
-\end{quote}
-would be wrong since it mixes up the presence of the \package{caption3} kernel
-and the \package{caption} package.
-If the \package{caption3} kernel is loaded this does not mean that the
-\package{caption} package is loaded, too, and the latter one re-defines
-|\caption|, |\@caption|, and |\@make|\-|caption| while the \package{caption3}
-kernel does not re-define any of them, instead it only provides (default) values
-for the \package{caption}, \package{floatrow}, and \package{subfig} package.
-
-Currently there is build-in support for the following babel language options:
-|arabic|, |farsi|, |french|, |hungarian|, |latvian|, and |magyar|.
-This support could be deactivated by defining
-\begin{quote}
- |\def\caption@ifbabel@|\meta{package}|{false}|
-\end{quote}
-where \meta{package} is either |arabi|, |french|, |frenchle|, |hungarian|,
-or |latvian|.
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\begin{thebibliography}{99}
-
- \bibitem{TLC2}
- Frank Mittelbach and Michel Goossens:\\
- \newblock {\em The {\LaTeX} Companion (2nd.~Ed.)},\\
- \newblock Addison-Wesley, 2004.
-
- \bibitem{beamer}
- Till Tantau:\\
- \href{http://www.ctan.org/pkg/beamer}%
- {\emph{User Guide to the Beamer Class, Version 3.07}},\\
- March 11, 2007
-
- \bibitem{KOMAScript}
- Markus Kohm \& Jens-Uwe-Morawski:\\
- \href{http://www.ctan.org/pkg/koma-script}%
- {\emph{KOMA-Script -- a versatile \LaTeXe\ bundle}},\\
- 2007-01-09
-
- \bibitem{NTG}
- Victor Eijkhout:\\
- \href{http://www.ctan.org/pkg/ntgclass}%
- {\emph{An introduction to the Dutch \LaTeX\ document classes}},\\
- 3 September 1989
-
- \bibitem{algorithms}
- Rog\'erio Brito:\\
- \href{http://www.ctan.org/pkg/algorithms}%
- {\emph{Algorithms}},\\
- June 2, 2006
-
-\iffalse
- \bibitem{algorithm2e}
- Christophe Fiorio:\\
- \href{http://www.ctan.org/pkg/algorithm2e}%
- {\emph{algorithm2e.sty -- package for algorithms}},\\
- March 11, 2007
-\fi
-
- \bibitem{float}
- Anselm Lingnau:\\
- \href{http://www.ctan.org/pkg/float}%
- {\emph{An Improved Environment for Floats}},\\
- 2001/11/08
-
- \bibitem{floatflt}
- Mats Dahlgren:\\
- \href{http://www.ctan.org/pkg/floatflt}%
- {\emph{Welcome to the floatflt package}},\\
- 1998/06/05
-
- \bibitem{floatrow}
- Olga Lapko:\\
- \href{http://www.ctan.org/pkg/floatrow}%
- {\emph{The floatrow package documentation}},\\
- 2007/12/24
-
- \bibitem{fltpage}
- Sebastian Gross:\\
- \href{http://www.ctan.org/pkg/fltpage}%
- {\emph{Welcome to the beta test of fltpage package!}},\\
- 1998/11/13
-
- \bibitem{hyperref}
- Sebastian Rahtz \& Heiko Oberdiek:\\
- \href{http://www.ctan.org/pkg/hyperref}%
- {\emph{Hypertext marks in \LaTeX}},\\
- November 12, 2007
-
- \bibitem{hypcap}
- Heiko Oberdiek:\\
- \href{http://www.ctan.org/pkg/hypcap}%
- {\emph{The hypcap package -- Adjusting anchors of captions}},\\
- 2007/04/09
-
- \bibitem{listings}
- Carsten Heinz \& Brooks Moses:\\
- \href{http://www.ctan.org/pkg/listings}%
- {\emph{The Listings Package}},\\
- 2007/02/22
-
- \bibitem{longtable}
- David Carlisle:\\
- \href{http://www.ctan.org/pkg/longtable}%
- {\emph{The longtable package}},\\
- 2004/02/01
-
- \bibitem{picinpar}
- Friedhelm Sowa:\\
- \href{http://www.ctan.org/pkg/picinpar}%
- {\emph{Pictures in Paragraphs}},\\
- July 13, 1993
-
- \bibitem{picins}
- Joachim Bleser and Edmund Lang:\\
- \href{http://www.ctan.org/pkg/picins}%
- {\emph{PicIns-Benutzerhandbuch Version 3.0}},\\
- September~1992
-
- \bibitem{rotating}
- Sebastian Rahtz and Leonor Barroca:\\
- \href{http://www.ctan.org/pkg/rotating}%
- {\emph{A style option for rotated objects in \LaTeX}},\\
- 1997/09/26
-
- \bibitem{setspace}
- Erica M. S. Harris \& Geoffrey Tobin:\\
- \href{http://www.ctan.org/pkg/setspace}%
- {\emph{LaTeX Document Package ``setspace''}},\\
- 1 December 2000
-
- \bibitem{sidecap}
- Rolf Niepraschk \& Hubert G\"a\ss lein:\\
- \href{http://www.ctan.org/pkg/sidecap}%
- {\emph{The sidecap package}},\\
- 2003/06/06
-
- \bibitem{subfigure}
- Steven D. Cochran:\\
- \href{http://www.ctan.org/pkg/subfigure}%
- {\emph{The subfigure package}},\\
- 2002/07/02
-
- \bibitem{subfig}
- Steven D. Cochran:\\
- \href{http://www.ctan.org/pkg/subfig}%
- {\emph{The subfig package}},\\
- 2005/07/05
-
- \bibitem{supertabular}
- Johannes Braams and Theo Jurriens:\\
- \href{http://www.ctan.org/pkg/supertabular}%
- {\emph{The supertabular environment}},\\
- 2002/07/19
-
- \bibitem{threeparttable}
- Donald Arseneau:\\
- \href{http://www.ctan.org/pkg/threeparttable}%
- {\emph{Three part tables: title, tabular environment, notes}},\\
- 2003/06/13
-
- \bibitem{wrapfig}
- Donald Arseneau:\\
- \href{http://www.ctan.org/pkg/wrapfig}%
- {\emph{WRAPFIG.STY ver 3.6}},\\
- 2003/01/31
-
- \bibitem{xtab}
- Peter Wilson:\\
- \href{http://www.ctan.org/pkg/xtab}%
- {\emph{The xtab package}},\\
- 2004/05/24
-
-\end{thebibliography}
-
-% --------------------------------------------------------------------------- %
-
-\end{document}
-
diff --git a/Master/texmf-dist/source/latex/caption/caption-koma.dtx b/Master/texmf-dist/source/latex/caption/caption-koma.dtx
index 380a054df98..84f2f61d3fc 100644
--- a/Master/texmf-dist/source/latex/caption/caption-koma.dtx
+++ b/Master/texmf-dist/source/latex/caption/caption-koma.dtx
@@ -27,11 +27,10 @@
% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
-% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
-% and the user manuals
-% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty.
%
% \fi
+%
% \CheckSum{273}
%
% \iffalse
@@ -143,6 +142,7 @@
% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\kernel@ifnextchar}
% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
diff --git a/Master/texmf-dist/source/latex/caption/caption-light.dtx b/Master/texmf-dist/source/latex/caption/caption-light.dtx
index c56734a4142..697f8233ab9 100644
--- a/Master/texmf-dist/source/latex/caption/caption-light.dtx
+++ b/Master/texmf-dist/source/latex/caption/caption-light.dtx
@@ -2,7 +2,7 @@
%
% This is file `caption-light.dtx'.
%
-% Copyright (C) 2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+% Copyright (C) 2020-2021 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
%
% --------------------------------------------------------------------------
%
@@ -27,12 +27,11 @@
% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
-% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
-% and the user manuals
-% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty.
%
% \fi
-% \CheckSum{84}
+%
+% \CheckSum{99}
%
% \iffalse
%<*driver>
@@ -221,6 +220,7 @@
% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\kernel@ifnextchar}
% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
@@ -264,13 +264,13 @@
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption-light}[2020/08/24 v1.0 Customizing captions (AR)]
+\ProvidesPackage{caption-light}[2021/03/21 v1.0a Customizing captions (AR)]
% \end{macrocode}
%
% \section{Loading the kernel}
%
% \begin{macrocode}
-\RequirePackage{caption3}[2020/08/23] % needs v2.0 or newer
+\RequirePackage{caption3}[2020/08/30] % needs v2.0 or newer
% \end{macrocode}
%
% \section{Check against unknown document classes}
@@ -310,6 +310,7 @@
% \end{macrocode}
%
% \begin{macro}{\caption@makecaption}
+% \changes{v1.0a}{2021/03/21}{Support of \cs{ifcaption@star} and \cs{caption@@make@epilogue} added}
% |\@makecaption|\marg{label}\marg{text}\\
% We do basically the same as the original code (from the standard
% \LaTeX\ document classes), but take care of selected settings
@@ -327,15 +328,26 @@
\global \@minipagefalse
\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\fi
- \caption@iftop\caption@aboveskip\caption@belowskip}
+ \caption@iftop\caption@aboveskip\caption@belowskip
+ \caption@@make@epilogue}
% \end{macrocode}
% \begin{macrocode}
\newcommand\caption@@makecaption[2]{%
\caption@applyfont
- {\captionlabelfont #1}%
- {\caption@iflabelfont\captionlabelfont
- \relax\caption@labelsep}%
- {\captiontextfont #2}}
+ \ifcaption@star\else
+ \begingroup
+ \captionlabelfont #1\relax\relax
+ \endgroup
+ \fi
+ \ifcaption@star\else
+ \begingroup
+ \caption@iflabelfont\captionlabelfont
+ \relax\caption@labelsep
+ \endgroup
+ \fi
+ \begingroup
+ \captiontextfont #2%
+ \endgroup}
% \end{macrocode}
% \end{macro}
%
diff --git a/Master/texmf-dist/source/latex/caption/caption-memoir.dtx b/Master/texmf-dist/source/latex/caption/caption-memoir.dtx
index 1f29e68cb80..918669964ec 100644
--- a/Master/texmf-dist/source/latex/caption/caption-memoir.dtx
+++ b/Master/texmf-dist/source/latex/caption/caption-memoir.dtx
@@ -27,17 +27,16 @@
% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
-% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
-% and the user manuals
-% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty.
%
% \fi
-% \CheckSum{56}
+%
+% \CheckSum{66}
%
% \iffalse
%<*driver>
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesFile{caption-memoir.drv}[2020/10/10 v2.1 Implementation of the caption-memoir package]
+\ProvidesFile{caption-memoir.drv}[2020/10/10 v2.2 Implementation of the caption-memoir package]
\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
%\errorcontextlines=3
%
@@ -139,6 +138,7 @@
% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\kernel@ifnextchar}
% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
@@ -183,7 +183,7 @@
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesFile{caption-memoir.sto}[2020/10/10 v2.1 Adaption of the caption package to the memoir document class (AR)]
+\ProvidesFile{caption-memoir.sto}[2021/06/30 v2.2 Adaption of the caption package to the memoir document class (AR)]
% \end{macrocode}
%
% \section{Adaptions already included in the caption package}
@@ -201,11 +201,12 @@
%
% \section{Single-line-check}
%
-% \begin{macro}{\caption@prepareslc}
+% \begin{macro}{\pagenote}
% \changes{v1.4a}{2011/10/21}{Re-definition of \cs{pagenote} added}
% We re-define \cs{pagenote} here so it won't disturb the single-line-check.
% \begin{macrocode}
-\g@addto@macro\caption@prepareslc{%
+\providecommand*\AtCaptionSingleLineCheck{\g@addto@macro\caption@prepareslc} % for caption v3.5
+\AtCaptionSingleLineCheck{%
\let\pagenote\caption@gobble}
% \end{macrocode}
% \end{macro}
@@ -277,6 +278,10 @@
%
% \section{Vertical spaces before and after captions}
%
+% \begin{macrocode}
+\AtCaptionPackage{%
+% \end{macrocode}
+
% The \class{memoir} document classes uses |\above|\-|caption|\-|skip| and |\below|\-|caption|\-|skip|
% different than the standard document classes and the \package{caption} package:
% They always typeset |\above|\-|caption|\-|skip| before the caption and
@@ -286,7 +291,20 @@
% package is used, so no extra vertical space will be created.
%
% \begin{macrocode}
-\AtCaptionPackage{\setlength\belowcaptionskip{0pt}}
+ \setlength\belowcaptionskip{0pt}%
+% \end{macrocode}
+%
+% Furthermore we adapt the `auto' positioning algorithm to match the one implemented
+% in the \class{memoir} document class.
+% (Note: This needs at least \package{caption} \version{3.6}.)
+%
+% \begin{macrocode}
+ \@ifundefined{DeclareCaptionAutoPosition}{}{%
+ \DeclareCaptionAutoPosition{\ifdim\prevdepth>-99\p@#2\else#1\fi}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+}
% \end{macrocode}
%
% \section{TODO}
diff --git a/Master/texmf-dist/source/latex/caption/caption-ntg.dtx b/Master/texmf-dist/source/latex/caption/caption-ntg.dtx
index 97e0379f5f5..1285bbab926 100644
--- a/Master/texmf-dist/source/latex/caption/caption-ntg.dtx
+++ b/Master/texmf-dist/source/latex/caption/caption-ntg.dtx
@@ -27,11 +27,10 @@
% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
-% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
-% and the user manuals
-% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty.
%
% \fi
+%
% \CheckSum{8}
%
% \iffalse
@@ -141,6 +140,7 @@
% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\kernel@ifnextchar}
% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
diff --git a/Master/texmf-dist/source/latex/caption/caption-rus.tex b/Master/texmf-dist/source/latex/caption/caption-rus.tex
deleted file mode 100644
index 2082c375f04..00000000000
--- a/Master/texmf-dist/source/latex/caption/caption-rus.tex
+++ /dev/null
@@ -1,6226 +0,0 @@
-%
-% This is file `caption-rus.tex'.
-% Russian translation of `caption-eng.tex'
-%
-% Copyright (C) 1994-2007 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
-%
-% --------------------------------------------------------------------------
-%
-% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
-% of this license or (at your option) any later version.
-% The latest version of this license is in
-% http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
-% version 2003/12/01 or later.
-%
-% This work has the LPPL maintenance status "maintained".
-%
-% This Current Maintainer of this work is Axel Sommerfeldt.
-%
-% This work consists of the files caption.ins, caption.dtx, caption2.dtx,
-% ltcaption.dtx, and subcaption.dtx, the derived files caption.sty,
-% caption2.sty, caption3.sty, ltcaption.sty, and subcaption.sty, and the
-% user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex.
-%
-\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesFile{caption-rus.tex}[2008/04/06 v3.1h The caption package in Russian]
-\hbadness=9999 \newcount\hbadness \hfuzz=20pt % Make TeX shut up.
-%\errorcontextlines=3
-
-\documentclass[USenglish,russian,a4paper]{ltxdoc}
-\usepackage{mathtext}
-\usepackage[T2A]{fontenc}
-\usepackage[cp1251]{inputenc}
-\usepackage{babel}
-\usepackage{listpen,afterpage}
-
-\setlength\parindent{0pt}
-\setlength\parskip{\smallskipamount}
-\setlength\leftmargini{1.5em}% default = 2.5em
-\makeatletter
-\g@addto@macro\MacroFont{\normalcolor}
-\@flushglue = 1em plus 1fil
-\parfillskip = 1em plus 1fil
-\makeatother
-
-\newcommand\LineBreak{\linebreak[3]}
-\newcommand\PageBreak{\pagebreak[3]}
-\usepackage{ifpdf}
-\ifpdf
- \usepackage{mathptmx}
- \addtolength\marginparwidth{15pt}
- \IfFileExists{literat.sty}{\usepackage{literat}}{}
-% \IfFileExists{t2aftx.fd}{\def\sfdefault{ftx}}{}
-% \IfFileExists{t2apxtt.fd}{\def\ttdefault{pxtt}}{}
- \ifdim\paperheight=297mm % a4paper
- \advance\textheight.5in
- \advance\topmargin-.35in
- \emergencystretch1em
- \tolerance7000
- \renewcommand\LineBreak{\\}
- \renewcommand\PageBreak{\clearpage}
- \fi
-\fi
-
-\usepackage[bottom]{footmisc}
-\usepackage{graphicx,longtable,setspace}
-
-\usepackage{hypdoc}
-\hypersetup{unicode}
-\ifpdf\usepackage{hypdestopt}\fi
-\hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}}
-\hypersetup{breaklinks=true}
-
-\usepackage[listof=0,hypcap=false]{caption}[2008/04/01]
-
-\def\itemautorefname {\cyr\cyrp.}%
-\def\figureautorefname {\cyr\cyrr\cyri\cyrs.}%
-\def\tableautorefname {\cyr\cyrt\cyra\cyrb\cyrl.}%
-\def\partautorefname {\cyr\cyrch.}%
-\def\appendixautorefname {\cyr\cyrp\cyrr\cyri\cyrl.}%
-\def\chapterautorefname {\cyr\cyrg\cyrl.}%
-\def\sectionautorefname {\cyr\cyrr\cyra\cyrz\cyrd.}%
-\def\subsectionautorefname {\cyr\cyrr\cyra\cyrz\cyrd.}%
-\def\subsubsectionautorefname {\cyr\cyrr\cyra\cyrz\cyrd.}%
-\def\paragraphautorefname {\cyr\cyrp.}%
-\def\subparagraphautorefname {\cyr\cyrp.}%
-\def\pageautorefname {\cyr\cyrs.}%
-
-\DeclareRobustCommand*\eTeX{\texorpdfstring
- {\leavevmode\hbox{$\varepsilon$}-\TeX}%
- {e-TeX}}
-\DeclareRobustCommand*\AmS{\texorpdfstring
- {{\protect\usefont{OMS}{cmsy}{m}{n}A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}%
- {AMS}}
-\DeclareRobustCommand*\KOMAScript{\texorpdfstring
- {\textsf{K\kern.05em O\kern.05em M\kern.05em A\kern.1em-\kern.1em Script}}%
- {KOMA-Script}}
-\DeclareRobustCommand*\NTG{NTG}
-\DeclareRobustCommand*\SmF{SMF}
-
-\usepackage{marvosym}
-\makeatletter
-\newcommand*\INFO{\@ifstar{\@INFO{}}{\@INFO{\vbox to \ht\strutbox}}}
-\newcommand*\@INFO[1]{\MARGINSYM{#1{\hspace*{-1em}\LARGE\Info\hspace*{1em}}}}
-\makeatother
-
-\newcommand*\MARGINSYM[1]{\hskip 1sp \marginpar{\raggedleft\textcolor{blue}{{#1}}}}
-\newcommand*\NEW[2]{}%\hskip 1sp \marginpar{\footnotesize\sffamily\raggedleft#1\\#2}}
-
-% \ContinuedFloat
-\DeclareCaptionLabelFormat{continued1e}{Continued #1~#2}
-\DeclareCaptionLabelFormat{continued1r}{#1~#2 (\textit{ïðîäîëæåíèå})}
-\DeclareCaptionLabelFormat{continued2}{#1~#2\asbuk{ContinuedFloat}}
-% \DeclareCaptionLabelFormat
-\DeclareCaptionLabelFormat{bf-parens}{(\textbf{#2})}
-% \DeclareCaptionStyle
-\DeclareCaptionStyle{mystyle}[margin=5mm,justification=centering]%
- {font=footnotesize,labelfont=sc,margin={10mm,0mm}}
-% Example 1
-\DeclareCaptionFormat{myformat1}{#1#2\\#3}
-\newlength\myindention
-\DeclareCaptionFormat{myformat2}{#1#2\\\hspace*\myindention#3}
-\DeclareCaptionOption{myindention}{\setlength\myindention{#1}}
-% Example 2
-\DeclareCaptionFormat{reverse}{#3#2#1}
-\DeclareCaptionLabelFormat{fullparens}{(\bothIfFirst{#1}{~}#2)}
-\DeclareCaptionLabelSeparator{fill}{\hfill}
-% Example 3
-\DeclareCaptionFormat{llap}{\llap{#1#2}#3\par}
-\DeclareCaptionFormat{llapx}{\llap{\makebox[5em][l]{#1}}#3\par}
-% Example 4
-\DeclareCaptionLabelFormat{andtable}{#1~#2 \& \tablename~\thetable}
-
-\newcommand*\purerm[1]{{\upshape\mdseries\rmfamily #1}}
-\newcommand*\puresf[1]{{\upshape\mdseries\sffamily #1}}
-\newcommand*\purett[1]{{\upshape\mdseries\ttfamily #1}}
-\let\class\puresf \let\package\puresf
-
-\newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
-\newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
-\newcommand*\version[2][]{$v#2$}
-\newcommand*\x{\discretionary{}{}{}}
-
-\newenvironment{Annotation}%
- {\ifvmode\else\unskip\par\fi\pagebreak[2]%
- \smallskip
- \small(\ignorespaces}{\unskip)\par}
-\newenvironment{Annotation*}%
- {\ifvmode\else\unskip\par\fi\pagebreak[2]%
- \small(\ignorespaces}{\unskip)\par}
-
-\newenvironment{Example}%
- {\ifvmode\else\unskip\par\fi\pagebreak[2]%
- \minipage{\linewidth}\smallskip}%
- {\smallskip\endminipage\par}
-
-\makeatletter
-\newcommand\example{\@ifstar
- {\@example{belowskip=\abovecaptionskip}}%
- {\@example{}}}
-\def\@example#1{%
- \@testopt{\@@example{#1}}{figure}}
-\long\def\@@example#1[#2]#3#4{%
- \begingroup
- \captionsetup{#1,size=small,margin={\leftmargini,10pt},#3}%
- \captionof{#2}[]{#4}%
- \endgroup}
-\makeatother
-
-\newenvironment{Expert}%
- {\ifvmode\else\unskip\par\fi\pagebreak[3]%
- \smallskip
- \footnotesize\ignorespaces}{\par}
-\newenvironment{Expert*}%
- {\ifvmode\else\unskip\par\fi\pagebreak[3]%
- \footnotesize\ignorespaces}{\par}
-
-\newenvironment{Note}[1][\DefaultNoteText]%
- {\ifvmode\else\unskip\par\fi
- \smallskip
- \small\emph{#1}:~\ignorespaces}{\par}
-\newenvironment{Note*}[1][\DefaultNoteText]%
- {\ifvmode\else\unskip\par\fi
- \small\emph{#1}:~\ignorespaces}{\par}
-
-\newenvironment{Options}[1]%
- {\list{}{\renewcommand\makelabel[1]{\texttt{##1}\hfil}%
- \settowidth\labelwidth{\texttt{#1\space}}%
- \setlength\leftmargin{10pt}%
- \addtolength\leftmargin{\labelwidth}%
- \addtolength\leftmargin{\labelsep}}}%
- {\endlist}
-
-\makeatletter
-\def\Ref{\@ifstar{\@Ref\ref}{\@Ref\autoref}}
-\def\@Ref#1#2{#1{#2}: \textit{\nameref{#2}}}
-\newcommand*\SEE[3][]{\nopagebreak{#1(#2 #3)}}
-\newcommand*\SeeUserDefined[1][]{\See{\Ref{declare}#1}}
-\makeatother
-
-\begin{document}
-\let\subsectionautorefname\sectionautorefname
-\let\subsubsectionautorefname\sectionautorefname
-
-\def\thispackage{ïàêåò \package{caption}}
-\def\Thispackage{Ïàêåò \package{caption}}
-
-\newcommand*\DefaultNoteText{Çàìå÷àíèå}
-% \newcommand\NEWfeature{\NEW{New feature}}
-% \newcommand\NEWdescription{\NEW{New description}}
-\newcommand\NEWfeature{\NEW{Íîâàÿ âîçìîæíîñòü}}
-\newcommand\NEWdescription{\NEW{Íîâîå îïèñàíèå}}
-\makeatletter
-\newcommand*\See{\@ifstar{\SEE{Ñì.}}{\SEE[\small]{Ñì.}}}
-\newcommand*\see{\@ifstar{\SEE{ñì.}}{\SEE[\small]{ñì.}}}
-
-% --------------------------------------------------------------------------- %
-
-\GetFileInfo{caption-rus.tex}
-\let\docdate\filedate
-\GetFileInfo{caption.sty}
-
-% \title{Customizing captions of floating environments
-% using the caption package\texorpdfstring{\thanks{%
-% This package has version number \fileversion,
-% last revised \filedate.
-\title{Íàñòðîéêà ïîäïèñåé ïëàâàþùèõ îáúåêòîâ (ôëîòîâ) ñ~ïîìîùüþ ïàêåòà
- \package{caption}\thanks{Äàííûé ïàêåò âåðñèè
-%%% \fileversion, ïîñëåäíèé ðàç ìîäèôèöèðîâàí \filedate.
- v3.1m, ïîñëåäíèé ðàç ìîäèôèöèðîâàí 2010/01/09.
-%^^A% Translation of the version v3.1h, dated 2008/04/03.
-%^^A% The questions and notes about translation please
-%^^A% send to \texttt{Lapko.O@g23.relcom.ru} (Olga Lapko).
-%^^A% The version of translation could be obsolete. Please
-%^^A% look English or German documentation for the new information
-%^^A% (see margin labels).}}
- Ïåðåâîä äîêóìåíòàöèè v3.1h, äàòèðîâàííîé 2008/04/03.
- Âîïðîñû è~çàìå÷àíèÿ ïî ïåðåâîäó íàïðàâëÿéòå ïî àäðåñó \texttt{Lapko.O@g23.relcom.ru}.
- \emph{Âåðñèÿ ïåðåâîäà ìîæåò îòíîñèòüñÿ ê~îäíîé èç ïðåäûäóùèõ âåðñèé ïàêåòà è~ìîæåò
- ñîäåðæàòü óñòàðåâøèå äàííûå.
- Îáðàùàéòåñü ê~àíãëèéñêîé èëè íåìåöêîé äîêóìåíòàöèè çà áîëåå ñâåæåé èíôîðìàöèåé
- (îáðàùàéòå âíèìàíèå íà ïîìåòêè íà ïîëÿõ).
- }}{}}
-% \author{Axel Sommerfeldt\\
-\author{Àêñåëü Çîììåðôåëüäò (Axel Sommerfeldt)\\
- \url{https://gitlab.com/axelsommerfeldt/caption}}
-\date{\docdate}
-\maketitle
-
-% --------------------------------------------------------------------------- %
-
-\begin{abstract}
-% \Thispackage\ offers customization of captions
-% in floating environments such |figure| and |table| and cooperates with
-% many other packages.
-% \par\smallskip
- \Thispackage\ ïðåäëàãàåò íàñòðîéêè ïå÷àòè
- ïîäïèñåé äëÿ ïëàâàþùèõ îáúåêòîâ (ôëîòîâ)
- |figure| è~|table| è~ñîâìåñòèì (êîîïåðèðóåòñÿ)
- ñî~ìíîãèìè ïàêåòàìè.
-% \textit{Please note:} Many document classes already have build-in options and
-% commands for customizing captions.
-% If these possibilities are sufficient for you, there is usually no need for
-% you to use the \package{caption} package at all.
-% And if you are just interested in using the command \cs{captionof}, loading of
-% the very small \package{capt-of} package is usually sufficient.
-\par\smallskip
-\textit{Îáðàòèòå âíèìàíèå}: ìíîæåñòâî êëàññîâ äîêóìåíòîâ óæå èìåþò âñòðîåííûå îïöèè
-è~êîìàíäû äëÿ íàñòðîéêè ïîäïèñåé.
-Åñëè ýòè íàñòðîéêè âàñ óäîâëåòâîðÿþò, òî âîâñå íåò íåîáõîäèìîñòè â~èñïîëüçîâàíèè ïàêåòà
-\package{caption}.
-Åñëè âàì íóæíà òîëüêî êîìàíäà \cs{captionof} \cdash--- çàãðóçêà íåáîëüøîãî ïàêåòà
-\package{capt-of} áóäåò äîñòàòî÷íà.
-\end{abstract}
-
-\newcommand\exampletext{%
-% White sand beaches. The pink smoothness of the conch shell. A sea abundant
-% with possibilities. Duty-free shops filled with Europe's finest gifts and
-% perfumes. Play your favorite game of golf amidst the tropical greens on one
-% of the many championship courses.}
- Òèáåòñêàÿ ìàíäàëà ïðåäñòàâëÿåò ñîáîé ñâîåîáðàçíóþ êàðòó îñîáîãî õðàìà
- è~Øàìáàëû. Âèäíû âîðîòà ïî ÷åòûð¸ì ñòîðîíàì ñâåòà, ïîñòðîéêà èä¸ò
- óñòóïàìè ââåðõ. (Ìîçàèêà ïîëà ðûöàðñêîãî õðàìà íà î.\,Ðîäîñ âîñïðîèçâîäèò
- óçîð ìàíäàëû.)}
-
-% --------------------------------------------------------------------------- %
-
-% \section*{Introduction}
-\section*{Ââåäåíèå}
-
-% Within the standard \LaTeX\ document classes captions haven't received the
-% attention they deserve. Simply typeset as an ordinary paragraph there is no
-% remarkable visual difference from the rest of the text, like here:
-Âíóòðè ñòàíäàðòíûõ êëàññîâ \LaTeX'à~ïîäïèñè íå ïîëó÷èëè çàñëóæåííîãî
-âíèìàíèÿ. Îíè íàáèðàþòñÿ êàê îáû÷íûé àáçàö è~âíåøíå íå îòëè÷àþòñÿ îò îñíîâíîãî
-òåêñòà, êàê çäåñü:
-
-\example*{size=normalsize,margin=0pt}{\exampletext}
-
-% There should be possibilities to change this; for example, it would be nice
-% to make the text of the caption a little bit smaller as the normal
-% text, add an extra margin, typeset the caption label with the same font
-% family and shape as your headings etc. Just like this one:
-Äîëæíà áûòü âîçìîæíîñòü èçìåíèòü ýòî; íàïðèìåð, òåêñò ëó÷øå çàäàòü
-ìåíüøèì êåãëåì, äîáàâèòü âòÿæêó (ñ~îáåèõ ñòîðîí),
-ó~íóìåðàöèîííûõ çàãîëîâêîâ ïîäïèñåé çàäàòü òàêèå æå
-íà÷åðòàíèå èëè íàñûùåííîñòü, êàê ó~çàãîëîâêîâ ðàçäåëîâ. Íàïðèìåð, êàê ñëåäóþùóþ ïîäïèñü:
-
-\example*{size=small,margin=10pt,labelfont=bf,labelsep=endash}{\exampletext}
-
-% You can do this easily with this package as there are many ready-to-use
-% caption formatting options, but you are free to define your very own stuff, too.
-Ñ~äàííûì ïàêåòîì ýòî ñäåëàòü ïðîñòî, ïîñêîëüêó â~í¸ì óæå åñòü ìíîæåñòâî ãîòîâûõ
-îïöèé êëþ÷åé íàñòðîéêè, è~âû ñâîáîäíû è~âûáðàòü ñâî¸ ñî÷åòàíèå îïöèé äëÿ
-îôîðìëåíèÿ, è~ñîçäàòü ñâîè îïöèè.
-
-\bigskip
-
-\INFO\begin{minipage}[t]{\textwidth}
-\small
-% Please note that \thispackage\ is only controlling the look \& feel of the
-% captions. It does \emph{not} control the placement of the captions.
-% (But you could do so by using other packages like the \package{floatrow}
-% package\cite{floatrow}.)
-Îáðàòèòå âíèìàíèå, ÷òî \thispackage\ êîíòðîëèðóåò òîëüêî îôîðìëåíèå
-ïîäïèñåé. Îí \emph{íå} êîíòðîëèðóåò ðàçìåùåíèå ïîäïèñåé.
-(Íî ýòî âîçìîæíî, åñëè èñïîëüçîâàòü äîïîëíèòåëüíî äðóãèå ïàêåòû,
-íàïðèìåð \package{floatrow}\cite{floatrow}.)
-\end{minipage}
-
-\begingroup\small
-%^^A% \vspace{2ex}\centerline{\textbf{Frequently Appeared Design\footnote
-%^^A% {Added in translated text.}}\nopagebreak}
-\vspace{2ex}\centerline{\textbf{\TeX íè÷åñêîå ðåäàêòèðîâàíèå\footnote
- {Äîáàâëåíî ïðè ïåðåâîäå.}}\nopagebreak}
-\begin{multicols}{2}\raggedright\advance\rightskip1em
- \makeatletter\let\item\@idxitem\ignorespaces\makeatother
-%^^A% \item Last line of caption centered
-\item Âûêëþ÷êà ïîñëåäíåé ñòðîêè ïî öåíòðó
- \pageref{TeXr:centerlast}
-%^^A% \item Hanged caption label
-\item Íóìåðàöèîííûé çàãîëîâîê íà âåñó
- \pageref{TeXr:hang:label}
-%
-%^^A \indexspace
-%
-%^^A% \item Spaces above and below captions
-\item Îòáèâêè ó~ïîäïèñåé íàä è~ïîä ôëîòàìè
- \pageref{TeXr:captionskips:a}%^^A--\pageref{TeXr:captionskips:z}
-%^^A% \item Settings, for caption label
-\item Îôîðìëåíèå
-%^^A% \subitem for caption label
-\subitem íóìåðàöèîííûõ çàãîëîâêîâ
- \pageref{TeXr:caplabel:a}%^^A--\pageref{TeXr:caplabel:z}
-%^^A% \subitem for one-line captions
-\subitem îäíîñòðî÷íûõ ïîäïèñåé
- \pageref{TeXr:singleline:a}%^^A--\pageref{TeXr:singleline:z}
-%^^A% \subitem for multi-paragraph captions
-\subitem ïîäïèñåé èç íåñêîëüêèõ àáçàöåâ
- \pageref{TeXr:multipar:a}%^^A--\pageref{TeXr:multipar:z}
-%
-%^^A \indexspace
-%
-%^^A% \item Captions
-\item Ïîäïèñè\nopagebreak
-%^^A% \subitem for continued floats
-\subitem ê~ôëîòàì ñ~ïðîäîëæåíèåì
- \pageref{TeXr:continued:a}\nopagebreak %^^A--\pageref{TeXr:continued:z}
-%^^A% \subitem above tables
-\subitem íàä òàáëèöàìè
- \pageref{TeXr:captop:a}%^^A--\pageref{TeXr:captop:z}
-%^^A% \subitem skipped entry in list
-\subitem áåç çàïèñè â~ñïèñêå ðèñóíêîâ,
-%^^A% \subsubitem trick with empty option
- \subsubitem òðþê ñ~äîïîëíèòåëüíûì àðãóìåíòîì êîìàíäû
- |\caption| \pageref{TeXr:nolistentry:I}
-%^^A% \subsubitem key |listof=|
- \subsubitem êëþ÷ ïàêåòà |list=|
- \pageref{TeXr:nolistentry:II}
-%^^A% \subitem unlabeled
-\subitem áåç íóìåðàöèîííîãî çàãîëîâêà
- \pageref{TeXr:starcaption:a}%^^A--\pageref{TeXr:starcaption:z}
-%^^A% \subitem outside float
-\subitem âíå îêðóæåíèÿ ôëîòà
- \pageref{TeXr:captionof:a}%^^A--\pageref{TeXr:captiononof:z}
-%
-\end{multicols}%
-\endgroup
-\clearpage
-%
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\tableofcontents
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-% \section{Using this package}
-\section{Èñïîëüçîâàíèå ïàêåòà}
-\label{usage}
-
-\DescribeMacro{\usepackage}
-% Insert
-Äîáàâüòå
-\begin{quote}
- |\usepackage|\oarg{options}|{caption}[|\texttt{\filedate}|]|
-\end{quote}
-% into the preamble of your document, i.e.~the part of your document
-% between |\document|\-|class| and |\begin{doc|\-|u|\-|ment}|.
-% The options control how your captions will look like; e.g.,
-â~ïðåàìáóëó âàøåãî äîêóìåíòà, ò.\,å. â~÷àñòü ôàéëà ìåæäó êîìàíäàìè
-|\document|\-|class| è~|\begin{document}|.
-Îïöèè çàäàþò íàñòðîéêè îôîðìëåíèÿ ïîäïèñåé â~êíèãå; íàïðèìåð, îïöèè
-\begin{quote}
- |\usepackage[margin=10pt,font=small,labelfont=bf,|\\
- | labelsep=endash]{caption}|%
- %|[|\texttt{\filedate}|]|
-\end{quote}
-% would result in captions looking like the second one in the introduction.
-çàäàäóò ïîäïèñè, ïîõîæèå íà âòîðîé ïðèìåð âî ââåäåíèè.
-
-\DescribeMacro{\captionsetup}
-% For a later change of options \thispackage\ provides the command
-Äëÿ ïîñëåäóþùèõ èçìåíåíèé \thispackage\ ïðåäëàãàåò êîìàíäó
-\begin{quote}
- |\captionsetup|\oarg{float type}\marg{options}\quad.
-\end{quote}
-% So
-Ñëåäîâàòåëüíî, îïðåäåëåíèÿ
-\begin{quote}
- |\usepackage[margin=10pt,font=small,labelfont=bf]{caption}|
-\end{quote}
-% and
-\begin{quote}
- |\usepackage{caption}|\\
- |\captionsetup{margin=10pt,font=small,labelfont=bf}|
-\end{quote}
-% are equal in their results.
-ýêâèâàëåíòíû.
-
-% It's good to know that |\caption|\-|setup| has an effect on the current
-% environment only. So if you want to change settings for the
-% current |figure| or |table| only, just place the |\caption|\-|setup| command
-% inside the |figure| or |table| right before the |\caption| command.
-% For example
-Íóæíî îáðàòèòü âíèìàíèå, ÷òî óñòàíîâêè |\captionsetup| ìîãóò äåéñòâîâàòü è~íà îäíî
-îêðóæåíèå. Òàê ÷òî, åñëè âû õîòèòå èçìåíèòü óñòàíîâêè òîëüêî
-îäíîãî îêðóæåíèÿ |figure| èëè |table|, ïîìåñòèòå êîìàíäó |\captionsetup|
-âíóòðè |figure| èëè |table| ïðÿìî ïåðåä êîìàíäîé |\caption|.
-Íàïðèìåð
-\begin{quote}
- |\begin{figure}|\\
- | |\ldots\\
- | \captionsetup{singlelinecheck=off}|\\
- | \caption{|\ldots|}|\\
- |\end{figure}|
-\end{quote}
-% switches the single-line-check off, but only for this |figure|,
-% so all the other captions remain untouched.
-îòêëþ÷àåò êîíòðîëü îäíîñòðî÷íîé ïîäïèñè (ñì.~îá ýòîì íèæå), íî òîëüêî äëÿ ýòîãî
-îêðóæåíèÿ |figure|, äðóãèå ïîäïèñè íå èçìåíÿòñÿ.
-
-\smallskip
-
-\begin{Annotation}
-% For a detailed description of |\caption|\-|setup| see \Ref{captionsetup}.
-Ïîäðîáíîå îïèñàíèå êîìàíäû |\captionsetup| ñì.~â~\Ref{captionsetup}.
-\end{Annotation}
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-% \section{Options}
-\section{Îïöèè}
-\label{options}
-
-\def\OptionLabel{RaggedRight}
-\def\UserDefined{\ldots}
-
-% --------------------------------------------------------------------------- %
-
-% \subsection{Formatting}
-\subsection{Îôîðìëåíèå}
-\label{formats}
-
-\DescribeMacro{format=}
-% A figure or table caption mainly consists of three parts: the caption label,
-% which says if this object is a `Figure' or `Table' and what number is
-% associated with it, the caption text itself, which is normally a short
-% description of contents, and the caption separator which separates the text
-% from the label.
-Ïîäïèñü ðèñóíêà èëè òàáëèöû îáû÷íî èìååò òðè ÷àñòè\nopagebreak: íóìåðàöèîííûé
-çàãîëîâîê, êîòîðûé îáúÿâëÿåò, ÷òî ýòîò îáúåêò íàçûâàåòñÿ `Ðèñ'óíîê èëè `Òàáëèöà' è~èìååò
-ñâîé íîìåð; ñîáñòâåííî òåêñò, êîòîðûé îáû÷íî äà¸ò êðàòêîå îïèñàíèå
-ñîäåðæàíèÿ; ðàçäåëèòåëü ìåæäó íóìåðàöèîííûì çàãîëîâêîì è~òåêñòîì.
-
-% The \textit{caption format} determines how this information will be presented;
-% it is specified with the option
-\textit{Ôîðìàò ïîäïèñè} îïðåäåëÿåò, êàê äàííàÿ èíôîðìàöèÿ áóäåò ïðåäñòàâëåíà;
-ýòî çàäà¸òñÿ êëþ÷îì
-\begin{quote}
- |format=|\meta{format name}\quad
-\end{quote}
-% having the name of the caption format as its argument.
-ñ~îïöèåé, îïðåäåëÿþùåé îôîðìëåíèå (ôîðìàò) ïîäïèñè.
-
-% There are two standard caption formats:
-Äàëåå äâà ñòàíäàðòíûõ îôîðìëåíèÿ ïîäïèñè:
-%\footnote{You have the option to
-%define your own ones, too. See section \ref{declare}:
-%\textit{``Do it yourself!''} for details.}
-
-\begin{Options}{\OptionLabel}
- \item[plain]%\NEWdescription{v3.0h}
-% Typesets the captions as a normal paragraph.
- Ïå÷àòàåò ïîäïèñè êàê îáû÷íûé àáçàö.
-
- \item[hang]
-% Indents the caption text, so it will `hang' under the first line of the text.
- Äåëàåò âòÿæêó òàê, ÷òî ïåðâàÿ ñòðîêà [íóìåðàöèîííûé çàãîëîâîê] âûñòóïàåò âëåâî.%
- \label{TeXr:hang:label}
-
- \item[\UserDefined]
-% Own formats can be defined using |\Declare|\-|Caption|\-|Format|.\LineBreak
-% \SeeUserDefined
- Ñîáñòâåííîå îôîðìëåíèå ìîæåò áûòü îïðåäåëåíî, ñ~ïîìîùüþ êîìàíäû
- |\Declare|\-|Caption|\-|Format|. \SeeUserDefined
-\end{Options}
-
-\begin{Example}
-% An example: Specifying the option
- Ïðèìåð: çàäàíèå îïöèè
- \begin{quote}
- |format=hang|
- \end{quote}
-% yields captions like this:
- ñîçäà¸ò ïîäïèñè êàê ýòà:
- \example{format=hang}{\exampletext}
-\end{Example}
-
-\pagebreak[3]
-\DescribeMacro{indention=}
-% For both formats (\texttt{plain} and \texttt{hang}) you can setup an extra
-% indention starting at the second line of the caption. You do this with the
-% option
-Äëÿ îáîèõ îôîðìëåíèé (\texttt{plain} è~\texttt{hang}) ìîæíî óñòàíîâèòü
-äîïîëíèòåëüíóþ âòÿæêó âòîðûõ ñòðîê ïîäïèñè. Ýòî ìîæíî ñäåëàòü ñ~êëþ÷îì
-\begin{quote}
- |indention=|\meta{amount}\quad.
-\end{quote}
-%^^A% [Please note, that indention of the keys \verb|format=hang| and
-%^^A% |indention=|\meta{amount} are summarized.---\emph{Trans.}]
-[Îáðàòèòå âíèìàíèå, ÷òî âòÿæêà èç êëþ÷åé \verb|format=hang| è~|indention=|\meta{amount}
-ñóììèðóþòñÿ. \cdash--- \emph{Ïðèì.\,ïåðåâ.}]
-
-% Two examples:
-Ïàðà ïðèìåðîâ:
-
-\begin{Example}
- \begin{quote}
- |format=plain,indention=.5cm|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=plain,indention=.5cm}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |format=hang,indention=-0.5cm|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=hang,indention=-0.5cm}{\exampletext}
-\end{Example}
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{labelformat=}
-% With the option
-Ñ~êëþ÷îì\label{TeXr:caplabel:a}%
-\nopagebreak[3]
-\begin{quote}
- |labelformat=|\meta{label format name}
-\end{quote}
-\nopagebreak[3]
-%\NEWdescription{v3.0e}
-% you specify how the caption label will be typeset.
-% There are five standard caption label formats:
-âû çàäà¸òå, êàê ïå÷àòàåòñÿ íóìåðàöèîííàÿ ÷àñòü.
-Ñóùåñòâóþò ÷åòûðå ñòàíäàðòíûõ îôîðìëåíèÿ íóìåðàöèîííîãî çàãîëîâêà:
-
-\begin{Options}{\OptionLabel}
- \item[default]
-% The caption label will be typeset as specified by the document class,
-% usually this means the name and the number (like \texttt{simple}).
-% (This is the default behaviour.)
- íóìåðàöèîííûé çàãîëîâîê ïå÷àòàåòñÿ òàê æå êàê â~ñòàíäàðòíûõ êëàññàõ,
- ýòî îáû÷íî íàçâàíèå ôëîòà è~íîìåð (êàê \texttt{simple}).
- (Çàäà¸òñÿ ïî óìîë÷àíèþ.)
-
- \item[empty]
-% The caption label will be empty.
- Íóìåðàöèîííûé çàãîëîâîê îòñóòñòâóåò.
-\iffalse
-% (This option makes sense when used together with other options like
-% \texttt{labelsep=none}.)
- (Ýòà îïöèÿ èìååò ñìûñë âìåñòå ñ~îïöèÿìè òèïà \texttt{labelsep=none}.)
-\fi
-
- \item[simple]
-% The caption label will be typeset as a name and a number.
- Íóìåðàöèîííûé çàãîëîâîê ïå÷àòàåòñÿ êàê íàçâàíèå ôëîòà è~åãî íîìåð.
-
- \item[brace]\NEWfeature{v3.1f}
-% The caption label will be closed with a single (right) brace.
- Íóìåðàöèîííûé çàãîëîâîê (íîìåð ïîäôëîòà) îòäåë¸í ñïðàâà êðóãëîé ñêîáêîé.
-
- \item[parens]
-% The number of the caption label will be typeset in parentheses.
- Íîìåð â~íóìåðàöèîííîé ÷àñòè çàãîëîâêà ïå÷àòàåòñÿ â~ñêîáêàõ.
-
- \item[\UserDefined]
-% Own label formats can be defined using |\Declare|\-|Caption|\-|Label|\-|Format|.
-% \SeeUserDefined
- Ñîáñòâåííîå îôîðìëåíèå ìîæåò áûòü îïðåäåëåíî ñ~ïîìîùüþ
- êîìàíäû |\Declare|\-|Caption|\-|Label|\-|Format|.
-\end{Options}
-
-\begin{Example}
-% An example: Using the options
- Ïðèìåð: ñ~îïöèÿìè êëþ÷åé
- \begin{quote}
- |format=plain,labelformat=parens,labelsep=quad|
- \end{quote}
-% gives captions like this one:
- ñîçäà¸òñÿ òàêàÿ ïîäïèñü:
- \example{format=plain,labelformat=parens,labelsep=quad}{\exampletext}
-\end{Example}
-[Íàçâàíèå â~íóìåðàöèîííîì çàãîëîâêå äëÿ äàííîãî ïðèìåðà èçìåíåíî ñ~ïîìîùüþ
-îïöèè |figurename|. \See{\Ref{names}}]
-
-\medskip
-
-\begin{Note*}
-% Some environments, e.g.~the |algorithm| environment offered by the
-% \package{algorithm2e} package, might react allergic to a change of the
-% caption label format.
-Ó~íåêîòîðûõ îêðóæåíèé, íàïðèìåð ó~îêðóæåíèÿ |algorithm|, ïðåäëàãàåìîãî
-ïàêåòîì \package{algorithm2e}, èçìåíåíèå ôîðìàòà íóìåðàöèîííîãî çàãîëîâêà
-ìîæåò âûçâàòü àëëåðãèþ.
-\end{Note*}
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{labelsep=}
-% With the option
-Ñ~êëþ÷îì
-\begin{quote}
- |labelsep=|\meta{label separator name}
-\end{quote}
-% you specify what caption separator will be used.\footnote{%
-% If the caption label or the caption text is empty,
-% no separator will be used.}
-% You can choose one of the following:
-âû îïðåäåëÿåòå êàêîé ðàçäåëèòåëü [ìåæäó íóìåðàöèîííûì çàãîëîâêîì è~òåêñòîì]
-áóäåò èñïîëüçîâàòüñÿ\footnote{%
- Åñëè íóìåðàöèîííûé çàãîëîâîê èëè òåêñò ïîäïèñè ïóñòûå,
- ðàçäåëèòåëü íå èñïîëüçóåòñÿ.}.
-Âû ìîæåòå çàäàòü ñëåäóþùèå îïöèè:
-
-\begin{Options}{newline}
- \item[none]
-% There is no caption separator.
- Îòñóòñòâóåò ðàçäåëèòåëü íóìåðàöèîííîé ÷àñòè è~òåêñòà ïîäïèñè.
-\iffalse
-% (This option makes sense when used together with other options like
-% \texttt{labelformat=empty}.)
- (Ïðèìåíåíèå ýòîé îïöèè
- èìååò ñìûñë âìåñòå ñ~îïöèÿìè òèïà \texttt{labelformat=empty}.)
-\fi
-
- \item[colon]
-% The caption label and text will be separated by a colon and a space.
- Íóìåðàöèîííûé çàãîëîâîê è~òåêñò ðàçäåëåíû äâîåòî÷èåì è~ïðîáåëîì.
-
- \item[period]
-% The caption label and text will be separated by a period and a space.
- Íóìåðàöèîííûé çàãîëîâîê è~òåêñò ðàçäåëåíû òî÷êîé è~ïðîáåëîì.
-
- \item[space]
-% The caption label and text will be separated by a single space.
- Íóìåðàöèîííûé çàãîëîâîê è~òåêñò ðàçäåëåíû ïðîáåëîì.
-
- \item[quad]
-% The caption label and text will be separated by a |\quad|.
- Íóìåðàöèîííûé çàãîëîâîê è~òåêñò ðàçäåëåíû êåãåëüíîé (|\quad|).
-
- \item[newline]
-% The caption label and text will be separated by a line break (|\\|).
-% Please note that this separator does not work with all caption
-% formats (e.g.~|format=|\x|hang|), and you'll get an error message
-% trying such combination of options.
- Íóìåðàöèîííûé çàãîëîâîê è~òåêñò ðàçäåëåíû íîâîé ñòðîêîé~(|\\|).
- Îáðàòèòå âíèìàíèå, ÷òî ýòîò ðàçäåëèòåëü íå ðàáîòàåò ñ~íåêîòîðûìè
- ôîðìàòàìè (íàïðèìåð, |format=|\x|hang|), è~âû ïîëó÷èòå ñîîáùåíèå
- îá îøèáêå ïðè ïîïûòêå èñïîëüçîâàòü ýòó êîìáèíàöèþ.
-
- \item[endash]\NEWfeature{v3.0h}
-% The caption label and text will be separated by an en-dash,
-% surrounded by spaces (\verb*| -- |).
- Íóìåðàöèîííûé çàãîëîâîê è~òåêñò ðàçäåëÿåòñÿ êðàòêèì òèðå,
- îêðóæ¸ííûì ïðîáåëàìè (\verb*| -- |).
-
- \item[\UserDefined]
-% Own separators can be defined using |\Declare|\-|Caption|\-|Label|\-|Sep|\-|a|\-|ra|\-|tor|.
-% \SeeUserDefined
- Ñîáñòâåííûå ðàçäåëèòåëè ìîæíî îïðåäåëèòü, èñïîëüçóÿ êîìàíäó
- |\Declare|\-|Caption|\-|Label|\-|Sep|\-|a|\-|ra|\-|tor|.
- \SeeUserDefined
-\end{Options}
-
-% Three examples:
-Òðè ïðèìåðà:
-\begin{Example}
- \begin{quote}
- |format=plain,labelsep=period|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=plain,labelsep=period}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |format=plain,labelsep=newline,singlelinecheck=false|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=plain,labelsep=newline,singlelinecheck=false}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |format=plain,labelsep=endash|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=plain,labelsep=endash}{\exampletext}
-\end{Example}
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{textformat=}\NEWfeature{v3.0l}%
-% With the option
-Ñ~îïöèåé
-\nopagebreak[3]
-\begin{quote}
- |textformat=|\meta{text format name}
-\end{quote}
-\nopagebreak[3]
-% you specify how the caption text will be typeset.
-% There are two standard caption text formats:
-âû îïðåäåëÿåòå êàê òåêñò ïîäïèñè áóäåò íàïå÷àòàí.
-Ñóùåñòâóåò äâà ñòàíäàðòíûõ ôîðìàòà ïîäïèñè:
-
-\begin{Options}{\OptionLabel}
- \item[simple]
-% The caption text will be typeset as it is.
- Òåêñò ïîäïèñè áóäåò íàïå÷àòàí êàê åñòü.
-
- \item[period]
-% The caption text will be followed by a period.
- Â~êîíöå ïîäïèñè ñòàâèòñÿ òî÷êà.
-
- \item[\UserDefined]
-% Own label formats can be defined using |\Declare|\-|Caption|\-|Text|\-|Format|.
-% \SeeUserDefined
- Ñîáñòâåííûå ôîðìàòû òåêñòà ìîãóò áûòü îïðåäåëåíû ñ~èñïîëüçîâàíèåì êîìàíäû |\Declare|\-|Caption|\-|Text|\-|Format|.
- \SeeUserDefined
-\end{Options}
-
-% --------------------------------------------------------------------------- %
-
-\PageBreak
-% \subsection{Justification}
-\subsection{Âûêëþ÷êà}
-\label{justification}
-
-\DescribeMacro{justification=}
-% As addition to the caption format you could also specify a
-% \emph{caption justification}; it is specified with the option
-Ïðè îôîðìëåíèè ïîäïèñè âû ìîæåòå îïðåäåëèòü
-\emph{âûêëþ÷êó ïîäïèñè}; îíà çàäà¸òñÿ êëþ÷îì
-\begin{quote}
- |justification=|\meta{justification name}\quad.
-\end{quote}
-
-% You can choose one of the following:
-Âû ìîæåòå âûáðàòü ñëåäóþùèå îïöèè:
-
-\begin{Options}{\OptionLabel}
- \item[justified]
-% Typesets the caption as a normal paragraph.
- Ïå÷àòàåò ïîäïèñü â~âèäå îáû÷íîãî àáçàöà. (Ïî óìîë÷àíèþ.)
-
- \item[centering]
-% Each line of the caption will be centered.
- Âñå ñòðîêè âûêëþ÷åíû ïî öåíòðó.
-
-% \item[Centering]
-
- \item[centerlast]
-% The last line of each paragraph of the caption text will be centered.
- Àáçàö íàáèðàåòñÿ íà ïîëíûé ôîðìàò, ïîñëåäíÿÿ ñòðîêà âûêëþ÷åíà ïî öåíòðó.
-
- \item[centerfirst]
-% Only the first line of the caption will be centered.
- Öåíòðèðóåòñÿ òîëüêî ïåðâàÿ ñòðîêà [îñòàëüíûå, â~òîì ÷èñëå è~êîíöåâàÿ,
- âûêëþ÷àþòñÿ íà ïîëíûé ôîðìàò].
-
- \item[raggedright]
-% Each line of the caption will be moved to the left margin.
- Ñòðîêè ïîäïèñè âûêëþ÷åíû âëåâî.
-
-\iffalse
- \item[RaggedRight]
-% Each line of the caption will be moved to the left margin using
-% the command |\RaggedRight| from the \package{ragged2e} package.
- Ñòðîêè ïîäïèñè âûêëþ÷åíû âëåâî ñ~èñïîëüçîâàíèåì êîìàíäû
- |\RaggedRight| èç ïàêåòà \package{ragged2e}.
-\else
- \item[RaggedRight]
-% Each line of the caption will be moved to the left margin, too.
-% But this time the command |\RaggedRight| of the \package{ragged2e}
-% package will be used to achieve this.
-% The main difference to |raggedright| is that the word breaking
-% algorithm of \TeX\ will work inside captions.\footnote{%
-% The need for the \package{ragged2e} package will be detected at
-% run-time, therefore you maybe need a second \LaTeX\ run if this
-% option is used for the first time.}
- Ñòðîêè ïîäïèñè òàêæå âûêëþ÷åíû âëåâî.
- Íî â~äàííîì ñëó÷àå èñïîëüçóåòñÿ êîìàíäà |\RaggedRight| ïàêåòà
- \package{ragged2e}. Îñíîâíîå îòëè÷èå îò îïöèè |raggedright|
- çàêëþ÷àåòñÿ â~èñïîëüçîâàíèè àëãîðèòìà Plain \TeX'à äëÿ ðàçðûâà
- ñëîâ âíóòðè ïîäïèñè.\footnote{
- Íåîáõîäèìîñòü â~ýòîì ïàêåòå îïðåäåëÿåòñÿ «íà ëåòó»,
- ïîýòîìó ïðè èñïîëüçîâàíèè ýòîé îïöèè äîêóìåíò íóæíî äâàæäû îáðàáîòàòü \LaTeX'îì.}.
-\fi
-
- \item[raggedleft]
-% Each line of the caption will be moved to the right margin.
- Ñòðîêè ïîäïèñè âûêëþ÷åíû âïðàâî.
-
-% \item[RaggedLeft]
-% % Each line of the caption will be moved to the right margin using
-% % the command |\RaggedLeft| from the \package{ragged2e} package.
-% Ñòðîêè ïîäïèñè âûêëþ÷åíû âïðàâî ñ~èñïîëüçîâàíèåì êîìàíäû
-% |\RaggedRight| èç ïàêåòà \package{ragged2e}.
-
-%\showhyphens{justification}
- \item[\UserDefined]
-% Own justifications can be defined using
-% |\Declare|\-|Caption|\-|Jus|\-|ti|\-|fi|\-|ca|\-|tion|.
-% \SeeUserDefined
- Ñîáñòâåííûå îïðåäåëåíèÿ âûêëþ÷êè ìîæíî çàäàòü ñ~ïîìîùüþ êîìàíäû
- |\Declare|\-|Caption|\-|Jus|\-|ti|\-|fi|\-|ca|\-|tion|.
- \SeeUserDefined
-\end{Options}
-
-% Three examples:
-Òðè ïðèìåðà:\label{TeXr:centerlast}%
-\begin{Example}
- \begin{quote}
- |format=plain,justification=centerlast|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=plain,justification=centerlast}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |format=hang,justification=raggedright|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=hang,justification=raggedright}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |format=plain,labelsep=newline,justification=centering|
- \end{quote}
- \captionsetup{skip=0pt}
- \example*{format=plain,labelsep=newline,justification=centering}{\exampletext}
-\end{Example}
-
-\smallskip
-
-\PageBreak
-\DescribeMacro{singlelinecheck=}\label{TeXr:singleline:a}%
-% The standard \LaTeX\ document classes (\class{article}, \class{report}, and
-% \class{book}) automatically center a caption if it fits in one single line:
-Ñòàíäàðòíûå êëàññû \LaTeX'à (\class{article}, \class{report}, è~\class{book})
-àâòîìàòè÷åñêè öåíòðèðóþò ïîäïèñü åñëè îíà îäíîñòðî÷íàÿ:
-
-\example*{}{A short caption.}
-
-\INFO
-% \Thispackage\ adapts this behavior and therefore usually ignores the
-% justification \& indention you have set with |justification=| \&
-% |indention=| in such case.
-% But you can switch this special treatment of such short captions off
-% with the option
-\Thispackage\ ñëåäóåò çà ýòèì àëãîðèòìîì è~ïîýòîìó
-â~òàêèõ ñëó÷àÿõ èãíîðèðóåò âûêëþ÷êó, çàäàííóþ êëþ÷àìè |justification=| è~|indention=|.
-Îïðåäåëèòü, ñëåäîâàòü ýòîìó àëãîðèòìó èëè íåò ìîæíî,
-çàäàâ êëþ÷
-\begin{quote}
- |singlelinecheck=|\meta{bool}\quad.
-\end{quote}
-% Using |false|, |no|, |off| or |0| for \meta{bool} switches the
-% extra centering off:
-Èñïîëüçóÿ |false|, |no|, |off| èëè |0| âìåñòî \meta{bool} âû îòêëþ÷èòå
-öåíòðèðîâàíèå îäíîñòðî÷íîé ïîäïèñè:
-\begin{quote}
- |singlelinecheck=false|
-\end{quote}
-% Doing so the above short caption would look like
-Ïîñëå ýòîãî îïðåäåëåíèÿ êîðîòêèå ïîäïèñè
-[ïðè çàäàíèè âûêëþ÷êè ïî óìîë÷àíèþ, â~âèäå îáû÷íîãî àáçàöà]
-áóäóò âûãëÿäåòü òàê
-
-\begingroup
- \captionsetup{type=figure}
- \ContinuedFloat
- \example*{singlelinecheck=false}{A short caption.}
-\endgroup
-
-% You switch the extra centering on again by using |true|, |yes|, |on| or |1|
-% for \meta{bool}. (The default is on.)
-Èñïîëüçóÿ |true|, |yes|, |on| èëè |1| âìåñòî \meta{bool} âû âêëþ÷èòå ìåõàíèçì
-öåíòðèðîâàíèÿ êîðîòêèõ ïîäïèñåé. (Çàäàíî ïî óìîë÷àíèþ.)%^^A
-\label{TeXr:singleline:z}
-
-% --------------------------------------------------------------------------- %
-
-% \subsection{Fonts}
-\subsection{Øðèôòû}
-\label{fonts}
-
-\DescribeMacro{font=}
-\DescribeMacro{labelfont=}
-\DescribeMacro{textfont=}
-% There are three font options which affects different parts of the caption:
-% One affecting the whole caption (|font|), one which only affects the caption
-% label and separator (|label|\-|font|) and at least one which only affects the
-% caption text (|text|\-|font|).
-% You set them up using the options
-Çàäàíû òðè êëþ÷à êîòîðûå îïðåäåëÿþò øðèôò ðàçíûõ ýëåìåíòîâ ïîäïèñè:
-Ïåðâûé çàäà¸ò øðèôò äëÿ âñåé ïîäïèñè (|font|), âòîðîé çàäà¸ò øðèôò òîëüêî
-äëÿ íóìåðàöèîííîãî çàãîëîâêà è~ðàçäåëèòåëÿ (|label|\-|font|), è~òðåòèé
-\cdash--- øðèôò äëÿ òåêñòà (|text|\-|font|).
-Âû çàäà¸òå èõ, èñïîëüçóÿ êëþ÷è
-\begin{quote}\begin{tabular}{@{}r@{}ll}
- |font=| & \marg{font options} & ,\\
- |labelfont=| & \marg{font options} & , è\\
- |textfont=| & \marg{font options} & .\\
-\end{tabular}\end{quote}
-% where \meta{font options} is a list of comma separated font options.
-ãäå àðãóìåíòîì \meta{font options} ÿâëÿþòñÿ ïåðå÷èñëåííûå ÷åðåç çàïÿòóþ îïöèè.
-
-% And these are the available font options:
-Äàëåå óæå ñîçäàííûå îïöèè äàííûõ êëþ÷åé:
-
-\begin{Options}{stretch=\meta{amount}}
- \item[scriptsize] {\scriptsize Î÷åíü ìàëåíüêèé}
- \item[footnotesize] {\footnotesize Îáû÷íî èñïîëüçóåòñÿ â~ñíîñêàõ}
- \item[small] {\small Ìàëåíüêèé}
- \item[normalsize] {\normalsize Íîðìàëüíûé}
- \item[large] {\large Áîëüøîé}
- \item[Large] {\Large Åù¸ áîëüøå}
-\end{Options}
-\vspace{0pt}\pagebreak[3]
-\begin{Options}{stretch=\meta{amount}}
-% \item[normalfont] {\normalfont Normal shape \& series \& family}
- \item[normalfont] {\normalfont Èñõîäíûå ñåìåéñòâî, íàñûùåííîñòü è~íà÷åðòàíèå}
-
- \item[up] {\upshape Ïðÿìîé}
- \item[it] {\itshape Êóðñèâ}
- \item[sl] {\slshape Íàêëîííûé}
- \item[sc] {\scshape Êàïèòåëü}
-
- \item[md] {\mdseries Íîðìàëüíàÿ íàñûùåííîñòü (ñâåòëûé)}
- \item[bf] {\bfseries Ïîëóæèðíûé}
-
- \item[rm] {\rmfamily Øðèôò ñ~çàñå÷êàìè}
- \item[sf] {\sffamily Ðóáëåíûé}
- \item[tt] {\fontfamily{cmtt}\selectfont Øðèôò ïèøóùåé ìàøèíêè (ðàâíîøèðèííûé)}
-\end{Options}
-\vspace{0pt}\pagebreak[3]
-\begin{Options}{stretch=\meta{amount}}
-% \item[singlespacing] Single spacing \See{\Ref{setspace}}
-% \item[onehalfspacing] One-and-a-half spacing \See{\Ref{setspace}}
-% \item[doublespacing] Double spacing \See{\Ref{setspace}}
-% \item[stretch=\meta{amount}] |\setstretch|\marg{amount} \See{\Ref{setspace}}
- \item[singlespacing] Îäèíàðíûé èíòåðëèíüÿæ \See{\Ref{setspace}}
- \item[onehalfspacing] Ïîëóòîðíûé èíòåðëèíüÿæ \See{\Ref{setspace}}
- \item[doublespacing] Äâîéíîé èíòåðëèíüÿæ \See{\Ref{setspace}}
- \item[stretch=\meta{amount}] ${} \equiv {}$|\setstretch|\marg{amount} \See{\Ref{setspace}}
-\end{Options}
-\vspace{0pt}\pagebreak[3]
-\begin{Options}{stretch=\meta{amount}}
-% \item[normalcolor] |\normalcolor|
-% \item[color=\meta{colour}] |\color|\marg{colour}
-% {\small(If the \package{color} or \package{xcolor} package is loaded,
-% see \Ref{declare} for an example)}
- \item[normalcolor] ñîîòâåòñòâóåò êîìàíäå |\normalcolor|
- \item[color=\meta{colour}] îïöèÿ êëþ÷à ýêâèâàëåíòíà àðãóìåíòó êîìàíäû |\color|\marg{colour}
- {\small(Åñëè çàãðóæåí ïàêåò \package{color} èëè \package{xcolor},
- ñì., íàïðèìåð~\Ref{declare})}
-\end{Options}
-\vspace{0pt}\pagebreak[3]
-\begin{Options}{stretch=\meta{amount}}
-% \item[normal] The combination of the options |normal|\-|color|,
-% |normal|\-|font|, |normal|\-|size|, and |single|\-|spacing|
- \item[normal] Êîìáèíàöèÿ îïöèé |normal|\-|color|,
- |normal|\-|font|, |normal|\-|size| è~|single|\-|spacing|
-
- \item[\UserDefined]
-% Own font options can be defined using |\Declare|\-|Caption|\-|Font|.
-% \SeeUserDefined
- Ñîáñòâåííûå îïöèè ìîãóò áûòü îïðåäåëåíû ñ~ïîìîùüþ êîìàíäû
- |\Declare|\-|Caption|\-|Font|.
- \SeeUserDefined
-\end{Options}
-
-% If you use only one of these options you can omit the braces;
-% e.g., the options
-Åñëè èñïîëüçóåòñÿ îäíà îïöèÿ êëþ÷à, ôèãóðíûå ñêîáêè ìîæíî îïóñòèòü;
-íàïðèìåð, îïöèè
-%\begin{quote}
- |font={small}|
-%\end{quote}
-% and
-%\begin{quote}
- |font=small|
-%\end{quote}
-% will give the same result.
-äàäóò îäèíàêîâûé ðåçóëüòàò.
-
-% Three examples:
-Òðè ïðèìåðà
-\begin{Example}
- \begin{quote}
- |font=it,labelfont=bf|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{font=it,labelfont=bf}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |labelfont=bf,textfont=it|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{labelfont=bf,textfont=it}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |font={small,stretch=0.80}|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{font={small,stretch=0.80}}{\exampletext}
-\end{Example}
-
-\medskip
-
-\pagebreak[3]
-\DescribeMacro{font+=}
-\DescribeMacro{labelfont+=}
-\DescribeMacro{textfont+=}
-\NEWfeature{v3.1f}%
-% You can also add font options to the current ones, so for example
-Âû òàêæå ìîæåòå äîáàâèòü îïöèè øðèôòà ê~òåêóùèì, òàê íàïðèìåð çàïèñü
-\begin{quote}
- |\captionsetup{font=small}|\\
- |\captionsetup{font+=it}|
-\end{quote}
-% is identical to
-áóäåò èäåíòè÷íà
-\begin{quote}
- |\captionsetup{font={small,it}}|
-\end{quote}
-
-% --------------------------------------------------------------------------- %
-
-% \subsection{Margins and further paragraph options}
-\subsection{Ïîëÿ è~äðóãèå îïöèè ôîðìèðîâàíèÿ àáçàöà}
-\label{margins}
-
-\DescribeMacro{margin=}
-\DescribeMacro{width=}
-% For all captions you can specify \emph{either} an extra margin \emph{or}
-% a fixed width:~\footnote{Only fixed widths are supported here; if you are
-% looking for a way to limit the width of the caption to the width of the
-% figure or table, please take a look at the \package{floatrow}\cite{floatrow}
-% or \package{threeparttable}\cite{threeparttable} package.}
-Äëÿ âñåõ ïîäïèñåé ìîæíî îïðåäåëèòü \emph{ëèáî} äîïîëíèòåëüíóþ âòÿæêó
-\emph{ëèáî} ôèêñèðîâàííóþ øèðèíó. Ýòî çàäà¸òñÿ êëþ÷àìè\footnote{Çäåñü ïîääåðæèâàþòñÿ
- òîëüêî ôèêñèðîâàííûå øèðèíû; åñëè âàì íóæíî çàäàòü øèðèíó ïîäïèñè ïî øèðèíå
- ãðàôèêè èëè òàáëè÷íîãî ìàòåðèàëà, îáðàòèòåñü ê~ïàêåòàì \package{floatrow}\cite{floatrow}
- èëè \package{threeparttable}\cite{threeparttable}.}
-\begin{quote}\begin{tabular}{@{}r@{}ll}
- |margin=| & \meta{amount} & \emph{--èëè--}\\
- |margin=| & |{|\meta{left amount}|,|\meta{right amount}|}| & \emph{--èëè--}\\
- |width=| & \meta{amount} & \\
-\end{tabular}\end{quote}
-\NEWfeature{v3.1}
-% If you specify just one \meta{amount} for the margin, it will be used for
-% both, the left and right margin, e.g.~|margin=|\x|10pt| is equivalent to
-% |margin=|\x|{10pt,10pt}|.
-% In two-side documents the left and right margin will be swapped on even pages.
-Åñëè âû îïðåäåëèòå òîëüêî îäíî çíà÷åíèå \meta{amount} äëÿ ïîëÿ, îíî áóäåò èñïîëüçîâàíî äëÿ îáîèõ ïîëåé,
-ëåâîãî è~ïðàâîãî, íàïðèìåð,~|margin=|\x|10pt| ýêâèâàëåíòíî |margin=|\x|{10pt,10pt}|.
-Äëÿ äâóñòîðîííèõ äîêóìåíòîâ ëåâîå è~ïðàâîå ïîëÿ íà ÷¸òíûõ ïîëîñàõ çåðêàëüíî îòîáðàçÿòñÿ.
-\DescribeMacro{oneside}
-\DescribeMacro{twoside}
-% To prevent this you can specify the option |oneside| additionally,
-% e.g.~|\caption|\-|setup{margin=|\x|{0pt,10pt},|\x|oneside}|.\par
-% But if you are specifying a width, then both, the left and the right margin,
-% will have the same amount.
-Åñëè âàì ýòî íå íóæíî âû ìîæåòå çàäàòü äîïîëíèòåëüíî îïöèþ |oneside|,
-íàïðèìåð,~|\caption|\-|setup|\x|{margin=|\x|{0pt,10pt},|\x|oneside}|.\par
-Íî åñëè âû îïðåäåëÿåòå øèðèíó ïîäïèñè, òî îáà ïîëÿ áóäóò îäèíàêîâûìè.
-
-% Three examples will illustrating this:
-Òðè ïðèìåðà äëÿ èëëþñòðàöèè:
-\begin{Example}
- \begin{quote}
- |margin=10pt|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{margin=10pt}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |margin={1cm,0cm}|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{margin={1cm,0cm}}{\exampletext}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |width=.75\textwidth|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{width=.75\textwidth}{\exampletext}
-\end{Example}
-
-\begin{Note}
-% When the caption is placed beside the contents (for example in a |SC|\-|figure|
-% environment offered by the \package{sidecap} package\cite{sidecap}) or the
-% figure is an in-text figure (for example in a |wrap|\-|figure| environment
-% offered by the \package{wrapfig} package\cite{wrapfig}), the margin setting
-% will be automatically reset to |0pt| at the very beginning of the environment.
-% But if you really want to setup an extra margin for these environments, you can
-% do so by setting this margin either inside the environment itself, of by
-% specifying a margin for this particular environment,
-% e.g.~|\caption|\-|setup[SC|\-|figure]{margin=|\x|10pt}|.
-Êîãäà ïîäïèñü ïîìåùåíà ðÿäîì ñ~ñîäåðæèìûì (íàïðèìåð âíóòðè
-îêðóæåíèÿ |SCfigure|, ïðåäëàãàåìîãî ïàêåòîì \package{sidecap} package\cite{sidecap})
-èëè îêðóæåíèå ôëîòà îáòåêàåòñÿ òåêñòîì (ôëîò ïîìåù¸í â~îáîðêó, íàïðèìåð â~îêðóæåíèè |wrap|\-|figure|
-ïðåäëàãàåìîì ïàêåòîì \package{wrapfig}\cite{wrapfig}), óñòàíîâêè ïîëåé
-îáíóëÿþòñÿ â~íà÷àëå îêðóæåíèÿ. Íî åñëè âàì äåéñòâèòåëüíî íóæíî çàäàòü
-âòÿæêó äëÿ ýòèõ îêðóæåíèé, âû ìîæåòå çàäàòü íóæíûå ïîëÿ âíóòðè îêðóæåíèÿ, çàäàâ
-óñòàíîâêè ïîëåé ñïåöèàëüíî äëÿ ýòèõ îêðóæåíèé, íàïðèìåð,
-|\caption|\-|setup[SC|\-|figure]|\x|{margin=10pt}|.
- \end{Note}
-
-\begin{Expert}
-\DescribeMacro{margin*=}\NEWfeature{v3.1}%
-% There is also a starred variant of the |margin=| option, |margin*=|, which only
-% changes the margin if no width was set.
-Ñóùåñòâóåò òàêæå «çâ¸çäíûé» âàðèàíò êëþ÷à |margin=|, êëþ÷ |margin*=|, êîòîðûé
-èçìåíÿåò ïîëÿ òîëüêî êîãäà íå çàäàíà øèðèíà.
-\end{Expert}
-
-\begin{Expert}
-\DescribeMacro{minmargin=}
-\DescribeMacro{maxmargin=}\NEWfeature{v3.1}%
-% You can also set a minimum or maximum margin amount. This can be useful for
-% limiting the margin amount in smaller environments, e.g.~|minipage|s.
-% For example the \SmF\ document classes limit the margin amount to
-% |maxmargin=|\x|0.1\linewidth|. (See \Ref{SMF})
-Âû ìîæåòå òàêæå çàäàòü ìèíèìàëüíûé èëè ìàêñèìàëüíûé ðàçìåð ïîëåé. Ýòî ìîæåò áûòü ïîëåçíî
-äëÿ îãðàíè÷åíèÿ ðàçìåðà ïîëåé â~óìåíüøåííûõ ôîðìàòàõ, íàïðèìåð âíóòðè îêðóæåíèÿ~|minipage|.
-Íàïðèìåð êëàññû äîêóìåíòîâ \SmF\ îãðàíè÷èâàþò ïîëÿ
-|maxmargin=|\x|0.1\linewidth|. (Ñì.~\Ref{SMF})
-\end{Expert}
-
-\medskip
-
-\pagebreak[3]
-\DescribeMacro{parskip=}\label{TeXr:multipar:a}%
-% This option is useful for captions containing more than one paragraph.
-% It specifies the extra vertical space inserted between them:
-Äàííûé êëþ÷ ïîíàäîáèòñÿ, åñëè ïîäïèñè ñîäåðæàò áîëåå îäíîãî àáçàöà.
-Îí çàäà¸ò äîïîëíèòåëüíóþ âåðòèêàëüíóþ îòáèâêó ìåæäó àáçàöàìè:
-\begin{quote}
- |parskip=|\meta{amount}
-\end{quote}
-% One example:
-Ïðèìåð:
-\begin{Example}
- \begin{quote}
- |margin=10pt,parskip=5pt|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{margin=10pt,parskip=5pt}{%
-% First paragraph of the caption. This one contains some test, just to
-% show how these options affect the layout of the caption.\par
-% Second paragraph of the caption. This one contains some text, too, to
-% show how these options affect the layout of the caption.}
- Ïåðâûé àáçàö ïîäïèñè. Îí ñîäåðæèò íåìíîãî òåêñòà, ÷òîáû ïîêàçàòü
- êàê çàäàííûå íàñòðîéêè ñîçäàþò îôîðìëåíèå ïîäïèñè.\par
- Âòîðîé àáçàö ïîäïèñè. Îí òîæå ñîäåðæèò íåìíîãî òåêñòà, ÷òîáû ïîêàçàòü
- êàê çàäàííûå íàñòðîéêè ñîçäàþò îôîðìëåíèå ïîäïèñè.}
-\end{Example}
-
-\pagebreak[3]
-\DescribeMacro{hangindent=}
-% The option
-Êëþ÷
-\begin{quote}
- |hangindent=|\meta{amount}
-\end{quote}
-% is for setting up a hanging indention starting from the second line of each
-% paragraph. If the caption contains just a single paragraph, using this option
-% leads to the same result as the option |indention=|\meta{amount} you already
-% know about.
-% But if the caption contains multiple paragraphs you will notice the difference:
-çàäà¸ò âòÿæêó äëÿ âòîðûõ ñòðîê êàæäîãî àáçàöà ïîäïèñè.
-Åñëè ïîäïèñü ñîñòîèò èç îäíîãî àáçàöà, ýòîò êëþ÷ äà¸ò òîò æå ðåçóëüòàò
-÷òî è~èçâåñòíûé âàì êëþ÷ |indention=|\meta{amount}.
-Íî â~ïîäïèñè èç íåñêîëüêèõ àáçàöåâ âû óâèäèòå ðàçíèöó:
-
-\begin{Example}
- \begin{quote}
- |format=hang,indention=-.5cm|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=hang,indention=-.5cm}{%
-% First paragraph of the caption. This one contains some test, just to
-% show how these options affect the layout of the caption.\par
-% Second paragraph of the caption. This one contains some text, too, to
-% show how these options affect the layout of the caption.}
- Ïåðâûé àáçàö ïîäïèñè. Îí ñîäåðæèò íåìíîãî òåêñòà, ÷òîáû ïîêàçàòü
- êàê çàäàííûå íàñòðîéêè ñîçäàþò îôîðìëåíèå ïîäïèñè.\par
- Âòîðîé àáçàö ïîäïèñè. Îí òîæå ñîäåðæèò íåìíîãî òåêñòà, ÷òîáû ïîêàçàòü
- êàê çàäàííûå íàñòðîéêè ñîçäàþò îôîðìëåíèå ïîäïèñè.}
-\end{Example}
-
-\begin{Example}
- \begin{quote}
- |format=hang,hangindent=-.5cm|
- \end{quote}
- \captionsetup{skip=0pt}
- \example{format=hang,hangindent=-.5cm}{%
-% First paragraph of the caption. This one contains some test, just to
-% show how these options affect the layout of the caption.\par
-% Second paragraph of the caption. This one contains some text, too, to
-% show how these options affect the layout of the caption.}
- Ïåðâûé àáçàö ïîäïèñè. Îí ñîäåðæèò íåìíîãî òåêñòà, ÷òîáû ïîêàçàòü
- êàê çàäàííûå íàñòðîéêè ñîçäàþò îôîðìëåíèå ïîäïèñè.\par
- Âòîðîé àáçàö ïîäïèñè. Îí òîæå ñîäåðæèò íåìíîãî òåêñòà, ÷òîáû ïîêàçàòü
- êàê çàäàííûå íàñòðîéêè ñîçäàþò îôîðìëåíèå ïîäïèñè.}
-\end{Example}
-
-\begin{Note}
-% If your caption contains more than one paragraph, you have
-% to specify an alternative caption for the list-of-figures using the
-% optional argument of |\caption| or |\caption|\-|of|, otherwise you will
-% get an error message.
-Åñëè ïîäïèñü ñîäåðæèò áîëåå îäíîãî àáçàöà, âàì íóæíî
-çàäàòü ñîêðàù¸ííûé âàðèàíò ïîäïèñè äëÿ ñïèñêîâ ðèñóíêîâ èëè òàáëèö, èñïîëüçóÿ
-äîïîëíèòåëüíûé àðãóìåíò êîìàíä |\caption| èëè |\captionof|, èíà÷å âû ïîëó÷èòå
-ñîîáùåíèå îá îøèáêå.
-\end{Note}
-
-% --------------------------------------------------------------------------- %
-
-\PageBreak
-% \subsection{Styles}
-\subsection{Ñòèëè}
-\label{style}
-
-\DescribeMacro{style=}
-% A suitable combination of caption options is called \emph{caption style}.
-% You can compare them more or less to page styles which you set up with
-% |\page|\-|style|;
-% the caption style provides all settings for a whole caption layout.
-Îïðåäåë¸ííàÿ êîìáèíàöèÿ íåñêîëüêèõ êëþ÷åé ñîçäà¸ò \emph{ñòèëü ïîäïèñè}.
-Ýòî ìîæíî ñðàâíèòü ñî ñòèëÿìè êîëîíòèòóëà, çàäàâàåìîãî êîìàíäîé
-|\pagestyle|: ñòèëü ïîäïèñè çàäà¸ò âñå íàñòðîéêè äëÿ îôîðìëåíèÿ ïîäïèñè.
-
-% You switch to an already defined caption style with the option
-Ïðåäâàðèòåëüíî ñîçäàííûé ñòèëü ìîæíî âûçâàòü êëþ÷îì
-\begin{quote}
- |style=|\meta{style name}\quad.
-\end{quote}
-% \Thispackage\ pre-defines two styles: |base| and |default|.
-\Thispackage\ îïðåäåëÿåò äâà ñòèëÿ: |base| è~|default|.
-
-\NEWfeature{v3.1}
-% The |base| style puts all options you already know about to values reflecting
-% the look of the captions when using one of the base \LaTeX\ document classes
-% \class{article}, \class{report}, and \class{book}.
-% This means that specifying the option
-Ñòèëü |base| çàäà¸ò âñå èçâåñòíûå âàì êëþ÷è ñî çíà÷åíèÿìè,
-ñîîòâåòñòâóþùèìè çàäàííûì â~áàçîâûõ êëàññàõ \LaTeX'à
-\class{article}, \class{report} è~\class{book}.
-Ýòî îçíà÷àåò, ÷òî çàäàíèå îïöèè
-\begin{quote}
- |style=base|
-\end{quote}
-% has the same effect as specifying all these options:
-äàñò òîò æå ýôôåêò, ÷òî è çàäàíèå âñåõ ïåðå÷èñëåííûõ îïöèé:
-\begin{quote}
- |format=plain,labelformat=default,labelsep=colon,|\\
- |justification=justified,font={},labelfont={},|\\
- |textfont={},margin=0pt,indention=0pt|\\
- |parindent=0pt,hangindent=0pt,singlelinecheck=true|
-\end{quote}
-\begin{Annotation*}
-% But |justification=centering,indention=0pt| will be set if
-% the caption fits into a single line.
-À~äëÿ îäíîñòðî÷íîé ïîäïèñè áóäóò çàäàíû íàñòðîéêè |justification=|\x|centering,|\x|indention=0pt|.
-\end{Annotation*}
-
-% In contrast the |default| style follows the default values, reflecting
-% the look of the captions given by the document class you actually use.
-% This style is selected by default and represents these options:
-Â~îòëè÷èå îò ïðåäûäóùåãî ñòèëü |default| çàäà¸ò çíà÷åíèÿ, îòâå÷àþùèå
-âèäó ïîäïèñåé, ñîçäàâàåìûõ äàííûì êëàññîì äîêóìåíòà.
-Ýòîò ñòèëü îïðåäåëÿåò ñëåäóþùèå îïöèè:
-\begin{quote}
- |format=default,labelformat=default,labelsep=default,|\\
- |justification=default,font=default,labelfont=default,|\\
- |textfont=default,margin=0pt,indention=0pt|\\
- |parindent=0pt,hangindent=0pt,singlelinecheck=true|
-\end{quote}
-\begin{Annotation*}
-% But again |justification=centering,indention=0pt| will be set if
-% the caption fits into a single line.
-Íî ïðè ýòîì ñíîâà äåéñòâóþò íàñòðîéêè
-|justification=|\x|centering,|\x|indention=0pt| äëÿ îäíîñòðî÷íûõ ïîäïèñåé.
-\end{Annotation*}
-
-% So if you use one of the base \LaTeX\ document classes \class{article},
-% \class{report}, or \class{book}, both caption styles, |base| and |default|,
-% point to (nearly) the same settings.
-Ïîýòîìó, åñëè âû èñïîëüçóåòå îäèí èç êëàññîâ \LaTeX'à \class{article},
-\class{report} èëè \class{book}, îáå îïöèè, |base| è~|default|, çàäàäóò ôàêòè÷åñêè
-îäèíàêîâûå íàñòðîéêè.
-
-\begin{Note}
-% Own caption styles can be defined using |\Declare|\-|Caption|\-|Style|.\LineBreak
-% \SeeUserDefined
-Ñîáñòâåííûå ñòèëè ïîäïèñè ìîãóò áûòü îïðåäåëåíû ñ~ïîìîùüþ
-êîìàíäû |\Declare|\-|Caption|\-|Style|.\LineBreak\SeeUserDefined
-\end{Note}
-
-% --------------------------------------------------------------------------- %
-
-% \subsection{Skips}
-\subsection{Îòáèâêè}
-\label{skips}
-
-\DescribeMacro{skip=}\NEWfeature{v3.0d}%
-% The vertical space between the caption and the figure or table contents is
-% controlled by the option
-Âåðòèêàëüíàÿ îòáèâêà ìåæäó ïîäïèñüþ è~ñîäåðæèìûì ðèñóíêà èëè òàáëèöû
-îïðåäåëÿåòñÿ êëþ÷îì
-\begin{quote}
- |skip=|\meta{amount}\quad.
-\end{quote}
-% The standard \LaTeX\ document classes \class{article}, \class{report} and
-% \class{book} preset it to |skip=|\x|10pt|, but other document classes may
-% use a different amount.
-Ñòàíäàðòíûå êëàññû \LaTeX'à |article|, |report| è~|book| îïðåäåëÿþò êëþ÷ êàê
-|skip=|\x|10pt|,
-íî äðóãèå êëàññû ìîãóò çàäàòü äðóãîå çíà÷åíèå.
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{position=}\label{TeXr:captionskips:a}%
-% The |\caption| command offered by \LaTeX{} has a design flaw:
-% The command does not know if it stands on the beginning of the figure or
-% table, or at the end. Therefore it does not know where to put the space
-% separating the caption from the content of the figure or table.
-% While the standard implementation always puts the space above the caption
-% in floating environments (and inconsistently below the caption in
-% |long|\-|table|s), the implementation offered by this package is more
-% flexible:
-% By giving the option
-Êîìàíäà |\caption|, ïðåäëàãàåìàÿ \LaTeX'îì èìååò íåäîñòàòîê â~îôîðìëåíèè:
-êîìàíäà íå çíàåò, ñòîèò ëè îíà â~íà÷àëå îêðóæåíèÿ ðèñóíêà èëè òàáëèöû, èëè â~êîíöå.
-Ïîýòîìó îíà íå çíàåò, êàê ðàññòàâèòü îòáèâêè, îòäåëÿþùèå ïîäïèñü îò ñîäåðæèìîãî
-ðèñóíêà èëè òàáëèöû. Ïîêà ÷òî ñòàíäàðòíûå îïðåäåëåíèÿ çàäàþò îòáèâêó âñåãäà ñâåðõó
-ïîäïèñè (è~ñíèçó òàáëè÷íîãî çàãîëîâêà â~îêðóæåíèè |long|\-|table|, ÷òî ïðîòèâîðå÷èò ñòàíäàðòíîìó),
-ðåøåíèå, ïðåäëàãàåìîå äàííûì ïàêåòîì áîëåå ãèáêîå.
-Çàäàíèå îïöèè
-\begin{quote}
- |position=top|\quad èëè\quad |position=above|
-\end{quote}
-% it's assumed that the caption is standing at the \emph{top} of the
-% environment and therefore the space setup with |skip=|\x\meta{amount}
-% is placed below the caption.
-% (Please note that |position=|\x|top| does \emph{NOT} mean that the
-% caption is actually placed at the top of the figure or table.
-% Instead the caption is usually placed where you place the |\caption|
-% command.)
-% But with
-áóäåò îçíà÷àòü, ÷òî ïîäïèñü ðàçìåùàåòñÿ \emph{ñâåðõó} ñîäåðæèìîãî
-îêðóæåíèÿ, è~ñëåäîâàòåëüíî îòáèâêà |skip=|\meta{amount} áóäåò
-çàäàíà ñíèçó ïîäïèñè.
-(Îáðàòèòå âíèìàíèå, ÷òî |position=|\x|top| \emph{ÍÅ} îçíà÷àåò,
-÷òî ïîäïèñü äåéñòâèòåëüíî íàïå÷àòàåòñÿ ñâåðõó ðèñóíêà èëè òàáëèöû.
-Ïîäïèñü áóäåò ïå÷àòàòüñÿ òàì, ãäå âû çàäàëè êîìàíäó |\caption|.)
-Íî çàäàíèå
-\begin{quote}
- |position=bottom|\quad èëè\quad |position=below|
-\end{quote}
-% it's assumed that the caption is standing at the \emph{bottom} of the
-% environment and therefore the space is placed above the caption.
-% And finally with
-îçíà÷àåò, ÷òî ïîäïèñü ñòîèò \emph{ñíèçó} ñîäåðæèìîãî
-îêðóæåíèÿ è~ñëåäîâàòåëüíî îòáèâêà ñòàâèòñÿ ñâåðõó ïîäïèñè.
-È~íàêîíåö, çàäàâ
-\begin{quote}
-% |position=auto|\quad {\small(which is the default setting)}
- |position=auto|\quad {\small(÷òî ÿâëÿåòñÿ çíà÷åíèåì ïî óìîë÷àíèþ)}
-\end{quote}
-% \thispackage\ tries its best to determine the actual position of
-% the caption on its own. Please note that while this is successfully in
-% most cases, it could give wrong results under rare circumstances.
-\thispackage\ ïîñòàðàåòñÿ ñàìîñòîÿòåëüíî îïðåäåëèòü ðåàëüíîå ïîëîæåíèå
-ïîäïèñè. Îáðàòèòå âíèìàíèå, ÷òî, õîòÿ ýòî è~äàñò âåðíûé ðåçóëüòàò â~áîëüøèíñòâå ñëó÷àåâ,
-â~íåêîòîðûõ ðåäêèõ ñèòóàöèÿõ ýòî ìîæåò äàòü íåâåðíûé ðåçóëüòàò.
-
-\medskip
-
-\pagebreak[3]
-\DescribeMacro{figureposition=}%\NEWfeature{v3.0a}
-\DescribeMacro{tableposition=}%\NEWfeature{v3.0a}
-% The |position| option is especially useful when used together with the
-% optional argument of the |\caption|\-|setup| command.
-% \See{also \Ref{captionsetup}}\par
-% For example
-Îïöèÿ |position| îñîáåííî ïîëåçíà, êîãäà èñïîëüçóåòñÿ â~íàñòðîéêàõ
-ñ~îïöèåé â~êîìàíäå |\captionsetup|.
-\See{\Ref{captionsetup}}\par
-Íàïðèìåð\label{TeXr:captop:a}
-\begin{quote}
- |\captionsetup[table]{position=above}|
-\end{quote}
-% causes all captions within tables to be treated as captions \emph{above}
-% the table (regarding spacing around it).
-% Because this is a very common setting, \thispackage\ offers
-% the abbreviating options |figure|\-|position=|\x\meta{pos} and
-% |table|\-|position=|\x\meta{pos}, e.g.
-îïðåäåëÿåò, ÷òî âñå òàáëè÷íûå çàãîëîâêè ïîìåùåíû \emph{íàä} ñîäåðæèìûì
-òàáëèöû (ñ~ñîîòâåòñòâóþùèìè îòáèâêàìè).
-Ïîñêîëüêó ýòî äîñòàòî÷íî ÷àñòî èñïîëüçóåìûå íàñòðîéêè, \thispackage\ ïðåäëàãàåò
-êëþ÷è-àááðåâèàòóðû |figure|\-|position=|\allowbreak\meta{pos}
-è~|table|\-|position=|\allowbreak\meta{pos},
-íàïðèìåð
-\begin{quote}
- |\usepackage[|\ldots|,tableposition=top]{caption}|
-\end{quote}
-% is equivalent to
-ýêâèâàëåíòíî ñëåäóþùåìó
-\begin{quote}
- |\usepackage[|\ldots|]{caption}|\\
- |\captionsetup[table]{position=top}|
-\end{quote}
-
-\medskip
-
-\INFO
-% Please note that the options |skip=|, |position=|, |figure|\-|position=|,
-% and |table|\-|position=| do not always have an effect.
-% Since it's a matter of the document class to supply the environments
-% |figure| and |table|, it could use its very own spacing, and could
-% decide for itself if the caption will be typeset as ``top'' or ``bottom''
-% caption.
- Îáðàòèòå âíèìàíèå, ÷òî êëþ÷è |skip=|, |position=|,
- |figure|\-|position=| è~|table|\-|position=| íå âñåãäà äàäóò ýôôåêò.
- Ïîñêîëüêó îïðåäåëåíèå îêðóæåíèé |figure| è~|table| äàþò êëàññû äîêóìåíòà,
- òî îíè è~îïðåäåëÿþò, áóäåò ëè ïîäïèñü ïîìåùåíà ñâåðõó èëè ñíèçó.
-% For example the \KOMAScript\ document classes support the |skip=|
-% setting, but will always typeset |figure| captions as ``bottom'' captions,
-% and |table| captions are dependent on the global option
-% |table|\-|captions|\-|above| resp.\ |table|\-|captions|\-|below|.
-% \See{\Ref{KOMA}}
- Íàïðèìåð, êëàññû äîêóìåíòîâ \KOMAScript\ ïîääåðæèâàþò íàñòðîéêó |skip=|,
- íî îíà âñåãäà ïå÷àòàåò ïîäïèñè ê~ðèñóíêàì (|figure|) ñíèçó,
- à~ðàçìåùåíèå òàáëè÷íûõ çàãîëîâêîâ (|table|) çàâèñèò îò ãëîáàëüíîé îïöèè
- |table|\-|captions|\-|above| è, ñîîòâåòñòâåííî, |table|\-|captions|\-|below|.
- \See{\Ref{KOMA}}
-
-% Furthermore some packages control the behavior of the spacing above and
-% below the caption for themself, e.g.~the \package{float}, the
-% \package{floatrow}, and the \package{supertabular} package.
- Áîëåå òîãî íåêîòîðûå ïàêåòû ñàìè êîíòðîëèðóþò îòáèâêè ñâåðõó è~ñíèçó ïîäïèñè,
- íàïðèìåð, ïàêåòû \package{float},
- \package{floatrow}, è~\package{supertabular}.
-
-\bigskip
-
-\begin{Expert*}
-% Internally the skip between caption and contents is represented by
-% |\above|\-|caption|\-|skip| (which is always set above the caption in
-% \LaTeX{}s implementation).
-% But there is a second value |\below|\-|caption|\-|skip| (usually set to
-% |0pt| by default) which is set below the caption in \LaTeX{}s implementation,
-% but on the other side than |\above|\-|caption|\-|skip| by this package.
-% So technically speaking, this package swaps the meaning of these two skips
-% when |position=|\x|top| is set.
-% Please note that there are several packages around which do the same trick
-% (like the \package{ftcap}, the \package{nonfloat}, and the \package{topcap}
-% package), so the usage of the \package{caption} option |position=| is not
-% supported if one of these packages will be used, too.
-Ñîáñòâåííî ãîâîðÿ, îòáèâêà ìåæäó ïîäïèñüþ è~ñîäåðæèìûì ôëîòà îïðåäåëÿåòñÿ çíà÷åíèåì
-|\above|\-|caption|\-|skip| (êîòîðàÿ â~ñòàíäàðòíîì
-\LaTeX'å âñåãäà çàäà¸òñÿ ñâåðõó ïîäïèñè).
-Íî ñóùåñòâóåò è~âòîðàÿ êîìàíäà îòáèâêè |\below|\-|caption|\-|skip| (îáû÷íî
-ðàâíàÿ |0pt|) êîòîðàÿ â~ñòàíäàðòíîì \LaTeX'å ïîìåùàåòñÿ ñíèçó ïîäïèñè,
-èëè ñ~ïðîòèâîïîëîæíîé ñòîðîíû îò |\above|\-|caption|\-|skip|, â~äàííîì ïàêåòå.
-Èíà÷å ãîâîðÿ, äàííûé ïàêåò ïåðåêëþ÷àåò çíà÷åíèÿ ýòèõ îòáèâîê ïðè çàäàíèè îïöèè
- |position=|\x|top|.
-Îáðàòèòå âíèìàíèå, ÷òî ñóùåñòâóåò íåñêîëüêî ïàêåòîâ, êîòîðûå äåëàþò òîò æå òðþê
-(ýòî ïàêåòû \package{ftcap}, \package{nonfloat} è~\package{topcap});
-ïîýòîìó, â~ñëó÷àå èñïîëüçîâàíèÿ îäíîãî èç ýòèõ ïàêåòîâ, èñïîëüçîâàíèå êëþ÷à
-|position=| ïàêåòà \package{caption} íå ïîääåðæèâàåòñÿ.
-\end{Expert*}
-
-% --------------------------------------------------------------------------- %
-
-% \subsection{Lists}
-\subsection{Ñïèñêè ôëîòîâ}
-\label{lists}
-
-\DescribeMacro{list=}\label{TeXr:nolistentry:II}\NEWfeature{v3.1}%
-% The |\caption| command usually places an entry in the List of Figures
-% resp.~List of Tables. You can either suppress that individually by giving an
-% empty optional argument to |\caption| {\small(see \Ref{caption})}, or
-% programmatically by saying
-Êîìàíäà |\caption| îáû÷íî ïîìåùàåò òåêñò â~Ñïèñîê ðèñóíêîâ èëè Ñïèñîê òàáëèö.
-Âû ìîæåòå çàïðåòèòü ýòî, çàäàâ ïóñòîé äîïîëíèòåëüíûé àðãóìåíò â~êîìàíäå
-|\caption| {\small(ñì.~\Ref{caption})}, èëè çàäàòü îáùóþ óñòàíîâêó, çàïèñàâ
-\begin{quote}
-% |list=no|\quad(or any other boolean value instead of |no|)\quad.~\footnote{%
-% Please note that the \package{subfig} package\cite{subfig} is not supporting
-% this option, it uses the counters \texttt{lofdepth} \& \texttt{lotdepth} for
-% this purpose instead.}
- |list=no|\quad(èëè äðóãîå çíà÷åíèå áóëåâà ïàðàìåòðà âìåñòî |no|)\quad.~\footnote{%
- Îáðàòèòå âíèìàíèå, ÷òî ïàêåò \package{subfig} package\cite{subfig} íå ïîääåðæèâàåò ýòó îïöèþ,
- îí èñïîëüçóåò äëÿ ýòîé öåëè ñ÷¸ò÷èêè \texttt{lofdepth} \& \texttt{lotdepth}.}
-\end{quote}
-
-\pagebreak[3]
-\DescribeMacro{listformat=}\NEWfeature{v3.1}%
-% With the option
-Ñ~ïîìîùüþ êëþ÷à
-\nopagebreak[3]
-\begin{quote}
- |listformat=|\meta{list format name}
-\end{quote}
-\nopagebreak[3]
-% you can specify how the |figure| or |table| number will be typeset within
-% the List of Figures resp.~List of Tables.
-% There are five standard caption list formats:
-âû ìîæåòå îïðåäåëèòü êàê íîìåð ðèñóíêà (|figure|) èëè òàáëèöû (|table|) áóäóò íàïå÷àòàíû
-â~Ñïèñêå ðèñóíêîâ èëè Ñïèñêå òàáëèö.
-Ñóùåñòâóþò ïÿòü ñòàíäàðòíûõ ôîðìàòîâ âûâîäà ïîäïèñåé â~Ñïèñêàõ:
-
-\begin{Options}{\OptionLabel}
- \item[empty]
-% No number will be typeset.
- Íîìåð íå ïå÷àòàåòñÿ.
-
- \item[simple]
-% The number will be typeset with label prefix.
- Íîìåð ïå÷àòàåòñÿ ñ~ïðåôèêñîì ìåòêè.
-
- \item[parens]
-% The number will be typeset in parentheses, with label prefix.
- Íîìåð ïå÷àòàåòñÿ â~ñêîáêàõ ñ~ïðåôèêñîì ìåòêè.
-
- \item[subsimple]
-% Same as |simple|, but without label prefix. (default)
- Òî æå, ÷òî |simple|, íî áåç ïðåôèêñà. (çàäàíî ïî óìîë÷àíèþ)
-
- \item[subparens]
-% Same as |parens|, but without label prefix.
- Òî æå, ÷òî |parens|, íî áåç ïðåôèêñà.
-
- \item[\UserDefined]
-% Own list formats can be defined using |\Declare|\-|Caption|\-|List|\-|Format|.
-% \SeeUserDefined
- Ñîáñòâåííûå ôîðìàòû ìåòêè â~Ñïèñêàõ ìîãóò áûòü îïðåäåëåíû ñ~èñïîëüçîâàíèåì êîìàíäû |\Declare|\-|Caption|\-|List|\-|Format|.
- \SeeUserDefined
-\end{Options}
-
-% The prefix ($=$|\p@figure| resp.~|\p@table|), which runs ahead of the
-% number ($=$|\the|\-|figure| resp.~|\the|\-|table|) in lists (e.g.~List of
-% Figure/Table) and references, is usually empty,
-% so the list formats |simple| and |subsimple| gives equal results;
-% same with |parens| and |subparens|.
-% But this can be different for sub-figures or sub-tables listed in the List of
-% Figures resp.~List of Tables, or when the label prefix is redefined for a
-% different purpose.\footnote{%
-% Sub-figures and sub-tables can be typeset using the \package{subcaption}
-% or \package{subfig} package.}
-Ïðåôèêñû ìåòêè ($=$|\p@figure| èëè~|\p@table|), êîòîðûå ïîìåùàþòñÿ îáû÷íî
-ïåðåä íîìåðàìè ($=$|\the|\-|figure| èëè~|\the|\-|table| ñîîòâåòñòâåííî)
-â~Ñïèñêàõ (ðèñóíêîâ èëè òàáëèö) îáû÷íî ïóñòû,
-ïîýòîìó ôîðìàòû |simple| è~|subsimple| äàäóò îäèíàêîâûé ðåçóëüòàò,
-òî æå ñàìîå ïðîèçîéä¸ò ñ~|parens|
-è~|subparens|.
-Íî ýòî ìîæåò äàâàòü îòëè÷íûå ðåçóëüòàòû äëÿ ïîäðèñóíêîâ èëè ïîäòàáëèö
-ïîìåù¸ííûõ â~Ñïèñêå ðèñóíêîâ èëè Ñïèñêå òàáëèö, èëè êîãäà ïðåôèêñ ìåòêè ïåðåîïðåäåë¸í
-äëÿ äðóãèõ öåëåé.\footnote{%
- Ïîäïèñè äëÿ ÷àñòåé ðèñóíêîâ è~òàáëèö ìîãóò áûòü ñîçäàíû
- ñ~ïîìîùüþ ïàêåòîâ \package{subcaption}
- èëè \package{subfig}.}
-
-% --------------------------------------------------------------------------- %
-
-% \subsection{Names \& Numbering}
-\subsection{Íàèìåíîâàíèÿ è~íóìåðàöèÿ}
-\label{names}\label{numbering}
-
-\DescribeMacro{figurename=}
-\DescribeMacro{tablename=}\NEWfeature{v3.0l}%
-% You can change the name of the figures and tables with the options
-Âû ìîæåòå èçìåíèòü íàçâàíèå ðèñóíêà è~òàáëèöû ñ~ïîìîùüþ êëþ÷åé
-\begin{quote}\begin{tabular}{@{}r@{}l@{\quad}l@{}}
- |figurename=| & \meta{name} & è\\
- |tablename=| & \meta{name} & .\\
-\end{tabular}\end{quote}
-% The document class usually sets them to ``Figure'' and ``Table'', but for
-% example with
-Êëàññ äîêóìåíòà îïðåäåëÿåò èõ îáû÷íî êàê «Figure» è~«Table», íî åñëè
-âû çàäàäèòå, íàïðèìåð
-\begin{quote}
- |figurename=Fig.|
-\end{quote}
-% you can change the figure name to ``Fig''.
-âû èçìåíèòå èìÿ ðèñóíêà íà «Fig».
-
-\smallskip\INFO
-% If you use the \package{babel} package, please load \thispackage\ \emph{after}
-% the \package{babel} package.
-Åñëè âû ïîëüçóåòåñü ïàêåòîì \package{babel}, çàãðóæàéòå \thispackage\ \emph{ïîñëå}
-ïàêåòà \package{babel}.
-
-\medskip
-
-\pagebreak[3]
-\DescribeMacro{name=}\NEWfeature{v3.1f}%
-% In contrast to the options |figure|\-|name| and |table|\-|name| the option
-Â~îòëè÷èå îò îïöèé |figure|\-|name=| è~|table|\-|name=| îïöèÿ
-\emph{äàííîãî} îêðóæåíèÿ ñ~ïîìîùüþ êëþ÷à
-\begin{quote}
- |name=|\meta{name}\quad.
-\end{quote}
-% changes the name of the \emph{current} environment.
-% This could be useful in conjunction with the optional argument of
-% |\caption|\-|setup|, e.g.
-èçìåíÿåò èìÿ òåêóùåé ìåòêè òåêóùåãî îêðóæåíèÿ.
-Ýòî ìîæåò áûòü ïîëåçíûì ïðè èñïîëüçîâàíèè äîïîëíèòåëüíîãî àðãóìåíòà â~êîìàíäå
-|\caption|\-|setup|, íàïðèìåð çàäàíèå
-\begin{quote}
- |\captionsetup[wrapfigure]{name=Fig.}|
-\end{quote}
-% changes the name to ``Fig.'' for all |wrap|\-|figure|s (while all the other
-% figure captions will still have ``Figure'' as name).
-èçìåíÿåò èìÿ ðèñóíêà íà «Fig.» äëÿ âñåõ îêðóæåíèé |wrap|\-|figure| (â~òî âðåìÿ êàê ïîäïèñè
-ó~äðóãèõ îêðóæåíèé ðèñóíêîâ îñòàþòñÿ «Figure»).
-
-\medskip
-
-\pagebreak[3]%
-\DescribeMacro{listfigurename=}
-\DescribeMacro{listtablename=}\NEWfeature{v3.1g}%
-% Analogous to the options |figure|\-|name| and |table|\-|name| you can change
-% the title of the lists here. So for example
-Àíàëîãè÷íî îïöèÿì |figure|\-|name| è~|table|\-|name| âû ìîæåòå èçìåíèòü
-çàãîëîâîê äëÿ ñïèñêîâ ôëîòîâ. Òàê íàïðèìåð
-\begin{quote}
- |listfigurename=List of Images|
-\end{quote}
-% changes the title ``List of Figures'' to ``List of images''.
-Èçìåíèò çàãîëîâîê «List of Figures» íà «List of Images».
-
-[Èëè, åñëè äëÿ ðóññêîé ëèòåðàòóðû âû çàäàäèòå:
-\begin{quote}
- |listfigurename=\CYRS\cyrp\cyri\cyrs\cyro\cyrk\ |\\ |\cyri\cyrl\cyrl\cyryu\cyrs\cyrt\cyrr\cyra\cyrc\cyri\cyrishrt|
-\end{quote}
-èëè
-\begin{quote}\def\ttdefault{cmtt}
- |listfigurename=Ñïèñîê èëëþñòðàöèé|
-\end{quote}
-ïðåâðàòèò çàãîëîâîê â~«Ñïèñîê èëëþñòðàöèé».]
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{figurewithin=}
-\DescribeMacro{tablewithin=}\NEWfeature{v3.1f}%
-% If a document class providing |\chapter| is used (e.g.~\class{report} or
-% \class{book}), usually the |figure| and |table| caption counters
-% are dependent on the |chapter| counter. Otherwise usually the |figure| and
-% |table| counters are continuous throughout the document.
-Åñëè êëàññ äîêóìåíòà çàäà¸ò ãëàâû, è~èñïîëüçóåòñÿ êîìàíäà |\chapter|
-(íàïðèìåð \package{report} èëè
-\package{book}), òî íóìåðàöèÿ ñ÷¸ò÷èêîâ ïîäïèñåé |figure| è~|table|
-ïîä÷èíåíà ñ÷¸ò÷èêó ãëàâû |chapter|. Â~ïðîòèâíîì ñëó÷àå íóìåðàöèÿ |figure|
-è~|table| ïðîäîëæàåòñÿ ïî âñåìó äîêóìåíòó.
-
-% This can be changed with the options
-Ýòî ìîæåò áûòü èçìåíåíî ñ~ïîìîùüþ îïöèè
-\begin{quote}\begin{tabular}{r@{}l}
- |figurewithin=| & \texttt{chapter} \emph{èëè} \texttt{section} \emph{èëè} \texttt{none}\quad è\\
- |tablewithin=| & \texttt{chapter} \emph{èëè} \texttt{section} \emph{èëè} \texttt{none}\quad .\\
-\end{tabular}\end{quote}
-% If ``|none|'' is given as value, the numbering of figures resp. tables will
-% be continuous throughout the document.
-% Otherwise the numbering will be dependent on the given counter,
-% e.g.~|figure|\-|within=|\x|section| gives figures a section-dependent
-% numbering scheme.
-Åñëè çàäàíà îïöèÿ «|none|», íóìåðàöèÿ ðèñóíêîâ è~òàáëèö áóäåò ñêâîçíîé âî
-âñ¸ì äîêóìåíòå.
-Â~ïðîòèâíîì ñëó÷àå íóìåðàöèÿ áóäåò ïîä÷èíåíà çàäàííîìó ñ÷¸ò÷èêó,
-íàïðèìåð, |figurewithin=|\x|section| ñîçäàñò íóìåðàöèþ ðèñóíêîâ,
-ïîä÷èí¸ííóþ çàãîëîâêàì ðàçäåëîâ
-ïåðâîãî óðîâíÿ.
-
-\bigskip
-
-\begin{Expert*}
-% The name and numbering is internally done by the commands
-% |\|\meta{type}|name| \& |\the|\meta{type}, e.g.~|\figure|\-|name| \&
-% |\the|\-|figure| for figures.
-% While usually using the above options are sufficient, sometimes a direct
-% re-definition of these two macros is necessary. For example:
-Íàçâàíèå è~íóìåðàöèÿ îïðåäåëÿþòñÿ êîìàíäàìè |\|\meta{type}|name|
-è~|\the|\meta{type}, íàïðèìåð |\figurename| è~|\thefigure| äëÿ ðèñóíêîâ.
-Õîòÿ çàäàíèå êëþ÷åé, îïèñûâàåìûõ âûøå äîñòàòî÷íî, èíîãäà íåîáõîäèìî
-ïðÿìîå ïåðåîïðåäåëåíèå ýòèõ äâóõ êîìàíä. Íàïðèìåð:
-\begin{quote}
- |\captionsetup{figurewithin=section}|\\
- |\renewcommand\thefigure{\arabic{section}\alph{figure}}|
-\end{quote}
-% gives you a section-dependent numbering scheme \meta{section}\meta{figure}
-% with a numerical section counter and a alphanumerical figure counter,
-% e.g.~``|Figure 2b|''.
-äàñò âàì ïîä÷èí¸ííóþ ðàçäåëó ñõåìó íóìåðàöèè \meta{section}\meta{figure}
-ãäå íîìåð ðàçäåëà çàäàí â~âèäå àðàáñêîé öèôðû, à~íîìåð ðèñóíêà \cdash--- â~âèäå íóìåðàöèè áóêâàìè,
-íàïðèìåð, «|Figure 2b|».
-\end{Expert*}
-
-% --------------------------------------------------------------------------- %
-
-% \subsection{Types}
-\subsection{Òèïû (ôëîòîâ)}
-\label{types}
-
-\DescribeMacro{type=}\NEWfeature{v3.0d}%
-% The |\caption| command can typeset captions for different types,
-% e.g.~|figure| and |table|. If you try to use the |\caption| command outside
-% these environments you will get an error message, because it does not know what
-% kind of caption do you want to have here. But in such situations you can set
-% the caption type manually with
-Êîìàíäà |\caption| ìîæåò ñîçäàòü ïîäïèñè ðàçëè÷íûõ òèïîâ,
-íàïðèìåð, |figure| è~|table|. Åñëè âû ïîïðîáóåòå çàäàòü êîìàíäó |\caption| çà ïðåäåëàìè
-ýòèõ îêðóæåíèé, òî ïîëó÷èòå ñîîáùåíèå îá îøèáêå, ïîñêîëüêó ýòà êîìàíäà íå çíàåò
-êàêîé òèï ïîäïèñè âû õîòèòå çäåñü ñîçäàòü. Íî â~ïîäîáíûõ ñèòóàöèÿõ
-âû ìîæåòå çàäàòü òèï ïîäïèñè âðó÷íóþ, èñïîëüçóÿ
-\begin{quote}
- |type=|\meta{float type}
-\end{quote}
-% prior to the usage of the |\caption| command (and other commands like
-% |\Continued|\-|Float|, or |\sub|\-|caption|\-|box| offered by the
-% \package{subcaption} package, or |\sub|\-|float| offered by the
-% \package{subfig} package\cite{subfig}),
-% for example within an non-floating environment like |minipage|:
-ïåðåä èñïîëüçîâàíèåì êîìàíäû |\caption| (è~äðóãèõ êîìàíä òèïà
-|\Continued|\-|Float|, èëè |\sub|\-|caption|\-|box| ïðåäëàãàåìîé ïàêåòîì
- \package{subcaption} èëè |\subfloat| ïðåäëàãàåìîé ïàêåòîì \package{subfig}\cite{subfig}),
-íàïðèìåð âíóòðè íåïëàâàþùåãî îêðóæåíèÿ âðîäå |minipage|:
-\begin{quote}
- |\noindent\begin{minipage}{\textwidth}|\\
- | \captionsetup{type=figure}|\\
- | \subfloat{|\ldots|}|\\
- | |\ldots\\
- | \caption{|\ldots|}|\\
- |\end{minipage}|
-\end{quote}
-
-\begin{Expert}
-% There is also a starred variant of this option, |type*=|\meta{float type},
-% which behaves different than |type=|\meta{float type} if the
-% \package{hyperref} package\cite{hyperref} is loaded: While |type=| sets an
-% hyperlink anchor (if |hypcap=|\x|true| is set), |type*=| does not.
-% (See also \Ref{hyperref}\,)
-Ñóùåñòâóåò çâ¸çäíûé âàðèàíò ýòîãî êëþ÷à, |type*=|\x\meta{float type},
-êîòîðûé îòëè÷àåòñÿ îò |type=|\x\meta{float type} åñëè çàãðóæåí ïàêåò
-\package{hyperref}\cite{hyperref}: â~òî âðåìÿ êàê êëþ÷ |type=| çàäà¸ò
-ìåòêó ãèïåðññûëêè (hyperlink anchor, åñëè çàäàí êëþ÷ |hypcap=|\x|true|), êëþ÷ |type*=| ýòîãî íå äåëàåò.
-(Ñì.~òàêæå \Ref{hyperref})
-\end{Expert}
-\begin{Expert}
-% \emph{\DefaultNoteText:} Please don't re-define the internal macro |\@captype|
-% for yourself, like suggested by some documentations, always use
-% |\caption|\-|setup{type=|\x\ldots|}| instead.
-\emph{\DefaultNoteText}: íå ïåðåîïðåäåëÿéòå, ïîæàëóéñòà, âíóòðåííþþ ìàêðîêîìàíäó |\@captype|,
-êàê ïðåäëàãàåòñÿ íåêîòîðûìè ðóêîâîäñòâàìè èëè äîêóìåíòàìè ïàêåòîâ, äëÿ
-ýòîãî èñïîëüçóéòå âñåãäà
-|\caption|\-|setup{type=|\x\ldots|}|.
-\end{Expert}
-
-\medskip
-
-% Own float types can be defined with |\Declare|\-|Caption|\-|Type| offered by
-% this package, |\new|\-|float| offered by the \package{float}
-% package\cite{float}, or |\Declare|\-|New|\-|Float|\-|Type| offered by the
-% \package{floatrow} package\cite{float}.
-Ñîáñòâåííûå òèïû ôëîòîâ ìîãóò áûòü îïðåäåëåíû ñ~ïîìîùüþ êîìàíäû |\Declare|\-|Caption|\-|Type|
-ïðåäëàãàåìîé ýòèì ïàêåòîì, êîìàíäîé |\new|\-|float|, ïðåäëàãàåìîé ïàêåòîì \package{float}\cite{float},
-èëè |\Declare|\-|New|\-|Float|\-|Type| ïðåäëàãàåìîé ïàêåòîì
-\package{floatrow}\cite{floatrow}.
-
-\medskip
-
-\INFO % \NEWdescription{v3.1}
-% Please note that you should use the option |type=| only
-% \emph{inside} boxes or environments (like |\par|\-|box| or |mini|\-|page|),
-% at best one where no page break could happen between contents and caption.
-% Furthermore some visual side-effects (e.g.~mixed-up figure and table settings
-% regarding captions) could occur without using a box or environment,
-% therefore a warning message will be issued if you try to do so.\footnote{%
-% You only get this warning message if you use \eTeX\ as underlying \TeX\ engine.}
-Îáðàòèòå âíèìàíèå, ÷òî ëó÷øå èñïîëüçîâàòü êëþ÷ |type=| òîëüêî
-\emph{âíóòðè} áîêñîâ èëè òàêèõ îêðóæåíèé (òèïà |\parbox| èëè |minipage|), ò.\,å.
-ãäå íå ìîæåò ïðîèçîéòè ïåðåõîäà íà ñëåäóþùóþ ñòðàíèöó ìåæäó ïîäïèñüþ è~ñîäåðæèìûì ôëîòà.
-Ïîìèìî ýòîãî âîçìîæíû íåêîòîðûå ïîáî÷íûå ýôôåêòû (íàïðèìåð, ñìåøåíèå íàñòðîåê äëÿ ïîäïèñåé
-ðèñóíêîâ è~òàáëèö) åñëè íå èñïîëüçóåòñÿ áîêñ èëè îêðóæåíèå, êðîìå ýòîãî
-âû ïîëó÷èòå ïðåäóïðåæäåíèå, åñëè ïîïðîáóåòå ýòî ñäåëàòü.\footnote{%
-Âû ïîëó÷èòå ýòî ïðåäóïðåæäåíèå òîëüêî â~ñëó÷àå, êîãäà â~êà÷åñòâå êîìïèëÿòîðà \TeX'à èñïîëüçóåòñÿ
-\eTeX.}
-
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-% \section{Commands}
-\section{Êîìàíäû}
-
-% \subsection{Typesetting captions}
-\subsection{Ïå÷àòü ïîäðèñóíî÷íûõ ïîäïèñåé}
-\label{caption}
-\label{captionlistentry}
-
-\DescribeMacro{\caption}
-% The command
-Êîìàíäà
-\begin{quote}
- |\caption|\oarg{list entry}\marg{heading}
-\end{quote}
-% typesets the caption inside a floating environment like |figure| or |table|.
-% Well, you already know this, but \thispackage\ offers an extension:
-% If you leave the argument \meta{list entry} empty, no entry in the list of
-% figures or tables will be made. For example:
-ïå÷àòàåò ïîäïèñü âíóòðè îêðóæåíèÿ ôëîòà, òèïà |figure| èëè |table|.
-Òàê, ýòî íàì èçâåñòíî, íî íîâîñòü ñîñòîèò â~òîì, ÷òî åñëè
-çàäàòü àðãóìåíò \meta{list entry} ïóñòûì, ïîäïèñü â~ñïèñêå ðèñóíêîâ èëè
-òàáëèö íå ïîÿâèòñÿ; íàïðèìåð,
-\begin{quote}
-% |\caption[]{A figure without list entry.}|
- |\caption[]{Ïîäïèñü áåç çàïèñè â~ñïèñêå ðèñóíêîâ.}|
- \label{TeXr:nolistentry:I}%
-\end{quote}
-
-\begin{Expert}
-% Please remember that the \meta{heading} is a so-called \emph{moving} argument,
-% if no \meta{list entry} has been given. But if a \meta{list entry} is given,
-% this argument is moving instead.
-% ``\emph{Moving} argument'' means that the argument will be written to the
-% list-of file, make it appearing in the ``List of Figures'' resp.
-% ``List of Tables'', too.
-% \emph{Moving} arguments are not allowed to contain \emph{fragile} commands,
-% everything must be \emph{robust}, otherwise the argument could get
-% \emph{broken}, resulting in strange errors at the next \LaTeX\ run.
-% Some \emph{fragile} commands could be \emph{protected} by a leading |\protect|,
-% own definitions could get defined with |\Declare|\-|Robust|\-|Command| instead of
-% |\new|\-|command| to make them \emph{robust}.
-Íàïîìíèì, ÷òî àðãóìåíò \meta{heading} áóäåò \emph{ïîäâèæíûì},
-åñëè íå çàäàí äîïîëíèòåëüíûé àðãóìåíò \meta{list entry}. Åñëè æå çàäàí \meta{list entry},
-òî ñòàíîâèòñÿ ïîäâèæíûì ýòîò äîïîëíèòåëüíûé àðãóìåíò. Òåðìèí «\emph{ïîäâèæíûé} àðãóìåíò»
-â~äàííîì ñëó÷àå îçíà÷àåò, ÷òî îí çàïèñûâàåòñÿ â~ôàéëå Ñïèñêà, ÷òîáû
-çàòåì åãî âûâåñòè â~ðàçäåëàõ «Ñïèñîê ðèñóíêîâ» èëè «Ñïèñîê òàáëèö».
-Â~\emph{ïîäâèæíûå} àðãóìåíòû íåëüçÿ ïîìåùàòü \emph{õðóïêèå} êîìàíäû,
-âñå ýëåìåíòû äîëæíû áûòü \emph{íåðàçáèâàåìûìè} (íåõðóïêèìè), èíà÷å àðãóìåíò áóäåò
-«\emph{ðàçáèò}» (ðàñêðûò), ñîçäàâàÿ ñòðàííûå îøèáêè â~ñëåäóþùèõ
-îáðàáîòêàõ \LaTeX'îì. Íåêîòîðûå \emph{õðóïêèå}
-êîìàíäû ìîãóò áûòü \emph{çàùèùåíû} çàäàíèåì ïåðåä íèìè êîìàíäû |\protect|.
-×òîáû ñîáñòâåííûå
-îïðåäåëåíèÿ áûëè \emph{íåðàçáèâàåìûìè}, èõ íóæíî îïðåäåëÿòü ÷åðåç |\DeclareRobustCommand|, à~íå
-÷åðåç |\newcommand|.
-
-% An example: |\caption{${}^{137}_{\phantom{1}55}$Cs}| will cause errors since
-% |\phantom| is \emph{fragile}.
-% So we have either have to use the optional argument \meta{list entry}
-% (e.g.~|\caption[${}^|\x|{137}_|\x|{55}$|\x|Cs]|\x|{${}^|\x|{137}_|\x|{\phantom{1}55}$|\x|Cs}|)
-% or add |\protect| to prevent the |\phantom| command from getting \emph{broken}:
-% |\caption{${}^|\x|{137}_|\x|{|\textcolor{blue}{\cs{protect}}|\phantom{1}55}$|\x|Cs}|.
-Ïðèìåð: çàïèñü |\caption{${}^{137}_{\phantom{1}55}$Cs}| âûäàñò ñîîáùåíèÿ îá îøèáêàõ,
-ïîñêîëüêó êîìàíäà |\phantom| \emph{õðóïêàÿ}. Ïîýòîìó íóæíî ëèáî çàäàòü äîïîëíèòåëüíûé àðãóìåíò
-\meta{list entry}
-(íàïðèìåð,
-|\caption[${}^|\x|{137}_|\x|{55}$|\x|Cs]|\x|{${}^|\x|{137}_|\x|{\phantom{1}55}$|\x|Cs}|)
-èëè äîáàâèòü êîìàíäó |\protect|, äëÿ çàùèòû êîìàíäû |\phantom| îò òîãî, ÷òîáû îíà
-\emph{ðàçáèëàñü}:
-|\caption{${}^|\x|{137}_|\x|{|\textcolor{blue}{\cs{protect}}|\phantom{1}55}$|\x|Cs}|.
-
-% But sometimes even this is not sufficient. The reason behind is the so-called
-% single-line-check: It puts the \meta{heading} into a horizontal box to determine
-% the width of the caption, and this could cause error messages, too.
-% An example:
-% |\caption{A| |scheme.| |\[V_{C}| |\sim| |\left| |\{| |\begin{array}{cc}|
-% |E_{g}| |&| |\textrm{p-n}| |\\| |e\phi_{B}| |&| |\textrm{M-S}| |\end{array}|
-% |\right.| |\]}|.
-% Using |\caption[A| |scheme]{|\ldots|}| is not sufficient here, it's still
-% leading to errors. (``\texttt{Missing \$ inserted.}'')
-% So we have to put a |\caption|\-|setup{single|\-|line|\-|check=|\x|off}|
-% just in front of the |\caption| command additionally.
-Íî èíîãäà è~ýòî íå ïîìîãàåò. Ïðè÷èíà êðîåòñÿ â~òàê íàçûâàåìîé ïðîâåðêå
-íà îäíîñòðî÷íóþ ïîäïèñü
-(single-line-check): ìàêðîêîìàíäà ïîìåùàåò ñîäåðæèìîå àðãóìåíòà \meta{heading}
-â~ãîðèçîíòàëüíûé áîêñ,
-÷òîáû îïðåäåëèòü øèðèíó ïîäïèñè, è~ýòî òàêæå ìîæåò ñîçäàòü ñîîáùåíèÿ îá îøèáêàõ.
-Ïðèìåð:
-|\caption{A| |scheme.| |\[V_{C}| |\sim| |\left| |\{| |\begin{array}{cc}|
-|E_{g}| |&| |\textrm{p-n}| |\\| |e\phi_{B}| |&| |\textrm{M-S}| |\end{array}|
-|\right.| |\]}|.
-Èñïîëüçîâàíèå |\caption[A| |scheme]{|\ldots|}| çäåñü íå ãîäèòñÿ,
-ýòî òîæå ïðèâåä¸ò ê~îøèáêàì.
-(«\texttt{Missing \$ inserted.}») Ïîýòîìó ìû âûíóæäåíû äîïîëíèòåëüíî çàäàòü
-|\captionsetup{singlelinecheck=off}| ïåðåä êîìàíäîé |\caption|.
-
-% For more information about \emph{moving} arguments and \emph{fragile} \&
-% \emph{robust} commands, take a closer look at your \LaTeX\ manual or visit
-% \url{http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/teTeX/latex/latex2e-html/fragile.html}.
-Áîëåå ïîëíóþ èíôîðìàöèþ î~\emph{ïîäâèæíûõ} àðãóìåíòàõ è~\emph{õðóïêèõ}
-è~\emph{íåðàçáèâàåìûõ} êîìàíäàõ, ñìîòðèòå â~âàøåì ðóêîâîäñòâå ïî \LaTeX'ó èëè îáðàòèòåñü ê~%
-\url{http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/teTeX/latex/latex2e-html/fragile.html}.
-\end{Expert}
-
-\medskip
-
-\pagebreak[3]
-\DescribeMacro{\caption*}\label{TeXr:starcaption:a}%
-% The \package{longtable} package defines the command |\caption*| which
-% typesets the caption without label and without entry in the list of tables.
-% An example:
-Ïàêåò \package{longtable} îïðåäåëÿåò êîìàíäó |\caption*| êîòîðàÿ
-ïå÷àòàåò ïîäïèñü áåç ìåòêè è~çàíåñåíèÿ å¸ â~ñïèñîê òàáëèö.
-Ïðèìåð:
-\begin{quote}
- |\begin{longtable}{|\ldots|}|\\
- | \caption*{A table}\\|\\
- | |\ldots\\
- |\end{longtable}|
-\end{quote}
-% looks like
-âûãëÿäèò ñëåäóþùèì îáðàçîì:\nopagebreak
-\DeleteShortVerb{\|}
-\vskip\intextsep
-\begin{minipage}{\linewidth}
- \captionsetup{type=table,position=t}
- \caption*{A table}
- \centering
- \begin{tabular}{r|rr}
- & x & y \\\hline
- a & 1 & 2 \\
- b & 3 & 4 \\
- \end{tabular}
-\end{minipage}
-\vskip\intextsep
-\MakeShortVerb{\|}
-% \Thispackage\ offers this feature, too, so you can use this command now within
-% every floating environment like |figure| or |table|, like:
-\Thispackage\ òîæå ïðåäëàãàåò òàêóþ âîçìîæíîñòü. È~òåïåðü âû ìîæåòå èñïîëüçîâàòü ýòó êîìàíäó
-ñ~ëþáûì îêðóæåíèåì ïëàâàþùåãî îáúåêòà, íàïðèìåð |figure| èëè |table|, êàê çäåñü:
-\begin{quote}
- |\begin{table}|\\
- | \caption*{A table}|\\
-% | \begin{tabular}{|\ldots|}|\\
-% | |\ldots\\
-% | \end{tabular}|\\
- | |\ldots\\
- |\end{table}|
-\end{quote}
-
-\pagebreak[3]
-\DescribeMacro{\captionof}\label{TeXr:captionof:a}%
-\DescribeMacro{\captionof*}
-% Sometimes you want to typeset a caption \emph{outside} a floating environment,
-% putting a figure within a non-floating |mini|\-|page| for instance.
-% For this purpose \thispackage\ offers the command
-Èíîãäà âàì íóæíî ñîçäàòü ïîäïèñü \emph{âíå} îêðóæåíèÿ ôëîòà,
-ïîìåñòèâ, ê~ïðèìåðó, ïîäïèñü âíóòðè îêðóæåíèÿ |minipage|. Äëÿ ýòîé öåëè ïàêåò
-\thispackage\ ïðåäëàãàåò êîìàíäó
-\begin{quote}
- |\captionof|\marg{float type}\oarg{list entry}\marg{heading}\quad.
-\end{quote}
-% Note that the first argument, the \meta{float type}, is mandatory here, because
-% the |\captionof| command needs to know which name to put into the caption label
-% (e.g. ``Figure'' or ``Table'') and in which list to put the contents entry.
-% An example:
-Îáðàòèòå âíèìàíèå, ÷òî ïåðâûé àðãóìåíò, \meta{float type}, â~äàííîì ñëó÷àå ÿâëÿåòñÿ
-îáÿçàòåëüíûì, ïîñêîëüêó êîìàíäà |\captionof| äîëæíà çíàòü, ê~êàêîìó ïëàâàþùåìó
-îáúåêòó ñîçäàòü ïîäïèñü (íàïðèìåð. «Ðèñ.» èëè «Òàáëèöà») è~â~êàêîé ñïèñîê ôëîòîâ ïîìåñòèòü
-ïîäïèñü. Ïðèìåð
-\begin{quote}
-% |\captionof{figure}{A figure}|\\
- |\captionof{table}{A table}|
-\end{quote}
-% typesets captions like this:
-ñîçäà¸ò ïîäïèñè êàê çäåñü:
-\begin{Example}
-% \begingroup
-% \captionof{figure}{A figure}
-% \endgroup
- \captionsetup{position=top}
-% \begingroup
- \captionof{table}{A table}
-% \endgroup
-\end{Example}
-
-% The star variant |\caption|\-|of*| has the same behavior as the |\caption*|
-% command:
-% It typesets the caption without label and without entry to the list of figures
-% or tables.
-«Çâ¸çäíûé» âàðèàíò |\captionof*| äà¸ò òîò æå ðåçóëüòàò, ÷òî è~|\caption*|:
-ïå÷àòàåò ïîäïèñü áåç íóìåðàöèîííîãî çàãîëîâêà è~âûâîäà â~Ñïèñîê ðèñóíêîâ èëè
-òàáëèö.
-
-\INFO % \NEWdescription{v3.1}
-% Since |\caption|\-|of| uses the option |type| internally, the same
-% restrictions as for the |type| option apply here, so you should use both
-% |\caption|\-|of| and |\caption|\-|of*| only \emph{inside} boxes or
-% environments, too.
-Ïîñêîëüêó êîìàíäà |\captionof| èñïîëüçóåò âíóòðè ñåáÿ êëþ÷ |type|, òå æå îãðàíè÷åíèÿ, ÷òî è~äëÿ
-êëþ÷à |type=| äåéñòâóþò çäåñü, ïîýòîìó âû ìîæåòå èñïîëüçîâàòü è~|\captionof|
-è~|\captionof*| òîëüêî \emph{âíóòðè} áîêñîâ èëè îêðóæåíèé.
-\See{\Ref{types}}
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{\captionlistentry}\NEWfeature{v3.1}%
-% Under certain circumstances it could be useful to make a list-of-figure
-% (or table) entry on its own.
-% This could be achieved with
-Â~íåêîòîðûõ ñëó÷àÿõ ìîæåò áûòü ïîëåçíûì ñîçäàíèå òåêñòà äëÿ Ñïèñêà ðèñóíêîâ (èëè òàáëèö) îòäåëüíî.
-Ýòî ìîæíî ñäåëàòü ñ~ïîìîùüþ
-\begin{quote}
- |\captionlistentry|\oarg{float type}\marg{list entry}\quad.
-\end{quote}
-
-% One example: It's quite easy to have a |long|\-|table| with captions above the
-% contents and a single list entry which points to the first page of the table:
-Îäèí ïðèìåð: î÷åíü ëåãêî ïîëó÷èòü òàáëèöó â~îêðóæåíèè |long|\-|table|
-ñ~ïîäïèñÿìè ñâåðõó òàáëèöû
-è~îäíèì âõîæäåíèåì â~Ñïèñêå êîòîðîå îòìå÷àåò ïåðâóþ ñòðàíèöó òàáëèöû:
-\begin{quote}
- |\begin{longtable}{|\ldots|}|\\
- | \caption{|\ldots|}\\|\\
- |\endfirsthead|\\
- | \caption[]{|\ldots|}\\|\\
- |\endhead|\\
- | |\ldots
-\end{quote}
-% But since the \package{longtable} package does not offer an
-% |\end|\-|first|\-|foot| command, you cannot easily have captions \emph{below}
-% the table contents and a single list entry which points to the first page of
-% the table.
-% Here is were the |\caption|\-|list|\-|entry| command could be used:
-Íî, ïîñêîëüêó ïàêåò \package{longtable} íå ïðåäëàãàåò êîìàíäû |\endfirstfoot|,
-âû íå ìîæåòå èñïîëüçîâàòü ïîäïèñè \emph{ñíèçó} òàáëèöû, äëÿ ñîçäàíèÿ åäèíñòâåííîãî
-âõîæäåíèÿ â~Ñïèñîê, êîòîðûé îòìå÷àåò ïåðâóþ ñòðàíèöó òàáëèöû.
-Ýòî ñèòóàöèÿ, ãäå êîìàíäà |\captionlistentry| ìîæåò áûòü ïîëåçíà:
-\begin{quote}
- |\begin{longtable}{|\ldots|}|\\
- | \caption[]{|\ldots|}\\|\\
- |\endfoot|\\
- | \captionlistentry{|\ldots|}|\\
- | |\ldots
-\end{quote}
-\begin{Annotation*}
-% Another example can be found in \Ref{examples}.
-Äðóãîé ïðèìåð ìîæíî íàéòè â~\Ref{examples}.
-\end{Annotation*}
-
-\smallskip
-
-\begin{Expert}
-% There is also a starred variant, |\caption|\-|list|\-|entry*|, which does not
-% increment the \meta{float type} counter.
-% (Note that inside |long|\-|table| environments |\caption|\-|list|\-|entry|
-% never increments the |table| counter. See also \Ref{longtable}.)
-Òàêæå ñóùåñòâóåò «çâ¸çäíûé» âàðèàíò |\caption|\-|list|\-|entry*|, êîòîðûé
-íå óâåëè÷èâàåò çíà÷åíèå ñ÷¸ò÷èêà ôëîòà.
-(Îáðàòèòå âíèìàíèå, ÷òî âíóòðè îêðóæåíèÿ |long|\-|table| êîìàíäà |\caption|\-|list|\-|entry|
-íèêîãäà íå óâåëè÷èâàåò çíà÷åíèÿ ñ÷¸ò÷èêà òàáëèöû. Ñì.~òàêæå îïèñàíèå \Ref{longtable}.)
-\end{Expert}
-
-\begin{Expert}
-% Please note that \meta{list entry} is a \emph{moving} argument, so everything
-% it contains must be \emph{robust}. (See also explanation of |\caption|)
-Îáðàòèòå òàêæå âíèìàíèå, ÷òî \meta{list entry} ÿâëÿåòñÿ \emph{ïîäâèæíûì}
-àðãóìåíòîì, ïîýòîìó âñ¸ åãî
-ñîäåðæèìîå äîëæíî áûòü \emph{íåðàçáèâàåìûì}. (Ñì.~òàêæå îïèñàíèå êîìàíäû |\caption|)
-\end{Expert}
-
-
-% \subsection{Setting options}
-\subsection{Çàäàíèå êëþ÷åé è~îïöèé}
-\label{captionsetup}
-
-\DescribeMacro{\captionsetup}
-% We already know the |\caption|\-|setup| command (see \Ref{usage}),
-% but this time we get enlighten about its optional argument
-% \meta{float type}.
-Íàì óæå èçâåñòíà êîìàíäà |\captionsetup| (ñì.~\Ref{usage}),
-íî ñåé÷àñ ìû ðàçáåð¸ì çíà÷åíèå äîïîëíèòåëüíîãî àðãóìåíòà, \meta{float type}.
-
-% Remember, the syntax of this command is
-Íàïîìíèì ñèíòàêñèñ ýòîé êîìàíäû
-\begin{quote}
- |\captionsetup|\oarg{float type}\marg{options}\quad.
-\end{quote}
-
-% If a \meta{float type} gets specified, all the \meta{options} don't
-% change anything at this time. Instead they only get marked for a later use,
-% when a caption inside of a floating environment of the particular type
-% \meta{float type} gets typeset.
-% For example
-Åñëè \meta{float type} çàäàí, âñå êëþ÷è è~îïöèè, \meta{options} íè÷åãî
-íå èçìåíÿò â~ìåñòå çàäàíèÿ. Îíè òîëüêî îïðåäåëåíû äëÿ áóäóùåãî èñïîëüçîâàíèÿ
-â~ìîìåíò, êîãäà ïîäïèñü îêàæåòñÿ âíóòðè îêðóæåíèÿ ôëîòà
-\meta{float type}.
-Íàïðèìåð
-\begin{quote}
- |\captionsetup[figure]|\marg{options}
-\end{quote}
-% forces captions within a |figure| environment to use the given \meta{options}.
-îïðåäåëÿåò îôîðìëåíèå \meta{options} äëÿ ïîäïèñè âíóòðè îêðóæåíèÿ |figure|.
-
-% Here comes an example to illustrate this:
-Äàëåå èä¸ò ïðèìåð èëëþñòðèðóþùèé ñêàçàííîå:
-\begin{quote}
- |\captionsetup{font=small}|\\
- |\captionsetup[figure]{labelfont=bf,textfont=it}|
-\end{quote}
-% gives captions like this:
-ñîçäàñò ïîäïèñè âèäà:
-\begin{Example}
- \captionsetup{font=small}
- \captionsetup[figure]{labelfont=bf,textfont=it}
- \begingroup
- \captionof{figure}{A figure}
- \endgroup
- \captionsetup{position=top}
- \begingroup
- \captionof{table}{A table}
- \endgroup
-\end{Example}
-% As you see the command |\caption|\-|setup[figure]{|\ldots|}| only changes
-% the look of the |figure| caption labels, not touching the other ones.
-Êàê âû âèäèòå óñòàíîâêà |\caption|\-|setup[figure]{labelfont=bf}| èçìåíÿåò
-òîëüêî øðèôò íóìåðàöèîííîé ÷àñòè ïîäïèñè, âñ¸ îñòàëüíîå îñòà¸òñÿ.
-
-% As \meta{float type} you can usually give one of these two only:
-% |figure| or |table|.
-% But as we will see later some \LaTeX\ packages (like the \package{floatrow},
-% \package{longtable}, and \package{sidecap} package for example) and also
-% this package offer additional environments with captions and these two
-% commands can also be used with them.
-% \See{\Ref{declare} and \Ref{packages}}
-Â~êà÷åñòâå \meta{float type} âû îáû÷íî çàäà¸òå òîëüêî äâå îïöèè:
-|figure| èëè |table|.
-Íî êàê áóäåò âèäíî ïîçäíåå íåêîòîðûå ïàêåòû \LaTeX'à (íàïðèìåð \package{floatrow},
-\package{longtable} è~\package{sidecap}) à~òàêæå äàííûé ïàêåò
-ïðåäëàãàþò äîïîëíèòåëüíûå îêðóæåíèÿ ñ~ïîäïèñÿìè è~ýòè äâå êîìàíäû
-ìîãóò áûòü ñ~íèìè èñïîëüçîâàíû.
-\See{\Ref{declare} è~\Ref{packages}}
-
-\smallskip
-
-\pagebreak[3]
-\NEWfeature{v3.1}
-\begin{Expert}
-% There is also a starred variant of |\caption|\-|setup|:
-Ñóùåñòâóåò è~çâ¸çäíûé âàðèàíò êîìàíäû |\captionsetup|:
-\begin{quote}
- |\captionsetup*|\oarg{float type}\marg{options}
-\end{quote}
-% While the non-starred variant can give you warnings---for example if the
-% \meta{options} are actually not used throughout the document
-% (e.g.~a |\caption|\-|setup[table]{font=|\x|sf}| without a |table|)---the
-% starred variant will not.
-% \iffalse
-% This can get quite useful when setting generic options which are independent
-% of a specific document.
-% \fi
-Â~òî âðåìÿ êàê íåçâ¸çäíûé âàðèàíò äàñò âàì ïðåäóïðåæäåíèå, åñëè \meta{options} íå
-èñïîëüçîâàëèñü â~äîêóìåíòå (íàïðèìåð íàñòðîéêè |\captionsetup[table]{font=sf}| \cdash---
-è~íè îäíîãî îêðóæåíèÿ |table|), çâ¸çäíûé âàðèàíò ýòîãî íå äåëàåò.
-\iffalse
-Ýòî ìîæåò áûòü î÷åíü ïîëåçíî äëÿ ñîçäàíèÿ íàñòðîåê, íåçàâèñèìûõ îò êîíêðåòíîãî äîêóìåíòà.
-\fi
-\end{Expert}
-
-\medskip
-
-\pagebreak[3]
-\DescribeMacro{\clearcaptionsetup}
-% If you want to get rid of these parameters marked for an automatic use within
-% a particular environment you can use the command
-Åñëè âàì âíóòðè äàííîãî îêðóæåíèÿ íóæíî îòìåíèòü ïàðàìåòðû, çàäàííûå äëÿ
-òåêóùåãî òèïà ôëîòà, èñïîëüçóéòå êîìàíäó
-\begin{quote}
- |\clearcaptionsetup|\oarg{option}\marg{float type}\quad.
-\end{quote}
-
-% For example |\clearcaptionsetup{figure}| would clear all the extra handling
-% for figures in the example above:
-Íàïðèìåð |\clearcaptionsetup{figure}| îòìåíèò äîïîëíèòåëüíûå íàñòðîéêè
-èç ïðèìåðà âûøå:
-\begin{quote}
- |\captionsetup{font=small}|\\
- |\captionsetup[figure]{labelfont=bf,textfont=it}|\\
- \ldots\\
- | \caption{A figure}|\\
- \ldots\\
- |\clearcaptionsetup{figure}|\\
- \ldots\\
- | \caption{A figure}|\\
- \ldots\\
-\end{quote}
-\pagebreak[3]
-\begin{Example}
- \captionsetup{font=small}
- \captionsetup[figure]{labelfont=bf,textfont=it}
- \begingroup
- \captionof{figure}{A figure}
- \endgroup
- \captionsetup{position=top}
- \clearcaptionsetup{figure}
- \begingroup
- \captionof{figure}{A figure}
- \endgroup
-\end{Example}
-
-\pagebreak[3]
-\NEWfeature{v3.1}
-% If an optional argument \meta{option} is given, only the settings regarding
-% this particular \meta{option} are cleared.\footnote{You can only specify
-% \emph{one} option here, not a list of options.
-% If you want to clean more than one option, you need to use more than one
-% \cs{clear}\-\texttt{caption}\-\texttt{setup}.}
-% While the example above not only clears the options
-% |labelfont=bf,|\x|textfont=it|
-% for figures (but all options for figures instead),
-% this one would only clear the |labelfont=bf| setting, leaving all other
-% settings for figures intact:
-Åñëè çàäàí äîïîëíèòåëüíûé àðãóìåíò \meta{option}, îòìåíÿþòñÿ òîëüêî íàñòðîéêè
-äàííîé îïöèè \meta{option}.\footnote{Âû ìîæåòå çàäàòü òîëüêî
-\emph{îäíó} îïöèþ, à~íå ñïèñîê îïöèé.
-Åñëè âàì íóæíî îòìåíèòü íàñòðîéêè äëÿ ðÿäà îïöèé, âàì ïðèä¸òñÿ èñïîëüçîâàòü íåñêîëüêî êîìàíä
-\cs{clearcaptionsetup}.}
-Â~òî âðåìÿ êàê ïðèìåð âûøå íå òîëüêî îòìåíèë îïöèè êëþ÷åé |labelfont=bf,|\allowbreak
-|textfont=it|
-äëÿ ðèñóíêîâ (íî è~âñå îïöèè äëÿ ðèñóíêîâ),
-ñëåäóþùèé ïðèìåð îòìåíèò òîëüêî íàñòðîéêó |labelfont=bf|, îñòàâèâ âñå îñòàëüíûå
-íàñòðîéêè íåòðîíóòûìè:
-\begin{quote}
- |\captionsetup{font=small}|\\
- |\captionsetup[figure]{labelfont=bf,textfont=it}|\\
- \ldots\\
- | \caption{A figure}|\\
- \ldots\\
- |\clearcaptionsetup[labelfont]{figure}|\\
- \ldots\\
- | \caption{A figure}|\\
- \ldots
-\end{quote}
-\begin{Example}
- \captionsetup{font=small}
- \captionsetup[figure]{labelfont=bf,textfont=it}
- \begingroup
- \captionof{figure}{A figure}
- \endgroup
- \captionsetup{position=top}
- \clearcaptionsetup[labelfont]{figure}
- \begingroup
- \captionof{figure}{A figure}
- \endgroup
-\end{Example}
-\begin{Expert}
-% Analogous to |\caption|\-|setup*| there is also a starred form
-% |\clear|\-|caption|\-|setup*| which suppresses warnings if the given
-% \meta{option} was not setup for the specified \meta{float type}.
-Àíàëîãè÷íî êîìàíäå |\captionsetup*| ñóùåñòâóåò òàêæå çâ¸çäíàÿ ôîðìà
-|\clearcaptionsetup*| êîòîðàÿ îòìåíÿåò ïðåäóïðåæäåíèÿ, åñëè \meta{option}
-íå ÿâëÿåòñÿ íàñòðîéêîé äëÿ äàííîãî \meta{float type}.
-\end{Expert}
-
-\medskip
-
-\DescribeMacro{\showcaptionsetup}
-% For debugging purposes the command\nopagebreak
-Äëÿ âîçìîæíîñòåé íàñòðîéêè íàñòðîåê, ïðåäëîæåíà êîìàíäà\nopagebreak
-\begin{quote}
- |\showcaptionsetup|\marg{float type}\quad.\nopagebreak[3]
-\end{quote}
-% is offered. It generates a log file entry, showing the given options
-% for the specified \meta{float type}. For example
-Îíà ñîçäà¸ò ñîîáùåíèå â~log-ôàéëå, ïîêàçûâàÿ çàäàííûå îïöèè
-äëÿ âûáðàííîãî \meta{float type}. Íàïðèìåð
-\begin{quote}
- |\captionsetup[figure]{labelfont=bf,textfont=it}|\\
- |\showcaptionsetup{figure}|
-\end{quote}
-% gives the info:
-äàñò ñîîáùåíèå:
-\begin{quote}\small
- |Caption Info: Option list on `figure'|\\
- |Caption Data: {labelfont=bf,textfont=it} on input line 5.|
-\end{quote}
-
-\pagebreak[3]
-% \subsection{Continued floats}
-\subsection{Ïðîäîëæàþùèåñÿ ôëîòû}
-\label{ContinuedFloat}
-
-\DescribeMacro{\ContinuedFloat}\label{TeXr:continued:a}%
-% Sometimes you want to split figures or tables without giving them
-% their own reference number. This is what the command
-Èíîãäà âîçíèêàåò íåîáõîäèìîñòü ðàçáèòü ðèñóíêè èëè òàáëèöû íà íåñêîëüêî
-÷àñòåé, çàäàâ èì îáùèé íîìåð. Äëÿ ýòîãî ïðåäíàçíà÷åíà êîìàíäà
-\begin{quote}
- |\ContinuedFloat|\quad.
-\end{quote}
-% is for; it should be used as first command inside the floating environment.
-% It prevents the incrementation of the relevant counter (usually done by
-% |\caption|), so a figure or table containing a |\Continued|\-|Float| inside
-% gets the same reference number as the figure or table before.
-% An example:
-Ëó÷øå å¸ ïîñòàâèòü ïåðâîé âíóòðè îêðóæåíèÿ ôëîòà.
-Êîìàíäà |\ContinuedFloat| îòìåíÿåò óâåëè÷åíèå ñîîòâåòñòâóþùåãî ñ÷¸ò÷èêà ôëîòà
-(èñïîëüçóåìîãî êîìàíäîé |\caption|)
-è~çàäà¸ò òîò æå íîìåð êàê è~ó~ðèñóíêà èëè òàáëèöû âûøå. Ïðèìåð
-\begin{quote}
- |\begin{table}|\\
- | \caption{A table}|\\
- | |\ldots\\
- |\end{table}|\\
- \ldots\\
- |\begin{table}\ContinuedFloat|\\
- | \caption{A table (cont.)}|\\
- | |\ldots\\
- |\end{table}|
-\end{quote}
-% gives the following result:
-äàñò ñëåäóþùèé ðåçóëüòàò:
-\begin{Example}
- \captionsetup{type=table,position=b,skip=0pt}
- \caption{A table}
- \centerline{\ldots}
- \ContinuedFloat
- \caption{A table (cont.)}
- \centerline{\ldots}
-\end{Example}
-
-\bigskip
-
-\NEWfeature{v3.1}
-% Furthermore the |\Continued|\-|Float| command executes options associated with
-% the type name ``|Continued|\-|Float|''. For example this can be used to switch
-% to a different label format for continued figures or tables, as shown here:
-Ïîìèìî ýòîãî êîìàíäà |\Continued|\-|Float| âêëþ÷àåò îïöèè, ñâÿçàííûå
-ñ~ñîîòâåòñòâóþùåé îïöèåé"=òèïîì «|Continued|\-|Float|». Íàïðèìåð, ýòî ìîæåò áûòü èñïîëüçîâàíî äëÿ
-ñîçäàíèÿ àëüòåðíàòèâíûõ ôîðìàòîâ ìåòîê äëÿ òàáëèö è~ðèñóíêîâ, êàê ïîêàçàíî çäåñü:
-\begin{quote}
- |\DeclareCaptionLabelFormat{continued}{Continued #1~#2}|\\
- |\captionsetup[ContinuedFloat]{labelformat=continued}|\\
- \ldots\\
- |\begin{table}\ContinuedFloat|\\
- | \caption{A table}|\\
- | |\ldots\\
- |\end{table}|
-\end{quote}
-\begin{Example}\selectlanguage{USenglish}
- \captionsetup{type=table,position=b,skip=0pt}
- \captionsetup[ContinuedFloat]{labelformat=continued1e}
- \ContinuedFloat
- \caption{A table}\label{continued1e}
- \centerline{\ldots}
-\end{Example}
-Â~ðóññêîé äîêóìåíòàöèè ýòî ìîæåò âûãëÿäåòü òàê:
-\begin{quote}
- |\DeclareCaptionLabelFormat{continued}{#1~#2 (\textit{ïðîäîëæåíèå})}|\\
- |\captionsetup[ContinuedFloat]{labelformat=continued}|\\
- \ldots\\
- |\begin{table}\ContinuedFloat|\\
- | \caption{A table}|\\
- | |\ldots\\
- |\end{table}|
-\end{quote}
-\begin{Example}
- \captionsetup{type=table,position=b,skip=0pt}
- \captionsetup[ContinuedFloat]{labelformat=continued1r}
- \ContinuedFloat
- \caption{A table}\label{continued1r}
- \centerline{\ldots}
-\end{Example}
-\smallskip
-% \See{\Ref{declare} for an explanation of
-% \cs{Declare}\-\texttt{Caption}\-\texttt{Label}\-\texttt{Format}.}
-\See{\Ref{declare} îïèñûâàþùèé
- \cs{Declare}\-\texttt{Caption}\-\texttt{Label}\-\texttt{Format}.}
-
-\medskip
-
-% There is also a \LaTeX\ counter called |Continued|\-|Float| which could be
-% used for own purposes.
-% For ordinary (floating) environments it's set to zero, to one for the first
-% continued float, to two inside the second one, and so on.
-% So every |\Continued|\-|Float| increments this counter and a floating
-% environment without |\Continued|\-|Float| command resets this counter to zero.
-% An example:
-Ñîçäàí òàêæå ñ÷¸ò÷èê \LaTeX'à, íàçâàííûé |Continued|\-|Float|, êîòîðûé ìîæåò áûòü
-èñïîëüçîâàí ïðè íåîáõîäèìîñòè.
-Â~îáû÷íûõ îêðóæåíèÿõ ïëàâàþùèõ îáúåêòîâ îí ðàâåí íóëþ, â~ïåðâîì ïðîäîëæàþùåìñÿ
-ôëîòå îí ðàâåí åäèíèöå, â~ñëåäóþùåì äëÿ âòîðîãî îêðóæåíèÿ è~ò.\,ä.
-Òàê, êàæäàÿ êîìàíäà |\Continued|\-|Float| óâåëè÷èâàåò ýòîò ñ÷¸ò÷èê è~ïëàâàþùèé îáúåêò
-áåç êîìàíäû |\Continued|\-|Float| âíîâü îáíóëÿåò ýòîò ñ÷¸ò÷èê.
-Ïðèìåð:
-\begin{quote}
- |\DeclareCaptionLabelFormat{cont}{#1~#2\asbuk{ContinuedFloat}}|\\
- |\captionsetup[ContinuedFloat]{labelformat=cont}|\\
- \ldots\\
- |\begin{table}\ContinuedFloat|\\
- | \caption{A table}|\\
- | |\ldots\\
- |\end{table}|
-\end{quote}
-\begin{Example}
- \captionsetup{type=table,position=b,skip=0pt}
- \captionsetup[ContinuedFloat]{labelformat=continued2}
- \ContinuedFloat
- \caption{A table}\label{continued2}
- \centerline{\ldots}
-\end{Example}
-\medskip
-% A reference to this table would still result in the output
-% ``\autoref{continued2}'' since only the caption label format was changed.
-% If you would like to use the |Continued|\-|Float| counter for the references,
-% too, you could redefine the command |\the|\-|Continued|\-|Float| instead,
-% which will be appended to the figure or table counter automatically in
-% continued floats and is preset to be empty.
-Ññûëêà íà ýòó òàáëèöó îñòàíåòñÿ â~âèäå
-«\autoref{continued2}», ïîñêîëüêó èçìåíÿëñÿ òîëüêî ôîðìàò ìåòêè.
-Åñëè âàì íóæíî èñïîëüçîâàòü òàêæå ñ÷¸ò÷èê |Continued|\-|Float| â~ññûëêàõ,
-âû äîëæíû ïåðåîïðåäåëèòü êîìàíäó |\the|\-|Continued|\-|Float|,
-êîòîðàÿ, ïîäêëþ÷àåòñÿ àâòîìàòè÷åñêè â~ïðîäîëæàþùèõñÿ ôëîòàõ,
-òîãäà êàê ïî óìîë÷àíèþ ýòà êîìàíäà ïóñòà.
-\begin{quote}
- |\renewcommand\theContinuedFloat{\asbuk{ContinuedFloat}}|\\
- \ldots\\
- |\begin{table}\ContinuedFloat|\\
- | \caption{A table}|\\
- | |\ldots\\
- |\end{table}|
-\end{quote}
-\begin{Example}
- \captionsetup{type=table,position=b,skip=0pt}
- \renewcommand\theContinuedFloat{\asbuk{ContinuedFloat}}
- \ContinuedFloat
- \caption{A table}\label{continued3}
- \centerline{\ldots}
-\end{Example}
-\medskip
-% A reference to that table would result in the output ``\autoref{continued3}''.
-Ññûëêà íà ýòó òàáëèöó äàñò ñëåäóþùèé ðåçóëüòàò «\autoref{continued3}».
-
-\pagebreak[3]
-\DescribeMacro{\ContinuedFloat*}
-% Suppose you want to start the first figure or table of such a series with a
-% kind of ``Figure 7a'' and not with ``Figure 7'' (and the second one with
-% ``Figure 7b'' instead of ``Figure 7a'').
-% This is possible, too, by using the starred variant |\Continued|\-|Float*|
-% which---just like |\Continued|\-|Float|---executes options associated with the
-% type name ``|Continued|\-|Float|'' and increments the \LaTeX\ counter
-% |Continued|\-|Float|, \emph{but} marks the first figure or table of a series
-% instead:
-Ïðåäïîëîæèì âàì íóæíî ñîçäàòü ïðîäîëæàþùèåñÿ ðèñóíîê èëè òàáëèöó ñ~íóìåðàöèîííûì
-çàãîëîâêîì âèäà «Figure 7a», à~íå «Figure 7» (à~çàòåì, êàê
-«Figure 7b», âìåñòî «Figure 7a»).
-Ýòî òàêæå âîçìîæíî, åñëè èñïîëüçîâàòü çâ¸çäíûé âàðèàíò êîìàíäû |\Continued|\-|Float*|
-êîòîðàÿ \cdash--- êàê è~|\Continued|\-|Float| \cdash--- ïîäêëþ÷àåò îïöèè
-ñ~ïîìîùüþ êîìàíäû «|Continued|\-|Float|» è~óâåëè÷èâàåò ñ÷¸ò÷èê \LaTeX'à
-|Continued|\-|Float|, \emph{íî} îòìå÷àåò è~ïåðâûé ôëîò èç ñåðèè
-ïðîäîëæàþùèõñÿ ôëîòîâ:
-\begin{quote}
- |\renewcommand\theContinuedFloat{\asbuk{ContinuedFloat}}|\\
- \ldots\\
- |\begin{figure}\ContinuedFloat*|\\
- | |\ldots\\
- | \caption{First figure of a series}|\\
- |\end{figure}|\\
- \ldots\\
- |\begin{figure}\ContinuedFloat|\\
- | |\ldots\\
- | \caption{Second figure of a series}|\\
- |\end{figure}|\\
- \ldots\\
- |\begin{figure}\ContinuedFloat|\\
- | |\ldots\\
- | \caption{Third figure of a series}|\\
- |\end{figure}|
-\end{quote}
-\begin{Example}
- \captionsetup{type=figure,position=b,skip=0pt}
- \renewcommand\theContinuedFloat{\asbuk{ContinuedFloat}}
- \begingroup
- \ContinuedFloat*
- \centerline{\ldots}
- \caption{First figure of a series}
- \endgroup
- \begingroup
- \ContinuedFloat
- \centerline{\ldots}
- \caption{Second figure of a series}
- \endgroup
- \begingroup
- \ContinuedFloat
- \centerline{\ldots}
- \caption{Third figure of a series}
- \endgroup
-\end{Example}
-\smallskip
-% \Note{Unfortunately \cs{ContinuedFloat*} is not available if the
-% \package{subfig} package\cite{subfig} is loaded.}
-\Note{Ê~ñîæàëåíèþ êîìàíäó \cs{ContinuedFloat*} íåëüçÿ èñïîëüçîâàòü ïðè çàãðóæåííîì ïàêåòå
- \package{subfig}\cite{subfig}.}
-
-\pagebreak[3]
-% \subsubsection*{A note about longtables}
-\subsubsection*{A note about longtables}
-% If you want to have a different caption label in |long|\-|table|s (offered
-% by the \package{longtable} package\cite{longtable}) after a page break,
-% this can \emph{not} be archived by using |\Continued|\-|Float|,
-% but instead you could write something like:
-Åñëè âàì íóæíî ñîçäàòü îòëè÷àþùèéñÿ ôîðìàò ìåòêè äëÿ ïðîäîëæåíèÿ
-îêðóæåíèÿ |long|\-|table|
-(ïðåäëàãàåìîãî ïàêåòîì \package{longtable}\cite{longtable})
-íà ñëåäóþùåé ñòðàíèöå,
-èñïîëüçîâàíèå |\Continued|\-|Float| \emph{íå} äàñò ðåçóëüòàòîâ,
-íî âû ìîæåòå çàäàòü ÷òî-òî âðîäå:
-\begin{quote}
- |\DeclareCaptionLabelFormat{continued}{Continued #1~#2}|\\
- \ldots\\
- |\begin{longtable}{|\ldots|}|\\
- | \caption{A longtable}\\|\\
- |\endfirsthead|\\
- | \captionsetup{labelformat=continued}|\\
- | \caption[]{A longtable}\\|\\
- |\endhead|\\
- | |\ldots\\
- |\end{longtable}|
-\end{quote}
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-% \section{Own enhancements}
-\section{Ñîáñòâåííûå íàñòðîéêè}
-\label{declare}
-
-% A family of commands is provided to allow users to define their own formats
-% etc.
-% This enables information on separators, justification, fonts, and styles to
-% be associated with a name and kept in one place.
-% (These commands need to appear in the document preamble,
-% this is the part between |\document|\-|class| and |\begin{document}|.)
-Èìååòñÿ ñåìåéñòâî êîìàíä, ïîçâîëÿþùèõ ïîëüçîâàòåëþ ñàìîñòîÿòåëüíî
-ñîçäàòü ñîáñòâåííîå îôîðìëåíèå.
-Ýòî ïîçâîëÿåò èíôîðìàöèþ î~ðàçäåëèòåëÿõ, âûêëþ÷êå, øðèôòàõ, è~ñòèëÿõ
-ïðèâÿçàòü ê~îïðåäåë¸ííîìó êëþ÷ó, è~ïîìåñòèòü âñ¸ ýòî â~îäíîì ìåñòå
-(òàêèå êîìàíäû äîëæíû íàõîäèòüñÿ â~ïðåàìáóëå äîêóìåíòà \cdash---
-ýòî ÷àñòü ìåæäó ñòðîêàìè êîìàíä |\document|\-|class| è~|\begin{document}|).
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\Format}
-% You can define your own caption formats using the command
-Âû ìîæåòå îïðåäåëèòü ñâî¸ îôîðìëåíèå ïîäïèñè, èñïîëüçóÿ êîìàíäó
-\begin{quote}
-% |\DeclareCaptionFormat|\marg{name}\marg{code using \#1, \#2 and \#3}\mbox{\quad.}
- |\DeclareCaptionFormat|\marg{name}\marg{êîä, èñïîëüçóþùèé \#1, \#2 è~\#3}\mbox{\ .}
-\end{quote}
-% At usage the system replaces \#1 with the caption label, \#2 with the
-% separator and \#3 with the text. So the standard format |plain| is
-% pre-defined by \thispackage\ as
-Ïðè èñïîëüçîâàíèè ïðîãðàììà çàìåíÿåò \#1 íà íóìåðàöèîííûé çàãîëîâîê, \#2 íà
-ðàçäåëèòåëü è~\#3 íà òåêñò ïîäïèñè. Èòàê, ñòàíäàðòíûé ôîðìàò |plain| îïðåäåë¸í
-âíóòðè ïàêåòà \thispackage\ êàê
-\begin{quote}
- |\DeclareCaptionFormat{plain}{#1#2#3\par}|\quad.
-\end{quote}
-\begin{Expert}
-% There is also a starred variant, |\Declare|\-|Caption|\-|Format*|,
-% which causes the code being typeset in \TeX s vertical (instead of
-% horizontal) mode, but does not support the |indention=| option.
-Ñóùåñòâóåò òàêæå çâ¸çäíûé âàðèàíò |\Declare|\-|Caption|\-|Format*|, êîòîðûé
-ñîçäà¸ò êîä, ïå÷àòàþùèéñÿ â~âåðòèêàëüíîì ðåæèìå (ìîäå) \TeX'à (âìåñòî
-îáû÷íîãî ãîðèçîíòàëüíîãî),
-íî â~ýòîì ñëó÷àå íå ïîääåðæèâàåòñÿ êëþ÷ |indention=|.
-\end{Expert}
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\LabelFormat}
-% Likewise you can define your own caption label formats:
-Àíàëîãè÷íî âû ìîæåòå îïðåäåëèòü ôîðìàò íóìåðàöèîííîãî çàãîëîâêà:
-\begin{quote}
- |\DeclareCaptionLabelFormat|\marg{name}\marg{êîä èñïîëüçóþùèé \#1 è~\#2}
-\end{quote}
-% At usage \#1 gets replaced with the name (e.g. ``figure'') and \#2
-% gets replaced with the reference number (e.g. ``12'').
-% An example:
-Ïðè èñïîëüçîâàíèè \#1 çàìåíÿåòñÿ íà èìÿ ôëîòà (íàïðèìåð. «Ðèñ.») è~\#2
-çàìåíÿåòñÿ íà ïîðÿäêîâûé íîìåð (íàïðèìåð «12»). Ïðèìåð:
-\begin{quote}
- |\DeclareCaptionLabelFormat{bf-parens}{(\textbf{#2})}|\\
- |\captionsetup{labelformat=bf-parens,labelsep=quad}|
-\end{quote}
-\example*{labelformat=bf-parens,labelsep=quad}{\exampletext}
-
-\pagebreak[3]
-\DescribeMacro{\bothIfFirst}
-\DescribeMacro{\bothIfSecond}
-% If you define your own caption label formats and use the
-% \package{subcaption} or \package{subfig}\cite{subfig} package,
-% you should take care of empty caption label names.
-% For this purpose the commands
-Êîãäà âû îïðåäåëÿåòå ñâî¸ îôîðìëåíèå íóìåðàöèîííîãî çàãîëîâêà è~èñïîëüçóåòå
-òàêæå ïàêåòû \package{subcaption} èëè \package{subfig},
-âû äîëæíû ïîìíèòü ÷òî â~ïîäôëîòàõ ýëåìåíò
-«èìÿ ôëîòà» áóäåò ïóñòûì. Äëÿ ýòîé öåëè ñëåäóþùèå êîìàíäû
-\begin{quote}
- |\bothIfFirst|\marg{first arg}\marg{second arg}\quad è\\
- |\bothIfSecond|\marg{first arg}\marg{second arg}
-\end{quote}
-% are offered. |\bothIfFirst| tests if the first argument exists (means: is
-% not empty), |\bothIfSecond| tests if the second argument exists. If yes,
-% both arguments get typeset, otherwise none of them.
-ïðåäëîæåíû. Êîìàíäà |\bothIfFirst| òåñòèðóåò íàëè÷èå ïåðâîãî àðãóìåíòà (÷òî îí
-íåïóñòîé), êîìàíäà |\bothIfSecond| òåñòèðóåò íàëè÷èå âòîðîãî. Åñëè òåñòèðóåìûé
-àðãóìåíò åñòü, òî ïå÷àòàþòñÿ îáà àðãóìåíòà, â~ïðîòèâíîì ñëó÷àå íè îäíîãî.
-
-\smallskip
-
-\pagebreak[3]
-% For example the standard label format |simple| is \emph{not} defined as
-Íàïðèìåð, ñòàíäàðòíîå îôîðìëåíèå íóìåðàöèè |simple| îïðåäåëåíî íå òàê:
-\begin{quote}
- |\DeclareCaptionLabelFormat{simple}{#1~#2}|\mbox{\quad,}
-\end{quote}
-% because this could cause an extra space if \#1 is empty. Instead |simple|
-% is defined as
-ïîñêîëüêó àðãóìåíò \#1 ìîæåò áûòü ïóñòûì. Âìåñòî ýòîãî |simple|
-îïðåäåë¸í ñëåäóþùèì îáðàçîì
-\begin{quote}
- |\DeclareCaptionLabelFormat{simple}%|\\
- | {\bothIfFirst{#1}{~}#2}|\mbox{\quad,}
-\end{quote}
-% causing the space to appear only if the label name is present.
-â~ðåçóëüòàòå ïðîáåë ïîÿâèòñÿ òîëüêî òîãäà, êîãäà åñòü èìÿ íóìåðàöèîííîãî
-çàãîëîâêà.
-
-\smallskip
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\TextFormat}\NEWfeature{v3.0l}%
-% Likewise you can define your own caption text formats:
-Àíàëîãè÷íî ìîæíî îïðåäåëèòü ôîðìàò òåêñòà ïîäïèñè:
-\begin{quote}
-% |\DeclareCaptionTextFormat|\marg{name}\marg{code using \#1}
- |\DeclareCaptionTextFormat|\marg{name}\marg{êîä, èñïîëüçóþùèé àðãóìåíò \#1}
-\end{quote}
-% At usage \#1 gets replaced with the caption text.
-Ïðè èñïîëüçîâàíèè \#1 çàìåíÿåòñÿ òåêñòîì ïîäïèñè.
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\LabelSeparator}
-% You can define your own caption label separators with
-Ìîæíî îïðåäåëèòü ñâîé ðàçäåëèòåëü íîìåðà è~òåêñòà ïîäïèñè ñ~ïîìîùüþ
- êîìàíäû
-\begin{quote}
- |\DeclareCaptionLabelSeparator|\marg{name}\marg{code}\mbox{\quad.}
-\end{quote}
-% Again an easy example taken from \thispackage\ itself:
-È~îïÿòü ïðîñòîé ïðèìåð èç òîãî, ÷òî ïðåäëàãàåò \thispackage:
-\begin{quote}
- |\DeclareCaptionLabelSeparator{colon}{: }|
- \end{quote}
- \begin{Expert}
-% There is also a starred variant, |\Declare|\-|Caption|\-|Label|\-|Separator*|,
-% which causes the code being typeset without using the |label|\-|font=| setting.
-% So for example the label separators |quad|, |new|\-|line|, and |en|\-|dash|
-% are defined in this way.
-Ñóùåñòâóåò òàêæå çâ¸çäíûé âàðèàíò, |\Declare|\-|Caption|\-|Label|\-|Separator*|,
-êîòîðûé îïðåäåëÿåò êîä, áåç èñïîëüçîâàíèÿ íàñòðîåê èç êëþ÷à |label|\-|font=|.
-Òàê, íàïðèìåð, ðàçäåëèòåëè |quad|, |newline| è |endash|
-îïðåäåëåíû ýòîé êîìàíäîé.
-\end{Expert}
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\Justification}
-% You can define your own caption justifications with
-Âû ìîæåòå îïðåäåëèòü ñîáñòâåííóþ âûêëþ÷êó ñ~ïîìîùüþ êîìàíäû
-\begin{quote}
- |\DeclareCaptionJustification|\marg{name}\marg{code}\mbox{\quad.}
-\end{quote}
-% The \meta{code} simply gets typeset just before the caption.
-% E.g.~using the justification |raggedright|, which is defined as
-Àðãóìåíò \meta{code} çàäà¸ò âûêëþ÷êó äî íà÷àëà ïîäïèñè.
-Íàïðèìåð èñïîëüçîâàíèå âûêëþ÷êè |raggedright|, êîòîðàÿ îïðåäåëåíà êàê
-\begin{quote}
- |\DeclareCaptionJustification{raggedright}{\raggedright}|\mbox{\quad,}
-\end{quote}
-% typesets captions with all lines moved to the left margin.
-âûêëþ÷àåò âñå ñòðîêè ïîäïèñè â~ëåâûé êðàé.
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\Font}
-% You can define your own caption fonts with
-Âû ìîæåòå çàäàòü ñâîé øðèôò äëÿ ïîäïèñè ñ~ïîìîùüþ
-\begin{quote}
- |\DeclareCaptionFont|\marg{name}\marg{code}\quad.
-\end{quote}
-% For example this package defines the options |small| and |bf| as
-Íàïðèìåð äàííûé ïàêåò îïðåäåëÿåò îïöèè |small| è~|bf| êàê
-\begin{quote}
- |\DeclareCaptionFont{small}{\small}|\quad è\\
- |\DeclareCaptionFont{bf}{\bfseries}|\quad.
-\end{quote}
-\iffalse
-% The line spacing could be customized using the \package{setspace} package,
-% for example:%\NEWdescription{v3.0h}
-Èíòåðëèíüÿæ ìîæåò áûòü íàñòðîåí ñ~ïîìîùüþ ïàêåòà \package{setspace},
-íàïðèìåð:%\NEWdescription{v3.0h}
-\begin{quote}
- |\usepackage{setspace}|\\
-% |\DeclareCaptionFont{singlespacing}{\setstretch{1}}|~\footnote{%
-% \emph{\DefaultNoteText:} Using \cs{singlespacing} does not work here since
-% it contains a \cs{vskip} command.}\\
- |\DeclareCaptionFont{singlespacing}{\setstretch{1}}|\quad\footnote{%
- \emph{\DefaultNoteText}: Èñïîëüçîâàíèå \cs{singlespacing} â äàííîì ñëó÷àå
- íå ðàáîòàåò ïîñêîëüêó ñîäåðæèò êîìàíäó \cs{vskip}.}\\
- |\DeclareCaptionFont{onehalfspacing}{\onehalfspacing}|\\
- |\DeclareCaptionFont{doublespacing}{\doublespacing}|\\
- |\captionsetup{font={onehalfspacing,small},labelfont=bf}|
-\end{quote}
-\example{font={onehalfspacing,small},labelfont=bf,singlelinecheck=off}{\exampletext}
-\fi
-% An example which brings color into life:
-Ïðèìåð èñïîëüçîâàíèÿ öâåòà:
-\begin{quote}
- |\usepackage{color}|\\
- |\DeclareCaptionFont{red}{\color{red}}|\\
- |\DeclareCaptionFont{green}{\color{green}}|\\
- |\DeclareCaptionFont{blue}{\color{blue}}|\\
- |\captionsetup{labelfont={blue,bf},textfont=green}|
-\end{quote}
-\example*{labelfont={color=blue,bf},textfont={color=green},singlelinecheck=off}{\exampletext}
-% But since \thispackage\ already includes the tricky definition
-Íî ïîñêîëüêó \thispackage\ óæå èñïîëüçóåò õèòðîóìíîå îïðåäåëåíèå
-\begin{quote}
- |\DeclareCaptionFont{color}{\color{#1}}|
-\end{quote}
-% you can get the same result simply with
-âû ìîæåòå ïîëó÷èòü òîò æå ðåçóëüòàò çàäàâ ïðîñòî
-\begin{quote}
- |\usepackage{color}|\\
- |\captionsetup{labelfont={color=blue,bf},|\\
- | textfont={color=green}}|\quad.
-\end{quote}
-
-\medskip
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\Style}
-% You can define your own caption styles with
-Âû ìîæåòå îïðåäåëèòü ñâîè ñîáñòâåííûå ñòèëè ñ~ïîìîùüþ
-\begin{quote}
- |\DeclareCaptionStyle|\marg{name}\oarg{additional options}\marg{options}\mbox{\quad.}
-\end{quote}
-% Remember, caption styles are just a collection of suitable options, saved
-% under a given name. You can wake up these options at any time with the
-% option |style=|\meta{style name}.
-Íàïîìíèì, ÷òî ñòèëè ïîäïèñè ýòî êîëëåêöèÿ êëþ÷åé, ñîõðàí¸ííûõ
-ïîä äàííûì èìåíåì. Âû ìîæåòå ïðèâåñòè èõ â~äåéñòâèå ñ~ïîìîùüþ êëþ÷à
-|style=|\meta{style name}.
-
-% All caption styles are based on the |base| set of options. (See \Ref{style}
-% for a complete list.) So you only need to specify options which are different
-% to them.
-Âñå ñòèëè ïîäïèñåé áàçèðóþòñÿ íà óñòàíîâêàõ ïî óìîë÷àíèþ. (Ñì. ïîëíûé ñïèñîê
-â~\Ref{style}.) Ïîýòîìó äîñòàòî÷íî îïðåäåëèòü îïöèè, îòëè÷íûå
-îò óæå çàäàííûõ.
-
-% If you specify \meta{additional options} they get used in addition when
-% the caption fits into a single line and this check was not disabled with
-% the option |single|\-|line|\-|check=off|.
-Åñëè âû îïðåäåëèòå \meta{additional options} îíè áóäóò èñïîëüçîâàòüñÿ êîãäà
-ïîäïèñü áóäåò îäíîñòðî÷íîé, è~êîíòðîëü êîðîòêèõ ïîäïèñåé íå îòêëþ÷åí
-çàäàíèåì îïöèè |single|\-|line|\-|check=off|.
-
-% Again a very easy example taken from the core of this package: The
-% caption style |base| is pre-defined as
-Îïÿòü æå î÷åíü ïðîñòîé ïðèìåð èç ñàìîãî ïàêåòà. Ñòèëü ïîäïèñåé |base|
-îïðåäåë¸í êàê:
-\begin{quote}
- |\DeclareCaptionStyle{base}%|\\
- | [justification=centering,indention=0pt]{}|\quad.
-\end{quote}
-
-% Something more exciting:
-×òî-òî ïîèíòåðåñíåå:
-\begin{quote}
- |\DeclareCaptionStyle{mystyle}%|\\
- | [margin=5mm,justification=centering]%|\\
- | {font=footnotesize,labelfont=sc,margin={10mm,0mm}}|\\
- |\captionsetup{style=mystyle}|
-\end{quote}
-% gives you caption like these ones:
-äàñò âàì ïîäïèñè êàê â~ñëåäóþùåì ïðèìåðå:
-\begin{Example}
- \captionsetup{type=figure,style=mystyle,position=b}
- \caption{Êîðîòêàÿ ïîäïèñü.}
- \caption{Äëèííàÿ, äëèííàÿ, äëèííàÿ, äëèííàÿ, äëèííàÿ, äëèííàÿ,
- äëèííàÿ, äëèííàÿ, äëèííàÿ, äëèííàÿ, äëèííàÿ,
- äëèííàÿ, äëèííàÿ, äëèííàÿ, äëèííàÿ, äëèííàÿ, ïîäïèñü.}
-\end{Example}
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaption-\\ListFormat}\NEWfeature{v3.1}%
-% You can define your own caption list formats with
-Âû ìîæåòå îïðåäåëèòü ñâîé ôîðìàò äëÿ Ñïèñêîâ, èñïîëüçóÿ
-\begin{quote}
- |\DeclareCaptionListFormat|\marg{name}\marg{êîä èñïîëüçóþùèé \#1 è~\#2}\mbox{\quad.}
-\end{quote}
-% At usage \#1 gets replaced with the label prefix (e.g.~|\p@figure|),
-% and \#2 gets replaced with the reference number (e.g.~|\thefigure|).
-Ïðè èñïîëüçîâàíèè \#1 çàìåíÿåòñÿ íà ïðåôèêñ ìåòêè (íàïðèìåð |\p@figure|)
-è~\#2 \cdash--- íà íîìåð (íàïðèìåð, |\thefigure|).
-
-\bigskip
-
-\pagebreak[3]
-\DescribeMacro{\DeclareCaptionType}\NEWfeature{v3.1f}%
-% You can define your own floating environments and caption types with
-Âû ìîæåòå îïðåäåëèòü ñîáñòâåííûå îêðóæåíèÿ è~òèïû ïîäïèñåé, èñïîëüçóÿ
-\begin{quote}
- |\DeclareCaptionType|\oarg{options}\marg{type}\oarg{name}\oarg{list name}
-\end{quote}
-% where \meta{options} are one or more of
-ãäå \meta{options} îäíà èç
-\begin{quote}\begin{tabular}{r@{}l@{\qquad}l}
- |fileext=| & \meta{file extension}
- & {\small(íàïðèìåð~|fileext=lod|)}\\
-% |listname=|\meta{list name}\\
-% |name=|\meta{prosa name}\\
- |placement=| & \meta{combination of \,\purett{htbp}}
- & {\small(íàïðèìåð~|placement=tbp|)}\\
- |within=| & \meta{``within'' counter} \emph{or} \texttt{none}\quad.
- & {\small(íàïðèìåð~|within=section|)}
-\end{tabular}\end{quote}
-% If no \meta{options} are given, ``lo\meta{type}'' will be used as \meta{file
-% extension} for the list, ``|tbp|'' as \meta{placement} specifier,
-% and ``|chapter|'' resp. ``|none|'' as \meta{``within'' counter},
-% i.e., the counter which resets the numbering.
-% (If ``|none|'' was specified as value, the numbering of the new
-% type will be continuous throughout the document.)
-Åñëè \meta{options} íå çàäàíû, «lo\meta{type}» áóäåò èñïîëüçîâàí êàê \meta{file
-extension} äëÿ Ñïèñêà, «|tbp|» êàê îïöèÿ ðàçìåùåíèÿ \meta{placement}
-è~«|chapter|» èëè «|none|» êàê ñ÷¸ò÷èê \meta{``within'' counter},
-ò.\,å. ñ÷¸ò÷èê, êîíòðîëèðóþùèé ïåðåíóìåðàöèþ.
-(Åñëè çàäàí «|none|», íóìåðàöèÿ íîâîãî òèïà ôëîòà
-áóäåò ñêâîçíàÿ.)
-
-% If no \meta{name} is given, the name of the newly created type will be set
-% to \meta{type}, but with an uppercase first letter.
-% If no \meta{list name} is given, the list name will be set to ``List of
-% \meta{name}s''.
-Åñëè íå çàäàí êëþ÷ \meta{name}, èìÿ âíîâü ñîçäàííîãî òèïà ôëîòîâ áóäåò âçÿòî
-èç àðãóìåíòà \meta{type}, íî ñ~ïåðâîé ïðîïèñíîé áóêâîé.
-Åñëè íåò àðãóìåíòà \meta{list name}, íàçâàíèå Ñïèñêà áóäåò çàäàíî êàê «List of
-\meta{name}s». [Äëÿ îïöèè \meta{name} íåò ïîääåðæêè íà ðóññêîì ÿçûêå.]
-% caption-deu.tex:
-% (Diese Vorbelegungen sind also nur fur
-% englischsprachige Dokumente geeignet,
-% bei anderssprachigen Dokumenten sollte man also immer \meta{Name} und
-% \meta{Listenname} mit angeben.) which means:
-%
-% (This presets are only appropriate for English documents, so for
-% other languages you should use the optional arguments "name" and "list name".)
-(Ýòè àâòîìàòè÷åñêèå óñòàíîâêè âîçìîæíû òîëüêî äëÿ
-àíãëèéñêèõ äîêóìåíòîâ, ïîýòîìó äëÿ
-äðóãèõ ÿçûêîâ îïöèè \meta{name} è~\meta{list name}
-îáÿçàòåëüíû.)
-
-% The list will be typeset using the command |\list|\-|of|\meta{type}|s|,
-% analogous to |\list|\-|of|\-|figures| and |\list|\-|of|\-|tables|.
-% If the \package{fltpage} package is loaded, an environment called
-% |FP|\meta{type} will be defined, same for |sideways|\meta{type}
-% (\package{rotating} package), |SC|\meta{type} (\package{sidecap} package),
-% and |wrap|\meta{type} (\package{wrapfig} package).
-Ñïèñîê ôëîòîâ ìîæåò áûòü ñîçäàí ñ~ïîìîùüþ êîìàíäû |\listof|\meta{type}|s|,
-àíàëîãè÷íûé |\list|\-|of|\-|figures| è~|\list|\-|of|\-|tables|.
-Åñëè èñïîëüçóåòñÿ ïàêåò \package{fltpage}, îêðóæåíèå
-|FP|\meta{type} áóäåò îïðåäåëåíî, òî æå äëÿ |sideways|\meta{type}
-(ïàêåò \package{rotating}), |SC|\meta{type} (ïàêåò \package{sidecap}),
-è~|wrap|\meta{type} (ïàêåò \package{wrapfig}).
-
-\smallskip
-
-\pagebreak[3]
-% So for example
-Òàê, íàïðèìåð
-\begin{quote}
- |\DeclareCaptionType{diagram}|
-\end{quote}
-% will define a new caption type and floating environment called |diagram|,
-% the list will be stored in a file with the extension |lodiagram|, the name
-% (used for the caption) will be ``Diagram'' and the list name
-% ``List of Diagrams''.
-% The list could be typeset with |\listofdiagrams|.
-% Dependent on which packages are loaded, the environments |FPdiagram|,
-% |sidewaysdiagram|, |SCdiagram|, and |wrapdiagram| will be defined additionally.
-îïðåäåëÿåò íîâûé òèï ïîäïèñè è~îêðóæåíèå ôëîòà, íàçâàííûé |diagram|,
-Ñïèñîê áóäåò çàïèñûâàòüñÿ â~ôàéë ñ~ðàñøèðåíèåì |lodiagram|, èìÿ
-(èñïîëüçóåìîå â~íóìåðàöèîííîì çàãîëîâêå ïîäïèñè) áóäåò «|Diagram|» è~çàãîëîâîê Ñïèñêà
-«|List of Diagrams|». Ñïèñîê ìîæåò áûòü ðàñïå÷àòàí êîìàíäîé |\listofdiagrams|.
-Â~çàâèñèìîñòè îò òîãî, êàêèå ïàêåòû çàãðóæåíû, îïðåäåëÿòñÿ äîïîëíèòåëüíî îêðóæåíèÿ
-|FPdiagram|,
-|sideways|\-|diagram|, |SCdiagram| è~|wrap|\-|diagram|.
-
-%caption-deu.tex
-% So definiert zum Beispiel
-% \begin{quote}
-% |\DeclareCaptionType{diagram}[Diagramm][Diagrammverzeichnis]|
-% \end{quote}
-%
-Ïîäîáíîå æå îïðåäåëåíèå äëÿ ðóññêîé äîêóìåíòàöèè äîëæíî âûãëÿäåòü òàê:
-\begin{quote}
- |\DeclareCaptionType{diagram}[Äèàãðàììà][Ñïèñîê äèàãðàìì]|
-\end{quote}
-
-% --------------------------------------------------------------------------- %
-
-% \subsection{Further examples}
-\subsection{Åù¸ íåñêîëüêî ïðèìåðîâ}
-\label{examples}
-
-\subsubsection*{Example 1}
-
-%\NEWdescription{v3.1}
-% If you would like to have a line break between caption label and text
-% you could define it this way:
-Åñëè âàì íóæíî çàäàòü íîâóþ ñòðîêó ìåæäó íóìåðàöèîííûì çàãîëîâêîì è~òåêñòîì,
-âû ìîæåòå çàäàòü ýòî ñëåäóþùèì îáðàçîì:
-\begin{quote}
- |\DeclareCaptionFormat{myformat}{#1#2\\#3}|
-\end{quote}
-% If you select this format with |\caption|\-|setup{format=|\x|myformat}|
-% you get captions like this:
-Åñëè âû âûáåðåòå ýòîò ôîðìàò, çàäàâ |\caption|\-|setup{format=|\x|myformat}|
-âû ïîëó÷èòå òàêîé âèä ïîäïèñåé:
-%\begin{Example}
-% \captionsetup{skip=0pt}
- \example{format=myformat1,labelfont=bf}{\exampletext}
-%\end{Example}
-% You could even use an indention with this caption format:
-Âû ìîæåòå èñïîëüçîâàòü âòÿæêó ñ~ýòèì ôîðìàòîì:
-\begin{quote}
- |\captionsetup{format=myformat,indention=1cm}|
-\end{quote}
-% This would look like this:
-Ýòî áóäåò âûãëÿäåòü òàê:
-%\begin{Example}
-% \captionsetup{skip=0pt}
- \example{format=myformat1,indention=1cm,labelfont=bf}{\exampletext}
-%\end{Example}
-% Instead, you would like to have an indention only of the first line of
-% the caption text? No problem, e.g.
-À~÷òî åñëè, âìåñòî ýòîãî, çàäàòü âòÿæêó òîëüêî äëÿ ïåðâîé ñòðîêè ïîäïèñè?
-Íåò ïðîáëåì, íàïðèìåð
-\begin{quote}
- |\newlength\myindention|\\
- |\DeclareCaptionFormat{myformat}%|\\
- | {#1#2\\\hspace*{\myindention}#3}|\\
- \ldots\\
- |\setlength\myindention{1cm}|\\
- |\captionsetup{format=myformat}|
-\end{quote}
-% would give you captions like
-äàñò ïîäïèñü âèäà
-%\begin{Example}
-% \captionsetup{skip=0pt}
- \example{format=myformat2,myindention=1cm,labelfont=bf}{\exampletext}
-%\end{Example}
-% But you want to have an caption option for this indention, so you can use
-% it for example with
-% |\caption|\-|setup|\x|[figure]|\x|{my|\-|indention=|\x\ldots|}|?
-% This could be done, too:
-Íî âû õîòèòå ñîçäàòü îïöèþ äëÿ ýòîé âòÿæêè, äëÿ òîãî, ÷òîáû
-èñïîëüçîâàòü å¸ êàê |\captionsetup|\x|[figure]|\x|{myindention=|\ldots|}|?
-Ýòî òîæå ìîæíî ñäåëàòü:
-\begin{quote}
- |\newlength\myindention|\\
- |\DeclareCaptionOption{myindention}%|\\
- | {\setlength\myindention{#1}}|\\
- |\DeclareCaptionFormat{myformat}%|\\
- | {#1#2\\\hspace\myindention #3}|\\
- \ldots\\
- |\captionsetup{format=myformat,myindention=1cm}|
-\end{quote}
-% would give the same result as the example above.
-÷òî äàñò ðåçóëüòàò àíàëîãè÷íûé ïðèâåä¸ííîìó âûøå.
-
-% \subsubsection*{Example 2}
-\subsubsection*{Ïðèìåð 2}
-
-% You want captions to look like this:
-Âû õîòèòå ïîëó÷èòü ïîäïèñè òàêîãî âèäà:
-%\begin{Example}
-% \captionsetup{skip=0pt}
- \example{format=reverse,labelformat=fullparens,labelsep=fill,labelfont=it}{\exampletext}
-%\end{Example}
-\pagebreak[2]
-% You could do it this way:
-Ýòî ìîæíî ñäåëàòü ñëåäóþùèì îáðàçîì:
-\nopagebreak[3]
-\begin{quote}
- |\DeclareCaptionFormat{reverse}{#3#2#1}|\\
- |\DeclareCaptionLabelFormat{fullparens}%|\\
- | {(\bothIfFirst{#1}{~}#2)}|\\
- |\DeclareCaptionLabelSeparator{fill}{\hfill}|\\
- |\captionsetup{format=reverse,labelformat=fullparens,|\\
- | labelsep=fill,font=small,labelfont=it}|
-\end{quote}
-
-% \subsubsection*{Example 3}
-\subsubsection*{Ïðèìåð 3}
-
-% The caption text should go into the left margin? A possible solution would be:
-Òåêñò íóìåðàöèîííîãî çàãîëîâêà ïîäïèñè äîëæåí áûòü âûâåäåí â~ëåâîå ïîëå? Âîçìîæíîå ðåøåíèå:
-\begin{quote}
- |\DeclareCaptionFormat{llap}{\llap{#1#2}#3\par}|\\
- |\captionsetup{format=llap,labelsep=quad,singlelinecheck=no}|
-\end{quote}
-% As a result you would get captions like this:
-Â~ðåçóëüòàòå âû ïîëó÷èòå òàêèå ïîäïèñè:
-\example{format=llap,labelsep=quad,singlelinecheck=no,margin=0pt}{\exampletext}
-
-\medskip
-
-% If the indention into the margin shall be fixed, you could use a combination
-% of |\llap| and |\makebox|, for example:
-Åñëè ëåâûé êðàé ïîäïèñè ïðè âûõîäå ïîäïèñè íà ïîëÿ äîëæåí áûòü íà ôèêñèðîâàííîì ðàññòîÿíèè,
-ìîæíî èñïîëüçîâàòü êîìáèíàöèþ êîìàíä
-|\llap| è~|\makebox|, íàïðèìåð:
-\begin{quote}
- |\DeclareCaptionFormat{llapx}%|\\
- | {\llap{\makebox[5em][l]{#1}}#3\par}|\\
- |\captionsetup{format=llapx,singlelinecheck=off}|
-\end{quote}
-\example{format=llapx,singlelinecheck=off,skip=0pt,margin=0pt}{\exampletext}
-
-% \subsubsection*{Example 4}
-\subsubsection*{Ïðèìåð 4}
-
-% This example puts a figure aside a table, but uses only one common caption for both.
-% This will be achieved by a combination of
-% |\Declare|\-|Caption|\-|Label|\-|Format| and |\caption|\-|list|\-|entry|:
-Ñëåäóþùèé ïðèìåð ïîìåùàåò ðèñóíîê ðÿäîì ñ~òàáëèöåé, íî èñïîëüçóåò îáùóþ äëÿ íèõ ïîäïèñü.
-Ýòî ìîæíî ñäåëàòü êîìáèíàöèåé êîìàíä
-|\Declare|\-|Caption|\-|Label|\-|Format| è~|\caption|\-|list|\-|entry|:
-\begin{quote}
- |\DeclareCaptionLabelFormat{andtable}%|\\
- | {#1~#2 \& \tablename~\thetable}|\\
- \ldots\\
- |\begin{figure}|\\
- | \centering|\\
- | \includegraphics{|\ldots|}%|\\
- | \qquad|\\
- | \begin{tabular}[b]{\ldots}|\\
- | |\ldots\\
- | \end{tabular}|\\
- | \captionlistentry[table]{|\ldots|}|\\
- | \captionsetup{labelformat=andtable}|\\
- | \caption{|\ldots|}|\\
- |\end{figure}|
-\end{quote}
-\DeleteShortVerb{\|}%
-\noindent\begin{minipage}{\linewidth}
- \captionsetup{type=figure}
- \centering
- \includegraphics[width=30pt]{cat}%
- \qquad
- \begin{tabular}[b]{r|rr}
- & x & y \\\hline
- a & 1 & 2 \\
- b & 3 & 4 \\
- \end{tabular}
-% \captionlistentry[table]{A figure and a table with a common caption}
-% \captionsetup{labelformat=andtable}
-% \caption{A figure and a table with a common caption~\footnotemark}
- \captionlistentry[table]{Ðèñóíîê è~òàáëèöà ñ~îáùåé ïîäïèñüþ}
- \captionsetup{labelformat=andtable}
- \caption{Ðèñóíîê è~òàáëèöà ñ~îáùåé ïîäïèñüþ\footnotemark}
-\end{minipage}
-% \footnotetext{The picture was taken with permission from the
-% \LaTeX\ Companion\cite{TLC2} examples.}
-\IfFileExists{cat.eps}%
-{\footnotetext{Ðèñóíîê ëþáåçíî ïðåäîñòàâëåí èç ïðèìåðîâ êíèãè
- \LaTeX\ Companion\cite{TLC2}.}}{}
-\MakeShortVerb{\|}
-% (Please remember that |\caption|\-|list|\-|entry| increments the figure
-% resp.~table counter.)
-(Íàïîìíèì, ÷òî êîìàíäà |\caption|\-|list|\-|entry|, êàê è~|\caption|, óâåëè÷èâàåò ñ÷¸ò÷èê ôëîòà.)
-
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-% \section{Document classes \& Babel support}
-\section{Êëàññû äîêóìåíòîâ è~ïîääåðæêà ïàêåòà \package{babel}}
-\label{classes}
-
-% This section will give you an overview of the document classes the
-% \package{caption} supports, what do they already offer regarding captions,
-% what side effects will occur when using the \package{caption} package with
-% them, and what are the `default' settings for them.
-Ýòîò ðàçäåë äàñò îáçîð êëàññîâ äîêóìåíòîâ, êîòîðûå ïîääåðæèâàþòñÿ ïàêåòîì
-\package{caption}, ÷òî îíè óæå ïðåäëàãàþò äëÿ ðàáîòû ñ~ïîäïèñÿìè,
-êàêèå ïîáî÷íûå ýôôåêòû âîçíèêàþò ïðè èñïîëüçîâàíèè ñ~íèìè ïàêåòà \package{caption}
-è~êàêîâû óñòàíîâêè ïî óìîë÷àíèþ äëÿ ýòèõ êëàññîâ.
-
-\NEWfeature{v3.1}
-% The `default' settings depend on the document class you use; they represent
-% how the class author wanted the captions to look like. So for example
-% setting |format=|\x|default| can give you different visual designs when used
-% with different document classes.
-Óñòàíîâêè ïî óìîë÷àíèþ çàâèñÿò îò êëàññà äîêóìåíòà, èñïîëüçóåìîãî âàìè; îíè ïðåäñòàâëÿþò
-îôîðìëåíèå ïîäïèñåé, ñîîòâåòñòâóþùåå çàìûñëàì àâòîðà äàííîãî êëàññà äîêóìåíòà. Íàïðèìåð, íàñòðîéêè
-|format=|\x|default| äàäóò ðàçëè÷íûé ðåçóëüòàò ïðè èñïîëüçîâàíèè ñ~ðàçíûìè êëàññàìè.
-
-\begingroup\setlength\leftmargini{0.3em}% default = 2.5em
-\INFO
-% If you don't find the document class you use in this section, you usually
-% don't have to worry: Many document classes (e.g.~the \class{octavo} class)
-% are derived from one of the standard document classes \class{article},
-% \class{report}, or \class{book}, and behave the same regarding captions.
-% \Thispackage\ automatically does a compatibility check against the document
-% class used and will give you the clear warning
-Åñëè âû íå íàøëè êëàññ äîêóìåíòà â~ýòîì ðàçäåëå, òî, îáû÷íî, ýòî íå ïîâîä äëÿ âîëíåíèÿ:
-ìíîæåñòâî êëàññîâ äîêóìåíòîâ (íàïðèìåð, êëàññ \class{octavo})
-ïîëó÷åíû èç ñòàíäàðòíûõ êëàññîâ äîêóìåíòîâ
-\class{article}, \class{report} èëè \class{book}, è~èìåþò
-àíàëîãè÷íûå íàñòðîéêè äëÿ ïîäïèñåé.
-\Thispackage\ àâòîìàòè÷åñêè äåëàåò ïðîâåðêó ñîâìåñòèìîñòè êëàññà äîêóìåíòà
-è~äà¸ò íåäâóñìûñëåííîå ïðåäóïðåæäåíèå
-\begin{quote}\footnotesize
- |Package caption Warning: Unsupported document class (or package) detected,|\\
- |(caption) usage of the caption package is not recommended.|\\
- |See the caption package documentation for explanation.|
-\end{quote}
-% if such an incompatibility was detected.
-% If you don't get such warning everything is fine, but if you get it the
-% usage of \thispackage\ is not recommended and especially not supported.
-åñëè áûëà îïðåäåëåíà íåñîâìåñòèìîñòü.
-Åñëè âû òàêîãî ïðåäóïðåæäåíèÿ íå ïîëó÷èëè, òî âñ¸ â~ïîðÿäêå, íî åñëè âû ýòî ïðåäóïðåæäåíèå
-âñ¸ æå ïîëó÷èëè, \thispackage\ íå ðåêîìåíäóåòñÿ è~òåì áîëåå íå ïîääåðæèâàåòñÿ.
-
-\begin{Expert}
-% If you get such a compatibility warning but decide to use \thispackage{}
-% anyway, you should watch carefully what side-effects occur, usually the
-% look and feel of your captions will change by just including \thispackage{}
-% without options, meaning they do not look like as intended by the author
-% of the document class.
-% If this is fine for you, you should first specify the option |style=|\x|base|
-% via |\use|\-|package[style=|\x|base]{caption}| or
-% |\caption|\-|setup{style=|\x|base}| to set \thispackage\ into a well-defined
-% state.
-% Afterwards you can start setting your own options additionally and
-% keep your fingers crossed.
-Åñëè âû, íåñìîòðÿ íà ïðåäóïðåæäåíèå, ðåøèëè âñ¸ ðàâíî èñïîëüçîâàòü \thispackage{},
-âû äîëæíû ïðîâåðèòü, êàêîé ïîáî÷íûé ýôôåêò âîçíèêàåò. Îáû÷íî ïîäêëþ÷åííûé \thispackage{}
-áåçî âñÿêèõ îïöèé â~òàêèõ ñëó÷àÿõ èçìåíÿåò âûâîä ïîäïèñåé, è~îíè âûãëÿäÿò íå òàê, êàê
-ïðåäóñìîòðåíî àâòîðîì êëàññà äîêóìåíòà.
-Åñëè ýòî âàñ óäîâëåòâîðÿåò, âû ìîæåòå äëÿ íà÷àëà çàäàòü êëþ÷ |style=|\x|base|,
-çàäàâ åãî â~ñòðîêå |\use|\-|package[style=|\x|base]{caption}| èëè â~êîìàíäå
-|\caption|\-|setup{style=|\x|base}|, ÷òî âåðí¸ò õîðîøî íàñòðîåííûå ïàêåòîì óñòàíîâêè.
-Ïîñëå ýòîãî âû ìîæåòå çàäàâàòü ñâîè îïöèè è~íàäåÿòüñÿ íà ëó÷øåå.
-\end{Expert}
-\endgroup
-
-\newcommand*\Option{Îïöèÿ}
-\newcommand*\defaultvalue{çíà÷åíèå \texttt{ïî óìîë÷àíèþ}}
-\newcommand*\uses{\textit{èñïîëüçóåò}}
-\newcommand*\settings{\textit{íàñòðîéêè}}
-\newcommand*\nofont{\textit{îòñóòñòâóåò}}
-
-% \subsection{Standard \LaTeX: article, report, and book}
-\subsection{Ñòàíäàðòíûé \LaTeX: article, report, è~book}
-
-\begin{tabular}{ll}
-\Option & \defaultvalue \\\hline
-|format=| & |plain| \\
-|labelformat=| & |simple| \\
-|labelsep=| & |colon| \\
-|justification=| & |justified| \\
-|font=| & \nofont \\
-|labelfont=| & \nofont \\
-|textfont=| & \nofont \\
-\end{tabular}
-
-\begin{Annotation}
-% This also applies to document classes derived from them.
-Ýòî îòíîñèòñÿ è~ê~ïðîèçâîäíûì îò íèõ êëàññàì.
-\end{Annotation}
-
-% \subsection{\AmS: amsart, amsproc, and amsbook}
-\subsection{Êëàññû \AmS: amsart, amsproc, è~amsbook}
-\label{AMS}
-
-\begin{tabular}{ll}
-\Option & \defaultvalue \\\hline
-|format=| & |plain| \\
-|labelformat=| & |simple| \\
-|labelsep=| & |.\enspace| \\
-|justification=| & |justified| \\
-|font=| & |\@captionfont| \\
-|labelfont=| & |\@captionheadfont| \\
-|textfont=| & |\@captionfont\upshape| \\
-\end{tabular}
-
-\begin{Annotation*}
-% |\@caption|\-|font| will be set to |\normal|\-|font|, and
-% |\@caption|\-|head|\-|font| to |\sc|\-|shape| by the \AmS\ document classes.
-Êëàññû \AmS\ îïðåäåëÿþò êîìàíäó |\@caption|\-|font|, êîòîðàÿ çàäà¸òñÿ êàê
-|\normal|\-|font|, à~|\@caption|\-|head|\-|font| \cdash--- êàê |\scshape|.
-\end{Annotation*}
-
-% Furthermore the margin will be set to |\caption|\-|indent| for
-% more-than-one-line captions (which will be set to |3pc| by the \AmS\ classes),
-% the margin for single-line captions will be set to the half of it instead.
-% If you want to use a common margin for both, insert
-% |\clear|\-|caption|\-|setup[margin*]{single|\-|line}|
-% into the preamble of your document, after loading \thispackage.
-Êðîìå ýòîãî ïîëå ïðèíèìàåò çíà÷åíèå |\captionindent| â~ìíîãîñòðî÷íûõ ïîäïèñÿõ
-(êîòîðîå ðàâíî â~ýòèõ êëàññàõ~|3pc|),
-ïîëå äëÿ îäíîñòðî÷íîé ïîäïèñè óìåíüøàåòñÿ â~äâà ðàçà.
-Åñëè âû õîòèòå çàäàòü îáùåå ïîëå äëÿ îáîèõ âàðèàíòîâ, äîáàâüòå â~ïðåàìáóëå äîêóìåíòà
-|\clear|\-|caption|\-|setup[margin*]{single|\-|line}|
-ïîñëå çàãðóçêè ïàêåòà.
-
-% Additionally the options |figure|\-|position=b,|\x|table|\-|position=t|
-% will be set. You can override these settings by specifying other values for
-% |figure|\-|position=| or |table|\-|position=| in the option list while
-% loading \thispackage.
-Äîïîëíèòåëüíî çàäàþòñÿ îïöèè |figure|\-|position=b,|\x|table|\-|position=t|.
-Âû ìîæåòå èçìåíèòü ýòè óñòàíîâêè, çàäàâ äðóãèå çíà÷åíèÿ äëÿ êëþ÷åé
-|figure|\-|position=| èëè |table|\-|position=| ïðè çàãðóçêå ïàêåòà.
-
-\subsection{Êëàññ beamer}
-\label{beamer}
-
-\begin{tabular}{ll}
-\Option & \defaultvalue \\\hline
-|format=| & |plain| \\
-|labelformat=| & \textit{íå íóìåðóåòñÿ} \\
-|labelsep=| & |colon| \\
-|justification=| & |raggedright| \\
-|font=| & \class{beamer} «|caption|» \settings \\
-|labelfont=| & \class{beamer} «|caption name|» \settings \\
-|textfont=| & \nofont \\
-\end{tabular}
-
-% \subsubsection*{Build-in features, and side-effects}
-% You can setup font and color settings with
-% |\set|\-|beamer|\-|font{caption}|\marg{options} and
-% |\set|\-|beamer|\-|font{caption name}|\marg{options}.
-% This will still work, unless you set a different font with
-% |\caption|\-|setup{font=|\x\meta{options}|}| or
-% |\caption|\-|setup{label|\-|font=|\x\meta{options}|}|.\par
-% Furthermore the \class{beamer} classes offer different caption templates
-% which can be chosen with
-% |\set|\-|beamer|\-|template|\x|{caption}|\x|[|\meta{template}|]|.
-% Since \thispackage\ replaces this caption template mechanism,
-% |\def|\-|beamer|\-|template*|\x|{caption}|\x\marg{template code}
-% and
-% |\set|\-|beamer|\-|template|\x|{caption}|\x|[|\meta{template}|]|
-% will have no effect when \thispackage\ is used.
-\subsubsection*{Âñòðîåííûå îñîáåííîñòè è~ïîáî÷íûå ýôôåêòû}
-Âû ìîæåòå çàäàòü øðèôò è~öâåò ñ~ïîìîùüþ
-|\set|\-|beamer|\-|font{caption}|\marg{options} è~%
-|\set|\-|beamer|\-|font{caption name}|\marg{options}.
-Ýòî áóäåò ðàáîòàòü, åñëè òîëüêî âû íå çàäàäèòå äðóãîé øðèôò ÷åðåç
-|\caption|\-|setup{font=|\x\meta{options}|}| èëè
-|\caption|\-|setup{label|\-|font=|\x\meta{options}|}|.\par
-Êðîìå ýòîãî êëàññ \class{beamer} ïðåäëàãàåò ðàçëè÷íûå øàáëîíû
-îôîðìëåíèÿ ïîäïèñåé, çàäàâàåìûå ÷åðåç
-|\set|\-|beamer|\-|template|\x|{caption}|\x|[|\meta{template}|]|.
-Ïîñêîëüêó \thispackage\ çàìåíÿåò ýòîò ìåõàíèçì, êîìàíäû
-|\def|\-|beamer|\-|template*|\x|{caption}|\x\marg{template code}
-è~|\set|\-|beamer|\-|template|\x|{caption}|\x|[|\meta{template}|]|
-íå èìåþò ñèëû ïðè åãî èñïîëüçîâàíèè.
-
-% \subsection{\KOMAScript: scrartcl, scrreprt, and scrbook}
-\subsection{Êëàññû \KOMAScript: scrartcl, scrreprt, è~scrbook}
-\label{KOMA}
-
-\begin{tabular}{ll}
-\Option & \defaultvalue \\\hline
-% |format=| & \uses\ |\setcapindent| \textit{\&} |\setcaphanging| \settings \\
-|format=| & \uses\ |\setcapindent| è~|\setcaphanging| \settings \\
-% |labelformat=| & \textit{like \purett{simple}, but with support of ``autodot''}\\
-|labelformat=| & \textit{òî æå, ÷òî \purett{simple}, íî ñ~ïîääåðæêîé ``autodot''}\\
-|labelsep=| & |\captionformat| \\
-|justification=| & |justified| \\
-|font=| & \settings\ |\setkomafont{caption}| \\
-|labelfont=| & \settings\ |\setkomafont{captionlabel}| \\
-|textfont=| & \nofont \\
-\end{tabular}
-
-% \subsubsection*{Build-in features}
-% The \KOMAScript\ document classes offer many ways to customize the look and
-% feel of the captions. For an overview and a full description please take a
-% look at the \KOMAScript\ documentation, section `Tables and Figures'.
-\subsubsection*{Âñòðîåííûå âîçìîæíîñòè}
-Êëàññû \KOMAScript\ ïðåäëàãàþò ìíîãî âàðèàíòîâ äëÿ íàñòðîéêè âûâîäà
-ïîäïèñåé. Ïîëíûé îáçîð âû ìîæåòå íàéòè â~[àíãëèéñêîé] äîêóìåíòàöèè
-\KOMAScript, ðàçäåë `Tables and Figures'.
-
-% \subsubsection*{Side effects}
-% The optional argument of |\set|\-|cap|\-|width| is not supported and
-% will be ignored if used in conjunction with the \package{caption} package.
-% Furthermore the \KOMAScript\ options |table|\-|caption|\-|above| \&
-% |table|\-|caption|\-|below| and the commands |\caption|\-|above| \&
-% |\caption|\-|below| are stronger than the |position=| setting offered by
-% the \package{caption} package.
-\subsubsection*{Ïîáî÷íûå ýôôåêòû}
-Äîïîëíèòåëüíûé àðãóìåíò êîìàíäû |\setcapwidth| íå ïîääåðæèâàåòñÿ (ïîêà)
-è~áóäåò èãíîðèðîâàòüñÿ ïðè ñîâìåñòíîì èñïîëüçîâàíèè ñ~ïàêåòîì \package{caption}.
-Ïîìèìî ýòîãî, îïöèè \KOMAScript\ |tablecaptionabove| è~%
-|table|\-|caption|\-|below| è~êîìàíäû |\caption|\-|above| è~|\caption|\-|below|
-áóäóò ñèëüíåå ÷åì íàñòðîéêè êëþ÷à |position=| ïðåäëàãàåìîãî ïàêåòîì \package{caption}.
-
-% \subsection{\NTG: artikel, rapport, and boek}
-\subsection{Êëàññû \NTG: artikel, rapport, è~boek}
-\label{NTG}
-
-\begin{tabular}{ll}
-\Option & \defaultvalue \\\hline
-|format=| & |plain| \\
-|labelformat=| & |simple| \\
-|labelsep=| & |colon| \\
-|justification=| & |justified| \\
-|font=| & \nofont \\
-|labelfont=| & |\CaptionLabelFont| \\
-|textfont=| & |\CaptionTextFont| \\
-\end{tabular}
-
-% \subsubsection*{Build-in features, and side-effects}
-% |\Caption|\-|Label|\-|Font| and |\Caption|\-|Text|\-|Font| can be set either
-% directly or by using |\Caption|\-|Fonts|.
-% Both is still supported unless you use one of the two options
-% |label|\-|font=| or |text|\-|font=| offered by \thispackage.
-\subsubsection*{Âñòðîåííûå îñîáåííîñòè è~ïîáî÷íûå ýôôåêòû}
-|\CaptionLabelFont| è~|\Caption|\-|Text|\-|Font| ìîãóò áûòü
-çàäàíû ëèáî íåïîñðåäñòâåííî, ëèáî
-ñ~èñïîëüçîâàíèåì êîìàíäû |\Caption|\-|Fonts|. Îáà âàðèàíòà
-ïîääåðæèâàþòñÿ, òîëüêî åñëè íå áûë
-çàäàí îäèí èç êëþ÷åé |labelfont=| èëè |textfont=| äàííîãî ïàêåòà.
-
-% \subsection{\SmF{}: smfart and smfbook}
-\subsection{Êëàññû \SmF{}: smfart è~smfbook}
-\label{SMF}
-
-% Since the \SmF\ document classes are derived from the \AmS\ document classes
-% the same default values are valid here.
-Ïîñêîëüêó êëàññû \SmF\ ÿâëÿþòñÿ ïðîèçâîäíûìè êëàññîâ \AmS, òî òå æå îãðàíè÷åíèÿ
-äåéñòâóþò è~çäåñü.
-
-% Additionally the margin is limited up to the tenth of the |\line|\-|width|.
-% If you don't like this limitation, you can switch it off with the option
-% |max|\-|margin=|\x|off| or |max|\-|margin=|\x|false|
-% (which both means the same).
-Êðîìå òîãî ðàçìåð ïîëÿ îãðàíè÷åí îäíîé äåñÿòîé îò çíà÷åíèÿ |\linewidth|.
-Åñëè âàñ íå óñòðàèâàþò ýòè îãðàíè÷åíèÿ, èõ ìîæíî îòêëþ÷èòü ñ~ïîìîùüþ
-|maxmargin=|\x|off| èëè |maxmargin=|\x|false| (îáà âàðèàíòà äàþò îäíî è~òî æå).
-
-\subsection{Êëàññ thesis}
-\label{thesis}
-
-\begin{tabular}{ll}
-\Option & \defaultvalue \\\hline
-|format=| & |hang| \\
-% |labelformat=| & \textit{like \purett{simple}, but with short name}\\
-|labelformat=| & \textit{òî æå, ÷òî \purett{simple}, íî ñ~êðàòêèì èìåíåì}\\
-|labelsep=| & |colon| \\
-|justification=| & |justified| \\
-|font=| & \nofont \\
-|labelfont=| & |\captionheaderfont| \\
-|textfont=| & |\captionbodyfont| \\
-\end{tabular}
-
-% \subsubsection*{Build-in features, and side-effects}
-\subsubsection*{Âñòðîåííûå îñîáåííîñòè è~ïîáî÷íûå ýôôåêòû}
-% The caption label font can be set with |\caption|\-|header|\-|font|,
-% the caption text font with |\caption|\-|body|\-|font|.
-% Both is still supported unless you use one of the two options
-% |label|\-|font=| or |text|\-|font=| offered by \thispackage.
-Øðèôò íóìåðàöèîííîãî çàãîëîâêà ìîæåò áûòü çàäàí ÷åðåç êîìàíäó |\caption|\-|header|\-|font|,
-øðèôò äëÿ òåêñòà ïîäïèñè \cdash--- ÷åðåç |\caption|\-|body|\-|font|.
-Îáå êîìàíäû ïîääåðæèâàþòñÿ, òîëüêî åñëè âû íå èñïîëüçîâàëè îïöèè
-|label|\-|font=| èëè |text|\-|font=|, êîòîðûå ïðåäëàãàåò \thispackage.
-
-% \subsection{frenchb Babel option}
-\subsection{Îïöèÿ frenchb ïàêåòà Babel}
-\label{frenchb}
-
-% If you use the \package{frenchb} option of the \package{babel} package
-% with one of the three standard \LaTeX{} classes (or a one derived from them)
-% the default |label|\-|sep=| will be set to |\Caption|\-|Sep|\-|a|\-|ra|\-|tor|
-% (offered by \package{frenchb}), overriding the default value set by the
-% document class.
-% So redefining |\Caption|\-|Sep|\-|a|\-|ra|\-|tor| will still work, unless you
-% don't select a different |label|\-|sep=| than the default one.
-Åñëè âû èñïîëüçóåòå îïöèþ \package{frenchb} ïàêåòà \package{babel}
-ñ~îäíèì èç òð¸õ ñòàíäàðòíûõ êëàññîâ \LaTeX'à (èëè èõ ïðîèçâîäíûìè)
-çíà÷åíèå ïî óìîë÷àíèþ êëþ÷à |labelsep=| [îïöèÿ |labelsep=default|] áóäåò èñïîëüçîâàòü
-çíà÷åíèå êîìàíäû |\Caption|\-|Sep|\-|a|\-|ra|\-|tor| (ïðåäëàãàåìîé
-ïàêåòîì \package{frenchb}), çàìåíèâ çíà÷åíèå ïî óìîë÷àíèþ, çàäàííîå êëàññîì.
-À~ïåðåîïðåäåë¸ííàÿ êîìàíäà |\Caption|\-|Sep|\-|a|\-|ra|\-|tor|
-áóäåò ðàáîòàòü äî òåõ ïîð, ïîêà âû
-íå îïðåäåëèòå äðóãîå çíà÷åíèå |labelsep=|, îòëè÷àþùååñÿ îò çíà÷åíèÿ ïî óìîë÷àíèþ.
-
-\INFO*
-% Please load \thispackage\ \emph{after} the \package{babel} package.
-Ïîæàëóéñòà çàãðóæàéòå \thispackage\ \emph{ïîñëå} ïàêåòà \package{babel}.
-
-% \subsection{frenchle and frenchpro packages}
-\subsection{Ïàêåòû frenchle è~frenchpro}
-\label{frenchpro}
-
-% If you use the \package{frenchle} or \package{frenchpro} package,
-% the default |label|\-|sep=| will be set to |\caption|\-|sep|\-|a|\-|ra|\-|tor|
-% (offered by \package{frenchle/pro}) plus \cs{space}, overriding the default
-% value set by the document class.
-% So redefining |\caption|\-|sep|\-|a|\-|ra|\-|tor| will still work, unless you
-% don't select a different |label|\-|sep=| than the default one.
-Åñëè âû èñïîëüçóåòå ïàêåòû \package{frenchle} èëè \package{frenchpro},
-çíà÷åíèå ïî óìîë÷àíèþ |label|\-|sep=| îïðåäåëèò çíà÷åíèå êîìàíäû
-|\caption|\-|sep|\-|a|\-|ra|\-|tor| (ïðåäëàãàåìîé
-ïàêåòàìè \package{frenchle/pro}) ïëþñ \cs{space}, çàìåíèâ çíà÷åíèå, çàäàííîå êëàññîì
-ïî óìîë÷àíèþ.
-Ïîýòîìó ïåðåîïðåäåëåíèå |\caption|\-|sep|\-|a|\-|ra|\-|tor|
-ðàáîòàåò äî òåõ ïîð, ïîêà âû
-íå îïðåäåëèòå äðóãîå çíà÷åíèå |labelsep=|, îòëè÷àþùååñÿ îò çíà÷åíèÿ ïî óìîë÷àíèþ.
-
-% Furthermore the default |text|\-|font=| will be set to |text|\-|font=|\x|it|,
-% since this emulates the default setting of |\caption|\-|font| defined by the
-% \package{frenchle} or \package{frenchpro} package.
-% %If you redefine |\captionfont| after loading the \package{frenchle} or
-% %\package{frenchpro} package, this redefinition gets lost.
-Ïîìèìî ýòîãî êëþ÷ ïî óìîë÷àíèþ |text|\-|font=| áóäåò çàäàí êàê |text|\-|font=|\x|it|,
-ïîñêîëüêó ýòî ýìóëèðóåò íàñòðîéêè êîìàíäû |\caption|\-|font| îïðåäåë¸ííîé ïàêåòàìè
-\package{frenchle} èëè \package{frenchpro}.
-% %Åñëè âû ïåðåîïðåäåëèòå êîìàíäó |\captionfont| ïîñëå çàãðóçêè \package{frenchle} èëè
-% %\package{frenchpro}, ýòî ïåðåîïðåäåëåíèå ïðîïàä¸ò.
-% Please note that the command |\caption|\-|font| is used by the
-% \package{caption} package internally for a different purpose,
-% so you should not change it (anymore).
-Îáðàòèòå âíèìàíèå, ÷òî êîìàíäà |\caption|\-|font| èñïîëüçóåòñÿ ïàêåòîì
-\package{caption} äëÿ äðóãèõ öåëåé, ïîýòîìó ëó÷øå åþ áîëüøå íå ïîëüçîâàòüñÿ.
-
-% The command |\un|\-|numbered|\-|captions|\marg{figure \emph{or} table} will
-% still work, but only unless you don't select a different |label|\-|format=|
-% than the default one.
-Êîìàíäà |\un|\-|numbered|\-|captions|\marg{figure \emph{èëè} table} áóäåò ðàáîòàòü,
-íî òîëüêî, åñëè âû íå îïðåäåëèëè êëþ÷ |label|\-|format=|, îòëè÷àþùèéñÿ
-îò çíà÷åíèÿ ïî óìîë÷àíèþ.
-
-\INFO*
-% Please load \thispackage\ \emph{after} the \package{frenchle}
-% or \package{frenchpro} package.
-Ïîæàëóéñòà, çàãðóæàéòå \thispackage\ \emph{ïîñëå} ïàêåòîâ \package{frenchle}
-èëè \package{frenchpro}.
-
-% --------------------------------------------------------------------------- %
-
-\pagebreak[4]
-% \section{Package support}
-\section{Ïîääåðæêà ïàêåòîâ}
-\label{packages}
-\label{compatibility}
-
-%\NEWdescription{v3.1}
-% \Thispackage\ was adapted to the following packages which deals with
-% captions, too:
-\Thispackage\ àäàïòèðîâàí ñ~ïàêåòàìè, êîòîðûå òàêæå ðàáîòàþò ñ~ïîäðèñóíî÷íûìè ïîäïèñÿìè:
-\begin{quote}
- \package{float}, \package{floatflt}, \package{fltpage},
- \package{hyperref}, \package{hypcap}, \package{listings},
- \package{longtable}, \package{picinpar}, \package{picins},
- \package{rotating}, \package{setspace}, \package{sidecap},
- \package{subfigure}, \package{supertabular}, \package{threeparttable},
- \package{wrapfig}, and \package{xtab}
-\end{quote}
-
-% Furthermore the \package{floatrow} package\cite{floatrow}, the
-% \package{subcaption} package (which is part of the \package{caption} package
-% bundle), and the \package{subfig} package\cite{subfig} support \thispackage{}
-% and use its |\caption|\-|setup| interface.
-Ïîìèìî ýòîãî ïàêåòû \package{floatrow}\cite{floatrow},
-ïàêåò \package{subcaption} (ÿâëÿåòñÿ ÷àñòüþ ãðóïïû ïàêåòîâ \package{caption}),
-è~ïàêåò \package{subfig}\cite{subfig}
-ïîääåðæèâàþò \thispackage\ è~èñïîëüçóþò èíòåðôåéñ |\caption|\-|setup|.
-
-\begingroup\setlength\leftmargini{0.3em}% default = 2.5em
-\INFO
-% If a package (or document class) unknown to \thispackage\ redefines
-% the |\caption| command as well, this redefinition will be preferred
-% over the one this package offers, providing maximum compatibility and
-% avoiding conflicts.
-% If such a potential incompatibility is detected, you will see this
-% warning message:~\footnote{%
-% You can suppress this warning by specifying the option
-% \texttt{compatibility=true} when loading \thispackage.}
-Åñëè ïàêåò (èëè êëàññ äîêóìåíòà), íåèçâåñòíûé äàííîìó ïàêåòó, ïåðåîïðåäåëÿåò
-êîìàíäó |\caption|, ýòî ïåðåîïðåäåëåíèå áóäåò áîëåå ïðåäïî÷òèòåëüíî ïî
-ñðàâíåíèþ ñ~òåì ÷òî ïðåäëàãàåò \thispackage, ÷òî ñîçäàñò ìàêñèìóì ñîâìåñòèìîñòè
-è~äàñò âîçìîæíîñòü èçáåæàòü ïîñëåäñòâèé êîíôëèêòîâ.
-Åñëè ïîòåíöèàëüíàÿ íåñîâìåñòèìîñòü áóäåò îáíàðóæåíà, âû óâèäèòå ñëåäóþùåå
-ïðåäóïðåæäåíèå:\footnote{%
- Âû ìîæåòå çàïðåòèòü ýòî ïðåäóïðåæäåíèå, çàäàâ îïöèþ \texttt{compatibility=true}
- ïðè çàãðóçêå äàííîãî ïàêåòà.}
-\begin{quote}\footnotesize
- |Package caption Warning: \caption will not be redefined since it's already|\\
- |(caption) redefined by a document class or package which is|\\
- |(caption) unknown to the caption package.|\\
- |See the caption package documentation for explanation.|
-\end{quote}
-\endgroup
-
-% As a result, the following features offered by \thispackage\ will not be available:
-Â~ðåçóëüòàòå, ñëåäóþùèå íàñòðîéêè, êîòîðûå ïðåäëàãàåò \thispackage,
-íå áóäóò ðàáîòàòü:
-\begin{itemize}
-% \item the options |labelformat=|, |position=auto|, |list=|, and |listformat=|
-% \item |\caption*| (to produce a caption without label)
-% \item |\caption[]{|\ldots|}| (to produce no entry in the List of Figures or Tables)
-% \item |\caption{}| (to produce an empty caption without label separator)
-% \item |\ContinuedFloat|
-% \item correctly justified captions in environments like \texttt{wide} and
-% \texttt{addmargin} which add extra margins
-% \item the \textsf{hypcap} feature \See{\Ref{hyperref}\,}
-% \item the sub-caption feature \See{\package{subcaption} package documentation}
- \item îïöèè |labelformat=|, |position=auto|, |list=| è~|listformat=|
- \item |\caption*| (ñîçäàíèå ïîäïèñè áåç íóìåðàöèîííîãî çàãîëîâêà)
- \item |\caption[]{|\ldots|}| (îòêëþ÷åíèå âûâîäà â~Ñïèñîê ôëîòîâ)
- \item |\caption{}| (ñîçäàíèå ïîäïèñè áåç ðàçäåëèòåëÿ ìåæäó íóìåðàöèîííûì çàãîëîâêîì è~òåêñòîì)
- \item |\ContinuedFloat|
- \item ïðàâèëüíàÿ âûêëþ÷êà ïîäïèñåé â~îêðóæåíèÿõ òèïà \texttt{wide} è~\texttt{addmargin},
- êîòîðûå äîáàâëÿþò äîïîëíèòåëüíûå ïîëÿ
- \item îïöèÿ \textsf{hypcap} \See{\Ref{hyperref}\,}
- \item âîçìîæíîñòü ñîçäàíèÿ ïîäïîäïèñè \See{äîêóìåíòàöèþ ê~ïàêåòó \package{subcaption}}
-\end{itemize}
-
-\DescribeMacro{compatibility=}
-% You can override this compatibility mode by specifying the option
-Âû ìîæåòå îòêëþ÷èòü òàêîé ðåæèì ñîâìåñòèìîñòè, çàäàâ
-\begin{quote}
- |compatibility=false|
-\end{quote}
-% when loading \thispackage.
-% But please note that using this option is neither recommended nor supported
-% since unwanted side-effects or even errors could occur afterwards.
-% (For that reason you will get a warning about this.)
-ïðè çàãðóçêå ïàêåòà.
-Íî îáðàòèòå âíèìàíèå, ÷òî èñïîëüçîâàíèå ýòîé îïöèè è~íå ðåêîìåíäóåòñÿ, è~íå ïîääåðæèâàåòñÿ
-ïîñêîëüêó ìîãóò âîçíèêíóòü ïîáî÷íûå ýôôåêòû è~äàæå îøèáêè.
-(Ïî ýòîìó ïîâîäó âû êàê ðàç óæå ïîëó÷èëè ïðåäóïðåæäåíèå.)
-
-\newcommand\packagedescription[1]{%
- \ifvmode\else\par\fi
- \nopagebreak
- \parbox[b]{\linewidth}{\footnotesize\leftskip=10pt\rightskip=10pt\relax#1}\par
- \nopagebreak\smallskip\nopagebreak}
-
-\pagebreak[3]
-\subsection{Ïàêåò algorithms}
-\label{algorithms}
-\packagedescription{%
-% The \package{algorithms} package bundle\cite{algorithms} provides two
-% environments: The \texttt{algorithmic} environment provides a possibility
-% for describing algorithms, and the \texttt{algorithm} environment provides
-% a ``float'' wrapper for algorithms.}
-Ãðóïïà ïàêåòîâ \package{algorithms}\cite{algorithms} ïðåäëàãàåò äâà îêðóæåíèÿ:
-Îêðóæåíèå \texttt{algorithmic} ïðåäëàãàåò âîçìîæíîñòü äëÿ çàïèñè àëãîðèòìîâ,
-à~\texttt{algorithm} \cdash--- «ïëàâàþùèé» âàðèàíò àëãîðèòìîâ.}
-
-% Since the \texttt{algorithm} environment is implemented via |\new|\-|float|
-% provided by the \package{float} package\cite{float}, please see \Ref{float}.
-Ïîñêîëüêó îêðóæåíèå \texttt{algorithm} çàäà¸òñÿ ÷åðåç êîìàíäó |\new|\-|float|,
-ïðåäëàãàåìóþ ïàêåòîì \package{float}\cite{float}, îçíàêîìüòåñü ñ~\Ref{float}.
-
-\iffalse
-\pagebreak[3]
-\subsection{Ïàêåò algorithm2e}
-\label{algorithm2e}
-\packagedescription{%
-% The \package{algorithm2e} package\cite{algorithm2e} offers an environment for
-% writing algorithms in LaTeX2e.}
-Ïàêåò \package{algorithm2e}\cite{algorithm2e} ïðåäëàãàåò îêðóæåíèå äëÿ
-çàïèñè àëãîðèòìîâ â~LaTeX2e.}
-
-% Since the \package{algorithm2e} package does not use some kind of standard
-% interface for defining its floating environment (e.g.~|\newfloat| of the
-% \package{float} package) and typesetting its caption,
-% the \package{algorithm2e} package is \emph{not} supported by \thispackage.
-Ïîñêîëüêó ïàêåò \package{algorithm2e} íå èñïîëüçóåò ñòàíäàðòíûé èíòåðôåéñ äëÿ
-îïðåäåëåíèÿ ñîáñòâåííîãî îêðóæåíèÿ ôëîòà (íàïðèìåð, êîìàíäó~|\newfloat| èç ïàêåòà
-\package{float}) è~ñîçäàíèÿ ïîäïèñè,
-ïàêåò \package{algorithm2e} \emph{íå} ïîääåðæèâàåòñÿ äàííûì ïàêåòîì.
-%
-% So if you want to customize the captions using \thispackage,
-% you have to build a new environment which uses a supported interface regarding
-% floats (e.g. using the \package{float} or \package{floatrow} package),
-% and combine this environment with the internal \package{algorithm2e} code.
-Ïîýòîìó, åñëè âàì íóæíî íàñòðîèòü ïîäïèñè èñïîëüçóÿ \thispackage,
-âû äîëæíû ñàìè ñîçäàòü íîâîå îêðóæåíèå, èñïîëüçóÿ ïîääåðæèâàåìûé èíòåðôåéñ ðàáîòû ñ~ôëîòàìè
-(íàïðèìåð, èñïîëüçóÿ ïàêåòû \package{float} èëè \package{floatrow}),
-è~ñêîìáèíèðîâàòü ýòî îêðóæåíèå ñ~êîäîì ïàêåòà \package{algorithm2e}.
-%
-% As first step you could define a non-floating environment \texttt{algorithmic},
-% for example:
-Ñíà÷àëà âû äîëæíû îïðåäåëèòü íåïëàâàþùåå îêðóæåíèå \texttt{algorithmic},
-íàïðèìåð:
-\begin{quote}
- |\usepackage{algorithm2e}|\\
- |% save the "algorithm" environment from the algorithm2e package|\\
- |\let\ORIGalgorithm\algorithm|\\
- |\let\ORIGendalgorithm\endalgorithm|\\
- |% define the algorithmic environment|\\ % , based on the saved environment
- |\newenvironment{algorithmic}%|\\
- | {\renewenvironment{algocf}[1][h]{}{}% pass over floating stuff|\\
- | \ORIGalgorithm}%|\\
- | {\ORIGendalgorithm}|\\
- \ldots
-\end{quote}
-% Having defined this non-floating environment, you could define your own new
-% floating environment with |\newfloat| of the \package{float} package
-% (or |\DeclareNewFloatType| of the \package{floatrow} package),
-% and use the combination of this floating environment and \texttt{algorithmic}
-% in its body, just like you would do when you use the
-% \package{algorithm}/\package{algorithmic} package tandem.
-Îïðåäåëèâ òàêîå íåïëàâàþùåå îêðóæåíèå,
-âû ìîæåòå îïðåäåëèòü ñâî¸ ñîáñòâåííîå îêðóæåíèå ôëîòà ñ~ïîìîùüþ êîìàíäû |\newfloat| ïàêåòà
-\package{float}, (èëè |\DeclareNewFloatType| ïàêåòà \package{floatrow}),
-è~èñïîëüçîâàòü êîìáèíàöèþ ýòîãî îêðóæåíèÿ ôëîòà è~îêðóæåíèÿ
-\texttt{algorithmic} âíóòðè íåãî, àíàëîãè÷íî òîìó, êàê ýòî èñïîëüçóåòñÿ
-ïðè òàíäåìå ïàêåòîâ
-\package{algorithm}/\package{algorithmic}.
-
-% You could even use the \package{algorithm} package for this purpose, for example:
-Âû ìîæåòå èñïîëüçîâàòü äëÿ ýòèõ öåëåé ïàêåò \package{algorithm}, íàïðèìåð:
-\begin{quote}
- \ldots\\
- |% load the algorithm package to re-define the|\\
- |% floating environment "algorithm" and \listofalgorithms|\\
- |\let\listofalgorithms\undefined|\\
- |\usepackage{algorithm}|\\
- \ldots\\
- |% Example usage:|\\
- |\begin{algorithm}|\\
- |\caption{An algorithm}|\\
- |\begin{algorithmic}|\\
- | \SetVline|\\
- | \eIf{cond1}{|\\
- | a line\;|\\
- | }{|\\
- | another line\;|\\
- | }|\\
- |\end{algorithmic}|
-\end{quote}
-% Now you are finally able to customize the float and caption layout like every
-% other floating environment defined with the \package{float} package\cite{float},
-% please see \Ref{float}.
-Òåïåðü âû ìîæåòå ñîçäàòü íàñòðîéêè äëÿ ñîäåðæèìîãî ôëîòà è~åãî ïîäïèñè, àíàëîãè÷íî ëþáîìó äðóãîìó
-îêðóæåíèþ ôëîòà, îïðåäåë¸ííîìó ïàêåòîì \package{float} package\cite{float},
-ñì.~\Ref{float}.
-
-% \begin{Annotation}
-% An alternative would be using the \package{algorithmicx} package.
-Â~êà÷åñòâå àëüòåðíàòèâû ìîæíî èñïîëüçîâàòü ïàêåò \package{algorithmicx}.
-% \end{Annotation}
-\fi
-
-\pagebreak[3]
-\subsection{Ïàêåò float}
-\label{float}
-\packagedescription{%
-% The \package{float} package\cite{float} introduces the commands
-% \cs{restylefloat} to give existing floating environments a new look \& feel
-% and \cs{newfloat} to define new floating environments.
-% It also provides the ``\texttt{H}'' float placement option which places
-% the environments ``here'' instead of letting them floating around.}
-Ïàêåò \package{float}\cite{float} ïðåäëàãàåò êîìàíäû
-\cs{restylefloat} äëÿ ïåðåîïðåäåëåíèÿ óæå ñóùåñòâóþùåãî ìàêåòà ôëîòà
-è~\cs{newfloat} äëÿ îïðåäåëåíèÿ íîâûõ îêðóæåíèé ôëîòîâ.
-Òàêæå îí ïðåäëàãàåò ñïåöèàëüíóþ îïöèþ ðàçìåùåíèÿ ôëîòà \texttt{H}, êîòîðàÿ ïîìåùàåò
-ôëîò «çäåñü», îòêëþ÷èâ ïëàâàíèå ôëîòà.}
-
-% For floating environments defined with \cs{newfloat} or \cs{restylefloat} the
-% |po|\-|si|\-|tion| option has no effect on the main caption anymore, since its
-% placement and spacing will be controlled by the selected float style instead.
-Äëÿ îêðóæåíèé ôëîòîâ, îïðåäåë¸ííûõ ñ~ïîìîùüþ êîìàíä \cs{newfloat} èëè
-\cs{restylefloat} îïöèÿ
-|po|\-|si|\-|tion| íå èìååò ýôôåêòà, òàê êàê ìåõàíèçì ðàçìåùåíèÿ è~ðàññòàíîâîê
-îòáèâîê êîíòðîëèðóåòñÿ ñòèëåì ôëîòà ïàêåòà \package{float}.
-
-% A caption style and options defined with the name of the float style will be
-% executed additionally to the regular ones.
-% Using this mechanism \thispackage\ emulates the default look \& feel of the
-% |ruled| captions: It defines the caption style
-Ñòèëè ïîäïèñè è~êëþ÷è àññîöèèðîâàííûå ñ~íàçâàíèåì äàííîãî ñòèëÿ ôëîòà
-âêëþ÷àþòñÿ ïðè çàïóñêå äàííîãî îêðóæåíèÿ.
-Èñïîëüçóÿ ýòîò ìåõàíèçì \thispackage\ ýìóëèðóåò âûâîä ïîäïèñåé â~ñòèëå
-|ruled|: îí îïðåäåëÿåò ñòèëü ïîäïèñè
-\begin{quote}
- |\DeclareCaptionStyle{ruled}%|\\
- | {labelfont=bf,labelsep=space,strut=off}|\mbox{\quad.}
-\end{quote}
-% So to change this you need either define your own caption style called
-% |ruled| or use |\caption|\-|setup[ruled]|\marg{options} to specify additional
-% options.%,
-%e.g.~|\caption|\-|setup[ruled]{labelsep=|\x|colon}|.
-Òàê, ÷òîáû èçìåíèòü ýòî âû ìîæåòå ëèáî îïðåäåëèòü ñâîé ñòèëü ïîäïèñè, íàçâàííûé
-|ruled| èëè èñïîëüçîâàòü |\caption|\-|setup[ruled]|\x\marg{options} è~îïðåäåëèòü
-äîïîëíèòåëüíûå îïöèè.%,
-
-% Also by using this mechanism the skip between a |boxed| float and its caption
-% is specified, overriding its global value:
-Òàêæå, èñïîëüçóÿ ýòîò ìåõàíèçì, îòáèâêà ìåæäó ôëîòîì â~ðàìêå (|boxed|) è~åãî
-ïîäïèñüþ ïåðåîïðåäåëÿåò çíà÷åíèå:
-\begin{quote}
- |\captionsetup[boxed]{skip=2pt}|
-\end{quote}
-% For changing this, just use |\caption|\-|setup[boxed]{skip=|\x\meta{value}|}|
-% with an appropriate value. Or if you want to use the global |skip| setting
-% instead, you can remove the usage of the local setting for these floats with
-% |\clear|\-|caption|\-|setup[skip]{boxed}|.
-Äëÿ èçìåíåíèÿ ýòîãî, èñïîëüçóéòå |\caption|\-|setup[boxed]{skip=|\x\meta{value}|}|
-ñ~ñîîòâåòñòâóþùèì çíà÷åíèåì. Èëè, åñëè âàì íóæíî âìåñòî ýòîãî èñïîëüçîâàòü îáùèå
-(ãëîáàëüíûå) óñòàíîâêè êëþ÷à |skip|,
-âû ìîæåòå îòìåíèòü èñïîëüçîâàíèå ëîêàëüíîãî îïðåäåëåíèÿ, çàäàâ
-|\clear|\-|caption|\-|setup[skip]{boxed}|.
-
-\begin{Note}
-% Only one single caption can be typeset inside environments defined with
-% |\new|\-|float| or |\re|\-|style|\-|float|, furthermore these environments
-% are not behaving exactly like the pre-defined floats |figure| and |table|.
-% As a consequence many packages do not cooperate well with these.
-% Furthermore the \package{float} package has some caveats \& limitations,
-% so if you just want to define a new simple floating environment---behaving
-% like |figure| or |table|---I recommend using |\Declare|\-|Caption|\-|Type|
-% instead.
-% And for defining non-simple floating environments and customization I
-% recommend using |\Declare|\-|New|\-|Float|\-|Type| offered by the
-% \package{floatrow} package\cite{floatrow}.
-Âíóòðè îêðóæåíèé îïðåäåë¸ííûõ êîìàíäàìè |\new|\-|float| èëè |\re|\-|style|\-|float|
-ìîæíî çàäàòü òîëüêî îäíó ïîäðèñóíî÷íóþ ïîäïèñü, êðîìå òîãî
-ýòè îêðóæåíèÿ ðàáîòàþò íå òàê, êàê
-îïðåäåë¸ííûå â~ñòàíäàðòíîì \LaTeX'å |figure| è~|table|.
-Â~ðåçóëüòàòå ìíîæåñòâî ïàêåòîâ íå ìîæåò áûòü êîîïåðèðîâàòüñÿ ñ~äàííûì ïàêåòîì.
-Áîëåå òîãî ïàêåò \package{float} èìååò íåêîòîðûå íåäîñòàòêè è~îãðàíè÷åíèÿ, ïîýòîìó, åñëè
-âàì íóæíî îïðåäåëèòü íîâîå îêðóæåíèå, ðàáîòàþùåå êàê
-|figure| èëè |table| \cdash--- ÿ ðåêîìåíäîâàë áû äëÿ ýòîãî èñïîëüçîâàòü êîìàíäó
-|\Declare|\-|Caption|\-|Type|.
-À~äëÿ îïðåäåëåíèÿ äðóãèõ îêðóæåíèé ôëîòîâ è~èõ íàñòðîéêè ìîæíî
-èñïîëüçîâàòü êîìàíäó |\Declare|\-|New|\-|Float|\-|Type| èç ïàêåòà
-\package{floatrow}\cite{floatrow}.
-\end{Note}
-
-\iffalse
-% Please also note that you \emph{don't} need a |\restyle|\-|float| for using
-% the ``|H|'' float placement specifier. Some docs say so, but they are
-% wrong.
-% And |\restyle|\-|float{table}| is a very good method to shoot yourself
-% in the foot, since many packages using |table| internally are not working
-% correctly afterwards.
-Îáðàòèòå âíèìàíèå, ÷òî âàì \emph{íå} íóæíî çàäàâàòü |\restyle|\-|float| äëÿ èñïîëüçîâàíèÿ
-îïöèè ðàçìåùåíèÿ «|H|». Íåêîòîðûå ðóêîâîäñòâà ñîâåòóþò ýòî, íî ýòî íåâåðíî.
-À~çàäàíèå |\restyle|\-|float{table}| õîðîøèé ñïîñîá ñáèòü ñåáÿ ñ~íîã,
-ïîñêîëüêó ìíîãèå ïàêåòû, èñïîëüçóþùèå â~ñâîèõ ìàêðîêîìàíäàõ îêðóæåíèå |table| ïåðåñòàþò
-ðàáîòàòü.
-\fi
-
-\pagebreak[3]
-\subsection{Ïàêåò floatflt}
-\label{floatflt}
-\packagedescription{%
-% The \package{floatflt} package\cite{floatflt} offers figures and tables
-% which do not span the full width of a page and are float around by text.}
-Ïàêåò \package{floatflt}\cite{floatflt} ïðåäëàãàåò îêðóæåíèÿ íåáîëüøèõ
-ðèñóíêîâ è~òàáëèö,
-îáòåêàåìûõ òåêñòîì.}
-
-\NEWfeature{v3.1}
-% If you want to setup special options for the |float|\-|ing|\-|figure| and
-% |float|\-|ing|\-|table| environments you can use
-Åñëè âû õîòèòå çàäàòü ñïåöèàëüíûå îïöèè äëÿ îêðóæåíèé |floating|\-|figure|
-è~|floating|\-|table|,
-ìîæíî çàäàòü
-\begin{quote}
- |\captionsetup[floatingfigure]|\marg{options}\quad\emph{è}\\
- |\captionsetup[floatingtable]|\marg{options}\quad.
-\end{quote}
-% These options will be executed additionally to the regular ones for
-% |figure| resp.~|table|.
-Ýòè îïöèè áóäóò äîáàâëåíû ñîîòâåòñòâåííî ê~îñíîâíûì äëÿ |figure| èëè |table|.
-
-\begin{Note}
-% The |margin| resp.~|width| setting will not be used for these figures resp.~tables,
-% unless you set it explicit with |\caption|\-|setup[floating|\-|figure]{|\ldots|}|
-% resp.~|\caption|\-|setup[floating|\-|table]{|\ldots|}|.
-Íàñòðîéêè êëþ÷åé |margin| èëè |width| íå èñïîëüçóþòñÿ äëÿ òàêèõ ðèñóíêîâ èëè òàáëèö,
-òîëüêî åñëè âû íå çàäàäèòå èõ ñòðîãî,
-âíóòðè |\caption|\-|setup[floating|\-|figure]{|\ldots|}| èëè
-|\caption|\-|setup[floating|\-|table]{|\ldots|}|.
-\end{Note}
-
-\pagebreak[3]
-\subsection{Ïàêåò fltpage}
-\label{fltpage}
-\packagedescription{%
-% The \package{fltpage} package\cite{fltpage} offers the outhouse of the
-% caption for |figure|s or |table|s which needs the whole page
-% for its contents. This will be done by placing the caption on the bottom
-% of the previous or next page.}
-Ïàêåò \package{fltpage}\cite{fltpage} ïðåäëàãàåò âíåøíþþ ïîäïèñü äëÿ ôëîòîâ
-|figure| èëè |table|, ñîäåðæèìîå êîòîðûõ çàíèìàåò öåëóþ ñòðàíèöó.
-Ïîäïèñü ïðè ýòîì ðàçìåùàåòñÿ íà ïðåäûäóùåé èëè ñëåäóþùåé ñòðàíèöå [íà ðàçâîðîòå].}
-
-\iffalse
-\NEWfeature{v3.1}
-% Two options control the links to the environments |FPfigure| and |FPtable|:
-Ñëåäóþùèå êëþ÷è êîíòðîëèðóþò ññûëêè íà îêðóæåíèÿ |FPfigure| è~|FPtable|:
-\begin{description}
-% \item{\texttt{FPlist=caption} or \texttt{FPlist=figure}}\\[\smallskipamount]
-% If set to |caption|, the list entry will link to the caption; if set to
-% |figure|, it will link to the figure contents.
-% (The default setting is |FP|\-|list=|\x|caption|.)
-% \item{\texttt{FPref=caption} or \texttt{FPref=figure}}\\[\smallskipamount]
-% If set to |caption|, a \cs{ref}, \cs{pageref}, \cs{autoref}, or \cs{nameref}
-% will link to the caption; if set to |figure|, it will link to the figure contents.
-% (The default setting is |FP|\-|ref=|\x|figure|.)
- \item{\texttt{FPlist=caption} èëè \texttt{FPlist=figure}}\\[\smallskipamount]
-Åñëè îïðåäåëåíà îïöèÿ |caption|, ññûëêà â~Ñïèñêå ðèñóíêîâ áóäåò îòíîñèòüñÿ ê~ïîäïèñè; à~åñëè
-|figure| \cdash--- òî ê~ñîäåðæèìîìó ôëîòà.
-(Çíà÷åíèå ïî óìîë÷àíèþ |FPlist=|\x|caption|.)
-\item{\texttt{FPref=caption} èëè \texttt{FPref=figure}}\\[\smallskipamount]
-Åñëè îïðåäåëåíà îïöèÿ |caption|, ññûëêè \cs{ref}, \cs{pageref}, \cs{autoref}, èëè \cs{nameref}
-áóäóò ïðèâÿçàíû ê~ïîäïèñè; à~åñëè |figure| \cdash--- òî ê~ñîäåðæèìîìó ôëîòà.
-(Çíà÷åíèå ïî óìîë÷àíèþ |FPref=figure|.)
-\end{description}
-\fi
-
-% If you want to setup special options for the |FPfigure| and |FPtable|
-% environments you can use
-Åñëè âû õîòèòå çàäàòü ñïåöèàëüíûå íàñòðîéêè äëÿ îêðóæåíèé |FPfigure| è~|FPtable|
-âû ìîæåòå èñïîëüçîâàòü
-\begin{quote}
- |\captionsetup[FPfigure]|\marg{options}\quad\emph{è}\\
- |\captionsetup[FPtable]|\marg{options}\quad.
-\end{quote}
-% These options will be executed additionally to the regular ones for
-% |figure| or |table|.
-Ýòè îïöèè áóäóò çàäàíû äîïîëíèòåëüíî ê~îñíîâíûì íàñòðîéêàì äëÿ
-|figure| èëè |table|.
-
-% Furthermore |\Declare|\-|Caption|\-|Type|\marg{name} will also define
-% an environment called |FP|\meta{name} which behaves like |FP|\-|figure| and
-% |FP|\-|table|.
-Ïîìèìî ýòîãî êîìàíäà \cs{DeclareCaptionType}\marg{name} òàêæå îïðåäåëèò
-îêðóæåíèå |FP|\meta{name}, êîòîðîå áóäåò àíàëîãè÷íî |FPfigure| è~|FPtable|.
-
-\pagebreak[3]
-\subsection{Ïàêåò hyperref}
-\label{hyperref}
-\packagedescription{%
-% The \package{hyperref} package\cite{hyperref} is used to handle cross
-% referencing commands in LaTeX to produce hypertext links in the document.}
-Ïàêåò hyperref\cite{hyperref} èñïîëüçóåòñÿ äëÿ óïðàâëåíèÿ êîìàíäàìè ïåðåêð¸ñòíûõ ññûëîê
-â~\LaTeX'å äëÿ ñîçäàíèÿ ãèïåðòåêñòîâûõ ññûëîê âíóòðè äîêóìåíòà.}
-
-\NEWfeature{v3.1}
-% There are two options available to control the placement of hyperlink
-% anchors:~\footnote{These options are named after the \package{hypcap} package
-% which they supersede.}
-Ñóùåñòâóþò äâà êëþ÷à, êîíòðîëèðóþùèõ ðàçìåùåíèå ãèïåðññûëîê:\footnote{Ýòè
-îïöèè íàçâàíû ïî ïàêåòó \package{hypcap}, êîòîðûé îíè çàìåíÿþò.}
-\begin{description}
-% \item{\texttt{hypcap=true} or \texttt{hypcap=false}}\\[\smallskipamount]
-% If set to |true| all hyperlink anchors -- where entries in the
-% List of Figures, |\ref|, and |\auto|\-|ref| will link to -- are placed at
-% the beginning of the (floating) environment.\par
-% If set to |false| the hyperlink anchor is (usually) placed at the caption.\par
-% (The default setting is |hypcap=|\x|true|.)
-\item{\texttt{hypcap=true} èëè \texttt{hypcap=false}}\\[\smallskipamount]
-Åñëè çàäàíà îïöèÿ |true| âñå ãèïåðññûëêè \cdash--- çàïèñè â~Ñïèñêàõ ðèñóíêîâ (òàáëèö),
-êîìàíäû |\ref| è~|\autoref| \cdash--- áóäóò ïðèâÿçàíû
-ê~íà÷àëó îêðóæåíèÿ ôëîòà.\par
-Åñëè çàäàíà îïöèÿ |false| ãèïåðññûëêè (îáû÷íî) ïðèâÿçûâàþòñÿ ê~ïîäïèñè.\par
-(Çíà÷åíèå ïî óìîë÷àíèþ |hypcap=true|.)
-% \item{\texttt{hypcapspace=}\meta{amount}}\\[\smallskipamount]
-% Because it looks poor if the hyperlink points exactly at the top of
-% the figure or table, you can specify a vertical distance between
-% the hyperlink anchor and the (floating) environment itself,
-% e.g.~|hyp|\-|cap|\-|space=|\x|0pt| removes this distance.\par
-% (The default setting is |hypcapspace=0.5\baselineskip|.)
-\item{\texttt{hypcapspace=}\meta{amount}}\\[\smallskipamount]
-Ïîñêîëüêó ýòî âûãëÿäèò ïëîõî, åñëè ãèïåðññûëêà ïîïàäàåò òî÷íî ââåðõ ðèñóíêà èëè òàáëèöû,
-âû ìîæåòå çàäàòü ñïåöèàëüíûé ïàðàìåòð ðàññòîÿíèÿ ìåæäó ïðèâÿçêîé ãèïåðññûëêè
-è~îêðóæåíèåì ôëîòà,
-íàïðèìåð, |hyp|\-|cap|\-|space=|\x|0pt| óáèðàåò ýòî ðàññòîÿíèå.\par
-(Çíà÷åíèå ïî óìîë÷àíèþ |hypcapspace=0.5\baselineskip|.)
-\end{description}
-
-% Both settings have no effect in |lst|\-|listing|s (provided by the
-% \package{listings} package), |long|\-|table|s (provided by the
-% \package{longtable} package), |super|\-|tabular|s (provided by the
-% \package{supertabular} package), and |x|\-|tabular|s (provided by the
-% \package{xtab} package), within these environments hyperlink
-% anchors will always be placed as if |hyp|\-|cap=|\x|true| and
-% |hyp|\-|cap|\-|space=|\x|0pt| would be set.
-Îáå íàñòðîéêè íå èìåþò ýôôåêòà â~îêðóæåíèÿõ |lstlisting| (ïðåäëàãàåìîì ïàêåòîì
-\package{listings}), |longtable| (ïðåäëàãàåìîì ïàêåòîì
-\package{longtable}), |super|\-|tabular| (ïðåäëàãàåìîì ïàêåòîì
-\package{supertabular}) è |xtabular| (ïðåäëàãàåìîì ïàêåòîì \package{xtab}),
-âíóòðè ýòèõ îêðóæåíèé ãèïåðññûëêè âñåãäà áóäóò çàäàíû òàê,
-áóäòî çàäàíû îïöèè |hyp|\-|cap=|\x|true| è~|hyp|\-|cap|\-|space=|\x|0pt|.
-
-%\pagebreak[3]Please note:\nopagebreak
-\pagebreak[3]Îáðàòèòå âíèìàíèå:\nopagebreak
-\begin{description}
-% \item{\cs{captionof}\marg{type}\csmarg{\purerm\ldots}
-% vs.~\cs{captionsetup}\csmarg{type=\textrm{\meta{type}}}$+$\cs{caption}\csmarg{\purerm\ldots}}%
-% \\[\smallskipamount]
-% Without \package{hyperref} loaded, both will give you identical results.
-% But with \package{hyperref} loaded, and with |hyp|\-|cap=|\x|true| requested,
-% the hyperlink anchor will be placed different.
-% For example:
-\item{\cs{captionof}\marg{type}\csmarg\ldots\ è~%
- \cs{captionsetup}\csmarg{type=\textrm{\meta{type}}}$+$\cs{caption}\csmarg\ldots}\\[\smallskipamount]
-Áåç ïàêåòà \package{hyperref}, äàäóò âàì èäåíòè÷íûå ðåçóëüòàòû.
-Íî ñ~çàãðóæåííûì ïàêåòîì \package{hyperref}, è~ñ~îïöèåé |hypcap=|\x|true|,
-ãèïåðññûëêà áóäåò äðóãîé. Íàïðèìåð:
-\begin{quote}
-|\begin{minipage}{\linewidth}|\\
-| |\ldots\\
-| \captionof{figure}{A figure}|\\
-|\end{minipage}|
-\end{quote}
-% will place the hyperlink anchor at the caption.
-% (And if |hyp|\-|cap=|\x|true| is set, you will get a warning about this.)
-% But
-Ïîìåñòèò ãèïåðññûëêó â~ïîäïèñü.
-(À~åñëè çàäàíà îïöèÿ |hyp|\-|cap=|\x|true|, âû ïîëó÷èòå ïðåäóïðåæäåíèå.)
-Íî
-\begin{quote}
-|\begin{minipage}{\linewidth}|\\
-| \captionsetup{type=figure}|\\
-| |\ldots\\
-| \caption{A figure}|\\
-|\end{minipage}|
-\end{quote}
-% will place the hyperlink anchor at the beginning of the |mini|\-|page|,
-% since |\caption|\-|setup{type=|\x|figure}| does not only set the caption type
-% to ``figure'' but does place a hyperlink anchor, too.
-ïîìåñòèò ãèïåðññûëêó â~íà÷àëî îêðóæåíèÿ |mini|\-|page|,
-ïîñêîëüêó êîìàíäà |\caption|\-|setup|\x|{type=|\x|figure}| íå òîëüêî çàäà¸ò íàñòðîéêè äëÿ
-ôëîòà «figure», íî òàêæå ïîìåùàåò ãèïåðññûëêó.
-
-% \item{\cs{caption}\csoarg{}\csmarg{\purerm\ldots}
-% vs.~\cs{captionsetup}\csmarg{list=false}$+$\cs{caption}\csmarg{\purerm\ldots}}\\[\smallskipamount]
-\item{\cs{caption}\csoarg{}\csmarg\ldots\ è~%
- \cs{captionsetup}\csmarg{list=false}$+$\cs{caption}\csmarg\ldots}\\[\smallskipamount]
-% Again, without \package{hyperref} loaded, both will give you identical results.
-% But with \package{hyperref} loaded, the difference is in the nuances.
-% So for example the optional argument of |\caption| will also be written to
-% the |aux| file, and will be used by the |\name|\-|ref| command.
-% So if you choose to use |\caption| with empty optional argument,
-% |\name|\-|ref| will also give you an empty result.
-% So it's better to use |\caption|\-|setup{list=|\x|false}| if you don't
-% want an entry in the List of Figures or List of Tables.
-Îïÿòü æå, áåç ïàêåòà \package{hyperref}, îáà âàðèàíòà äàäóò îäèíàêîâûé ðåçóëüòàò.
-À~ñ~çàãðóæåííûì ïàêåòîì \package{hyperref}, îòëè÷èå áóäåò â~íþàíñàõ.
-Òàê, íàïðèìåð, äîïîëíèòåëüíûé àðãóìåíò êîìàíäû |\caption| òàêæå áóäåò çàïèñàí â~%
-|aux|-ôàéë, è~òàêæå áóäåò èñïîëüçîâàòüñÿ êîìàíäà |\name|\-|ref|.
-Ïîýòîìó, åñëè âû èñïîëüçóåòå êîìàíäó ïîäïèñè~|\caption| ñ~ïóñòûì äîïîëíèòåëüíûì àðãóìåíòîì, êîìàíäà
-|\name|\-|ref| òàêæå äàñò âàì «ïóñòîé» ðåçóëüòàò.
-Ïîýòîìó ëó÷øå èñïîëüçîâàòü \cs{captionsetup}\csmarg{list=false}, åñëè âàì íå íóæíî
-çàïèñûâàòü ðèñóíîê â~Ñïèñîê ðèñóíêîâ èëè òàáëèö.
-\end{description}
-
-\pagebreak[3]
-\subsection{Ïàêåò hypcap}
-\label{hypcap}
-\packagedescription{%
-% The \package{hyp\-cap} package\cite{hypcap} offers a solution to the problem
-% that links to a float using \package{hyper\-ref} may anchors to the caption
-% rather than the beginning of the float.
-% Since \thispackage\ \version{3.1} already solves this problem for itself,
-% the \package{hypcap} package is usually not needed.}
-% %, at least when you use \thispackage.}
-Ïàêåò \package{hypcap}\cite{hypcap} ïðåäëàãàåò ðåøåíèå ïðîáëåì, ñâÿçàííûõ ñ~ôëîòàìè
-ïðè èñïîëüçîâàíèè ïàêåòà \package{hyperref}, êîòîðûé ïîìåùàåò ãèïåðññûëêè â~ïîäïèñü,
-à~íå â~íà÷àëî ôëîòà.
-Ïîñêîëüêó \thispackage\ \version{3.1} óæå ðåøèë ýòó ïðîáëåìó ñâîèìè ñðåäñòâàìè,
-ïàêåò \package{hypcap} îáû÷íî íå íóæåí.%
-% , êîãäà âû èñïîëüçóåòå
-% \thispackage.
-}
-
-% If the \package{hyp\-cap} package is loaded additionally to the
-% \package{hyper\-ref} package, it takes over the control of the hyperlink
-% anchor placement from \thispackage, overriding the options |hyp|\-|cap=|
-% and |hyp|\-|cap|\-|space=|.
-Åñëè ïàêåò \package{hypcap} çàãðóæåí äîïîëíèòåëüíî ê~ïàêåòó \package{hyperref},
-òî êîíòðîëü çà ãèïåðññûëêàìè ïåðåõîäèò îò ïàêåòà \package{caption} ê~íåìó,
-ïåðåêðûâàÿ îïöèè êëþ÷åé |hypcap=| è~|hyp|\-|cap|\-|space=|.
-
-% So for a manual placement of hyperlink anchors
-% |\caption|\-|setup{type=|\x\meta{type}|}| is not sufficient anymore,
-% instead you need to use |\cap|\-|start| (provided by the \package{hyp\-cap}
-% package) for this.
-Ïîýòîìó äëÿ ðó÷íîãî ðàçìåùåíèÿ ãèïåðññûëêè |\caption|\-|setup{type=|\x\meta{type}|}|
-óæå íå ãîäèòñÿ, è~âìåñòî ýòîãî âû äîëæíû èñïîëüçîâàòü êîìàíäó |\capstart|
-(ïðåäëàãàåìóþ ïàêåòîì \package{hypcap}).
-
-% Regarding the automatically placement the \package{hypcap} package offers good
-% placement of hyperlink anchors for the floating environments |figure| and
-% |table| only. In contrast the |hypcap=|\x|true| option of \thispackage\ also
-% offers good placements of hyperlink anchors for
-% |floating|\-|figure|s (provided by the \package{float\-flt} package),
-% |FP|\-|figure|s \& |FPtable|s (provided by the \package{flt\-page} package),
-% |fig|\-|window|s (provided by the \package{pic\-in\-par} package),
-% |par|\-|pic|s (provided by the \package{pic\-ins} package),
-% |SC|\-|figure|s (provided by the \package{side\-cap} package),
-% |three|\-|part|\-|table|s (provided by the \package{three\-part\-table} package),
-% and |wrapfigure|s (provided by the \package{wrap\-fig} package).%---%
-% %so by loading the \package{hypcap} package additionally you will
-% %loose that.
-Ïðè àâòîìàòè÷åñêîì ðàçìåùåíèè ãèïåðññûëîê, ïàêåò \package{hypcap} çàäà¸ò âåðíîå
-ðàçìåùåíèå òîëüêî äëÿ îêðóæåíèé |figure| è~%
-|table|. Â~òî âðåìÿ êàê îïöèÿ êëþ÷à |hypcap=true| ïàêåòà \package{caption}, ïðåäëàãàåò òàêæå
-êîððåêòíîå ðàçìåùåíèÿ ññûëîê äëÿ îêðóæåíèé
-|floating|\-|figure| (ïðåäëàãàåìîãî ïàêåòîì \package{floatflt}),
-|FPfigure| è~|FPtable| (ïðåäëàãàåìûõ ïàêåòîì \package{fltpage}),
-|figwindow| (ïðåäëàãàåìîãî ïàêåòîì \package{picinpar}),
-|parpic| (ïðåäëàãàåìîãî ïàêåòîì \package{picins}),
-|SCfigure| (ïðåäëàãàåìîãî ïàêåòîì \package{sidecap}),
-|three|\-|part|\-|table| (ïðåäëàãàåìîãî ïàêåòîì \package{threeparttable}),
-è~|wrap|\-|figure| (ïðåäëàãàåìîãî ïàêåòîì \package{wrapfig}).%---%
-%ïîýòîìó, çàãðóæàÿ ïàêåò \package{hypcap}, âû òåðÿåòå ýòè âîçìîæíîñòè.
-
-\pagebreak[3]
-\subsection{Ïàêåò listings}
-\label{listings}
-\packagedescription{%
-% The \package{listings} package\cite{listings} typesets programming code.}
-Ïàêåò \package{listings}\cite{listings} ïîìîãàåò ðàñïå÷àòàòü ïðîãðàììíûé êîä.}
-
-% If you want to setup special options for the |lst|\-|listing| environment
-% you can use
-Åñëè âû æåëàåòå ñîçäàòü ñïåöèàëüíûå îïöèè äëÿ îêðóæåíèÿ |lstlinsting|
-âû ìîæåòå èñïîëüçîâàòü
-\begin{quote}
- |\captionsetup[lstlisting]|\marg{options}\quad.
-\end{quote}
-
-% Please note that the \package{listings} package has its very own options
-% for controlling the position and the skips of the caption:
-% |caption|\-|pos=|, |above|\-|caption|\-|skip=|, and |below|\-|caption|\-|skip=|.
-% \See{\package{listings} documentation for details.}
-% These \package{listings} options override the \package{caption}'s ones, but
-% can be again overwritten by |\caption|\-|setup[lst|\-|listing]{|\ldots|}|,
-% e.g.%~
-Îáðàòèòå âíèìàíèå, ÷òî ïàêåò \package{listings} èìååò ñîáñòâåííûå îïöèè
-äëÿ êîíòðîëÿ ðàñïîëîæåíèÿ îòáèâîê âîêðóã ïîäïèñè:
-|caption|\-|pos=|, |above|\-|caption|\-|skip=|, è~|below|\-|caption|\-|skip=|.
-\See{ïîäðîáíåå â~äîêóìåíòàöèè ïàêåòà \package{listings}.}
-Îïöèè ïàêåòà \package{listings} ïåðåîïðåäåëÿþò îïöèè \package{caption}, íî
-ìîãóò áûòü â~ñâîþ î÷åðåäü ïåðåïèñàíû ñ~ïîìîùüþ íàñòðîåê
-|\caption|\-|setup[lst|\-|listing]{|\ldots|}|,
-íàïðèìåð,
-\begin{quote}|\caption|\-|setup[lst|\-|listing]{skip=|\x|10pt}|\quad.\end{quote}
-
-\pagebreak[3]
-\subsection{Ïàêåò longtable}
-\label{longtable}
-\packagedescription{%
-% The \package{longtable} package\cite{longtable} offers an environment
-% which behaves similar to the \texttt{tabular} environment, but the table
-% itself can span multiple pages.}
-Ïàêåò \package{longtable}\cite{longtable} ïðåäëàãàåò îêðóæåíèå,
-êîòîðîå ðàáîòàåò àíàëîãè÷íî \texttt{tabular}, íî òàáëè÷íûé ìàòåðèàë ìîæåò çàíèìàòü
-íåñêîëüêî ñòðàíèö.}
-
-% If you want to setup special options for the |long|\-|table| environment
-% you can use
-Åñëè âû æåëàåòå ñîçäàòü ñïåöèàëüíûå íàñòðîéêè äëÿ îêðóæåíèÿ |long|\-|table|
-âû ìîæåòå èñïîëüçîâàòü
-\begin{quote}
- |\captionsetup[longtable]|\marg{options}\quad.
-\end{quote}
-% These options will be executed additionally to the regular ones for
-% |table|.
-Ýòè îïöèè áóäóò äîáàâëåíû ê~îñíîâíûì íàñòðîéêàì äëÿ
-|table|.
-
-% The |margin| and |width| settings usually override |\LT|\-|cap|\-|width|,
-% so you get an equal look \& feel of the captions in |table|s and
-% |long|\-|table|s.
-% But if you set |\LT|\-|cap|\-|width| to a value different than its default
-% $=$ |4in|, \thispackage\ will follow that.
-% (But |\LT|\-|cap|\-|width| will be overwritten by
-% |\caption|\-|setup[long|\-|table]{width=|\x\meta{value}|}|,
-% even if it is set to a value different than |4in|.)
-Íàñòðîéêè êëþ÷åé |margin| è~|width| îáû÷íî ïåðåêðûâàþò çíà÷åíèå êîìàíäû
-|\LTcapwidth|, ïîýòîìó
-âû ìîæåòå ïîëó÷èòü èäåíòè÷íîå îôîðìëåíèå äëÿ ïîäïèñåé â~îêðóæåíèÿõ |table| è~%
-|longtable|.
-Íî åñëè âû çàäàäèòå çíà÷åíèå |\LT|\-|cap|\-|width| îòëè÷íîå îò çàäàííîãî ïî óìîë÷àíèþ,
-÷òî ðàâíî ${}={}$|4in|, \thispackage\ áóäåò èñïîëüçîâàòü ýòî çíà÷åíèå.
-(Íî |\LTcapwidth| áóäåò ïåðåïèñàíî ïîñëåäóþùåé íàñòðîéêîé
-|\caption|\-|setup[long|\-|table]{width=|\x\meta{value}|}|, äàæå åñëè îíî çàäàíî
-îòëè÷íûì îò~|4in|.)
-
-\begin{Note}
-% |\caption|\-|of| and |\Continued|\-|Float| do \emph{not} work for |long|\-|table|s.
-% Furthermore neither |\caption| nor |\caption|\-|list|\-|entry| will increment
-% the |table| counter here; it's incremented by the |long|\-|table| environment
-% instead.
-% \NEWfeature{v3.1}
-% If you need a |long|\-|table| which does not increment the |table| counter
-% please use the |long|\-|table*| environment (offered by the
-% \package{ltcaption} package which is part of \thispackage\ bundle and will be
-% loaded automatically).
-Êîìàíäû |\caption|\-|of| è~|\Continued|\-|Float| íå ðàáîòàþò â~îêðóæåíèÿõ |long|\-|table|.
-Êðîìå òîãî íè |\caption| íè |\caption|\-|list|\-|entry| íå óâåëè÷èâàþò çíà÷åíèå ñ÷¸ò÷èêà
-òàáëèö |table|; åãî çíà÷åíèå óïðàâëÿåòñÿ îêðóæåíèåì |long|\-|table|.
-\NEWfeature{v3.1}
-Åñëè âàì íóæíî ñîçäàòü îêðóæåíèå |longtable| áåç óâåëè÷åíèÿ ñ÷¸ò÷èêà òàáëèö, |table|,
-èñïîëüçóéòå îêðóæåíèå |longtable*|, ïðåäëàãàåìîå ïàêåòîì \package{ltcaption},
-êîòîðûé ÿâëÿåòñÿ ÷àñòüþ ãðóïïû ïàêåòîâ ïàêåòà \package{caption} è~çàãðóæàåòñÿ àâòîìàòè÷åñêè.
-\end{Note}
-
-\pagebreak[3]
-\subsection{Ïàêåò picinpar}
-\label{picinpar}
-\packagedescription{%
-% Similar to the \package{floatflt} package the \package{picinpar}
-% package\cite{picinpar} offers figures and tables which do not span the full
-% width of a page and are float around by text.
-% For a detailed discussion about the differences between these packages
-% please take a look at The \LaTeX\ Companion\cite{TLC2}.}
-Àíàëîãè÷íûé ïàêåòó \package{floatflt}, ïàêåò \package{picinpar}%
-\cite{picinpar} ïðåäëàãàåò îêðóæåíèÿ íåáîëüøèõ ðèñóíêîâ è~òàáëèö, îáòåêàåìûõ òåêñòîì.
-Çà áîëåå ïîäðîáíîé èíôîðìàöèåé î~ðàçëè÷èÿõ ïàêåòîâ îáðàùàéòåñü
-ê~\LaTeX\ Companion\cite{TLC2}.}
-
-\NEWfeature{v3.1}
-% If you want to setup special options for the |fig|\-|window| and
-% |tab|\-|window| environments you can use
-Åñëè âàì íóæíû ñïåöèàëüíûå íàñòðîéêè äëÿ îêðóæåíèé |figwindow| è~|tabwindow|
-âû ìîæåòå çàäàòü
-\begin{quote}
- |\captionsetup[figwindow]|\marg{options}\quad\emph{è}\\
- |\captionsetup[tabwindow]|\marg{options}\quad.
-\end{quote}
-% These options will be executed additionally to the regular ones for
-% |figure| or |table|.
-Ýòè íàñòðîéêè áóäóò äîáàâëåíû ê~îñíîâíûì íàñòðîéêàì
-|figure| èëè |table|.
-
-\begin{Note}
-% The |margin| resp.~|width| setting will not be used for these figures and tables,
-% unless you set it explicit with |\caption|\-|setup[fig|\-|window]{|\ldots|}| or
-% |\caption|\-|setup[fig|\-|table]{|\ldots|}|.
-Íàñòðîéêè êëþ÷åé |margin| è~|width| íå èñïîëüçóþòñÿ äëÿ ýòèõ ðèñóíêîâ è~òàáëèö,
-òîëüêî åñëè âû íå çàäàäèòå ñòðîãî |\caption|\-|setup|\x|[figwindow]{|\ldots|}| èëè
-|\caption|\-|setup|\x|[figtable]{|\ldots|}|.
-\end{Note}
-
-\pagebreak[3]
-\subsection{Ïàêåò picins}
-\label{picins}
-\packagedescription{%
-% Similar to the \package{floatflt} and \package{picinpar} package the
-% \package{picins} package\cite{picins} offers figures and tables which do not
-% span the full width of a page and are float around by text.
-% For a detailed discussion about the differences between these packages
-% please take a look at The \LaTeX\ Companion\cite{TLC2}.}
-Àíàëîãè÷åí ïàêåòàì \package{floatflt} è~\package{picinpar}
-\package{picins}\cite{picins} ïðåäëàãàåò îêðóæåíèÿ íåáîëüøèõ ðèñóíêîâ è~òàáëèö, îáòåêàåìûõ òåêñòîì.
-Çà áîëåå ïîäðîáíîé èíôîðìàöèåé î~ðàçëè÷èÿõ ïàêåòîâ îáðàùàéòåñü
-ê~\LaTeX\ Companion\cite{TLC2}.}
-
-\NEWfeature{v3.1}
-% If you want to setup special options for the |par|\-|pic| environment you can use
-Åñëè âû õîòèòå çàäàòü ñïåöèàëüíûå íàñòðîéêè äëÿ îêðóæåíèÿ |parpic| âû ìîæåòå çàäàòü
-\begin{quote}
- |\captionsetup[parpic]|\marg{options}\quad.
-\end{quote}
-% These options will be executed additionally to the regular ones for
-% |figure| or |table|.
-Ýòè íàñòðîéêè áóäóò äîáàâëåíû ê~îñíîâíûì íàñòðîéêàì
-|figure| èëè |table|.\par
-
-% Furthermore |\pic|\-|caption[]{|\ldots|}| produce no entry in the List of Figures,
-% and |\pic|\-|caption*{|\ldots|}| gives an unlabeled \& unnumbered caption.
-Ïîìèìî ýòîãî êîìàíäà |\pic|\-|caption[]{|\ldots|}| íå ñîçäà¸ò çàïèñè â~Ñïèñêå ðèñóíêîâ,
-à~êîìàíäà |\pic|\-|caption*{|\ldots|}| çàäà¸ò ïîäïèñü áåç íóìåðàöèîííîãî çàãîëîâêà.
-
-\begin{Note}
-% The |margin| resp.~|width| setting will not be used for these figures and tables.
-% \iffalse
-% if |pic|\-|caption|\-|side| or |pic|\-|caption|\-|top|\-|side| is used.
-% The |width| setting will not be used (but the |margin| setting will) if
-% |pic|\-|caption|\-|out|\-|side| or |pic|\-|caption|\-|in|\-|side| is used.
-% \fi
-% But you can override this by setting it explicit with
-% |\caption|\-|setup[par|\-|pic]{|\ldots|}|.
-Íàñòðîéêè êëþ÷åé |margin| è~|width| íå èñïîëüçóþòñÿ äëÿ ýòèõ ðèñóíêîâ è~òàáëèö.
-\iffalse
-åñëè çàäàíû êîìàíäû |pic|\-|caption|\-|side| èëè |pic|\-|caption|\-|top|\-|side|.
-Íàñòðîéêè êëþ÷à |width| íå áóäóò èñïîëüçîâàòüñÿ (íî êëþ÷ |margin| áóäåò), åñëè
-çàäàíû êîìàíäû |pic|\-|caption|\-|out|\-|side| èëè |pic|\-|caption|\-|in|\-|side|.
-\fi
-Íî ýòî ìîæíî ïåðåîïðåäåëèòü íàñòðîéêàìè
-|\caption|\-|setup[par|\-|pic]{|\ldots|}|.
-\end{Note}
-
-% If you want to have a |\pic|\-|caption| of another type as |figure|, please
-% do \emph{not} re-define |\@cap|\-|type| as suggested by the \package{picins}
-% documentation. Please use the |\pic|\-|caption|\-|type|\marg{type} command
-% which is offered by \thispackage\ instead, e.g.:
-Åñëè âàì íóæíî çàäàòü ïîäïèñü, |\piccaption|, íå äëÿ |figure|, à~äëÿ äðóãîãî òèïà ôëîòà,
-\emph{íå} ïåðåîïðåäåëÿéòå êîìàíäó |\@captype|, êàê ïðåäëîæåíî â~äîêóìåíòàöèè ïàêåòà
-\package{picins}.
-Èñïîëüçóéòå êîìàíäó |\piccaptiontype|\marg{type}, ïðåäëàãàåìóþ äàííûì ïàêåòîì,
-íàïðèìåð:
-\begin{quote}
- |\piccaptiontype{table}|\\
- |\piccaption{An example table}|\\
- |\parpic(50mm,10mm)[s]{|\ldots|}|
-\end{quote}
-
-\pagebreak[3]
-\subsection{Ïàêåò rotating}
-\label{rotating}
-\packagedescription{%
-% The \package{rotating} package\cite{rotating} offers the floating
-% environments \texttt{side\-ways\-figure} and \texttt{side\-ways\-table} which
-% are just like normal figures and tables but rotated by 90 resp.~270 degree.
-% Furthermore a command \cs{rot\-caption} is offered for rotated captions only.}
-Ïàêåò \package{rotating}\cite{rotating} ïðåäëàãàåò îêðóæåíèÿ ôëîòîâ
-\texttt{side\-ways\-figure} è~\texttt{side\-ways\-table}
-êîòîðûå ÿâëÿþòñÿ òåìè æå ðèñóíêàìè è~òàáëèöàìè, íî ðàçâ¸ðíóòûìè íà 90~ãðàäóñîâ.
-Ïîìèìî ýòîãî èñïîëüçóåòñÿ êîìàíäà \cs{rotcaption} äëÿ ïîâîðîòà òîëüêî ïîäïèñåé.}
-
-\iffalse % No, we don't do that
-% If you want to setup special options for the |side|\-|ways|\-|figure| and
-% |side|\-|ways|\-|table| environments you can use
-Åñëè âû õîòèòå çàäàòü íàñòðîéêè äëÿ îêðóæåíèé |sidewaysfigure| è~|sidewaystable|
-âû ìîæåòå çàäàòü
-\begin{quote}
- |\captionsetup[sidewaysfigure]|\marg{options}\\
- |\captionsetup[sidewaystable]|\marg{options}\quad.
-\end{quote}
-Ýòè íàñòðîéêè áóäóò äîáàâëåíû ê~îñíîâíûì íàñòðîéêàì
-|figure| èëè |table|.\par
-\fi
-
-% The command |\rot|\-|caption| will be extended by \thispackage, so
-% |\rot|\-|caption*| and |\rot|\-|caption|\-|of| can be used analogous to
-% |\caption*| and |\caption|\-|of|.
-Êîìàíäà |\rot|\-|caption| áûëà ðàñøèðåíà äàííûì ïàêåòîì, ïîýòîìó
-|\rot|\-|caption*| èëè |\rot|\-|caption|\-|of| ìîãóò áûòü èñïîëüçîâàíû àíàëîãè÷íî
-êîìàíäàì |\caption*| è~|\captionof|.
-
-\NEWfeature{v3.1}
-% Furthermore |\Declare|\-|Caption|\-|Type|\marg{name} will also define
-% an environment called |side|\-|ways|\meta{name} which behaves like
-% |side|\-|ways|\-|figure| and |side|\-|ways|\-|table|.
-Ïîìèìî ýòîãî êîìàíäà |\Declare|\-|Caption|\-|Type|\marg{name} îïðåäåëèò
-îêðóæåíèå, íàçûâàåìîå |side|\-|ways|\meta{name}, êîòîðîå ðàáîòàåò àíàëîãè÷íî
-|side|\-|ways|\-|figure| è~|side|\-|ways|\-|table|.
-
-\pagebreak[3]
-\subsection{Ïàêåò setspace}
-\label{setspace}
-\packagedescription{%
-% The \package{setspace} package\cite{setspace} offers options and commands
-% to change the spacing,
-% e.g.\ \cs{usepackage}\x\csoarg{one\-half\-spacing}\x\csmarg{set\-space}
-% causes the document to be typeset in one-and-a-half spacing.}
-Ïàêåò \package{setspace}\cite{setspace} ïðåäëàãàåò îïöèè è~êîìàíäû äëÿ
-èçìåíåíèÿ èíòåðëèíüÿæà,
-íàïðèìåð \cs{usepackage}\x\csoarg{one\-half\-spacing}\x\csmarg{set\-space}
-ñîçäàñò äîêóìåíò, ðàñïå÷àòàííûé ñ~ïîëóòîðíûì èíòåðëèíüÿæåì.}
-
-% If the \package{setspace} package is used in conjunction with \thispackage,
-% the caption will be typeset with single spacing as default. This can be changed
-% by specifying either |font=|\x|one|\-|half|\-|spacing|,
-% |font=|\x|double|\-|spacing|, or |font={stretch=|\x\meta{amount}|}|.
-% \See{also \Ref{fonts}}
-Åñëè ïàêåò \package{setspace} èñïîëüçóåòñÿ âìåñòå ñ~äàííûì ïàêåòîì,
-ïîäïèñü áóäåò íàïå÷àòàíà ñ~îäèíàðíûì èíòåðëèíüÿæåì. Ýòî ìîæíî ïåðåîïðåäåëèòü,
-çàäàâ ëèáî |font=onehalfspacing|, |font=doublespacing|, ëèáî
-|font={stretch=|\meta{amount}|}|. \See{òàêæå \Ref{fonts}}
-
-\pagebreak[3]
-\subsection{Ïàêåò sidecap}
-\label{sidecap}
-\packagedescription{%
-% The \package{sidecap} package\cite{sidecap} offers the floating environments
-% \texttt{SC\-figure} and \texttt{SC\-table} which are like usual figures
-% and tables but the caption will be put \emph{beside} the contents.}
-Ïàêåò \package{sidecap}\cite{sidecap} ïðåäëàãàåò îêðóæåíèÿ ôëîòîâ
-|SCfigure| è~|SCtable|, êîòîðûå ÿâëÿþòñÿ òåìè æå ðèñóíêàìè è~òàáëèöàìè,
-íî ïîäïèñè ïîìåùàþòñÿ \emph{ñáîêó} ñîäåðæèìîãî.}
-
-% If you want to setup special options for the |SCfigure| and |SCtable|
-% environments you can use
-Åñëè âàì íóæíî çàäàòü íàñòðîéêè äëÿ îêðóæåíèé |SCfigure| è~|SCtable|
-âû ìîæåòå çàäàòü
-\begin{quote}
- |\captionsetup[SCfigure]|\marg{options}\quad\emph{and}\\
- |\captionsetup[SCtable]|\marg{options}\quad.
-\end{quote}
-% These options will be executed additionally to the regular ones for
-% |figure| or |table|.
-Ýòè íàñòðîéêè áóäóò äîáàâëåíû ê~îñíîâíûì íàñòðîéêàì
-|figure| èëè |table|.\par
-
-\pagebreak[3]
-\NEWfeature{v3.1}
-% Furthermore |\Declare|\-|Caption|\-|Type|\marg{name} will also define
-% an environment called |SC|\meta{name} which behaves like |SC|\-|figure| and
-% |SC|\-|table|.
-Ïîìèìî ýòîãî êîìàíäà \cs{DeclareCaptionType}\marg{name} ìîæåò îïðåäåëèòü
-îêðóæåíèå |SC|\meta{name}, êîòîðîå ðàáîòàåò àíàëîãè÷íî |SCfigure| è~|SCtable|.
-
-\pagebreak[3]
-\begin{Note}
-% The \package{sidecap} package offers its own options for justification.
-% If set, they will override the one specified with the caption option
-% |jus|\-|ti|\-|fi|\-|ca|\-|tion=| for captions beside their contents.
-Ïàêåò \package{sidecap} ïðåäëàãàåò îïöèè äëÿ âûêëþ÷êè ïîäïèñåé.
-È~åñëè îíè çàäàíû, òî îíè ïåðåîïðåäåëÿò íàñòðîéêè êëþ÷à
-|justification=| äëÿ ïîäïèñåé ñòîÿùèõ ñáîêó.
-\end{Note}
-
-\begin{Note}
-% The |margin| resp.~|width| setting will not be used for these figures and tables,
-% unless you set it explicit with |\caption|\-|setup[SC|\-|figure]{|\ldots|}|
-% or |\caption|\-|setup[SC|\-|table]{|\ldots|}|.
-Íàñòðîéêè êëþ÷åé |margin| è~|width| íå èñïîëüçóþòñÿ äëÿ ýòèõ ðèñóíêîâ è~òàáëèö,
-òîëüêî åñëè âû íå çàäàäèòå ñòðîãî |\captionsetup|\x|[SCfigure]|\x|{|\ldots|}|
-èëè |\captionsetup|\x|[SCtable]|\x|{|\ldots|}|.
-\end{Note}
-
-\medskip
-
-\begin{Annotation*}
-% Instead of using the \package{sidecap} package you can also use the more
-% powerful and flexible \package{floatrow} package\cite{floatrow} for typesetting
-% captions beside the contents.
-Âìåñòî èñïîëüçîâàíèÿ ïàêåòà \package{sidecap} âû ìîæåòå âîñïîëüçîâàòüñÿ
-ïàêåòîì \package{floatrow}\cite{floatrow} äëÿ ðàçìåùåíèÿ ïîäïèñåé ñáîêó ôëîòîâ.
-\end{Annotation*}
-
-\pagebreak[3]
-% \subsubsection*{Undocumented features}
-% The \package{sidecap} package \version{1.6} has some undocumented package
-% options and commands which allow further customization of the side-captions:
-\subsubsection*{Íåäîêóìåíòèðîâàííûå îñîáåííîñòè}
-Ïàêåò \package{sidecap} âåðñèè \version{1.6} èìååò íåêîòîðûå íåäîêóìåíòèðîâàííûå
-îïöèè è~êîìàíäû êîòîðûå ïîçâîëÿþò çàäàòü äîïîëíèòåëüíûå íàñòðîéêè:
-
-\pagebreak[3]
-\DescribeMacro{margincaption}
-% The package option
-Îïöèÿ ïàêåòà
-\begin{quote}
- |margincaption|\qquad{\small(e.g.~|\usepackage[margincaption]{sidecap}|)}
-\end{quote}
-% causes all side-captions to be placed into the margin.
-ïîçâîëÿåò ïîìåñòèòü âñå ïîäïèñè ñáîêó íà ïîëå.
-
-\pagebreak[3]
-\DescribeMacro{\sidecaptionvpos}
-% The command
-Êîìàíäà
-\begin{quote}
- |\sidecaptionvpos|\marg{float type}\marg{pos}
-\end{quote}
-% sets the vertical position of the side-caption. \meta{pos} can be either `|t|'
-% (for top alignment), `|b|' (for bottom alignment), or `|c|' (for center alignment).
-% The default setting for |table| is `|t|', for |figure| and all other ones
-% defined with |\Declare|\-|Caption|\-|Type| it's `|b|'.
-çàäà¸ò âåðòèêàëüíîå ïîëîæåíèå ïîäïèñè. Àðãóìåíò \meta{pos} ìîæåò áûòü ëèáî `|t|'
-(äëÿ âûðàâíèâàíèÿ ïî âåðõó), `|b|' (äëÿ âûðàâíèâàíèÿ ïî íèçó), èëè `|c|'
-(äëÿ âûðàâíèâàíèÿ ïî öåíòðó).
-Çíà÷åíèå ïî óìîë÷àíèþ äëÿ òàáëèö, |table|, \cdash--- `|t|',
-äëÿ ðèñóíêîâ, |figure|, è~âñåõ äðóãèõ îêðóæåíèé, îïðåäåë¸ííûõ
-ñ~ïîìîùüþ |\Declare|\-|Caption|\-|Type| \cdash--- `|b|'.
-
-\pagebreak[3]
-\subsection{Ïàêåò subfigure}
-\label{subfigure}
-\packagedescription{%
-% The \package{subfigure} package\cite{subfigure} provides support for small or
-% `sub' figures and tables within a single figure or table environment.
-% This package is obsolete, new users should use \package{subfig} instead.}
-Ïàêåò \package{subfigure}\cite{subfigure} ïðåäëàãàåò ïîääåðæêó äëÿ ÷àñòåé ôëîòîâ (ïîäôëîòîâ)
-âíóòðè îäíîãî îêðóæåíèÿ |figure| èëè |table|.
-Ýòîò ïàêåò ÿâëÿåòñÿ óñòàðåâøèì, íîâûå ïîëüçîâàòåëÿì ðåêîìåíäóåòñÿ ïàêåò \package{subfig}.}
-
-% Since the \package{subfigure} package is obsolete it will only be supported in
-% a way that old documents (which have used \thispackage\ \version{1.x} during
-% development) should still compile as expected.
-Ïîñêîëüêó ïàêåò \package{subfigure} óñòàðåâøèé, îí ïîääåðæèâàåòñÿ è~êîìïèëèðóåòñÿ òîëüêî â~ñòàðûõ äîêóìåíòàõ
-(èñïîëüçóþùèõ \thispackage\ \version{1.x}).
-
-% Please use the \package{subfig} package instead with supports \thispackage\
-% \version{3.x}.
-Âìåñòî ýòîãî èñïîëüçóéòå, ïîæàëóéñòà, ïàêåò \package{subfig}; åãî ïîääåðæèâàåò \thispackage\
-\version{3.x}.
-
-% \See{the \package{subfig} package\cite{subfig} documentation for details.}
-\See{äîêóìåíòàöèþ ïàêåòà \package{subfig}\cite{subfig}.}
-
-\pagebreak[3]
-\subsection{Ïàêåòû supertabular è~xtab}
-\label{supertabular}
-\packagedescription{%
-% The \package{supertabular}\cite{supertabular} and \package{xtab}\cite{xtab}
-% packages offer an environment which can span multiple pages and is quite
-% similar to the \texttt{long\-table} environment provided by the
-% \package{longtable} package\cite{longtable}.
-% For a detailed discussion about the differences between these powerful
-% packages please take a look at The \LaTeX\ Companion\cite{TLC2}.}
-Ïàêåòû \package{supertabular}\cite{supertabular} è~\package{xtab}\cite{xtab}
-ïðåäëàãàþò îêðóæåíèå,
-àíàëîãè÷íîå \texttt{long\-table}, (ïàêåò \package{longtable}\cite{longtable}),
-êîòîðîå ìîæåò ðàçáèâàòüñÿ íà íåñêîëüêî ñòðàíèö.
-Äåòàëüíûå îáúÿñíåíèÿ ðàçëè÷èé ýòèõ ìîùíûõ ïàêåòîâ
-ñì.~â~\LaTeX\ Companion\cite{TLC2}.}
-
-% If you want to setup special options for the |super|\-|tabular|
-% resp.~|x|\-|tabular| environment you can use
-Åñëè âàì íóæíî çàäàòü ñïåöèàëüíûå íàñòðîéêè äëÿ îêðóæåíèé |super|\-|tabular|
-èëè~|xtabular| âû ìîæåòå çàïèñàòü
-\begin{quote}
- |\captionsetup[supertabular]|\marg{options}\quad\emph{è, ñîîòâåòñòâåííî}\\
- |\captionsetup[xtabular]|\marg{options}\quad.
-\end{quote}
-% These options will be executed additionally to the regular ones for
-% |table|.
-Ýòè íàñòðîéêè áóäóò äîáàâëåíû ê~îñíîâíûì íàñòðîéêàì
-|figure| èëè |table|.\par
-
-\begin{Note}
-% |\Continued|\-|Float| does not work for |super|\-|tabular|s and |x|\-|tabular|s.
-Êîìàíäà |\Continued|\-|Float| íå ðàáîòàåò ñ~|super|\-|tabular| è~|xtabular|.
-\end{Note}
-
-\pagebreak[3]
-\subsection{Ïàêåò threeparttable}
-\label{threeparttable}
-\packagedescription{%
-% The \package{threeparttable} package\cite{threeparttable} provides a scheme
-% for tables that have a structured note section after the table contents and
-% the caption.
-% This scheme provides an answer to the old problem of putting footnotes in
-% tables---by making footnotes entirely unnecessary.}
-Ïàêåò \package{threeparttable}\cite{threeparttable}
-ïðåäëàãàåò ñõåìó äëÿ òàáëèö, èìåþùèõ ñòðóêòóðèðîâàííûé ðàçäåë çàìå÷àíèé ïîñëå òàáëè÷íîãî ìàòåðèàëà
-è~ïîäïèñè.
-Ýòà ñõåìà ïðåäëàãàåò îòâåò äëÿ ñòàðîé ïðîáëåìû ðàçìåùåíèÿ ñíîñîê â~òàáëèöàõ áåç íåîáõîäèìîñòè
-ñîçäàíèÿ ñíîñîê.}
-
-\NEWfeature{v3.1}
-% If you want to setup special options for the |three|\-|part|\-|table| and
-% |measured|\-|figure| environments you can use
-Åñëè âàì íóæíî ñîçäàòü ñïåöèàëüíûå íàñòðîéêè äëÿ îêðóæåíèé
-|three|\-|part|\-|table| è~|measured|\-|figure|,
-âû ìîæåòå çàäàòü
-\begin{quote}
- |\captionsetup[threeparttable]|\marg{options}\quad\emph{è}\\
- |\captionsetup[measuredfigure]|\marg{options}\quad.
-\end{quote}
-% These options will be executed additionally to the regular ones for
-% |table| or |figure|.
-Ýòè íàñòðîéêè áóäóò äîáàâëåíû ê~îñíîâíûì íàñòðîéêàì
-|figure| èëè |table|.\par
-
-\begin{Note}
-% Since the caption will have the same width as the contents here,
-% the |margin| resp.~|width| setting will not be used for these figures and tables,
-% at least unless you set it explicit with
-% |\caption|\-|setup[three|\-|part|\-|table]{|\ldots|}| or
-% |\caption|\-|setup[measured|\-|figure]{|\ldots|}|.
-Ïîñêîëüêó øèðèíà ïîäïèñè ðàâíà øèðèíå òàáëèöû,
-êëþ÷è |margin| è~|width| çäåñü íå èñïîëüçóþòñÿ äëÿ ðèñóíêîâ è~òàáëèö,
-òîëüêî åñëè âû íå çàäàäèòå ñòðîãî
-|\caption|\-|setup|\x|[threeparttable]|\x|{|\ldots|}|
-èëè |\caption|\-|setup|\x|[measuredfigure]|\x|{|\ldots|}|.
-\end{Note}
-
-\medskip
-
-\begin{Annotation*}
-% Instead of using the \package{threeparttable} package you can
-% also use the \package{floatrow} package\cite{floatrow} for this purpose.
-Âìåñòî ïàêåòà \package{threeparttable} ìîæíî èñïîëüçîâàòü
-ïàêåò \package{floatrow}\cite{floatrow}.
-\end{Annotation*}
-
-\pagebreak[3]
-\subsection{Ïàêåò wrapfig}
-\label{wrapfig}
-\packagedescription{%
-% Similar to the \package{floatflt}, the \package{picinpar}, and the
-% \package{picins} package the \package{wrapfig} package\cite{wrapfig} offers
-% figures and tables which do not span the full width of a page and are float
-% around by text.
-% For a detailed discussion about the differences between these packages
-% please take a look at The \LaTeX\ Companion\cite{TLC2}.}
-Àíàëîãè÷íî ïàêåòàì \package{floatflt}, \package{picinpar} è~%
-\package{picins}, ïàêåò \package{wrapfig}\cite{wrapfig} ïðåäëàãàåò
-îêðóæåíèÿ íåáîëüøèõ ðèñóíêîâ è~òàáëèö îáòåêàåìûõ òåêñòîì.
-Çà áîëåå ïîäðîáíîé èíôîðìàöèåé î~ðàçëè÷èÿõ ïàêåòîâ îáðàùàéòåñü
-ê~\LaTeX\ Companion\cite{TLC2}.}
-
-\NEWfeature{v3.1}
-% If you want to setup special options for the |wrap|\-|figure| and
-% |wrap|\-|table| environments you can use
-Åñëè âàì íóæíî çàäàòü ñïåöèàëüíûå íàñòðîéêè äëÿ îêðóæåíèé |wrap|\-|figure|
-è~|wrap|\-|table| âû ìîæåòå çàäàòü
-\begin{quote}
- |\captionsetup[wrapfigure]|\marg{options}\\
- |\captionsetup[wraptable]|\marg{options}\quad.
-\end{quote}
-% These options will be executed additionally to the regular ones for
-% |figure| or |table|.
-Ýòè íàñòðîéêè áóäóò äîáàâëåíû ê~îñíîâíûì íàñòðîéêàì
-|figure| èëè |table|.\par
-
-% Furthermore |\Declare|\-|Caption|\-|Type|\marg{name} will also define
-% an environment called |wrap|\meta{name} which behaves like |wrap|\-|figure|
-% and |wrap|\-|table|.
-Ïîìèìî ýòîãî êîìàíäà |\Declare|\-|Caption|\-|Type|\marg{name} îïðåäåëèò
-íîâîå îêðóæåíèå |wrap|\meta{name}, êîòîðîå àíàëîãè÷íî |wrap|\-|figure| è~|wrap|\-|table|.
-
-\begin{Note}
-% The |margin| resp.~|width| setting will not be used for these figures and
-% tables, unless you set it explicit with
-% |\caption|\-|setup[wrap|\-|figure]{|\ldots|}|
-% or |\caption|\-|setup[wrap|\-|table]{|\ldots|}|.
-Íàñòðîéêè êëþ÷åé |margin| è~|width| íå èñïîëüçóþòñÿ äëÿ ðèñóíêîâ è~òàáëèö,
-òîëüêî åñëè âû íå çàäàäèòå ñòðîãî |\caption|\-|setup|\x|[wrapfigure]{|\ldots|}|
-èëè |\caption|\-|setup|\x|[wraptable]{|\ldots|}|.
-\end{Note}
-
-\begin{Note}
-% If the \package{wrapfig} package should be used in coorperation with the
-% \package{float} package, it needs to be loaded \emph{after} the
-% \package{float} package. Furthermore |\new|\-|float| and |\restyle|\-|float|
-% commands \emph{should} be placed after \emph{both} packages have been loaded.
-Åñëè ïàêåò \package{wrapfig} äîëæåí áûòü èñïîëüçîâàí ñîâìåñòíî ñ~ïàêåòîì
-\package{float}, òî åãî íóæíî çàãðóçèòü \emph{ïîñëå} ïàêåòà
-\package{float}. Êðîìå òîãî êîìàíäû |\new|\-|float| èëè |\restyle|\-|float|
-\emph{äîëæíû} áûòü ïîìåùåíû ïîñëå çàãðóçêè \emph{îáîèõ} ïàêåòîâ.
-\end{Note}
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-% \section{Further reading}
-\section{Ðåêîìåíäóåìàÿ ëèòåðàòóðà}
-
-% I recommend the following documents for further reading:
-ß ðåêîìåíäóþ ñëåäóþùèå äîêóìåíòû äëÿ äàëüíåéøåãî ÷òåíèÿ:
-
-\begin{itemize}
-\item
-% The \TeX\ FAQ -- Frequently asked questions about \TeX\ and \LaTeX:
- The \TeX\ FAQ -- ×àÂî ïî \TeX'ó è~\LaTeX'ó:
- \begin{quote}\url{http://faq.tug.org/}\end{quote}
-
-\item
- A French FAQ can be found at
- \begin{quote}\url{http://www.grappa.univ-lille3.fr/FAQ-LaTeX/}\end{quote}
-
-\item
- ``What is a minimal working example?'' from Christian Faulhammer and Ulrich Schwarz:
- \begin{quote}\url{http://www.minimalbeispiel.de/mini-en.html}\end{quote}
-
-\item
-%^^A \textsf{epslatex} from Keith Reckdahl contains many tips around
-%^^A including graphics in \LaTeXe\ documents.
-%^^A You will find this document in the directory
- \textsf{epslatex} (Keith Reckdahl) ñîäåðæèò ìíîæåñòâî ïîäñêàçîê
- êàê ðàçìåñòèòü èëëþñòðàöèîííûé ìàòåðèàë â~äîêóìåíòàöèè ñîçäàííîé â~\LaTeXe.
- Âû íàéäåòå ýòîò ôàéë â~äèðåêòîðèè
- \begin{quote}\url{http://mirror.ctan.org/info/epslatex/}\end{quote}
-\end{itemize}
-
-% --------------------------------------------------------------------------- %
-
-\pagebreak[3]
-% \section{Thanks}
-\section{Áëàãîäàðíîñòè}
-
-{\fontencoding{T1}%\fontfamily{ptm}
-\selectfont
-I would like to thank Katja Melzner,
-Steven D. Cochran, Frank Mittelbach, Olga Lapko,
-David Carlisle, Carsten Heinz, and Keith Reckdahl.
-Thanks a lot for all your help, ideas, patience, spirit, and support!
-
-Also I would like to thank
-Harald Harders,
-Peter L\"offler,
-Peng Yu,
-Alexander Zimmermann,
-Matthias Pospiech,
-J\"urgen Wieferink,
-Christoph Bartoschek,
-Uwe St\"ohr,
-Ralf Stubner,
-Geoff Vallis,
-Florian Keiler,
-J\"urgen G\"obel,
-Uwe Siart,
-Sang-Heon Shim,
-Henrik Lundell,
-David Byers,
-William Asquith,
-Prof.~Dr.~Dirk Hoffmann,
-Frank Martini,
-Danie Els,
-and
-Markus Kohm,
-who all helped to make this package a better one.}
-
-% --------------------------------------------------------------------------- %
-
-\clearpage\appendix
-% \section{Alphabetical Reference}
-\section{Àëôàâèòíûé óêàçàòåëü}
-
-%\newenvironment{Warnings}%
-% {\begin{trivlist}%
-% \def\Message{\pagebreak[3]\leftskip=0pt\relax\item[]\color{blue}}%
-% \def\Description{\nopagebreak\par\nopagebreak\color{black}\leftskip=1.5em\nopagebreak}%
-% }%
-% {\color{black}\end{trivlist}}
-\makeatletter
-\newenvironment{Warnings}{%
- \newif\ifMessage
- \def\Message{%
- \ifMessage\end{minipage}\par\vspace\itemsep\pagebreak[3]\fi
- \begin{minipage}{\linewidth}%
- \setlength\parindent{0pt}%
- \setlength\parskip{\smallskipamount}%
- \setlength\leftskip{0pt}%
- \color{blue}%
- \Messagetrue}%
- \def\Description{%
- \par\color{black}\leftskip=1.5em}%
- \def\Or{\@testopt\@Or{èëè}}%
- \def\@Or[##1]{%
- \\{\small\color{black}\hspace{1.5em}\textit{-- ##1 --}}\\}%
-}{%
- \ifMessage\end{minipage}\par\fi
-}
-\makeatother
-
-% \subsection{Options}
-\subsection{Êëþ÷è (îïöèè)}
-\newcommand\preambleoption{\,%
- \begingroup\def\thefootnote{\fnsymbol{footnote}}%
- \footnotemark[2]%
- \endgroup}
-\newcommand\preambleoptiontext{%
- \begingroup\def\thefootnote{\fnsymbol{footnote}}%
-% \footnotetext[2]{These options are only available in the preamble of the document.}%
- \footnotetext[2]{Ýòè îïöèè ìîæíî èñïîëüçîâàòü òîëüêî â~ïðåàìáóëå äîêóìåíòà.}%
- \endgroup}
-
-\newcommand\cell[1]{\tabular[t]{@{}l@{}}#1\endtabular}
-
-\begin{longtable*}{@{}l@{\ }ll@{}}
-% Option & Short description & Section \\
-Êëþ÷ & Êðàòêîå îïèñàíèå & Ðàçäåë \\
-\hline\noalign{\vskip2pt}
-\endhead
-% |aboveskip| & sets the skip above caption & \ref{skips} \\
-|aboveskip| & çàäà¸ò îòáèâêó íàä ïîäïèñüþ & \ref{skips} \\
-% |belowskip| & sets the skip below caption & \ref{skips} \\
-|belowskip| & çàäà¸ò îòáèâêó ïîä ïîäïèñüþ & \ref{skips} \\
-% |compatibility|\preambleoption & force (non-)compatibility & \ref{classes} \\
-|compatibility|\preambleoption & ôîðñèðîâàòü (íå)ñîâìåñòèìîñòü & \ref{compatibility} \\
-%|config| & & \ref{x} \\
-% |figurename|\preambleoption & sets the figure name & \ref{names} \\
-|figurename|\preambleoption & çàäàíèå èìåíè ðèñóíêà â~ìåòêå & \ref{names} \\
-% |figureposition|\preambleoption & gives a hint about the figure caption position & \ref{skips} \\
-|figureposition|\preambleoption & äà¸ò ïîäñêàçêó î~ðàçìåùåíèè ïîçèöèè ïîäïèñè ðèñóíêà & \ref{skips} \\
-% |figurewithin|\preambleoption & sets the figure ``within'' counter & \ref{numbering} \\
-|figurewithin|\preambleoption & \cell{çàäà¸ò ñ÷¸ò÷èê ðàçäåëà, êîòîðîìó ïîä÷èíÿåòñÿ\\ íóìåðàöèÿ ðèñóíêîâ}
- & \ref{numbering} \\
-% |font|(|+|) & sets the font & \ref{fonts} \\
-|font|(|+|) & çàäà¸ò øðèôò & \ref{fonts} \\
-% |format| & sets the format & \ref{formats} \\
-|format| & çàäà¸ò ôîðìàò & \ref{formats} \\
-\iffalse
-% |FPlist| & to where the list entry of a FPfigure should link? & \ref{fltpage} \\
-|FPlist| & ê~÷åìó ïðèâÿçûâàòü FPfigure â~Ñïèñêå ôëîòîâ? & \ref{fltpage} \\
-% |FPref| & to where a |\ref| to a FPfigure should link? & \ref{fltpage} \\
-|FPref| & ê~÷åìó ïðèâÿçûâàòü |\ref| äëÿ FPfigure? & \ref{fltpage} \\
-\fi
-% |hangindent| & sets the hang indention & \ref{margins} \\
-|hangindent| & \cell{çàäà¸ò âòÿæêó [íà âåñó;\\ ñîîòâåòñòâóåò êîìàíäå \cs{hangindent}]} & \ref{margins} \\
-% |hypcap| & select `hypcap' feature & \ref{hyperref} \\
-|hypcap| & îïðåäåëÿåò ðàáîòó ïàêåòà `hypcap' & \ref{hyperref} \\
-% |hypcapspace| & sets the distance between hyperlink \& contents & \ref{hyperref} \\
-|hypcapspace| & \cell{çàäà¸ò ðàññòîÿíèå ìåæäó ãèïåðññûëêîé\\ è~ñîäåðæèìûì
-îáúåêòà} & \ref{hyperref} \\
-% |indention| & sets the indention & \ref{margins} \\
-|indention| & çàäà¸ò âòÿæêó & \ref{margins} \\
-% |justification| & sets the justification & \ref{justification} \\
-|justification| & çàäà¸ò âûêëþ÷êó & \ref{justification} \\
-% |labelfont|(|+|) & sets the font of the caption label & \ref{fonts} \\
-|labelfont|(|+|) & çàäà¸ò øðèôò äëÿ ìåòêè ôëîòà & \ref{fonts} \\
-% |labelformat| & sets the format of the caption label & \ref{formats} \\
-|labelformat| & \cell{çàäà¸ò ôîðìàò [îôîðìëåíèå] íóìåðàöèîííîãî\\ çàãîëîâêà} & \ref{formats} \\
-% |labelsep| & sets the label separator & \ref{formats} \\
-|labelsep| & \cell{çàäà¸ò ðàçäåëèòåëü ìåæäó íóìåðàöèîííûì\\ çàãîëîâêîì
-è~òåêñòîì ïîäïèñè} & \ref{formats} \\
-% |labelseparator| & sets the label separator & \ref{formats} \\
-|labelseparator| & \cell{çàäà¸ò ðàçäåëèòåëü ìåæäó íóìåðàöèîííûì\\ çàãîëîâêîì
-è~òåêñòîì ïîäïèñè} & \ref{formats} \\
-% |list| & switches the entries in the `List of' on or off & \ref{lists} \\
-|list| & \cell{îïðåäåëÿåò (âêëþ÷àåò/îòêëþ÷àåò) âûâîä ïîäïèñåé\\ â~Ñïèñêå ôëîòîâ} & \ref{lists} \\
-% |listformat| & sets the `List of' entry format & \ref{lists} \\
-% |listfigurename| & sets the `List of Figure' name & \ref{names} \\
-|listfigurename| & çàäà¸ò çàãîëîâîê äëÿ Ñïèñêà ðèñóíêîâ & \ref{names} \\
-|listformat| & îïðåäåëÿåò ôîðìàò äëÿ âûâîäà â~Ñïèñêå ôëîòîâ & \ref{lists} \\
-% |listtablename| & sets the `List of Tables' name & \ref{names} \\
-|listtablename| & çàäà¸ò çàãîëîâîê äëÿ Ñïèñêà òàáëèö & \ref{names} \\
-% |margin| & sets the margin & \ref{margins} \\
-|margin| & çàäà¸ò ïîëÿ âîêðóã ïîäïèñè & \ref{margins} \\
-% |margin*| & sets the margin, but only if no width is set & \ref{margins} \\
-|margin*| & \cell{çàäà¸ò ïîëÿ, â~ñëó÷àå, åñëè øèðèíà ïîäïèñè\\ íå çàäàíà} & \ref{margins} \\
-% |maxmargin| & sets the max. margin & \ref{margins} \\
-|maxmargin| & çàäà¸ò ìàêñèìàëüíóþ âåëè÷èíó ïîëÿ & \ref{margins} \\
-% |minmargin| & sets the min. margin & \ref{margins} \\
-|minmargin| & çàäà¸ò ìèíèìàëüíóþ âåëè÷èíó ïîëÿ & \ref{margins} \\
-%| name| & sets the name of the current environment & \ref{names} \\
-|name| & çàäà¸ò èìÿ íîâîãî îêðóæåíèÿ & \ref{names} \\
-% |oneside| & selects the one-side mode & \ref{margins} \\
-|oneside| & çàäà¸ò îäíîñòîðîííþþ ïå÷àòü äîêóìåíòà & \ref{margins} \\
-% |options| & executes the given option list & \ref{x} \\
-|options| & âêëþ÷àåò äàííûé ñïèñîê îïöèé & \\
-% |parindent| & sets the paragraph indention & \ref{margins} \\
-|parindent| & çàäà¸ò àáçàöíûé îòñòóï & \ref{margins} \\
-% |parskip| & sets the skip between paragraphs & \ref{margins} \\
-|parskip| & çàäà¸ò îòáèâêó ìåæäó àáçàöàìè & \ref{margins} \\
-% |position| & gives a hint about the caption position & \ref{skips} \\
-|position| & äà¸ò ïîäñêàçêó î~ðàçìåùåíèè ïîäïèñè & \ref{skips} \\
-% |singlelinecheck| & switches the single-line-check on or off & \ref{justification} \\
-|singlelinecheck| & âêëþ÷àåò êîíòðîëü [îôîðìëåíèÿ] îäíîñòðî÷íûõ ïîäïèñåé & \ref{justification} \\
-%|size| & sets the size of font & \ref{x} \\
-% |skip| & sets the skip between content \& caption & \ref{skips} \\
-|skip| & \cell{çàäà¸ò îòáèâêó ìåæäó ñîäåðæèìûì ôëîòà è~ïîäïèñè} & \ref{skips} \\
-% |strut| & switches the usage of |\strut|s on or off & \ref{formats} \\
-|strut| & âêëþ÷àåò èñïîëüçîâàíèå êîìàíäû ðàñïîðêè |\strut| & \ref{formats} \\
-% |style| & sets the caption style & \ref{style} \\
-|style| & çàäà¸ò ñòèëü îôîðìëåíèÿ ïîäïèñè & \ref{style} \\
-%|style*| & sets the caption style & \ref{style} \\
-% |subtype| & sets the sub-caption type & \phantom{t}--~\footnotemark \\
-|subtype| & çàäà¸ò âûâîä ïîäïèñè ÷àñòè ôëîòà & \phantom{t}--~\footnotemark \\
-% |tablename|\preambleoption & sets the table name & \ref{names} \\
-|tablename|\preambleoption & çàäà¸ò èìÿ òàáëèöû & \ref{names} \\
-% |tableposition|\preambleoption & gives a hint about the table caption position & \ref{skips} \\
-|tableposition|\preambleoption & \cell{äà¸ò ïîäñêàçêó î~ïîëîæåíèè ïîäïèñè òàáëèöû
- \\(òàáëè÷íîãî çàãîëîâêà)} & \ref{skips} \\
-% |tablewithin|\preambleoption & sets the table ``within'' counter & \ref{numbering} \\
-|tablewithin|\preambleoption & \cell{çàäà¸ò ñ÷¸ò÷èê ðàçäåëà, êîòîðîìó ïîä÷èíÿåòñÿ\\ íóìåðàöèÿ òàáëèö}
- & \ref{numbering} \\
-% |textfont|(|+|) & sets the font of the caption text & \ref{fonts} \\
-|textfont|(|+|) & çàäà¸ò øðèôò äëÿ òåêñòà ïîäïèñè & \ref{fonts} \\
-% |textformat| & sets the format of the caption text & \ref{formats} \\
-|textformat| & çàäà¸ò ôîðìàò òåêñòà ïîäïèñè & \ref{formats} \\
-% |twoside| & selects the two-side mode & \ref{margins} \\
-|twoside| & çàäà¸ò äâóñòîðîííþþ ïå÷àòü äîêóìåíòà & \ref{margins} \\
-% |type| & sets the caption type \& places a hyperlink anchor & \ref{types} \\
-|type| & çàäà¸ò òèï ïîäïèñè è~ïîìåùàåò íà÷àëî ãèïåðññûëêè & \ref{types} \\
-% |type*| & sets the caption type only & \ref{types} \\
-|type*| & çàäà¸ò òîëüêî òèï ïîäïèñè & \ref{types} \\
-% |width| & sets a fixed caption width & \ref{margins} \\
-|width| & çàäà¸ò ôèêñèðîâàííóþ øèðèíó ïîäïèñè & \ref{margins} \\
-\end{longtable*}
-\preambleoptiontext
-% \footnotetext{The option \opt{subtype} is explained in the
-% \package{subcaption} package documentation.}
-\footnotetext{Çíà÷åíèå îïöèè \texttt{subtype} îáúÿñíÿåòñÿ â~äîêóìåíòàöèè ê~ïàêåòó
- \package{subcaption}.}
-
-\nopagebreak\parbox[t]{\linewidth}{%
-\begin{Note*}
-% Obsolete options are not listed here. See
-% \Ref{caption1} and
-% \Ref{caption2} for a list of these options.}
- Óñòàðåâøèå îïöèè çäåñü íå ïåðå÷èñëÿþòñÿ. Çà ñïèñêîì ýòèõ îïöèé îáðàòèòåñü ê~äîêóìåíòàöèè
- \Ref{caption1} è~\Ref{caption2}.
-\end{Note*}}
-
-% \subsection{Commands}
-\subsection{Êîìàíäû}
-
-\begin{longtable*}{lll}
-Êîìàíäà & & Ðàçäåë \\
-\hline
-\endhead
-|\abovecaptionskip| & & \ref{skips} \\
-%|\AtBeginCaption| & & \ref{hooks} \\
-%|\AtEndCaption| & & \ref{hooks} \\
-|\belowcaptionskip| & & \ref{skips} \\
-|\caption| & & \ref{caption} \\
-|\caption*| & & \ref{caption} \\
-|\captionlistentry| & & \ref{captionlistentry} \\
-|\captionof| & & \ref{caption} \\
-|\captionof*| & & \ref{caption} \\
-|\captionsetup| & & \ref{captionsetup} \\
-|\captionsetup*| & & \ref{captionsetup} \\
-|\centerfirst| & & \ref{justification} \\
-|\centerlast| & & \ref{justification} \\
-|\clearcaptionsetup| & & \ref{captionsetup} \\
-|\clearcaptionsetup*| & & \ref{captionsetup} \\
-|\ContinuedFloat| & & \ref{ContinuedFloat} \\
-|\DeclareCaptionFont| & & \ref{declare} \\
-|\DeclareCaptionFormat| & & \ref{declare} \\
-|\DeclareCaptionFormat*| & & \ref{declare} \\
-|\DeclareCaptionJustification| & & \ref{declare} \\
-|\DeclareCaptionLabelFormat| & & \ref{declare} \\
-|\DeclareCaptionLabelSeparator| & & \ref{declare} \\
-|\DeclareCaptionLabelSeparator*| & & \ref{declare} \\
-|\DeclareCaptionListFormat| & & \ref{declare} \\
-|\DeclareCaptionOption| & & \ref{declare} \\
-|\DeclareCaptionStyle| & & \ref{declare} \\
-|\DeclareCaptionSubType| & & --~\footnotemark \\
-|\DeclareCaptionTextFormat| & & \ref{declare} \\
-|\DeclareCaptionType| & & \ref{declare} \\
-|\showcaptionsetup| & & \ref{captionsetup} \\
-\end{longtable*}
-% \footnotetext{\cs{DeclareCaptionSubType} is explained in the
-% \package{subcaption} package documentation.}
-\footnotetext{Êîìàíäà \cs{DeclareCaptionSubType} îïèñàíà
- â~äîêóìåíòàöèè ê~ïàêåòó \package{subcaption}.}
-
-\clearpage
-% \subsection{Warnings}
-\subsection{Ïðåäóïðåæäåíèÿ}
-
-\begin{Warnings}
-
-\Message
- |\caption outside box or environment.|
-\Or
- |\captionsetup{type=...} outside box or environment.|
-\Or
- |\captionsetup{type*=...} or \captionof outside box|\\
- | or environment.|
-\Description
-% You have placed a |\caption|, |\caption|\-|of|, or
-% |\caption|\-|setup{type=|\x\meta{type}|}| command outside an box, group,
-% or environment.
-% You should not do this since it could cause some bad side-effects.
-% \par\See{\Ref{types} and \Ref{caption}}
- Âû ïîìåñòèëè |\caption|, |\caption|\-|of|, èëè
- |\caption|\-|setup{type=|\x\meta{type}|}| âíå áîêñà, ãðóïïû
- èëè îêðóæåíèÿ.
- Ýòî ìîæåò ñîçäàòü ïîáî÷íûå ýôôåêòû.
- \par\See{\Ref{types} è~\Ref{caption}}
-
-\Message
- |\caption will not be redefined since it's already|\\
- |redefined by a document class or package which is|\\
- |unknown to the caption package.|
-\Description
-% If \thispackage\ detects that some (unknown) document class or
-% package has enhanced |\caption|, it will not redefine
-% |\caption|, too, since this would simply kill the enhancement.
-% As a result some features, like |\caption*|, |\Continued|\-|Float|,
-% using the optional argument of |\caption|\-|setup|,
-% or the options |list=| and |hypcap=| will not be available.\par
-% If you don't care about the original enhancements but would
-% like to use the full range of features of \thispackage\ instead
-% you can give the unsupported(!) option |compatibility=|\x|false|
-% a try and keep your fingers crossed.
-% (But you will get the next warning instead.)
-% \par\See{\Ref{classes} and \Ref{compatibility}}
- \Thispackage\ îáíàðóæèë, ÷òî èñïîëüçóåòñÿ êàêîé-ëèáî (íåèçâåñòíûé) êëàññ äîêóìåíòà èëè
- ïàêåò, ðàñøèðèâøèé îïðåäåëåíèå |\caption|, ïîýòîìó äàëüíåéøåå ïåðåîïðåäåëåíèå
- |\caption| ìîæåò óíè÷òîæèòü èñïîëüçóåìûå íàñòðîéêè.
- Â~ðåçóëüòàòå íåêîòîðûå îñîáåííîñòè, òàêèå êàê |\caption*|, |\ContinuedFloat|,
- èñïîëüçîâàíèå äîïîëíèòåëüíîãî àðãóìåíòà |\captionsetup|,
- èëè îïöèé |list=| è~|hypcap=| íåâîçìîæíî.\par
- Åñëè âàì íå íóæíû îðèãèíàëüíûå íàñòðîéêè è~âàæíåå èñïîëüçîâàòü
- ïîëíûé ñïåêòð âîçìîæíîñòåé äàííîãî ïàêåòà, âû ìîæåòå çàäàòü
- íåïîääåðæèâàåìóþ(!) îïöèþ |compatibility=false|
- è~íàäåÿòüñÿ íà ëó÷øåå.
- (Íî â~ýòîì ñëó÷àå âû ïîëó÷èòå ñëåäóþùåå ïðåäóïðåæäåíèå.)
- \par\See{\Ref{classes}}
-
-\Message
- |Forced redefinition of \caption since the|\\
- |unsupported(!) package option `compatibility=false'|\\
- |was given.|
-\Description
-% Since you were so keen to specify the option |compatibility=|\x|false|
-% \thispackage\ will try to do its best to fulfill your wishes.
-% But depending on the document class or other packages you use that
-% can end in non-functional features or even errors. So keep your
-% fingers crossed!
- Åñëè âû áûëè ñòîëü îòâàæíû, çàäàâ îïöèþ |compatibility=|\x|false|,
- \thispackage\ ïîñòàðàåòñÿ ñäåëàòü âñ¸, ÷òî âû ïîòðåáóåòå.
- Íî òàêîå èñïîëüçîâàíèå ýòîãî ïàêåòà ñîâìåñòíî ñ~òàêèì ïàêåòîì èëè êëàññîì
- ìîæåò îòêëþ÷èòü íåêîòîðûå îñîáåííîñòè èëè ïîðîäèòü îøèáêè.
- Èòàê, íàäåéòåñü íà ëó÷øåå!
- \par\See{\Ref{compatibility}}
-
-\Message
- |Hyperref support is turned off because hyperref has|\\
- |stopped early.|
-\Description
-% If the \package{hyperref} package stops early during loading
-% (because of what-ever reason), the \package{hyperref} support of
-% \thispackage\ will not be available. As a result you could get
-% \package{hyperref} warnings and non-functional hyperlinks to figures
-% or tables.
- Åñëè çàãðóçêà ïàêåòà \package{hyperref} çàâåðøèëàñü ðàíüøå ïîëîæåííîãî
- (ïî êàêîé-ëèáî ïðè÷èíå), ïîääåðæêà ïàêåòà \package{hyperref} ïàêåòîì
- \package{caption} áóäåò îòêëþ÷åíà. Â~ðåçóëüòàòå âû ïîëó÷èòå
- \package{hyperref} ïðåäóïðåæäåíèÿ è~íåôóíêöèîíèðóþùèå ãèïåðññûëêè íà ðèñóíêè
- èëè òàáëèöû.
- \par\See{\Ref{hyperref}\,}
-
-\Message
- |Ignoring optional argument [|\meta{pos}|] of \setcapwidth.|
-\Description
-% \Thispackage\ tries to emulate the \KOMAScript\ commands regarding
-% captions as best as it can. But the optional argument of the
-% \KOMAScript\ command |\setcapwidth| is not (yet) working if you use
-% this package, so if you try to use it anyway, you will get this warning.
- \Thispackage\ ñòàðàåòñÿ êîððåêòíî ýìóëèðîâàòü êîìàíäû \KOMAScript, îòíîñÿùèåñÿ ê~ïîäïèñÿì.
- Íî îïöèÿ êîìàíäû |\setcapwidth| èç
- \KOMAScript\ åù¸ íå ðàáîòàåò âìåñòå ñ~ýòèì ïàêåòîì,
- ïîýòîìó, åñëè âû ðåøèòå å¸ èñïîëüçîâàòü, âû ïîëó÷èòå ïðåäóïðåæäåíèå.
- \par\See{\Ref{KOMA}}
-
-\Message
- |Internal Warning: |\meta{warning message}|.|
-\Description
-% You should never see this warning, either you use a package which redefines
-% |figure| or |table| and which is unknown to \thispackage, or this is a bug
-% in \thispackage.
-% Please send me an e-mail reporting this issue.
- Íàäåþñü âû íå óâèäèòå òàêîãî ñîîáùåíèÿ, îíî ïîÿâèòñÿ â~ñëó÷àå ïåðåîïðåäåëåíèé îêðóæåíèé
- |figure| èëè |table|, íåèçâåñòíûõ äàííîìó ïàêåòó, èëè ýòî îøèáêà ñàìîãî ïàêåòà
- \package{caption}.
- Ïîæàëóéñòà, ïðèøëèòå e-mail ñ~îáðàçöîì, äàþùèì ýòî ñîîáùåíèå.
-
-\Message
- |\label before \caption ignored|
-\Description
-% Regarding |\label| the floating environments behave differently than its
-% non-floating counterparts: The internal reference will not be generated
-% at the beginning of the environment, but at |\caption| instead.
-% So you have to place the |\label| command either just \emph{after} or
-% \emph{inside} the caption text (mandatory argument of |\caption|).
- Ìåòêè, |\label|, ê~ïëàâàþùèì îáúåêòàì ðàáîòàþò íå òàê, êàê íåïëàâàþùèå îêðóæåíèÿ:
- èíôîðìàöèÿ äëÿ ìåòêè ãåíåðèðóåòñÿ íå â~íà÷àëå îêðóæåíèÿ,
- à~ïîñëå êîìàíäû |\caption|.
- Ïîýòîìó âû äîëæíû ïîìåñòèòü êîìàíäó |\label| ëèáî \emph{ïîñëå} òåêñòà
- |\caption| ëèáî âíóòðè òåêñòà ïîäïèñè.
-
-\Message
- |Option `|\meta{option}|' was not in list `|\meta{option list}|'.|
-\Description
-% If you try to remove a specific option of an option list,
-% for example with |\clear|\-|caption|\-|setup[po|\-|si|\-|tion]{table}|,
-% and this option can not be found inside the option list, you will
-% get this warning. If this is not because of a typo and you would like
-% to suppress this warning, use |\clear|\-|caption|\-|setup*| instead of
-% |\clear|\-|caption|\-|setup|.
- Åñëè âû ïîïðîáóåòå óäàëèòü îïöèþ èç ñïèñêà îïöèé,
- íàïðèìåð, |\clear|\-|caption|\-|setup[po|\-|si|\-|tion]{table}|,
- à~ýòà îïöèÿ íå áûëà îáíàðóæåíà â~ñïèñêå, âû ïîëó÷èòå
- ýòî ïðåäóïðåæäåíèå. Åñëè ýòî ïðîèñõîäèò íå èç-çà îïå÷àòêè è~âû õîòèòå çàïðåòèòü ýòî
- ïðåäóïðåæäåíèå, èñïîëüçóéòå |\clearcaptionsetup*| âìåñòî
- |\clearcaptionsetup|.
- \par\See{\Ref{captionsetup}}
-
-\Message
- |Option list `|\meta{option list}|' undefined.|
-\Description
-% If you try to remove a specific option of an option list,
-% for example with |\clear|\-|caption|\-|setup[for|\-|mat]{figure}|,
-% and this option list is not defined (yet), you will
-% get this warning. If this is not because of a typo and you would like
-% to suppress this warning, use |\clear|\-|caption|\-|setup*| instead of
-% |\clear|\-|caption|\-|setup|.
- Åñëè âû ïîïðîáóåòå óäàëèòü îïöèþ èç ñïèñêà îïöèé,
- íàïðèìåð, |\clear|\-|caption|\-|setup[for|\-|mat]{figure}|,
- à~ýòà îïöèÿ íå áûëà îáíàðóæåíà â~ñïèñêå, âû ïîëó÷èòå
- ýòî ïðåäóïðåæäåíèå. Åñëè ýòî ïðîèñõîäèò íå èç-çà îïå÷àòêè è~âû õîòèòå çàïðåòèòü ýòî
- ïðåäóïðåæäåíèå, èñïîëüçóéòå |\clearcaptionsetup*| âìåñòî
- |\clearcaptionsetup|.
- \par\See{\Ref{captionsetup}}
-
-\iffalse
-\Message
- |Possibly superfluous \restylefloat{|\meta{type}|} detected.|\\
- |If you think that this warning is unjustified,|\\
- |you can switch it off using the caption package|\\
- |option `restylefloatcheck=off'.|
-\Description
- \TODO
-\fi
-
-\Message
- |`ragged2e' package not loaded, therefore|\\
- |substituting \raggedright for \RaggedRight.|
-\Description
-% The caption option |justification=|\x|RaggedRight| is only full functional
-% if you have the \package{ragged2e} package installed in your \TeX\ system.
-% If not, you will get this warning, and |justification=|\x|RaggedRight|
-% will be treated as |justification=|\x|raggedright|.
- Îïöèÿ |justification=|\x|RaggedRight| áóäåò ôóíêöèîíèðîâàòü
- åñëè ïàêåò \package{ragged2e} èíñòàëëèðîâàí â~âàøåé ñèñòåìå \TeX{}.
- Åñëè ïàêåòà íåò, âû ïîëó÷èòå ïðåäóïðåæäåíèå, è~|justification=|\x|RaggedRight|
- áóäåò ðàáîòàòü êàê |justification=|\x|raggedright|.
- \par\See{\Ref{justification}}
-
-\Message
- |Obsolete option `ignoreLTcapwidth' ignored.|
-\Description
-% The \package{caption2} package option |ignoreLTcapwidth| will not be
-% emulated by this version of \thispackage, usually you can simply wipe it
-% away.
- Îïöèÿ ïàêåòà \package{caption2}, |ignoreLTcapwidth|, íå áóäåò ýìóëèðîâàòüñÿ
- äàííîé âåðñèåé ïàêåòà, îáû÷íî ýòî ïðåäóïðåæäåíèå ìîæíî èãíîðèðîâàòü.
- \par\See{\Ref{caption2} and \Ref{longtable}}
-
-\Message
- |`ragged2e' support has been changed. Rerun to get|\\
- |captions right.|
-\Description
-% The \package{ragged2e} package will only be loaded by \thispackage\ if it
-% is actually needed.
-% At least two \LaTeX\ runs are needed for that, so on the first run you could
-% get this warning.
-% Just compile your document again and this warning should go away.
- Ïàêåò \package{ragged2e} ìîæåò áûòü çàãðóæåí ïàêåòîì \package{caption} åñëè ýòî
- äåéñòâèòåëüíî íåîáõîäèìî.
- Ïî êðàéíåé ìåðå äëÿ ýòîãî íóæíû äâå îáðàáîòêè \LaTeX'à, è~ïðè ïåðâîé îáðàáîòêå
- âû ïîëó÷èòå ýòî ñîîáùåíèå.
- Ñêîìïèëèðóéòå äîêóìåíò âòîðîé ðàç è ïðåäóïðåæäåíèå èñ÷åçíåò.
- \par\See{\Ref{justification}}
-
-\Message
- |Reference on page |\meta{page no.}| undefined.|
-\Description
-% If you use a |twoside| page layout, \thispackage\ needs to track the
-% page numbers to get the margins right.
-% At least two \LaTeX\ runs are needed for that, on the first run you could get
-% this warning.
-% Just compile your document again and this warning should go away.
- Åñëè âû èñïîëüçóåòå îïöèþ äîêóìåíòà |twoside|, ïàêåòó íóæíî êîíòðîëèðîâàòü íóìåðàöèþ ñòðàíèö,
- ÷òîáû ïîëó÷èòü âåðíî ðàçìåù¸ííûå ïîëÿ.
- Äëÿ ýòîãî íóæíû äâå îáðàáîòêè \LaTeX'îì, à~ïðè ïåðâîé îáðàáîòêå âû ïîëó÷èòå ýòî
- ñîîáùåíèå.
- Ñêîìïèëèðóéòå äîêóìåíò âòîðîé ðàç è ïðåäóïðåæäåíèå èñ÷åçíåò.
- \par\See{\Ref{margins}}
-
-\Message
- |The caption type was already set to `|\meta{type}|'.|
-\Description
-% This warning informs you about mixed caption options. For example if
-% you use a |\caption|\-|setup{type=|\x|table}| or
-% |\caption|\-|of{table}{|\ldots|}| inside a |figure| environment,
-% this would result in using both option sets for that specific caption,
-% the one for |figure| (specified with |\caption|\-|setup[figure]{|\ldots|}|)
-% and the one for |table| (specified with |\caption|\-|setup[table]{|\ldots|}|)
-% as well.\par
-% {\small(You can suppress this warning by using the starred form
-% |\caption|\-|setup*{type=|\x\ldots|}|.)\par}
- Ýòî ïðåäóïðåæäåíèå èíôîðìèðóåò î~ñìåøåíèè îïöèé. Íàïðèìåð,
- âû èñïîëüçóåòå |\captionof{table}{|\ldots|}| âíóòðè îêðóæåíèÿ |figure|,
- ýòî ÿâëÿåòñÿ ðåçóëüòàòîì èñïîëüçîâàíèÿ îáåèõ îïöèé äëÿ ýòîé ñïåöèôè÷åñêîé ïîäïèñè:
- äëÿ |figure| (çàäàííîé ñ~ïîìîùüþ |\captionsetup[figure]{|\ldots|}|)
- è~äëÿ |table| (çàäàííîé ñ~ïîìîùüþ |\captionsetup[table]{|\ldots|}|).\par
- {\small(Âû ìîæåòå îòêëþ÷èòü ýòî ïðåäóïðåæäåíèå, èñïîëüçóÿ çâ¸çäíóþ ôîðìó êîìàíäû
- |\caption|\-|setup*{type=|\x\ldots|}|.)\par}
- \par\See{\Ref{captionsetup}}
-
-\Message
- |The option `hypcap=true' will be ignored for this|\\
- |particular \caption.|
-\Description
-% \Thispackage\ hasn't found a proper hyperlink anchor for this particular
-% caption, so it decides to ignore the setting |hypcap=|\x|true| (which is set by
-% default). As a result a link to this caption (e.g.~in the List of Figures,
-% or set by |\ref| or |\auto|\-|ref|) will link you to the caption of the figure
-% or table, not to the figure or table itself.\par
- \Thispackage\ íå íàø¸ë ïîäõîäÿùåå ìåñòî äëÿ ãèïåðññûëêè äëÿ äàííîé
- ïîäïèñè, ïîýòîìó ïàêåò ðåøàåò èãíîðèðîâàòü íàñòðîéêè |hypcap=|\x|true| (çàäàííûå
- ïî óìîë÷àíèþ). Â~ðåçóëüòàòå ññûëêà íà ýòó ïîäïèñü (íàïðèìåð, â~Ñïèñêå ðèñóíêîâ,
- èëè â~êîìàíäàõ |\ref| èëè |\autoref|) áóäåò ïðèâÿçàíà ê~ïîäïèñè ðèñóíêà èëè òàáëèöû,
- à~íå ê~ñîäåðæèìîìó ðèñóíêà èëè òàáëèöû.\par
-% This can happen if you use |\caption|\-|of| inside a non-floating environment,
-% but also if you use some package which redefines |figure| or |table|, and
-% which is unknown to \thispackage.\par
- Ýòî ìîæåò ïðîèçîéòè åñëè âû èñïîëüçóåòå êîìàíäó |\captionof| â~íåïëàâàþùåì îêðóæåíèè,
- à~òàêæå ïðè èñïîëüçîâàíèè ïàêåòà, ïåðåîïðåäåëÿþùåãî îêðóæåíèÿ |figure| èëè |table|,
- íåèçâåñòíîãî äàííîìó ïàêåòó.\par
-% If this is ok for you but you want to suppress this warning, simply place a
-% |\caption|\-|setup{hyp|\-|cap=|\x|false}| just before the |\caption| or
-% |\caption|\-|of| command which is causing the warning.
- Åñëè âàì ýòî ïîäõîäèò è~âû õîòèòå çàïðåòèòü ýòî ïðåäóïðåæäåíèå, çàäàéòå êîä
- |\caption|\-|setup{hyp|\-|cap=|\x|false}| ïåðåä |\caption| èëè
- |\captionof|, êîòîðûå ïîðîæäàþò ïðåäóïðåæäåíèå.
-% If this is not ok for you, you can set a hyperlink anchor with
-% |\caption|\-|setup{type=|\x\meta{float type}|}| for yourself.
- Åñëè æå ýòî âàñ íå óñòðàèâàåò, âû ìîæåòå ïîïðîáîâàòü çàäàòü ãèïåðññûëêó, ñ~ïîìîùüþ
- |\caption|\-|setup{type=|\x\meta{float type}|}|.
- \par\See{\Ref{hyperref}}
-
-\Message
- |Unsupported document class (or package) detected,|\\
- |usage of the caption package is not recommended.|
-\Description
-% Either the document class you use is unknown to \thispackage, or you
-% have included a package in your document which redefines |\@make|\-|caption|
-% (which is responsible for typesetting the caption internally) as well.
-% This means \thispackage\ will either change the design of captions in an
-% unwanted way, or it even refuses to work correctly at all.
- Ëèáî êëàññ äîêóìåíòà íåèçâåñòåí äàííîìó ïàêåòó, ëèáî âû
- ïîäêëþ÷èëè ïàêåò, êîòîðûé ïåðåîïðåäåëÿåò êîìàíäó |\@makecaption|
- (âíóòðåííÿÿ êîìàíäà, ñîçäàþùàÿ ïîäïèñè).
- Ýòî îçíà÷àåò ÷òî \thispackage\ èçìåíèò îôîðìëåíèå ïîäïèñåé â~íåæåëàòåëüíûì ñïîñîáîì,
- èëè âîîáùå îòêàæåòñÿ ðàáîòàòü.
- \par\See{\Ref{classes} è~\Ref{compatibility}}
-
-\Message
- |Unused \captionsetup[|\meta{type}|].|
-\Description
-% You have specified options with |\caption|\-|setup[|\meta{type}|]| which are
-% not used later on.
-% This can be because of a typo in \meta{type},
-% or because you use a package which redefines |figure| or |table| and
-% which is unknown to \thispackage, or simply because you don't have any usage
-% of the environment \meta{type} after this line.
-% (If you want to suppress this warning you can use |\caption|\-|setup*|
-% instead of |\caption|\-|setup|.)
- Âû îïðåäåëèëè îïöèè |\captionsetup[|\meta{type}|]| êîòîðûå
- ïîçäíåå íå èñïîëüçîâàëèñü.
- Ýòî ìîæåò ïðîèçîéòè èç-çà îïå÷àòêè â~àðãóìåíòå \meta{type},
- èëè ïîòîìó, ÷òî âû èñïîëüçóåòå ïàêåò, êîòîðûé ïåðåîïðåäåëÿåò îêðóæåíèÿ |figure| èëè |table|,
- íåèçâåñòíûé äàííîìó ïàêåòó, èëè ïðîñòî âû íå èñïîëüçîâàëè îêðóæåíèÿ
- \meta{type} ïîñëå çàäàííûõ íàñòðîåê.\par
- (Åñëè âû õîòèòå çàïðåòèòü ýòî ïðåäóïðåæäåíèå, âû ìîæåòå çàäàòü |\captionsetup*| âìåñòî
- |\captionsetup|.)\enlargethispage{\baselineskip}
- \par\See{\Ref{captionsetup}}
-
-\Message
- |Usage of the |\meta{package}| package together with the|\\
- |caption package is strongly not recommended.|\\
- |Instead of loading the |\meta{package}| package you should|\\
- |use the caption package option `tableposition=top'.|
-\Description
-% The package \meta{package} is dealing with caption skips as well.
-% Please decide which one do you actually want to use, \thispackage\ or the
-% other one, using both can lead to wrong skips above or below the caption.
- Ïàêåò \meta{package} èçìåíÿåò îòáèâêè âîêðóã ïîäïèñè.
- Ðåøèòå, ÷åé èíòåðôåéñ âû ïðåäïî÷ò¸òå: \thispackage\ èëè
- äðóãîé ïàêåò, èñïîëüçîâàíèå îáîèõ ìîæåò çàäàòü íåâåðíûå îòáèâêè âîêðóã ïîäïèñè.
- \par\See{\Ref{skips}}
-
-\end{Warnings}
-
-\pagebreak[3]
-%^^A\subsection{Errors}
-\subsection{Ñîîáùåíèÿ îá îøèáêàõ}
-
-\begin{Warnings}
-
-\Message
- |Argument of \@caption has an extra }.|
-\Or
- |Paragraph ended before \@caption was complete.|
-\Description
-% If you want to typeset something special (like a tabular) as caption,
-% you need to give an optional argument to |\caption| resp.~|\caption|\-|of|
-% for the List of Figures resp.~List of Tables, too, even if you don't
-% use such list.
- Åñëè âû õîòèòå ñîçäàòü ÷òî-òî íåîáû÷íîå (íàïðèìåð òàáëèöó) âíóòðè ïîäïèñè,
- âû äîëæíû çàäàòü äîïîëíèòåëüíûé àðãóìåíò äëÿ êîìàíäû |\caption| èëè |\captionof|,
- ÷òîáû ïîìåñòèòü òåêñò â~Ñïèñîê ðèñóíêîâ èëè òàáëèö, äàæå åñëè âû íå èñïîëüçóåòå
- òàêîé ñïèñîê.
- \par\See{\Ref{caption}, \Ref{lists}, è~\Ref{hyperref}\,}
-
-\Message
- |\caption outside float.|
-\Description
-% You have placed a |\caption| command outside a floating environment, or
-% a |long|\-|table| or |wrap|\-|figure|.
-% If this is what you want to, please use either
-% |\caption|\-|setup{type=|\x\meta{type}|}| $+$ |\caption| or
-% |\caption|\-|of|.
- Âû ïîìåñòèëè êîìàíäó |\caption| çà ïðåäåëàìè îêðóæåíèÿ ôëîòà èëè
- |longtable|. Åñëè âû äåëàåòå ýòî ñîçíàòåëüíî, çàäàéòå
- |\captionsetup{|\x|type=|\x\meta{type}|}| $+$ |\caption| èëè |\captionof|.
- \par\See{\Ref{caption}}
-
-\Message
- |\ContinuedFloat outside float.|
-\Description
-% You have placed a |\Continued|\-|Float| command outside a floating
-% environment. % or |long|\-|table|.
- Âû ïîìåñòèëè êîìàíäó |\ContinuedFloat| âíå îêðóæåíèÿ ôëîòà.
-% If this is what you want to, please use the combination
-% |\caption|\-|setup{type=|\x\meta{type}|}| $+$ |\Continued|\-|Float|.\par
- Åñëè âû ýòî ñäåëàëè ñîçíàòåëüíî, èñïîëüçóéòå êîìáèíàöèþ
- |\captionsetup{|\x|type=|\x\meta{type}|}| $+$ |\ContinuedFloat|.\par
-% Please note that |\Continued|\-|Float| inside a |long|\-|table| is not
-% working, but maybe using the |long|\-|table*| environment, which
-% typesets a |long|\-|table| without incrementing the |table| counter,
-% if sufficient for you.
- Îáðàòèòå âíèìàíèå, ÷òî èñïîëüçîâàíèå |\ContinuedFloat| âíóòðè |longtable| (ïîêà) íå ðàáîòàåò,
- íî, âîçìîæíî èñïîëüçîâàíèå îêðóæåíèÿ |longtable*|, êîòîðîå ñîçäà¸ò |longtable|
- áåç óâåëè÷åíèÿ íóìåðàöèè |table|, ðåøèò âàøè ïðîáëåìû.
- \par\See{\Ref{ContinuedFloat} è~\Ref{longtable}}
-
-\Message
- |Continued `|\meta{type}|' after `|\meta{type}|'.|
-\Description
-% Continued figures or tables are not allowed to be interrupted by a floating
-% environment (or |long|\-|table|) of another type,
-% e.g.~a table between a figure and a continued figure.
- Ïðîäîëæàþùèåñÿ ðèñóíêè èëè òàáëèöû íå äîëæíû ïðåðûâàòüñÿ
- îêðóæåíèåì äðóãîãî òèïà (èëè îêðóæåíèåì |long|\-|table|),
- íàïðèìåð òàáëèöà ìåæäó ðèñóíêîì è~åãî ïðîäîëæåíèåì.
- \par\See{\Ref{ContinuedFloat}}
-
-\Message
- |For a successful cooperation of the `wrapfig' package|\\
- |with the `float' package you should load the `wrapfig'|\\
- |package *(right) after* the `float' package.|
-\Description
-% Please take care of the load order of packages
-% if you use the \package{wrapfig} package in cooperation with the
-% \package{float} package.
- Áóäüòå âíèìàòåëüíû ñ~ïîðÿäêîì çàãðóçêè ïàêåòîâ, åñëè âû èñïîëüçóåòå
- ïàêåò \package{wrapfig} ñîâìåñòíî ñ~ïàêåòîì
- \package{float}.
- \par\See{\Ref{wrapfig}}
-
-\Message
- |For a successful cooperation of the `wrapfig' package|\\
- |with the `float' package you should use at least|\\
- |`wrapfig' version 3.6.|
-\Description
-% Please take care of the version of the \package{wrapfig} package
-% if you use the \package{wrapfig} package in cooperation with the
-% \package{float} package.
- Îáðàòèòå âíèìàíèå íà âåðñèþ ïàêåòà \package{wrapfig}, êîòîðóþ âû èñïîëüçóåòå,
- åñëè âû èñïîëüçóåòå ýòîò ïàêåò âìåñòå ñ~ïàêåòîì
- \package{float}.
- \par\See{\Ref{wrapfig}}
-
-\Message
- |For a successful cooperation we need at least version|\\
- |`|\meta{date}|' of package |\meta{package}|, but only version|\\
- |`|\meta{old-date}|' is available.|
-\Description
-% \Thispackage\ does not work with such an outdated package, please update it
-% to a more recent version, at least to the one requested.
- \Thispackage\ íå ðàáîòàåò ñ~äàííîé âåðñèåé ïàêåòà, îáíîâèòå åãî,
- êàê ìèíèìóì äî òðåáóåìîé âåðñèè.
-
-\Message
- |Internal Error: |\meta{error message}|.|
-\Description
-% You should never see this error.
-% Please send me an e-mail reporting this issue.
- Âû íå äîëæíû ïîëó÷àòü òàêîå ñîîáùåíèå.
- Ïîæàëóéñòà, ïðèøëèòå e-mail ñ~îáðàçöîì, äàþùèì ýòî ñîîáùåíèå.
-
-\Message
- |No float type '|\meta{type}|' defined.|
-\Description
-% The \meta{type} you have specified in |\caption|\-|setup{type=|\x\meta{type}|}|,
-% |\caption|\-|of|\marg{type}, or |\Declare|\-|Caption|\-|Sub|\-|Type| is
-% not defined.
-% \meta{type} should be either `\texttt{figure}' or `\texttt{table}', or
-% any other floating environment defined with |\Declare|\-|Caption|\-|Type|,
-% |\new|\-|float| offered by the \package{float} package\cite{float},
-% or |\Declare|\-|New|\-|Float|\-|Type| offered by the \package{floatrow}
-% package\cite{floatrow}.
- Òèï ôëîòà \meta{type}, êîòîðûé âû âûáðàëè â~êîìàíäàõ |\captionsetup|\x|{type=|\x\meta{type}|}|,
- |\captionof|\x\marg{type} èëè |\Declare|\-|Caption|\-|SubType| íå îïðåäåë¸í.
- Ôëîò \meta{type} äîëæåí áûòü ëèáî `\texttt{figure}' èëè `\texttt{table}', èëè
- ëþáîå äðóãîå îêðóæåíèå îïðåäåë¸ííîå ñ~ïîìîùüþ êîìàíäû |\Declare|\-|Caption|\-|Type|,
- |\newfloat|, ïðåäëàãàåìîé ïàêåòîì \package{float}\cite{float},
- èëè |\Declare|\-|NewFloat|\-|Type| ïðåäëàãàåìîé ïàêåòîì \package{floatrow}\cite{floatrow}.
-
-\Message
- |Not allowed in longtable* environment.|
-\Description
-% The usage of |\caption| is not allowed inside the |long|\-|table*| environment.
-% Please use either |\caption*| for a caption without label or use the regular
-% |long|\-|table| environment instead.
- Èñïîëüçîâàíèå êîìàíäû |\caption| íåâîçìîæíî âíóòðè îêðóæåíèÿ |long|\-|table*|.
- Ëèáî èñïîëüçóéòå êîìàíäó |\caption*| äëÿ ñîçäàíèÿ ïîäïèñè, ëèáî çàìåíèòå îêðóæåíèå íà
- |longtable|.
-
-\Message
- |Not available in compatibility mode.|
-\Description
-% The feature required is not supported in compatibility mode.
-% `compatibility mode' means that \thispackage\ has detected either an
-% incompatible document class or an incompatible package which also
-% extents the |\caption| command. Leaving the original extension intact,
-% some features of \thispackage\ are not supported.
- Òðåáóåìàÿ íàñòðîéêà íå ïîääåðæèâàåòñÿ â~ðåæèìå ñîâìåñòèìîñòè.
- Òåðìèí `compatibility mode' («ðåæèì ñîâìåñòèìîñòè») îçíà÷àåò, ÷òî \thispackage\ îáíàðóæèë
- íåñîâìåñòèìûé êëàññ äîêóìåíòà èëè ïàêåò, êîòîðûé ìîäèôèöèðóåò
- êîìàíäó |\caption|. Îñòàâèâ îðèãèíàëüíûå íàñòðîéêè íåòðîíóòûìè,
- \thispackage\ îòìåíÿåò íåêîòîðûå ñâîè íàñòðîéêè.
- \par\See{\Ref{compatibility}}
-
-\Message
- |Only one \caption can be placed in this environment.|
-\Description
-% Inside the environments offered by the \package{fltpage} and \package{sidecap}
-% package only \emph{one} caption can be placed. (This is due implementation design.)
- Âíóòðè îêðóæåíèé, ïðåäëàãàåìûõ ïàêåòàìè \package{fltpage} è~\package{sidecap}
- ìîæíî ïîìåñòèòü òîëüêî îäíó ïîäïèñü. (Ýòî òðåáîâàíèÿ îôîðìëåíèÿ.)
-
-\Message
- |Option clash for package caption.|
-%\Or[but sometimes also]
-\Or[íî èíîãäà òàêæå]
- |Missing \begin{document}.|
-\Description
-% \Thispackage\ has already been loaded by some other \LaTeX\ package,
-% so you can't do that again specifying different options.
-% A candidate causing this could be the \package{subfig} package; if this is
-% the case, please load \thispackage\ \emph{before} the \package{subfig}
-% package or specify the option |caption=|\x|false| while loading the
-% \package{subfig} package.
-% \par\See{the \package{subfig} package\cite{subfig} documentation}
- \Thispackage\ óæå çàãðóæåí äðóãèì ïàêåòîì \LaTeX'à,
- è~íåëüçÿ çàãðóæàòü ïàêåò ïîâòîðíî, çàäàâ äðóãèå îïöèè.
- Ïåðâîé ïðè÷èíîé âûçâàâøåé òàêîå ñîîáùåíèå ìîæåò áûòü ïàêåò \package{subfig};
- è~åñëè ýòî òàê,
- çàãðóçèòå \thispackage\ \emph{äî} ïàêåòà \package{subfig}
- èëè îïðåäåëèòå |caption=|\x|false| ïðè çàãðóçêå
- \package{subfig}.
- \par\See{äîêóìåíòàöèþ ïàêåòà \package{subfig}\cite{subfig}}
-
-\Message
- |Paragraph ended before \caption@makecurrent was complete.|
-\Or
- |Paragraph ended before \caption@prepareanchor was complete.|
-\Description
-% If you want to typeset multi-paragraph captions, you need to give an
-% optional argument to |\caption| resp.~|\caption|\-|of| for the List of
-% Figures resp.~List of Tables, too, even if you don't use such list.
-% \par\See{\Ref{caption}, \Ref{lists}, and \Ref{hyperref}\,}
- Åñëè âàì íóæíî ñîçäàòü ïîäïèñü èç íåñêîëüêèõ àáçàöåâ, âû äîëæíû ñîçäàòü
- äîïîëíèòåëüíûé àðãóìåíò â~êîìàíäàõ |\caption| èëè~|\captionof| äëÿ Ñïèñêà ðèñóíêîâ èëè
- Ñïèñêà òàáëèöû, äàæå åñëè âû íå èñïîëüçóåòå ýòè ñïèñêè.
- \par\See{\Ref{caption}, \Ref{lists}, è~\Ref{hyperref}\,}
-
-\iffalse % was removed in v3.1b
-\Message
- |Something is going wrong here...|\\
- |For a removal of this problem please consult the|\\
- |caption package documentation, especially the sections|\\
- |about the `float' and the `wrapfig' package.|
-\Description
-% Please take care of the load order of packages
-% if you use the \package{wrapfig} package in cooperation with the
-% \package{float} package. But maybe a different package tried to extent
-% the \package{float} package in a manner which is incompatible to
-% \thispackage!?
-% \par\See{\Ref{float} and \Ref{wrapfig}}
- Îáðàòèòå âíèìàíèå íà ïîðÿäîê çàãðóæåííûõ ïàêåòîâ,
- åñëè âû èñïîëüçóåòå ïàêåò \package{wrapfig} âìåñòå ñ~ïàêåòîì
- \package{float}. Íî âîçìîæíî êàêîé"=òî äðóãîé ïàêåò ïûòàåòñÿ ðàñøèðèòü íàñòðîéêè ïàêåòà
- \package{float} íåèçâåñòíûì ïàêåòó \package{caption} ñïîñîáîì!?
- \par\See{\Ref{float} è~\Ref{wrapfig}}
-\fi
-
-\Message
- |Something's wrong--perhaps a missing \caption|\\
- |in the last figure or table.|
-\Description
-% It seems that you have used a |\sub|\-|caption| command (or a different one
-% which has typeset a sub-caption) without a corresponding |\caption| command.
-% This is not supported.
- Âîçìîæíî âû èñïîëüçîâàëè êîìàíäó |\sub|\-|caption| (èëè äðóãóþ êîìàíäó, ñîçäàþùóþ
- ïîäïèñü ÷àñòè ðèñóíêà) áåç ñîîòâåòñòâóþùåé êîìàíäû |\caption|.
- Ýòî íå ïîääåðæèâàåòñÿ.
-
-\Message
- |The option `labelsep=|\meta{name}|' does not work|\\
- |with `format=hang'.|
-\Or
- |The option `labelsep=|\meta{name}|' does not work|\\
- |with \setcaphanging (which is set by default).|
-\Description
-% A caption label separator which contains a |\\| command (like
-% |labelsep=|\x|newline|) can not be combined with a hanging caption format
-% (like |format=|\x|hang|).
-% Please select either another caption label separator
-% (e.g.~|labelsep=|\x|colon|) or another caption format
-% (e.g.~|format=|\x|plain|).
-% \par\See{\Ref{formats} resp.~\Ref{KOMA}}
- Ðàçäåëèòåëü íóìåðàöèîííîãî çàãîëîâêà è~òåêñòà ïîäïèñè, çàäàííûé êàê êîìàíäà |\\| (ò.\,å.
- |labelsep=|\x|newline|) íå ìîæåò áûòü ñêîìáèíèðîâàí ñ~ôîðìàòîì ñîçäàþùèì ñòðîêó íà âåñó
- (like |format=|\x|hang|).
- Çàäàéòå ëèáî äðóãîé ðàçäåëèòåëü
- (íàïðèìåð~|labelsep=|\x|colon|) ëèáî äðóãîé ôîðìàò ïîäïèñè
- (e.g.~|format=|\x|plain|).
- \par\See{\Ref{formats} èëè~\Ref{KOMA}}
-
-\Message
- |The package option `caption=false' is obsolete.|\\
- |Please pass this option to the subfig package instead|\\
- |and do *not* load the caption package anymore.|
-\Description
-% You have specified the option |caption=|\x|false|. This used to be a workaround
-% for not using the whole \package{caption} package (leaving the caption stuff
-% offered by the document class or other packages intact), but keeping the
-% \package{subfig} package working. This mechanism is obsolete and not offered
-% anymore, please pass this option to the \package{subfig} package instead and
-% do not load \thispackage\ anymore.
-% \par\See{the \package{subfig} package\cite{subfig} documentation}
- Âû çàäàëè îïöèþ |caption=|\x|false|. Ýòî èñïîëüçóåòñÿ äëÿ òîãî,
- ÷òîáû íå èñïîëüçîâàòü ïàêåò \package{caption} öåëèêîì (îñòàâèâ èçìåíåíèÿ êîìàíä
- ïîäïèñåé, ñäåëàííûå êëàññîì äîêóìåíòà èëè äðóãèì ïàêåòîì íåòðîíóòûìè), íî ïîçâîëÿåò ðàáîòàòü
- ïàêåòó \package{subfig}. Ýòîò ìåõàíèçì óñòàðåâøèé è~áîëåå íå ïîääåðæèâàåòñÿ,
- ïîýòîìó èñïîëüçóéòå ýòó îïöèþ ïðè çàãðóçêå ïàêåòà \package{subfig} è~íå çàãðóæàéòå
- \thispackage\ âîâñå.
- \par\See{äîêóìåíòàöèþ ïàêåòà \package{subfig}\cite{subfig}}
-
-\Message
- |Undefined boolean value `|\meta{value}|'.|
-\Description
-% You tried to set a boolean option (like |singlelinecheck=| or |hypcap=|)
-% with an improper value. Only |false|, |no|, |off|, |0| or |true|, |yes|,
-% |on|, |1| is allowed here.
- Âû ïûòàëèñü çàäàòü áóëåâ êëþ÷ (íàïðèìåð, |singlelinecheck=| èëè |hypcap=|)
- ñ~íåâåðíîé îïöèåé. Òîëüêî |false|, |no|, |off|, |0| èëè |true|, |yes|,
- |on|, |1| äîïóñêàþòñÿ â~îïöèÿõ ýòèõ êëþ÷åé.
-
-\Message
- |Undefined format `|\meta{name}|'.|
-\Description
-% You tried to set a caption format which does not exists.
-% Maybe a typo!?
- Âû ïûòàåòåñü çàäàòü ôîðìàò ïîäïèñè, êîòîðûé íå ñóùåñòâóåò.
- Ìîæåò áûòü ýòî îïå÷àòêà!?
- \par\See{\Ref{formats}}
-
-\Message
- |Undefined label format `|\meta{name}|'.|
-\Description
-% You tried to set a caption label format which does not exists.
-% Maybe a typo!?
- Âû ïûòàåòåñü çàãðóçèòü ôîðìàò ìåòêè, êîòîðûé íå ñóùåñòâóåò.
- Ìîæåò áûòü ýòî îïå÷àòêà!?
- \par\See{\Ref{formats}}
-
-\Message
- |Undefined label separator `|\meta{name}|'.|
-\Description
-% You tried to set a caption label separator which does not exists.
-% Maybe a typo!?
- Âû ïûòàåòåñü çàäàòü ðàçäåëèòåëü, êîòîðûé íå ñóùåñòâóåò.
- Ìîæåò áûòü ýòî îïå÷àòêà!?
- \par\See{\Ref{formats}}
-
-\Message
- |Undefined list format `|\meta{name}|'.|
-\Description
-% You tried to set a caption list-of format which does not exists.
-% Maybe a typo!?
- Âû ïûòàåòåñü çàäàòü ôîðìàò âûâîäà äëÿ Ñïèñêà ôëîòîâ, êîòîðûé íå ñóùåñòâóåò.
- Ìîæåò áûòü ýòî îïå÷àòêà!?
- \par\See{\Ref{lists}}
-
-\Message
- |Undefined position `|\meta{name}|'.|
-\Description
-% You tried to set a caption position with an improper value.
-% Maybe a typo!?
- Âû ïûòàåòåñü çàäàòü îïöèþ ðàñïîëîæåíèÿ ïîäïèñè, êîòîðàÿ íå ñóùåñòâóåò.
- Ìîæåò áûòü ýòî îïå÷àòêà!?
- \par\See{\Ref{skips}}
-
-\Message
- |Undefined style `|\meta{name}|'.|
-\Description
-% You tried to set a caption style which does not exists.
-% Maybe a typo!?
- Âû ïûòàåòåñü çàäàòü ñòèëü ïîäïèñè, êîòîðûé íå ñóùåñòâóåò.
- Ìîæåò áûòü ýòî îïå÷àòêà!?
- \par\See{\Ref{style}}
-
-\Message
- |Usage of the `position' option is incompatible|\\
- |to the `|\meta{package}|' package.|
-\Description
-% % (ftcap,nonfloat,topcapt)
-% The given package is dealing with caption skips as well.
-% Please decide which one do you actually want to use: The |position=| option
-% of \thispackage\ or the mechanism of the other one; using both this way
-% would lead to wrong skips above or below the caption and is therefore
-% not supported.
- Äàííûé ïàêåò èçìåíÿåò îòáèâêè âîêðóã ïîäïèñè.
- Ðåøèòå, êàêèì ïàêåòîì ÷òî âû ñîáèðàåòåñü èñïîëüçîâàòü: êëþ÷ |position=|
- ïàêåòà \package{caption} èëè ìåõàíèçì äðóãîãî ïàêåòà; èñïîëüçîâàíèå îáîèõ ïàêåòîâ
- ìîæåò ïîðîäèòü íåâåðíûå îòáèâêè ñâåðõó èëè ñíèçó ïîäïèñè è~ñîîòâåòñòâåííî íå ïîääåæðèâàåòñÿ.
- \par\See{\Ref{skips}}
-
-\Message
- |Undefined text format `|\meta{name}|'.|
-\Description
-% You tried to set a caption text format which does not exists.
-% Maybe a typo!?
- Âû ïûòàåòåñü çàäàòü ôîðìàò òåêñòà ïîäïèñè, êîòîðûé íå ñóùåñòâóåò.
- Ìîæåò áûòü ýòî îïå÷àòêà!?
- \par\See{\Ref{formats}}
-
-\Message
- |You can't use both, the (obsolete) caption2 *and*|\\
- |the (current) caption package.|
-\Description
-% This error message says it all, you simply can't do that.
-% Please use only \thispackage.
- Ýòî ñîîáùåíèå îá îøèáêå ñêàçàëî óæå âñ¸, è~âàì ïðîñòî íåëüçÿ ýòî äåëàòü
- [èñïîëüçîâàòü ïàêåòû \package{caption} è~\package{caption}2].
- Èñïîëüçóéòå òîëüêî \thispackage.
- \par\See{\Ref{caption2}}
-
-
-\end{Warnings}
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-% \section{Version history}
-\section{Èñòîðèÿ ñîçäàíèÿ âåðñèé}
-\label{history}
-
-% The version $1.0$ was written in 1994 and was offering a handful of options
-% to customize the look \& feel of the captions.
-% Furthermore this version already supported the \package{rotating} and
-% \package{subfigure} packages.
-% Version $1.1$ introduced the |center|\-|last| option;
-% version $1.2$ added the support of the \package{float} package.
-% Version $1,3$ offered a better support of the \package{subfigure} package,
-% while version $1.4$ came with the new option |nooneline|.
-Âåðñèÿ $1.0$ áûëà íàïèñàíà â~1994~ãîäó è~ïðåäëàãàëà ìíîæåñòâî îïöèé
-äëÿ íàñòðîéêè âûâîäà ïîäïèñåé. Êðîìå òîãî ýòà âåðñèÿ óæå ïîääåðæèâàëà ïàêåòû
-\package{rotating} è~\package{subfigure}.
-Âåðñèÿ $1.1$ ïðåäëîæèëà îïöèþ |center|\-|last|;
-âåðñèÿ $1.2$ äîáàâèëà
-ïîääåðæêó ïàêåòà \package{float}.
-Âåðñèÿ $1.3$ ïðåäëîæèëà óëó÷øåííóþ ïîääåðæêó ïàêåòà \package{subfigure},
-òîãäà êàê âåðñèÿ $1.4$ âûøëà ñ~ïîääåðæêîé îïöèè |nooneline|.
-
-% The \package{caption2} package $2.0$ was an experimental side-version of
-% the regular \package{caption} package. It was made public as beta test version
-% without proper documentation in 1995 because of the strong demand for new
-% features and adaptations to additional packages like the \package{longtable}
-% package.
-% Furthermore it offered a revised support of the \package{subfigure} package.
-% (A version $2.1$ was offered as bugfix-release in 2002.)
-Ïàêåò \package{caption2} âåðñèè $2.0$ áûë ýêñïåðèìåíòàëüíîé ïîáî÷íîé âåðñèåé
-îñíîâíîãî ïàêåòà \package{caption}. Îí áûë îïóáëèêîâàí êàê áåòà-òåñò-âåðñèÿ
-áåç ñîîòâåòñòâóþùåé äîêóìåíòàöèè â~1995~ãîäó, òàê êàê óæå íàçðåëà íåîáõîäèìîñòü
-â~íîâûõ íàñòðîéêàõ äëÿ äðóãèõ ïàêåòîâ, íàïðèìåð äëÿ \package{longtable}.
-Ïîìèìî ýòîãî áûëà ïðåäëîæåíà ïîääåðæêà ïàêåòà \package{subfigure}.
-(Â~âåðñèè $2.1$, íàïèñàííîé â~2002~ãîäó áûëè èñïðàâëåíèÿ îøèáîê.)
-
-% In 2003 I finally found some time, so a new regular release $3.0$
-% of the \package{caption} package could be build in cooperation with
-% Frank Mittelbach and Steven Cochran.
-% It was released in December 2003 and superseded the neglected
-% \package{caption2} package.
-% Main parts were re-written and it provided a complete re-work of
-% the user interface.
-% Furthermore it supported the \package{hyperref}, \package{hypcap},
-% \package{listings}, \package{sidecap}, and \package{supertabular} packages
-% additionally.
-Â~2003~ãîäó ÿ âñ¸-òàêè íàø¸ë íåìíîãî âðåìåíè, äëÿ íîâîãî ðåëèçà $3.0$
-ïàêåòà \package{caption}, ñîçäàííîãî ñîâìåñòíî
-ñ~Ôðàíêîì Ìèòòåëüáàõîì (Frank Mittelbach) è~Ñòèâåíîì Êîêðåéíîì (Steven Cochran).
-Ýòà âåðñèÿ áûëà îïóáëèêîâàíà â~äåêàáðå 2003~ãîäà è~ñòàëà çàìåíîé
-ïàêåòà \package{caption2}.
-Îñíîâíûå ÷àñòè áûëè ïåðåïèñàíû, è~áûë ïðåäëîæåí íîâûé ïîëüçîâàòåëüñêèé èíòåðôåéñ.
-Ïîìèìî ýòîãî ïîÿâèëàñü ïîääåðæêà äðóãèõ ïàêåòîâ \package{hyperref}, \package{hypcap},
-\package{listings}, \package{sidecap} è~\package{supertabular}.
-
-% While all the previous versions were designed for usage with the standard
-% \LaTeX\ document classes \class{article}, \class{report}, and \class{book},
-% the current version $3.1$ released in 2007 also supports the \AmS,
-% \KOMAScript, \NTG, and \SmF\ document classes, and the \class{beamer} class
-% as well.
-Â~òî âðåìÿ êàê ïðåäûäóùèå âåðñèè áûëè ñîçäàíû äëÿ ñòàíäàðòíûõ êëàññîâ
-\LaTeX'à: \class{article}, \class{report} è~\class{book},
-òåêóùàÿ âåðñèÿ $3.1$, îïóáëèêîâàííàÿ â~2007~ãîäó ïðåäëàãàåò òàêæå ïîääåðæêó äëÿ ïàêåòîâ \AmS,
-\KOMAScript, {\NTG} è~\SmF, à~òàêæå êëàññà \class{beamer}.
-% Furthermore it was adapted to the \package{frenchb} Babel option,
-% the \package{frenchle} \& \package{frenchpro} packages,
-% and the \package{floatflt}, \package{fltpage}, \package{picinpar},
-% \package{picins}, \package{setspace}, \package{threeparttable},
-% and \package{wrapfig} packages.
-Ïîìèìî ýòîãî ñîçäàíà ïîääåðæêà ê~îïöèè \package{frenchb} ïàêåòà \package{babel},
-ïàêåòàì \package{frenchle} è~\package{frenchpro},
-à~òàêæå ïàêåòàì \package{floatflt}, \package{fltpage}, \package{picinpar},
-\package{picins}, \package{setspace}, \package{threeparttable}
-è~\package{wrapfig}.
-% New options and commands were introduced as well, among other things
-% |font+|, |figure|\-|within| \& |table|\-|within|,
-% |list| \& |list|\-|format|, |max|\-|margin| \& |min|\-|margin|,
-% |\caption|\-|list|\-|entry|, |\Declare|\-|Caption|\-|List|\-|Format|, and
-% |\Declare|\-|Caption|\-|Type|.
-Áûëè ïðåäëîæåíû íîâûå êîìàíäû è~êëþ÷è, íàïðèìåð ïîìèìî ïðî÷åãî
-|font+|, |figure|\-|within| è~|table|\-|within|,
-|list| è~|list|\-|format|, |max|\-|margin| è~|min|\-|margin|,
-|\caption|\-|list|\-|entry|, |\Declare|\-|Caption|\-|List|\-|Format| è~%
-|\Declare|\-|Caption|\-|Type|.
-% Further benefits are the new compatibility check \see*{\Ref{compatibility}},
-% the new ``hypcap'' feature \see*{\Ref{hyperref}\,}, and the sub-caption
-% feature \see*{\package{subcaption} package documentation}.
-Â~äàëüíåéøåì áûëè äîáàâëåíû êîíòðîëü ñîâìåñòèìîñòè ñ~êëàññàìè è~ïàêåòàìè
-\see*{\Ref{compatibility}},
-ïîääåðæêà îïöèè |hypcap| \see*{\Ref{hyperref}}
-è~âîçìîæíîñòè ñîçäàíèÿ ïîäïèñåé ÷àñòåé ôëîòîâ
-\see*{äîêóìåíòàöèþ ê~ïàêåòó \package{subcaption}}.
-
-\clearpage
-% \section{Compatibility to older versions}
-\section{Ñîâìåñòèìîñòü ñî ñòàðûìè âåðñèÿìè}
-
-\subsection{Ïàêåò \package{caption} v\texorpdfstring{$1.x$}{1.x}}
-\label{caption1}
-
-% This version of \thispackage\ still supports the old options
-% and commands provided by the version $1.0$ to $1.4$ of this package.
-% So there shouldn't occur any problems compiling old documents, but please
-% don't mix old options and commands with the new ones. This isn't supported
-% and can cause ugly side effects.
-Äàííàÿ âåðñèÿ ïàêåòà ïîääåðæèâàåò ñòàðûå îïöèè è~êîìàíäû
-ñîçäàííûå â~âåðñèÿõ $1.0$--$1.4$ ýòîãî ïàêåòà. Ïîýòîìó íå äîëæíî âîçíèêàòü
-ïðîáëåì â~êîìïèëÿöèè ñòàðûõ äîêóìåíòîâ, íî, ïîæàëóéñòà, íå ñìåøèâàéòå
-ñòàðûå îïöèè è~êîìàíäû ñ~íîâûìè. Ýòî íå ïîääåðæèâàåòñÿ
-è~ìîæåò äàòü íåïðèÿòíûå ïîáî÷íûå ýôôåêòû.
-
-% Here comes a short oversight of the obsolete options and how
-% they have been replaced within this version of \thispackage:
-Çäåñü äàí êðàòêèé îáçîð óñòàðåâøèõ îïöèé è~êîìàíä è~÷åì
-îíè çàìåíåíû â~ñîâðåìåííîé âåðñèè ïàêåòà \package{caption}:
-
-\begin{center}\small
-\begin{tabular}{ll}
-\package{caption} \version{1.x} & \package{caption} \version{3.x}\\
-\hline
-%\endhead
-|normal| & |format=plain|\\
-|hang| & |format=hang|\\
-|isu| & |format=hang|\\
-|center| & |justification=centering|\\
-|centerlast| & |justification=centerlast|\\
-|nooneline| & |singlelinecheck=off|\\
-|scriptsize| & |font=scriptsize|\\
-|footnotesize| & |font=footnotesize|\\
-|small| & |font=small|\\
-|normalsize| & |font=normalsize|\\
-|large| & |font=large|\\
-|Large| & |font=Large|\\
-|up| & |labelfont=up|\\
-|it| & |labelfont=it|\\
-|sl| & |labelfont=sl|\\
-|sc| & |labelfont=sc|\\
-|md| & |labelfont=md|\\
-|bf| & |labelfont=bf|\\
-|rm| & |labelfont=rm|\\
-|sf| & |labelfont=sf|\\
-|tt| & |labelfont=tt|\\
-\end{tabular}
-\end{center}
-
-% Beside the options for setting up the desired font there were also
-% the commands |\caption|\-|size| resp.~|\caption|\-|font| and
-% |\caption|\-|label|\-|font| who could be redefined with
-% |\re|\-|new|\-|command| and allowed an alternate and more flexible way to
-% change the font used for captions.
-% This mechanism was replaced by the commands
-Ïîìèìî îïöèé äëÿ íàñòðîåê íóæíîãî øðèôòà áûëè òàêæå êîìàíäû
-|\caption|\-|size|, à~òàêæå |\caption|\-|font| è~|\caption|\-|label|\-|font|
-êîòîðûå ìîãëè áûòü ïåðåîïðåäåëåíû ñ~ïîìîùüþ |\renewcommand| è~ïîçâîëÿëè
-àëüòåðíàòèâíûé è~áîëåå ãèáêèé ñïîñîá èçìåíèòü øðèôò ïîäïèñåé.
-Äàííûé ìåõàíèçì çàìåí¸í íà êîìàíäû
-\begin{quote}
- |\DeclareCaptionFont{|\ldots|}{|\ldots|}|\qquad è\\
- |\captionsetup{font=|\ldots|,labelfont=|\ldots|}|\qquad.
-\end{quote}
-\SeeUserDefined
-
-% Setting the margin for captions was done in \version{1.x} with
-Óñòàíîâêè ïîëåé â~âåðñèè \version{1.x} çàäàâàëèñü ñ~ïîìîùüþ
-\begin{quote}
- |\setlength{\captionmargin}{|\ldots|}|\quad.
-\end{quote}
-% This was replaced by
-Ýòî çàìåíåíî íà
-\begin{quote}
- |\captionsetup{margin=|\ldots|}|\qquad.
-\end{quote}
-\See{\Ref{margins}}
-
-% For example the old-style code
-Íàïðèìåð, ñòàðûé êîä
-\begin{quote}
- |\usepackage[hang,bf]{caption}|\\
- |\renewcommand\captionfont{\small\sffamily}|\\
- |\setlength\captionmargin{10pt}|
-\end{quote}
-% will still work fine, but should be written today as
-äî ñèõ ïîð ðàáîòàåò, íî ëó÷øå ïåðåïèñàòü åãî êàê
-\begin{quote}
- |\usepackage[format=hang,labelfont=bf,font={small,sf},|\\
- | margin=10pt]{caption}|
-\end{quote}
-% or
-èëè
-\begin{quote}
- |\usepackage{caption}|\\
- |\captionsetup{format=hang,labelfont=bf,font={small,sf},|\\
- | margin=10pt}|\qquad.
-\end{quote}
-
-% The quite exotic option |ruled| which allowed a partial usage of
-% the caption settings for |ruled| floats defined with the
-% \package{float} package will be emulated by this version of the
-% caption package, too.
-% But using this option is not recommended anymore since this
-% version of \thispackage\ offers a more flexible way
-% for changing the captions of these floating environments:
-Òàêàÿ ýêçîòè÷åñêàÿ îïöèÿ |ruled|, êîòîðàÿ ïîçâîëÿëà ÷àñòè÷íî èñïîëüçîâàòü
-íàñòðîéêè ïîäïèñè äëÿ ôëîòîâ ñ~îôîðìëåíèåì |ruled| èç ïàêåòà
-\package{float}, ýìóëèðóåòñÿ è~äàííûì ïàêåòîì òîæå.
-Íî èñïîëüçîâàíèå ýòîé îïöèè íå ðåêîìåíäóåòñÿ, ïîñêîëüêó äàííàÿ âåðñèÿ ïàêåòà
-ïðåäëàãàåò áîëåå ãèáêèé ñïîñîá äëÿ èçìåíåíèÿ ïîäïèñåé
-òàêèõ îêðóæåíèé ïëàâàþùèõ ôëîòîâ:
-\begin{quote}
- |\DeclareCaptionStyle{ruled}{|\ldots|}|
-\end{quote}
-% resp.
-è, ñîîòâåòñòâåííî
-\begin{quote}
- |\captionsetup[ruled]{|\ldots|}|\qquad.
-\end{quote}
-\SeeUserDefined[, \Ref{captionsetup}, è~\Ref{float}]
-
-\subsection{Ïàêåò caption2 v\texorpdfstring{$2.x$}{2.x}}
-\label{caption2}
-
-% Although they do very similar stuff, the packages \package{caption} and
-% its experimental and now obsolete variant \package{caption2} have a
-% very different implementation design.
-% Therefore a full compatibility could not be offered.
-% For that reason you will still find a file called |caption2.sty| in
-% this package distribution, so old documents using the \package{caption2}
-% package will still compile fine.
-Õîòÿ èñïîëüçóþòñÿ îäíè è~òå æå íàñòðîéêè è~â~ïàêåòå \package{caption}
-è~â~ýêñïåðèìåíòàëüíîé, íî ñåé÷àñ óñòàðåâøåé âåðñèè"=ïàêåòå
-\package{caption2}, ó~ýòèõ ïàêåòîâ ñîâåðøåííî ðàçíûé ìåõàíèçì èõ çàäàíèÿ.
-Ïîýòîìó ïîëíàÿ ñîâìåñòèìîñòü íåâîçìîæíà.
-Ïî ýòîé ïðè÷èíå äî ñèõ ïîð ñóùåñòâóåò ïàêåò |caption2.sty| â~äàííîì
-äèñòðèáóòèâå, è~ñòàðûå äîêóìåíòû, èñïîëüçóþùèå ïàêåò \package{caption2}
-áóäóò êîìïèëèðîâàòüñÿ.
-
-% Newly created documents should use the actual version of
-% \thispackage\ instead. In most cases it's sufficient to replace the command
-Íîâûå äîêóìåíòû äîëæíû èñïîëüçîâàòü ñîâðåìåííûå âåðñèè ïàêåòà
-\package{caption}. Â~áîëüøèíñòâå ñëó÷àåâ ìîæíî çàìåíèòü ñòðîêó
-\begin{quote}
- |\usepackage[...]{caption2}|
-\end{quote}
-% by
-íà
-\begin{quote}
- |\usepackage[...]{caption}|\qquad.
-\end{quote}
-% But some options and commands will not be emulated, so you can get
-% error messages afterwards. This section will hopefully help you removing
-% these errors. If you have problems migrating from \package{caption2}
-% to \package{caption} please don't hesitate to send me an e-mail asking
-% for help.
-Íî íåêîòîðûå îïöèè è~êîìàíäû íå ýìóëèðóþòñÿ, è~âû ìîæåòå
-ïîëó÷èòü ñîîáùåíèÿ îá îøèáêàõ. Äàííûé ðàçäåë ïîìîæåò âàì ëèêâèäèðîâàòü
-òàêèå îøèáêè. Åñëè ó~âàñ ïðîáëåìû ïî çàìåíå ïàêåòà \package{caption2}
-íà \package{caption} íå ðàçäóìûâàéòå è~îòïðàâëÿéòå ìíå e-mail.
-
-% In addition to the obsolete options shown in the last section
-% these ones will be emulated, too:
-Ïîìèìî óñòàðåâøèõ îïöèé èç ïðåäûäóùåãî ðàçäåëà
-ñëåäóþùèå òàêæå ýìóëèðóþòñÿ:
-
-\begin{center}\small
-\begin{tabular}{ll}
-\package{caption2} \version{2.x} & \package{caption} \version{3.x}\\
-\hline
-%\endhead
-|flushleft| & |justification=raggedright|\\
-|flushright| & |justification=raggedleft|\\
-|oneline| & |singlelinecheck=on|\\
-\end{tabular}
-\end{center}
-
-% Setting the margin for captions was done in \version{2.x} with
-Çàäàíèå âòÿæåê (ïîëåé) äëÿ ïîäïèñåé, ñîçäàííûõ â~\version{2.x}
-\begin{quote}\leavevmode\hbox{%
- |\setcaptionmargin{|\ldots|}| èëè, ñîîòâåòñòâåííî
- |\setcaptionwidth{|\ldots|}|\quad.
-}\end{quote}
-% This was replaced by
-Îíè ìîãóò áûòü çàìåíåíû íà
-\begin{quote}\leavevmode\hbox{%
- |\captionsetup{margin=|\ldots|}| èëè, ñîîòâåòñòâåííî
- |\captionsetup{width=|\ldots|}|\quad.
-}\end{quote}
-\See{\Ref{margins}}
-
-% Setting an indention was done in \version{2.x} with
-Âòÿæêà â~âåðñèè \version{2.x} çàäàâàëàñü êàê
-\begin{quote}
- |\captionstyle{indent}|\\
- |\setlength\captionindent{|\ldots|}|\quad.
-\end{quote}
-\pagebreak[3]
-% This is now done with
-Ñåé÷àñ ýòî çàäà¸òñÿ êàê
-\nopagebreak[3]
-\begin{quote}
- |\captionsetup{format=plain,indention=|\ldots|}|\quad.
-\end{quote}
-
-% The so-called single-line-check was controlled by the commands
-% |\oneline|\-|captions|\-|false| (for switching the check off) and
-% |\oneline|\-|captions|\-|true| (for switching the check on).
-% This was replaced by
-Êîíòðîëü êîðîòêîé ïîäïèñè êîíòðîëèðóåòñÿ êîìàíäàìè
-|\oneline|\-|captions|\-|false| (îòêëþ÷àåò êîíòðîëü)
-è~|\oneline|\-|captions|\-|true| (äëÿ âêëþ÷åíèÿ êîíòðîëÿ).
-Ýòî çàìåíåíî íà
-|\caption|\-|setup{single|\-|line|\-|check=|\x|off}|
-% resp.
-è, ñîîòâåòñòâåííî
-|\caption|\-|setup{single|\-|line|\-|check=|\x|on}|.
-\See{\Ref{justification}}
-
-% The commands
-Êîìàíäû
-\begin{quote}
- |\captionlabeldelim|, |\captionlabelsep|, |\captionstyle|,\\
- |\defcaptionstyle|, |\newcaptionstyle|, è~|\renewcaptionstyle|
-\end{quote}
-% do not have a simple replacement and therefore will not be emulated
-% by this version of \thispackage. (So using them will
-% cause error messages.) Rewriting such code is not always easy and
-% straight-ahead, but by conscientious reading of this manual you should
-% be able to find appropriate options and commands instead.
-íå èìåþò ïðîñòîé çàìåíû ïîýòîìó íå ýìóëèðóþòñÿ
-äàííîé âåðñèåé ïàêåòà. (Èõ èñïîëüçîâàíèå âûçîâåò
-ñîîáùåíèå îá îøèáêå.) Çàìåíà ýòîãî êîäà íå âñåãäà ïðîñòà,
-íî äîáðîñîâåñòíî ïðî÷èòàâ äàííîå ðóêîâîäñòâî, âû ñìîæåòå íàéòè
-ïîäõîäÿùèå îïöèè è~êîìàíäû çàìåíû.
-
-\iffalse
-... (some examples)
-\fi
-
-% The \version{2.x} option |ignore|\-|LT|\-|cap|\-|width| do not have a
-% replacement, too.
-% But in most cases you can simply drop using that option because
-% in this version of \thispackage\ the value of |\LT|\-|cap|\-|width|
-% will be ignored anyway (unless you set it to a different value than the
-% default one which is |4in|).
-Îïöèÿ |ignore|\-|LT|\-|cap|\-|width| âåðñèè \version{2.x} òîæå íå èìååò çàìåíû.
-Íî â~áîëüøèíñòâå ñëó÷àåâ ýòó îïöèþ ìîæíî îïóñòèòü, ïîòîìó ÷òî â~äàííîé
-âåðñèè ïàêåòà çíà÷åíèå |\LT|\-|cap|\-|width|
-áóäåò èãíîðèðîâàòüñÿ â~ëþáîì ñëó÷àå (åñëè òîëüêî âû íå çàäàäèòå çíà÷åíèå,
-îòëè÷íîå îò çàäàííîãî ïî óìîë÷àíèþ |4in|).
-\See{\Ref{longtable}}
-
-\subsection{Ïàêåò caption v\texorpdfstring{$3.0$}{3.0}}
-\label{caption3}
-
-%\NEWdescription{v3.1}
-% \Thispackage\ \version{3.0} did not support any document classes
-% other than the standard \LaTeX\ ones: \class{article}, \class{report},
-% and \class{book}.
-% Therefore the default settings used to be fixed, but now \thispackage{}
-% supports more classes, therefore they are now set in dependence on the
-% document class used.
-\Thispackage\ \version{3.0} íå ïîääåðæèâàë íèêàêèõ êëàññîâ äîêóìåíòîâ, êðîìå
-ñòàíäàðòíûõ êëàññîâ \LaTeX'à: \class{article}, \class{report},
-and \class{book}.
-Â~ñòàðûõ íàñòðîéêàõ âåä¸òñÿ ðàáîòà íàä îøèáêàìè, íî~òåïåðü \thispackage{}
-ïîääåðæèâàåò áîëüøå êëàññîâ, ïîýòîìó íàñòðîéêè ïîäïèñåé çàâèñÿò îò èñïîëüçóåìîãî
-êëàññà äîêóìåíòà.
-
-% For example: While in \version{3.0} the default caption
-% |jus|\-|ti|\-|fi|\-|ca|\-|tion| used to be always |jus|\-|ti|\-|fied|,
-% it's now still |jus|\-|ti|\-|fied| when using one of the standard document
-% classes, but |ragged|\-|right| will be used as default format when used
-% with the \class{beamer} document class.
-Íàïðèìåð, â~òî âðåìÿ êàê â~âåðñèè $3.0$ çíà÷åíèåì êëþ÷à |justification|
-ïî óìîë÷àíèþ ÿâëÿåòñÿ |justi|\-|fied|, îíî îñòàíåòñÿ |justi|\-|fied| ïðè èñïîëüçîâàíèè
-ñòàíäàðòíûõ êëàññîâ äîêóìåíòîâ, íî çàìåíÿåòñÿ íà |ragged|\-|right| ïðè èñïîëüçîâàíèè
-êëàññà äîêóìåíòà \class{beamer}.
-
-% %An easy way to select the `old' defaults---if desired---is using the option
-% An easy way to select the `old' defaults is using the option
-% |style=base| when loading \thispackage\ (or later on using |\caption|\-|setup|).
-Ïðîñòîé ïóòü çàäàòü «ñòàðûå» çíà÷åíèÿ ïî óìîë÷àíèþ \cdash--- èñïîëüçîâàòü îïöèþ
-|style=base| ïðè çàãðóçêå ïàêåòà (èëè ïîçäíåå, â~êîìàíäå |\caption|\-|setup|).
-
-% Another new feature is the automatic check for compatibility; if an
-% incompatibility will be found, a warning message will be issued and if a strong
-% incompatibility was found some features of \thispackage\ will be disabled.
-Åù¸ îäíîé îñîáåííîñòüþ ñòàëà àâòîìàòè÷åñêàÿ ïðîâåðêà íà ñîâìåñòèìîñòü [êëàññà è~ïàêåòà]; åñëè
-îáíàðóæèâàåòñÿ íåñîâìåñòèìîñòü, âûäà¸òñÿ ïðåäóïðåæäåíèå î~íåñîâìåñòèìîñòè íåêîòîðûõ âîçìîæíîñòåé
-äàííîãî ïàêåòà ñ~êëàññîì äîêóìåíòà.
-% Please note that only this check was added to \thispackage, so if you get
-% such warning message, the previous versions of \thispackage\ were incompatible
-% as well, but did not issued such warning, they were ``only'' having
-% side-effects or causing problems.
-Îáðàòèòå âíèìàíèå, ÷òî òàêîå ïðåäóïðåæäåíèå ïîÿâèëîñü òîëüêî â~òåêóùåé âåðñèè ïàêåòà, ïîýòîìó åñëè
-âû ïîëó÷èëè ýòî ñîîáùåíèå ýòî îçíà÷àåò, ÷òî è~ïðåäûäóùèå âåðñèè áûëè òàêæå íåñîâìåñòèìû,
-è~îíè óæå èìåëè ïîáî÷íûå ýôôåêòû è~ìîãëè ñîçäàâàòü ïðîáëåìû.
-% So these warnings only say that some bad side effects or problems could
-% happen, but not that they actually will happen.
-% Anyway, if you use \thispackage\ in such circumstances,
-% you should use it with care.
-Ýòè ïðåäóïðåæäåíèÿ ãîâîðÿò, ÷òî \emph{ìîãóò} ïîÿâèòüñÿ ïðîáëåìû, íî ýòî íå çíà÷èò, ÷òî îíè
-íåïðåìåííî ïîÿâÿòñÿ.
-Â~ëþáîì ñëó÷àå åñëè âû èñïîëüçóåòå \thispackage\ èãíîðèðóÿ ýòî ïðåäóïðåæäåíèå,
-áóäüòå îñòîðîæíû.
-
-\bigskip
-
-\begin{Note*}
-% \Thispackage\ \version{3.0} offered the option |caption=|\x|false|,
-% which used to be a workaround for not using the whole \package{caption} package
-% (leaving the caption stuff offered by the document class or other packages
-% intact), but keeping the \package{subfig} package\cite{subfig} working.
-% This mechanism is obsolete and not offered anymore, please pass this option
-% to the \package{subfig} package instead and do not load \thispackage\ anymore.
-% %\par\See{the \package{subfig} package documentation}
-Ïàêåò âåðñèè \version{3.0} ïðåäëàãàë îïöèþ |caption=false|, êîòîðàÿ âêëþ÷àëà ëèøü
-÷àñòè÷íîå èñïîëüçîâàíèå âîçìîæíîñòåé ïàêåòà \package{caption} (ñîõðàíÿÿ
-íàñòðîéêè êëàññà äîêóìåíòà èëè äðóãèõ ïàêåòîâ íåòðîíóòûìè), íî îñòàâëÿëà
-âîçìîæíîñòü ðàáîòû ïàêåòà \package{subfig}.
-Ýòîò ìåõàíèçì òåïåðü óñòàðåâøèé è~áîëüøå íå ïîääåðæèâàåòñÿ,
-ïîýòîìó çàäàâàéòå, ïîæàëóéñòà, ýòó îïöèþ ïðè çàãðóçêå ïàêåòà \package{subfig},
-è~íå çàãðóæàéòå äàííûé ïàêåò âîâñå.
-%\par\See{the \package{subfig} package\cite{subfig} documentation}
-\end{Note*}
-
-% --------------------------------------------------------------------------- %
-
-\clearpage
-\begin{thebibliography}{99}
-\fontencoding{T1}%\fontfamily{ptm}
-\selectfont
-
- \bibitem{TLC2}
- Frank Mittelbach and Michel Goossens:\\
- \newblock {\em The {\LaTeX} Companion (2nd.~Ed.)},\\
- \newblock Addison-Wesley, 2004.
-
- \bibitem{beamer}
- Till Tantau:\\
- \href{http://www.ctan.org/pkg/beamer}%
- {\emph{User Guide to the Beamer Class, Version 3.07}},\\
- March 11, 2007
-
- \bibitem{KOMAScript}
- Markus Kohm \& Jens-Uwe-Morawski:\\
- \href{http://www.ctan.org/pkg/koma-script}%
- {\emph{KOMA-Script -- a versatile \LaTeXe\ bundle}},\\
- 2007-01-09
-
- \bibitem{NTG}
- Victor Eijkhout:\\
- \href{http://www.ctan.org/pkg/ntgclass}%
- {\emph{An introduction to the Dutch \LaTeX\ document classes}},\\
- 3 September 1989
-
- \bibitem{algorithms}
- Rog\'erio Brito:\\
- \href{http://www.ctan.org/pkg/algorithms}%
- {\emph{Algorithms}},\\
- June 2, 2006
-
-\iffalse
- \bibitem{algorithm2e}
- Christophe Fiorio:\\
- \href{http://www.ctan.org/pkg/algorithm2e}%
- {\emph{algorithm2e.sty -- package for algorithms}},\\
- March 11, 2007
-\fi
-
- \bibitem{float}
- Anselm Lingnau:\\
- \href{http://www.ctan.org/pkg/float}%
- {\emph{An Improved Environment for Floats}},\\
- 2001/11/08
-
- \bibitem{floatflt}
- Mats Dahlgren:\\
- \href{http://www.ctan.org/pkg/floatflt}%
- {\emph{Welcome to the floatflt package}},\\
- 1998/06/05
-
- \bibitem{floatrow}
- Olga Lapko:\\
- \href{http://www.ctan.org/pkg/floatrow}%
- {\emph{The floatrow package documentation}},\\
- 2008/03/28
-
- \bibitem{fltpage}
- Sebastian Gross:\\
- \href{http://www.ctan.org/pkg/fltpage}%
- {\emph{Welcome to the beta test of fltpage package!}},\\
- 1998/11/13
-
- \bibitem{hyperref}
- Sebastian Rahtz \& Heiko Oberdiek:\\
- \href{http://www.ctan.org/pkg/hyperref}%
- {\emph{Hypertext marks in \LaTeX}},\\
- November 12, 2007
-
- \bibitem{hypcap}
- Heiko Oberdiek:\\
- \href{http://www.ctan.org/pkg/hypcap}%
- {\emph{The hypcap package -- Adjusting anchors of captions}},\\
- 2007/04/09
-
- \bibitem{listings}
- Carsten Heinz \& Brooks Moses:\\
- \href{http://www.ctan.org/pkg/listings}%
- {\emph{The Listings Package}},\\
- 2007/02/22
-
- \bibitem{longtable}
- David Carlisle:\\
- \href{http://www.ctan.org/pkg/longtable}%
- {\emph{The longtable package}},\\
- 2004/02/01
-
- \bibitem{picinpar}
- Friedhelm Sowa:\\
- \href{http://www.ctan.org/pkg/picinpar}%
- {\emph{Pictures in Paragraphs}},\\
- July 13, 1993
-
- \bibitem{picins}
- Joachim Bleser and Edmund Lang:\\
- \href{http://www.ctan.org/pkg/picins}%
- {\emph{PicIns-Benutzerhandbuch Version 3.0}},\\
- September~1992
-
- \bibitem{rotating}
- Sebastian Rahtz and Leonor Barroca:\\
- \href{http://www.ctan.org/pkg/rotating}%
- {\emph{A style option for rotated objects in \LaTeX}},\\
- 1997/09/26
-
- \bibitem{setspace}
- Erica M. S. Harris \& Geoffrey Tobin:\\
- \href{http://www.ctan.org/pkg/setspace}%
- {\emph{LaTeX Document Package ``setspace''}},\\
- 1 December 2000
-
- \bibitem{sidecap}
- Rolf Niepraschk \& Hubert G\"a\ss lein:\\
- \href{http://www.ctan.org/pkg/sidecap}%
- {\emph{The sidecap package}},\\
- 2003/06/06
-
- \bibitem{subfigure}
- Steven D. Cochran:\\
- \href{http://www.ctan.org/pkg/subfigure}%
- {\emph{The subfigure package}},\\
- 2002/07/02
-
- \bibitem{subfig}
- Steven D. Cochran:\\
- \href{http://www.ctan.org/pkg/subfig}%
- {\emph{The subfig package}},\\
- 2005/07/05
-
- \bibitem{supertabular}
- Johannes Braams and Theo Jurriens:\\
- \href{http://www.ctan.org/pkg/supertabular}%
- {\emph{The supertabular environment}},\\
- 2002/07/19
-
- \bibitem{threeparttable}
- Donald Arseneau:\\
- \href{http://www.ctan.org/pkg/threeparttable}%
- {\emph{Three part tables: title, tabular environment, notes}},\\
- 2003/06/13
-
- \bibitem{wrapfig}
- Donald Arseneau:\\
- \href{http://www.ctan.org/pkg/wrapfig}%
- {\emph{WRAPFIG.STY ver 3.6}},\\
- 2003/01/31
-
- \bibitem{xtab}
- Peter Wilson:\\
- \href{http://www.ctan.org/pkg/xtab}%
- {\emph{The xtab package}},\\
- 2004/05/24
-
-\end{thebibliography}
-
-% --------------------------------------------------------------------------- %
-
-\end{document}
diff --git a/Master/texmf-dist/source/latex/caption/caption-thesis.dtx b/Master/texmf-dist/source/latex/caption/caption-thesis.dtx
index c358eadff1c..aa0694668b7 100644
--- a/Master/texmf-dist/source/latex/caption/caption-thesis.dtx
+++ b/Master/texmf-dist/source/latex/caption/caption-thesis.dtx
@@ -27,11 +27,10 @@
% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
-% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
-% and the user manuals
-% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty.
%
% \fi
+%
% \CheckSum{9}
%
% \iffalse
@@ -139,6 +138,7 @@
% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\kernel@ifnextchar}
% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
diff --git a/Master/texmf-dist/source/latex/caption/caption.dtx b/Master/texmf-dist/source/latex/caption/caption.dtx
index 09cef7fb865..4b59565b22c 100644
--- a/Master/texmf-dist/source/latex/caption/caption.dtx
+++ b/Master/texmf-dist/source/latex/caption/caption.dtx
@@ -2,7 +2,7 @@
%
% This is file `caption.dtx'.
%
-% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+% Copyright (C) 1994-2022 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
%
% --------------------------------------------------------------------------
%
@@ -27,29 +27,33 @@
% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
-% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
-% and the user manuals
-% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty.
%
% \fi
-% \CheckSum{2692}
+%
+% \CheckSum{2869}
%
% \iffalse
%<*driver>
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesFile{caption.drv}[2020/10/11 v3.5 Implementation of the caption package]
+\ProvidesFile{caption.drv}[2022/02/20 v3.6 Implementation of the caption package]
\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
%\errorcontextlines=3
%
\documentclass{ltxdoc}
\setlength\parindent{0pt}
\setlength\parskip{\smallskipamount}
+\setlength\leftmargini{2em}% default = 2.5em
+%\makeatletter\g@addto@macro\MacroFont{\normalcolor}\makeatother
%
\makeatletter % make room for subsections like 2.16.14 in the TOC
%\newcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
\renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.7em}}
\makeatother
%
+\newcommand\LineBreak{\linebreak[3]}
+\newcommand\PageBreak{\pagebreak[3]}
+%
\usepackage{ifpdf}
\ifpdf
\usepackage{mathptmx,courier}
@@ -57,15 +61,135 @@
\addtolength\marginparwidth{15pt}
\fi
%
+\usepackage[bottom]{footmisc}
+\usepackage{graphicx,longtable,setspace}
+%
\usepackage{hypdoc}
\ifpdf\usepackage{hypdestopt}\fi
\hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}}
+\hypersetup{breaklinks=true}
+\AtBeginDocument{%
+ \let\subsectionautorefname\sectionautorefname
+ \let\subsubsectionautorefname\sectionautorefname}
%
-\usepackage[debug]{caption}[2013/01/01]
+\usepackage[listof=false,hypcap=false]{caption}[2022/01/06]
%
\DeclareRobustCommand*\eTeX{\texorpdfstring
{\leavevmode\hbox{$\varepsilon$}-\TeX}%
{e-TeX}}
+\DeclareRobustCommand*\AmS{\texorpdfstring
+ {{\protect\usefont{OMS}{cmsy}{m}{n}A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}%
+ {AMS}}
+\DeclareRobustCommand*\KOMAScript{\texorpdfstring
+ {\textsf{K\kern.05em O\kern.05em M\kern.05em A\kern.1em-\kern.1em Script}}%
+ {KOMA-Script}}
+\DeclareRobustCommand*\NTG{NTG}
+\DeclareRobustCommand*\SmF{SMF}
+%
+\usepackage{marvosym}
+\makeatletter
+\newcommand*\INFO{\@ifstar{\@INFO{}}{\@INFO{\vbox to \ht\strutbox}}}
+\newcommand*\@INFO[1]{\MARGINSYM{#1{\LARGE\Info}}}
+\makeatother
+
+\makeatletter
+\newcommand*\MARGINSYM[1]{\hskip 1sp \marginpar{\raggedleft\textcolor{blue}{{#1}}}}
+\newcommand*\NEW[1]{\@ifstar{\@NEW{#1}{\vskip2pt}}{\@NEW{#1}{}}}
+\newcommand*\@NEW[3]{\MARGINSYM{#2\footnotesize#1\\#3}}
+\makeatother
+
+% \ContinuedFloat
+\DeclareCaptionLabelFormat{continued1}{Continued #1~#2}
+\DeclareCaptionLabelFormat{continued2}{#1~#2\alph{ContinuedFloat}}
+% \DeclareCaptionLabelFormat
+\DeclareCaptionLabelFormat{bf-parens}{(\textbf{#2})}
+% \DeclareCaptionStyle
+\DeclareCaptionStyle{mystyle}[margin=5mm,justification=centering]%
+ {font=footnotesize,labelfont=sc,margin={10mm,0mm}}
+% Example 1
+\DeclareCaptionFormat{myformat1}{#1#2\\#3}
+\newlength\myindention
+\DeclareCaptionFormat{myformat2}{#1#2\\\hspace*\myindention#3}
+\DeclareCaptionOption{myindention}{\setlength\myindention{#1}}
+% Example 2
+\DeclareCaptionFormat{reverse}{#3#2#1}
+\DeclareCaptionLabelFormat{fullparens}{(\bothIfFirst{#1}{~}#2)}
+\DeclareCaptionLabelSeparator{fill}{\hfill}
+% Example 3
+\DeclareCaptionFormat{llap}{\llap{#1#2}#3\par}
+\DeclareCaptionFormat{llapx}{\llap{\makebox[5em][l]{#1}}#3\par}
+% Example 4
+\DeclareCaptionLabelFormat{andtable}{#1~#2 \& \tablename~\thetable}
+
+\newcommand*\purerm[1]{\texorpdfstring{{\upshape\mdseries\rmfamily #1}}{#1}}
+\newcommand*\puresf[1]{\texorpdfstring{{\upshape\mdseries\sffamily #1}}{#1}}
+\newcommand*\purett[1]{\texorpdfstring{{\upshape\mdseries\ttfamily #1}}{#1}}
+\let\class\puresf \let\package\puresf % obsolete
+\let\cls\puresf \let\pkg\puresf
+\let\env\purett \let\opt\purett
+
+\newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
+\newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
+\newcommand*\version[2][]{v$#2$}
+\newcommand*\issue[1]{GitLab~\##1}
+\newcommand*\x{\discretionary{}{}{}}
+
+\newenvironment{Annotation}%
+ {\ifvmode\else\unskip\par\fi\pagebreak[2]%
+ \smallskip
+ \small(\ignorespaces}{\unskip)\par}
+\newenvironment{Annotation*}%
+ {\ifvmode\else\unskip\par\fi\pagebreak[2]%
+ \small(\ignorespaces}{\unskip)\par}
+
+\newenvironment{Example}%
+ {\ifvmode\else\unskip\par\fi\pagebreak[2]%
+ \minipage{\linewidth}\smallskip}%
+ {\smallskip\endminipage\par}
+
+\makeatletter
+\newcommand\example{\@ifstar
+ {\@example{belowskip=\abovecaptionskip}}%
+ {\@example{}}}
+\def\@example#1{%
+ \@testopt{\@@example{#1}}{figure}}
+\long\def\@@example#1[#2]#3#4{%
+ \begingroup
+ \captionsetup{#1,size=small,margin={\leftmargini,10pt},#3}%
+ \captionof{#2}[]{#4}%
+ \endgroup}
+\makeatother
+
+\newenvironment{Expert}%
+ {\ifvmode\else\unskip\par\fi\pagebreak[3]%
+ \smallskip
+ \footnotesize\ignorespaces}{\par}
+\newenvironment{Expert*}%
+ {\ifvmode\else\unskip\par\fi\pagebreak[3]%
+ \footnotesize\ignorespaces}{\par}
+
+\newenvironment{Note}[1][\DefaultNoteText]%
+ {\ifvmode\else\unskip\par\fi
+ \smallskip
+ \small\emph{#1:}~\ignorespaces}{\par}
+\newenvironment{Note*}[1][\DefaultNoteText]%
+ {\ifvmode\else\unskip\par\fi
+ \small\emph{#1:}~\ignorespaces}{\par}
+
+\newenvironment{Options}[1]%
+ {\list{}{\renewcommand\makelabel[1]{\texttt{##1}\hfil}%
+ \settowidth\labelwidth{\texttt{#1\space}}%
+ \setlength\leftmargin{10pt}%
+ \addtolength\leftmargin{\labelwidth}%
+ \addtolength\leftmargin{\labelsep}}}%
+ {\endlist}
+
+\makeatletter
+\def\Ref{\@ifstar{\@Ref\ref}{\@Ref\autoref}}
+\def\@Ref#1#2{#1{#2}: \textit{\nameref{#2}}}
+\newcommand*\SEE[3][]{\nopagebreak{#1(#2 #3)}}
+\newcommand*\SeeUserDefined[1][]{\See{\Ref{declare}#1}}
+\makeatother
%
\begin{document}
\DocInput{caption.dtx}
@@ -73,68 +197,4105 @@
%</driver>
% \fi
%
-% \newcommand*\purerm[1]{\texorpdfstring{{\upshape\mdseries\rmfamily #1}}{#1}}
-% \newcommand*\puresf[1]{\texorpdfstring{{\upshape\mdseries\sffamily #1}}{#1}}
-% \newcommand*\purett[1]{\texorpdfstring{{\upshape\mdseries\ttfamily #1}}{#1}}
-% \let\class\puresf \let\package\puresf
-% \let\env\purett \let\opt\purett
%
% \def\thispackage{the \package{caption} package}
% \def\Thispackage{The \package{caption} package}
%
-% \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
-% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
-% \newcommand*\version[2][]{v$#2$}
-%
-% \newcommand*\issue[1]{GitLab~\##1}
+% \newcommand*\DefaultNoteText{Note}
+% \newcommand*\NEWfeature{\NEW{New feature}}
+% \newcommand*\NEWdescription{\NEW{New description}}
+% \makeatletter
+% \newcommand*\See{\@ifstar{\SEE{See}}{\SEE[\small]{See}}}
+% \newcommand*\see{\@ifstar{\SEE{see}}{\SEE[\small]{see}}}
+% \makeatother
%
% \GetFileInfo{caption.drv}
% \let\docdate\filedate
% \let\docversion\fileversion
% \GetFileInfo{caption.sty}
%
-% \title{The Implementation of
-% \texorpdfstring{\thispackage\thanks{%^^A
+% \title{Customizing captions of floating environments%^^A
+% \texorpdfstring{\thanks{%^^A
% This package has version number \docversion.}}%^^A
-% {the caption package}}
+% {}}
% \author{Axel Sommerfeldt\\
% \url{https://gitlab.com/axelsommerfeldt/caption}}
% \date{\docdate}
% \maketitle
%
% \begin{abstract}
-% \Thispackage\ consists of two parts -- the kernel
-% (|caption3.sty|) and the main package (|caption.sty|).
-%
-% \Thispackage\ redefines the \LaTeX\ commands
-% |\caption|, |\@caption|, and |\@makecaption| and maps the latter one to
-% |\caption@@make|, giving the user the possibility to control the look \& feel
-% of the captions from floating environments like |figure| and |table|.
-% Furthermore it does similar to the caption stuff coming from other packages
-% (like the \package{longtable} or \package{supertabular} package):
-% Mapping the appropriate internal commands (like |\LT@makecaption| or
-% |\ST@caption|) to the ones offered by the \package{caption3} kernel.
-% So you can think of \thispackage\ as a layer package, it
-% simply provides adaptation layers between the caption stuff coming from
-% \LaTeXe\ or packages, and the caption stuff offered by the
-% \package{caption3} kernel.
+% \Thispackage\ offers customization of captions
+% in floating environments such |figure| and |table| and cooperates with
+% many other packages.
+% \par\smallskip
+% \textit{Please note:} Many document classes already have build-in options and
+% commands for customizing captions.
+% If these possibilities are sufficient for you, there is usually no need for
+% you to use the \package{caption} package at all.
+% And if you are only interested in using the command \cs{captionof}, loading of
+% the very small \package{capt-of} package is usually sufficient.
% \end{abstract}
-%
-% \section*{User manual}
%
-% This document is describing the code implementation only.
-% The user documentation can be found in
-% \nopagebreak\begin{quote}
+% \newcommand\shortexampletext{%
+% White sand beaches. The pink smoothness of the conch shell. A sea abundant
+% with possibilities. Duty-free shops filled with Europe's finest gifts and
+% perfumes.}
+% \newcommand\exampletext{\shortexampletext\space
+% Play your favorite game of golf amidst the tropical greens on one
+% of the many championship courses.}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \section*{Introduction}
+%
+% Within the standard \LaTeX\ document classes captions haven't received the
+% attention they deserve. Simply typeset as an ordinary paragraph there is no
+% remarkable visual difference from the rest of the text, like here:
+%
+% \example*{size=normalsize,margin=0pt}{\shortexampletext}
+%
+% There should be possibilities to change this; for example, it would be nice
+% to make the text of the caption a little bit smaller as the normal
+% text, add an extra margin, typeset the caption label with the same font
+% family and shape as your headings etc. Just like this one:
+%
+% \example*{size=small,margin=10pt,labelfont=bf,labelsep=endash}{\shortexampletext}
+%
+% You can do this easily with this package as there are many ready-to-use
+% caption formatting options, but you are free to define your very own stuff, too.
+%
+% \bigskip
+%
+% \INFO\begin{minipage}[t]{\textwidth}
+% \small
+% Please note that \thispackage\ is only controlling the look \& feel of the
+% captions. It does \emph{not} control the placement of the captions.
+% (But you could do so by using other packages like the \package{floatrow}
+% package\cite{floatrow}.)
+% \end{minipage}
+%
+% \medskip
+%
+% \INFO\begin{minipage}[t]{\textwidth}
+% \small
+% This documentation is outdated and is currently under revision.
+% Progress could be tracked here:
+% \url{https://gitlab.com/axelsommerfeldt/caption/-/commits/doc/caption}
+% \end{minipage}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \tableofcontents
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \section{Using this package}
+% \label{usage}
+%
+% Insert
+% \begin{quote}
+% |\usepackage|\oarg{options}|{caption}[|\texttt{\filedate}|]|
+% \end{quote}
+% into the preamble of your document, i.e.~the part of your document
+% between |\document|\-|class| and |\begin{doc|\-|u|\-|ment}|.
+% The options control how your captions will look like; e.g.,
+% \begin{quote}
+% |\usepackage[margin=10pt,font=small,labelfont=bf,|\\
+% | labelsep=endash]{caption}|%
+% %|[|\texttt{\filedate}|]|
+% \end{quote}
+% would result in captions looking like the second one in the introduction.
+%
+% \DescribeMacro{\captionsetup}
+% For a later change of options \thispackage\ provides the command
+% \begin{quote}
+% |\captionsetup|\oarg{float type}\marg{options}\quad.
+% \end{quote}
+% So
+% \begin{quote}
+% |\usepackage[margin=10pt,font=small,labelfont=bf]{caption}|
+% \end{quote}
+% and
+% \begin{quote}
+% |\usepackage{caption}|\\
+% |\captionsetup{margin=10pt,font=small,labelfont=bf}|
+% \end{quote}
+% are equal in their results.
+%
+% It's good to know that |\caption|\-|setup| has an effect on the current
+% environment only. So if you want to change settings for the
+% current |figure| or |table| only, just place the |\caption|\-|setup| command
+% inside the |figure| or |table| right before the |\caption| command.
+% For example
+% \begin{quote}
+% |\begin{figure}|\\
+% | |\ldots\\
+% | \captionsetup{singlelinecheck=off}|\\
+% | \caption{|\ldots|}|\\
+% |\end{figure}|
+% \end{quote}
+% switches the single-line-check off, but only for this |figure|,
+% so all the other captions remain untouched.
+%
+% \begin{Annotation}
+% For a detailed description of |\caption|\-|setup| see \Ref{captionsetup}.
+% \end{Annotation}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \section{Options}
+% \label{options}
+%
+% \def\OptionLabel{RaggedRight}
+% \def\UserDefined{\ldots}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{Formatting}
+% \label{formats}
+%
+% \DescribeMacro{format=}
+% A figure or table caption mainly consists of three parts: the caption label,
+% which says if this object is a `Figure' or `Table' and what number is
+% associated with it, the caption text itself, which is normally a short
+% description of contents, and the caption separator which separates the text
+% from the label.
+%
+% The \textit{caption format} determines how this information will be presented;
+% it is specified with the option
+% \begin{quote}
+% |format=|\meta{format name}\quad,
+% \end{quote}
+% having the name of the caption format as its argument.
+%
+% There are two standard caption formats:
+% \begin{Options}{\OptionLabel}
+% \item[plain]%\NEWdescription{v3.0h}
+% Typesets the captions as a normal paragraph.
+%
+% \item[hang]
+% Indents the caption text, so it will `hang' under the first line of the text.
+%
+% \item[\UserDefined]
+% Own formats can be defined using |\Declare|\-|Caption|\-|Format|.\LineBreak
+% \SeeUserDefined
+% \end{Options}
+%
+% \begin{Example}
+% An example: Specifying the option
+% \begin{quote}
+% |format=hang|
+% \end{quote}
+% yields captions like this:
+% \example{format=hang}{\exampletext}
+% \end{Example}
+%
+% \pagebreak[3]
+% \DescribeMacro{indention=}
+% For both formats (\texttt{plain} and \texttt{hang}) you can setup an extra
+% indention starting at the second line of the caption. You do this with the
+% option
+% \begin{quote}
+% |indention=|\meta{amount}\quad.
+% \end{quote}
+%
+% Two examples:
+%
+% \begin{Example}
+% \begin{quote}
+% |format=plain,indention=.5cm|
+% \end{quote}
+% \captionsetup{skip=0pt}
+% \example{format=plain,indention=.5cm}{\exampletext}
+% \end{Example}
+%
+% \begin{Example}
+% \begin{quote}
+% |format=hang,indention=-0.5cm|
+% \end{quote}
+% \captionsetup{skip=0pt}
+% \example{format=hang,indention=-0.5cm}{\exampletext}
+% \end{Example}
+%
+% \bigskip
+%
+% \pagebreak[3]
+% \DescribeMacro{labelformat=}
+% With the option
+% \nopagebreak[3]
+% \begin{quote}
+% |labelformat=|\meta{label format name}
+% \end{quote}
+% \nopagebreak[3]
+% you specify how the caption label will be typeset.
+% There are five standard caption label formats:
+%
+% \begin{Options}{\OptionLabel}
+% \item[original]
+% The caption label will be typeset as specified by the document class,
+% usually this means the name and the number (like \texttt{simple}).
+%
+% Until \version{3.4} of \thispackage\ this label format was called `default'.
+% Since \version{3.5} it is called `original' and usually is the default label
+% format, so |label|\-|format=|\-|default| will still select this label format,
+% unless the default was changed by either a document class or babel language package.
+%
+% \item[empty]
+% The caption label will be empty.
+% \iffalse
+% (This option makes sense when used together with other options like
+% \texttt{labelsep=none}.)
+% \fi
+%
+% \item[simple]
+% The caption label will be typeset as a name and a number.
+%
+% \item[brace]\NEWfeature{v3.1f}
+% The caption label will be closed with a single (right) brace.
+%
+% \item[parens]
+% The number of the caption label will be typeset in parentheses.
+%
+% \item[\UserDefined]
+% Own label formats can be defined using |\Declare|\-|Caption|\-|Label|\-|Format|.
+% \SeeUserDefined
+% \end{Options}
+%
+% \begin{Example}
+% An example: Using the options
+% \begin{quote}
+% |format=plain,labelformat=parens,labelsep=quad|
+% \end{quote}
+% gives captions like this one:
+% \example{format=plain,labelformat=parens,labelsep=quad}{\exampletext}
+% \end{Example}
+%
+% \medskip
+%
+% \begin{Note*}
+% Some environments, e.g.~the |algorithm| environment offered by the
+% \package{algorithm2e} package, might react allergic to a change of the
+% caption label format.
+% \end{Note*}
+%
+% \bigskip
+%
+% \pagebreak[3]
+% \DescribeMacro{labelsep=}
+% With the option
+% \begin{quote}
+% |labelsep=|\meta{label separator name}
+% \end{quote}
+% you specify what caption separator will be used.\footnote{%
+% If the caption label or the caption text is empty,
+% no separator will be used.}
+% You can choose one of the following:
+%
+% \begin{Options}{\OptionLabel}
+% \item[none]
+% There is no caption separator.
+% \iffalse
+% (This option makes sense when used together with other options like
+% \texttt{labelformat=empty}.)
+% \fi
+%
+% \item[colon]
+% The caption label and text will be separated by a colon and a space.
+%
+% \item[period]
+% The caption label and text will be separated by a period and a space.
+%
+% \item[space]
+% The caption label and text will be separated by a single space.
+%
+% \item[quad]
+% The caption label and text will be separated by a |\quad|.
+%
+% \item[newline]
+% The caption label and text will be separated by a line break (|\\|).
+% Please note that this separator does not work with all caption
+% formats (e.g.~|format=|\x|hang|), and you'll get an error message
+% trying such combination of options.
+%
+% \item[endash]\NEWfeature{v3.0h}
+% The caption label and text will be separated by an en-dash,
+% surrounded by spaces (\verb*| -- |).
+%
+% \item[\UserDefined]
+% Own separators can be defined using |\Declare|\-|Caption|\-|Label|\-|Sep|\-|a|\-|ra|\-|tor|.
+% \SeeUserDefined
+% \end{Options}
+%
+% Three examples:
+% \begin{Example}
+% \begin{quote}
+% |format=plain,labelsep=period|
+% \end{quote}
+% \captionsetup{skip=0pt}
+% \example{format=plain,labelsep=period}{\exampletext}
+% \end{Example}
+%
+% \begin{Example}
+% \begin{quote}
+% |format=plain,labelsep=newline,singlelinecheck=false|
+% \end{quote}
+% \captionsetup{skip=0pt}
+% \example{format=plain,labelsep=newline,singlelinecheck=false}{\exampletext}
+% \end{Example}
+%
+% \begin{Example}
+% \begin{quote}
+% |format=plain,labelsep=endash|
+% \end{quote}
+% \captionsetup{skip=0pt}
+% \example{format=plain,labelsep=endash}{\exampletext}
+% \end{Example}
+%
+% \bigskip
+%
+% \pagebreak[3]
+% \DescribeMacro{textformat=}
+% \NEWfeature*{v3.1}
+% With the option
+% \nopagebreak[3]
+% \begin{quote}
+% |textformat=|\meta{text format name}
+% \end{quote}
+% \nopagebreak[3]
+% you specify how the caption text will be typeset.
+% There are two standard caption text formats:
+%
+% \begin{Options}{\OptionLabel}
+% \item[empty]
+% The caption text will be suppressed.
+%
+% \item[simple]
+% The caption text will be typeset as it is.
+%
+% \item[period]
+% The caption text will be followed by a period.
+%
+% \item[\UserDefined]
+% Own text formats can be defined using |\Declare|\-|Caption|\-|Text|\-|Format|.
+% \SeeUserDefined
+% \end{Options}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \PageBreak
+% \subsection{Justification}
+% \label{justification}
+%
+% \DescribeMacro{justification=}
+% As addition to the caption format you could also specify a
+% \emph{caption justification}; it is specified with the option
+% \begin{quote}
+% |justification=|\meta{justification name}\quad.
+% \end{quote}
+%
+% You can choose one of the following:
+%
+% \begin{Options}{\OptionLabel}
+% \item[justified]
+% Typesets the caption as a normal paragraph.
+%
+% \item[centering]
+% Each line of the caption will be centered.
+%
+% \iffalse
+% \item[Centering]
+% \fi
+%
+% \item[centerlast]
+% The last line of each paragraph of the caption text will be centered.
+%
+% \item[centerfirst]
+% Only the first line of the caption will be centered.
+%
+% \item[raggedright]
+% Each line of the caption will be moved to the left margin.
+%
+% \iffalse
+% \item[RaggedRight]
+% Each line of the caption will be moved to the left margin using
+% the command |\RaggedRight| from the \package{ragged2e} package.
+% \else
+% \item[RaggedRight]
+% Each line of the caption will be moved to the left margin, too.
+% But this time the command |\RaggedRight| of the \package{ragged2e}
+% package will be used to achieve this.
+% The main difference to |raggedright| is that the word breaking
+% algorithm of \TeX\ will work inside captions.\footnote{%
+% The need for the \package{ragged2e} package will be detected at
+% run-time, therefore you maybe need a second \LaTeX\ run if this
+% option is used for the first time.}
+% \fi
+%
+% \item[raggedleft]
+% Each line of the caption will be moved to the right margin.
+%
+% \iffalse
+% \item[RaggedLeft]
+% Each line of the caption will be moved to the right margin using
+% the command |\RaggedLeft| from the \package{ragged2e} package.
+% \fi
+%
+% \item[\UserDefined]
+% Own justifications can be defined using |\Declare|\-|Caption|\-|Jus|\-|ti|\-|fi|\-|ca|\-|tion|.
+% \SeeUserDefined
+% \end{Options}
+%
+% Three examples:
+% \begin{Example}
+% \begin{quote}
+% |format=hang,justification=raggedright|
+% \end{quote}
+% \captionsetup{skip=0pt}
+% \example{format=hang,justification=raggedright}{\exampletext}
+% \end{Example}
+%
+% \begin{Example}
+% \begin{quote}
+% |format=hang,justification=centerlast|
+% \end{quote}
+% \captionsetup{skip=0pt}
+% \example{format=hang,justification=centerlast}{\exampletext}
+% \end{Example}
+%
+% \begin{Example}
+% \begin{quote}
+% |format=plain,labelsep=newline,justification=centering|
+% \end{quote}
+% \captionsetup{skip=0pt}
+% \example*{format=plain,labelsep=newline,justification=centering}{\exampletext}
+% \end{Example}
+%
+% \smallskip
+%
+% \PageBreak
+% \DescribeMacro{singlelinecheck=}
+% The standard \LaTeX\ document classes (\class{article}, \class{report}, and
+% \class{book}) automatically center a caption if it fits in one single line:
+%
+% \example*{}{A short caption.}
+%
+% \INFO
+% \Thispackage\ adapts this behavior and therefore usually ignores the
+% justification \& indention you have set with |justification=| \&
+% |indention=| in such case.
+% But you can switch this special treatment of such short captions off
+% with the option
+% \begin{quote}
+% |singlelinecheck=|\meta{bool}\quad.
+% \end{quote}
+% Using |false|, |no|, |off| or |0| for \meta{bool} switches the
+% extra centering off:
+% \begin{quote}
+% |singlelinecheck=false|
+% \end{quote}
+% Doing so the above short caption would look like
+%
+% \begingroup
+% \captionsetup{type=figure}
+% \ContinuedFloat
+% \example*{singlelinecheck=false}{A short caption.}
+% \endgroup
+%
+% You switch the extra centering on again by using |true|, |yes|, |on| or |1|
+% for \meta{bool}. (The default is on.)
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{Fonts}
+% \label{fonts}
+%
+% \DescribeMacro{font=}
+% \DescribeMacro{labelfont=}
+% \DescribeMacro{textfont=}
+% There are three font options which affects different parts of the caption:
+% One affecting the whole caption (|font|), one which only affects the caption
+% label and separator (|label|\-|font|) and at least one which only affects the
+% caption text (|text|\-|font|).
+% You set them up using the options
+% \begin{quote}\begin{tabular}{@{}r@{}ll}
+% |font=| & \marg{font options} & ,\\
+% |labelfont=| & \marg{font options} & , and\\
+% |textfont=| & \marg{font options} & ,\\
+% \end{tabular}\end{quote}
+% where \meta{font options} is a list of comma separated font options.
+%
+% And these are the available font options:
+%
+% \begin{Options}{stretch=\meta{amount}}
+% \item[scriptsize] {\scriptsize Very small size}
+% \item[footnotesize] {\footnotesize The size usually used for footnotes}
+% \item[small] {\small Small size}
+% \item[normalsize] {\normalsize Normal size}
+% \item[large] {\large Large size}
+% \item[Large] {\Large Even larger size}
+% \end{Options}
+% \vspace{0pt}\pagebreak[3]
+% \begin{Options}{stretch=\meta{amount}}
+% \item[normalfont] {\normalfont Normal shape \& series \& family}
+%
+% \item[up] {\upshape Upright shape}
+% \item[it] {\itshape Italic shape}
+% \item[sl] {\slshape Slanted shape}
+% \item[sc] {\scshape Small Caps shape}
+%
+% \item[md] {\mdseries Medium series}
+% \item[bf] {\bfseries Bold series}
+%
+% \item[rm] {\rmfamily Roman family}
+% \item[sf] {\sffamily Sans Serif family}
+% \item[tt] {\ttfamily Typewriter family}
+% \end{Options}
+% \vspace{0pt}\pagebreak[3]
+% \begin{Options}{stretch=\meta{amount}}
+% \item[singlespacing] Single spacing \See{\Ref{setspace}}
+% \item[onehalfspacing] One-and-a-half spacing \See{\Ref{setspace}}
+% \item[doublespacing] Double spacing \See{\Ref{setspace}}
+% \item[stretch=\meta{amount}] |\setstretch|\marg{amount} \See{\Ref{setspace}}
+% \end{Options}
+% \vspace{0pt}\pagebreak[3]
+% \begin{Options}{stretch=\meta{amount}}
+% \item[normalcolor] |\normalcolor|
+% \item[color=\meta{colour}] |\color|\marg{colour}
+% {\small(If the \package{color} or \package{xcolor} package is loaded,
+% see \Ref{declare} for an example)}
+% \end{Options}
+% \vspace{0pt}\pagebreak[3]
+% \begin{Options}{stretch=\meta{amount}}
+% \item[normal] The combination of the options |normal|\-|color|,
+% |normal|\-|font|, |normal|\-|size|, and |single|\-|spacing|
+%
+% \item[\UserDefined]
+% Own font options can be defined using |\Declare|\-|Caption|\-|Font|.
+% \SeeUserDefined
+% \end{Options}
+%
+% If you use only one of these options you can omit the braces;
+% e.g., the options
+% |font={small}|
+% and
+% |font=small|
+% will give the same result.
+%
+% Three examples:
+% \begin{Example}
+% \begin{quote}
+% |font=it,labelfont=bf|
+% \end{quote}
+% \captionsetup{skip=0pt}
+% \example{font=it,labelfont=bf}{\exampletext}
+% \end{Example}
+%
+% \begin{Example}
+% \begin{quote}
+% |labelfont=sc,textfont=it|
+% \end{quote}
+% \captionsetup{skip=0pt}
+% \example{labelfont=sc,textfont=it}{\exampletext}
+% \end{Example}
+%
+% \begin{Example}
+% \begin{quote}
+% |font={small,stretch=0.80}|
+% \end{quote}
+% \captionsetup{skip=0pt}
+% \example{font={small,stretch=0.80}}{\exampletext}
+% \end{Example}
+%
+% \medskip
+%
+% \pagebreak[3]
+% \DescribeMacro{font+=}
+% \DescribeMacro{labelfont+=}
+% \DescribeMacro{textfont+=}
+% \NEWfeature*{v3.1}
+% You can also add font options to the current ones, so for example
+% \begin{quote}
+% |\captionsetup{font=small}|\\
+% |\captionsetup{font+=it}|
+% \end{quote}
+% is identical to
+% \begin{quote}
+% |\captionsetup{font={small,it}}|
+% \end{quote}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{Margins and further paragraph options}
+% \label{margins}
+%
+% \DescribeMacro{margin=}
+% \DescribeMacro{width=}
+% For all captions you can specify \emph{either} an extra margin \emph{or}
+% a fixed width:~\footnote{Only fixed widths are supported here; if you are
+% looking for a way to limit the width of the caption to the width of the
+% figure or table, please take a look at the \package{floatrow}\cite{floatrow}
+% or \package{threeparttable}\cite{threeparttable} package.}
+% \begin{quote}\begin{tabular}{@{}r@{}ll}
+% |margin=| & \meta{amount} & \emph{--or--}\\
+% |margin=| & |{|\meta{left amount}|,|\meta{right amount}|}| & \emph{--or--}\\
+% |width=| & \meta{amount} & \\
+% \end{tabular}\end{quote}
+% \NEWfeature{v3.1}
+% If you specify just one \meta{amount} for the margin, it will be used for
+% both, the left and right margin, e.g.~|margin=|\x|10pt| is equivalent to
+% |margin=|\x|{10pt,10pt}|.
+% In two-side documents the left and right margin will be swapped on even pages.
+% \DescribeMacro{oneside}
+% \DescribeMacro{twoside}
+% To prevent this you can specify the option |oneside| additionally,
+% e.g.~|\caption|\-|setup{margin=|\x|{0pt,10pt},|\x|oneside}|.\par
+% But if you are specifying a width, then both, the left and the right margin,
+% will have the same amount.
+%
+% Three examples will illustrating this:
+% \begin{Example}
+% \begin{quote}
+% |margin=10pt|
+% \end{quote}
+% \captionsetup{skip=0pt}
+% \example{margin=10pt}{\exampletext}
+% \end{Example}
+%
+% \begin{Example}
+% \begin{quote}
+% |margin={1cm,0cm}|
+% \end{quote}
+% \captionsetup{skip=0pt}
+% \example{margin={1cm,0cm}}{\exampletext}
+% \end{Example}
+%
+% \begin{Example}
+% \begin{quote}
+% |width=.75\textwidth|
+% \end{quote}
+% \captionsetup{skip=0pt}
+% \example{width=.75\textwidth}{\exampletext}
+% \end{Example}
+%
+% \begin{Note}
+% When the caption is placed beside the contents (for example in a |SC|\-|figure|
+% environment offered by the \package{sidecap} package\cite{sidecap}) or the
+% figure is an in-text figure (for example in a |wrap|\-|figure| environment
+% offered by the \package{wrapfig} package\cite{wrapfig}), the margin setting
+% will be automatically reset to |0pt| at the very beginning of the environment.
+% But if you really want to setup an extra margin for these environments, you can
+% do so by setting this margin either inside the environment itself, of by
+% specifying a margin for this particular environment,
+% e.g.~|\caption|\-|setup[SC|\-|figure]{margin=|\x|10pt}|.
+% \end{Note}
+%
+% \begin{Expert}
+% \DescribeMacro{margin*=}
+% \NEWfeature*{v3.1}
+% There is also a starred variant of the |margin=| option, |margin*=|, which only
+% changes the margin if no width was set.
+% \end{Expert}
+%
+% \begin{Expert}
+% \DescribeMacro{minmargin=}
+% \DescribeMacro{maxmargin=}
+% \NEWfeature*{v3.1}
+% You can also set a minimum or maximum margin amount. This can be useful for
+% limiting the margin amount in smaller environments, e.g.~|minipage|s.
+% For example the \SmF\ document classes limit the margin amount to
+% |maxmargin=|\x|0.1\linewidth|. (See \Ref{SMF})
+% \end{Expert}
+%
+% \medskip
+%
+% \pagebreak[3]
+% \DescribeMacro{parskip=}
+% This option is useful for captions containing more than one paragraph.
+% It specifies the extra vertical space inserted between them:
+% \begin{quote}
+% |parskip=|\meta{amount}
+% \end{quote}
+% One example:
+% \begin{Example}
+% \begin{quote}
+% |margin=10pt,parskip=5pt|
+% \end{quote}
+% \captionsetup{skip=0pt}
+% \example{margin=10pt,parskip=5pt}{%
+% First paragraph of the caption. This one contains some test, just to
+% show how these options affect the layout of the caption.\par
+% Second paragraph of the caption. This one contains some text, too, to
+% show how these options affect the layout of the caption.}
+% \end{Example}
+%
+% \pagebreak[3]
+% \DescribeMacro{hangindent=}
+% The option
+% \begin{quote}
+% |hangindent=|\meta{amount}
+% \end{quote}
+% is for setting up a hanging indention starting from the second line of each
+% paragraph. If the caption contains just a single paragraph, using this option
+% leads to the same result as the option |indention=|\meta{amount} you already
+% know about.
+% But if the caption contains multiple paragraphs you will notice the difference:
+%
+% \begin{Example}
+% \begin{quote}
+% |format=hang,indention=-.5cm|
+% \end{quote}
+% \captionsetup{skip=0pt}
+% \example{format=hang,indention=-.5cm}{%
+% First paragraph of the caption. This one contains some test, just to
+% show how these options affect the layout of the caption.\par
+% Second paragraph of the caption. This one contains some text, too, to
+% show how these options affect the layout of the caption.}
+% \end{Example}
+%
+% \begin{Example}
+% \begin{quote}
+% |format=hang,hangindent=-.5cm|
+% \end{quote}
+% \captionsetup{skip=0pt}
+% \example{format=hang,hangindent=-.5cm}{%
+% First paragraph of the caption. This one contains some test, just to
+% show how these options affect the layout of the caption.\par
+% Second paragraph of the caption. This one contains some text, too, to
+% show how these options affect the layout of the caption.}
+% \end{Example}
+%
+% \begin{Note}
+% If your caption contains more than one paragraph, you have
+% to specify an alternative caption for the list-of-figures using the
+% optional argument of |\caption| or |\caption|\-|of|, otherwise you will
+% get an error message.
+% \end{Note}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \PageBreak
+% \subsection{Styles}
+% \label{style}
+%
+% \DescribeMacro{style=}
+% A suitable combination of caption options is called \emph{caption style}.
+% You can compare them more or less to page styles which you set up with
+% |\page|\-|style|;
+% the caption style provides all settings for a whole caption layout.
+%
+% You switch to an already defined caption style with the option
+% \begin{quote}
+% |style=|\meta{style name}\quad.
+% \end{quote}
+% \Thispackage\ pre-defines two styles: |base| and |default|.
+%
+% \NEWfeature{v3.1}
+% The |base| style puts all options you already know about to values reflecting
+% the look of the captions when using one of the base \LaTeX\ document classes
+% \class{article}, \class{report}, and \class{book}.
+% This means that specifying the option
+% \begin{quote}
+% |style=base|
+% \end{quote}
+% has the same effect as specifying all these options:
+% \begin{quote}
+% |format=plain,labelformat=default,labelsep=colon,|\\
+% |justification=justified,font={},labelfont={},|\\
+% |textfont={},margin=0pt,indention=0pt|\\
+% |parindent=0pt,hangindent=0pt,singlelinecheck=true|
+% \end{quote}
+% \begin{Annotation*}
+% But |justification=centering,indention=0pt| will be set if
+% the caption fits into a single line.
+% \end{Annotation*}
+%
+% In contrast the |default| style follows the default values, reflecting
+% the look of the captions given by the document class you actually use.
+% This style is selected by default and represents these options:
+% \begin{quote}
+% |format=default,labelformat=default,labelsep=default,|\\
+% |justification=default,font=default,labelfont=default,|\\
+% |textfont=default,margin=0pt,indention=0pt|\\
+% |parindent=0pt,hangindent=0pt,singlelinecheck=true|
+% \end{quote}
+% \begin{Annotation*}
+% But again |justification=centering,indention=0pt| will be set if
+% the caption fits into a single line.
+% \end{Annotation*}
+%
+% So if you use one of the base \LaTeX\ document classes \class{article},
+% \class{report}, or \class{book}, both caption styles, |base| and |default|,
+% point to (nearly) the same settings.
+%
+% \begin{Note}
+% Own caption styles can be defined using |\Declare|\-|Caption|\-|Style|.\LineBreak
+% \SeeUserDefined
+% \end{Note}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{Skips}
+% \label{skips}
+%
+% \DescribeMacro{skip=}
+% The vertical space between the caption and the figure or table contents is
+% controlled by the option
+% \begin{quote}
+% |skip=|\meta{amount}\quad.
+% \end{quote}
+% The standard \LaTeX\ document classes \class{article}, \class{report} and
+% \class{book} preset it to |skip=|\x|10pt|, but other document classes may
+% use a different amount.
+%
+% \bigskip
+%
+% \pagebreak[3]
+% \DescribeMacro{position=}
+% The |\caption| command offered by \LaTeX{} has a design flaw:
+% The command does not know if it stands on the beginning of the figure or
+% table, or at the end. Therefore it does not know where to put the space
+% separating the caption from the content of the figure or table.
+% While the standard implementation always puts the space above the caption
+% in floating environments (and inconsistently below the caption in
+% |long|\-|table|s), the implementation offered by this package is more
+% flexible:
+% By giving the option
+% \begin{quote}
+% |position=top|\quad or\quad |position=above|
+% \end{quote}
+% it's assumed that the caption is standing at the \emph{top} of the
+% environment and therefore the space setup with |skip=|\x\meta{amount}
+% is placed below the caption.
+% (Please note that |position=|\x|top| does \emph{NOT} mean that the
+% caption is actually placed at the top of the figure or table.
+% Instead the caption is usually placed where you place the |\caption|
+% command.)
+% But with
+% \begin{quote}
+% |position=bottom|\quad or\quad |position=below|
+% \end{quote}
+% it's assumed that the caption is standing at the \emph{bottom} of the
+% environment and therefore the space is placed above the caption.
+% And finally with
+% \begin{quote}
+% |position=auto|\quad {\small(which is the default setting)}
+% \end{quote}
+% \thispackage\ tries its best to determine the actual position of
+% the caption on its own. Please note that while this is successfully in
+% most cases, it could give wrong results under rare circumstances.
+%
+% \medskip
+%
+% \pagebreak[3]
+% \DescribeMacro{figureposition=}
+% \DescribeMacro{tableposition=}
+% The |position| option is especially useful when used together with the
+% optional argument of the |\caption|\-|setup| command.
+% \See{also \Ref{captionsetup}}\par
+% For example
+% \begin{quote}
+% |\captionsetup[table]{position=above}|
+% \end{quote}
+% causes all captions within tables to be treated as captions \emph{above}
+% the table (regarding spacing around it).
+% Because this is a very common setting, \thispackage\ offers
+% the abbreviating options |figure|\-|position=|\x\meta{pos} and
+% |table|\-|position=|\x\meta{pos}, e.g.
+% \begin{quote}
+% |\usepackage[|\ldots|,tableposition=top]{caption}|
+% \end{quote}
+% is equivalent to
+% \begin{quote}
+% |\usepackage[|\ldots|]{caption}|\\
+% |\captionsetup[table]{position=top}|
+% \end{quote}
+%
+% \medskip
+%
+% \INFO
+% Please note that the options |skip=|, |position=|, |figure|\-|position=|,
+% and |table|\-|position=| do not always have an effect.
+% Since it's a matter of the document class to supply the environments
+% |figure| and |table|, it could use its very own spacing, and could
+% decide for itself if the caption will be typeset as ``top'' or ``bottom''
+% caption.
+% For example the \KOMAScript\ document classes support the |skip=|
+% setting, but will always typeset |figure| captions as ``bottom'' captions,
+% and |table| captions are dependent on the global option
+% |table|\-|captions|\-|above| resp.\ |table|\-|captions|\-|below|.
+% \See{\Ref{KOMA}}
+%
+% Furthermore some packages control the behavior of the spacing above and
+% below the caption for themself, e.g.~the \package{float}, the
+% \package{floatrow}, and the \package{supertabular} package.
+%
+% \bigskip
+%
+% \begin{Expert*}
+% Internally the skip between caption and contents is represented by
+% |\above|\-|caption|\-|skip| (which is always set above the caption in
+% \LaTeX{}s implementation).
+% But there is a second value |\below|\-|caption|\-|skip| (usually set to
+% |0pt| by default) which is set below the caption in \LaTeX{}s implementation,
+% but on the other side than |\above|\-|caption|\-|skip| by this package.
+% So technically speaking, this package swaps the meaning of these two skips
+% when |position=|\x|top| is set.
+% Please note that there are several packages around which do the same trick
+% (like the \package{ftcap}, the \package{nonfloat}, and the \package{topcap}
+% package), so the usage of the \package{caption} option |position=| is not
+% supported if one of these packages will be used, too.
+% \end{Expert*}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{Lists}
+% \label{lists}
+%
+% \DescribeMacro{list=}
+% \NEWfeature*{v3.1}
+% The |\caption| command usually places an entry in the List of Figures
+% resp.~List of Tables. You can either suppress that individually by giving an
+% empty optional argument to |\caption| {\small(see \Ref{caption})}, or
+% programmatically by saying
+% \begin{quote}
+% |list=no|\quad(or any other boolean value instead of |no|)\quad.~\footnote{%
+% Please note that the \package{subfig} package\cite{subfig} is not supporting
+% this option, it uses the counters \texttt{lofdepth} \& \texttt{lotdepth} for
+% this purpose instead.}
+% \end{quote}
+%
+% \pagebreak[3]
+% \DescribeMacro{listformat=}
+% \NEWfeature*{v3.1}
+% With the option
+% \nopagebreak[3]
+% \begin{quote}
+% |listformat=|\meta{list format name}
+% \end{quote}
+% \nopagebreak[3]
+% you can specify how the |figure| or |table| number will be typeset within
+% the List of Figures resp.~List of Tables.
+% There are five standard caption list formats:
+%
+% \begin{Options}{\OptionLabel}
+% \item[empty]
+% No number will be typeset.
+%
+% \item[simple]
+% The number will be typeset with label prefix.
+%
+% \item[parens]
+% The number will be typeset in parentheses, with label prefix.
+%
+% \item[subsimple]
+% Same as |simple|, but without label prefix. (default)
+%
+% \item[subparens]
+% Same as |parens|, but without label prefix.
+%
+% \item[\UserDefined]
+% Own list formats can be defined using |\Declare|\-|Caption|\-|List|\-|Format|.
+% \SeeUserDefined
+% \end{Options}
+%
+% The prefix ($=$|\p@figure| resp.~|\p@table|), which runs ahead of the
+% number ($=$|\the|\-|figure| resp.~|\the|\-|table|) in lists (e.g.~List of
+% Figure/Table) and references, is usually empty,
+% so the list formats |simple| and |subsimple| gives equal results;
+% same with |parens| and |subparens|.
+% But this can be different for sub-figures or sub-tables listed in the List of
+% Figures resp.~List of Tables, or when the label prefix is redefined for a
+% different purpose.\footnote{%
+% Sub-figures and sub-tables can be typeset using the \package{subcaption}
+% or \package{subfig} package.}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{Names}
+% \label{names}
+%
+% \DescribeMacro{name=}
+% \NEWfeature*{v3.1}
+% The option
+% \begin{quote}
+% |name=|\meta{name}
+% \end{quote}
+% changes the name of the \emph{current} environment.
+% This could be useful in conjunction with the optional argument of
+% |\caption|\-|setup|, e.g.
+% \begin{quote}
+% |\captionsetup[wrapfigure]{name=Fig.}|
+% \end{quote}
+% changes the name to ``Fig.'' for all |wrap|\-|figure|s (while all the other
+% figure captions will still have ``Figure'' as name).
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{Types}
+% \label{types}
+%
+% \DescribeMacro{type=}
+% The |\caption| command can typeset captions for different types,
+% e.g.~|figure| and |table|. If you try to use the |\caption| command outside
+% these environments you will get an error message, because it does not know what
+% kind of caption do you want to have here. But in such situations you can set
+% the caption type manually with
+% \begin{quote}
+% |type=|\meta{float type}
+% \end{quote}
+% prior to the usage of the |\caption| command (and other commands like
+% |\Continued|\-|Float|, or |\sub|\-|caption|\-|box| offered by the
+% \package{subcaption} package, or |\sub|\-|float| offered by the
+% \package{subfig} package\cite{subfig}),
+% for example within an non-floating environment like |minipage|:
+% \begin{quote}
+% |\noindent\begin{minipage}{\textwidth}|\\
+% | \captionsetup{type=figure}|\\
+% | \subfloat{|\ldots|}|\\
+% | |\ldots\\
+% | \caption{|\ldots|}|\\
+% |\end{minipage}|
+% \end{quote}
+%
+% \begin{Expert}
+% There is also a starred variant of this option, |type*=|\meta{float type},
+% which behaves different than |type=|\meta{float type} if the
+% \package{hyperref} package\cite{hyperref} is loaded: While |type=| sets an
+% hyperlink anchor (if |hypcap=|\x|true| is set), |type*=| does not.
+% (See also \Ref{hyperref}\,)
+% \end{Expert}
+% \begin{Expert}
+% \emph{\DefaultNoteText:} Please don't re-define the internal macro |\@captype|
+% for yourself, like suggested by some documentations, always use
+% |\caption|\-|setup{type=|\x\ldots|}| instead.
+% \end{Expert}
+%
+% \medskip
+%
+% Own float types can be defined with
+% |\Declare|\-|Floating|\-|Environment| offered by the \package{newfloat} package,
+% |\new|\-|float| offered by the \package{float} package\cite{float}, or
+% |\Declare|\-|New|\-|Float|\-|Type| offered by the \package{floatrow} package\cite{float}.
+%
+% \medskip
+%
+% \INFO % \NEWdescription{v3.1}
+% Please note that you should use the option |type=| only
+% \emph{inside} boxes or environments (like |\par|\-|box| or |mini|\-|page|),
+% at best one where no page break could happen between contents and caption.
+% Furthermore some visual side-effects (e.g.~mixed-up figure and table settings
+% regarding captions) could occur without using a box or environment,
+% therefore a warning message will be issued if you try to do so.\footnote{%
+% You only get this warning message if you use \eTeX\ as underlying \TeX\ engine.}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \section{Commands}
+%
+% \subsection{Typesetting captions}
+% \label{caption}
+% \label{captionlistentry}
+%
+% \DescribeMacro{\caption}
+% The command
+% \begin{quote}
+% |\caption|\oarg{list entry}\marg{heading}
+% \end{quote}
+% typesets the caption inside a floating environment like |figure| or |table|.
+% Well, you already know this, but \thispackage\ offers an extension:
+% If you leave the argument \meta{list entry} empty, no entry in the list of
+% figures or tables will be made. For example:
+% \begin{quote}
+% |\caption[]{A figure without list entry.}|
+% \end{quote}
+%
+% \begin{Expert}
+% Please remember that the \meta{heading} is a so-called \emph{moving} argument,
+% if no \meta{list entry} has been given. But if a \meta{list entry} is given,
+% this argument is moving instead.
+% ``\emph{Moving} argument'' means that the argument will be written to the
+% list-of file, make it appearing in the ``List of Figures'' resp.
+% ``List of Tables'', too.
+% \emph{Moving} arguments are not allowed to contain \emph{fragile} commands,
+% everything must be \emph{robust}, otherwise the argument could get
+% \emph{broken}, resulting in strange errors at the next \LaTeX\ run.
+% Some \emph{fragile} commands could be \emph{protected} by a leading |\protect|,
+% own definitions could get defined with |\Declare|\-|Robust|\-|Command| instead of
+% |\new|\-|command| to make them \emph{robust}.
+%
+% An example: |\caption{${}^{137}_{\phantom{1}55}$Cs}| will cause errors since
+% |\phantom| is \emph{fragile}.
+% So we have either have to use the optional argument \meta{list entry}
+% (e.g.~|\caption[${}^|\x|{137}_|\x|{55}$|\x|Cs]|\x|{${}^|\x|{137}_|\x|{\phantom{1}55}$|\x|Cs}|)
+% or add |\protect| to prevent the |\phantom| command from getting \emph{broken}:
+% |\caption{${}^|\x|{137}_|\x|{|\textcolor{blue}{\cs{protect}}|\phantom{1}55}$|\x|Cs}|.
+%
+% But sometimes even this is not sufficient. The reason behind is the so-called
+% single-line-check: It puts the \meta{heading} into a horizontal box to determine
+% the width of the caption, and this could cause error messages, too.
+% An example:
+% |\caption{A| |scheme.| |\[V_{C}| |\sim| |\left| |\{| |\begin{array}{cc}|
+% |E_{g}| |&| |\textrm{p-n}| |\\| |e\phi_{B}| |&| |\textrm{M-S}| |\end{array}|
+% |\right.| |\]}|.
+% Using |\caption[A| |scheme]{|\ldots|}| is not sufficient here, it's still
+% leading to errors. (``\texttt{Missing \$ inserted.}'')
+% So we have to put a |\caption|\-|setup{single|\-|line|\-|check=|\x|off}|
+% just in front of the |\caption| command additionally.
+%
+% For more information about \emph{moving} arguments and \emph{fragile} \&
+% \emph{robust} commands, take a closer look at your \LaTeX\ manual or visit
+% \url{http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/teTeX/latex/latex2e-html/fragile.html}.
+% \end{Expert}
+%
+% \medskip
+%
+% \pagebreak[3]
+% \DescribeMacro{\caption*}
+% The \package{longtable} package defines the command |\caption*| which
+% typesets the caption without label and without entry in the list of tables.
+% An example:
+% \begin{quote}
+% |\begin{longtable}{|\ldots|}|\\
+% | \caption*{A table}\\|\\
+% | |\ldots\\
+% |\end{longtable}|
+% \end{quote}
+% looks like
+% \DeleteShortVerb{\|}
+% \vskip\intextsep
+% \begin{minipage}{\linewidth}
+% \captionsetup{type=table,position=t}
+% \caption*{A table}
+% \centering
+% \begin{tabular}{r|rr}
+% & x & y \\\hline
+% a & 1 & 2 \\
+% b & 3 & 4 \\
+% \end{tabular}
+% \end{minipage}
+% \vskip\intextsep
+% \MakeShortVerb{\|}
+% \Thispackage\ offers this feature, too, so you can use this command now within
+% every floating environment like |figure| or |table|, like:
+% \begin{quote}
+% |\begin{table}|\\
+% | \caption*{A table}|\\
+% | |\ldots\\
+% |\end{table}|
+% \end{quote}
+%
+% \pagebreak[3]
+% \DescribeMacro{\captionof}
+% \DescribeMacro{\captionof*}
+% Sometimes you want to typeset a caption \emph{outside} a floating environment,
+% putting a figure within a non-floating |mini|\-|page| for instance.
+% For this purpose \thispackage\ offers the command
+% \begin{quote}
+% |\captionof|\marg{float type}\oarg{list entry}\marg{heading}\quad.
+% \end{quote}
+% Note that the first argument, the \meta{float type}, is mandatory here, because
+% the |\captionof| command needs to know which name to put into the caption label
+% (e.g. ``Figure'' or ``Table'') and in which list to put the contents entry.
+% An example:
+% \begin{quote}
+% |\captionof{table}{A table}|
+% \end{quote}
+% typesets captions like this:
+% \begin{Example}
+% \captionsetup{position=top}
+% \captionof{table}{A table}
+% \end{Example}
+%
+% The star variant |\caption|\-|of*| has the same behavior as the |\caption*|
+% command:
+% It typesets the caption without label and without entry to the list of figures
+% or tables.
+%
+% \INFO % \NEWdescription{v3.1}
+% Since |\caption|\-|of| uses the option |type| internally, the same
+% restrictions as for the |type| option apply here, so you should use both
+% |\caption|\-|of| and |\caption|\-|of*| only \emph{inside} boxes or
+% environments, too.
+% \See{\Ref{types}}
+%
+% \bigskip
+%
+% \pagebreak[3]
+% \DescribeMacro{\captionlistentry}
+% \NEWfeature*{v3.1}
+% Under certain circumstances it could be useful to make a list-of-figure
+% (or table) entry on its own.
+% This could be achieved with
+% \begin{quote}
+% |\captionlistentry|\oarg{float type}\marg{list entry}\quad.
+% \end{quote}
+%
+% One example: It's quite easy to have a |long|\-|table| with captions above the
+% contents and a single list entry which points to the first page of the table:
+% \begin{quote}
+% |\begin{longtable}{|\ldots|}|\\
+% | \caption{|\ldots|}\\|\\
+% |\endfirsthead|\\
+% | \caption[]{|\ldots|}\\|\\
+% |\endhead|\\
+% | |\ldots
+% \end{quote}
+% But since the \package{longtable} package does not offer an
+% |\end|\-|first|\-|foot| command, you cannot easily have captions \emph{below}
+% the table contents and a single list entry which points to the first page of
+% the table.
+% Here is were the |\caption|\-|list|\-|entry| command could be used:
+% \begin{quote}
+% |\begin{longtable}{|\ldots|}|\\
+% | \caption[]{|\ldots|}\\|\\
+% |\endfoot|\\
+% | \captionlistentry{|\ldots|}|\\
+% | |\ldots
+% \end{quote}
+%
+% \begin{Annotation*}
+% Another example can be found in \Ref{examples}.
+% \end{Annotation*}
+%
+% \begin{Expert}
+% There is also a starred variant, |\caption|\-|list|\-|entry*|, which does not
+% increment the \meta{float type} counter.
+% (Note that inside |long|\-|table| environments |\caption|\-|list|\-|entry|
+% never increments the |table| counter. See also \Ref{longtable}.)
+% \end{Expert}
+%
+% \begin{Expert}
+% Please note that \meta{list entry} is a \emph{moving} argument, so everything
+% it contains must be \emph{robust}. (See also explanation of |\caption|)
+% \end{Expert}
+%
+% \subsection{Setting options}
+% \label{captionsetup}
+%
+% \DescribeMacro{\captionsetup}
+% We already know the |\caption|\-|setup| command (see \Ref{usage}),
+% but this time we get enlighten about its optional argument
+% \meta{float type}.
+%
+% Remember, the syntax of this command is
+% \begin{quote}
+% |\captionsetup|\oarg{float type}\marg{options}\quad.
+% \end{quote}
+% If a \meta{float type} gets specified, all the \meta{options} don't
+% change anything at this time. Instead they only get marked for a later use,
+% when a caption inside of a floating environment of the particular type
+% \meta{float type} gets typeset.
+% For example
+% \begin{quote}
+% |\captionsetup[figure]|\marg{options}
+% \end{quote}
+% forces captions within a |figure| environment to use the given \meta{options}.
+%
+% Here comes an example to illustrate this:
+% \begin{quote}
+% |\captionsetup{font=small}|\\
+% |\captionsetup[figure]{labelfont=bf,textfont=it}|
+% \end{quote}
+% gives captions like this:
+% \begin{Example}
+% \captionsetup{font=small}
+% \captionsetup[figure]{labelfont=bf,textfont=it}
+% \begingroup
+% \captionof{figure}{A figure}
+% \endgroup
+% \captionsetup{position=top}
+% \begingroup
+% \captionof{table}{A table}
+% \endgroup
+% \end{Example}
+% As you see the command |\caption|\-|setup[figure]{|\ldots|}| only changes
+% the look of the |figure| caption labels, not touching the other ones.
+%
+% As \meta{float type} you can usually give one of these two only:
+% |figure| or |table|.
+% But as we will see later some \LaTeX\ packages (like the \package{floatrow},
+% \package{longtable}, and \package{sidecap} package for example) and also
+% this package offer additional environments with captions and these two
+% commands can also be used with them.
+% \See{\Ref{declare} and \Ref{packages}}
+%
+% \begin{Expert}
+% \NEWfeature{v3.1}
+% There is also a starred variant of |\caption|\-|setup|:
+% \begin{quote}
+% |\captionsetup*|\oarg{float type}\marg{options}
+% \end{quote}
+% While the non-starred variant can give you warnings---for example if the
+% \meta{options} are actually not used throughout the document
+% (e.g.~a |\caption|\-|setup[table]{font=|\x|sf}| without a |table|)---the
+% starred variant will not.
+% \iffalse
+% This can get quite useful when setting generic options which are independent
+% of a specific document.
+% \fi
+% \end{Expert}
+%
+% \medskip
+%
+% \pagebreak[3]
+% \DescribeMacro{\clearcaptionsetup}
+% If you want to get rid of these parameters marked for an automatic use within
+% a particular environment you can use the command
+% \begin{quote}
+% |\clearcaptionsetup|\oarg{option}\marg{float type}\quad.
+% \end{quote}
+%
+% For example |\clearcaptionsetup{figure}| would clear all the extra handling
+% for figures in the example above:
+% \begin{quote}
+% |\captionsetup{font=small}|\\
+% |\captionsetup[figure]{labelfont=bf,textfont=it}|\\
+% \ldots\\
+% | \caption{A figure}|\\
+% \ldots\\
+% |\clearcaptionsetup{figure}|\\
+% \ldots\\
+% | \caption{A figure}|\\
+% \ldots
+% \end{quote}
+% \begin{Example}
+% \captionsetup{font=small}
+% \captionsetup[figure]{labelfont=bf,textfont=it}
+% \begingroup
+% \captionof{figure}{A figure}
+% \endgroup
+% \captionsetup{position=top}
+% \clearcaptionsetup{figure}
+% \begingroup
+% \captionof{figure}{A figure}
+% \endgroup
+% \end{Example}
+%
+% \pagebreak[3]
+% \NEWfeature{v3.1}
+% If an optional argument \meta{option} is given, only the settings regarding
+% this particular \meta{option} are cleared.\footnote{You can only specify
+% \emph{one} option here, not a list of options.
+% If you want to clean more than one option, you need to use more than one
+% \cs{clear}\-\texttt{caption}\-\texttt{setup}.}
+% While the example above not only clears the options
+% |labelfont=bf,|\x|textfont=it|
+% for figures (but all options for figures instead),
+% this one would only clear the |labelfont=bf| setting, leaving all other
+% settings for figures intact:
+% \begin{quote}
+% |\captionsetup{font=small}|\\
+% |\captionsetup[figure]{labelfont=bf,textfont=it}|\\
+% \ldots\\
+% | \caption{A figure}|\\
+% \ldots\\
+% |\clearcaptionsetup[labelfont]{figure}|\\
+% \ldots\\
+% | \caption{A figure}|\\
+% \ldots
+% \end{quote}
+% \begin{Example}
+% \captionsetup{font=small}
+% \captionsetup[figure]{labelfont=bf,textfont=it}
+% \begingroup
+% \captionof{figure}{A figure}
+% \endgroup
+% \captionsetup{position=top}
+% \clearcaptionsetup[labelfont]{figure}
+% \begingroup
+% \captionof{figure}{A figure}
+% \endgroup
+% \end{Example}
+% \begin{Expert}
+% Analogous to |\caption|\-|setup*| there is also a starred form
+% |\clear|\-|caption|\-|setup*| which suppresses warnings if the given
+% \meta{option} was not setup for the specified \meta{float type}.
+% \end{Expert}
+%
+% \medskip
+%
+% \pagebreak[3]
+% \DescribeMacro{\showcaptionsetup}
+% For debugging purposes the command
+% \nopagebreak[3]
+% \begin{quote}
+% |\showcaptionsetup|\marg{float type}
+% \end{quote}
+% \nopagebreak[3]
+% is offered. It generates a log file entry, showing the given options
+% for the specified \meta{float type}. For example
+% \begin{quote}
+% |\captionsetup[figure]{labelfont=bf,textfont=it}|\\
+% |\showcaptionsetup{figure}|
+% \end{quote}
+% gives the info:
+% \begin{quote}\small
+% |Caption Info: Option list on `figure'|\\
+% |Caption Data: {labelfont=bf,textfont=it} on input line 5.|
+% \end{quote}
+%
+% \pagebreak[3]
+% \subsection{Continued floats}
+% \label{ContinuedFloat}
+%
+% \DescribeMacro{\ContinuedFloat}
+% Sometimes you want to split figures or tables without giving them
+% their own reference number. This is what the command
+% \begin{quote}
+% |\ContinuedFloat|
+% \end{quote}
+% is for; it should be used as first command inside the floating environment.
+% It prevents the incrementation of the relevant counter (usually done by
+% |\caption|), so a figure or table containing a |\Continued|\-|Float| inside
+% gets the same reference number as the figure or table before.
+% An example:
+% \begin{quote}
+% |\begin{table}|\\
+% | \caption{A table}|\\
+% | |\ldots\\
+% |\end{table}|\\
+% \ldots\\
+% |\begin{table}\ContinuedFloat|\\
+% | \caption{A table (cont.)}|\\
+% | |\ldots\\
+% |\end{table}|
+% \end{quote}
+% gives the following result:
+% \begin{Example}
+% \captionsetup{type=table,position=b,skip=0pt}
+% \caption{A table}
+% \centerline{\ldots}
+% \end{Example}
+% \begin{Example}
+% \captionsetup{type=table,position=b,skip=0pt}
+% \ContinuedFloat
+% \caption{A table (cont.)}
+% \centerline{\ldots}
+% \end{Example}
+%
+% \bigskip
+%
+% \NEWfeature{v3.1}
+% Furthermore the |\Continued|\-|Float| command executes options associated with
+% the type name ``|Continued|\-|Float|''. For example this can be used to switch
+% to a different label format for continued figures or tables, as shown here:
+% \begin{quote}
+% |\DeclareCaptionLabelFormat{continued}{Continued #1~#2}|\\
+% |\captionsetup[ContinuedFloat]{labelformat=continued}|\\
+% \ldots\\
+% |\begin{table}\ContinuedFloat|\\
+% | \caption{A table}|\\
+% | |\ldots\\
+% |\end{table}|
+% \end{quote}
+% \begin{Example}
+% \captionsetup{type=table,position=b,skip=0pt}
+% \captionsetup[ContinuedFloat]{labelformat=continued1}
+% \ContinuedFloat
+% \caption{A table}\label{continued1}
+% \centerline{\ldots}
+% \end{Example}
+% \smallskip
+% \See{\Ref{declare} for an explanation of
+% \cs{Declare}\-\texttt{Caption}\-\texttt{Label}\-\texttt{Format}.}
+%
+% \medskip
+%
+% There is also a \LaTeX\ counter called |Continued|\-|Float| which could be
+% used for own purposes.
+% For ordinary (floating) environments it's set to zero, to one for the first
+% continued float, to two inside the second one, and so on.
+% So every |\Continued|\-|Float| increments this counter and a floating
+% environment without |\Continued|\-|Float| command resets this counter to zero.
+% An example:
+% \begin{quote}
+% |\DeclareCaptionLabelFormat{cont}{#1~#2\alph{ContinuedFloat}}|\\
+% |\captionsetup[ContinuedFloat]{labelformat=cont}|\\
+% \ldots\\
+% |\begin{table}\ContinuedFloat|\\
+% | \caption{A table}|\\
+% | |\ldots\\
+% |\end{table}|
+% \end{quote}
+% \begin{Example}
+% \captionsetup{type=table,position=b,skip=0pt}
+% \captionsetup[ContinuedFloat]{labelformat=continued2}
+% \ContinuedFloat
+% \caption{A table}\label{continued2}
+% \centerline{\ldots}
+% \end{Example}
+% \medskip
+% A reference to this table would still result in the output
+% ``\autoref{continued2}'' since only the caption label format was changed.
+% If you would like to use the |Continued|\-|Float| counter for the references,
+% too, you could redefine the command |\the|\-|Continued|\-|Float| instead,
+% which will be appended to the figure or table counter automatically in
+% continued floats and is preset to be empty.
+% \begin{quote}
+% |\renewcommand\theContinuedFloat{\alph{ContinuedFloat}}|\\
+% \ldots\\
+% |\begin{table}\ContinuedFloat|\\
+% | \caption{A table}|\\
+% | |\ldots\\
+% |\end{table}|
+% \end{quote}
+% \begin{Example}
+% \captionsetup{type=table,position=b,skip=0pt}
+% \renewcommand\theContinuedFloat{\alph{ContinuedFloat}}
+% \ContinuedFloat
+% \caption{A table}\label{continued3}
+% \centerline{\ldots}
+% \end{Example}
+% \medskip
+% A reference to that table would result in the output ``\autoref{continued3}''.
+%
+% \pagebreak[3]
+% \DescribeMacro{\ContinuedFloat*}
+% Suppose you want to start the first figure or table of such a series with a
+% kind of ``Figure 7a'' and not with ``Figure 7'' (and the second one with
+% ``Figure 7b'' instead of ``Figure 7a'').
+% This is possible, too, by using the starred variant |\Continued|\-|Float*|
+% which---just like |\Continued|\-|Float|---executes options associated with the
+% type name ``|Continued|\-|Float|'' and increments the \LaTeX\ counter
+% |Continued|\-|Float|, \emph{but} marks the first figure or table of a series
+% instead:
+% \begin{quote}
+% |\renewcommand\theContinuedFloat{\alph{ContinuedFloat}}|\\
+% \ldots\\
+% |\begin{figure}\ContinuedFloat*|\\
+% | |\ldots\\
+% | \caption{First figure of a series}|\\
+% |\end{figure}|\\
+% \ldots\\
+% |\begin{figure}\ContinuedFloat|\\
+% | |\ldots\\
+% | \caption{Second figure of a series}|\\
+% |\end{figure}|\\
+% \ldots\\
+% |\begin{figure}\ContinuedFloat|\\
+% | |\ldots\\
+% | \caption{Third figure of a series}|\\
+% |\end{figure}|
+% \end{quote}
+% \begin{Example}
+% \captionsetup{type=figure,position=b,skip=0pt}
+% \renewcommand\theContinuedFloat{\alph{ContinuedFloat}}
+% \begingroup
+% \ContinuedFloat*
+% \centerline{\ldots}
+% \caption{First figure of a series}
+% \endgroup
+% \begingroup
+% \ContinuedFloat
+% \centerline{\ldots}
+% \caption{Second figure of a series}
+% \endgroup
+% \begingroup
+% \ContinuedFloat
+% \centerline{\ldots}
+% \caption{Third figure of a series}
+% \endgroup
+% \end{Example}
+%
+% \begin{Note}
+% Unfortunately \cs{ContinuedFloat*} is not available if the
+% \package{subfig} package\cite{subfig} is loaded.
+% \end{Note}
+%
+% \pagebreak[3]
+% \subsubsection*{A note about longtables}
+% If you want to have a different caption label in |long|\-|table|s (offered
+% by the \package{longtable} package\cite{longtable}) after a page break,
+% this can \emph{not} be archived by using |\Continued|\-|Float|,
+% but instead you could write something like:
+% \begin{quote}
+% |\DeclareCaptionLabelFormat{continued}{Continued #1~#2}|\\
+% \ldots\\
+% |\begin{longtable}{|\ldots|}|\\
+% | \caption{A longtable}\\|\\
+% |\endfirsthead|\\
+% | \captionsetup{labelformat=continued}|\\
+% | \caption[]{A longtable}\\|\\
+% |\endhead|\\
+% | |\ldots\\
+% |\end{longtable}|
+% \end{quote}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \section{Own enhancements}
+% \label{declare}
+%
+% A family of commands is provided to allow users to define their own formats
+% etc.
+% This enables information on separators, justification, fonts, and styles to
+% be associated with a name and kept in one place.
+% (These commands need to appear in the document preamble,
+% this is the part between |\document|\-|class| and |\begin{document}|.)
+%
+% \pagebreak[3]
+% \DescribeMacro{\DeclareCaption-\\Format}
+% You can define your own caption formats using the command
+% \begin{quote}
+% |\DeclareCaptionFormat|\marg{name}\marg{code using \#1, \#2 and \#3}\mbox{\quad.}
+% \end{quote}
+% At usage the system replaces \#1 with the caption label, \#2 with the
+% separator and \#3 with the text. So the standard format |plain| is
+% pre-defined by \thispackage\ as
+% \begin{quote}
+% |\DeclareCaptionFormat{plain}{#1#2#3\par}|\quad.
+% \end{quote}
+% \begin{Expert}
+% There is also a starred variant, |\Declare|\-|Caption|\-|Format*|,
+% which causes the code being typeset in \TeX s vertical (instead of
+% horizontal) mode, but does not support the |indention=| option.
+% \end{Expert}
+%
+% \pagebreak[3]
+% \DescribeMacro{\DeclareCaption-\\LabelFormat}
+% Likewise you can define your own caption label formats:
+% \begin{quote}
+% |\DeclareCaptionLabelFormat|\marg{name}\marg{code using \#1 and \#2}
+% \end{quote}
+% At usage \#1 gets replaced with the name (e.g. ``figure'') and \#2
+% gets replaced with the reference number (e.g. ``12'').
+% An example:
+% \begin{quote}
+% |\DeclareCaptionLabelFormat{bf-parens}{(\textbf{#2})}|\\
+% |\captionsetup{labelformat=bf-parens,labelsep=quad}|
+% \end{quote}
+% \example*{labelformat=bf-parens,labelsep=quad}{\exampletext}
+%
+% \pagebreak[3]
+% \DescribeMacro{\bothIfFirst}
+% \DescribeMacro{\bothIfSecond}
+% If you define your own caption label formats and use the
+% \package{subcaption} or \package{subfig}\cite{subfig} package,
+% you should take care of empty caption label names.
+% For this purpose the commands
+% \begin{quote}
+% |\bothIfFirst|\marg{first arg}\marg{second arg}\quad and\\
+% |\bothIfSecond|\marg{first arg}\marg{second arg}
+% \end{quote}
+% are offered. |\bothIfFirst| tests if the first argument exists (means: is
+% not empty), |\bothIfSecond| tests if the second argument exists. If yes,
+% both arguments get typeset, otherwise none of them.
+%
+% \smallskip
+%
+% \pagebreak[3]
+% For example the standard label format |simple| is \emph{not} defined as
+% \begin{quote}
+% |\DeclareCaptionLabelFormat{simple}{#1~#2}|\mbox{\quad,}
+% \end{quote}
+% because this could cause an extra space if \#1 is empty. Instead |simple|
+% is defined as
+% \begin{quote}
+% |\DeclareCaptionLabelFormat{simple}%|\\
+% | {\bothIfFirst{#1}{~}#2}|\mbox{\quad,}
+% \end{quote}
+% causing the space to appear only if the label name is present.
+%
+% \smallskip
+%
+% \pagebreak[3]
+% \DescribeMacro{\DeclareCaption-\\TextFormat}
+% \NEWfeature*{v3.1}
+% Likewise you can define your own caption text formats:
+% \begin{quote}
+% |\DeclareCaptionTextFormat|\marg{name}\marg{code using \#1}
+% \end{quote}
+% At usage \#1 gets replaced with the caption text.
+%
+% \bigskip
+%
+% \pagebreak[3]
+% \DescribeMacro{\DeclareCaption-\\LabelSeparator}
+% You can define your own caption label separators with
+% \begin{quote}
+% |\DeclareCaptionLabelSeparator|\marg{name}\marg{code}\mbox{\quad.}
+% \end{quote}
+% Again an easy example taken from \thispackage\ itself:
+% \begin{quote}
+% |\DeclareCaptionLabelSeparator{colon}{: }|
+% \end{quote}
+% \begin{Expert}
+% There is also a starred variant, |\Declare|\-|Caption|\-|Label|\-|Separator*|,
+% which causes the code being typeset without using the |label|\-|font=| setting.
+% So for example the label separators |quad|, |new|\-|line|, and |en|\-|dash|
+% are defined in this way.
+% \end{Expert}
+%
+% \bigskip
+%
+% \pagebreak[3]
+% \DescribeMacro{\DeclareCaption-\\Justification}
+% You can define your own caption justifications with
+% \begin{quote}
+% |\DeclareCaptionJustification|\marg{name}\marg{code}\mbox{\quad.}
+% \end{quote}
+% The \meta{code} simply gets typeset just before the caption.
+% E.g.~using the justification |raggedright|, which is defined as
+% \begin{quote}
+% |\DeclareCaptionJustification{raggedright}{\raggedright}|\mbox{\quad,}
+% \end{quote}
+% typesets captions with all lines moved to the left margin.
+%
+% \bigskip
+%
+% \pagebreak[3]
+% \DescribeMacro{\DeclareCaption-\\Font}
+% You can define your own caption fonts with
+% \begin{quote}
+% |\DeclareCaptionFont|\marg{name}\marg{code}\quad.
+% \end{quote}
+% For example this package defines the options |small| and |bf| as
+% \begin{quote}
+% |\DeclareCaptionFont{small}{\small}|\quad and\\
+% |\DeclareCaptionFont{bf}{\bfseries}|\quad.
+% \end{quote}
+% \iffalse
+% The line spacing could be customized using the \package{setspace} package,
+% for example:%\NEWdescription{v3.0h}
+% \begin{quote}
+% |\usepackage{setspace}|\\
+% |\DeclareCaptionFont{singlespacing}{\setstretch{1}}|~\footnote{%
+% \emph{\DefaultNoteText:} Using \cs{singlespacing} does not work here since
+% it contains a \cs{vskip} command.}\\
+% |\DeclareCaptionFont{onehalfspacing}{\onehalfspacing}|\\
+% |\DeclareCaptionFont{doublespacing}{\doublespacing}|\\
+% |\captionsetup{font={onehalfspacing,small},labelfont=bf}|
+% \end{quote}
+% \example{font={onehalfspacing,small},labelfont=bf,singlelinecheck=off}{\exampletext}
+% \fi
+% An example which brings color into life:
+% \begin{quote}
+% |\usepackage{color}|\\
+% |\DeclareCaptionFont{red}{\color{red}}|\\
+% |\DeclareCaptionFont{green}{\color{green}}|\\
+% |\DeclareCaptionFont{blue}{\color{blue}}|\\
+% |\captionsetup{labelfont={blue,bf},textfont=green}|
+% \end{quote}
+% \example*{labelfont={color=blue,bf},textfont={color=green},singlelinecheck=off}{\exampletext}
+% But since \thispackage\ already includes the tricky definition
+% \begin{quote}
+% |\DeclareCaptionFont{color}{\color{#1}}|
+% \end{quote}
+% you can get the same result simply with
+% \begin{quote}
+% |\usepackage{color}|\\
+% |\captionsetup{labelfont={color=blue,bf},|\\
+% | textfont={color=green}}|\quad.
+% \end{quote}
+%
+% \medskip
+%
+% \pagebreak[3]
+% \DescribeMacro{\DeclareCaption-\\Style}
+% You can define your own caption styles with
+% \begin{quote}
+% |\DeclareCaptionStyle|\marg{name}\oarg{additional options}\marg{options}\mbox{\quad.}
+% \end{quote}
+% Remember, caption styles are just a collection of suitable options, saved
+% under a given name. You can wake up these options at any time with the
+% option |style=|\meta{style name}.
+%
+% All caption styles are based on the |base| set of options. (See \Ref{style}
+% for a complete list.) So you only need to specify options which are different
+% to them.
+%
+% If you specify \meta{additional options} they get used in addition when
+% the caption fits into a single line and this check was not disabled with
+% the option |single|\-|line|\-|check=off|.
+%
+% Again a very easy example taken from the core of this package: The
+% caption style |base| is pre-defined as
+% \begin{quote}
+% |\DeclareCaptionStyle{base}%|\\
+% | [justification=centering,indention=0pt]{}|\quad.
+% \end{quote}
+%
+% Something more exciting:
+% \begin{quote}
+% |\DeclareCaptionStyle{mystyle}%|\\
+% | [margin=5mm,justification=centering]%|\\
+% | {font=footnotesize,labelfont=sc,margin={10mm,0mm}}|\\
+% |\captionsetup{style=mystyle}|
+% \end{quote}
+% gives you caption like these ones:
+% \begin{Example}
+% \captionsetup{type=figure,style=mystyle,position=b}
+% \caption{A short caption.}
+% \caption{A long long long long long long long long long
+% long long long long long long long long long
+% long long long long long long long long long caption.}
+% \end{Example}
+%
+% \bigskip
+%
+% \pagebreak[3]
+% \DescribeMacro{\DeclareCaption-\\ListFormat}
+% \NEWfeature*{v3.1}
+% You can define your own caption list formats with
+% \begin{quote}
+% |\DeclareCaptionListFormat|\marg{name}\marg{code using \#1 and \#2}\mbox{\quad.}
+% \end{quote}
+% At usage \#1 gets replaced with the label prefix (e.g.~|\p@figure|),
+% and \#2 gets replaced with the reference number (e.g.~|\thefigure|).
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{Further examples}
+% \label{examples}
+%
+% \subsubsection*{Example 1}
+%
+% If you would like to have a line break between caption label and text
+% you could define it this way:
+% \begin{quote}
+% |\DeclareCaptionFormat{myformat}{#1#2\\#3}|
+% \end{quote}
+% If you select this format with |\caption|\-|setup{format=|\x|myformat}|
+% you get captions like this:
+% \example{format=myformat1,labelfont=bf}{\exampletext}
+% You could even use an indention with this caption format:
+% \begin{quote}
+% |\captionsetup{format=myformat,indention=1cm}|
+% \end{quote}
+% This would look like this:
+% \example{format=myformat1,indention=1cm,labelfont=bf}{\exampletext}
+% Instead, you would like to have an indention only of the first line of
+% the caption text? No problem, e.g.
+% \begin{quote}
+% |\newlength\myindention|\\
+% |\DeclareCaptionFormat{myformat}%|\\
+% | {#1#2\\\hspace*{\myindention}#3}|\\
+% \ldots\\
+% |\setlength\myindention{1cm}|\\
+% |\captionsetup{format=myformat}|
+% \end{quote}
+% would give you captions like
+% \example{format=myformat2,myindention=1cm,labelfont=bf}{\exampletext}
+% But you want to have an caption option for this indention, so you can use
+% it for example with
+% |\caption|\-|setup|\x|[figure]|\x|{my|\-|indention=|\x\ldots|}|?
+% This could be done, too:
+% \begin{quote}
+% |\newlength\myindention|\\
+% |\DeclareCaptionOption{myindention}%|\\
+% | {\setlength\myindention{#1}}|\\
+% |\DeclareCaptionFormat{myformat}%|\\
+% | {#1#2\\\hspace*{\myindention} #3}|\\
+% \ldots\\
+% |\captionsetup{format=myformat,myindention=1cm}|
+% \end{quote}
+% would give the same result as the example above.
+%
+% \subsubsection*{Example 2}
+%
+% You want captions to look like this:
+% \example{format=reverse,labelformat=fullparens,labelsep=fill,labelfont=it}{\exampletext}
+%
+% \pagebreak[2]
+% You could do it this way:
+% \nopagebreak[3]
+% \begin{quote}
+% |\DeclareCaptionFormat{reverse}{#3#2#1}|\\
+% |\DeclareCaptionLabelFormat{fullparens}%|\\
+% | {(\bothIfFirst{#1}{~}#2)}|\\
+% |\DeclareCaptionLabelSeparator{fill}{\hfill}|\\
+% |\captionsetup{format=reverse,labelformat=fullparens,|\\
+% | labelsep=fill,font=small,labelfont=it}|
+% \end{quote}
+%
+% \subsubsection*{Example 3}
+%
+% The caption text should go into the left margin? A possible solution would be:
+% \begin{quote}
+% |\DeclareCaptionFormat{llap}{\llap{#1#2}#3\par}|\\
+% |\captionsetup{format=llap,labelsep=quad,singlelinecheck=no}|
+% \end{quote}
+% As a result you would get captions like this:
+% \example{format=llap,labelsep=quad,singlelinecheck=no,margin=0pt}{\exampletext}
+%
+% \medskip
+%
+% If the indention into the margin shall be fixed, you could use a combination
+% of |\llap| and |\makebox|, for example:
+% \begin{quote}
+% |\DeclareCaptionFormat{llapx}%|\\
+% | {\llap{\makebox[5em][l]{#1}}#3\par}|\\
+% |\captionsetup{format=llapx,singlelinecheck=off}|
+% \end{quote}
+% \example{format=llapx,singlelinecheck=off,skip=0pt,margin=0pt}{\exampletext}
+%
+% \subsubsection*{Example 4}
+%
+% This example puts a figure aside a table, but uses only one common caption for both.
+% This will be achieved by a combination of
+% |\Declare|\-|Caption|\-|Label|\-|Format| and |\caption|\-|list|\-|entry|:
+% \begin{quote}
+% |\DeclareCaptionLabelFormat{andtable}%|\\
+% | {#1~#2 \& \tablename~\thetable}|\\
+% \ldots\\
+% |\begin{figure}|\\
+% | \centering|\\
+% | \includegraphics{|\ldots|}%|\\
+% | \qquad|\\
+% | \begin{tabular}[b]{\ldots}|\\
+% | |\ldots\\
+% | \end{tabular}|\\
+% | \captionlistentry[table]{|\ldots|}|\\
+% | \captionsetup{labelformat=andtable}|\\
+% | \caption{|\ldots|}|\\
+% |\end{figure}|
+% \end{quote}
+% \DeleteShortVerb{\|}%
+% \noindent\begin{minipage}{\linewidth}
+% \captionsetup{type=figure}
+% \centering
+% \includegraphics[width=30pt]{cat}%
+% \qquad
+% \begin{tabular}[b]{r|rr}
+% & x & y \\\hline
+% a & 1 & 2 \\
+% b & 3 & 4 \\
+% \end{tabular}
+% \captionlistentry[table]{A figure and a table with a common caption}
+% \captionsetup{labelformat=andtable}
+% \caption{A figure and a table with a common caption~\footnotemark}
+% \end{minipage}
+% \footnotetext{The picture was taken with permission from the
+% \LaTeX\ Companion\cite{TLC2} examples.}
+% \MakeShortVerb{\|}
+%
+% (Please remember that |\caption|\-|list|\-|entry| increments the figure
+% resp.~table counter.)
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \section{Supported document classes}
+% \label{classes}
+%
+% This section will give you an overview of the document classes the
+% \package{caption} supports, what do they already offer regarding captions,
+% what side effects will occur when using the \package{caption} package with
+% them, and what are the `default' settings for them.
+%
+% \NEWfeature{v3.1}
+% The `default' settings depend on the document class you use; they represent
+% how the class author wanted the captions to look like. So for example
+% setting |format=|\x|default| can give you different visual designs when used
+% with different document classes.
+%
+% \begingroup\setlength\leftmargini{0.3em}% default = 2.5em
+% \INFO
+% If you don't find the document class you use in this section, you usually
+% don't have to worry: Many document classes (e.g.~the \class{octavo} class)
+% are derived from one of the standard document classes \class{article},
+% \class{report}, or \class{book}, and behave the same regarding captions.
+% \Thispackage\ automatically does a compatibility check against the document
+% class used and will give you the clear warning
+% \begin{quote}\footnotesize
+% |Package caption Warning: Unsupported document class (or package) detected,|\\
+% |(caption) usage of the caption package is not recommended.|\\
+% |See the caption package documentation for explanation.|
+% \end{quote}
+% if such an incompatibility was detected.
+% If you don't get such warning everything is fine, but if you get it the
+% usage of \thispackage\ is not recommended and especially not supported.
+% \endgroup
+%
+% \begin{Expert}
+% If you get such a compatibility warning but decide to use \thispackage{}
+% anyway, you should watch carefully what side-effects occur, usually the
+% look and feel of your captions will change by just including \thispackage{}
+% without options, meaning they do not look like as intended by the author
+% of the document class.
+% If this is fine for you, you should first specify the option |style=|\x|base|
+% via |\use|\-|package[style=|\x|base]{caption}| or
+% |\caption|\-|setup{style=|\x|base}| to set \thispackage\ into a well-defined
+% state.
+% Afterwards you can start setting your own options additionally and
+% keep your fingers crossed.
+% \end{Expert}
+%
+% \newcommand*\Option{Option}
+% \newcommand*\defaultvalue{\texttt{default} value}
+% \newcommand*\uses{\textit{uses}}
+% \newcommand*\settings{\textit{settings}}
+% \newcommand*\nofont{\textit{none}}
+%
+% \subsection{Standard \LaTeX: article, report, and book}
+%
+% \begin{tabular}{ll}
+% \Option & \defaultvalue \\\hline
+% |format=| & |plain| \\
+% |labelformat=| & |simple| \\
+% |labelsep=| & |colon| \\
+% |justification=| & |justified| \\
+% |font=| & \nofont \\
+% |labelfont=| & \nofont \\
+% |textfont=| & \nofont \\
+% \end{tabular}
+%
+% \begin{Annotation}
+% This also applies to document classes derived from them.
+% \end{Annotation}
+%
+% \subsection{\AmS: amsart, amsproc, and amsbook}
+% \label{AMS}
+%
+% \begin{tabular}{ll}
+% \Option & \defaultvalue \\\hline
+% |format=| & |plain| \\
+% |labelformat=| & |simple| \\
+% |labelsep=| & |.\enspace| \\
+% |justification=| & |justified| \\
+% |font=| & |\@captionfont| \\
+% |labelfont=| & |\@captionheadfont| \\
+% |textfont=| & |\@captionfont\upshape| \\
+% \end{tabular}
+%
+% \begin{Annotation*}
+% |\@caption|\-|font| will be set to |\normal|\-|font|, and
+% |\@caption|\-|head|\-|font| to |\sc|\-|shape| by the \AmS\ document classes.
+% \end{Annotation*}
+%
+% Furthermore the margin will be set to |\caption|\-|indent| for
+% more-than-one-line captions (which will be set to |3pc| by the \AmS\ classes),
+% the margin for single-line captions will be set to the half of it instead.
+% If you want to use a common margin for both, insert
+% |\clear|\-|caption|\-|setup[margin*]{single|\-|line}|
+% into the preamble of your document, after loading \thispackage.
+%
+% Additionally the options |figure|\-|position=b,|\x|table|\-|position=t|
+% will be set. You can override these settings by specifying other values for
+% |figure|\-|position=| or |table|\-|position=| in the option list while
+% loading \thispackage.
+%
+% \subsection{beamer}
+% \label{beamer}
+%
+% \begin{tabular}{ll}
+% \Option & \defaultvalue \\\hline
+% |format=| & |plain| \\
+% |labelformat=| & \textit{not numbered} \\
+% |labelsep=| & |colon| \\
+% |justification=| & |raggedright| \\
+% |font=| & \class{beamer} ``|caption|'' \settings \\
+% |labelfont=| & \class{beamer} ``|caption name|'' \settings \\
+% |textfont=| & \nofont \\
+% \end{tabular}
+%
+% \subsubsection*{Build-in features, and side-effects}
+% You can setup font and color settings with
+% |\set|\-|beamer|\-|font{caption}|\marg{options} and
+% |\set|\-|beamer|\-|font{caption name}|\marg{options}.
+% This will still work, unless you set a different font with
+% |\caption|\-|setup{font=|\x\meta{options}|}| or
+% |\caption|\-|setup{label|\-|font=|\x\meta{options}|}|.\par
+% Furthermore the \class{beamer} classes offer different caption templates
+% which can be chosen with
+% |\set|\-|beamer|\-|template|\x|{caption}|\x|[|\meta{template}|]|.
+% Since \thispackage\ replaces this caption template mechanism,
+% |\def|\-|beamer|\-|template*|\x|{caption}|\x\marg{template code}
+% and
+% |\set|\-|beamer|\-|template|\x|{caption}|\x|[|\meta{template}|]|
+% will have no effect when \thispackage\ is used.
+% (Exception: Selecting the template |default|, |num|\-|bered|, or
+% |caption| |name| |own| |line| will be recognized by \thispackage and be mapped
+% to corresponding options.)
+%
+% \subsection{\KOMAScript: scrartcl, scrreprt, and scrbook}
+% \label{KOMA}
+%
% \begin{tabular}{ll}
-% \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-eng.pdf}%
-% {\texttt{caption-eng.pdf}} & The English documentation \\
-% \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-rus.pdf}%
-% {\texttt{caption-rus.pdf}} & The Russian documentation\footnotemark \\
-% \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-deu.pdf}%
-% {\texttt{caption-deu.pdf}} & The German documentation \\
+% \Option & \defaultvalue \\\hline
+% |format=| & \uses\ |\setcapindent| \textit{\&} |\setcaphanging| \settings \\
+% |labelformat=| & \textit{like \purett{simple}, but with support of ``autodot''}\\
+% |labelsep=| & |\captionformat| \\
+% |justification=| & |justified| \\
+% |font=| & |\setkomafont{caption}| \settings \\
+% |labelfont=| & |\setkomafont{captionlabel}| \settings \\
+% |textfont=| & \nofont \\
% \end{tabular}
-% \footnotetext{Thanks a lot to Olga Lapko for this translation}
+%
+% \subsubsection*{Build-in features}
+% The \KOMAScript\ document classes offer many ways to customize the look and
+% feel of the captions. For an overview and a full description please take a
+% look at the \KOMAScript\ documentation, section `Tables and Figures'.
+%
+% \subsubsection*{Side effects}
+% The optional argument of |\set|\-|cap|\-|width| is not supported and
+% will be ignored if used in conjunction with the \package{caption} package.
+% Furthermore the \KOMAScript\ options |table|\-|caption|\-|above| \&
+% |table|\-|caption|\-|below| and the commands |\caption|\-|above| \&
+% |\caption|\-|below| are stronger than the |position=| setting offered by
+% the \package{caption} package.
+%
+% \subsection{\NTG: artikel, rapport, and boek}
+% \label{NTG}
+%
+% \begin{tabular}{ll}
+% \Option & \defaultvalue \\\hline
+% |format=| & |plain| \\
+% |labelformat=| & |simple| \\
+% |labelsep=| & |colon| \\
+% |justification=| & |justified| \\
+% |font=| & \nofont \\
+% |labelfont=| & |\CaptionLabelFont| \\
+% |textfont=| & |\CaptionTextFont| \\
+% \end{tabular}
+%
+% \subsubsection*{Build-in features, and side-effects}
+% |\Caption|\-|Label|\-|Font| and |\Caption|\-|Text|\-|Font| can be set either
+% directly or by using |\Caption|\-|Fonts|.
+% Both is still supported unless you use one of the two options
+% |label|\-|font=| or |text|\-|font=| offered by \thispackage.
+%
+% \subsection{\SmF: smfart and smfbook}
+% \label{SMF}
+%
+% Since the \SmF\ document classes are derived from the \AmS\ document classes
+% the same default values are valid here.
+%
+% Additionally the margin is limited up to the tenth of the |\line|\-|width|.
+% If you don't like this limitation, you can switch it off with the option
+% |max|\-|margin=|\x|off| or |max|\-|margin=|\x|false|
+% (which both means the same).
+%
+% \subsection{thesis}
+% \label{thesis}
+%
+% \begin{tabular}{ll}
+% \Option & \defaultvalue \\\hline
+% |format=| & |hang| \\
+% |labelformat=| & \textit{like \purett{simple}, but with short name}\\
+% |labelsep=| & |colon| \\
+% |justification=| & |justified| \\
+% |font=| & \nofont \\
+% |labelfont=| & |\captionheaderfont| \\
+% |textfont=| & |\captionbodyfont| \\
+% \end{tabular}
+%
+% \subsubsection*{Build-in features, and side-effects}
+% The caption label font can be set with |\caption|\-|header|\-|font|,
+% the caption text font with |\caption|\-|body|\-|font|.
+% Both is still supported unless you use one of the two options
+% |label|\-|font=| or |text|\-|font=| offered by \thispackage.
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \section{Supported babel package options}
+% \label{babel}
+%
+% \NEWfeature{v3.5}
+% Since version \version{3.5} of the \package{caption} package the support
+% is independent on the load order of \package{caption} and \package{babel}.
+%
+% \subsection{french babel option}
+% \label{french}
+%
+% If you use the \package{french} option of the \package{babel} package
+% with one of the three standard \LaTeX{} classes (or a one derived from them)
+% the default |label|\-|sep=| will be set to |\Caption|\-|Sep|\-|a|\-|ra|\-|tor|
+% (offered by \package{french}), overriding the default value set by the
+% document class.
+% So redefining |\Caption|\-|Sep|\-|a|\-|ra|\-|tor| will still work, unless you
+% don't select a different |label|\-|sep=| than the default one.
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \section{Supported packages}
+% \label{packages}
+% \label{compatibility}
+%
+% \Thispackage\ was adapted to the following packages which deals with
+% captions, too:
+% \begin{quote}
+% \package{float}, \package{floatflt}, \package{fltpage},
+% \package{hyperref}, \package{hypcap}, \package{listings},
+% \package{longtable}, \package{picinpar}, \package{picins},
+% \package{rotating}, \package{setspace}, \package{sidecap},
+% \package{subfigure}, \package{supertabular}, \package{threeparttable},
+% \package{wrapfig}, and \package{xtab}
+% \end{quote}
+%
+% Furthermore the \package{floatrow} package\cite{floatrow}, the
+% \package{subcaption} package (which is part of the \package{caption} package
+% bundle), and the \package{subfig} package\cite{subfig} support \thispackage{}
+% and use its |\caption|\-|setup| interface.
+%
+% \bigskip
+%
+% \begingroup\setlength\leftmargini{0.3em}% default = 2.5em
+% \INFO
+% If a package (or document class) unknown to \thispackage\ redefines
+% the |\caption| command as well, this redefinition will be preferred
+% over the one this package offers, providing maximum compatibility and
+% avoiding conflicts.
+% If such a potential incompatibility is detected, you will see this
+% warning message:~\footnote{%
+% You can suppress this warning by specifying the option
+% \texttt{compatibility=true} when loading \thispackage.}
+% \begin{quote}\footnotesize
+% |Package caption Warning: \caption will not be redefined since it's already|\\
+% |(caption) redefined by a document class or package which is|\\
+% |(caption) unknown to the caption package.|\\
+% |See the caption package documentation for explanation.|
+% \end{quote}
+% \endgroup
+%
+% As a result, the following features offered by \thispackage\ will not be available:
+% \begin{itemize}
+% \item the options |labelformat=|, |position=auto|, |list=|, and |listformat=|
+% \item |\caption*| (to produce a caption without label)
+% \item |\caption[]{|\ldots|}| (to produce no entry in the List of Figures or Tables)
+% \item |\caption{}| (to produce an empty caption without label separator)
+% \item |\ContinuedFloat|
+% \item correctly justified captions in environments like \texttt{wide} and
+% \texttt{addmargin} which add extra margins
+% \item the \textsf{hypcap} feature \See{\Ref{hyperref}\,}
+% \item the sub-caption feature \See{\package{subcaption} package documentation}
+% \end{itemize}
+%
+% \DescribeMacro{compatibility=}
+% You can override this compatibility mode by specifying the option
+% \begin{quote}
+% |compatibility=false|
+% \end{quote}
+% when loading \thispackage.
+% But please note that using this option is neither recommended nor supported
+% since unwanted side-effects or even errors could occur afterwards.
+% (For that reason you will get a warning about this.)
+%
+% \newcommand\packagedescription[1]{%
+% \ifvmode\else\par\fi
+% \nopagebreak
+% \parbox[b]{\linewidth}{\footnotesize\leftskip=10pt\rightskip=10pt\relax#1}\par
+% \nopagebreak\smallskip\nopagebreak}
+%
+% \PageBreak
+% \subsection{algorithms}
+% \label{algorithms}
+% \packagedescription{%
+% The \package{algorithms} package bundle\cite{algorithms} provides two
+% environments: The \texttt{algorithmic} environment provides a possibility
+% for describing algorithms, and the \texttt{algorithm} environment provides
+% a ``float'' wrapper for algorithms.}
+%
+% Since the \texttt{algorithm} environment is implemented via |\new|\-|float|
+% provided by the \package{float} package\cite{float}, please see \Ref{float}.
+%
+% \iffalse
+% \pagebreak[3]
+% \subsection{algorithm2e}
+% \label{algorithm2e}
+% \packagedescription{%
+% The \package{algorithm2e} package\cite{algorithm2e} offers an environment for
+% writing algorithms in LaTeX2e.}
+%
+% Since the \package{algorithm2e} package does not use some kind of standard
+% interface for defining its floating environment (e.g.~|\newfloat| of the
+% \package{float} package) and typesetting its caption,
+% the \package{algorithm2e} package is \emph{not} supported by \thispackage.
+%
+% So if you want to customize the captions using \thispackage,
+% you have to build a new environment which uses a supported interface regarding
+% floats (e.g. using the \package{float} or \package{floatrow} package),
+% and combine this environment with the internal \package{algorithm2e} code.
+%
+% As first step you could define a non-floating environment \texttt{algorithmic},
+% for example:
+% \begin{quote}
+% |\usepackage{algorithm2e}|\\
+% |% save the "algorithm" environment from the algorithm2e package|\\
+% |\let\ORIGalgorithm\algorithm|\\
+% |\let\ORIGendalgorithm\endalgorithm|\\
+% |% define the algorithmic environment|\\ % , based on the saved environment
+% |\newenvironment{algorithmic}%|\\
+% | {\renewenvironment{algocf}[1][h]{}{}% pass over floating stuff|\\
+% | \ORIGalgorithm}%|\\
+% | {\ORIGendalgorithm}|\\
+% \ldots
+% \end{quote}
+% Having defined this non-floating environment, you could define your own new
+% floating environment with |\newfloat| of the \package{float} package
+% (or |\DeclareNewFloatType| of the \package{floatrow} package),
+% and use the combination of this floating environment and \texttt{algorithmic}
+% in its body, just like you would do when you use the
+% \package{algorithm}/\package{algorithmic} package tandem.
+%
+% You could even use the \package{algorithm} package for this purpose, for example:
+% \begin{quote}
+% \ldots\\
+% |% load the algorithm package to re-define the|\\
+% |% floating environment "algorithm" and \listofalgorithms|\\
+% |\let\listofalgorithms\undefined|\\
+% |\usepackage{algorithm}|\\
+% \ldots\\
+% |% Example usage:|\\
+% |\begin{algorithm}|\\
+% |\caption{An algorithm}|\\
+% |\begin{algorithmic}|\\
+% | \SetVline|\\
+% | \eIf{cond1}{|\\
+% | a line\;|\\
+% | }{|\\
+% | another line\;|\\
+% | }|\\
+% |\end{algorithmic}|
+% \end{quote}
+% Now you are finally able to customize the float and caption layout like every
+% other floating environment defined with the \package{float} package\cite{float},
+% please see \Ref{float}.
+%
+% \begin{Annotation}
+% An alternative would be using the \package{algorithmicx} package.
+% \end{Annotation}
+% \fi
+%
+% \pagebreak[3]
+% \subsection{float}
+% \label{float}
+% \packagedescription{%
+% The \package{float} package\cite{float} introduces the commands
+% \cs{restylefloat} to give existing floating environments a new look \& feel
+% and \cs{newfloat} to define new floating environments.
+% It also provides the ``\texttt{H}'' float placement option which places
+% the environments ``here'' instead of letting them floating around.}
+%
+% For floating environments defined with \cs{newfloat} or \cs{restylefloat} the
+% |po|\-|si|\-|tion| option has no effect on the main caption anymore, since its
+% placement and spacing will be controlled by the selected float style instead.
+%
+% A caption style and options defined with the name of the float style will be
+% executed additionally to the regular ones.
+% Using this mechanism \thispackage\ emulates the default look \& feel of the
+% |ruled| captions: It defines the caption style
+% \begin{quote}
+% |\DeclareCaptionStyle{ruled}%|\\
+% | {labelfont=bf,labelsep=space,strut=off}|\mbox{\quad.}
+% \end{quote}
+% So to change this you need either define your own caption style called
+% |ruled| or use |\caption|\-|setup[ruled]|\marg{options} to specify additional
+% options.
+%
+% Also by using this mechanism the skip between a |boxed| float and its caption
+% is specified, overriding its global value:
+% \begin{quote}
+% |\captionsetup[boxed]{skip=2pt}|
+% \end{quote}
+% For changing this, just use |\caption|\-|setup[boxed]{skip=|\x\meta{value}|}|
+% with an appropriate value. Or if you want to use the global |skip| setting
+% instead, you can remove the usage of the local setting for these floats with
+% |\clear|\-|caption|\-|setup[skip]{boxed}|.
+%
+% \begin{Note}
+% Only one single caption can be typeset inside environments defined with
+% |\new|\-|float| or |\re|\-|style|\-|float|, furthermore these environments
+% are not behaving exactly like the pre-defined floats |figure| and |table|.
+% As a consequence many packages do not cooperate well with these.
+% Furthermore the \package{float} package has some caveats \& limitations,
+% so if you just want to define a new simple floating environment---behaving
+% like |figure| or |table|---I recommend using |\Declare|\-|Floating|\-|Environment|
+% offered by the \package{newfloat} package instead.
+% And for defining non-simple floating environments and customization I
+% recommend using |\Declare|\-|New|\-|Float|\-|Type| offered by the
+% \package{floatrow} package\cite{floatrow}.
+% \end{Note}
+%
+% \iffalse
+% Please also note that you \emph{don't} need a |\restyle|\-|float| for using
+% the ``|H|'' float placement specifier. Some docs say so, but they are
+% wrong.
+% And |\restyle|\-|float{table}| is a very good method to shoot yourself
+% in the foot, since many packages using |table| internally are not working
+% correctly afterwards.
+% \fi
+%
+% \pagebreak[3]
+% \subsection{floatflt}
+% \label{floatflt}
+% \packagedescription{%
+% The \package{floatflt} package\cite{floatflt} offers figures and tables
+% which do not span the full width of a page and are float around by text.}
+%
+% \NEWfeature{v3.1}
+% If you want to setup special options for the |float|\-|ing|\-|figure| and
+% |float|\-|ing|\-|table| environments you can use
+% \begin{quote}
+% |\captionsetup[floatingfigure]|\marg{options}\quad\emph{and}\\
+% |\captionsetup[floatingtable]|\marg{options}\quad.
+% \end{quote}
+% These options will be executed additionally to the regular ones for
+% |figure| resp.~|table|.
+%
+% \begin{Note}
+% The |margin| resp.~|width| setting will not be used for these figures resp.~tables,
+% unless you set it explicit with |\caption|\-|setup[floating|\-|figure]{|\ldots|}|
+% resp.~|\caption|\-|setup[floating|\-|table]{|\ldots|}|.
+% \end{Note}
+%
+% \pagebreak[3]
+% \subsection{fltpage}
+% \label{fltpage}
+% \packagedescription{%
+% The \package{fltpage} package\cite{fltpage} offers the outhouse of the
+% caption for |figure|s or |table|s which needs the whole page
+% for its contents. This will be done by placing the caption on the bottom
+% of the previous or next page.}
+%
+% \iffalse
+% \NEWfeature{v3.1}
+% Two options control the links to the environments |FPfigure| and |FPtable|:
+% \begin{description}
+% \item{\texttt{FPlist=caption} or \texttt{FPlist=figure}}\\[\smallskipamount]
+% If set to |caption|, the list entry will link to the caption; if set to
+% |figure|, it will link to the figure contents.
+% (The default setting is |FP|\-|list=|\x|caption|.)
+% \item{\texttt{FPref=caption} or \texttt{FPref=figure}}\\[\smallskipamount]
+% If set to |caption|, a \cs{ref}, \cs{pageref}, \cs{autoref}, or \cs{nameref}
+% will link to the caption; if set to |figure|, it will link to the figure contents.
+% (The default setting is |FP|\-|ref=|\x|figure|.)
+% \end{description}
+% \fi
+%
+% If you want to setup special options for the |FPfigure| and |FPtable|
+% environments you can use
+% \begin{quote}
+% |\captionsetup[FPfigure]|\marg{options}\quad\emph{and}\\
+% |\captionsetup[FPtable]|\marg{options}\quad.
+% \end{quote}
+% These options will be executed additionally to the regular ones for
+% |figure| or |table|.
+%
+% \pagebreak[3]
+% \subsection{frenchle and frenchpro packages}
+% \label{frenchpro}
+%
+% If you use the \package{frenchle} or \package{frenchpro} package,
+% the default |label|\-|sep=| will be set to |\caption|\-|sep|\-|a|\-|ra|\-|tor|
+% (offered by \package{frenchle/pro}) plus \cs{space}, overriding the default
+% value set by the document class.
+% So redefining |\caption|\-|sep|\-|a|\-|ra|\-|tor| will still work, unless you
+% don't select a different |label|\-|sep=| than the default one.
+%
+% Furthermore the default |text|\-|font=| will be set to |text|\-|font=|\x|it|,
+% since this emulates the default setting of |\caption|\-|font| defined by the
+% \package{frenchle} or \package{frenchpro} package.
+% Please note that the command |\caption|\-|font| is used by the
+% \package{caption} package internally for a different purpose,
+% so you should not change it (anymore).
+%
+% The command |\un|\-|numbered|\-|captions|\marg{figure \emph{or} table} will
+% still work, but only unless you don't select a different |label|\-|format=|
+% than the default one.
+%
+% \NEWfeature{v3.5}
+% Since version \version{3.5} of the \package{caption} package the support
+% is independent on the load order of \package{caption} and \package{frenchle}
+% resp~.\package{frenchpro}.
+%
+% \pagebreak[3]
+% \subsection{hyperref}
+% \label{hyperref}
+% \packagedescription{%
+% The \package{hyperref} package\cite{hyperref} is used to handle cross
+% referencing commands in LaTeX to produce hypertext links in the document.}
+%
+% \NEWfeature{v3.1}
+% There are two options available to control the placement of hyperlink
+% anchors:~\footnote{These options are named after the \package{hypcap} package
+% which they supersede.}
+% \begin{description}
+% \item{\texttt{hypcap=true} or \texttt{hypcap=false}}\\[\smallskipamount]
+% If set to |true| all hyperlink anchors -- where entries in the
+% List of Figures, |\ref|, and |\auto|\-|ref| will link to -- are placed at
+% the beginning of the (floating) environment.\par
+% If set to |false| the hyperlink anchor is (usually) placed at the caption.\par
+% (The default setting is |hypcap=|\x|true|.)
+% \item{\texttt{hypcapspace=}\meta{amount}}\\[\smallskipamount]
+% Because it looks poor if the hyperlink points exactly at the top of
+% the figure or table, you can specify a vertical distance between
+% the hyperlink anchor and the (floating) environment itself,
+% e.g.~|hyp|\-|cap|\-|space=|\x|0pt| removes this distance.\par
+% (The default setting is |hyp|\-|cap|\-|space=|\x|0.5\base|\-|line|\-|skip|.)
+% \end{description}
+%
+% Both settings have no effect in |lst|\-|listing|s (provided by the
+% \package{listings} package), |long|\-|table|s (provided by the
+% \package{longtable} package), |super|\-|tabular|s (provided by the
+% \package{supertabular} package), and |x|\-|tabular|s (provided by the
+% \package{xtab} package), within these environments hyperlink
+% anchors will always be placed as if |hyp|\-|cap=|\x|true| and
+% |hyp|\-|cap|\-|space=|\x|0pt| would be set.
+%
+% \pagebreak[3]Please note:\nopagebreak
+% \begin{description}
+% \item{\cs{captionof}\marg{type}\csmarg{\purerm\ldots}
+% vs.~\cs{captionsetup}\csmarg{type=\textrm{\meta{type}}}$+$\cs{caption}\csmarg{\purerm\ldots}}%
+% \\[\smallskipamount]
+% Without \package{hyperref} loaded, both will give you identical results.
+% But with \package{hyperref} loaded, and with |hyp|\-|cap=|\x|true| requested,
+% the hyperlink anchor will be placed different.
+% For example:
+% \begin{quote}
+% |\begin{minipage}{\linewidth}|\\
+% | |\ldots\\
+% | \captionof{figure}{A figure}|\\
+% |\end{minipage}|
+% \end{quote}
+% will place the hyperlink anchor at the caption.
+% (And if |hyp|\-|cap=|\x|true| is set, you will get a warning about this.)
+% But
+% \begin{quote}
+% |\begin{minipage}{\linewidth}|\\
+% | \captionsetup{type=figure}|\\
+% | |\ldots\\
+% | \caption{A figure}|\\
+% |\end{minipage}|
+% \end{quote}
+% will place the hyperlink anchor at the beginning of the |mini|\-|page|,
+% since |\caption|\-|setup{type=|\x|figure}| does not only set the caption type
+% to ``figure'' but does place a hyperlink anchor, too.
+%
+% \item{\cs{caption}\csoarg{}\csmarg{\purerm\ldots}
+% vs.~\cs{captionsetup}\csmarg{list=false}$+$\cs{caption}\csmarg{\purerm\ldots}}\\[\smallskipamount]
+% Again, without \package{hyperref} loaded, both will give you identical results.
+% But with \package{hyperref} loaded, the difference is in the nuances.
+% So for example the optional argument of |\caption| will also be written to
+% the |aux| file, and will be used by the |\name|\-|ref| command.
+% So if you choose to use |\caption| with empty optional argument,
+% |\name|\-|ref| will also give you an empty result.
+% So it's better to use |\caption|\-|setup{list=|\x|false}| if you don't
+% want an entry in the List of Figures or List of Tables.
+% \end{description}
+%
+% \pagebreak[3]
+% \subsection{hypcap}
+% \label{hypcap}
+% \packagedescription{%
+% The \package{hyp\-cap} package\cite{hypcap} offers a solution to the problem
+% that links to a float using \package{hyper\-ref} may anchors to the caption
+% rather than the beginning of the float.
+% Since \thispackage\ \version{3.1} already solves this problem for itself,
+% the \package{hypcap} package is usually not needed.}
+%
+% If the \package{hyp\-cap} package is loaded additionally to the
+% \package{hyper\-ref} package, it takes over the control of the hyperlink
+% anchor placement from \thispackage, overriding the options |hyp|\-|cap=|
+% and |hyp|\-|cap|\-|space=|.
+%
+% So for a manual placement of hyperlink anchors
+% |\caption|\-|setup{type=|\x\meta{type}|}| is not sufficient anymore,
+% instead you need to use |\cap|\-|start| (provided by the \package{hyp\-cap}
+% package) for this.
+%
+% Regarding the automatically placement the \package{hypcap} package offers good
+% placement of hyperlink anchors for the floating environments |figure| and
+% |table| only. In contrast the |hypcap=|\x|true| option of \thispackage\ also
+% offers good placements of hyperlink anchors for
+% |floating|\-|figure|s (provided by the \package{float\-flt} package),
+% |FP|\-|figure|s \& |FPtable|s (provided by the \package{flt\-page} package),
+% |fig|\-|window|s (provided by the \package{pic\-in\-par} package),
+% |par|\-|pic|s (provided by the \package{pic\-ins} package),
+% |SC|\-|figure|s (provided by the \package{side\-cap} package),
+% |three|\-|part|\-|table|s (provided by the \package{three\-part\-table} package),
+% and |wrapfigure|s (provided by the \package{wrap\-fig} package).
+%
+% \pagebreak[3]
+% \subsection{listings}
+% \label{listings}
+% \packagedescription{%
+% The \package{listings} package\cite{listings} typesets programming code.}
+%
+% If you want to setup special options for the |lst|\-|listing| environment
+% you can use
+% \begin{quote}
+% |\captionsetup[lstlisting]|\marg{options}\quad.
+% \end{quote}
+%
+% Please note that the \package{listings} package has its very own options
+% for controlling the position and the skips of the caption:
+% |caption|\-|pos=|, |above|\-|caption|\-|skip=|, and |below|\-|caption|\-|skip=|.
+% \See{\package{listings} documentation for details.}
+% These \package{listings} options override the \package{caption}'s ones, but
+% can be again overwritten by |\caption|\-|setup[lst|\-|listing]{|\ldots|}|,
+% e.g.%~
+% \begin{quote}|\caption|\-|setup[lst|\-|listing]{skip=|\x|10pt}|\quad.\end{quote}
+%
+% \pagebreak[3]
+% \subsection{longtable}
+% \label{longtable}
+% \packagedescription{%
+% The \package{longtable} package\cite{longtable} offers an environment
+% which behaves similar to the \texttt{tabular} environment, but the table
+% itself can span multiple pages.}
+%
+% If you want to setup special options for the |long|\-|table| environment
+% you can use
+% \begin{quote}
+% |\captionsetup[longtable]|\marg{options}\quad.
+% \end{quote}
+% These options will be executed additionally to the regular ones for
+% |table|.
+%
+% The |margin| and |width| settings usually override |\LT|\-|cap|\-|width|,
+% so you get an equal look \& feel of the captions in |table|s and
+% |long|\-|table|s.
+% But if you set |\LT|\-|cap|\-|width| to a value different than its default
+% $=$ |4in|, \thispackage\ will follow that.
+% (But |\LT|\-|cap|\-|width| will be overwritten by
+% |\caption|\-|setup[long|\-|table]{width=|\x\meta{value}|}|,
+% even if it is set to a value different than |4in|.)
+%
+% \begin{Note}
+% |\caption|\-|of| and |\Continued|\-|Float| do \emph{not} work for |long|\-|table|s.
+% Furthermore neither |\caption| nor |\caption|\-|list|\-|entry| will increment
+% the |table| counter here; it's incremented by the |long|\-|table| environment
+% instead.
+% \NEWfeature{v3.1}
+% If you need a |long|\-|table| which does not increment the |table| counter
+% please use the |long|\-|table*| environment (offered by the
+% \package{ltcaption} package which is part of \thispackage\ bundle and will be
+% loaded automatically).
+% \end{Note}
+%
+% \pagebreak[3]
+% \subsection{picinpar}
+% \label{picinpar}
+% \packagedescription{%
+% Similar to the \package{floatflt} package the \package{picinpar}
+% package\cite{picinpar} offers figures and tables which do not span the full
+% width of a page and are float around by text.
+% For a detailed discussion about the differences between these packages
+% please take a look at The \LaTeX\ Companion\cite{TLC2}.}
+%
+% \NEWfeature{v3.1}
+% If you want to setup special options for the |fig|\-|window| and
+% |tab|\-|window| environments you can use
+% \begin{quote}
+% |\captionsetup[figwindow]|\marg{options}\quad\emph{and}\\
+% |\captionsetup[tabwindow]|\marg{options}\quad.
+% \end{quote}
+% These options will be executed additionally to the regular ones for
+% |figure| or |table|.
+%
+% \begin{Note}
+% The |margin| resp.~|width| setting will not be used for these figures and tables,
+% unless you set it explicit with |\caption|\-|setup[fig|\-|window]{|\ldots|}| or
+% |\caption|\-|setup[fig|\-|table]{|\ldots|}|.
+% \end{Note}
+%
+% \pagebreak[3]
+% \subsection{picins}
+% \label{picins}
+% \packagedescription{%
+% Similar to the \package{floatflt} and \package{picinpar} package the
+% \package{picins} package\cite{picins} offers figures and tables which do not
+% span the full width of a page and are float around by text.
+% For a detailed discussion about the differences between these packages
+% please take a look at The \LaTeX\ Companion\cite{TLC2}.}
+%
+% \NEWfeature{v3.1}
+% If you want to setup special options for the |par|\-|pic| environment you can use
+% \begin{quote}
+% |\captionsetup[parpic]|\marg{options}\quad.
+% \end{quote}
+% These options will be executed additionally to the regular ones for
+% |figure| or |table|.
+%
+% Furthermore |\pic|\-|caption[]{|\ldots|}| produce no entry in the List of Figures,
+% and |\pic|\-|caption*{|\ldots|}| gives an unlabeled \& unnumbered caption.
+%
+% \begin{Note}
+% The |margin| resp.~|width| setting will not be used for these figures and tables.
+% \iffalse
+% if |pic|\-|caption|\-|side| or |pic|\-|caption|\-|top|\-|side| is used.
+% The |width| setting will not be used (but the |margin| setting will) if
+% |pic|\-|caption|\-|out|\-|side| or |pic|\-|caption|\-|in|\-|side| is used.
+% \fi
+% But you can override this by setting it explicit with
+% |\caption|\-|setup[par|\-|pic]{|\ldots|}|.
+% \end{Note}
+%
+% If you want to have a |\pic|\-|caption| of another type as |figure|, please
+% do \emph{not} re-define |\@cap|\-|type| as suggested by the \package{picins}
+% documentation. Please use the |\pic|\-|caption|\-|type|\marg{type} command
+% which is offered by \thispackage\ instead, e.g.:
+% \begin{quote}
+% |\piccaptiontype{table}|\\
+% |\piccaption{An example table}|\\
+% |\parpic(50mm,10mm)[s]{|\ldots|}|
+% \end{quote}
+%
+% \pagebreak[3]
+% \subsection{rotating}
+% \label{rotating}
+% \packagedescription{%
+% The \package{rotating} package\cite{rotating} offers the floating
+% environments \texttt{side\-ways\-figure} and \texttt{side\-ways\-table} which
+% are just like normal figures and tables but rotated by 90 resp.~270 degree.
+% Furthermore a command \cs{rot\-caption} is offered for rotated captions only.}
+%
+% \iffalse % No, we don't do that
+% If you want to setup special options for the |side|\-|ways|\-|figure| and
+% |side|\-|ways|\-|table| environments you can use
+% \begin{quote}
+% |\captionsetup[sidewaysfigure]|\marg{options}\\
+% |\captionsetup[sidewaystable]|\marg{options}\quad.
+% \end{quote}
+% These options will be executed additionally to the regular ones for
+% |figure| or |table|.
+% \fi
+%
+% The command |\rot|\-|caption| will be extended by \thispackage, so
+% |\rot|\-|caption*| and |\rot|\-|caption|\-|of| can be used analogous to
+% |\caption*| and |\caption|\-|of|.
+%
+% \pagebreak[3]
+% \subsection{setspace}
+% \label{setspace}
+% \packagedescription{%
+% The \package{setspace} package\cite{setspace} offers options and commands
+% to change the spacing,
+% e.g.\ \cs{usepackage}\x\csoarg{one\-half\-spacing}\x\csmarg{set\-space}
+% causes the document to be typeset in one-and-a-half spacing.}
+%
+% If the \package{setspace} package is used in conjunction with \thispackage,
+% the caption will be typeset with single spacing as default. This can be changed
+% by specifying either |font=|\x|one|\-|half|\-|spacing|,
+% |font=|\x|double|\-|spacing|, or |font={stretch=|\x\meta{amount}|}|.
+% \See{also \Ref{fonts}}
+%
+% \pagebreak[3]
+% \subsection{sidecap}
+% \label{sidecap}
+% \packagedescription{%
+% The \package{sidecap} package\cite{sidecap} offers the floating environments
+% \texttt{SC\-figure} and \texttt{SC\-table} which are like usual figures
+% and tables but the caption will be put \emph{beside} the contents.}
+%
+% If you want to setup special options for the |SCfigure| and |SCtable|
+% environments you can use
+% \begin{quote}
+% |\captionsetup[SCfigure]|\marg{options}\quad\emph{and}\\
+% |\captionsetup[SCtable]|\marg{options}\quad.
+% \end{quote}
+% These options will be executed additionally to the regular ones for
+% |figure| or |table|.
+%
+% \pagebreak[3]
+% \begin{Note}
+% The \package{sidecap} package offers its own options for justification.
+% If set, they will override the one specified with the caption option
+% |jus|\-|ti|\-|fi|\-|ca|\-|tion=| for captions beside their contents.
+% \end{Note}
+%
+% \begin{Note}
+% The |margin| resp.~|width| setting will not be used for these figures and tables,
+% unless you set it explicit with |\caption|\-|setup[SC|\-|figure]{|\ldots|}|
+% or |\caption|\-|setup[SC|\-|table]{|\ldots|}|.
+% \end{Note}
+%
+% \medskip
+%
+% \begin{Annotation*}
+% Instead of using the \package{sidecap} package you can also use the more
+% powerful and flexible \package{floatrow} package\cite{floatrow} for typesetting
+% captions beside the contents.
+% \end{Annotation*}
+%
+% \pagebreak[3]
+% \subsubsection*{Undocumented features}
+% The \package{sidecap} package \version{1.6} has some undocumented package
+% options and commands which allow further customization of the side-captions:
+%
+% \pagebreak[3]
+% \DescribeMacro{margincaption}
+% The package option
+% \begin{quote}
+% |margincaption|\qquad{\small(e.g.~|\usepackage[margincaption]{sidecap}|)}
% \end{quote}
+% causes all side-captions to be placed into the margin.
+%
+% \pagebreak[3]
+% \DescribeMacro{\sidecaptionvpos}
+% The command
+% \begin{quote}
+% |\sidecaptionvpos|\marg{float type}\marg{pos}
+% \end{quote}
+% sets the vertical position of the side-caption. \meta{pos} can be either `|t|'
+% (for top alignment), `|b|' (for bottom alignment), or `|c|' (for center alignment).
+% The default setting for |table| is `|t|', for |figure| and all other ones
+% defined with |\Declare|\-|Floating|\-|Environment| it's `|b|'.
+%
+% \pagebreak[3]
+% \subsection{subfigure}
+% \label{subfigure}
+% \packagedescription{%
+% The \package{subfigure} package\cite{subfigure} provides support for small or
+% `sub' figures and tables within a single figure or table environment.
+% This package is obsolete, new users should use \package{subfig} instead.}
+%
+% Since the \package{subfigure} package is obsolete it will only be supported in
+% a way that old documents (which have used \thispackage\ \version{1.x} during
+% development) should still compile as expected.
+%
+% Please use the \package{subfig} or \package{subcaption} package instead which both supports \thispackage\
+% \version{3.x}.
+%
+% \See{the \package{subfig} package\cite{subfig} documentation for details.}
+%
+% \pagebreak[3]
+% \subsection{supertabular and xtab}
+% \label{supertabular}
+% \packagedescription{%
+% The \package{supertabular}\cite{supertabular} and \package{xtab}\cite{xtab}
+% packages offer an environment which can span multiple pages and is quite
+% similar to the \texttt{long\-table} environment provided by the
+% \package{longtable} package\cite{longtable}.
+% For a detailed discussion about the differences between these powerful
+% packages please take a look at The \LaTeX\ Companion\cite{TLC2}.}
+%
+% If you want to setup special options for the |super|\-|tabular|
+% resp.~|x|\-|tabular| environment you can use
+% \begin{quote}
+% |\captionsetup[supertabular]|\marg{options}\quad\emph{resp.}\\
+% |\captionsetup[xtabular]|\marg{options}\quad.
+% \end{quote}
+% These options will be executed additionally to the regular ones for
+% |table|.
+%
+% \begin{Note}
+% |\Continued|\-|Float| does not work for |super|\-|tabular|s and |x|\-|tabular|s.
+% \end{Note}
+%
+% \pagebreak[3]
+% \subsection{threeparttable}
+% \label{threeparttable}
+% \packagedescription{%
+% The \package{threeparttable} package\cite{threeparttable} provides a scheme
+% for tables that have a structured note section after the table contents and
+% the caption.
+% This scheme provides an answer to the old problem of putting footnotes in
+% tables---by making footnotes entirely unnecessary.}
+%
+% \NEWfeature{v3.1}
+% If you want to setup special options for the |three|\-|part|\-|table| and
+% |measured|\-|figure| environments you can use
+% \begin{quote}
+% |\captionsetup[threeparttable]|\marg{options}\quad\emph{and}\\
+% |\captionsetup[measuredfigure]|\marg{options}\quad.
+% \end{quote}
+% These options will be executed additionally to the regular ones for
+% |table| or |figure|.
+%
+% \begin{Note}
+% Since the caption will have the same width as the contents here,
+% the |margin| resp.~|width| setting will not be used for these figures and tables,
+% at least unless you set it explicit with
+% |\caption|\-|setup[three|\-|part|\-|table]{|\ldots|}| or
+% |\caption|\-|setup[measured|\-|figure]{|\ldots|}|.
+% \end{Note}
+%
+% \medskip
+%
+% \begin{Annotation*}
+% Instead of using the \package{threeparttable} package you can
+% also use the \package{floatrow} package\cite{floatrow} for this purpose.
+% \end{Annotation*}
+%
+% \pagebreak[3]
+% \subsection{wrapfig}
+% \label{wrapfig}
+% \packagedescription{%
+% Similar to the \package{floatflt}, the \package{picinpar}, and the
+% \package{picins} package the \package{wrapfig} package\cite{wrapfig} offers
+% figures and tables which do not span the full width of a page and are float
+% around by text.
+% For a detailed discussion about the differences between these packages
+% please take a look at The \LaTeX\ Companion\cite{TLC2}.}
+%
+% \NEWfeature{v3.1}
+% If you want to setup special options for the |wrap|\-|figure| and
+% |wrap|\-|table| environments you can use
+% \begin{quote}
+% |\captionsetup[wrapfigure]|\marg{options}\quad\emph{and}\\
+% |\captionsetup[wraptable]|\marg{options}\quad.
+% \end{quote}
+% These options will be executed additionally to the regular ones for
+% |figure| or |table|.
+%
+% \begin{Note}
+% The |margin| resp.~|width| setting will not be used for these figures and
+% tables, unless you set it explicit with
+% |\caption|\-|setup[wrap|\-|figure]{|\ldots|}|
+% or |\caption|\-|setup[wrap|\-|table]{|\ldots|}|.
+% \end{Note}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \section{Further reading}
+%
+% I recommend the following documents for further reading:
+%
+% \begin{itemize}
+% \item
+% The \TeX\ FAQ -- Frequently asked questions about \TeX\ and \LaTeX:
+% \begin{quote}\url{http://faq.tug.org/}\end{quote}
+%
+% \item
+% A French FAQ can be found at
+% \begin{quote}\url{http://www.grappa.univ-lille3.fr/FAQ-LaTeX/}\end{quote}
+%
+% \item
+% ``What is a minimal working example?'' from Christian Faulhammer and Ulrich Schwarz:
+% \begin{quote}\url{http://www.minimalbeispiel.de/mini-en.html}\end{quote}
+%
+% \item
+% \textsf{epslatex} from Keith Reckdahl contains many tips around
+% including graphics in \LaTeXe\ documents.
+% You will find this document in the directory
+% \begin{quote}\url{http://mirror.ctan.org/info/epslatex/}\end{quote}
+% \end{itemize}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \pagebreak[3]
+% \section{Thanks}
+%
+% I would like to thank Katja Melzner,
+% Steven D. Cochran, Frank Mittelbach, Olga Lapko,
+% David Carlisle, Carsten Heinz, Keith Reckdahl, Markus Kohm,
+% Heiko Oberdiek, and Herbert Vo\ss.
+% Thanks a lot for all your help, ideas, patience, spirit, and support!
+%
+% Also I would like to thank
+% Harald Harders,
+% Peter L\"offler,
+% Peng Yu,
+% Alexander Zimmermann,
+% Matthias Pospiech,
+% J\"urgen Wieferink,
+% Christoph Bartoschek,
+% Uwe St\"ohr,
+% Ralf Stubner,
+% Geoff Vallis,
+% Florian Keiler,
+% J\"urgen G\"obel,
+% Uwe Siart,
+% Sang-Heon Shim,
+% Henrik Lundell,
+% David Byers,
+% William Asquith,
+% Prof.~Dr.~Dirk Hoffmann,
+% Frank Martini,
+% Danie Els,
+% Philipp Woock,
+% Fadi Semmo,
+% Matthias Stevens, and
+% Leo Liu
+% who all helped to make this package a better one.
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage\appendix
+% \section{Alphabetical Reference}
+%
+% \makeatletter
+% \newenvironment{Warnings}{%
+% \newif\ifMessage
+% \def\Message{%
+% \ifMessage\end{minipage}\par\vspace\itemsep\pagebreak[3]\fi
+% \begin{minipage}{\linewidth}%
+% \setlength\parindent{0pt}%
+% \setlength\parskip{\smallskipamount}%
+% \setlength\leftskip{0pt}%
+% \color{blue}%
+% \Messagetrue}%
+% \def\Description{%
+% \par\color{black}\leftskip=1.5em}%
+% \def\Or{\@testopt\@Or{or}}%
+% \def\@Or[##1]{%
+% \\{\small\color{black}\hspace{1.5em}\textit{-- ##1 --}}\\}%
+% }{%
+% \ifMessage\end{minipage}\par\fi
+% }
+% \makeatother
+%
+% \subsection{Options}
+% \newcommand\preambleoption{~%
+% \begingroup\def\thefootnote{\fnsymbol{footnote}}%
+% \footnotemark[2]%
+% \endgroup}
+% \newcommand\preambleoptiontext{%
+% \begingroup\def\thefootnote{\fnsymbol{footnote}}%
+% \footnotetext[2]{These options are only available in the preamble of the document.}%
+% \endgroup}
+%
+% \begin{longtable*}{lll}
+% Option & Short description & Section \\
+% \hline
+% \endhead
+% |aboveskip| & sets the skip above caption & \ref{skips} \\
+% |belowskip| & sets the skip below caption & \ref{skips} \\
+% |compatibility|\preambleoption & force (non-)compatibility & \ref{compatibility} \\
+% |figureposition|\preambleoption & gives a hint about the figure caption position & \ref{skips} \\
+% |font|(|+|) & sets the font & \ref{fonts} \\
+% |format| & sets the format & \ref{formats} \\
+% \iffalse
+% |FPlist| & To where the list entry of a FPfigure should link? & \ref{fltpage} \\
+% |FPref| & To where a |\ref| to a FPfigure should link? & \ref{fltpage} \\
+% \fi
+% |hangindent| & sets the hang indention & \ref{margins} \\
+% |hypcap| & selects `hypcap' feature & \ref{hyperref} \\
+% |hypcapspace| & sets the distance between hyperlink and contents & \ref{hyperref} \\
+% |indention| & sets the indention & \ref{margins} \\
+% |justification| & sets the justification & \ref{justification} \\
+% |labelfont|(|+|) & sets the font of the caption label & \ref{fonts} \\
+% |labelformat| & sets the format of the caption label & \ref{formats} \\
+% |labelsep| & sets the label separator & \ref{formats} \\
+% |labelseparator| & --same as |labelsep|-- & \ref{formats} \\
+% |list| & switches the entries in the List on or off & \ref{lists} \\
+% |listformat| & sets the `List of Figure/Table' entry format & \ref{lists} \\
+% |margin| & sets the margin & \ref{margins} \\
+% |margin*| & sets the margin, but only if no width is set & \ref{margins} \\
+% |maxmargin| & sets the max. margin & \ref{margins} \\
+% |minmargin| & sets the min. margin & \ref{margins} \\
+% |name| & sets the name of the current environment & \ref{names} \\
+% |oneside| & selects the one-side mode & \ref{margins} \\
+% |options| & executes the given option list & \\
+% |parindent| & sets the paragraph indention & \ref{margins} \\
+% |parskip| & sets the skip between paragraphs & \ref{margins} \\
+% |position| & gives a hint about the caption position & \ref{skips} \\
+% |singlelinecheck| & switches the single-line-check on or off & \ref{justification} \\
+% |skip| & sets the skip between content and caption & \ref{skips} \\
+% |strut| & switches the usage of |\strut|s on or off & \ref{formats} \\
+% |style| & sets the caption style & \ref{style} \\
+% |subtype| & sets the sub-caption type & \phantom{t}--~\footnotemark \\
+% |tableposition|\preambleoption & gives a hint about the table caption position & \ref{skips} \\
+% |textfont|(|+|) & sets the font of the caption text & \ref{fonts} \\
+% |textformat| & sets the format of the caption text & \ref{formats} \\
+% |twoside| & selects the two-side mode & \ref{margins} \\
+% |type| & sets the caption type \& places a hyperlink anchor & \ref{types} \\
+% |type*| & sets the caption type only & \ref{types} \\
+% |width| & sets a fixed caption width & \ref{margins} \\
+% \end{longtable*}
+% \preambleoptiontext
+% \footnotetext{The option \texttt{subtype} is explained in the
+% \package{subcaption} package documentation.}
+%
+% \nopagebreak\parbox[t]{\linewidth}{% prevent from page break
+% \begin{Note*}
+% Obsolete options are not listed here. See
+% \Ref{caption1} and
+% \Ref{caption2} for a list of these options.
+% \end{Note*}}
+%
+% \pagebreak[3]
+% \subsection{Commands}
+%
+% \begin{longtable*}{lll}
+% Command & & Section \\
+% \hline
+% \endhead
+% |\abovecaptionskip| & & \ref{skips} \\
+% |\belowcaptionskip| & & \ref{skips} \\
+% |\caption| & & \ref{caption} \\
+% |\caption*| & & \ref{caption} \\
+% |\captionlistentry| & & \ref{captionlistentry} \\
+% |\captionof| & & \ref{caption} \\
+% |\captionof*| & & \ref{caption} \\
+% |\captionsetup| & & \ref{captionsetup} \\
+% |\captionsetup*| & & \ref{captionsetup} \\
+% |\centerfirst| & & \ref{justification} \\
+% |\centerlast| & & \ref{justification} \\
+% |\clearcaptionsetup| & & \ref{captionsetup} \\
+% |\clearcaptionsetup*| & & \ref{captionsetup} \\
+% |\ContinuedFloat| & & \ref{ContinuedFloat} \\
+% |\DeclareCaptionFont| & & \ref{declare} \\
+% |\DeclareCaptionFormat| & & \ref{declare} \\
+% |\DeclareCaptionFormat*| & & \ref{declare} \\
+% |\DeclareCaptionJustification| & & \ref{declare} \\
+% |\DeclareCaptionLabelFormat| & & \ref{declare} \\
+% |\DeclareCaptionLabelSeparator| & & \ref{declare} \\
+% |\DeclareCaptionLabelSeparator*| & & \ref{declare} \\
+% |\DeclareCaptionListFormat| & & \ref{declare} \\
+% |\DeclareCaptionOption| & & \ref{declare} \\
+% |\DeclareCaptionStyle| & & \ref{declare} \\
+% |\DeclareCaptionSubType| & & --~\footnotemark \\
+% |\DeclareCaptionTextFormat| & & \ref{declare} \\
+% |\showcaptionsetup| & & \ref{captionsetup} \\
+% \end{longtable*}
+% \footnotetext{\cs{DeclareCaptionSubType} is explained in the
+% \package{subcaption} package documentation.}
+%
+% \clearpage
+% \subsection{Warnings}
+%
+% \begin{Warnings}
+%
+% \Message
+% |\caption outside box or environment.|
+% \Or
+% |\captionsetup{type=...} outside box or environment.|
+% \Or
+% |\captionsetup{type*=...} or \captionof outside box|\\
+% | or environment.|
+% \Description
+% You have placed a |\caption|, |\caption|\-|of|, or
+% |\caption|\-|setup{type=|\x\meta{type}|}| command outside an box, group,
+% or environment.
+% You should not do this since it could cause some bad side-effects.
+% \par\See{\Ref{types} and \Ref{caption}}
+%
+% \Message
+% |\caption will not be redefined since it's already|\\
+% |redefined by a document class or package which is|\\
+% |unknown to the caption package.|
+% \Description
+% If \thispackage\ detects that some (unknown) document class or
+% package has enhanced |\caption|, it will not redefine
+% |\caption|, too, since this would simply kill the enhancement.
+% As a result some features, like |\caption*|, |\Continued|\-|Float|,
+% using the optional argument of |\caption|\-|setup|,
+% or the options |list=| and |hypcap=| will not be available.\par
+% If you don't care about the original enhancements but would
+% like to use the full range of features of \thispackage\ instead
+% you can give the unsupported(!) option |compatibility=|\x|false|
+% a try and keep your fingers crossed.
+% (But you will get the next warning instead.)
+% \par\See{\Ref{classes} and \Ref{compatibility}}
+%
+% \Message
+% |Forced redefinition of \caption since the|\\
+% |unsupported(!) package option `compatibility=false'|\\
+% |was given.|
+% \Description
+% Since you were so keen to specify the option |compatibility=|\x|false|
+% \thispackage\ will try to do its best to fulfill your wishes.
+% But depending on the document class or other packages you use that
+% can end in non-functional features or even errors. So keep your
+% fingers crossed!
+% \par\See{\Ref{compatibility}}
+%
+% \Message
+% |Hyperref support is turned off because hyperref has|\\
+% |stopped early.|
+% \Description
+% If the \package{hyperref} package stops early during loading
+% (because of what-ever reason), the \package{hyperref} support of
+% \thispackage\ will not be available. As a result you could get
+% \package{hyperref} warnings and non-functional hyperlinks to figures
+% or tables.
+% \par\See{\Ref{hyperref}\,}
+%
+% \Message
+% |Ignoring optional argument [|\meta{pos}|] of \setcapwidth.|
+% \Description
+% \Thispackage\ tries to emulate the \KOMAScript\ commands regarding
+% captions as best as it can. But the optional argument of the
+% \KOMAScript\ command |\setcapwidth| is not (yet) working if you use
+% this package, so if you try to use it anyway, you will get this warning.
+% \par\See{\Ref{KOMA}}
+%
+% \Message
+% |Internal Warning: |\meta{warning message}|.|
+% \Description
+% You should never see this warning, either you use a package which redefines
+% |figure| or |table| and which is unknown to \thispackage, or this is a bug
+% in \thispackage.
+% Please send me an e-mail reporting this issue.
+%
+% \Message
+% |\label without proper \caption|
+% \Description
+% Regarding |\label| the floating environments behave differently than its
+% non-floating counterparts: The internal reference will not be generated
+% at the beginning of the environment, but at |\caption| instead.
+% So you have to place the |\label| command either just \emph{after} or
+% \emph{inside} the caption text (mandatory argument of |\caption|).
+%
+% \Message
+% |Option `|\meta{option}|' was not in list `|\meta{option list}|'.|
+% \Description
+% If you try to remove a specific option of an option list,
+% for example with |\clear|\-|caption|\-|setup[po|\-|si|\-|tion]{table}|,
+% and this option can not be found inside the option list, you will
+% get this warning. If this is not because of a typo and you would like
+% to suppress this warning, use |\clear|\-|caption|\-|setup*| instead of
+% |\clear|\-|caption|\-|setup|.
+% \par\See{\Ref{captionsetup}}
+%
+% \Message
+% |Option list `|\meta{option list}|' undefined.|
+% \Description
+% If you try to remove a specific option of an option list,
+% for example with |\clear|\-|caption|\-|setup[for|\-|mat]{figure}|,
+% and this option list is not defined (yet), you will
+% get this warning. If this is not because of a typo and you would like
+% to suppress this warning, use |\clear|\-|caption|\-|setup*| instead of
+% |\clear|\-|caption|\-|setup|.
+% \par\See{\Ref{captionsetup}}
+%
+% \Message
+% |Obsolete option `ignoreLTcapwidth' ignored.|
+% \Description
+% The \package{caption2} package option |ignoreLTcapwidth| will not be
+% emulated by this version of \thispackage, usually you can simply wipe it
+% away.
+% \par\See{\Ref{caption2} and \Ref{longtable}}
+%
+% \Message
+% |`ragged2e' support has been changed. Rerun to get|\\
+% |captions right.|
+% \Description
+% The \package{ragged2e} package will only be loaded by \thispackage\ if it
+% is actually needed.
+% At least two \LaTeX\ runs are needed for that, so on the first run you could
+% get this warning.
+% Just compile your document again and this warning should go away.
+% \par\See{\Ref{justification}}
+%
+% \Message
+% |Reference on page |\meta{page no.}| undefined.|
+% \Description
+% If you use a |twoside| page layout, \thispackage\ needs to track the
+% page numbers to get the margins right.
+% At least two \LaTeX\ runs are needed for that, on the first run you could get
+% this warning.
+% Just compile your document again and this warning should go away.
+% \par\See{\Ref{margins}}
+%
+% \Message
+% |The caption type was already set to `|\meta{type}|'.|
+% \Description
+% This warning informs you about mixed caption options. For example if
+% you use a |\caption|\-|setup{type=|\x|table}| or
+% |\caption|\-|of{table}{|\ldots|}| inside a |figure| environment,
+% this would result in using both option sets for that specific caption,
+% the one for |figure| (specified with |\caption|\-|setup[figure]{|\ldots|}|)
+% and the one for |table| (specified with |\caption|\-|setup[table]{|\ldots|}|)
+% as well.\par
+% {\small(You can suppress this warning by using the starred form
+% |\caption|\-|setup*{type=|\x\ldots|}|.)\par}
+% \par\See{\Ref{captionsetup}}
+%
+% \Message
+% |The option `hypcap=true' will be ignored for this|\\
+% |particular \caption.|
+% \Description
+% \Thispackage\ hasn't found a proper hyperlink anchor for this particular
+% caption, so it decides to ignore the setting |hypcap=|\x|true| (which is set by
+% default). As a result a link to this caption (e.g.~in the List of Figures,
+% or set by |\ref| or |\auto|\-|ref|) will link you to the caption of the figure
+% or table, not to the figure or table itself.\par
+% This can happen if you use |\caption|\-|of| inside a non-floating environment,
+% but also if you use some package which redefines |figure| or |table|, and
+% which is unknown to \thispackage.\par
+% If this is ok for you but you want to suppress this warning, simply place a
+% |\caption|\-|setup{hyp|\-|cap=|\x|false}| just before the |\caption| or
+% |\caption|\-|of| command which is causing the warning.
+% If this is not ok for you, you can set a hyperlink anchor with
+% |\caption|\-|setup{type=|\x\meta{float type}|}| for yourself.
+% \par\See{\Ref{hyperref}\,}
+%
+% \Message
+% |Unsupported document class (or package) detected,|\\
+% |usage of the caption package is not recommended.|
+% \Description
+% Either the document class you use is unknown to \thispackage, or you
+% have included a package in your document which redefines |\@make|\-|caption|
+% (which is responsible for typesetting the caption internally) as well.
+% This means \thispackage\ will either change the design of captions in an
+% unwanted way, or it even refuses to work correctly at all.
+% \par\See{\Ref{classes} and \Ref{compatibility}}
+%
+% \Message
+% |Unused \captionsetup[|\meta{type}|].|
+% \Description
+% You have specified options with |\caption|\-|setup[|\meta{type}|]| which are
+% not used later on.
+% This can be because of a typo in \meta{type},
+% or because you use a package which redefines |figure| or |table| and
+% which is unknown to \thispackage, or simply because you don't have any usage
+% of the environment \meta{type} after this line.
+% (If you want to suppress this warning you can use |\caption|\-|setup*|
+% instead of |\caption|\-|setup|.)
+% \par\See{\Ref{captionsetup}}
+%
+% \Message
+% |Usage of the |\meta{package}| package together with the|\\
+% |caption package is strongly not recommended.|\\
+% |Instead of loading the |\meta{package}| package you should|\\
+% |use the caption package option `tableposition=top'.|
+% \Description
+% The package \meta{package} is dealing with caption skips as well.
+% Please decide which one do you actually want to use, \thispackage\ or the
+% other one, using both can lead to wrong skips above or below the caption.
+% \par\See{\Ref{skips}}
+%
+% \end{Warnings}
+%
+% \pagebreak[3]
+% \subsection{Errors}
+%
+% \begin{Warnings}
+%
+% \Message
+% |Argument of \@caption has an extra }.|
+% \Or
+% |Paragraph ended before \@caption was complete.|
+% \Description
+% If you want to typeset something special (like a tabular) as caption,
+% you need to give an optional argument to |\caption| resp.~|\caption|\-|of|
+% for the List of Figures resp.~List of Tables, too, even if you don't
+% use such list.
+% \par\See{\Ref{caption}, \Ref{lists}, and \Ref{hyperref}\,}
+%
+% \Message
+% |\caption outside float.|
+% \Description
+% You have placed a |\caption| command outside a floating environment, or
+% a |long|\-|table| or |wrap|\-|figure|.
+% If this is what you want to, please use either
+% |\caption|\-|setup{type=|\x\meta{type}|}| $+$ |\caption| or
+% |\caption|\-|of|.
+% \par\See{\Ref{caption}}
+%
+% \Message
+% |\ContinuedFloat outside float.|
+% \Description
+% You have placed a |\Continued|\-|Float| command outside a floating
+% environment. % or |long|\-|table|.
+% If this is what you want to, please use the combination
+% |\caption|\-|setup{type=|\x\meta{type}|}| $+$ |\Continued|\-|Float|.\par
+% Please note that |\Continued|\-|Float| inside a |long|\-|table| is not
+% working, but maybe using the |long|\-|table*| environment, which
+% typesets a |long|\-|table| without incrementing the |table| counter,
+% if sufficient for you.
+% \par\See{\Ref{ContinuedFloat} and \Ref{longtable}}
+%
+% \Message
+% |Continued `|\meta{type}|' after `|\meta{type}|'.|
+% \Description
+% Continued figures or tables are not allowed to be interrupted by a floating
+% environment (or |long|\-|table|) of another type,
+% e.g.~a table between a figure and a continued figure.
+% \par\See{\Ref{ContinuedFloat}}
+%
+% \Message
+% |For a successful cooperation we need at least version|\\
+% |`|\meta{date}|' of package |\meta{package}|, but only version|\\
+% |`|\meta{old-date}|' is available.|
+% \Description
+% \Thispackage\ does not work with such an outdated package, please update it
+% to a more recent version, at least to the one requested.
+%
+% \Message
+% |Internal Error: |\meta{error message}|.|
+% \Description
+% You should never see this error.
+% Please send me an e-mail reporting this issue.
+%
+% \Message
+% |No float type '|\meta{type}|' defined.|
+% \Description
+% The \meta{type} you have specified in |\caption|\-|setup{type=|\x\meta{type}|}|,
+% |\caption|\-|of|\marg{type}, or |\Declare|\-|Caption|\-|Sub|\-|Type| is
+% not defined.
+% \meta{type} should be either `\texttt{figure}' or `\texttt{table}', or
+% any other floating environment defined with
+% |\Declare|\-|Floating|\-|Environment| offered by the \package{newfloat} package,
+% |\new|\-|float| offered by the \package{float} package\cite{float}, or
+% |\Declare|\-|New|\-|Float|\-|Type| offered by the \package{floatrow} package\cite{floatrow}.
+%
+% \Message
+% |Not allowed in longtable* environment.|
+% \Description
+% The usage of |\caption| is not allowed inside the |long|\-|table*| environment.
+% Please use either |\caption*| for a caption without label or use the regular
+% |long|\-|table| environment instead.
+%
+% \Message
+% |Not available in compatibility mode.|
+% \Description
+% The feature required is not supported in compatibility mode.
+% `compatibility mode' means that \thispackage\ has detected either an
+% incompatible document class or an incompatible package which also
+% extents the |\caption| command. Leaving the original extension intact,
+% some features of \thispackage\ are not supported.
+% \par\See{\Ref{compatibility}}
+%
+% \Message
+% |Only one \caption can be placed in this environment.|
+% \Description
+% Inside the environments offered by the \package{fltpage} and \package{sidecap}
+% package only \emph{one} caption can be placed. (This is due implementation design.)
+%
+% \Message
+% |Option clash for package caption.|
+% \Or[but sometimes also]
+% |Missing \begin{document}.|
+% \Description
+% \Thispackage\ has already been loaded by some other \LaTeX\ package,
+% so you can't do that again specifying different options.
+% A candidate causing this could be the \package{subfig} package; if this is
+% the case, please load \thispackage\ \emph{before} the \package{subfig}
+% package or specify the option |caption=|\x|false| while loading the
+% \package{subfig} package.
+% \par\See{the \package{subfig} package\cite{subfig} documentation}
+%
+% \Message
+% |Paragraph ended before \caption@makecurrent was complete.|
+% \Or
+% |Paragraph ended before \caption@prepareanchor was complete.|
+% \Description
+% If you want to typeset multi-paragraph captions, you need to give an
+% optional argument to |\caption| resp.~|\caption|\-|of| for the List of
+% Figures resp.~List of Tables, too, even if you don't use such list.
+% \par\See{\Ref{caption}, \Ref{lists}, and \Ref{hyperref}\,}
+%
+% \Message
+% |Something's wrong--perhaps a missing \caption|\\
+% |in the last figure or table.|
+% \Description
+% It seems that you have used a |\sub|\-|caption| command (or a different one
+% which has typeset a sub-caption) without a corresponding |\caption| command.
+% This is not supported.
+%
+% \Message
+% |The option `labelsep=|\meta{name}|' does not work|\\
+% |with `format=hang'.|
+% \Or
+% |The option `labelsep=|\meta{name}|' does not work|\\
+% |with \setcaphanging (which is set by default).|
+% \Description
+% A caption label separator which contains a |\\| command (like
+% |labelsep=|\x|newline|) can not be combined with a hanging caption format
+% (like |format=|\x|hang|).
+% Please select either another caption label separator
+% (e.g.~|labelsep=|\x|colon|) or another caption format
+% (e.g.~|format=|\x|plain|).
+% \par\See{\Ref{formats} resp.~\Ref{KOMA}}
+%
+% \Message
+% |The package option `caption=false' is obsolete.|\\
+% |Please pass this option to the subfig package instead|\\
+% |and do *not* load the caption package anymore.|
+% \Description
+% You have specified the option |caption=|\x|false|. This used to be a workaround
+% for not using the whole \package{caption} package (leaving the caption stuff
+% offered by the document class or other packages intact), but keeping the
+% \package{subfig} package working. This mechanism is obsolete and not offered
+% anymore, please pass this option to the \package{subfig} package instead and
+% do not load \thispackage\ anymore.
+% \par\See{the \package{subfig} package\cite{subfig} documentation}
+%
+% \Message
+% |Undefined boolean value `|\meta{value}|'.|
+% \Description
+% You tried to set a boolean option (like |singlelinecheck=| or |hypcap=|)
+% with an improper value. Only |false|, |no|, |off|, |0| or |true|, |yes|,
+% |on|, |1| is allowed here.
+%
+% \Message
+% |Undefined format `|\meta{name}|'.|
+% \Description
+% You tried to set a caption format which does not exists.
+% Maybe a typo!?
+% \par\See{\Ref{formats}}
+%
+% \Message
+% |Undefined label format `|\meta{name}|'.|
+% \Description
+% You tried to set a caption label format which does not exists.
+% Maybe a typo!?
+% \par\See{\Ref{formats}}
+%
+% \Message
+% |Undefined label separator `|\meta{name}|'.|
+% \Description
+% You tried to set a caption label separator which does not exists.
+% Maybe a typo!?
+% \par\See{\Ref{formats}}
+%
+% \Message
+% |Undefined list format `|\meta{name}|'.|
+% \Description
+% You tried to set a caption list-of format which does not exists.
+% Maybe a typo!?
+% \par\See{\Ref{lists}}
+%
+% \Message
+% |Undefined position `|\meta{name}|'.|
+% \Description
+% You tried to set a caption position with an improper value.
+% Maybe a typo!?
+% \par\See{\Ref{skips}}
+%
+% \Message
+% |Undefined style `|\meta{name}|'.|
+% \Description
+% You tried to set a caption style which does not exists.
+% Maybe a typo!?
+% \par\See{\Ref{style}}
+%
+% \Message
+% |Usage of the `position' option is incompatible|\\
+% |to the `|\meta{package}|' package.|
+% \Description
+% The given package is dealing with caption skips as well.
+% Please decide which one do you actually want to use: The |position=| option
+% of \thispackage\ or the mechanism of the other one; using both this way
+% would lead to wrong skips above or below the caption and is therefore
+% not supported.
+% \par\See{\Ref{skips}}
+%
+% \Message
+% |Undefined text format `|\meta{name}|'.|
+% \Description
+% You tried to set a caption text format which does not exists.
+% Maybe a typo!?
+% \par\See{\Ref{formats}}
+%
+% \Message
+% |You can't use both, the (obsolete) caption2 *and*|\\
+% |the (current) caption package.|
+% \Description
+% This error message says it all, you simply can't do that.
+% Please use only \thispackage.
+% \par\See{\Ref{caption2}}
+%
+% \end{Warnings}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \section{Version history}
+% \label{history}
+%
+% The version $1.0$ was written in 1994 and was offering a handful of options
+% to customize the look \& feel of the captions.
+% Furthermore this version already supported the \package{rotating} and
+% \package{subfigure} packages.
+% Version $1.1$ introduced the |center|\-|last| option;
+% version $1.2$ added the support of the \package{float} package.
+% Version $1,3$ offered a better support of the \package{subfigure} package,
+% while version $1.4$ came with the new option |nooneline|.
+%
+% The \package{caption2} package $2.0$ was an experimental side-version of
+% the regular \package{caption} package. It was made public as beta test version
+% without proper documentation in 1995 because of the strong demand for new
+% features and adaptations to additional packages like the \package{longtable}
+% package.
+% Furthermore it offered a revised support of the \package{subfigure} package.
+% (An improved version $2.1$ was offered in 2002.)
+%
+% In 2003 I finally found some time, so a new regular release $3.0$
+% of the \package{caption} package could be build in cooperation with
+% Frank Mittelbach and Steven Cochran.
+% It was released in December 2003 and superseded the neglected
+% \package{caption2} package.
+% Main parts were re-written and it provided a complete re-work of
+% the user interface.
+% Furthermore it supported the \package{hyperref}, \package{hypcap},
+% \package{listings}, \package{sidecap}, and \package{supertabular} packages
+% additionally.
+%
+% While all the previous versions were designed for usage with the standard
+% \LaTeX\ document classes \class{article}, \class{report}, and \class{book},
+% the current version $3.1$ released in 2007 also supports the \AmS,
+% \KOMAScript, \NTG, and \SmF\ document classes, and the \class{beamer} class
+% as well.
+% Furthermore it was adapted to the \package{french} Babel option,
+% the \package{frenchle} \& \package{frenchpro} packages,
+% and the \package{floatflt}, \package{fltpage}, \package{picinpar},
+% \package{picins}, \package{setspace}, \package{threeparttable},
+% and \package{wrapfig} packages.
+% New options and commands were introduced as well, among other things
+% |font+|, |figure|\-|within| \& |table|\-|within|,
+% |list| \& |list|\-|format|, |max|\-|margin| \& |min|\-|margin|,
+% |\caption|\-|list|\-|entry|, |\Declare|\-|Caption|\-|List|\-|Format|.
+% Further benefits are the new compatibility check \see*{\Ref{compatibility}},
+% the new ``hypcap'' feature \see*{\Ref{hyperref}\,}, and the sub-caption
+% feature \see*{\package{subcaption} package documentation}.
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \section{Compatibility to older versions}
+%
+% \subsection{caption v\texorpdfstring{$1.x$}{1.x}}
+% \label{caption1}
+%
+% This version of \thispackage\ still supports the old options
+% and commands provided by the version $1.0$ to $1.4$ of this package.
+% So there shouldn't occur any problems compiling old documents, but please
+% don't mix old options and commands with the new ones. This isn't supported
+% and can cause ugly side effects.
+%
+% Here comes a short oversight of the obsolete options and how
+% they have been replaced within this version of \thispackage:
+%
+% \begin{center}\small
+% \begin{tabular}{ll}
+% \package{caption} \version{1.x} & \package{caption} \version{3.x}\\
+% \hline
+% |normal| & |format=plain|\\
+% |hang| & |format=hang|\\
+% |isu| & |format=hang|\\
+% |center| & |justification=centering|\\
+% |centerlast| & |justification=centerlast|\\
+% |nooneline| & |singlelinecheck=off|\\
+% |scriptsize| & |font=scriptsize|\\
+% |footnotesize| & |font=footnotesize|\\
+% |small| & |font=small|\\
+% |normalsize| & |font=normalsize|\\
+% |large| & |font=large|\\
+% |Large| & |font=Large|\\
+% |up| & |labelfont=up|\\
+% |it| & |labelfont=it|\\
+% |sl| & |labelfont=sl|\\
+% |sc| & |labelfont=sc|\\
+% |md| & |labelfont=md|\\
+% |bf| & |labelfont=bf|\\
+% |rm| & |labelfont=rm|\\
+% |sf| & |labelfont=sf|\\
+% |tt| & |labelfont=tt|\\
+% \end{tabular}
+% \end{center}
+%
+% Beside the options for setting up the desired font there were also
+% the commands |\caption|\-|size| resp.~|\caption|\-|font| and
+% |\caption|\-|label|\-|font| who could be redefined with
+% |\re|\-|new|\-|command| and allowed an alternate and more flexible way to
+% change the font used for captions.
+% This mechanism was replaced by the commands
+% \begin{quote}
+% |\DeclareCaptionFont{|\ldots|}{|\ldots|}|\qquad and\\
+% |\captionsetup{font=|\ldots|,labelfont=|\ldots|}|\qquad.
+% \end{quote}
+% \SeeUserDefined
+%
+% Setting the margin for captions was done in \version{1.x} with
+% \begin{quote}
+% |\setlength{\captionmargin}{|\ldots|}|\quad.
+% \end{quote}
+% This was replaced by
+% \begin{quote}
+% |\captionsetup{margin=|\ldots|}|\qquad.
+% \end{quote}
+% \See{\Ref{margins}}
+%
+% For example the old-style code
+% \begin{quote}
+% |\usepackage[hang,bf]{caption}|\\
+% |\renewcommand\captionfont{\small\sffamily}|\\
+% |\setlength\captionmargin{10pt}|
+% \end{quote}
+% will still work fine, but should be written today as
+% \begin{quote}
+% |\usepackage[format=hang,labelfont=bf,font={small,sf},|\\
+% | margin=10pt]{caption}|
+% \end{quote}
+% or
+% \begin{quote}
+% |\usepackage{caption}|\\
+% |\captionsetup{format=hang,labelfont=bf,font={small,sf},|\\
+% | margin=10pt}|\qquad.
+% \end{quote}
+%
+% The quite exotic option |ruled| which allowed a partial usage of
+% the caption settings for |ruled| floats defined with the
+% \package{float} package will be emulated by this version of the
+% caption package, too.
+% But using this option is not recommended anymore since this
+% version of \thispackage\ offers a more flexible way
+% for changing the captions of these floating environments:
+% \begin{quote}
+% |\DeclareCaptionStyle{ruled}{|\ldots|}|
+% \end{quote}
+% resp.
+% \begin{quote}
+% |\captionsetup[ruled]{|\ldots|}|\qquad.
+% \end{quote}
+% \SeeUserDefined[, \Ref{captionsetup}, and \Ref{float}]
+%
+% \subsection{caption2 v\texorpdfstring{$2.x$}{2.x}}
+% \label{caption2}
+%
+% Although they do very similar stuff, the packages \package{caption} and
+% its experimental and now obsolete variant \package{caption2} have a
+% very different implementation design.
+% Therefore a full compatibility could not be offered.
+% For that reason you will still find a file called |caption2.sty| in
+% this package distribution, so old documents using the \package{caption2}
+% package will still compile fine.
+%
+% Newly created documents should use the actual version of
+% \thispackage\ instead. In most cases it's sufficient to replace the command
+% \begin{quote}
+% |\usepackage[...]{caption2}|
+% \end{quote}
+% by
+% \begin{quote}
+% |\usepackage[...]{caption}|\qquad.
+% \end{quote}
+% But some options and commands will not be emulated, so you can get
+% error messages afterwards. This section will hopefully help you removing
+% these errors. If you have problems migrating from \package{caption2}
+% to \package{caption} please don't hesitate to send me an e-mail asking
+% for help.
+%
+% In addition to the obsolete options shown in the last section
+% these ones will be emulated, too:
+%
+% \begin{center}\small
+% \begin{tabular}{ll}
+% \package{caption2} \version{2.x} & \package{caption} \version{3.x}\\
+% \hline
+% |flushleft| & |justification=raggedright|\\
+% |flushright| & |justification=raggedleft|\\
+% |oneline| & |singlelinecheck=on|\\
+% \end{tabular}
+% \end{center}
+%
+% Setting the margin for captions was done in \version{2.x} with
+% \begin{quote}\leavevmode\hbox{%
+% |\setcaptionmargin{|\ldots|}| resp.
+% |\setcaptionwidth{|\ldots|}|\quad.
+% }\end{quote}
+% This was replaced by
+% \begin{quote}\leavevmode\hbox{%
+% |\captionsetup{margin=|\ldots|}| resp.
+% |\captionsetup{width=|\ldots|}|\quad.
+% }\end{quote}
+% \See{\Ref{margins}}
+%
+% Setting an indention was done in \version{2.x} with
+% \begin{quote}
+% |\captionstyle{indent}|\\
+% |\setlength\captionindent{|\ldots|}|\quad.
+% \end{quote}
+% \pagebreak[3]
+% This is now done with
+% \nopagebreak[3]
+% \begin{quote}
+% |\captionsetup{format=plain,indention=|\ldots|}|\quad.
+% \end{quote}
+%
+% The so-called single-line-check was controlled by the commands
+% |\oneline|\-|captions|\-|false| (for switching the check off) and
+% |\oneline|\-|captions|\-|true| (for switching the check on).
+% This was replaced by
+% |\caption|\-|setup{single|\-|line|\-|check=|\x|off}|
+% resp.
+% |\caption|\-|setup{single|\-|line|\-|check=|\x|on}|\quad.
+% \See{\Ref{justification}}
+%
+% The commands
+% \begin{quote}
+% |\captionlabeldelim|, |\captionlabelsep|, |\captionstyle|,\\
+% |\defcaptionstyle|, |\newcaptionstyle|, and |\renewcaptionstyle|
+% \end{quote}
+% do not have a simple replacement and therefore will not be emulated
+% by this version of \thispackage. (So using them will
+% cause error messages.) Rewriting such code is not always easy and
+% straight-ahead, but by conscientious reading of this manual you should
+% be able to find appropriate options and commands instead.
+%
+% \iffalse
+% ... (some examples)
+% \fi
+%
+% The \version{2.x} option |ignore|\-|LT|\-|cap|\-|width| do not have a
+% replacement, too.
+% But in most cases you can simply drop using that option because
+% in this version of \thispackage\ the value of |\LT|\-|cap|\-|width|
+% will be ignored anyway (unless you set it to a different value than the
+% default one which is |4in|).
+% \See{\Ref{longtable}}
+%
+% \subsection{caption v\texorpdfstring{$3.0$}{3.0}}
+% \label{caption3}
+%
+% \Thispackage\ \version{3.0} did not support any document classes
+% other than the standard \LaTeX\ ones: \class{article}, \class{report},
+% and \class{book}.
+% Therefore the default settings used to be fixed, but now \thispackage{}
+% supports more classes, therefore they are now set in dependence on the
+% document class used.
+%
+% For example: While in \version{3.0} the default caption
+% |jus|\-|ti|\-|fi|\-|ca|\-|tion| used to be always |jus|\-|ti|\-|fied|,
+% it's now still |jus|\-|ti|\-|fied| when using one of the standard document
+% classes, but |ragged|\-|right| will be used as default format when used
+% with the \class{beamer} document class.
+%
+% An easy way to select the `old' defaults is using the option
+% |style=base| when loading \thispackage\ (or later on using |\caption|\-|setup|).
+%
+% \medskip
+%
+% Another new feature is the automatic check for compatibility; if an
+% incompatibility will be found, a warning message will be issued and if a strong
+% incompatibility was found some features of \thispackage\ will be disabled.
+% Please note that only this check was added to \thispackage, so if you get
+% such warning message, the previous versions of \thispackage\ were incompatible
+% as well, but did not issued such warning, they were ``only'' having
+% side-effects or causing problems.
+% So these warnings only say that some bad side effects or problems could
+% happen, but not that they actually will happen.
+% Anyway, if you use \thispackage\ in such circumstances,
+% you should use it with care.
+%
+% \bigskip
+%
+% \begin{Note*}
+% \Thispackage\ \version{3.0} offered the option |caption=|\x|false|,
+% which used to be a workaround for not using the whole \package{caption} package
+% (leaving the caption stuff offered by the document class or other packages
+% intact), but keeping the \package{subfig} package\cite{subfig} working.
+% This mechanism is obsolete and not offered anymore, please pass this option
+% to the \package{subfig} package instead and do not load \thispackage\ anymore.
+% \end{Note*}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \section{Commands for document class authors}
+%
+% A document class could simply load the \package{caption} package instead
+% of defining an own variant of |\@make|\-|caption|. However if the author decides
+% not to do this -- for whatever reason -- there is a second option:
+%
+% \NEWfeature{v3.5}
+% If a document class defines |\caption@document|\-|class|, an adaption to the
+% \package{caption} package will be loaded as |caption-|\meta{documentclass}|.sto|
+% if the \package{caption} kernel is loaded.
+% The goal of this adaption file is changing the default settings of the
+% \package{caption} package so simply loading it (without any package options)
+% will not make any harm to the look at feel of the captions.
+% This gives end-users the opportunity to fine-tune certain aspects of the
+% appearance of captions by adding package options, without unwanted
+% side-effects on other aspects of the appearance.
+%
+% In both cases the command |\Set|\-|Caption|\-|Default|
+% could be used to adapt the \package{caption} package default values:
+%
+% \DescribeMacro{\SetCaptionDefault}
+% The command
+% \begin{quote}
+% |\SetCaptionDefault*|\marg{option}\marg{default value}
+% \end{quote}
+% changes the default value for the option \meta{option}, for example:
+% \begin{quote}
+% |\SetCaptionDefault{format}{hang}|\\
+% |\SetCaptionDefault{justification}{raggedright}|\\
+% |\DeclareCaptionLabelSeparator{silly}{ +++ }|\\
+% |\SetCaptionDefault{labelseparator}{silly}|
+% \end{quote}
+% This command is available for the options
+% |box|,
+% |font|,
+% |format|,
+% |justification|,
+% |label|\-|font|,
+% |label|\-|format|,
+% |label|\-|separator|,
+% |list|\-|format|,
+% |margin|,
+% |parbox|,
+% |position|,
+% |single|\-|line|\-|check|,
+% |text|\-|font|,
+% |text|\-|format|, and
+% |width|.
+%
+% The starred variant only makes a difference when setting the default length
+% of either |margin| or |width|, in this case it will use |\def| internally
+% instead of |\edef| to store the value so the actual margin will be calculated
+% when used (and not when set).
+%
+% \DescribeMacro{\SetCaptionFallback}
+% The command
+% \begin{quote}
+% |\SetCaptionFallback|\marg{option}\marg{fallback value}
+% \end{quote}
+% changes the fallback value for the option \meta{option}, for example:
+% \begin{quote}
+% |\SetCaptionFallback{labelformat}{simple}|
+% \end{quote}
+% Currently only the pre-defined label format `original' uses a fallback
+% value when |\fnum@|\meta{environment} is not defined for the current (floating)
+% environment.
+%
+% \DescribeMacro{\AtCaptionPackage}
+% The adaption file will be loaded when the \package{caption} kernel |caption3.sty|
+% will be loaded so the given adaptions will be done for the \package{floatrow}
+% and \package{subfig} packages even if the \package{caption} package isn't loaded.
+%
+% But some adaptions have to be done for the \package{caption} package,
+% and for this reason the hook
+% \begin{quote}|\AtCaptionPackage|\marg{code}\end{quote}
+% is offered to authors of adaption files.
+% The \meta{code} inside the hook will be executed right before the given package
+% options will be evaluated.
+%
+% For example the adaption file for the \KOMAScript\ document classes
+% uses |\At|\-|Begin|\-|Caption| to re-define the \package{caption} package
+% options |figure|\-|position| and |table|\-|position| to issue a warning
+% that using these options have little effect here.
+%
+% \DescribeMacro{\AfterCaptionPackage}
+% The additional hook
+% \begin{quote}|\AfterCaptionPackage|\marg{code}\end{quote}
+% is offered to authors of adaption files as well.
+% The \meta{code} inside the hook will be executed at the very end of the
+% \package{caption} package.
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \section{Commands for babel language package authors}
+%
+% \NEWfeature{v3.5}
+% \DescribeMacro{\caption@switchdefault}
+% If the \package{caption3} kernel package is loaded, the command
+% \begin{quote}|\caption@switchdefault|\marg{option}\marg{code with \#1}\marg{new value}\end{quote}
+% is available which saves the old default value of the given option using
+% \meta{code} and sets the new default value afterwards.
+%
+% \DescribeMacro{\caption@restoredefault}
+% The command
+% \begin{quote}|\caption@restoredefault|\marg{option}\marg{old value}\end{quote}
+% restores the old default value which was stored in \meta{old value} before.
+%
+% Example:
+% \begin{quote}
+% |\DeclareCaptionLabelSeparator{french}{|\ldots|}|\\
+% |\addto\extrasfrench{%|\\
+% | \caption@switchdefault{labelseparator}{\babel@save #1}{french}}|\\
+% |% Note: \caption@restoredefault isn't needed here|
+% \end{quote}
+%
+% Another example:
+% \begin{quote}
+% |\caption@switchdefault{font}{\let\original@captionfont#1}{it}%|\\
+% \ldots\\
+% |\caption@restoredefault{font}{\original@captionfont}%|\\
+% \end{quote}
+%
+% Since boths commands are defined with |\def| inside the \package{caption3}
+% kernel, they could be pre-defined with
+% \begin{quote}
+% |\providecommand\caption@switchdefault[3]{}|\\
+% |\providecommand\caption@restoredefault[2]{}|
+% \end{quote}
+% inside the babel language package so their existence doesn't need to be tested
+% prior use.
+%
+% Additionally babel language packages should not re-define |\@make|\-|caption|
+% if the \package{caption} package is loaded, i.e.~if |\caption@makecaption| is
+% defined. (Unfortunately one cannot use the \LaTeX{} kernel command
+% |\@if|\-|package|\-|loaded{caption}| here since it's only available in the
+% document preamble.)
+%
+% Please note that code like
+% \begin{quote}
+% |\addto\extraswhatever{%|\\
+% | \@ifundefined{caption@makecaption}{%|\\
+% | \babel@save\@makecaption|\\
+% | \let\@makecaption\my@makecaption|\\
+% | }{%|\\
+% | \caption@switchdefault{|\ldots|}{\babel@save #1}{|\ldots|}%|\\
+% | }}|
+% \end{quote}
+% would be wrong since it mixes up the presence of the \package{caption3} kernel
+% and the \package{caption} package.
+% If the \package{caption3} kernel is loaded this does not mean that the
+% \package{caption} package is loaded, too, and the latter one re-defines
+% |\caption|, |\@caption|, and |\@make|\-|caption| while the \package{caption3}
+% kernel does not re-define any of them, instead it only provides (default) values
+% for the \package{caption}, \package{floatrow}, and \package{subfig} package.
+%
+% Currently there is build-in support for the following babel language options:
+% |arabic|, |farsi|, |french|, |hungarian|, |latvian|, and |magyar|.
+% This support could be deactivated by defining
+% \begin{quote}
+% |\def\caption@ifbabel@|\meta{package}|{false}|
+% \end{quote}
+% where \meta{package} is either |arabi|, |french|, |frenchle|, |hungarian|,
+% or |latvian|.
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
%
% \pagebreak[4]
% \section*{Internal commands}
@@ -145,11 +4306,8 @@
% Internal command & Currently used by \\
% \hline
% |\caption@kernel@addcontentsline| & \package{floatrow} \\
-% |\caption@makecaption| & \package{bidi} \\
% |\caption@settype| & \package{newfloat} \\
% |\caption@setsubtype| & \package{floatrow} \\
-% |\caption@starfalse| & \package{bidi} \\
-% |\caption@startrue| & \package{bidi} \\
% |\caption@xlabel| & \package{cleveref} \\
% \end{tabular}\end{quote}
%
@@ -160,10 +4318,159 @@
% but we are working on it on the Git branch \texttt{feature/lwarp}:
% \url{https://gitlab.com/axelsommerfeldt/caption/-/tree/feature/lwarp}
%
-% \StopEventually{}
-% \clearpage
-% \tableofcontents
-%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \StopEventually{%^^A
+% \begin{thebibliography}{99}
+%
+% \bibitem{TLC2}
+% Frank Mittelbach and Michel Goossens:\\
+% \newblock {\em The {\LaTeX} Companion (2nd.~Ed.)},\\
+% \newblock Addison-Wesley, 2004.
+%
+% \bibitem{beamer}
+% Till Tantau:\\
+% \href{http://www.ctan.org/pkg/beamer}%
+% {\emph{User Guide to the Beamer Class, Version 3.07}},\\
+% March 11, 2007
+%
+% \bibitem{KOMAScript}
+% Markus Kohm \& Jens-Uwe-Morawski:\\
+% \href{http://www.ctan.org/pkg/koma-script}%
+% {\emph{KOMA-Script -- a versatile \LaTeXe\ bundle}},\\
+% 2007-01-09
+%
+% \bibitem{NTG}
+% Victor Eijkhout:\\
+% \href{http://www.ctan.org/pkg/ntgclass}%
+% {\emph{An introduction to the Dutch \LaTeX\ document classes}},\\
+% 3 September 1989
+%
+% \bibitem{algorithms}
+% Rog\'erio Brito:\\
+% \href{http://www.ctan.org/pkg/algorithms}%
+% {\emph{Algorithms}},\\
+% June 2, 2006
+%
+% \bibitem{float}
+% Anselm Lingnau:\\
+% \href{http://www.ctan.org/pkg/float}%
+% {\emph{An Improved Environment for Floats}},\\
+% 2001/11/08
+%
+% \bibitem{floatflt}
+% Mats Dahlgren:\\
+% \href{http://www.ctan.org/pkg/floatflt}%
+% {\emph{Welcome to the floatflt package}},\\
+% 1998/06/05
+%
+% \bibitem{floatrow}
+% Olga Lapko:\\
+% \href{http://www.ctan.org/pkg/floatrow}%
+% {\emph{The floatrow package documentation}},\\
+% 2009/08/02
+%
+% \bibitem{fltpage}
+% Sebastian Gross:\\
+% \href{http://www.ctan.org/pkg/fltpage}%
+% {\emph{Welcome to the beta test of fltpage package!}},\\
+% 1998/11/13
+%
+% \bibitem{hyperref}
+% Sebastian Rahtz \& Heiko Oberdiek:\\
+% \href{http://www.ctan.org/pkg/hyperref}%
+% {\emph{Hypertext marks in \LaTeX: a manual for hyperref}},\\
+% November 2012
+%
+% \bibitem{hypcap}
+% Heiko Oberdiek:\\
+% \href{http://www.ctan.org/pkg/oberdiek}%
+% {\emph{The hypcap package -- Adjusting anchors of captions}},\\
+% 2011/02/16
+%
+% \bibitem{listings}
+% Carsten Heinz \& Brooks Moses:\\
+% \href{http://www.ctan.org/pkg/listings}%
+% {\emph{The Listings Package}},\\
+% 2007/02/22
+%
+% \bibitem{longtable}
+% David Carlisle:\\
+% \href{http://www.ctan.org/pkg/longtable}%
+% {\emph{The longtable package}},\\
+% 2004/02/01
+%
+% \bibitem{picinpar}
+% Friedhelm Sowa:\\
+% \href{http://www.ctan.org/pkg/picinpar}%
+% {\emph{Pictures in Paragraphs}},\\
+% July 13, 1993
+%
+% \bibitem{picins}
+% Joachim Bleser and Edmund Lang:\\
+% \href{http://www.ctan.org/pkg/picins}%
+% {\emph{PicIns-Benutzerhandbuch Version 3.0}},\\
+% September~1992
+%
+% \bibitem{rotating}
+% Sebastian Rahtz and Leonor Barroca:\\
+% \href{http://www.ctan.org/pkg/rotating}%
+% {\emph{A style option for rotated objects in \LaTeX}},\\
+% 1997/09/26
+%
+% \bibitem{setspace}
+% Erica M. S. Harris \& Geoffrey Tobin:\\
+% \href{http://www.ctan.org/pkg/setspace}%
+% {\emph{LaTeX Document Package ``setspace''}},\\
+% 1 December 2000
+%
+% \bibitem{sidecap}
+% Rolf Niepraschk \& Hubert G\"a\ss lein:\\
+% \href{http://www.ctan.org/pkg/sidecap}%
+% {\emph{The sidecap package}},\\
+% 2003/06/06
+%
+% \bibitem{subfigure}
+% Steven D. Cochran:\\
+% \href{http://www.ctan.org/pkg/subfigure}%
+% {\emph{The subfigure package}},\\
+% 2005/03/15
+%
+% \bibitem{subfig}
+% Steven D. Cochran:\\
+% \href{http://www.ctan.org/pkg/subfig}%
+% {\emph{The subfig package}},\\
+% 2005/07/05
+%
+% \bibitem{supertabular}
+% Johannes Braams and Theo Jurriens:\\
+% \href{http://www.ctan.org/pkg/supertabular}%
+% {\emph{The supertabular environment}},\\
+% 2004/02/20
+%
+% \bibitem{threeparttable}
+% Donald Arseneau:\\
+% \href{http://www.ctan.org/pkg/threeparttable}%
+% {\emph{Three part tables: title, tabular environment, notes}},\\
+% March 5, 2010
+%
+% \bibitem{wrapfig}
+% Donald Arseneau:\\
+% \href{http://www.ctan.org/pkg/wrapfig}%
+% {\emph{WRAPFIG.STY ver 3.6}},\\
+% Jan 31, 2003
+%
+% \bibitem{xtab}
+% Peter Wilson:\\
+% \href{http://www.ctan.org/pkg/xtab}%
+% {\emph{The xtab package}},\\
+% 2011/07/31
+%
+% \end{thebibliography}
+% }
+%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
@@ -191,6 +4498,7 @@
% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\kernel@ifnextchar}
% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
@@ -216,7 +4524,8 @@
% \fi
%
% \setlength{\parskip}{0pt plus 1pt}
-% \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
+% \renewcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
+% \let\endNote\undefined
%
% \changes{v1.0}{1994/10/27}{First release}
% \changes{v1.1}{1994/11/03}{New option \texttt{centerlast}}
@@ -232,25 +4541,69 @@
% \fi
%
% \clearpage
+% \section{The implementation}
%
% \iffalse
%<*package>
% \fi
%
-% \section{Identification}
+% \subsection{Introduction}
+%
+% \Thispackage\ consists of two parts -- the kernel
+% (|caption3.sty|) and the main package (|caption.sty|).
+%
+% \Thispackage\ redefines the \LaTeX\ commands
+% |\caption|, |\@caption|, and |\@makecaption| and maps the latter one to
+% |\caption@@make|, giving the user the possibility to control the look \& feel
+% of the captions from floating environments like |figure| and |table|.
+% Furthermore it does similar to the caption stuff coming from other packages
+% (like the \package{longtable} or \package{supertabular} package):
+% Mapping the appropriate internal commands (like |\LT@makecaption| or
+% |\ST@caption|) to the ones offered by the \package{caption3} kernel.
+% So you can think of \thispackage\ as a layer package, it
+% simply provides adaptation layers between the caption stuff coming from
+% \LaTeXe\ or packages, and the caption stuff offered by the
+% \package{caption3} kernel.
+%
+% \subsection{Identification}
%
+% We need at least \LaTeX2e\ version 1994/12/01.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption}[2020/10/26 v3.5g Customizing captions (AR)]
% \end{macrocode}
%
-% \section{Loading the kernel}
+% Bypass the release declarations in case the \LaTeX\ kernel doesn’t know how to deal with them
+% (as suggested by \url{https://www.latex-project.org/publications/2018-FMi-TUB-tb122mitt-version-rollback.pdf}).
+% \begin{macrocode}
+\providecommand\DeclareRelease[3]{}
+\providecommand\DeclareCurrentRelease[2]{}
+% \end{macrocode}
+%
+% Declare all supported releases.
+% \begin{macrocode}
+\DeclareRelease{v1}{1994-10-27}{caption_1995-04-05.sty}
+\DeclareRelease{v3.0}{2003-12-20}{caption_2007-04-16.sty}
+\DeclareRelease{v3.1}{2007-09-01}{caption_2010-01-09.sty}
+\DeclareRelease{v3.2}{2011-08-06}{caption_2011-11-10.sty}
+\DeclareRelease{v3.3}{2013-01-10}{caption_2019-09-01.sty}
+\DeclareRelease{v3.4}{2019-11-24}{caption_2020-07-29.sty}
+\DeclareRelease{v3.5}{2020-08-30}{caption_2020-10-26.sty}
+\DeclareCurrentRelease{v3.6}{2022-02-20}
+% \end{macrocode}
%
+% Identify the current version of the package.
% \begin{macrocode}
-\RequirePackage{caption3}[2020/10/06] % needs v2.2b or newer
+\ProvidesPackage{caption}[2022/02/20 v3.6 Customizing captions (AR)]
% \end{macrocode}
%
-% \section{Check against unknown document classes}
+% \subsection{Loading the kernel}
+%
+% Load a matching version of the \package{caption} kernel.
+% \begin{macrocode}
+\RequirePackage{caption3}[2022/01/07] % needs v2.3 or newer
+% \end{macrocode}
+%
+% \subsection{Check against unknown document classes}
%
% \begin{macrocode}
\caption@ifbool{documentclass}{}{%
@@ -259,7 +4612,7 @@
standard defaults will be used}}
% \end{macrocode}
%
-% \section{Check against incompatible packages}
+% \subsection{Check against incompatible packages}
%
% \changes{v3.0p}{2007/04/06}{Check against obsolete \package{caption2} package added}
% \begin{macrocode}
@@ -271,41 +4624,109 @@
}{}
% \end{macrocode}
%
+% Check against incompatible packages which used to work fine with \version{1} of the `caption' package.
% \changes{v3.1}{2007/06/15}{Check against incompatible \package{ftcap} package added}
% \changes{v3.1}{2007/06/15}{Check against incompatible \package{nonfloat} package added}
% \changes{v3.1}{2007/06/18}{Check against incompatible \package{topcapt} package added}
+% \changes{v3.6}{2021/01/02}{Check against incompatible packages \package{ftcap}, \package{nonfloat}, and \package{topcapt} revised}
% \begin{macrocode}
\caption@AtBeginDocument{%
- \@ifpackageloaded{ftcap}{\caption@DisablePositionOption{ftcap}}{}%
- \@ifpackageloaded{nonfloat}{\caption@DisablePositionOption{nonfloat}}{}%
- \@ifpackageloaded{topcapt}{\caption@DisablePositionOption{topcapt}}{}}
+ \caption@setincompatible{\@ifpackageloaded{captcont}}{captcont package}%
+ \caption@setincompatible{\@ifpackageloaded{ftcap}}{ftcap package}%
+ \caption@setincompatible{\@ifpackageloaded{nonfloat}}{nonfloat package}%
+ \caption@setincompatible{\@ifpackageloaded{topcapt}}{topcapt package}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setincompatible}
+% \changes{v3.4}{2019/09/09}{This macro added}
+% \changes{v3.6}{2020/12/22}{Adapted to fallback concept}
+% |\caption@setincompatible|\marg{condition}\marg{message text}
+% \begin{macrocode}
+\newcommand*\caption@setincompatible[2]{%
+ #1{%
+ \caption@Error{%
+ The #2 is incompatible to the\MessageBreak
+ current version of the `caption' package,\MessageBreak
+ so try \string\usepackage{caption}[=v1] instead}%
+ }{}}
+\@onlypreamble\caption@setincompatible
% \end{macrocode}
-% \begin{macro}{\caption@DisablePositionOption}
-% \changes{v3.1g}{2008/03/20}{\texttt{position=b} added}
-% \changes{v3.1h}{2008/03/29}{%
-% Name changed from \cs{caption@IncompatiblePackage} to \cs{caption@DisablePositionOption};
-% disables the `position' option now instead of issuing a warning}
-% |\caption@DisablePositionOption|\marg{package}\par
-% disables the `position' option.
+% \end{macro}
+%
+% \subsection{Positioning}
+%
% \begin{macrocode}
-\newcommand*\caption@DisablePositionOption[1]{%
- \caption@InfoNoLine{%
- `#1' package detected; setting `position=b' for compatibility reasons}%
- \caption@setposition b%
+\DeclareCaptionPosition{auto}{#2}{%
+ \caption@ifsubcaption@above{#2}{%
+ \ifvmode
+ \caption@autoposition{#1}{#2}%
+ \else
+ #2%
+ \fi}}
% \end{macrocode}
% \begin{macrocode}
- \DeclareCaptionOption{position}{%
- \caption@Error{Usage of the `position' option is incompatible\MessageBreak
- to the `#1' package}}}
+\def\caption@position@a{\caption@position@auto} % needed by floatrow package, \flrow@cappos
+% \end{macrocode}
+%
+% \begin{macrocode}
+\SetCaptionDefault{position}{auto}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setautoposition}
+% \changes{v3.1}{2007/06/10}{This macro added}
+% \changes{v3.5}{2020/07/27}{Adapted to current implementation of `auto'}
+% \changes{v3.6}{2021/01/03}{Adapted to current implementation of `auto'}
+% |\caption@setautoposition|\marg{position}\\
+% replaces the above algorithm by a different one (or a fixed position setting).
+% \begin{macrocode}
+\newcommand*\caption@setautoposition[1]{%
+ \renewcommand*\caption@position@auto{%
+ \@nameuse{caption@position@#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@autoposition}
+% \changes{v3.0a}{2004/01/23}{\cs{ifvmode} added}
+% \changes{v3.0b}{2004/05/16}{Split into \cs{caption@fixposition} & \cs{caption@autoposition}}
+% \changes{v3.5}{2020/07/27}{Adapted to current implementation of `auto'}
+% \changes{v3.6}{2021/01/05}{Adapted to current implementation of `auto'; \cs{ifvmode} moved into definition of `auto'}
+% We try to guess the current position of the caption by checking |\prev|\-|depth|.
+%
+% A different solution would be setting the |\space|\-|factor| to something
+% not much less than 1000 (for example 994) in |\caption@start| and
+% checking this value here by |\ifnum\space|\-|factor=994|.
+% (It's implemented in the \package{threeparttable} package\cite{threeparttable} this way.)
+%
+% Another idea would be checking |\@if|\-|mini|\-|page|, but since some packages
+% typeset the caption within a simple |\vbox| this does not seem to be a good one.
+% \begin{macrocode}
+\newcommand*\caption@autoposition[2]{%
+ \edef\caption@tempa{\the\prevdepth}%
+ \caption@Debug{\string\prevdepth=\caption@tempa}%
+ \ifdim\prevdepth>-\p@
+ #2% position=bottom
+ \else
+ #1% position=top
+ \fi}
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@autoposition}
+% \changes{v3.6}{2021/01/05}{This macro added}
+% |\DeclareCaptionAutoPosition|\marg{code with \#1 and \#2}\\
+% replaces the inner algorithm of |position=auto| with a custom one.
+% If \#1 is applied the skip will be typeset below the caption
+% (like |position=t|), if \#2 is applied the skip will by typeset
+% above the caption (like |position=b|).
% \begin{macrocode}
-\@onlypreamble\caption@DisablePositionOption
+\newcommand*\DeclareCaptionAutoPosition{%
+ \renewcommand*\caption@autoposition[2]}%
% \end{macrocode}
% \end{macro}
%
-% \section{Declaration of options}
+% \subsection{Declaration of options}
%
-% \subsection{Miscellaneous options}
+% \subsubsection{Miscellaneous options}
%
% \begin{macrocode}
\DeclareCaptionOption*{config}[caption]{%
@@ -335,105 +4756,8 @@
\captionsetup{list-entry=default}
% \end{macrocode}
%
-% \begin{macro}{\caption@declparboxrestore}
-% \changes{v3.5g}{2020/10/26}{This macro added}
-% |\caption@declparboxrestore|\marg{name}\marg{code}
-% \begin{macrocode}
-% TODO: Remove \caption@declparboxrestore
-\newcommand\caption@declparboxrestore{%
- \caption@decl{parboxrestore}}
-% \end{macrocode}
-% \begin{macrocode}
-\@onlypreamble\caption@declparboxrestore
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\caption@setparboxrestore}
-% \changes{v3.2}{2010/11/07}{This macro added}
-% \changes{v3.5g}{2020/10/26}{New implementation; default changed from `partial' to `full'}
-% |\caption@setparboxrestore|\marg{\purett{partial} or \purett{full}}
-% \begin{macrocode}
-% TODO: Remove \caption@setparboxrestore
-\newcommand*\caption@setparboxrestore{%
- \caption@set{parboxrestore}}
-% \end{macrocode}
-% \begin{macrocode}
-\caption@declparboxrestore{full}{%
- \@parboxrestore}
-% \end{macrocode}
-% The original code (from |latex/base/ltboxes.dtx|):
-% \begin{verbatim}
-% \def\@parboxrestore{\@arrayparboxrestore\let\\\@normalcr}
-% \def\@arrayparboxrestore{%
-% \let\if@nobreak\iffalse
-% \let\if@noskipsec\iffalse
-% \let\par\@@par
-% \let\-\@dischyph
-% \let\'\@acci\let\`\@accii\let\=\@acciii
-% \parindent\z@ \parskip\z@skip
-% \everypar{}%
-% \linewidth\hsize
-% \@totalleftmargin\z@
-% \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
-% \parfillskip\@flushglue \lineskip\normallineskip
-% \baselineskip\normalbaselineskip
-% \sloppy}
-% \end{verbatim}%^^A
-% This one will be used by |\@caption| instead of |\@parboxrestore|.
-% \begin{macrocode}
-\caption@declparboxrestore{partial}{%
- \let\if@nobreak\iffalse
- \let\if@noskipsec\iffalse
- \let\par\@@par
-% \let\-\@dischyph
-% \let\'\@acci\let\`\@accii\let\=\@acciii
- \parindent\z@ \parskip\z@skip
- \everypar{}%
-% \linewidth\hsize
-% \@totalleftmargin\z@
- \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
- \parfillskip\@flushglue \lineskip\normallineskip
- \baselineskip\normalbaselineskip
- \sloppy
- \let\\\@normalcr}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\caption@parboxrestore@mini}
-% \changes{v3.2}{2010/10/24}{This macro added}
-% \changes{v3.5g}{2020/10/26}{Renamed from \cs{caption@boxrestore@mini} to \cs{caption@parboxrestore@mini}}
-% Resets |\par| so the very first |\par| in |\@caption| behaves quite the same as in floating environments.
-% Will be used by |\set|\-|caption|\-|type|.
-% \begin{macrocode}
-\caption@declparboxrestore{mini}{%
- \let\par\@@par
- \parindent\z@ \parskip\z@skip
- \sloppy}
-% \end{macrocode}
-% \end{macro}
-%
-% `default' usually maps to `full'.
-% \changes{v3.5g}{2020/10/26}{The default of \cs{caption@parboxrestore} maps to `full' instead of `partial' now}
-% \begin{macrocode}
-\SetCaptionDefault{parboxrestore}{full}
-% \end{macrocode}
-%
% \changes{v3.2}{2010/11/07}{Option \opt{parboxrestore} added}
-% \begin{macrocode}
-% TODO: Remove the (undocumentated) option "parboxrestore"
-\DeclareCaptionOption{parboxrestore}{\caption@setparboxrestore{#1}}
-% \end{macrocode}
-%
-% \begin{macro}{\caption@parboxrestore}
-% \changes{v3.1}{2007/03/03}{This macro and its usage added}
-% \changes{v3.1b}{2007/09/17}{Bugfix: Redefinition of CR added}
-% \changes{v3.2}{2010/11/07}{Support of option \opt{parboxrestore} added}
-% \changes{v3.5g}{2020/10/26}{New implementation; renamed from \cs{caption@boxrestore} to \cs{caption@parboxrestore}}
-% \begin{macrocode}
-% TODO: Change definition to \def\caption@parboxrestore{\@parboxrestore}
-\captionsetup{parboxrestore=default}
-% \end{macrocode}
-% \end{macro}
+% \changes{v3.6}{2021/01/07}{(Undocumented) Option \opt{parboxrestore} removed}
%
% \changes{v3.1f}{2007/11/28}{Option \opt{@minipage=} added}
% \begin{macrocode}
@@ -444,58 +4768,30 @@
\captionsetup{@minipage=default}
% \end{macrocode}
%
-% \subsection{caption v1.x compatibility options}
% \changes{v3.1}{2007/07/21}{Option `compatibility' added}
% \changes{v3.1}{2007/09/01}{caption v1.x compatibility options revised}
% \changes{v3.1d}{2007/10/24}{Bugfix 07-10-24 in caption v1.x$ compatibility options}
% \changes{v3.5a}{2020/09/02}{caption v1.x compatibility options fixed}
+% \changes{v3.6}{2020/12/22}{Option `compatibility' adapted to fallback concept}
%
-% Currently we support |v1| and |v3| as values for the |compatibility=| option.
-% But since this used to be a boolean option is the past we still support any boolean value
-% for compatibility reasons.
+% We only support boolean values for the |compatibility=| option
+% since these were the only one which were documented in the past.
%
% \begin{macrocode}
-\DeclareCaptionOption{compatibility}[v1]{%
- \caption@ifinlist{#1}{v1,1,true,yes,on}{%
- \let\caption@ifcompatibility\@firstoftwo
- }{\caption@ifinlist{#1}{v3,3,0,false,no,off}{%
- \let\caption@ifcompatibility\@secondoftwo
+\DeclareCaptionOption{compatibility}[1]{%
+ \caption@ifinlist{#1}{1,true,yes,on}{%
+ \caption@Error{%
+ Obsolete compatibility value `#1',\MessageBreak
+ please use either \string\usepackage{caption}[=v1]\MessageBreak
+ or \string\usepackage{caption-light} instead}%
+ }{\caption@ifinlist{#1}{0,false,no,off}{%
+ % nothing to do
}{%
\caption@Error{Undefined compatibility value `#1'}%
}}}
-\@onlypreamble@key{caption}{compatibility}
-% \end{macrocode}
-% \begin{macrocode}
-\caption@setbool{compatibility}{0} % default: Try not to be compatible to v1.x
% \end{macrocode}
%
-% \begin{macro}{\caption@setincompatible}
-% \changes{v3.4}{2019/09/09}{This macro added}
-% |\caption@setincompatible|\marg{condition}\marg{message text}
-% \begin{macrocode}
-\newcommand*\caption@setincompatible[2]{%
- #1{%
- \caption@WarningNoLine{%
- #2;\MessageBreak
- Setting compatibility to v1}%
- \caption@setbool{compatibility}{1}%
- }{}}
-% \end{macrocode}
-% \end{macro}
-%
-% Check against incompatible packages which used to work fine with v1 of the `caption' package.
-% \begin{macrocode}
-\caption@AtBeginDocument{\caption@ifcompatibility{}{%
-% \end{macrocode}
-% The usage of the (now obsolete) \package{captcont} package,
-% which brings its own definition of |\caption*|, was quite common in the old days.
-% \begin{macrocode}
- \caption@setincompatible{\@ifpackageloaded{captcont}}{captcont package is loaded}%
-% \end{macrocode}
-% To be continued\ldots
-% \begin{macrocode}
-}}
-% \end{macrocode}
+% \subsubsection{caption v1.x compatibility options}
%
% \begin{macrocode}
\DeclareCaptionOptionNoValue*{normal}{%
@@ -540,7 +4836,7 @@
\DeclareCaptionOptionNoValue*{ruled}{\caption@setbool{ruled}{1}}
% \end{macrocode}
%
-% \subsection{caption2 v2.x compatibility options}
+% \subsubsection{caption2 v2.x compatibility options}
% \changes{v3.0h}{2005/07/08}{caption2 \version{2.x} compatibility options added}
% \changes{v3.1}{2007/09/01}{caption2 v2.x compatibility options revised}
% \changes{v3.1d}{2007/10/24}{Bugfix 07-10-24 in caption v2.x$ compatibility options}
@@ -560,7 +4856,7 @@
\caption@WarningNoLine{Obsolete option `ignoreLTcapwidth' ignored}}
% \end{macrocode}
%
-% \subsection{Obsolete caption v3.0 options}
+% \subsubsection{Obsolete caption v3.0 options}
% \changes{v3.1}{2007/05/07}{Package option \opt{caption} marked as obsolete,
% gives error now}
%
@@ -574,7 +4870,7 @@
and do *not* load the caption package anymore}}}
% \end{macrocode}
%
-% \subsection{fltpage package support options}
+% \subsubsection{fltpage package support options}
%
% \changes{v3.1}{2007/09/01}{Options `FPlist' \& `FPref' added}
% With these options is controlled where the list-of entry and |\ref| resp.
@@ -597,7 +4893,7 @@
\captionsetup{FPlist=caption,FPref=figure}
% \end{macrocode}
%
-% \subsection{hyperref package support options}
+% \subsubsection{hyperref package support options}
%
% \changes{v3.1}{2007/06/21}{Options `hypcap' \& `hypcapspace' added}
% With |hypcap=off| one can turn the \package{hypcap} support off
@@ -610,7 +4906,7 @@
\captionsetup{hypcap=1,hypcapspace=.5\baselineskip}
% \end{macrocode}
%
-% \section{Document class support}
+% \subsection{Document class support}
%
% Execute the code declared with |\At|\-|Caption|\-|Package|.
% We do this right before processing the options so stuff done with
@@ -622,7 +4918,7 @@
\let\AtCaptionPackage\@firstofone
% \end{macrocode}
%
-% \section{Processing of options}
+% \subsection{Processing of options}
%
% \changes{v3.0m}{2007/03/04}{Verbose option added}
% \changes{v3.1}{2007/07/02}{Verbose option removed from package}
@@ -633,30 +4929,73 @@
\caption@ProcessOptions*{caption}
% \end{macrocode}
%
-% \section{\cs{caption}, \cs{@caption}, and \cs{@makecaption}}
+% \subsection{\cs{caption}, \cs{@caption}, and \cs{@makecaption}}
%
-% \begin{macro}{\caption@ifflag}
-% \changes{v3.3}{2011/12/28}{This switch added}
-% \changes{v3.3}{2018/08/08}{Rewritten (and renamed) so a counter is used instead of a switch}
+% \begin{macro}{\caption@flags}
+% \changes{v3.3}{2018/08/08}{This counter and associated macros added}
% Since we support continued floats and sub-figures it's not an easy task
-% to manage the figure (and table) counter. (Especially since previous versions
-% of the caption package has proven that correcting a counter locally is not a good idea.)
-%
-% These three switches hold the
-% current status: |\caption@if|\-|flag{2}| is set if the caption was already
-% typeset (so the counter doesn't need to be incremented for sub-figures),
-% |\caption@if|\-|flag{4}| is set if there is already content which have
-% incremented the counter (so the counter doesn't need to be incremented
-% for the main caption, further sub-figures, and other stuff), and
-% |\caption@if|\-|flag{1}| is set if |\continued|\-|float| was given.
+% to manage the figure (and table) counter, especially since previous versions
+% of the caption package have proven that correcting a counter locally is not a good idea,
+% and to make it dependent on the |position=| setting (like the \package{subfig} package does)
+% is not a good idea, either.
%
% In the past three boolean switches were used to store the flags, but since some
% packages (like the \package{floatrow} and \package{tabu} package) try hard to keep
-% counter changes locally under certain circumstances, it seems a good idea to make
-% these flags a counter value, too.
+% \LaTeX{} counter changes locally under certain circumstances, it seems a good idea to make
+% these flags a \LaTeX{} counter value.
+%
+% See also:
+% \url{https://gitlab.com/axelsommerfeldt/caption/-/issues/27} and
+% \url{https://tex.stackexchange.com/questions/444942/subcaptionbox-in-tabu-wrong-numbering-of-subfigures}
+%
% \begin{macrocode}
\newcounter{caption@flags}
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@clrflags}
+% \changes{v3.3}{2018/08/08}{This macro added}
+% |\caption@clrflags| clears all flags.
+% Note that we have to use |\set|\-|counter| here (instead of using \TeX{} primitives)
+% since some packages re-define |\set|\-|counter| to keep counter changes local.
+% \begin{macrocode}
+\newcommand*\caption@clrflags{%
+ \setcounter{caption@flags}{0}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifflags}
+% \changes{v3.6}{2020/12/28}{This macro added}
+% |\caption@ifflags|\marg{yes-code}\marg{no-code}\\
+% tests if any of the flags is set.
+% \begin{macrocode}
+\newcommand*\caption@ifflags{%
+ \ifcase\c@caption@flags
+ \expandafter\@secondoftwo
+ \else
+ \expandafter\@firstoftwo
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setflag}
+% \changes{v3.3}{2013/04/14}{This macro added}
+% \changes{v3.3}{2018/08/08}{Rewritten so a counter is used instead of a switch}
+% |\caption@setflag|\marg{number}\\
+% sets the flag with the given number (where \meta{number} is one of 1, 2, 4, 8, 16, \ldots).
+% Note that we have to use |\add|\-|to|\-|counter| here (instead of |\advance|)
+% since some packages re-define |\add|\-|to|\-|counter| to keep counter changes local.
+% \begin{macrocode}
+\newcommand*\caption@setflag[1]{%
+ \caption@ifflag{#1}{}{\addtocounter{caption@flags}{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifflag}
+% \changes{v3.3}{2011/12/28}{This switch added}
+% \changes{v3.3}{2018/08/08}{Rewritten (and renamed) so a counter is used instead of a switch}
+% |\caption@ifflag|\marg{number}\marg{yes-code}\marg{no-code}\\
+% tests if the flag with the given number is set (where \meta{number} is one of 1, 2, 4, 8, 16, \ldots).
% \begin{macrocode}
\newcommand*\caption@ifflag[1]{%
\@tempcnta\c@caption@flags
@@ -669,37 +5008,81 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\caption@clrflags}
-% \changes{v3.3}{2018/08/08}{This macro added}
-% \begin{macro}{\caption@clrflag}
-% \changes{v3.3}{2013/04/14}{This macro added}
-% \changes{v3.3}{2018/08/08}{Rewritten so a counter is used instead of a switch}
-% \begin{macro}{\caption@setflag}
-% \changes{v3.3}{2013/04/14}{This macro added}
-% \changes{v3.3}{2018/08/08}{Rewritten so a counter is used instead of a switch}
-% Furthermore we introduce the macros \cs{caption@clrflag} and \cs{caption@setflag}
-% for clearing resp.~setting these flags.
+% \begin{macro}{\caption@setcontinued}
+% \changes{v3.6}{2020/09/20}{This macro added}
+% |\caption@setcontinued| sets the `continued float' flag, i.e. |\continued|\-|float| was used.
% \begin{macrocode}
-\newcommand*\caption@clrflags{%
- \setcounter{caption@flags}\z@}
+\newcommand*\caption@setcontinued{\caption@setflag1}
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifcontinued}
+% \changes{v3.3}{2011/12/28}{This switch added}
+% \changes{v3.3}{2018/08/08}{\cs{ifcaption@ContinuedFloat} replaced by \cs{caption@ifflag1}}
+% \changes{v3.6}{2020/09/20}{Revived as \cs{caption@ifcontinued}}
+% |\caption@if|\-|continued|\marg{yes-code}\marg{no-code}\\
+% tests if the `continued float' flag is set.
% \begin{macrocode}
-\newcommand*\caption@clrflag[1]{%
- \caption@ifflag{#1}{\caption@addtoflags{-#1}}{}}
-\newcommand*\caption@setflag[1]{%
- \caption@ifflag{#1}{}{\caption@addtoflags{#1}}}
-\newcommand*\caption@addtoflags{%
- \addtocounter{caption@flags}}
+\newcommand*\caption@ifcontinued{\caption@ifflag1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setcaption}
+% \changes{v3.6}{2020/09/20}{This macro added}
+% |\caption@setcaption| sets the `caption' flag, i.e. |\caption|, |\phantom|\-|caption|, or |\caption|\-|list|\-|entry| was used.
+% \begin{macrocode}
+\newcommand*\caption@setcaption{\caption@setflag2}
% \end{macrocode}
% \end{macro}
+%
+% \begin{macro}{\caption@ifcaption}
+% \changes{v3.3}{2011/12/28}{This switch added}
+% \changes{v3.3}{2018/08/08}{\cs{ifcaption@caption} replaced by \cs{caption@ifflag2}}
+% \changes{v3.6}{2020/09/20}{Revived as \cs{caption@ifcaption}}
+% |\caption@if|\-|caption|\marg{yes-code}\marg{no-code}\\
+% tests if the `caption' flag is set.
+% \begin{macrocode}
+\newcommand*\caption@ifcaption{\caption@ifflag2}
+% \end{macrocode}
% \end{macro}
+%
+% \begin{macro}{\caption@setsubcaption}
+% \changes{v3.6}{2020/09/20}{This macro added}
+% |\caption@setsubcaption| sets the `subcaption' flag, i.e. |\subcaption|, |\subcaptionbox|, \ldots was used.
+% \begin{macrocode}
+\newcommand*\caption@setsubcaption{%
+ \caption@ifcaption{\caption@setflag8}{\caption@setflag4}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifsubcaption@above}
+% \changes{v3.3}{2011/12/28}{This switch added}
+% \changes{v3.3}{2018/08/08}{\cs{ifcaption@subcaption} replaced by \cs{caption@ifflag4}}
+% \changes{v3.6}{2020/09/20}{Revived as \cs{caption@ifsubcaption@above} and \cs{caption@ifsubcaption@below}}
+% |\caption@if|\-|sub|\-|caption@above|\marg{yes-code}\marg{no-code}\\
+% tests if the `subcaption' flag was set before the `caption' flag was set, i.e. a sub-caption was typeset \emph{above} the corresponding caption.
+% \begin{macrocode}
+\newcommand*\caption@ifsubcaption@above{\caption@ifflag4}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifsubcaption@below}
+% \changes{v3.3}{2011/12/28}{This switch added}
+% \changes{v3.3}{2018/08/08}{\cs{ifcaption@subcaption} replaced by \cs{caption@ifflag4}}
+% \changes{v3.6}{2020/09/20}{Revived as \cs{caption@ifsubcaption@above} and \cs{caption@ifsubcaption@below}}
+% |\caption@if|\-|sub|\-|caption@below|\marg{yes-code}\marg{no-code}\\
+% tests if the `subcaption' flag was set after the `caption' flag was set, i.e. a sub-caption was typeset \emph{below} the corresponding caption.
+% \begin{macrocode}
+\newcommand*\caption@ifsubcaption@below{\caption@ifflag8}
+% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@caption}
% \changes{v3.0f}{2005/05/22}{Bugfix: \cs{ContinuedFloat} added}
% \changes{v3.0f}{2005/06/13}{Support of \cs{caption*[]} removed}
% \changes{v3.0l}{2007/01/19}{Minimal support of \textsf{combine} package added}
-% \changes{v3.1}{2007/02/04}{Re-written, does not save\&use original definition anymore}
+% \changes{v3.1}{2007/02/04}{Re-written, does not save \& use original definition anymore}
+% \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
% Here comes our definition of |\caption| and |\caption*|.
% Beside the support of the starred variant this code was adapted to the
% various packages we support.
@@ -713,8 +5096,17 @@
\caption@star
{\caption@refstepcounter\@captype}%
{\caption@dblarg{\@caption\@captype}}}%
- {\caption@Error{\noexpand\caption outside float}%
- \caption@gobble}}
+ {\caption@OutsideFloat\caption
+ \caption@withoptargs\@gobbletwo}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@OutsideFloat}
+% \changes{v3.6}{2022/01/05}{This macro added}
+% |\caption@OutsideFloat}| issues a ``\meta{command} outside float'' error.
+% \begin{macrocode}
+\newcommand*\caption@OutsideFloat[1]{%
+ \caption@Error{\string#1 outside float}}
% \end{macrocode}
% \end{macro}
%
@@ -736,6 +5128,7 @@
% \changes{v3.2d}{2011/10/21}{Adapted to the \textsf{memoir} document class}
% \changes{v3.2f}{2012/01/14}{Usage of \cs{M@gettitle} moved to \cs{caption@prepareanchor}}
% \changes{v3.3}{2013/01/06}{Adapted to the \textsf{nag} package}
+% \changes{v3.6}{2022/01/06}{Usage of \cs{caption@nobreak} added to improve \textsf{beamer} document class support}
% As above, our version has been adapted to the packages we support.
% Additionally our code is nested by |\caption@begin|\-|ex| \&
% |\caption@end| instead of |\begin|\-|group| \& |\end|\-|group|.
@@ -753,6 +5146,7 @@
% \end{macrocode}
% \begin{macrocode}
\par
+ \caption@nobreak
\caption@beginex{#1}{#2}{#3}%
\caption@setfloatcapt{%
\caption@parboxrestore
@@ -765,6 +5159,7 @@
\fi
\@makecaption{\csname fnum@#1\endcsname}%
{\ignorespaces\caption@makeanchor{#3}}\par
+ \caption@nobreak
\caption@if@minipage\@minipagetrue\@minipagefalse}%
\caption@end}
% \end{macrocode}
@@ -789,8 +5184,40 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\caption@nobreak}
+% \changes{v3.6}{2022/01/06}{This macro added}
+% |\caption@nobreak| for use in places where |\@caption| resp.~|\beamer@makecaption| does |\nobreak|.
+% It's defined to do nothing unless the \cls{beamer} document class is used.
+% \begin{macrocode}
+\newcommand*\caption@nobreak{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@parboxrestore}
+% \changes{v3.1}{2007/03/03}{This macro definition added}
+% \changes{v3.1b}{2007/09/17}{Bugfix: Redefinition of CR added}
+% \changes{v3.2}{2010/11/07}{Support of option \opt{parboxrestore} added}
+% \changes{v3.5g}{2020/10/26}{New implementation; renamed from \cs{caption@boxrestore} to \cs{caption@parboxrestore}}
+% \changes{v3.6}{2021/01/02}{Always uses \cs{@parboxrestore} now}
+% \changes{v3.6}{2022/02/13}{Hooks added}
+% |\caption@parboxrestore| simply expands to |\@par|\-|box|\-|restore|,
+% surrounded by `before' and `after' hooks.
+% \begin{macrocode}
+\newcommand*\caption@parboxrestore{%
+ \caption@before@parboxrestore
+ \caption@@parboxrestore
+ \caption@after@parboxrestore}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@before@parboxrestore{}
+\newcommand*\caption@@parboxrestore{\@parboxrestore}
+\newcommand*\caption@after@parboxrestore{}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\caption@makecaption}
% \changes{v3.1i}{2008/05/06}{Usage of \cs{caption@rule} added}
+% \changes{v3.6}{2022/01/06}{Usage of \cs{caption@nobreak} added to improve \textsf{beamer} document class support}
% |\@makecaption|\marg{label}\marg{text}\par
% We do basically the same as the original code (from the standard
% \LaTeX\ document classes), but take care of the |position=| setting
@@ -798,9 +5225,13 @@
% typeset the caption.
% \begin{macrocode}
\long\def\caption@makecaption#1#2{%
+ \caption@nobreak
\caption@make@above
+ \caption@nobreak
\caption@@make{#1}{#2}%
- \caption@make@below}
+ \caption@nobreak
+ \caption@make@below
+ \caption@nobreak}
% \end{macrocode}
% \end{macro}
%
@@ -826,155 +5257,90 @@
% \end{macro}
%
% \begin{macro}{\caption@redefine}
-% \changes{v3.1k}{2009/03/30}{This macro added, it contains the patching code now}
+% \changes{v3.1}{2007/05/09}{Re-definition of \cs{@xfloat} added}
+% \changes{v3.1b}{2007/09/22}{cs{@xfloat} will now be redefined in compatibility mode, too}
+% \changes{v3.1k}{2009/03/30}{The macro \cs{caption@redefine} contains the patching code now}
+% \changes{v3.5}{2020/08/30}{Re-definition of \cs{@xdblfloat} added}
% \begin{macrocode}
-\newcommand*\caption@redefine{}
+\newcommand*\caption@redefine{%
% \end{macrocode}
-% \end{macro}
-%
-% Prior to \version{3.4} we only redefined |\caption| and |\@caption| if the current definitions
-% were well known, so documents written in the old (\package{caption} package \version{1.x}) days
-% (where |\caption| \& |\@caption| were not redefined by us) still compiled fine.
-% This used to make sense when introducing \version{3.0} in the year 2003
-% but is simply overcautious and especially unwanted by the user nowadays.
-% So starting with \version{3.4} we only do not redefine |\caption| and |\@caption| if the
-% `compatibility' option is set to `v1'.
-%
+% Prior to \version{3.4} we only redefined |\caption| and |\@caption| if the current definitions
+% were well known, so documents written in the old (\package{caption} package \version{1.x}) days
+% (where |\caption| \& |\@caption| were not redefined by us) still compiled fine.
+% This used to make sense when introducing \version{3.0} in the year 2003
+% but is simply overcautious and especially unwanted by the user nowadays.
+% So starting with \version{3.4} we only do not redefine |\caption| and |\@caption| if the
+% `compatibility' option is set to `true', and starting with \version{3.6} we always redefine them.
% \begin{macrocode}
-\g@addto@macro\caption@redefine{%
+ \let\caption\caption@caption
+ \let\@caption\caption@@caption
% \end{macrocode}
-% \begin{macrocode}
- \caption@ifcompatibility{%
-% \end{macrocode}
-% \begin{macrocode}
- \caption@InfoNoLine{
- \noexpand\caption will not be redefined since `compatibility' is set to v1}%
-% \end{macrocode}
-% \begin{macrocode}
- \renewcommand*\caption@redefine{}%
-% \end{macrocode}
-%
-% |\continuedfloat| is not supported in compatibility mode `v1'.
-% \begin{macrocode}
- \renewcommand*\caption@continuedfloat[1]{%
- \caption@Error{Not available with option `compatibility=v1'}}%
-% \end{macrocode}
-%
-% |\caption@start| is not supported in compatibility mode `v1'.
-% \begin{macrocode}
- \caption@AtBeginDocument*{%
- \let\caption@start\relax
- \caption@ifdefined\caption@ORI@capstart{%
- \caption@Debug{%
- Restore hypcap definition of \string\capstart\@gobble}%
- \let\capstart\caption@ORI@capstart}{}%
- }%
-% \end{macrocode}
-%
-% \begin{macro}{\caption@star}
-% We redefine |\caption@star| here so it does not make any harm.
-% \begin{macrocode}
- \renewcommand*\caption@star[2]{#1#2}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macrocode}
- }{%
-% \end{macrocode}
-%
-% \begin{macro}{\caption}
-% \begin{macro}{\@caption}
-% \begin{macrocode}
- \renewcommand*\caption@redefine{%
- \let\caption\caption@caption
- \let\@caption\caption@@caption}%
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macrocode}
- }%
-% \end{macrocode}
-% \begin{macrocode}
- \caption@redefine
- \caption@AtBeginDocument*{%
- \let\caption@ORI@capstart\@undefined}%
-% \end{macrocode}
-%
-% \begin{macro}{\@xfloat}
-% \changes{v3.1}{2007/05/09}{This re-definition added}
-% \changes{v3.1b}{2007/09/22}{Will now be redefined in compatibility mode, too}
-% \changes{v3.5}{2020/08/30}{Hook added}
% We redefine |\@x|\-|float| so inside floating environments our
% type-specific options will be used, a \package{hyperref}
% anchor will be set etc.
% \begin{macrocode}
\let\caption@ORI@xfloat\@xfloat
+ \let\@xfloat\caption@xfloat
% \end{macrocode}
-% \begin{macrocode}
- \def\@xfloat#1[#2]{%
- \caption@ORI@xfloat{#1}[#2]%
- \caption@settype{#1}%
- \caption@xfloat@hook}%
-% \end{macrocode}
-% Hook, could be extended with |\g@addto@macro\caption@x|\-|float@hook{|\ldots|}|.
-% (The caption type could be found in |\@cap|\-|type|.)
-% \begin{macrocode}
- \newcommand*\caption@xfloat@hook{}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@xdblfloat}
-% \changes{v3.5}{2020/08/30}{Re-definition of \cs{xdblfloat} added}
% We redefine |\@xdbl|\-|float|, too, so special options for |figure*|
% resp.~|table*| will be applied here.
% \begin{macrocode}
\let\caption@ORI@xdblfloat\@xdblfloat
+ \let\@xdblfloat\caption@xdblfloat
% \end{macrocode}
% \begin{macrocode}
- \def\@xdblfloat#1[#2]{%
- \caption@ORI@xdblfloat{#1}[#2]% expands to \@xfloat{#1}[#2] + extra stuff
- \caption@setoptions{#1*}%
- \caption@xdblfloat@hook}%
-% \end{macrocode}
-% Hook, could be extended with |\g@addto@macro\caption@xdbl|\-|float@hook{|\ldots|}|.
-% (The caption type could be found in |\@cap|\-|type|.)
-% \begin{macrocode}
- \newcommand*\caption@xdblfloat@hook{}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macrocode}
}
% \end{macrocode}
-%
% Some packages (like the \package{hyperref} package for example) redefines
% |\caption| and |\@caption|, too.
-% So we have to use |\AtBeginDocument| here, so we can make sure
+% So we have to use |\At|\-|Begin|\-|Document| here, so we can make sure
% our definition is the one which will be valid at last.
% \begin{macrocode}
-\caption@AtBeginDocument{\caption@redefine}
+\caption@AtBeginDocument{%
+ \caption@redefine
+ \let\caption@redefine\relax}
% \end{macrocode}
-%
-% \begin{macro}{\@makecaption}
+% The redefinition of |\@make|\-|caption| will be done immediately.
% \begin{macrocode}
\let\@makecaption\caption@makecaption
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\phantomcaption}
-% \changes{v3.2}{2010/10/31}{Bugfix 10-09-01b: This macro added}
-% |\phantomcaption|\par
-% Use this one for figures with subcaptions but without main caption.
+% \begin{macro}{\caption@xfloat}
+% \changes{v3.1}{2007/05/09}{Re-definition of \cs{@xfloat} added}
+% \changes{v3.5}{2020/08/30}{Definition and usage of \cs{caption@xfloat@hook} added}
+% \changes{v3.6}{2020/12/27}{Re-definition of \cs{@xfloat} put into \cs{caption@xfloat}}
% \begin{macrocode}
-\newcommand\phantomcaption{%
- \caption@iftype
- {\caption@refstepcounter\@captype}%
- {\caption@Error{\noexpand\phantomcaption outside float}}}%
+\def\caption@xfloat#1[#2]{%
+ \caption@ORI@xfloat{#1}[#2]%
+ \caption@settype{#1}%
+ \caption@xfloat@hook}
+% \end{macrocode}
+% Hook, could be extended with |\g@addto@macro\caption@x|\-|float@hook{|\ldots|}|.
+% (The caption type could be found in |\@cap|\-|type|.)
+% \begin{macrocode}
+\newcommand*\caption@xfloat@hook{}
% \end{macrocode}
% \end{macro}
%
-% \section{\cs{setcaptiontype} and \cs{setcaptionsubtype}}
+% \begin{macro}{\caption@xdblfloat}
+% \changes{v3.5}{2020/08/30}{Re-definition of \cs{@xdblfloat} added}
+% \changes{v3.5}{2020/08/30}{Definition and usage of \cs{caption@xdblfloat@hook} added}
+% \changes{v3.6}{2020/12/27}{Re-definition of \cs{@xdblfloat} put into \cs{caption@xdblfloat}}
+% \begin{macrocode}
+\def\caption@xdblfloat#1[#2]{%
+ \caption@ORI@xdblfloat{#1}[#2]% expands to \@xfloat{#1}[#2] + extra stuff
+ \caption@setoptions{#1*}%
+ \caption@xdblfloat@hook}
+% \end{macrocode}
+% Hook, could be extended with |\g@addto@macro\caption@xdbl|\-|float@hook{|\ldots|}|.
+% (The caption type could be found in |\@cap|\-|type|.)
+% \begin{macrocode}
+\newcommand*\caption@xdblfloat@hook{}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{setcaptiontype} and \cs{setcaptionsubtype}}
%
% \changes{v3.0d}{2004/08/03}{Option \opt{type=} added}
% \changes{v3.1}{2007/06/25}{Option \opt{type*=} added}
@@ -1005,35 +5371,64 @@
% \changes{v3.2}{2010/10/24}{This macro added}
% \changes{v3.4e}{2020/01/02}{Check added if the subtype is defined}
% \changes{v3.5}{2020/08/24}{Definition method adapted to the \package{caption-light} package}
+% \changes{v3.6}{2021/01/02}{Usage of \cs{caption@initposition} added}
+% \changes{v3.6}{2021/01/09}{Usage of \cs{flushsubcaptionlistentries} added}
+% \changes{v3.6}{2022/02/20}{Optional argument added}
% Like |\captionsetup{type=xxx}|, but also works if |\caption|\-|setup| was redefined.
% \begin{macrocode}
\def\setcaptiontype{%
- \caption@parboxrestore@mini
+ \caption@parboxrestore@light
\caption@settype}
% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@settype{%
+ \caption@initposition
+ \caption@clrflags
+ \aftergroup\flushsubcaptionlistentries
+ \caption@@settype}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@settype{%
+ \caption@teststar\caption@@settype@\@firstoftwo\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@settype@[1]{%
+ \@ifnextchar[%]
+ {\caption@@settype@@{#1}}%
+ {\caption@@@settype{}{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@settype@@#1[#2]#3{%
+ \caption@@@settype{}{#1}{#3}%
+ \caption@setoptions{#2}}
+% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\setcaptionsubtype}
% \changes{v3.2a}{2011/08/15}{This macro added}
% \changes{v3.5d}{2020/09/28}{This macro revised}
+% \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
+% \changes{v3.6}{2022/01/07}{Multiple use is suppressed now by checking \cs{caption@ifsubtype}}
% Same, but sets the sub-type.
% \begin{macrocode}
-\newcommand\setcaptionsubtype{%
- \caption@iftype
- \caption@setsubtype
- {\caption@Error{\noexpand\setcaptionsubtype outside float}}}%
+\newcommand*\setcaptionsubtype{%
+ \caption@setsubtype}
% \end{macrocode}
% \begin{macrocode}
-\newcommand\caption@setsubtype{%
+\newcommand*\caption@setsubtype{% used by the floatrow package
\caption@teststar\caption@@setsubtype\@firstoftwo\@secondoftwo}
% \end{macrocode}
% \begin{macrocode}
\newcommand*\caption@@setsubtype[1]{%
- \caption@@@settype{sub}{#1}{sub\@captype}}
+ \caption@iftype
+ {\caption@ifsubtype
+ {\caption@Debug{subtype=\@subcaptype}}%
+ {\caption@@@settype{sub}{#1}{sub\@captype}}}%
+ {\caption@OutsideFloat\setcaptionsubtype}}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\caption@settype}
+% \begin{macro}{\caption@@@settype}
% \changes{v3.1}{2007/05/09}{This macro added}
% \changes{v3.1b}{2007/09/22}{Usage of \cs{caption@xlabel} added}
% \changes{v3.1d}{2007/10/23}{Error message for \cs{caption@checkgrouplevel} revised}
@@ -1044,35 +5439,21 @@
% \changes{v3.3}{2011/12/28}{Resetting of \cs{ifcaption@caption} and \cs{ifcaption@subcaption} added}
% \changes{v3.4e}{2020/01/02}{Checks added to prevent misuse regading subtypes}
% \changes{v3.5d}{2020/09/28}{This macro revised}
+% \changes{v3.6}{2020/12/27}{Some code out-sourced to \cs{caption@reset@currentlabel}}
% |\caption@settype*|\marg{type}\par
% sets |\@captype| and executes the options associated with it
% (using |\caption@set|\-|options|).
-% Furthermore we check |\current|\-|group|\-|level| (if avail),
-% redefine |\@currentlabel| so a |\label| before |\caption| will result
-% in a hint instead of a wrong reference, and
+% Furthermore we check |\current|\-|group|\-|level| (if avail), and
% use the macro |\caption@|(|sub|)|type|\-|hook| (which will be used by our
% \package{float} package support).\par
% The non-starred version sets a \package{hyperref} anchor additionally
% (if |hypcap=|\-|true| and the \package{hypcap} package is not loaded).
% \begin{macrocode}
-\newcommand*\caption@settype{%
- \caption@clrflags
- \caption@set@type}
-% \end{macrocode}
-% \begin{macrocode}
-\newcommand*\caption@set@type{%
- \caption@teststar\caption@@settype\@firstoftwo\@secondoftwo}
-% \end{macrocode}
-% \begin{macrocode}
-\newcommand*\caption@@settype{%
- \caption@@@settype{}}
-% \end{macrocode}
-% \begin{macrocode}
\newcommand*\caption@@@settype[3]{%
% #1 = "" or "sub"
% #2 = \@firstoftwo in star form, \@secondoftwo otherwise
% #3 = <type>, e.g.: "figure" or "subfigure"
- \caption@Debug{#1type=#3}%
+ \caption@Debug{#1type:=#3}%
\@nameuse{caption@check#1type}{#3}%
{\caption@checkgrouplevel{#1}{%
\captionsetup{#1type#2*\@empty=...}#2{ or
@@ -1099,28 +5480,59 @@
\fi
% \end{macrocode}
% \begin{macrocode}
- #2{}{%
- \let\@currentlabel\caption@undefinedlabel
-% \let\@currentHlabel\@undefined
- \ifx\caption@x@label\@undefined
- \let\caption@x@label\label
- \let\label\caption@xlabel
- \fi
- \caption@start}}}
+ #2{}{\caption@reset@currentlabel\caption@start}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@parboxrestore@light}
+% \changes{v3.2}{2010/10/24}{This macro added}
+% \changes{v3.5g}{2020/10/26}{Renamed from \cs{caption@boxrestore@mini} to \cs{caption@parboxrestore@mini}}
+% \changes{v3.6}{2021/01/02}{Renamed from \cs{caption@parboxrestore@mini} to \cs{caption@parboxrestore@light}}
+% Resets |\par| so the very first |\par| in |\@caption| behaves quite the same as in floating environments.
+% Will be used by |\set|\-|caption|\-|type|.
+% \begin{macrocode}
+\newcommand*\caption@parboxrestore@light{%
+ \let\par\@@par
+ \parindent\z@ \parskip\z@skip
+ \sloppy}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@reset@currentlabel}
+% \changes{v3.6}{2020/12/27}{This macro out-sourced from \cs{caption@settype}}
+% Redefine |\@currentlabel| so a |\label| before |\caption| will result
+% in a hint instead of a wrong reference.
+% \begin{macrocode}
+\newcommand*\caption@reset@currentlabel{%
+ \let\@currentlabel\caption@undefinedlabel
+% \let\@currentHlabel\@undefined
+ \ifx\caption@x@label\@undefined
+ \let\caption@x@label\label
+ \let\label\caption@xlabel
+ \fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@iftype}
-% \changes{v3.1}{2007/04/11}{This macro and its usage added}
-% Since we often need to check if |\@captype| is defined (means: we
+% \changes{v3.1}{2007/04/11}{This macro definition added}
+% Since we often need to check if |\@cap|\-|type| is defined (means: we
% are inside a floating environment) this helper macro was introduced.
% \begin{macrocode}
\newcommand*\caption@iftype{\caption@ifdefined\@captype}
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\caption@ifsubtype}
+% \changes{v3.6}{2022/01/07}{This macro definition added}
+% Since we often need to check if |\@sub|\-|cap|\-|type| is defined (means: we
+% are inside a sub-caption group of a floating environment) this helper macro was introduced.
+% \begin{macrocode}
+\newcommand*\caption@ifsubtype{\caption@ifdefined\@subcaptype}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\caption@checktype}
-% \changes{v3.4g}{2020/01/02}{This macro and its usage added}
+% \changes{v3.4g}{2020/01/02}{This macro definition added}
% \changes{v3.4m}{2020/07/29}{Check of \cs{sf@counterlist} from \package{subfig} package added}
% |\caption@checktype|\marg{type}\marg{code}\par
% is used by |\caption@settype| and should either expand the code or issue an error
@@ -1128,7 +5540,7 @@
% |\DeclareCaptionSubType| or |\newsubfloat|\cite{subfig}).
% \begin{macrocode}
\newcommand*\caption@checktype[1]{%
- \caption@ifsubtype{#1}\@firstoftwo{\caption@ifin@list\sf@counterlist{#1}}%
+ \caption@ifdefined@subtype{#1}\@firstoftwo{\caption@ifin@list\sf@counterlist{#1}}%
{\caption@Error{Should not be used with subtype `#1'}%
\@gobble}%
\@firstofone}
@@ -1136,7 +5548,7 @@
% \end{macro}
%
% \begin{macro}{\caption@checksubtype}
-% \changes{v3.4g}{2020/01/02}{This macro and its usage added}
+% \changes{v3.4g}{2020/01/02}{This macro definition added}
% \changes{v3.4m}{2020/07/29}{Check of \cs{sf@counterlist} from \package{subfig} package added}
% |\caption@checksubtype|\marg{type}\marg{code}\par
% is used by |\caption@settype| and should either expand the code or issue an error
@@ -1147,7 +5559,7 @@
% those sub-types as well (but not without warning since we do not support this).
% \begin{macrocode}
\newcommand*\caption@checksubtype[1]{%
- \caption@ifsubtype{#1}%
+ \caption@ifdefined@subtype{#1}%
\@firstofone
{\caption@ifin@list\sf@counterlist{#1}%
{\caption@Warning{%
@@ -1162,7 +5574,7 @@
% \end{macro}
%
% \begin{macro}{\caption@checkgrouplevel}
-% \changes{v3.1}{2007/07/15}{This macro and its usage added}
+% \changes{v3.1}{2007/07/15}{This macro definition added}
% \changes{v3.1f}{2007/11/28}{Error changed to warning (compatibility)}
% \changes{v3.3}{2013/04/21}{Uses \cs{caption@ifeTeX} now}
% \changes{v3.5}{2019/09/11}{Relies on \eTeX{} now}
@@ -1184,7 +5596,7 @@
% \end{macro}
%
% \begin{macro}{\caption@undefinedlabel}
-% \changes{v3.1}{2007/07/03}{This macro and its usage added}
+% \changes{v3.1}{2007/07/03}{This macro definition added}
% \changes{v3.1b}{2007/09/22}{Contents changed to \texttt{??}}
% \changes{v3.1i}{2008/04/13}{Contents changed to \cs{caption@xref}(\ldots)}
% \changes{v3.1k}{2009/03/30}{Bugfix 08-12-08: \cs{caption@xref} is robust now}
@@ -1206,8 +5618,9 @@
\newcommand*\caption@labelname{??}
% \end{macrocode}
% \end{macro}
+%
% \begin{macro}{\caption@xlabel}
-% \changes{v3.1b}{2007/09/22}{This macro and its usage added}
+% \changes{v3.1b}{2007/09/22}{This macro definition added}
% \changes{v3.1f}{2007/11/11}{Revised}
% \changes{v3.1i}{2008/04/13}{Bugfix: \cs{pageref} should always work now}
% \changes{v3.2c}{2011/08/19}{Works with optional arguments now, too}
@@ -1256,35 +5669,154 @@
% \end{macrocode}
% \end{macro}
%
-% \section{\cs{captionlistentry}}
+% \subsection{\cs{phantomcaption}}
+%
+% \begin{macro}{\phantomcaption}
+% \changes{v3.2}{2010/10/31}{Bugfix 10-09-01b: This macro added}
+% \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
+% |\phantomcaption|\par
+% increments the counter and generates an reference
+% which could be used with |\label|, but does not typeset anything.
+% \begin{macrocode}
+\newcommand*\phantomcaption{%
+ \caption@iftype
+ {\caption@refstepcounter\@captype}%
+ {\caption@OutsideFloat\phantomcaption}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{captionlistentry}}
%
% \begin{macro}{\captionlistentry}
% \changes{v3.1}{2007/07/28}{This macro added}
% \changes{v3.1f}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
% \changes{v3.1g}{2008/01/20}{Starred variant added}
% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% \changes{v3.6}{2020/12/27}{With optional argument \cs{caption@refstepcounter@} is used instead of \cs{caption@refstepcounter}}
+% \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
% |\captionlistentry|\oarg{float type}\marg{list entry}\\
% |\captionlistentry*|\oarg{float type}\marg{list entry}
% \begin{macrocode}
\newcommand*\captionlistentry{%
- \caption@teststar\@captionlistentry\@firstoftwo\@secondoftwo}
+ \caption@teststar\caption@listentry\@firstoftwo\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@listentry[1]{%
+ \@ifnextchar[%]
+ {\caption@listentry@{#1}}%
+ {\caption@@listentry{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@listentry@#1[#2]{%
+ \caption@@@listentry{#1}{#2}{\caption@refstepcounter@}}
% \end{macrocode}
% \begin{macrocode}
-\newcommand*\@captionlistentry[1]{%
- \@testopt{\caption@listentry{#1}}\@captype}
+\newcommand*\caption@@listentry[1]{%
+ \caption@iftype
+ {\caption@@@listentry{#1}{\@captype}{\caption@refstepcounter}}%
+ {\caption@OutsideFloat\captionlistentry
+ \@gobble}}
% \end{macrocode}
% \begin{macrocode}
-\def\caption@listentry#1[#2]#3{%
+\newcommand*\caption@@@listentry[4]{%
\@bsphack
- #1{\caption@gettitle{#3}}%
- {\caption@refstepcounter{#2}%
- \caption@makecurrent{#2}{#3}}%
- \caption@addcontentsline{#2}{#3}%
+ #1{\caption@gettitle{#4}}%
+ {#3{#2}\caption@makecurrent{#2}{#4}}%
+ \caption@addcontentsline{#2}{#4}%
\@esphack}
% \end{macrocode}
% \end{macro}
%
-% \section{\cs{captionbox}}
+% \subsection{\cs{captiontext}}
+%
+% \begin{macro}{\captiontext}
+% \changes{v3.6}{2022/01/05}{This macro added}
+% \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
+% |\captiontext*|\oarg{number}\marg{text for caption}\par
+% typesets the caption without incrementing the counter,
+% without putting an entry into the list, and without skips.
+% The starred variant skips the single-line-check additionally
+% and does not use a box or parbox or margin.
+% \begin{macrocode}
+\newcommand*\captiontext{%
+ \caption@iftype
+ {\caption@text\@captype}%
+ {\caption@OutsideFloat\captiontext
+ \caption@withoptargs\@gobbletwo}}
+\newcommand*\caption@text[1]{%
+ \caption@teststar{\caption@@text{#1}}\caption@@@make\caption@@make}
+\newcommand*\caption@@text[2]{%
+ \kernel@ifnextchar[%]
+ {\caption@@@text{#1}#2\@iden}%
+ {\caption@@@text{#1}#2\@gobble[0]}}
+\long\def\caption@@@text#1#2#3[#4]#5{%
+ \begingroup
+ #3{\csname c@#1\endcsname #4\relax}%
+ #2{\caption@fnum{#1}}{#5}%
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{The \env{captiongroup} environment}
+%
+% \begin{environment}{captiongroup}
+% \changes{v3.6}{2022/02/20}{This environment definition added}
+% \env{captiongroup} is simply an environment containing |\set|\-|caption|\-|type|, that's all.
+% A starred variant of this environment is available, too, which uses |\set|\-|caption|\-|type*|.
+% \begin{macrocode}
+\newenvironment{captiongroup}{\setcaptiontype}{}
+\newenvironment{captiongroup*}{\setcaptiontype*}{}
+% \end{macrocode}
+% \end{environment}
+%
+% \subsubsection{The \env{captionblock} environment}
+%
+% \begin{macro}{\caption@minipage}
+% \changes{v3.6}{2022/02/20}{This macro definition added}
+% This is a \env{minipage} with |\set|\-|caption|\-|type| as first contents line.
+% \begin{macrocode}
+\newcommand*\caption@minipage{%
+ \@testopt\caption@iminipage b}
+% \end{macrocode}
+% We pass all other optional arguments using the generic helper macro
+% |\caption@with|\-|opt|\-|args| offered by the \pkg{caption} kernel).
+% \begin{macrocode}
+\def\caption@iminipage[#1]{%
+ \caption@withoptargs{\caption@iiminipage{#1}}}
+% \end{macrocode}
+% `B' and `T' will add a |\vspace{0pt}|, all other values (and additional
+% optional arguments) will be passed unseen to the |minipage| environment.
+% \begin{macrocode}
+\newcommand*\caption@iiminipage[3]{%
+ \let\caption@endminipage@hook\@empty
+ \if#1B%
+ \minipage[b]#2{#3}%
+ \def\caption@endminipage@hook{\vspace{0pt}}%
+ \else\if#1T%
+ \minipage[t]#2{#3}%
+ \vspace{0pt}%
+ \else
+ \minipage[#1]#2{#3}%
+ \fi\fi
+ \@floatboxreset
+ \setcaptiontype}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@endminipage{%
+ \caption@endminipage@hook
+ \endminipage}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{captionblock}
+% \changes{v3.6}{2022/02/20}{This environment definition added}
+% \env{captionblock} is a \env{minipage} with |\set|\-|caption|\-|type| as first contents line.
+% \begin{macrocode}
+\newenvironment{captionblock}{\caption@minipage}{\caption@endminipage}
+% \end{macrocode}
+% \end{environment}
+%
+% \subsection{\cs{captionbox}}
%
% \begin{macro}{\captionbox}
% \changes{v3.2}{2010/12/17}{This macro added}
@@ -1293,6 +5825,7 @@
% \changes{v3.3}{2017/03/19}{When used with fixed witdh the content will not be hboxed anymore}
% \changes{v3.3c}{2019/09/01}{Adapted so it could be used by \cs{subfloat} offered by \package{subcaption}}
% \changes{v3.5}{2020/07/28}{Adapted to \package{caption3} v2.0}
+% \changes{v3.6}{2020/12/24}{Check of argument \meta{inner-pos} added}
% A |\parbox| with contents and caption, separated by an invisible |\hrule|.
% \begin{macrocode}
\newcommand*\captionbox{%
@@ -1319,27 +5852,28 @@
% \end{macrocode}
% \begin{macrocode}
\long\def\caption@iiiibox#1#2#3#4#5[#6][#7]#8{%
- \begingroup
- #1*% set \caption@position
- \caption@iftop{%
- \endgroup
- \parbox[t]{#6}{%
- #1\relax
- \caption@setposition t%
- #2{\caption#4{#5}}%
- \captionbox@hrule
- \csname caption@justification@#7\endcsname
- #8}%
- }{%
- \endgroup
- \parbox[b]{#6}{%
- #1\relax
- \caption@setposition b%
- \csname caption@justification@#7\endcsname
- #8%
- \captionbox@hrule
- #3{\caption#4{#5}}}%
- }}
+ \caption@checkdecl{justification}{#7}{%
+ \begingroup
+ #1*% set \caption@position
+ \caption@iftop{%
+ \endgroup
+ \parbox[t]{#6}{%
+ #1\relax
+ \caption@setposition t%
+ #2{\caption#4{#5}}%
+ \captionbox@hrule
+ \csname caption@justification@#7\endcsname
+ #8}%
+ }{%
+ \endgroup
+ \parbox[b]{#6}{%
+ #1\relax
+ \caption@setposition b%
+ \csname caption@justification@#7\endcsname
+ #8%
+ \captionbox@hrule
+ #3{\caption#4{#5}}}%
+ }}}
% \end{macrocode}
% \begin{macrocode}
\newcommand*\captionbox@innerpos@default{c}
@@ -1353,7 +5887,58 @@
% \end{macrocode}
% \end{macro}
%
-% \section{\cs{continuedfloat}}
+% \subsection{\cs{continuedfloat}}
+%
+% \begin{macro}{\c@continuedfloat}
+% \changes{v3.4}{2015/09/16}{Counter renamed from \cs{ContinuedFloat} to \cs{continuedfloat}}
+% |\thecontinuedfloat| will be preset to |\@empty|, so usually the continuation counter is not
+% included in the caption label or references.
+% \begin{macrocode}
+\newcounter{continuedfloat}
+\let\c@ContinuedFloat\c@continuedfloat % defined for compatibility reasons
+% \end{macrocode}
+% \begin{macrocode}
+\def\thecontinuedfloat{\theContinuedFloat}
+\let\theContinuedFloat\@empty % defined for compatibility reasons
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\continuedfloat@captype}
+% \changes{v3.6}{Renamed from \cs{caption@CFtype} to \cs{continuedfloat@captype}}
+% Since we have only a single `continuedfloat' counter (and not one per caption type),
+% we need to attach a caption type to our counter to make sure that the counter is not
+% (mis-)used for a different float type while it holds a value other than zero.
+% \begin{macrocode}
+\newcommand*\continuedfloat@captype{??}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@reset@continuedfloat}
+% |\caption@reset@continuedfloat|\marg{caption type}\\
+% resets the continuation counter to zero and attaches the given caption type to it.
+% \begin{macrocode}
+\newcommand*\caption@reset@continuedfloat[1]{%
+ \xdef\continuedfloat@captype{#1}%
+ \@stpelt{continuedfloat}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@set@continuedfloat}
+% \changes{v3.6}{2020/12/27}{Some code of \cs{continuedfloat} out-sourced to this macro}
+% |\caption@set@continuedfloat|\marg{yes-code}\marg{no-code}\\
+% checks if the current caption type matches the one attached to the `continuedfloat' counter
+% before increasing it.
+% \begin{macrocode}
+\newcommand*\caption@set@continuedfloat{%
+ \ifx\@captype\continuedfloat@captype
+ \stepcounter{continuedfloat}%
+ \expandafter\@firstoftwo
+ \else
+ \caption@Error{Continued `\@captype' after `\continuedfloat@captype'}%
+ \expandafter\@secondoftwo
+ \fi}
+% \end{macrocode}
+% \end{macro}
%
% \begin{macro}{\continuedfloat}
% \changes{v3.0i}{2005/11/12}{Optional argument added}
@@ -1362,101 +5947,67 @@
% \changes{v3.1}{2007/07/07}{\cs{caption@setoptions} added}
% \changes{v3.1g}{2008/01/29}{Starred variant added}
% \changes{v3.2f}{2011/12/17}{Undocumented optional argument removed}
+% \changes{v3.2f}{2011/12/17}{Redefinition of \cs{caption@@@continuedfloat} added}
% \changes{v3.3}{2011/12/28}{Uses \cs{ifcaption@ContinuedFloat} now}
% \changes{v3.3}{2013/05/01}{Usage of \cs{caption@restorecounters} added}
% \changes{v3.3}{2013/12/16}{Bugfix: Does not use \cs{caption@ContinuedFloat} anymore since this breaks \cs{ContinuedFloat} offered by the \package{subfig} package}
% \changes{v3.4}{2015/09/16}{Renamed from \cs{ContinuedFloat} to \cs{continuedfloat}}
% \changes{v3.5f}{2020/10/06}{Usage of \cs{caption@restorecounters} removed}
+% \changes{v3.6}{2020/12/27}{Check of counter caption type out-sourced to \cs{caption@check@continuedfloat}}
+% \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
% |\continuedfloat|\\
% |\continuedfloat*|\par
-% This mainly sets the appropriate flag, increments the
-% continuation counter, and executes the given options.
-% Furthermore we set |\caption@reset|\-|continued|\-|float| to |\@gobble| so the
-% continuation counter will not be reset to zero inside |\caption@ref|\-|step|\-|counter|.\par
-% When the \package{hyperref} package is used we have the problem
-% that the usage of |\continued|\-|float| will create duplicate
-% hyper links -- |\@current|\-|Href| will be the same for the main float and
-% the continued ones. So we have to make sure unique labels and references
-% will be created each time. We do this by extending |\the|\-|H|\-|figure| and
-% |\the|\-|H|\-|table|, so for continued floats the scheme
-% \begin{quote}\meta{type}|.|\meta{type \#}|\alph{|\meta{continued \#}|}|\end{quote}
-% will be used instead of
-% \begin{quote}\meta{type}|.|\meta{type \#}\quad\quad.\end{quote}
-% \par{\small(This implementation follows an idea from Steven Douglas Cochran.)}
-% \Note{This does not help if the \package{hyperref} package option
-% \texttt{naturalnames=true} is set.}
+% This mainly sets the `continued float' flag, increments the continuation counter, and executes the given options.
% \begin{macrocode}
\def\continuedfloat{%
- \caption@iftype
- {\caption@continuedfloat\@captype}%
- {\caption@Error{\noexpand\continuedfloat outside float}}}
+ \caption@teststar\caption@continuedfloat\@firstoftwo\@secondoftwo}
% \end{macrocode}
% \begin{macrocode}
\newcommand*\caption@continuedfloat[1]{%
- \@ifstar
- {\caption@@refstepcounter\@captype
- \caption@@continuedfloat{#1}}%
- {\caption@continued@float{#1}}}
-% \end{macrocode}
-% \begin{macrocode}
-\newcommand*\caption@continued@float[1]{%
- \edef\caption@tempa{#1}%
- \ifx\caption@tempa\caption@CFtype
- \caption@@continuedfloat{#1}%
- \else
- \caption@Error{Continued `#1' after `\caption@CFtype'}%
- \fi}
+ \caption@iftype
+ {#1{\caption@@refstepcounter\@captype}{}%
+ \caption@@continuedfloat\@captype}%
+ {\caption@OutsideFloat\continuedfloat}}
% \end{macrocode}
% \begin{macrocode}
\newcommand*\caption@@continuedfloat{%
- \caption@setflag1% continued float
- \caption@@@continuedfloat}
-\newcommand*\caption@@@continuedfloat{%
- \stepcounter{continuedfloat}%
- \caption@@@@continuedfloat}
+ \caption@clrflags
+ \caption@set@continuedfloat
+ {\caption@setcontinued
+ \caption@@@continuedfloat}%
+ {\@gobble}}
% \end{macrocode}
% \begin{macrocode}
-\newcommand*\caption@@@@continuedfloat[1]{%
+\newcommand*\caption@@@continuedfloat[1]{%
\caption@setoptions{ContinuedFloat}% for compatibility reasons
\caption@setoptions{continuedfloat}%
\caption@setoptions{continued#1}%
\expandafter\l@addto@macro\csname the#1\endcsname\thecontinuedfloat
+% \end{macrocode}
+% When the \package{hyperref} package is used we have the problem
+% that the usage of |\continued|\-|float| will create duplicate
+% hyper links -- |\@current|\-|Href| will be the same for the main float and
+% the continued ones. So we have to make sure unique labels and references
+% will be created each time. We do this by extending |\the|\-|H|\-|figure| and
+% |\the|\-|H|\-|table|, so for continued floats the scheme
+% \begin{quote}\meta{type}|.|\meta{type \#}|\alph{|\meta{continued \#}|}|\end{quote}
+% will be used instead of
+% \begin{quote}\meta{type}|.|\meta{type \#}\quad\quad.\end{quote}
+% \par{\small(This implementation follows an idea from Steven Douglas Cochran.)}
+% \Note{This does not help if the \package{hyperref} package option \texttt{naturalnames=true} is set.}
+% \begin{macrocode}
\@ifundefined{theH#1}{}{%
\expandafter\l@addto@macro\csname theH#1\endcsname{%
\@alph\c@continuedfloat}}%
- \let\caption@@@@continuedfloat\@gobble}
% \end{macrocode}
+% Make sure the options and the \package{hyperref} patch is only applied once (per group).
% \begin{macrocode}
-\newcommand*\caption@CFtype{??}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\thecontinuedfloat}
-% \changes{v3.4}{2015/09/16}{Renamed from \cs{theContinuedFloat} to \cs{thecontinuedfloat}}
-% This one is preset to \cs{@empty}, so usually the continuation counter is not
-% included in the caption label or references.
-% \begin{macrocode}
-\newcounter{continuedfloat}
-\let\c@ContinuedFloat\c@continuedfloat % defined for compatibility reasons
-\def\thecontinuedfloat{\theContinuedFloat}
-\let\theContinuedFloat\@empty % defined for compatibility reasons
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\caption@reset@continuedfloat}
-% \changes{v3.2f}{2011/12/17}{Redefinition of \cs{continuedfloat} added}
-% |\caption@reset@continuedfloat|\marg{type}\par
-% If a continuation counter is defined, we reset it.
-% (This one will be called inside |\@caption|.)
-% \begin{macrocode}
-\newcommand*\caption@reset@continuedfloat[1]{%
- \xdef\caption@CFtype{#1}%
- \@stpelt{continuedfloat}}
+ \let\caption@@@continuedfloat\@gobble}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ContinuedFloat}
-% For compatibility reasons we still support |\Continued|\-|Float|.
+% For compatibility reasons we still support the obsolete |\Continued|\-|Float|.
% \begin{macrocode}
\def\ContinuedFloat{\continuedfloat} % defined for compatibility reasons
% \end{macrocode}
@@ -1465,16 +6016,46 @@
% \begin{macro}{\caption@ContinuedFloat}
% \changes{v3.0f}{2005/06/11}{This macro added}
% \changes{v3.3}{2013/12/16}{Bugfix: Revised and defined with \cs{def} instead of \cs{newcommand}}
-% |\caption@ContinuedFloat|\marg{type}\par
+% |\caption@ContinuedFloat|\marg{caption type}\par
% This one is used by \cs{ContinuedFloat} offered by the \package{subfig} package.
+% Since the \package{subfig} package does its own counter handling we try not to
+% interfere by changing couter-related flags.
+% not interfere with it
% \begin{macrocode}
\def\caption@ContinuedFloat{%
- \let\caption@reset@continuedfloat\@gobble
- \caption@@@continuedfloat}
+ \caption@set@continuedfloat\caption@@@continuedfloat\@gobble}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\nextfloat}
+% \changes{v3.6}{2020/09/20}{This command added}
+% \changes{v3.6}{2021/01/09}{Usage of \cs{flushsubcaptionlistentries} added}
+% \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
+% |\nextfloat| resets the flags (indicating that the next contents of the floating environment starts here),
+% and sets a new \package{hyperref} anchor.
+% \begin{macrocode}
+\providecommand*\nextfloat{%
+ \caption@teststar\caption@nextfloat\@firstoftwo\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@nextfloat[1]{%
+ \caption@iftype
+ {\caption@@nextfloat\@captype
+ #1{}{\caption@reset@currentlabel\caption@start}}%
+ {\caption@OutsideFloat\nextfloat}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@nextfloat[1]{%
+ \flushsubcaptionlistentries
+ \caption@clrflags
+ \ifx\caption@@@continuedfloat\@gobble
+ % next continued float
+ \caption@set@continuedfloat\caption@setcontinued\relax
+ \fi}
% \end{macrocode}
% \end{macro}
%
-% \section{Internal helpers}
+% \subsection{Internal helpers}
%
% \begin{macro}{\caption@refstepcounter}
% \changes{v3.1}{2007/07/28}{This macro added}
@@ -1482,45 +6063,20 @@
% \changes{v3.2c}{2011/09/04}{Support of \cs{donemaincaptiontrue} from \textsf{memoir} document class added}
% \changes{v3.3}{2011/12/28}{Usage of \cs{ifcaption@caption}, \cs{ifcaption@subcaption}, and \cs{ifcaption@ContinuedFloat} added}
% \changes{v3.5e}{2020/09/28}{Bugfix in re-definition of \cs{stepcounter}; uses \cs{edef} instead of \cs{def} now}
-% Increments the float (i.e. |figure| or |table|) counter,
-% resets the continuation counter, and redefines itself to |\@gobble|.
+% \changes{v3.6}{2020/09/20}{Handling of flags out-sourced to \cs{caption@ifrefstepcounter}}
+% \changes{v3.6}{2020/12/27}{\cs{caption@@@refstepcounter} renamed to \cs{caption@refstepcounter@}}
+% \changes{v3.6}{2021/01/09}{Adapted to current interface of \cs{caption@prepare@stepcounter}}
+% |\caption@refstepcounter|\marg{counter}\\
+% increments the float counter (using |\ref|\-|step|\-|counter|) and resets the continuation counter.
% \begin{macrocode}
-\newcommand*\caption@refstepcounter[1]{%
- \@ifundefined{c@#1}%
- {\caption@Error{No float type '#1' defined}}%
- {\caption@ref@stepcounter{#1}%
+\newcommand*\caption@refstepcounter{%
+ \@nameuse{donemaincaptiontrue}% Support of the memoir document class
+ \caption@ifrefstepcounter\caption@@refstepcounter\caption@@refcounter}
% \end{macrocode}
-% Set flag if this part of the figure (or table) contains a caption now.
-% (If |\caption@if|\-|top| is not set, |\caption| is at the bottom of this part,
-% therefore ending this part, so we set the flag to |false| in this case.)
% \begin{macrocode}
- \caption@fixposition % TODO: Make this independant on the "position" setting
- \caption@iftop\caption@setflag\caption@clrflag2% caption
-% \end{macrocode}
-% This part does not contain content (like sub-figures) yet,
-% so we set |\if|\-|caption@sub|\-|caption| to |false|.
-% \begin{macrocode}
- \caption@clrflag4% subcaption
-% \end{macrocode}
-% Support of the \textsf{memoir} document class.
-% \begin{macrocode}
- \@nameuse{donemaincaptiontrue}}}
-% \end{macrocode}
-% \begin{macrocode}
-\newcommand*\caption@ref@stepcounter{%
- \caption@ifflag1{% continued float
- \let\caption@tempa\caption@@refcounter
- \caption@clrflag1% continued float
- }{%
- \let\caption@tempa\caption@@refstepcounter
- \caption@ifflag2{}{% caption
- \caption@ifflag4{% subcaption
- % Counter was already incremented by content, so we suppress \stepcounter{#1} here
- \let\caption@tempa\caption@@refcounter
- }{}%
- }%
- }%
- \caption@tempa}
+\newcommand*\caption@@refstepcounter[1]{%
+ \caption@prepare@stepcounter{#1}%
+ \caption@refstepcounter@{#1}}
% \end{macrocode}
% \begin{macrocode}
\newcommand*\caption@@refcounter[1]{%
@@ -1528,32 +6084,128 @@
\def\stepcounter##1{%
\edef\caption@tempa{#1}%
\edef\caption@tempb{##1}%
- \ifx\caption@tempa\caption@tempb \else
+ \ifx\caption@tempa\caption@tempb
+ % Suppress incrementation of counter
+ \else
\caption@stepcounter@ORI{##1}%
\fi}%
- \caption@@@refstepcounter{#1}%
- \let\stepcounter\caption@stepcounter@ORI}
+ \caption@refstepcounter@{#1}%
+ \let\stepcounter\caption@stepcounter@ORI}
% \end{macrocode}
% \begin{macrocode}
-\newcommand*\caption@@refstepcounter[1]{%
- \caption@prepare@stepcounter{#1}{ref}%
- \caption@@@refstepcounter{#1}}
+\newcommand*\caption@refstepcounter@{\refstepcounter}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@stepcounter}
+% \changes{v3.6}{2020/09/20}{This macro added}
+% \changes{v3.6}{2020/12/27}{Handling of flags out-sourced to \cs{caption@ifstepcounter}}
+% \changes{v3.6}{2020/12/27}{\cs{caption@@@stepcounter} renamed to \cs{caption@stepcounter@}}
+% \changes{v3.6}{2021/01/09}{Adapted to current interface of \cs{caption@prepare@stepcounter}}
+% |\caption@stepcounter|\marg{counter}\\
+% increments the float counter (using |\step|\-|counter|) and resets the continuation counter.
+% \begin{macrocode}
+\newcommand*\caption@stepcounter{%
+ \caption@ifstepcounter\caption@@stepcounter\caption@@counter}
% \end{macrocode}
% \begin{macrocode}
\newcommand*\caption@@stepcounter[1]{%
- \caption@prepare@stepcounter{#1}{}%
- \caption@@@stepcounter{#1}}
+ \caption@prepare@stepcounter{#1}%
+ \caption@stepcounter@{#1}}
% \end{macrocode}
% \begin{macrocode}
-\newcommand*\caption@prepare@stepcounter[2]{%
- \caption@addsubcontentslines{#2stepcounter}%
- \caption@reset@continuedfloat{#1}}
+\newcommand*\caption@@counter[1]{} % nothing to do
% \end{macrocode}
% \begin{macrocode}
-\newcommand*\caption@@@refstepcounter{\refstepcounter}
+\newcommand*\caption@stepcounter@{\stepcounter}
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@prepare@stepcounter}
+% \changes{v3.3}{2011/12/28}{This macro added}
+% \changes{v3.6}{2021/01/09}{Argument \meta{source hint} dropped; adapted to current interface of \cs{caption@addsubcontentslines}}
+% |\caption@prepare@stepcounter|\marg{counter}
+% Dumps the cached list entries and resets the continuation counter.
% \begin{macrocode}
-\newcommand*\caption@@@stepcounter{\stepcounter}
+\newcommand*\caption@prepare@stepcounter{%
+ \caption@addsubcontentslines\relax
+ \caption@reset@continuedfloat}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifrefstepcounter}
+% \changes{v3.6}{2020/09/20}{This macro added}
+% |\caption@ifrefstepcounter|\marg{yes-code}\marg{no-code}\\
+% tests if the counter should be increased or not. Furthermore it updates the flags accordingly.
+% \begin{macrocode}
+\newcommand*\caption@ifrefstepcounter{%
+ \caption@ifcounter
+% \end{macrocode}
+% If a caption was already typeset in this environment, we need to increment the counter (again).
+% \begin{macrocode}
+ {\caption@ifcaption}%
+% \end{macrocode}
+% If a caption and a sub-caption below it were already typeset, we issue a warning additionally.
+% (This will only be done if |position=b| is set because this is the case were the sub-caption numbering got most likely wrong.)
+% \begin{macrocode}
+ {\caption@ifsubcaption@below{\caption@iftop\@secondoftwo\@firstoftwo}{\@secondoftwo}}%
+% \end{macrocode}
+% In each case set the `caption' flag to indicate a caption was typeset.
+% \begin{macrocode}
+ {\caption@setcaption}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifstepcounter}
+% \changes{v3.6}{2020/12/27}{This macro added}
+% |\caption@ifstepcounter|\marg{yes-code}\marg{no-code}\\
+% tests if the counter should be increased or not. Furthermore it updates the flags accordingly.
+% \begin{macrocode}
+\newcommand*\caption@ifstepcounter{%
+ \caption@ifcounter
+% \end{macrocode}
+% If a caption and a sub-caption above it were already typeset in this environment, we need to increment the counter (again).
+% \begin{macrocode}
+ {\caption@ifcaption\caption@ifsubcaption@above\@secondoftwo}%
+% \end{macrocode}
+% In this case issue a warning additionally.
+% (This will only be done if |position=t| is set because this is the case were the sub-caption numbering got most likely wrong.)
+% \begin{macrocode}
+ {\caption@iftop}%
+% \end{macrocode}
+% In each case set the `subcaption' flag to indicate a sub-caption was typeset.
+% \begin{macrocode}
+ {\caption@setsubcaption}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifcounter}
+% \changes{v3.6}{2020/12/28}{This macro added}
+% |\caption@ifcounter|\marg{increment the counter?}\marg{issue a warning?}\marg{set flag}\marg{yes-code}\marg{no-code}\\
+% contains the common code of |\caption@if|\-|ref|\-|step|\-|counter| and |\caption@if|\-|step|\-|counter|.
+% \begin{macrocode}
+\newcommand*\caption@ifcounter[3]{%
+ \caption@ifflags
+% \end{macrocode}
+% Test if the counter should be incremented (again). If yes, test if a warning should be issued additionally.
+% (If the counter gets incremented all flags will be cleared to indicate a new run.)
+% \begin{macrocode}
+ {#1%
+ {#2\caption@Warning\@gobble{Ambiguous sub-caption(s), use \string\nextfloat}%
+ \caption@clrflags
+ \let\caption@next\@firstoftwo}%
+ {\let\caption@next\@secondoftwo}}%
+% \end{macrocode}
+% Always increment the counter if no flag was set so far.
+% \begin{macrocode}
+ {\let\caption@next\@firstoftwo}%
+% \end{macrocode}
+% Set either the `caption' or `subcaption' flag.
+% \begin{macrocode}
+ #3%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@next}
% \end{macrocode}
% \end{macro}
%
@@ -1569,7 +6221,9 @@
% \end{macrocode}
% \begin{macrocode}
\newcommand\caption@dblarg[1]{%
- \kernel@ifnextchar[{\caption@ydblarg{#1}}{\caption@xdblarg{#1}}}
+ \kernel@ifnextchar[%]
+ {\caption@ydblarg{#1}}%
+ {\caption@xdblarg{#1}}}
% \end{macrocode}
% \begin{macrocode}
\newcommand\caption@xdblarg[2]{%
@@ -1638,23 +6292,8 @@
% \changes{v3.0a}{2004/01/23}{Internal hooks \cs{caption@@begin} \& \cs{caption@@end} added}
% \changes{v3.0h}{2005/10/06}{Internal hooks \cs{caption@@begin} \& \cs{caption@@end} removed}
%
-% \begin{macro}{\caption@setfnum}
-% \changes{v3.1}{2007/03/10}{This macro added}
-% \changes{v3.5}{2020/08/03}{Adapted to \package{caption3} v2.0}
-% |\caption@setfnum|\marg{type}\\
-% stores the original definition of |\fnum@|\meta{type} in |\caption@fnum@|\meta{type}
-% and re-defines it according the caption label format set with |label|\-|format=|.
-% \begin{macrocode}
-\newcommand*\caption@setfnum[1]{%
- \@ifundefined{caption@fnum@#1}%
- {\expandafter\let\csname caption@fnum@#1\expandafter\endcsname\csname fnum@#1\endcsname
- \@namedef{fnum@#1}{\caption@fnum{#1}}}%
- {}}
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}{\caption@normalsize}
-% \changes{v3.1}{2007/05/05}{This macro and its usage added}
+% \changes{v3.1}{2007/05/05}{This macro definition added}
% \changes{v3.5}{2020/07/27}{Adapted to \package{caption3} v2.0}
% This one will be used by |\@caption| instead of |\normalsize|.
% \begin{macrocode}
@@ -1700,7 +6339,7 @@
% \end{macro}
%
% \begin{macro}{\caption@gettitle}
-% \changes{v3.1}{2007/05/05}{This macro and its usage added}
+% \changes{v3.1}{2007/05/05}{This macro definition added}
% This one is needed for support of the \package{nameref} package.
% \begin{macrocode}
\newcommand\caption@gettitle[1]{%
@@ -1710,7 +6349,7 @@
% \end{macrocode}
% \end{macro}
%
-% \section{Support for sub-captions}
+% \subsection{Support for sub-captions}
% \changes{v3.1f}{2007/11/16}{Support for sub-captions added}
%
% \begin{macro}{\caption@subtypehook}
@@ -1727,6 +6366,7 @@
% \changes{v3.3}{2018/09/06}{Adapted to the \package{chkfloat} package}
% \changes{v3.4f}{2020/01/03}{Redefinition of \cs{@caption} added since it was redefined by the \env{threeparttable} environment}
% \changes{v3.5}{2020/07/27}{Adapted to \package{caption3} v2.0}
+% \changes{v3.6}{2020/09/20}{Handling of flags out-sourced to \cs{caption@stepcounter}}
% Hook, will be used inside \cs{caption@setsubtype}.\par
% (Note: If we are inside an |sub|\-|float|\-|row| environment we have to keep
% the |\@make|\-|caption| code of the \package{floatrow} package intact.)
@@ -1734,22 +6374,11 @@
\newcommand*\caption@subtypehook{%
\ifx\caption\caption@subcaption \else
\caption@warmup
-% \end{macrocode}
-% \begin{macrocode}
- \caption@ifflag2{}{% caption
-% no \caption in this part of the (floating) environment yet
- \let\caption@add@contentsline\caption@addsubcontentsline
- \let\caption@addsubcontentslines\@gobble
- \caption@ifflag4{}{% subcaption
-% no \subcaption in this part of the (floating) environment yet
- \caption@ifflag1{% continued float
- \caption@clrflag1%
- }{%
- \caption@@stepcounter\@captype
- }%
- \caption@setflag4% subcaption
- }%
- }%
+ \caption@stepcounter\@captype
+ \caption@ifcaption
+ {}%
+ {\let\caption@add@contentsline\caption@addsubcontentsline
+ \let\caption@addsubcontentslines\@gobble}%
% \end{macrocode}
% \begin{macrocode}
\c@continuedfloat=0\relax
@@ -1780,8 +6409,9 @@
\let\@caption\caption@@caption
\let\phantomcaption\caption@subphantom
\let\captionlistentry\caption@sublistentry
+ \let\captiontext\caption@subtext
% \let\@captype\@subcaptype
- \let\caption@refstepcounter\caption@@@refstepcounter
+ \let\caption@refstepcounter\caption@refstepcounter@
% \end{macrocode}
% \begin{macrocode}
% restore \@makecaption
@@ -1841,7 +6471,17 @@
% \end{macrocode}
% \begin{macrocode}
\newcommand*\@subcaptionlistentry[1]{%
- \@testopt{\caption@listentry{#1}}\@subcaptype}
+ \@testopt{\caption@listentry{#1}}{\@subcaptype}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@subtext}
+% \changes{v3.2a}{2011/08/17}{This macro added}
+% Same as |\captiontext|, but for sub-captions.
+% \begin{macrocode}
+\newcommand*\caption@subtext{%
+% \caption@checkgrouplevel{sub}\subcaptiontext
+ \caption@text\@subcaptype}
% \end{macrocode}
% \end{macro}
%
@@ -1884,51 +6524,26 @@
% \begin{macro}{\flushsubcaptionlistentries}
% \changes{v3.3}{2012/01/15}{Renamed from \cs{caption@addsubcontentslines} to \cs{flushsubcaptionlistentries}}
% \changes{v3.3}{2013/03/10}{Bugfix: Missing redefinition of \cs{caption@addsubcontentslines} added}
+% \changes{v3.6}{2021/01/09}{Patch of \cs{chapter} and \cs{appendix} dropped}
% Writes pending sub-caption list entries.
+% (Note: We keep the parameter of |\caption@add|\-|sub|\-|contents|\-|lines| for compatibility reasons although it's not used anymore.)
% \begin{macrocode}
\newcommand*\flushsubcaptionlistentries{%
- \caption@addsubcontentslines{user}}
+ \caption@addsubcontentslines\relax}
% \end{macrocode}
% \begin{macrocode}
\renewcommand*\caption@addsubcontentslines[1]{%
- \caption@Debug{\string\flushsubcaptionlistentries (#1)}%
+ \caption@Debug{\string\flushsubcaptionlistentries}%
\begingroup
\caption@subcontentslines
\endgroup
\caption@clearsubcontentslines}
% \end{macrocode}
-% We need to patch \cs{chapter} otherwise a vertical gap will be inserted into
-% the list prior pending sub-caption list entries.
-% We do this |\At|\-|Begin|\-|Document| so packages like \package{newfloat}
-% will not complain about an unknown document class.
-% \begin{macrocode}
-\AtBeginDocument{%
-% \end{macrocode}
-% \begin{macrocode}
- \caption@ifdefined\chapter{%
- \let\caption@chapter@ORI\chapter
- \def\chapter{%
- \caption@addsubcontentslines{chapter}\caption@chapter@ORI}}{}%
-% \end{macrocode}
-% Same for \cs{appendix}.
-% \begin{macrocode}
- \caption@ifdefined\appendix{%
- \let\caption@appendix@ORI\appendix
- \def\appendix{%
- \caption@addsubcontentslines{appendix}\caption@appendix@ORI}}{}%
-% \end{macrocode}
-% Flush the list of pending sub-caption list entries at the end of the document.
-% \begin{macrocode}
- \caption@addsubcontentslines{AtEndDocument}%
-% \end{macrocode}
-% \begin{macrocode}
-}
-% \end{macrocode}
% \end{macro}
%
-% \section{Babel package support}
+% \subsection{Babel package support}
%
-% \subsection{The arabic \& farsi babel option}
+% \subsubsection{The arabic \& farsi babel option}
% \changes{v3.5}{2020/08/02}{\package{arabic} babel support addded}
%
% \begin{macrocode}
@@ -1948,7 +6563,7 @@
}{}
% \end{macrocode}
%
-% \subsection{The frenchle \& frenchpro package}
+% \subsubsection{The frenchle \& frenchpro package}
% \changes{v3.0h}{2005/10/03}{\package{frenchle/pro} package support added}
% \changes{v3.5}{2020/08/01}{\package{frenchle/pro} package support updated}
%
@@ -1984,7 +6599,7 @@
}{}
% \end{macrocode}
%
-% \subsection{The hungarian \& magyar babel option}
+% \subsubsection{The hungarian \& magyar babel option}
% \changes{v3.2}{2009/03/29}{\package{magyar} babel support added}
% \changes{v3.3}{2018/08/26}{\package{magyar} babel support revised}
% \changes{v3.5}{2020/08/02}{\package{magyar} babel support updated}
@@ -2013,7 +6628,7 @@
}{}
% \end{macrocode}
%
-% \subsection{The latvian babel option}
+% \subsubsection{The latvian babel option}
% \changes{v3.5}{2020/08/02}{\package{latvian} babel support updated}
%
% \begin{macrocode}
@@ -2031,7 +6646,7 @@
}{}
% \end{macrocode}
%
-% \section{Package support}
+% \subsection{Package support}
% \changes{v3.1}{2007/04/11}{Package options `float', `longtable' etc.~are not supported anymore, removed}
%
% \begin{macro}{\caption@IfPackageLoaded}
@@ -2073,12 +6688,13 @@
% \end{macro}
%
% \begin{macro}{\caption@clearmargin}
-% \changes{v3.1}{2007/05/05}{This macro and its usage added}
+% \changes{v3.1}{2007/05/05}{This macro definition added}
+% \changes{v3.6}{2021/01/17}{Adapted to current implementation of \cs{caption@setmargin}}
% This macro will be used by some package support stuff where the usual
% margin setting is not welcome, e.g. in the \package{sidecap} package.
% \begin{macrocode}
\newcommand*\caption@clearmargin{%
- \setcaptionmargin\z@
+ \caption@setmargin\z@
\let\caption@minmargin\@undefined}
% \end{macrocode}
% \end{macro}
@@ -2119,10 +6735,14 @@
\newcommand*\caption@freeze{%
\let\caption@frozen@continuedfloat\continuedfloat
\def\continuedfloat{%
- \caption@@freeze{\caption@@@@continuedfloat\@captype}%
+ \caption@@freeze{\caption@@@continuedfloat\@captype}%
\caption@frozen@continuedfloat}%
% \end{macrocode}
% \begin{macrocode}
+ \let\caption@frozen@nextfloat\nextfloat
+ \def\nextfloat{\caption@freeze@error}%
+% \end{macrocode}
+% \begin{macrocode}
\let\caption@frozen@setup\caption@setup
\def\caption@setup##1{%
\caption@@freeze{\caption@setup{##1}}%
@@ -2131,14 +6751,11 @@
% \begin{macrocode}
\let\caption@frozen@caption\caption
\def\caption{%
- \def\caption{%
- \caption@Error{%
- Only one \noexpand\caption can be placed in this environment}%
- \caption@gobble}%
+ \def\caption{\caption@freeze@error\caption@gobble}%
\@ifstar
- {\caption@SC@caption*}%
- {\let\@currentlabel\caption@SClabel
- \caption@withoptargs\caption@SC@caption}}%
+ {\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}%
@@ -2167,10 +6784,15 @@
% \begin{macrocode}
\def\caption@warmup{%
\let\continuedfloat\caption@frozen@continuedfloat
+ \let\nextfloat\caption@frozen@nextfloat
\let\caption@setup\caption@frozen@setup
\let\caption\caption@frozen@caption
\let\label\caption@frozen@label}}%
% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\caption@freeze@error{%
+ \caption@Error{Only one \noexpand\caption can be placed in this environment}}
+% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@prepare@defrost}
@@ -2178,7 +6800,7 @@
% Prevent resetting the caption flags
% \begin{macrocode}
\newcommand*\caption@prepare@defrost{%
- \let\caption@settype\caption@set@type}
+ \let\caption@settype\caption@@settype}
% \end{macrocode}
% \end{macro}
%
@@ -2212,7 +6834,7 @@
% \end{macrocode}
% \end{macro}
%
-% \subsection{The changepage package}
+% \subsubsection{The changepage package}
% \changes{v3.4k}{2020/05/30}{Patch of the \package{changepage} package added}
%
% \begin{macrocode}
@@ -2242,12 +6864,14 @@
% \end{macro}
%
% \begin{macro}{\caption@set@adjustwidth}
-% \changes{v3.4k}{2020/05/30}{This macro and its usage added}
+% \changes{v3.4k}{2020/05/30}{This macro definition added}
+% \changes{v3.6}{2022/02/13}{Usage of \cs{AtBeginCaption} replaced by \cs{l@addto@macro}\cs{caption@before@parboxrestore}}
% Store the values of \cs{hsize} and \cs{linewidth}.
% \begin{macrocode}
\providecommand*\caption@set@adjustwidth{%
\caption@adjustwidth@hsize\hsize
- \caption@adjustwidth@linewidth\linewidth}%
+ \caption@adjustwidth@linewidth\linewidth
+ \l@addto@macro\caption@before@parboxrestore\caption@test@adjustwidth}%
% \end{macrocode}
% \begin{macrocode}
\providecommand*\caption@patch@changepage[1]{%
@@ -2262,7 +6886,7 @@
% \end{macro}
%
% \begin{macro}{\caption@test@adjustwidth}
-% \changes{v3.4k}{2020/05/30}{This macro and its usage added}
+% \changes{v3.4k}{2020/05/30}{This macro definition added}
% Test if the values of \cs{hsize} and \cs{linewidth} are identical to
% the ones stored in the \env{adjustwidth} environment.
% If yes, set \cs{hsize} to the correct value.
@@ -2274,16 +6898,13 @@
\fi
\fi}%
% \end{macrocode}
-% \begin{macrocode}
- \AtBeginCaption{\caption@test@adjustwidth}%
-% \end{macrocode}
% \end{macro}
%
% \begin{macrocode}
}{}%
% \end{macrocode}
%
-% \subsection{The chkfloat package}
+% \subsubsection{The chkfloat package}
% \changes{v3.3}{2018/09/06}{Support of the \package{chkfloat} package added}
%
% \begin{macrocode}
@@ -2308,12 +6929,11 @@
}{}%
% \end{macrocode}
%
-% \subsection{The float package}
+% \subsubsection{The float package}
% \changes{v3.0f}{2005/05/31}{\package{float} package support rewritten and improved}
% \iffalse
-% (This is a more straight-ahead implementation, but it only works with v1.3
-% now, so v1.2 is no longer supported. The old code including documentation
-% can be found in caption-30f-050530.zip)
+% (This is a more straight-ahead implementation, but it only works with \version{1.3}
+% now, so \version{1.2} is no longer supported.
% \fi
%
% The \package{float} package usually do not use the \LaTeX\ kernel command
@@ -2401,9 +7021,9 @@
% \begin{macro}{\float@makebox}
% \changes{v3.3}{2013/01/06}{Corrects wrong load order hyperref-float now}
% \changes{v3.3}{2013/02/03}{Correction of wrong load order hyperref-float revised}
-% Redefine |\float@makebox| (only if we are not operating in compatibility mode `v1').
+% Redefine |\float@makebox|:
% \begin{macrocode}
- \caption@AtBeginDocument{\caption@ifcompatibility{}{%
+ \caption@AtBeginDocument{%
% \end{macrocode}
% If it was redefined by the \package{hyperref} package,
% we need to build on the original definition (and not on the redefined one).
@@ -2415,7 +7035,7 @@
\caption@ORI@float@makebox{#1\relax \caption@defrostHref}}%
% \end{macrocode}
% \begin{macrocode}
- }}%
+ }%
% \end{macrocode}
% \end{macro}
%
@@ -2540,7 +7160,7 @@
\caption@undefbool{ruled}
% \end{macrocode}
%
-% \subsection{The floatflt package}
+% \subsubsection{The floatflt package}
% \changes{v3.1}{2007/06/10}{Support of the \package{floatflt} package added}
%
% \begin{macrocode}
@@ -2583,7 +7203,6 @@
\newcommand*\caption@floatflt[1]{%
\caption@settype{#1}%
\caption@clearmargin
- \caption@setparboxrestore{full}%
\caption@setoptions{floating#1}}%
% \end{macrocode}
% \end{macro}
@@ -2592,7 +7211,7 @@
}{}
% \end{macrocode}
%
-% \subsection{The fltpage package}
+% \subsubsection{The fltpage package}
% \changes{v3.1}{2007/07/22}{Support of the \package{fltpage} package added}
%
% \begin{macrocode}
@@ -2742,7 +7361,7 @@
}
% \end{macrocode}
%
-% \subsection{The hyperref package}
+% \subsubsection{The hyperref package}
% \changes{v3.0f}{2005/06/11}{Support of the \package{hyperref} package added}
% \changes{v3.1}{2007/03/09}{Usage of \cs{hyper@makecurrent} instead of
% \cs{theHfigure} as indicator for \package{hyperref} package}
@@ -2768,14 +7387,14 @@
Hyperref support is turned off\MessageBreak
because hyperref has stopped early}%
}{%
- \g@addto@macro\caption@prepareslc{\measuring@true}%
+ \AtCaptionSingleLineCheck{\measuring@true}%
% \end{macrocode}
%
-% \begin{macro}{\caption@@@refstepcounter}
-% We redefine |\caption@@refstepcounter| so |\H@refstepcounter| will be used
+% \begin{macro}{\caption@refstepcounter@}
+% We redefine |\caption@refstepcounter@| so |\H@refstepcounter| will be used
% instead of |\refstepcounter| inside |\caption| \& |\captionlistentry|.
% \begin{macrocode}
- \renewcommand*\caption@@@refstepcounter{\H@refstepcounter}%
+ \renewcommand*\caption@refstepcounter@{\H@refstepcounter}%
% \end{macrocode}
% \end{macro}
%
@@ -2813,7 +7432,7 @@
\fi}%
% \end{macrocode}
% \begin{macrocode}
- \g@addto@macro\caption@prepareslc{\let\caption@makeanchor\@firstofone}%
+ \AtCaptionSingleLineCheck{\let\caption@makeanchor\@firstofone}%
% \end{macrocode}
% \end{macro}
%
@@ -3016,11 +7635,11 @@
}}{}
% \end{macrocode}
%
-% \subsection{The hypcap package}
+% \subsubsection{The hypcap package}
% \changes{v3.0f}{2005/06/22}{Support of the \package{hypcap} package added}
% \changes{v3.0l}{2007/02/20}{Adapted to \package{hypcap} \version{1.6}}
% \changes{v3.1e}{2007/11/04}{\package{hypcap} support adapted to \package{hyperref} \version{6.77}}
-%
+%
% \begin{macrocode}
\caption@IfPackageLoaded{hypcap}{% v1.0
\ifx\caption@start\relax \else % hyperref hasn't stopped early
@@ -3038,7 +7657,6 @@
% only but our version affects \emph{all} |\caption|s in the same
% environment, at least unless a new |\capstart| will be placed.
% \begin{macrocode}
- \let\caption@ORI@capstart\capstart % save for compatibility mode
\caption@ifundefined\capstarttrue % check for v1.10 of hypcap package
{\def\capstart{\caption@start@}}%
{\def\capstart{\ifcapstart\caption@start@\fi}}%
@@ -3060,7 +7678,7 @@
\fi}{}
% \end{macrocode}
%
-% \subsection{The listings package}
+% \subsubsection{The listings package}
% \changes{v3.0b}{2004/05/16}{Support of the \package{listings} package added}
%
% \begin{macrocode}
@@ -3073,6 +7691,7 @@
% \changes{v3.2}{2010/10/26}{Bugfix 10-07-20a: Set \cs{hsize} to \cs{linewidth}, if necessary}
% \changes{v3.4c}{2020/01/01}{Ugly workaround for usage in lists added}
% \changes{v3.4d}{2020/01/01}{Ugly workaround for usage in lists revised}
+% \changes{v3.6}{2021/01/04}{Re-definition of \cs{addcontentsline} added}
% To support the \package{listings} package we need to redefine
% |\lst@Make|\-|Caption| so the original stuff is nested with
% |\caption@begin| and |\caption@end| etc.\par
@@ -3083,7 +7702,7 @@
% \end{macrocode}
% \begin{macrocode}
\let\caption@ORI@lst@MakeCaption\lst@MakeCaption
- \def\lst@MakeCaption#1{% #1 is `t' or `b'
+ \renewcommand*\lst@MakeCaption[1]{% #1 is `t' or `b'
% \end{macrocode}
% This macro is always called twice by the \package{listings} package (with `t' resp. `b' as parameter),
% therefore we need an extra group here.
@@ -3123,6 +7742,15 @@
% \begin{macrocode}
\caption@setautoposition{#1}%
% \end{macrocode}
+% \begin{macrocode}
+% We re-define |\addcontentsline| so our list format gets used for the lol entry etc.
+ \ifx\lst@@caption\@empty \else
+ \let\caption@ORI@addcontentsline\addcontentsline
+ \renewcommand*\addcontentsline[3]{%
+ \let\addcontentsline\caption@ORI@addcontentsline
+ \caption@addcontentsline{lstlisting}{\lst@@caption}}%
+ \fi
+% \end{macrocode}
% At the end we do similar stuff as in our \cs{@caption} code.
% \begin{macrocode}
\caption@begin{lstlisting}%
@@ -3160,7 +7788,7 @@
}{}
% \end{macrocode}
%
-% \subsection{The longtable package}
+% \subsubsection{The longtable package}
%
% \begin{macro}{\LTcaptype}
% \changes{v3.1}{2007/07/06}{This macro and its support added}
@@ -3194,6 +7822,7 @@
% \changes{v3.3}{2016/01/31}{Support for \cs{bicaption} added}
% \changes{v3.3}{2018/10/05}{Definition of \cs{captionlistentry} fixed}
% \changes{v3.5}{2018/04/15}{Usage of \cs{caption@AtBeginLongtable} added}
+% \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
% We redefine |\LT@array| here to get |\captionsetup|\marg{options} working inside |longtable|s.
% \Note{Since the \package{hyperref} package patches \cs{LT@array} as well
% and since this only works with the original definition of \cs{LT@array},
@@ -3256,7 +7885,7 @@
% }%
% \global\let\caption@setContinuedFloat\@empty
\def\continuedfloat{\noalign{%
- \caption@Error{\noexpand\continuedfloat outside float}}}%
+ \caption@OutsideFloat\continuedfloat}}%
% \end{macrocode}
% |\bicaption| for longtable:
% \begin{macrocode}
@@ -3291,6 +7920,7 @@
% \changes{v3.0h}{2005/10/07}{\cs{caption@LT@make} introduced}
% \changes{v3.3}{2016/02/01}{Support for \cs{bicaption} via \cs{caption@LT@setup} added}
% \changes{v3.3a}{2019/04/02}{Work-around for problem with \package{floatrow} added}
+% \changes{v3.6}{2021/01/09}{Adapted to current interface of \cs{caption@prepare@stepcounter}}
% |\LT@makecaption|\marg{cmd}\marg{label}\marg{text}\par
% \smallskip
% The original definition:
@@ -3336,7 +7966,7 @@
\caption@startrue#1\caption@starfalse
% \end{macrocode}
% \begin{macrocode}
- \caption@prepare@stepcounter\LTcaptype{LT}%
+ \caption@prepare@stepcounter\LTcaptype
% \end{macrocode}
% \changes{v3.1}{2007/05/05}{\cs{caption@font@normal} added}
% \begin{macrocode}
@@ -3389,6 +8019,7 @@
% \begin{macro}{\caption@LT@settype}
% \changes{v3.3}{2018/08/26}{This macro added}
% \changes{v3.3}{2018/10/05}{Uses argument no. 1 instead of \cs{LTcaptype}}
+% \changes{v3.6}{2021/01/17}{Adapted to current implementation of \cs{caption@setwidth}}
% \begin{macrocode}
\newcommand*\caption@LT@settype[1]{%
\caption@settype*{#1}%
@@ -3398,7 +8029,7 @@
% (But |\captionsetup[longtable]{width=|\ldots|}| will overwrite |\LTcapwidth|.)
% \begin{macrocode}
\ifdim\LTcapwidth=4in \else
- \setcaptionwidth\LTcapwidth
+ \caption@setwidth\LTcapwidth
\fi
% \end{macrocode}
% \begin{macrocode}
@@ -3447,7 +8078,7 @@
% \end{macrocode}
% \end{macro}
%
-% \subsection{The picinpar package}
+% \subsubsection{The picinpar package}
% \changes{v3.1}{2007/06/13}{Support of the \package{picinpar} package added}
%
% \begin{macrocode}
@@ -3484,8 +8115,7 @@
\let\@makecaption\caption@@make
\caption@setautoposition b%
\caption@settype{#1}%
- \caption@clearmargin
- \caption@setparboxrestore{full}}%
+ \caption@clearmargin}%
% \end{macrocode}
% \end{macro}
%
@@ -3493,6 +8123,7 @@
% \changes{v3.1d}{2007/10/25}{Missing \% added}
% \changes{v3.3}{2013/04/14}{\cs{caption@ContinuedFloattrue} added}
% \changes{v3.3}{2018/10/06}{\cs{caption@ContinuedFloattrue} replaced by \cs{caption@setflag1}}
+% \changes{v3.6}{2020/12/28}{\cs{caption@setflag1} replaced by \cs{caption@clrflags}\cs{caption@setcontinued}}
% This one finally typesets the caption using |\caption|.
% \begin{macrocode}
\newcommand\caption@wincaption[1]{%
@@ -3505,7 +8136,9 @@
\let\caption@@start\relax
\caption@prepareslc
\else
- \caption@setflag1%
+ % don't increment the figure or table counter again
+ \caption@clrflags
+ \caption@setcontinued
\fi
% \end{macrocode}
% The argument |#1| could contain simply the caption text
@@ -3531,7 +8164,7 @@
}{}
% \end{macrocode}
%
-% \subsection{The picins package}
+% \subsubsection{The picins package}
% \changes{v3.0j}{2006/01/26}{Support of the \package{picins} package added}
%
% \begin{macro}{\piccaptiontype}
@@ -3609,11 +8242,10 @@
\caption@freezeHref % will be defrosted in \ivparpic
\caption@settype\@piccaptype
% \ifnum\c@piccaptionpos>2\relax
- \caption@clearmargin
+ \caption@clearmargin
% \else
-% \captionwidth\z@ % do not use "width=" setting
+% \caption@width\z@ % do not use "width=" setting
% \fi
- \caption@setparboxrestore{full}%
\caption@setoptions{parpic}%
\caption@setautoposition b%
% \end{macrocode}
@@ -3668,7 +8300,7 @@
}
% \end{macrocode}
%
-% \subsection{The rotating package}
+% \subsubsection{The rotating package}
%
% \begin{macrocode}
\caption@IfPackageLoaded{rotating}[1995/08/22 v2.10]{%
@@ -3695,8 +8327,9 @@
%
% \begin{macro}{\@makerotcaption}
% \changes{v3.0i}{2005/12/06}{Rewritten, should finally work proper now}
-% \changes{v3.0m}{2007/03/04}{Uses \cs{caption@parbox} instead of \cs{caption@start/endbox} now}
+% \changes{v3.0m}{2007/03/04}{Uses \cs{caption@parbox} instead of \cs{caption@start/endbox}}
% \changes{v3.3}{2012/12/26}{Rewritten (again)}
+% \changes{v3.6}{2021/01/17}{Adapted to current implementation of \cs{caption@setmargin}}
% Original (bugfixed) code:
% \begin{verbatim}
% \long\def\@makerotcaption#1#2{%
@@ -3717,8 +8350,8 @@
% \begin{macrocode}
\long\def\@makerotcaption#1#2{%
\rotatebox{90}{%
- \ifdim\captionwidth=\z@
- \setcaptionwidth{.8\vsize}%
+ \ifdim\caption@width=\z@
+ \caption@setwidth{.8\vsize}%
\l@addto@macro\caption@singleline{%
\caption@setup{parbox=none}}%
\fi
@@ -3732,7 +8365,7 @@
}{}
% \end{macrocode}
%
-% \subsection{The sidecap package}
+% \subsubsection{The sidecap package}
%
% \begin{macrocode}
\caption@IfPackageLoaded{sidecap}[2003/06/06 v1.6f]{%
@@ -3831,7 +8464,7 @@
}{}
% \end{macrocode}
%
-% \subsection{The subfigure package}
+% \subsubsection{The subfigure package}
% \changes{v3.1}{2007/04/06}{subfigure package support added}
%
% \begin{macrocode}
@@ -3869,7 +8502,7 @@
}{}
% \end{macrocode}
%
-% \subsection{The supertabular and xtab packages}
+% \subsubsection{The supertabular and xtab packages}
%
% \begin{macrocode}
\caption@IfPackageLoaded{supertabular}[2002/07/19 v4.1e]{%
@@ -3979,9 +8612,9 @@
% \begingroup
% \@parboxrestore
% \normalsize
-% %% \if@topcaption \vskip -10\p@ \fi
+% %% \if@topcaption \vskip -10\p@ \fi
% \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
-% %% \if@topcaption \vskip 10\p@ \fi
+% %% \if@topcaption \vskip 10\p@ \fi
% \endgroup
% \global\advance\ST@pageleft -\PWSTcapht
% \ST@trace\tw@{Added caption. Space left for xtabular: \the\ST@pageleft}}
@@ -4010,7 +8643,7 @@
}{}
% \end{macrocode}
%
-% \subsection{The threeparttable package}
+% \subsubsection{The threeparttable package}
% \changes{v3.1}{2007/05/08}{Support of the \package{threeparttable} package added}
%
% \begin{macrocode}
@@ -4080,7 +8713,7 @@
}{}
% \end{macrocode}
%
-% \subsection{The wrapfig package}
+% \subsubsection{The wrapfig package}
% \changes{v3.1}{2007/05/05}{Support of the \package{wrapfig} package added}
% \changes{v3.2d}{2011/11/02}{Support of the \package{wrapfig} package rewritten}
%
@@ -4090,6 +8723,7 @@
%
% \begin{macro}{\wrapfloat}
% \changes{v3.2d}{2011/11/02}{Redefinition of this macro added}
+% \changes{v3.6}{2020/12/28}{Usage of \cs{@testopt} added}
% First of all we make the \package{wrapfig} package independent from the package
% load order regarding the \package{float} package.
% Since the usage of |\@float@set|\-|every| is missing in the code of the \package{wrapfig}
@@ -4104,7 +8738,7 @@
% \@float@setevery{#1}%
\def\WF@floatstyhook{\let\@currbox\WF@box
\global\setbox\WF@box\float@makebox{\wd\WF@box}}}%
- \@ifnextchar[\WF@wr{\WF@wr[]}}
+ \@testopt\WF@wr{}}
% \end{macrocode}
% \end{macro}
%
@@ -4144,7 +8778,7 @@
\@ifundefined{fst@#1}{}{\@float@setevery{#1}}%
\caption@settype{#1}%
\caption@clearmargin
-%%% \caption@setoptions{wrap}%
+%%% \caption@setoptions{wrap}%
\caption@setoptions{wrap#1}}%
% \end{macrocode}
% \end{macro}
@@ -4153,7 +8787,45 @@
}{}
% \end{macrocode}
%
-% \section{That's all Folks!}
+% \subsection{Debug stuff}
+%
+% \begin{macro}{\caption@checkcounter}
+% \changes{v3.6}{2020/12/28}{This macro added}
+% |\caption@checkref|\marg{counter}\marg{expected value}\\
+% checks if |\value|\marg{counter} would result in the \meta{expected value}.
+% \begin{macrocode}
+\newcommand*\caption@checkcounter[1]{%
+ \caption@check{\the#1}{\@nameuse{the#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@check[3]{%
+ \edef\caption@tempa{#2}%
+ \edef\caption@tempb{#3}%
+ \ifx\caption@tempa\caption@tempb
+ \caption@Info{\string#1 = \caption@tempa}%
+ \else
+ \caption@Error{\string#1 = \caption@tempa\space <> \caption@tempb}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@checkref}
+% \changes{v3.6}{2020/12/28}{This macro added}
+% |\caption@checkref|\marg{marker}\marg{expected value}\\
+% checks if |\ref|\marg{marker} would result in the \meta{expected value}.
+% \begin{macrocode}
+\newcommand*\caption@checkref[2]{%
+ \@ifundefined{r@#1}{}%
+ {\expandafter\expandafter\expandafter
+ \caption@@checkref\csname r@#1\endcsname\@nil{#1}{#2}}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@checkref#1#2\@nil#3#4{%
+ \caption@check{\ref{#3}}{#1}{#4}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{That's all Folks!}
%
% Execute the code declared with |\After|\-|Caption|\-|Package|.
%
@@ -4172,121 +8844,7 @@
% \fi
%
% \clearpage
-% \begin{thebibliography}{99}
-% \bibitem{float}
-% Anselm Lingnau:\\
-% \href{http://www.ctan.org/pkg/float}%
-% {\emph{An Improved Environment for Floats}},\\
-% 2001/11/08
-%
-% \bibitem{floatflt}
-% Mats Dahlgren:\\
-% \href{http://www.ctan.org/pkg/floatflt}%
-% {\emph{Welcome to the floatflt package}},\\
-% 1998/06/05
-%
-% \bibitem{floatrow}
-% Olga Lapko:\\
-% \href{http://www.ctan.org/pkg/floatrow}%
-% {\emph{The floatrow package documentation}},\\
-% 2009/08/02
-%
-% \bibitem{fltpage}
-% Sebastian Gross:\\
-% \href{http://www.ctan.org/pkg/fltpage}%
-% {\emph{Welcome to the beta test of fltpage package!}},\\
-% 1998/11/13
-%
-% \bibitem{hyperref}
-% Sebastian Rahtz \& Heiko Oberdiek:\\
-% \href{http://www.ctan.org/pkg/hyperref}%
-% {\emph{Hypertext marks in \LaTeX: a manual for hyperref}},\\
-% November 2012
-%
-% \bibitem{hypcap}
-% Heiko Oberdiek:\\
-% \href{http://www.ctan.org/pkg/oberdiek}%
-% {\emph{The hypcap package -- Adjusting anchors of captions}},\\
-% 2011/02/16
-%
-% \bibitem{listings}
-% Carsten Heinz \& Brooks Moses:\\
-% \href{http://www.ctan.org/pkg/listings}%
-% {\emph{The Listings Package}},\\
-% 2007/02/22
-%
-% \bibitem{longtable}
-% David Carlisle:\\
-% \href{http://www.ctan.org/pkg/longtable}%
-% {\emph{The longtable package}},\\
-% 2004/02/01
-%
-% \bibitem{picinpar}
-% Friedhelm Sowa:\\
-% \href{http://www.ctan.org/pkg/picinpar}%
-% {\emph{Pictures in Paragraphs}},\\
-% July 13, 1993
-%
-% \bibitem{picins}
-% Joachim Bleser and Edmund Lang:\\
-% \href{http://www.ctan.org/pkg/picins}%
-% {\emph{PicIns-Benutzerhandbuch Version 3.0}},\\
-% September~1992
-%
-% \bibitem{rotating}
-% Sebastian Rahtz and Leonor Barroca:\\
-% \href{http://www.ctan.org/pkg/rotating}%
-% {\emph{A style option for rotated objects in \LaTeX}},\\
-% 1997/09/26
-%
-% \bibitem{sidecap}
-% Rolf Niepraschk \& Hubert G\"a\ss lein:\\
-% \href{http://www.ctan.org/pkg/sidecap}%
-% {\emph{The sidecap package}},\\
-% 2003/06/06
-%
-% \bibitem{subfigure}
-% Steven D. Cochran:\\
-% \href{http://www.ctan.org/pkg/subfigure}%
-% {\emph{The subfigure package}},\\
-% 2005/03/15
-%
-% \bibitem{subfig}
-% Steven D. Cochran:\\
-% \href{http://www.ctan.org/pkg/subfig}%
-% {\emph{The subfig package}},\\
-% 2005/07/05
-%
-% \bibitem{supertabular}
-% Johannes Braams and Theo Jurriens:\\
-% \href{http://www.ctan.org/pkg/supertabular}%
-% {\emph{The supertabular environment}},\\
-% 2004/02/20
-%
-% \bibitem{threeparttable}
-% Donald Arseneau:\\
-% \href{http://www.ctan.org/pkg/threeparttable}%
-% {\emph{Three part tables: title, tabular environment, notes}},\\
-% March 5, 2010
-%
-% \bibitem{wrapfig}
-% Donald Arseneau:\\
-% \href{http://www.ctan.org/pkg/wrapfig}%
-% {\emph{WRAPFIG.STY ver 3.6}},\\
-% Jan 31, 2003
-%
-% \bibitem{xtab}
-% Peter Wilson:\\
-% \href{http://www.ctan.org/pkg/xtab}%
-% {\emph{The xtab package}},\\
-% 2011/07/31
-% \end{thebibliography}
-%
-% \iffalse
-% --------------------------------------------------------------------------- %
-% \fi
-%
-% \clearpage
% \Finale
%
\endinput
+
diff --git a/Master/texmf-dist/source/latex/caption/caption.ins b/Master/texmf-dist/source/latex/caption/caption.ins
index 188347ba15c..0a45ce53ea6 100644
--- a/Master/texmf-dist/source/latex/caption/caption.ins
+++ b/Master/texmf-dist/source/latex/caption/caption.ins
@@ -6,7 +6,7 @@
\preamble
-Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+Copyright (C) 1994-2022 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
https://gitlab.com/axelsommerfeldt/caption
@@ -33,9 +33,7 @@ the derived files
caption.sty, caption-light.sty, caption2.sty, caption3.sty,
caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
- caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
-and the user manuals
- caption-deu.tex, caption-eng.tex, caption-rus.tex.
+ caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty.
\endpreamble
@@ -56,14 +54,28 @@ and the user manuals
\generate{\file{ltcaption.sty}{\from{ltcaption.dtx}{package}}}
\generate{\file{subcaption.sty}{\from{subcaption.dtx}{package}}}
+\generate{\file{caption_1995-04-05.sty}{\from{fallback/v1/caption.dtx}{package}}}
+\generate{\file{caption2_1995-10-09.sty}{\from{fallback/v2.0/caption2.dtx}{package}}}
+\generate{\file{caption2_2005-10-03.sty}{\from{fallback/v2.1/caption2.dtx}{package}}}
+\generate{\file{caption_2007-04-16.sty}{\from{fallback/v3.0/caption.dtx}{package}}}
+\generate{\file{caption3_2007-04-11.sty}{\from{fallback/v3.0/caption.dtx}{kernel}}}
+\generate{\file{caption_2010-01-09.sty}{\from{fallback/v3.1/caption.dtx}{package}}}
+\generate{\file{caption3_2010-01-14.sty}{\from{fallback/v3.1/caption.dtx}{kernel}}}
+\generate{\file{caption_2011-11-10.sty}{\from{fallback/v3.2/caption.dtx}{package}}}
+\generate{\file{caption3_2011-11-01.sty}{\from{fallback/v3.2/caption3.dtx}{package}}}
+\generate{\file{caption_2019-09-01.sty}{\from{fallback/v3.3/caption.dtx}{package}}}
+\generate{\file{caption3_2019-09-01.sty}{\from{fallback/v3.3/caption3.dtx}{package}}}
+\generate{\file{caption_2020-07-29.sty}{\from{fallback/v3.4/caption.dtx}{package}}}
+\generate{\file{caption3_2020-07-29.sty}{\from{fallback/v3.4/caption3.dtx}{package}}}
+\generate{\file{caption_2020-10-26.sty}{\from{fallback/v3.5/caption.dtx}{package}}}
+\generate{\file{caption3_2020-10-26.sty}{\from{fallback/v3.5/caption3.dtx}{package}}}
+
\Msg{***********************************************************}
\Msg{*}
\Msg{* To finish the installation you have to move the files}
\Msg{* `*.sty' and `*.sto' into a directory searched by TeX.}
\Msg{*}
-\Msg{* To produce the documentation run the file}
-\Msg{* `caption-eng.tex' (English version) or `caption-rus.tex'}
-\Msg{* (Russian version) or `caption-deu.tex' (German version)}
-\Msg{* through LaTeX.}
+\Msg{* To produce the documentation run the files}
+\Msg{* `*.dtx' through LaTeX.}
\Msg{*}
\Msg{***********************************************************}
diff --git a/Master/texmf-dist/source/latex/caption/caption2.dtx b/Master/texmf-dist/source/latex/caption/caption2.dtx
index 9e6850dfe69..7ec1096e361 100644
--- a/Master/texmf-dist/source/latex/caption/caption2.dtx
+++ b/Master/texmf-dist/source/latex/caption/caption2.dtx
@@ -2,7 +2,7 @@
%
% This is file `caption2.dtx'.
%
-% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+% Copyright (C) 1994-2021 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
%
% --------------------------------------------------------------------------
%
@@ -27,18 +27,16 @@
% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
-% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
-% and the user manuals
-% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty.
%
% \fi
-% \CheckSum{864}
+%
+% \CheckSum{818}
%
% \iffalse
%<*driver>
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesFile{caption2.drv}%
- [2007/11/28 v2.2 Documentated code of the (obsolete) caption2 package]
+\ProvidesFile{caption2.drv}[2007/11/28 v2.2 Documentated code of the (obsolete) caption2 package]
\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
%\errorcontextlines=3
%
@@ -70,9 +68,16 @@
% \newcommand*{\purerm}[1]{{\upshape\mdseries\rmfamily #1}}
% \newcommand*{\puresf}[1]{{\upshape\mdseries\sffamily #1}}
% \newcommand*{\purett}[1]{{\upshape\mdseries\ttfamily #1}}
-% \let\package\puresf\def\thispackage{\package{caption2}}
+% \let\class\puresf \let\package\puresf
% \let\env\purett \let\opt\purett
%
+% \def\thispackage{the \package{caption2} package}
+% \def\Thispackage{The \package{caption2} package}
+%
+% \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
+% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
+% \newcommand*\version[2][]{v$#2$}
+%
% \GetFileInfo{caption2.drv}
% \let\docdate\filedate
% \let\docversion\fileversion
@@ -180,6 +185,7 @@
% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
% \DoNotIndex{\if,\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\kernel@ifnextchar}
% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
@@ -209,47 +215,52 @@
%
% \subsection{Identificaton}
%
+% We need at least \LaTeX2e\ version 1994/12/01.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption2}[2020/09/28 v2.2f Customising captions (AR)]
% \end{macrocode}
%
-% \changes{v2.2b}{2007/06/15}{Made obsolete warning even more annoying}
+% Bypass the release declarations in case the \LaTeX\ kernel doesn’t know how to deal with them
+% (as suggested by \url{https://www.latex-project.org/publications/2018-FMi-TUB-tb122mitt-version-rollback.pdf}).
% \begin{macrocode}
-\PackageWarning{caption2}{%
- ****************************************************\MessageBreak
- THIS PACKAGE IS OBSOLETE:\MessageBreak
- This package attempts to provide an `caption2'\MessageBreak
- package v2.0/2.1 author environment so that OLD\MessageBreak
- documents can be successfully processed. It should\MessageBreak
- NOT be used for NEW documents! New documents should\MessageBreak
- use the regular `caption' package v3.x instead.\MessageBreak
- ****************************************************\@gobbletwo}%
+\providecommand\DeclareRelease[3]{}
+\providecommand\DeclareCurrentRelease[2]{}
% \end{macrocode}
%
-% \subsection{Loading the caption3 kernel}
+% Declare all supported releases.
+% \begin{macrocode}
+\DeclareRelease{v2.0}{1995-10-09}{caption2_1995-10-09.sty}
+\DeclareRelease{v2.1}{2002-08-03}{caption2_2005-10-03.sty}
+\DeclareCurrentRelease{v2.2}{2007-04-09} % 1st version using caption3
+% \end{macrocode}
%
+% Identify the current version of the package.
% \begin{macrocode}
-\RequirePackage{caption3}[2020/09/28] % needs v2.2a or newer
+\ProvidesPackage{caption2}[2021/01/20 v2.2i Customising captions (AR)]
+%\PackageWarning{caption2}{THIS PACKAGE IS OBSOLETE, PLEASE USE caption INSTEAD}
% \end{macrocode}
-% We undefine user commands offered by \package{caption} but not by \package{caption2}
-% since they should not be used together with \package{caption2}.
+%
+% \subsection{Loading the caption3 kernel}
+%
% \begin{macrocode}
-\let\captionsetup\@undefined
-\let\clearcaptionsetup\@undefined
-\let\showcaptionsetup\@undefined
-\let\DeclareCaptionType\@undefined
-\let\DeclareCaptionSubType\@undefined
+\RequirePackage{caption3}[2007/03/04]
% \end{macrocode}
%
% \begin{macro}{\captiontwo@Error}
% \changes{v2.2f}{2020/09/28}{This macro added}
+% \changes{v2.2g}{2020/12/25}{Fallback definition of \cs{caption@@eh} added}
% |\captiontwo@Error|\marg{message}\\
% issues an error message (with code line indication).
% \begin{macrocode}
\newcommand*\captiontwo@Error[2][]{%
\PackageError{caption2}{#2}{#1\caption@@eh{caption2}}}
% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\caption@@eh[1]{%
+ If you do not understand this error, please take a closer look\MessageBreak
+ at the documentation of the `#1' package, especially the\MessageBreak
+ section about errors.\MessageBreak\@ehc}
+% \end{macrocode}
% \end{macro}
%
% \subsection{Check against the regular caption package}
@@ -280,7 +291,17 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\captionwidth}
+% \changes{v2.2h}{2021/01/19}{Re-added since the \package{caption3} kernel uses \cs{caption@width} now}
+% \begin{macrocode}
+\@ifundefined{captionwidth}
+ {\let\captionwidth\caption@width}
+ {}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\ifcaptionwidth}
+% \changes{v2.2}{2007/04/06}{New implementation, based on \cs{captionwidth}}
% Either \cs{captionmargin} (with specifies an extra margin) or \cs{captionwidth}
% (with specifies an explicit width) can be set, therefore we need the flag \cs{ifcaptionwidth}
% to determine with parameter we should pay attention to.
@@ -291,19 +312,22 @@
%
% \begin{macro}{\captionindent}
% \changes{v2.2b}{2007/08/12}{Re-added since the \package{caption3} kernel uses \cs{caption@indent} now}
+% \changes{v2.2g}{2020/12/25}{Will only be defined if it is not defined yet}
% \cs{captionindent} will be used in caption style \texttt{indent} and specifies the indention
-% after the first line.
+% after the first line. (In \package{caption3} \version{1.1} \cs{captionindent} was renamed to
+% \cs{caption@indent} to improve compatibility to the AMS \& SMF document classes.)
% \begin{macrocode}
-\let\captionindent\caption@indent
+\@ifundefined{captionindent}
+ {\let\captionindent\caption@indent}
+ {}
% \end{macrocode}
% \end{macro}
%
-% \changes{v2.1}{2002/02/20}{New ifs \cs{ifcaptionlabel} and \cs{ifignoreLTcapwidth}}
-%
% \begin{macro}{\ifcaptionlabel}
+% \changes{v2.1}{2002/02/20}{New switch \cs{ifcaptionlabel}}
% If \cs{ifcaptionlabel} is not set the caption label should be suppressed;
% we need this flag to support the \cs{caption*} command.
-% \changes{v2.2}{2007/04/06}{New definition, based on \cs{ifcaption@star}}
+% \changes{v2.2}{2007/04/06}{New implementation, based on \cs{ifcaption@star}}
% \begin{macrocode}
\def\ifcaptionlabel{%
\ifcaption@star
@@ -331,12 +355,30 @@
% \end{macro}
%
% \begin{macro}{\ifignoreLTcapwidth}
+% \changes{v2.1}{2002/02/20}{New switch \cs{ifignoreLTcapwidth}}
% If \cs{ifignoreLTcapwidth} is set we ignore the \cs{LTcapwidth} of \textsf{longtable}.
% \begin{macrocode}
\newif\ifignoreLTcapwidth
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\setcaptionmargin}
+% \changes{v2.2h}{2021/01/19}{Re-added since the \package{caption3} kernel does not define it anymore}
+% \begin{macro}{\setcaptionwidth}
+% \changes{v2.2h}{2021/01/19}{Re-added since the \package{caption3} kernel does not define it anymore}
+% User-friendly commands to set the caption margin resp.\ width.
+% Note that they additionally set the \cs{ifcaptionwidth} flag.
+% \begin{macrocode}
+\providecommand*\setcaptionmargin{%
+ \setlength\captionwidth\z@
+ \setlength\captionmargin}
+\providecommand*\setcaptionwidth{%
+ \setlength\captionmargin\z@
+ \setlength\captionwidth}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\normalcaptionparams}
% \cs{normalcaptionparams} resets all caption related parameters to it's normal default values.
% \cs{captionfont} will be set to \cs{captionsize} so setting the obsolete \cs{captionsize} will still work.
@@ -667,6 +709,7 @@
% of the package given in parameter \#1, a value of 0 will deactivate it.
% \begin{macrocode}
\newcommand*\caption@setpackage[1]{\@namedef{caption@pkt@#1}}
+\@onlypreamble\caption@setpackage
% \end{macrocode}
% \end{macro}
%
@@ -692,7 +735,8 @@
% \begin{macro}{all}
% These options will enable or suppress the support of all the above packages.
% \begin{macrocode}
-\DeclareOption{none}{\caption@twozerofalse
+\DeclareOption{none}{%
+ \caption@twozerofalse
\caption@setpackage{float}{0}\caption@setpackage{longtable}{0}%
\caption@setpackage{subfigure}{0}}
\DeclareOption{all}{\ExecuteOptions{float,longtable,subfigure}}
@@ -721,13 +765,6 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{debug}
-% This option will put additional debug information in the log file.
-% \begin{macrocode}
-\DeclareOption{debug}{\caption@setup{debug}}
-% \end{macrocode}
-% \end{macro}
-%
% \subsection{Execution of options}
%
% Now we set the default values and start processing the options.
@@ -767,9 +804,9 @@
% (like \textsf{ucthesis}), so we do it here if not already done.
% \changes{v2.1}{2002/02/19}{\cs{abovecaptionskip} and \cs{belowcaptionskip} will be defined if neccessary}
% \begin{macrocode}
-\caption@ifundefined\abovecaptionskip{%
+\@ifundefined{abovecaptionskip}{%
\newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@}}{}
-\caption@ifundefined\belowcaptionskip{%
+\@ifundefined{belowcaptionskip}{%
\newlength\belowcaptionskip\setlength\belowcaptionskip{0\p@}}{}
% \end{macrocode}
% \end{macro}
@@ -783,7 +820,7 @@
% These values are only set and used within the caption code itself.
% \cs{captionlinewidth} will be set to the given vertical space for the caption,
% normally this is \cs{linewidth}. (This value was called \cs{realcaptionwidth}
-% within \thispackage\ \mbox{2.0}, so we will offer this, too.)
+% within \thispackage\ \version{2.0}, so we will offer this, too.)
%
% \cs{captionlabel} and \cs{captiontext} will be set to the caption label
% resp.\ the caption text.
@@ -845,7 +882,7 @@
% If we are we call the appropriate caption definition.
% \begin{macrocode}
\newcommand*\usecaptionstyle[1]{%
- \caption@ifundefined\captiontext{%
+ \@ifundefined{captiontext}{%
\captiontwo@Error
[The usage of \protect#1 is only
allowed inside code declared with\MessageBreak \protect\defcaptionstyle,
@@ -861,7 +898,7 @@
% \end{macro}
%
% \begin{macro}{\@makecaption}
-% This is the heart of the \thispackage\ package -- the redefinition of the
+% This is the heart of the \thispackage{} -- the redefinition of the
% core caption code. It was taken from the \LaTeXe\ standard classes and modified.
% It's very easy -- apart from using \cs{abovecaptionskip} and \cs{belowcaptionskip}
% we just set \cs{captionlinewidth}, \cs{captionlabel} and \cs{captiontext}
@@ -882,45 +919,41 @@
% \subsection{Support of other packages}
%
% \begin{macro}{\caption@ifpackage}
-% This macro will execute the code needed to support the package
-% named within argument \#1. The parameter \#2 is the command
-% which shows if the package is loaded -- it is defined, it is
-% already loaded, otherwise not. The parameter \#3 contains code
-% which will be executed if no support is required -- this is for
-% cleanup purposes. The final parameter \#4 contains the code itself.
+% This macro will execute the code needed to support the package named within
+% argument \#1.
+% The parameter \#2 contains code which will be executed if the package is loaded.
+% The parameter \#3 contains code which will be executed if no support is
+% required -- this is for cleanup purposes.
% \changes{v2.1c}{2004/05/09}{Compatibility warning removed}
+% \changes{v2.2i}{2021/01/20}{Interface and code revised (uses \cs{@ifpackageloaded} now)}
% \begin{macrocode}
-\newcommand*\caption@ifpackage[3]{%
- \if1\@nameuse{caption@pkt@#1}%
- \@ifundefined{#2}%
- {\let\next\AtBeginDocument}%
- {\let\next\@firstofone}%
- \else\ifcaption@twozero
- \@ifundefined{#2}%
- {#3\let\next\@gobble}%
- {\let\next\@firstofone}%
+\newcommand\caption@ifpackage[3]{%
+ \ifcaption@twozero
+ \let\next\@firstofone
+ \else\if1\@nameuse{caption@pkt@#1}%
+ \def\next{\@ifpackageloaded{#1}\@firstofone\AtBeginDocument}%
\else
- #3\let\next\@gobble
+ \PackageInfo{caption2}{#1 package is disabled}%
+ #3%
+ \let\next\@gobble
\fi\fi
- \expandafter\let\csname caption@pkt@#1\endcsname\undefined
- \caption@ifdebug{%
- \ifx\next\@gobble\PackageInfo{caption2}{#1 => gobble}%
- \else\ifx\next\@firstofone\PackageInfo{caption2}{#1 => firstofone}%
- \else\ifx\next\AtBeginDocument\PackageInfo{caption2}{#1 => AtBeginDocument}%
- \fi\fi\fi}{}%
- \next}
+ \@nameundef{caption@pkt@#1}%
+% \end{macrocode}
+% \begin{macrocode}
+ \next{%
+ \@ifpackageloaded{#1}{%
+ \PackageInfo{caption2}{#1 package is loaded}%
+ #2}{%
+ \PackageInfo{caption2}{#1 package is not loaded}%
+ #3}}}
+\@onlypreamble\caption@ifpackage
% \end{macrocode}
% \end{macro}
%
% \subsubsection{Support of the float package}
%
% \begin{macrocode}
-\caption@ifpackage{float}{floatc@plain}{}{%
- \ifx\floatc@plain\relax
- \PackageWarning{caption2}{%
- Option `float' was set but there is no float package loaded}
- \else
- \PackageInfo{caption2}{float package v1.2 (or newer) detected}
+\caption@ifpackage{float}{%
% \end{macrocode}
%
% \begin{macro}{\caption@floatc}
@@ -936,15 +969,15 @@
%
% \changes{v2.1b}{2004/03/19}{\cs{realcaptionwidth}$=$\cs{hsize} was missing here}
% \begin{macrocode}
- \newcommand\caption@floatc[3]{%
- \ifx\captionlabelfont\@empty
- \let\captionlabelfont\@fs@cfont
- \fi
- \captionlinewidth\hsize
- \realcaptionwidth\hsize
- \def\captionlabel{#2}%
- \def\captiontext{#3}%
- \usecaptionstyle{#1}}
+ \newcommand\caption@floatc[3]{%
+ \ifx\captionlabelfont\@empty
+ \let\captionlabelfont\@fs@cfont
+ \fi
+ \captionlinewidth\hsize
+ \realcaptionwidth\hsize
+ \def\captionlabel{#2}%
+ \def\captiontext{#3}%
+ \usecaptionstyle{#1}}%
% \end{macrocode}
% \end{macro}
%
@@ -954,7 +987,7 @@
% \texttt{plain} and \texttt{boxed} float types will use the actual
% caption style set by the user.
% \begin{macrocode}
- \renewcommand*\floatc@plain{\caption@floatc{\caption@style}}
+ \renewcommand*\floatc@plain{\caption@floatc{\caption@style}}%
% \end{macrocode}
% \end{macro}
%
@@ -968,17 +1001,17 @@
% Then we redefine \cs{floatc@ruled} so the caption style `ruled' will
% be used.
% \begin{macrocode}
- \ifcaption@ruled
- \dummycaptionstyle{ruled}{\onelinecaptionsfalse\setcaptionmargin{\z@}}%
- \else
- \newcaptionstyle{ruled}{%
- \ifcaptionlabel
- {\@fs@cfont\captionlabel}\space%
- \fi\captiontext\par}%
- \fi
+ \ifcaption@ruled
+ \dummycaptionstyle{ruled}{\onelinecaptionsfalse\setcaptionmargin{\z@}}%
+ \else
+ \newcaptionstyle{ruled}{%
+ \ifcaptionlabel
+ {\@fs@cfont\captionlabel}\space%
+ \fi\captiontext\par}%
+ \fi
% \end{macrocode}
% \begin{macrocode}
- \renewcommand*\floatc@ruled{\caption@floatc{ruled}}
+ \renewcommand*\floatc@ruled{\caption@floatc{ruled}}%
% \end{macrocode}
% \end{macro}
%
@@ -1005,37 +1038,33 @@
% group again so the original \cs{@fs@capt} is happy with closing the group.
%
% \begin{macrocode}
- \renewcommand*\caption@of[2]{\def\@captype{#2}%
- \@ifundefined{fst@#2}{}{%
- \@nameuse{fst@#2}%
- \caption@ifundefined\@float@setevery{}{\@float@setevery{#2}}%
- \let\caption@fs@capt\@fs@capt
- \let\@fs@capt\caption@of@float}%
- #1}
+ \renewcommand*\caption@of[2]{%
+ \def\@captype{#2}%
+ \@ifundefined{fst@#2}{}{%
+ \@nameuse{fst@#2}%
+ \@ifundefined{@float@setevery}{}{\@float@setevery{#2}}%
+ \let\caption@fs@capt\@fs@capt
+ \let\@fs@capt\caption@of@float}%
+ #1}%
% \end{macrocode}
%
% \begin{macrocode}
- \newcommand\caption@of@float[2]{\egroup
- \vskip\abovecaptionskip
- \normalsize\caption@fs@capt{#1}{#2}%
- \vskip\belowcaptionskip
- \bgroup}%
+ \newcommand\caption@of@float[2]{\egroup
+ \vskip\abovecaptionskip
+ \normalsize\caption@fs@capt{#1}{#2}%
+ \vskip\belowcaptionskip
+ \bgroup}%
% \end{macrocode}
% \end{macro}
%
% \begin{macrocode}
- \fi}
+}{}
% \end{macrocode}
%
% \subsubsection{Support of the longtable package}
%
% \begin{macrocode}
-\caption@ifpackage{longtable}{LT@makecaption}{}{%
- \ifx\LT@makecaption\relax
- \PackageWarning{caption2}{%
- Option `longtable' was set but there is no longtable package loaded}
- \else
- \PackageInfo{caption2}{longtable package v3.15 (or newer) detected}
+\caption@ifpackage{longtable}{%
% \end{macrocode}
%
% \begin{macro}{\LT@makecaption}
@@ -1058,28 +1087,28 @@
% (Remember: |#1| is |\@gobble| in star form of |\caption|,
% and |\@firstofone| otherwise.)
% \begin{macrocode}
- \dummycaptionstyle{longtable}{}
+ \dummycaptionstyle{longtable}{}%
% \end{macrocode}
% \begin{macrocode}
- \renewcommand\LT@makecaption[3]{%
- \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\hsize{%
- \ifignoreLTcapwidth
- \else
- \setcaptionwidth\LTcapwidth
- \fi
- \captionlinewidth\hsize
- \realcaptionwidth\hsize
- \captionlabelfalse#1\captionlabeltrue
- \def\captionlabel{#2}%
- \def\captiontext{#3}%
- \usecaptionstyle{longtable}%
- \endgraf\vskip\baselineskip}%
- \hss}}}
+ \renewcommand\LT@makecaption[3]{%
+ \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\hsize{%
+ \ifignoreLTcapwidth
+ \else
+ \setcaptionwidth\LTcapwidth
+ \fi
+ \captionlinewidth\hsize
+ \realcaptionwidth\hsize
+ \captionlabelfalse#1\captionlabeltrue
+ \def\captionlabel{#2}%
+ \def\captiontext{#3}%
+ \usecaptionstyle{longtable}%
+ \endgraf\vskip\baselineskip}%
+ \hss}}}%
% \end{macrocode}
% \end{macro}
%
% \begin{macrocode}
- \fi}
+}{}
% \end{macrocode}
%
% \subsubsection{Support of the subfigure package}
@@ -1091,13 +1120,8 @@
%
% \begin{macro}{\setsubcapstyle}
% This sets the subcaptionstyle to a appropriate value.
-%
-% If \cs{ifsubcapraggedright} is undefined (it was introduced
-% into v2.1 of the \textsf{subfigure} package) we define it first.
% \begin{macrocode}
\newcommand*\setsubcapstyle{%
- \caption@ifundefined\subcapraggedrightfalse{%
- \newif\ifsubcapraggedright}{}%
\ifsubcaphang
\ifsubcapcenter
\subcapstyle{hang+center}%
@@ -1118,6 +1142,13 @@
\subcapstyle{normal}%
\fi\fi\fi\fi}
% \end{macrocode}
+% If \cs{ifsubcapraggedright} is undefined (it was introduced
+% in \version{2.1} of the \textsf{subfigure} package) we define it first.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \@ifundefined{subcapraggedrightfalse}{%
+ \newif\ifsubcapraggedright}{}}
+% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@makesubcaption}
@@ -1188,15 +1219,7 @@
% the helper macros in the garbage can.
%
% \begin{macrocode}
-\caption@ifpackage{subfigure}{@makesubfigurecaption}{%
- \let\setsubcapstyle\undefined
- \let\caption@makesubcaption\undefined}{%
- \ifx\@makesubfigurecaption\relax
- \PackageWarning{caption2}{%
- Option `subfigure' was set but there is no subfigure package loaded}
- \let\setsubcapstyle\undefined
- \let\caption@makesubcaption\undefined
- \else
+\caption@ifpackage{subfigure}{%
% \end{macrocode}
%
% Some stuff has changed from version 2.0 to 2.1 of the
@@ -1205,15 +1228,15 @@
% otherwise we assume v2.1 or newer.
%
% \begin{macrocode}
- \ifx\subcapfont\undefined
- \PackageInfo{caption2}{subfigure package v2.0 detected}
+ \ifx\subcapfont\@undefined
+ \PackageInfo{caption2}{subfigure package v2.0 detected}%
% \end{macrocode}
%
% \begin{macro}{\subcapfont}
% We define \cs{subcapfont} here so we can use it later
% in common code for \textsf{subfigure} v2.0 and v2.1 (or newer).
% \begin{macrocode}
- \let\subcapfont\@empty
+ \let\subcapfont\@empty
% \end{macrocode}
% \end{macro}
%
@@ -1227,13 +1250,13 @@
% Note: \cs{subfigcapmargin} is a command in v2.0 of \textsf{subfigure}.
% So we make \cs{subfigcapwidth} a command, too.
% \begin{macrocode}
- \newcommand*\subfigcapwidth{\z@}
- \newcommand*\setsubcapmargin{%
- \subfigcapwidthfalse
- \renewcommand*\subfigcapmargin}
- \newcommand*\setsubcapwidth{%
- \subfigcapwidthtrue
- \renewcommand*\subfigcapwidth}
+ \newcommand*\subfigcapwidth{\z@}%
+ \newcommand*\setsubcapmargin{%
+ \subfigcapwidthfalse
+ \renewcommand*\subfigcapmargin}%
+ \newcommand*\setsubcapwidth{%
+ \subfigcapwidthtrue
+ \renewcommand*\subfigcapwidth}%
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1242,20 +1265,20 @@
% \begin{macro}{\subcaplabelsep}
% Analogous to \cs{captionlabelsep} we define \cs{subcaplabelsep}.
% \begin{macrocode}
- \newcommand*\subcaplabelsep{\space}
+ \newcommand*\subcaplabelsep{\space}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@subfig@hss}
% This will be uses within the caption code itself.
% \begin{macrocode}
- \let\caption@subfig@hss\hfil
+ \let\caption@subfig@hss\hfil
% \end{macrocode}
% \end{macro}
%
% \begin{macrocode}
- \else
- \PackageInfo{caption2}{subfigure package v2.1 (or newer) detected}
+ \else
+ \PackageInfo{caption2}{subfigure package v2.1 (or newer) detected}%
% \end{macrocode}
%
% \begin{macro}{\subfigcapwidth}
@@ -1268,13 +1291,13 @@
% Note: \cs{subfigcapmargin} is a length in v2.1 of \textsf{subfigure}.
% So we make \cs{subfigcapwidth} a length, too.
% \begin{macrocode}
- \newdimen\subfigcapwidth
- \newcommand*\setsubcapmargin{%
- \subfigcapwidthfalse
- \setlength\subfigcapmargin}
- \newcommand*\setsubcapwidth{%
- \subfigcapwidthtrue
- \setlength\subfigcapwidth}
+ \newdimen\subfigcapwidth
+ \newcommand*\setsubcapmargin{%
+ \subfigcapwidthfalse
+ \setlength\subfigcapmargin}%
+ \newcommand*\setsubcapwidth{%
+ \subfigcapwidthtrue
+ \setlength\subfigcapwidth}%
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1283,19 +1306,19 @@
% \begin{macro}{\subcaplabelsep}
% Analogous to \cs{captionlabelsep} we define \cs{subcaplabelsep}.
% \begin{macrocode}
- \newcommand*\subcaplabelsep{\hskip\subfiglabelskip}
+ \newcommand*\subcaplabelsep{\hskip\subfiglabelskip}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@subfig@hss}
% This will be uses within the caption code itself.
% \begin{macrocode}
- \let\caption@subfig@hss\hss
+ \let\caption@subfig@hss\hss
% \end{macrocode}
%
% \end{macro}
% \begin{macrocode}
- \fi
+ \fi
% \end{macrocode}
%
% Here starts the common code for \textsf{subfigure} v2.0 and v2.1.
@@ -1306,9 +1329,9 @@
% Analogous to \cs{ifcaptionwidth}, \cs{captionindent} \& \cs{captionlabeldelim}
% we define \cs{ifsubfigcapwidth}, \cs{subcapindent} \& \cs{subcaplabeldelim}
% \begin{macrocode}
- \newif\ifsubfigcapwidth
- \newdimen\subcapindent
- \newcommand*\subcaplabeldelim{}
+ \newif\ifsubfigcapwidth
+ \newdimen\subcapindent
+ \newcommand*\subcaplabeldelim{}%
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1319,13 +1342,13 @@
% Analogous to \cs{captionstyle} we define \cs{subcapstyle}
% and set it (via \cs{setsubcapstyle}) to a appropriate value.
% \begin{macrocode}
- \newcommand*\subcapstyle[1]{%
- \expandafter\ifx\csname caption@@#1\endcsname\relax
- \captiontwo@Error{Undefined caption style `#1'}%
- \else
- \def\caption@substyle{#1}%
- \fi}
- \setsubcapstyle
+ \newcommand*\subcapstyle[1]{%
+ \expandafter\ifx\csname caption@@#1\endcsname\relax
+ \captiontwo@Error{Undefined caption style `#1'}%
+ \else
+ \def\caption@substyle{#1}%
+ \fi}%
+ \setsubcapstyle
% \end{macrocode}
% \end{macro}
%
@@ -1338,8 +1361,8 @@
% to be just the plain label and nothing else.
%
% \begin{macrocode}
- \renewcommand*\@thesubfigure{\thesubfigure}
- \renewcommand*\@thesubtable{\thesubtable}
+ \renewcommand*\@thesubfigure{\thesubfigure}%
+ \renewcommand*\@thesubtable{\thesubtable}%
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1348,20 +1371,17 @@
% \begin{macro}{\@makesubtablecaption}
% Now we are ready to redefine \cs{@makesubfigurecaption}.
% \begin{macrocode}
- \let\@makesubfigurecaption\caption@makesubcaption
- \let\@makesubtablecaption\caption@makesubcaption
+ \let\@makesubfigurecaption\caption@makesubcaption
+ \let\@makesubtablecaption\caption@makesubcaption
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macrocode}
- \fi}
-% \end{macrocode}
-%
-% That's all folks!
-%
-% \begin{macrocode}
-\let\caption@ifpackage\undefined
+}{%
+ \let\setsubcapstyle\@undefined
+ \let\caption@makesubcaption\@undefined
+}
% \end{macrocode}
%
% \iffalse
diff --git a/Master/texmf-dist/source/latex/caption/caption3.dtx b/Master/texmf-dist/source/latex/caption/caption3.dtx
index 96b2bc8ea95..5c91c87aa69 100644
--- a/Master/texmf-dist/source/latex/caption/caption3.dtx
+++ b/Master/texmf-dist/source/latex/caption/caption3.dtx
@@ -2,7 +2,7 @@
%
% This is file `caption3.dtx'.
%
-% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+% Copyright (C) 1994-2022 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
%
% --------------------------------------------------------------------------
%
@@ -27,17 +27,16 @@
% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
-% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
-% and the user manuals
-% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty.
%
% \fi
-% \CheckSum{3674}
+%
+% \CheckSum{3781}
%
% \iffalse
%<*driver>
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesFile{caption3.drv}[2020/10/11 v2.2 Implementation of the caption kernel]
+\ProvidesFile{caption3.drv}[2021/01/02 v2.3 Implementation of the caption kernel]
\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
%\errorcontextlines=3
%
@@ -61,7 +60,7 @@
\ifpdf\usepackage{hypdestopt}\fi
\hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}}
%
-\usepackage{caption3}[2020/09/12]
+\usepackage{caption3}[2020/12/22]
%
\DeclareRobustCommand*\eTeX{\texorpdfstring
{\leavevmode\hbox{$\varepsilon$}-\TeX}%
@@ -110,7 +109,7 @@
% called |\@makecaption| and no options to control its behavior (except the
% vertical skips above and below the caption itself), we provide similar
% commands called |\caption@make| and |\caption@@make|, but with a lot of
-% options which can be selected with |\captionsetup|.
+% options which can be selected with |\caption|\-|setup|.
% Loading the kernel part do not change the output of a \LaTeX\ document
% -- it just provides functionality which can be used by \LaTeXe\ packages
% which typesets captions, for example the \package{caption} and
@@ -122,18 +121,20 @@
% These internal commands are save to use by other packages as well
% since their interface will not change in future releases:
% \begin{quote}\begin{tabular}{ll}
-% Internal command & Currently used by \\
+% Internal command & Currently used by \\
% \hline
-% |\caption@addcontentsline| & \package{floatrow} \\
-% |\caption@fnun| & \package{floatrow} \\
-% |\caption@ifinlist| & \package{floatrow} \\
-% |\caption@iftop| & \package{keyfloat}, \package{subfig} \\
-% |\caption@make| & \package{subfig} \\
-% |\caption@@make| & \package{floatrow} \\
-% |\caption@setautoposition| & \package{bidi} \\
-% |\caption@setoptions| & \package{floatrow} \\
-% |\caption@setposition| & \package{floatrow} \\
-% |\caption@switchdefault| & \emph{none} \\
+% |\caption@addcontentsline| & \package{floatrow} \\
+% |\caption@fnun| & \package{floatrow} \\
+% |\caption@getlabel| & \package{subcaption} \\
+% |\caption@gobble| & \package{subcaption} \\
+% |\caption@ifinlist| & \package{floatrow} \\
+% |\caption@iftop| & \package{keyfloat} \\
+% |\caption@make| & \package{subfig} \\
+% |\caption@@make| & \package{floatrow} \\
+% |\caption@setoptions| & \package{floatrow} \\
+% |\caption@setposition| & \package{floatrow} \\
+% |\caption@switchdefault| & \emph{none} \\
+% |\caption@withoptargs| & \package{subcaption} \\
% \end{tabular}\end{quote}
%
% If your package wants to use any other internal command of the \package{caption3} package,
@@ -143,21 +144,18 @@
% not change in the future, too, but I do not support them (and maybe I will change them anyway
% and patch the other package on-the-fly instead, at least if it's unmaintained):
% \begin{quote}\begin{tabular}{ll}
-% Internal command & Currently used by \\
+% Internal command & Currently used by \\
% \hline
-% |\caption@hangindent | & \package{bidi} \\
-% |\caption@@@make| & \package{floatrow} \\
-% |\caption@@par| & \package{bidi} \\
-% |\caption@parindent| & \package{bidi} \\
-% |\caption@set@bool| & \package{floatrow} \\
-% |\caption@setfont| & \package{floatrow} \\
-% |\caption@setkeys| & \package{floatrow} \\
-% |\caption@setstyle*| & \package{floatrow} \\
+% |\caption@@@make| & \package{floatrow} \\
+% |\caption@set@bool| & \package{floatrow} \\
+% |\caption@setfont| & \package{floatrow} \\
+% |\caption@setkeys| & \package{floatrow} \\
+% |\caption@setstyle*| & \package{floatrow} \\
% \hline
-% |\caption@hj@|\meta{name} & \package{floatrow} \\
-% |\caption@lsep@|\meta{name} & \package{floatrow} \\
+% |\caption@hj@|\meta{name} & \package{floatrow} \\
+% |\caption@lsep@|\meta{name} & \package{floatrow} \\
% |\caption@lsep@default| & \package{babel-hungarian} \\
-% |\caption@sty@|\meta{name} & \package{floatrow} \\
+% |\caption@sty@|\meta{name} & \package{floatrow} \\
% \end{tabular}\end{quote}
%
% Furthermore the \package{floatrow} package uses the undocumented option
@@ -198,6 +196,7 @@
% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\kernel@ifnextchar}
% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
@@ -240,9 +239,32 @@
%
% \section{Identification}
%
+% We need at least \LaTeX2e\ version 1994/12/01.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption3}[2020/10/21 v2.2e caption3 kernel (AR)]
+% \end{macrocode}
+%
+% Bypass the release declarations in case the \LaTeX\ kernel doesn’t know how to deal with them
+% (as suggested by \url{https://www.latex-project.org/publications/2018-FMi-TUB-tb122mitt-version-rollback.pdf}).
+% \begin{macrocode}
+\providecommand\DeclareRelease[3]{}
+\providecommand\DeclareCurrentRelease[2]{}
+% \end{macrocode}
+%
+% Declare all supported releases.
+% \begin{macrocode}
+\DeclareRelease{v1.0} {2003-12-20}{caption3_2007-04-11.sty} % for caption v3.0
+\DeclareRelease{v1.1} {2007-09-01}{caption3_2010-01-14.sty} % for caption v3.1
+\DeclareRelease{v1.3} {2011-08-06}{caption3_2011-11-01.sty} % for caption v3.2
+\DeclareRelease{v1.8} {2013-01-10}{caption3_2019-09-01.sty} % for caption v3.3
+\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
+% \end{macrocode}
+%
+% Identify the current version of the package.
+% \begin{macrocode}
+\ProvidesPackage{caption3}[2022/01/07 v2.3 caption3 kernel (AR)]
% \end{macrocode}
%
% \section{Generic helpers}
@@ -1428,6 +1450,7 @@
%
% \begin{macro}{\DeclareCaptionLength}
% \changes{v2.0}{2020/08/09}{This macro added}
+% \changes{v2.3}{2021/01/17}{Now defines \cs{caption@xxx} instead of \cs{captionxxx} as length}
% |\DeclareCaptionLength|\marg{name}\marg{default value}\\
% \begin{enumerate}
% \item Defines a new length (dimension)
@@ -1438,9 +1461,8 @@
% \end{enumerate}
% \begin{macrocode}
\newcommand*\DeclareCaptionLength[1]{%
- \expandafter\newdimen\csname caption#1\endcsname
- \@namedef{caption@setdefault@#1}##1{%
- \caption@setdefault@length{##1}}%
+ \expandafter\newdimen\csname caption@#1\endcsname
+ \@namedef{caption@setdefault@#1}{\caption@setdefault@length}%
\SetCaptionDefault*{#1}}
\@onlypreamble\DeclareCaptionLength
% \end{macrocode}
@@ -1448,59 +1470,94 @@
%
% \begin{macro}{\caption@setdefault@length}
% \changes{v2.0}{2020/08/09}{This macro added}
+% \changes{v2.3}{2021/01/17}{Adapted to current implementation of \cs{DeclareCaptionLength}}
% |\caption@setdefault@length*|\marg{cmd}\marg{name}\marg{value}\\
% sets a default value for the given \meta{length}, either using |\def|
% (if the starred variant is used) or |\edef| (if the non-starred variant is
% used).
% \begin{macrocode}
\newcommand*\caption@setdefault@length[3]{%
- \expandafter#1\csname caption#2@default\endcsname{#3}}
+ \expandafter#1\csname caption@#2@default\endcsname{#3}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@setlength}
% \changes{v2.0}{2020/08/09}{This macro added}
+% \changes{v2.3}{2021/01/17}{Adapted to current implementation of \cs{DeclareCaptionLength}}
% |\caption@setlength|\marg{name}\marg{value}\\
% sets a length to either the given \meta{value} or to the default value if
% \meta{value} is `default'.
% \begin{macrocode}
\newcommand*\caption@setlength[2]{%
\caption@ifdefault{#2}%
- {\expandafter\let\expandafter\caption@tempa\csname caption#1@default\endcsname}%
+ {\expandafter\let\expandafter\caption@tempa\csname caption@#1@default\endcsname}%
{\def\caption@tempa{#2}}%
- \expandafter\setlength\csname caption#1\endcsname\caption@tempa}
+ \expandafter\setlength\csname caption@#1\endcsname\caption@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@tempdima}
+% |\caption@tempdima| will be used as temporary dimension register, similar to |\@tempdima|.
+% \begin{macrocode}
+\newdimen\caption@tempdima
% \end{macrocode}
% \end{macro}
%
% \section{Margin resp. width}
-% \changes{v1.0n}{2007/04/01}{\cs{captionmarginx} renamed to \cs{captionmargin@}}
% \changes{v1.0n}{2007/04/03}{Option `twoside' added}
% \changes{v1.1}{2007/08/11}{Options `margin*', `minmargin', and `maxmargin' added}
% \changes{v1.2}{2007/11/10}{Option `oneside' added}
%
% \begin{macro}{\captionmargin}
-% \begin{macro}{\captionwidth}
-% |\captionmargin| and |\captionwidth| contain the extra margin
-% resp. the total width used for captions. Please never set these values in
-% a direct way, they are just accessible in user documents to provide
-% compatibility to \version{1.x} of the \package{caption} package.\par
-% Note that we can only set one value at a time, `margin' \emph{or} `width'.
-% If |\caption|\-|width| is not zero we will take this value afterwards,
-% otherwise |\caption|\-|margin| and |\caption|\-|margin@|.
+% |\captionmargin| contains the extra margin used for captions (if different than |0pt|).
+% It is just available for user documents to provide compatibility to \version{1.x} of
+% the \package{caption} package where |\set|\-|length\caption|\-|margin{|\ldots|}| was
+% the way how a caption margin was set.
% \begin{macrocode}
-\DeclareCaptionLength{margin}{0pt}
-\DeclareCaptionLength{margin@}{\the\captionmargin}
-\DeclareCaptionLength{width}{0pt}
-\newdimen\caption@tempdima
+\newdimen\captionmargin
+\setlength\captionmargin{0pt}
+% \end{macrocode}
+% |\SetCaptionDefault{margin}{|\ldots|}| sets both default values,
+% i.e.~for the left and for the right margin.
+% \begin{macrocode}
+\newcommand\caption@setdefault@margin[3]{%
+ \caption@setdefault@length{#1}{left#2}{#3}%
+ \caption@setdefault@length{#1}{right#2}{#3}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@leftmargin}
+% \changes{v1.0n}{2007/04/01}{\cs{captionmarginx} renamed to \cs{captionmargin@}}
+% \changes{v2.3}{2021/01/17}{\cs{captionmargin@} replaced by \cs{caption@leftmargin} and \cs{caption@rightmargin}}
+% \begin{macro}{\caption@rightmargin}
+% \changes{v1.0n}{2007/04/01}{\cs{captionmarginx} renamed to \cs{captionmargin@}}
+% \changes{v2.3}{2021/01/17}{\cs{captionmargin@} replaced by \cs{caption@leftmargin} and \cs{caption@rightmargin}}
+% |\caption@leftmargin| and |\caption@rightmargin| contain the extra margin used for captions.
+% (These values will be used if the obsolete |\caption|\-|margin| is set to |0pt|.)
+% \begin{macrocode}
+\DeclareCaptionLength{leftmargin}{0pt}
+\DeclareCaptionLength{rightmargin}{0pt}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\caption@width}
+% \changes{v2.3}{2021/01/17}{This dimension renamed from \cs{captionwidth} to \cs{caption@width}}
+% |\caption@width| contains the total width used for captions.
+% Note that we can only set one value at a time, `margin' \emph{or} `width'.
+% If |\caption|\-|@width| is not zero we will take this value,
+% otherwise |\caption|\-|@left|\-|margin| and |\caption|\-|@right|\-|margin|.
% \begin{macrocode}
-\DeclareCaptionOption{margin}{\setcaptionmargin{#1}}
-\DeclareCaptionOption{margin*}{\setcaptionmargin*{#1}}
-\DeclareCaptionOption{width}{\setcaptionwidth{#1}}
-\DeclareCaptionOption{width*}{\setcaptionwidth*{#1}}
+\newdimen\caption@width
+\setlength\caption@width{0pt}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{margin}{\caption@setmargin{#1}}
+\DeclareCaptionOption{margin*}{\caption@setmargin*{#1}}
+\DeclareCaptionOption{width}{\caption@setwidth{#1}}
+\DeclareCaptionOption{width*}{\caption@setwidth*{#1}}
% \end{macrocode}
% \begin{macrocode}
\DeclareCaptionOption{calcmargin}{\caption@setcalcmargin{#1}}
@@ -1518,71 +1575,82 @@
\DeclareCaptionOption{maxmargin}{\caption@setoptcmd\caption@maxmargin{#1}}
% \end{macrocode}
%
-% \begin{macro}{\setcaptionmargin}
+% \begin{macro}{\caption@setmargin}
% \changes{v1.0f}{2005/10/24}{Renamed from \cs{caption@setmargin} to \cs{setcaptionmargin}}
% \changes{v1.0f}{2005/10/24}{\cs{setcaptionmargin} enhanced so it can take left+right margin}
% \changes{v1.1}{2007/08/11}{Starred variant added}
% \changes{v1.1}{2007/08/12}{\cs{setlength}\cs{captionmargin} \& \cs{setlength}\cs{captionmargin@} swapped so `\texttt{margin*=}\cs{captionmargin}' works in singleline options}
% \changes{v1.3}{2010/11/07}{Support for option \opt{calcmargin} added}
-% |\setcaptionmargin*|\marg{amount}\\
+% \changes{v2.3}{2021/01/17}{Renamed from \cs{setcaptionmargin} to \cs{caption@setmargin}; sets \cs{caption@width} resp.~\cs{caption@leftmargin} and \cs{caption@rightmargin} now}
+% \changes{v2.3}{2021/01/19}{Only the left or right margin can be set by leaving the other value blank}
+% |\caption@setmargin*|\marg{amount}\\
% sets the caption margin to the given \meta{amount}.
-% Please never use this in user documents, it's just there to
-% provide compatibility to the \package{caption2} package.
% \begin{macrocode}
-\newcommand*\setcaptionmargin{%
+\newcommand*\caption@setmargin{%
\caption@resetcalcmargin
- \caption@setmargin}
+ \caption@@setmargin}
% \end{macrocode}
% \begin{macrocode}
-\newcommand*\caption@setmargin{%
- \caption@teststar\caption@@setmargin\@gobble\@firstofone}
+\newcommand*\caption@@setmargin{%
+ \caption@teststar\caption@@@setmargin\@gobble\@firstofone}
% \end{macrocode}
% \begin{macrocode}
-\newcommand*\caption@@setmargin[2]{%
- #1{\captionwidth\z@}%
- \caption@@@setmargin#2,#2,\@nil}
+\newcommand*\caption@@@setmargin[2]{%
+ #1{\caption@width\z@}%
+ \caption@@@@setmargin#2,#2,\@nil}
+% \end{macrocode}
+% \begin{macrocode}
+\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}
% \end{macrocode}
% \begin{macrocode}
-\def\caption@@@setmargin#1,#2,#3\@nil{%
- \caption@setlength{margin}{#1}%
- \caption@setlength{margin@}{#2}%
- \addtolength\captionmargin@{-\captionmargin}}
+\newcommand*\caption@@@@@setmargin[2]{%
+ \def\caption@tempa{#2}%
+ \ifx\caption@tempa\@empty \else
+ \caption@setlength{#1margin}{#2}%
+ \fi}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\setcaptionwidth}
+% \begin{macro}{\caption@setwidth}
% \changes{v1.0f}{2005/10/24}{Renamed from \cs{caption@setwidth} to \cs{setcaptionwidth}}
% \changes{v1.3}{2010/11/07}{Starred variant added}
% \changes{v1.3}{2010/11/07}{Support for option \opt{calcwidth} added}
-% |\setcaptionwidth*|\marg{amount}\\
+% \changes{v2.3}{2021/01/17}{Renamed from \cs{setcaptionwidth} to \cs{caption@setwidth}; sets \cs{caption@width} resp.~\cs{caption@leftmargin} and \cs{caption@rightmargin} now}
+% |\caption@setwidth*|\marg{amount}\\
% sets the caption width to the given \meta{amount}.
-% Please never use this in user documents, it's just there to
-% provide compatibility to the \package{caption2} package.
% \begin{macrocode}
-\newcommand*\setcaptionwidth{%
+\newcommand*\caption@setwidth{%
\caption@resetcalcmargin
- \caption@setwidth}
+ \caption@@setwidth}
% \end{macrocode}
% \begin{macrocode}
-\newcommand*\caption@setwidth{%
- \caption@teststar\caption@@setwidth\@gobble\@firstofone}
+\newcommand*\caption@@setwidth{%
+ \caption@teststar\caption@@@setwidth\@gobble\@firstofone}
% \end{macrocode}
% \begin{macrocode}
-\newcommand*\caption@@setwidth[2]{%
- #1{\captionmargin\z@\captionmargin@\z@}%
- \caption@setlength{width}{#2}}%
+\newcommand*\caption@@@setwidth[2]{%
+ #1{\caption@leftmargin\z@\caption@rightmargin\z@}%
+ \setlength\caption@width{#2}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@setcalcmargin}
% \changes{v1.3}{2010/11/07}{This macro added}
+% \changes{v2.3}{2021/01/17}{Adapted to current implementation of \cs{caption@setmargin}}
% |\caption@setcalcmargin*|\marg{amount}\\
% sets the caption margin to the given \meta{amount}
% right before the caption will be typeset, i.e.\meta{amount} will
% not be evaluated immediately.
% \begin{macrocode}
\newcommand*\caption@setcalcmargin{%
- \caption@teststar{\caption@@setcalcmargin\caption@setmargin}%
+ \caption@teststar{\caption@@setcalcmargin\caption@@setmargin}%
\@secondoftwo\@firstoftwo}
% \end{macrocode}
% \begin{macrocode}
@@ -1605,13 +1673,14 @@
%
% \begin{macro}{\caption@setcalcwidth}
% \changes{v1.3}{2010/11/07}{This macro added}
+% \changes{v2.3}{2021/01/17}{Adapted to current implementation of \cs{caption@setmargin}}
% |\caption@setcalcwidth*|\marg{amount}\\
% sets the caption width to the given \meta{amount}
% right before the caption will be typeset, i.e.\meta{amount} will
% not be evaluated immediately.
% \begin{macrocode}
\newcommand*\caption@setcalcwidth{%
- \caption@teststar{\caption@@setcalcmargin\caption@setwidth}%
+ \caption@teststar{\caption@@setcalcmargin\caption@@setwidth}%
\@secondoftwo\@firstoftwo}
% \end{macrocode}
% \end{macro}
@@ -1737,9 +1806,9 @@
% \begin{macro}{\caption@hangindent}
% These are the indentions we support.
% \begin{macrocode}
-\DeclareCaptionLength{@indent}{0pt}
-\DeclareCaptionLength{@parindent}{0pt}
-\DeclareCaptionLength{@hangindent}{0pt}
+\DeclareCaptionLength{indent}{0pt}
+\DeclareCaptionLength{parindent}{0pt}
+\DeclareCaptionLength{hangindent}{0pt}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1750,13 +1819,13 @@
% \changes{v1.0f}{2005/08/22}{Undocumented defaults for \opt{parindent=}, \opt{hangindent=}, and \opt{parskip=} removed}
% \begin{macrocode}
\DeclareCaptionOption{indent}[\leftmargini]{% obsolete
- \caption@setlength{@indent}{#1}}
+ \caption@setlength{indent}{#1}}
\DeclareCaptionOption{indention}[\leftmargini]{%
- \caption@setlength{@indent}{#1}}
+ \caption@setlength{indent}{#1}}
\DeclareCaptionOption{parindent}{%
- \caption@setlength{@parindent}{#1}}
+ \caption@setlength{parindent}{#1}}
\DeclareCaptionOption{hangindent}{%
- \caption@setlength{@hangindent}{#1}}
+ \caption@setlength{hangindent}{#1}}
\DeclareCaptionOption{parskip}{%
\l@addto@macro\caption@@par{\setlength\parskip{#1}}}
% \end{macrocode}
@@ -1917,9 +1986,10 @@
% \begin{macro}{\DeclareCaptionBox}
% \changes{v1.5}{2012/03/15}{This macro added}
% \changes{v2.0}{2019/09/10}{Uses \cs{caption@decl} now}
+% \changes{v2.2f}{2020/10/26}{\cs{par} is now allowed as part of the \meta{code} argument}
% |\DeclareCaptionBox|\marg{name}\marg{code with \#1 and \#2}
% \begin{macrocode}
-\newcommand*\DeclareCaptionBox[2]{%
+\newcommand\DeclareCaptionBox[2]{%
\caption@decl{box}{#1}##1##2{#2}}
\@onlypreamble\DeclareCaptionBox
% \end{macrocode}
@@ -2245,9 +2315,10 @@
% \begin{macro}{\DeclareCaptionTextFormat}
% \changes{v1.0j}{2007/02/18}{This macro added}
% \changes{v2.0}{2019/09/10}{Uses \cs{caption@decl} now}
+% \changes{v2.2f}{2020/10/26}{\cs{par} is now allowed as part of the \meta{code} argument}
% |\DeclareCaptionTextFormat|\marg{name}\marg{code with \#1}
% \begin{macrocode}
-\newcommand*\DeclareCaptionTextFormat[2]{%
+\newcommand\DeclareCaptionTextFormat[2]{%
\caption@decl{textformat}{#1}##1{#2}}
\@onlypreamble\DeclareCaptionTextFormat
% \end{macrocode}
@@ -2260,11 +2331,11 @@
% There are three pre-defined text formats, called `empty', `simple' and `period'.
% \changes{v1.4}{2011/10/05}{Pre-defined text format `empty' added}
% \changes{v1.7}{2015/09/16}{The text format `empty' now takes care of the \cs{label}}
+% \changes{v2.3}{2020/12/26}{Clearance of \cs{caption@thelabel} replaced by \cs{caption@clrlabel}}
% \begin{macrocode}
\DeclareCaptionTextFormat{empty}{%
\caption@get@label#1\caption@makeanchor{}\@nil
- \caption@thelabel
- \global\let\caption@thelabel\relax}
+ \caption@thelabel\caption@clrlabel}
\long\def\caption@get@label#1\caption@makeanchor#2#3\@nil{%
\def\caption@tempa{#2}%
\ifx\caption@tempa\@empty
@@ -2284,9 +2355,7 @@
% \end{macrocode}
%
% \begin{macro}{\caption@getlabel}
-% \changes{v1.0}{2011/09/03}{\cs{label} can have optional arguments now}
% \changes{v1.7}{2015/09/16}{Moved from \package{bicaption} package to \package{caption3}}
-% \changes{v1.8d}{2019/09/01}{Bugfix: Global definition of \cs{caption@thelabel} added}
% \changes{v2.0}{2020/08/23}{Syntax changed}
% |\caption@getlabel|\marg{text}\\
% gets the label command out of the given caption text and stores it to
@@ -2324,8 +2393,19 @@
\l@addto@macro\caption@thelabel{[{#1}]}%
\caption@@@getlabel#2\@nil}
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@clrlabel}
+% \changes{v1.7}{2015/09/16}{Moved from \package{bicaption} package to \package{caption3}}
+% \changes{v1.8d}{2019/09/01}{Bugfix: Global definition of \cs{caption@thelabel} added}
+% \changes{v2.3}{2020/12/26}{Code moved into the new macro \cs{caption@clrlabel}}
+% |\caption@clrlabel|\\
+% resets |\caption@the|\-|label| to |\relax|.
% \begin{macrocode}
-\let\caption@thelabel\relax
+\newcommand*\caption@clrlabel{\let\caption@thelabel\relax}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@clrlabel
% \end{macrocode}
% \end{macro}
%
@@ -2703,16 +2783,19 @@
% usually has to take care for himself that this hint actually matches the
% right position.
%
-% \begin{macro}{\caption@declare@position}
+% \begin{macro}{\DeclareCaptionPosition}
% \changes{v2.0}{2020/07/26}{This macro added}
-% |\caption@declare@position|\marg{name}\marg{code}\\
-% declares a captionposition setting of the given \meta{name},
-% \meta{code} must either expand to |\@first|\-|of|\-|two| (top) or
-% |\@second|\-|of|\-|two| (below).
+% \changes{v2.3}{2021/01/02}{This macro renamed from \cs{caption@declare@position} to \cs{DeclareCaptionPosition} and re-written}
+% |\DeclareCaptionPosition|\marg{name}\marg{fallback-code}\marg{regular-code}\\
+% declares a caption position setting of the given \meta{name}.
+% The \meta{fallback-code} will be used when |\caption@iftop| is used before |\caption|
+% and the \meta{regular-code} will be used when |\caption| is used before |\caption@iftop|.
% \begin{macrocode}
-\newcommand*\caption@declare@position[2]{%
- \caption@decl{position}{#1}{#2}}
-\@onlypreamble\caption@declare@position
+\newcommand*\DeclareCaptionPosition[3]{%
+ \caption@decl[\edef]{position}{#1}{%
+ \unexpanded{\def\caption@fallback@position}####1####2\unexpanded{{#2}}%
+ \unexpanded{\def\caption@regular@position}####1####2\unexpanded{{#3}}}}
+\@onlypreamble\DeclareCaptionPosition
% \end{macrocode}
% \end{macro}
%
@@ -2733,38 +2816,45 @@
% \changes{v1.0a}{2004/01/22}{Now the positions \opt{t}, \opt{above}, \opt{b}, \opt{below}, and \opt{a} are allowed, too}
% \changes{v1.0c}{2004/08/10}{Usage of \cs{caption@defaultpos} added}
% \changes{v2.0}{2020/07/27}{Uses \cs{caption@set} now}
+% \changes{v2.3}{2021/01/02}{Uses \cs{caption@initposition} additionally}
% |\caption@setposition|\marg{position}\\
% puts |\caption@position| to the right value.
-% (Note: Since this command is used by the \package{floatrow} package as well
-% its syntax should not change.)
+% (Note: Since this command is used by the \package{floatrow} package as well its syntax should not change.)
% \begin{macrocode}
-\newcommand*\caption@setposition{\caption@set{position}}
+\newcommand*\caption@setposition{%
+ \caption@initposition
+ \caption@set{position}}
% \end{macrocode}
% \end{macro}
%
% These are the pre-defined position code snippets.
% \begin{macrocode}
-\caption@declare@position{t}{\@firstoftwo}
-\caption@declare@position{top}{\@firstoftwo}
-\caption@declare@position{above}{\@firstoftwo}
-\caption@declare@position{b}{\@secondoftwo}
-\caption@declare@position{bottom}{\@secondoftwo}
-\caption@declare@position{below}{\@secondoftwo}
-\caption@declare@position{a}{\caption@autoposition}% needed by floatrow package, \flrow@cappos
-\caption@declare@position{auto}{\caption@autoposition}
+\DeclareCaptionPosition{top}{#1}{#1}
+\def\caption@position@t{\caption@position@top}
+\def\caption@position@above{\caption@position@top}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionPosition{bottom}{#2}{#2}
+\def\caption@position@b{\caption@position@bottom}
+\def\caption@position@below{\caption@position@bottom}
% \end{macrocode}
%
% \changes{v1.1}{2007/05/08}{Default position changed from `bottom' to `auto'}
-% `default' usually maps to `auto'.
+% \changes{v1.3}{2021/01/02}{Default position changed back from `auto' to `bottom'}
+% `default' usually maps to `bottom'.
% \begin{macrocode}
-\SetCaptionDefault{position}{auto}
+\SetCaptionDefault{position}{bottom}
% \end{macrocode}
%
-% \begin{macro}{\caption@autoposition}
-% \changes{v2.0}{2020/07/27}{This macro added}
-% If in doubt, `position=auto' maps to `position=below'.
+% \begin{macro}{\caption@initposition}
+% \changes{v2.3}{2021/01/02}{This macro added}
+% |\caption@initposition|\\
+% initialize the position option defined with |\Declare|\-|Caption|\-|Position|.
+% This macro is usually used at |\@float|, i.e. at the beginning of a floating
+% environment.
% \begin{macrocode}
-\let\caption@autoposition\@secondoftwo
+\newcommand*\caption@initposition{%
+ \let\caption@@iftop\@undefined}
% \end{macrocode}
% \end{macro}
%
@@ -2773,10 +2863,13 @@
% \changes{v1.0c}{2005/02/12}{Adapted to \cs{caption@defaultpos}}
% \changes{v1.1}{2007/05/08}{Position will be fixed to `bottom' if `auto'}
% \changes{v2.0}{2020/07/27}{Adapted to current implementation of `auto'}
+% \changes{v2.3}{2021/01/02}{Adapted to current implementation of `position'}
% |\caption@iftop|\marg{true-code}\marg{false-code}\\
-% Since version \version{2.0} this command is identical to |\caption@position|.
+% tests if the caption position is set to `top' and sets the state to 2.
% \begin{macrocode}
-\newcommand*\caption@iftop{\caption@position}
+\newcommand*\caption@iftop{%
+ \caption@@fixposition\caption@fallback@position
+ \caption@@iftop}
% \end{macrocode}
% \end{macro}
%
@@ -2784,39 +2877,22 @@
% \changes{v1.0a}{2004/01/23}{\cs{ifvmode} added}
% \changes{v1.0b}{2004/05/16}{Split into \cs{caption@fixposition} & \cs{caption@autoposition}}
% \changes{v2.0}{2020/07/27}{Adapted to current implementation of `auto'}
+% \changes{v2.3}{2021/01/02}{Adapted to current implementation of `position'}
% |\caption@fixposition|\\
-% We try to guess the current position of the caption by checking |\prev|\-|depth|.\par
-% A different solution would be setting the |\space|\-|factor| to something
-% not much less than 1000 (for example 994) in |\caption@start| and
-% checking this value here by |\ifnum\space|\-|factor=994|.
-% (It's implemented in the \package{threeparttable} package\cite{threeparttable} this way.)\par
-% Another idea would be checking |\@if|\-|mini|\-|page|, but since some packages
-% typeset the caption within a simple |\vbox| this does not seem to be a good one.
+% freezes the position settings defined with |\Declare|\-|Caption|\-|Position|
+% by expanding the given code, either the \meta{fallback-code} or the \meta{regular-code}.
+% This macro is usually used at |\caption|, i.e. before the main caption is
+% typeset. (Note: This macro is not used at |\caption| inside sub-figures.)
% \begin{macrocode}
\newcommand*\caption@fixposition{%
- \ifvmode
- \edef\caption@tempa{\the\prevdepth}%
- \caption@Debug{\protect\prevdepth=\caption@tempa}%
- \ifdim\prevdepth>-\p@
- \let\caption@autoposition\@secondoftwo % position=below
- \else
- \let\caption@autoposition\@firstoftwo % position=above
- \fi
- \else
- \caption@Debug{no \protect\prevdepth}%
- \let\caption@autoposition\@secondoftwo % position=below
- \fi}
+ \caption@@fixposition\caption@regular@position}
% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\caption@setautoposition}
-% \changes{v1.1}{2007/06/10}{This macro added}
-% \changes{v2.0}{2020/07/27}{Adapted to current implementation of `auto'}
-% |\caption@setautoposition|\marg{position}\\
-% replaces the above algorithm by a different one (or a fixed position setting).
% \begin{macrocode}
-\newcommand*\caption@setautoposition[1]{%
- \def\caption@fixposition{\caption@@set{position}{autoposition}{#1}}}
+\newcommand*\caption@@fixposition[1]{%
+ \ifx\caption@@iftop\@undefined
+ \caption@position % defines \caption@fallback@position and \caption@regular@position
+ #1{\let\caption@@iftop\@firstoftwo}{\let\caption@@iftop\@secondoftwo}%
+ \fi}
% \end{macrocode}
% \end{macro}
%
@@ -3643,14 +3719,21 @@
% \subsection{The setspace package}
% \changes{v1.0n}{2007/04/02}{\package{setspace} package support added}
% \changes{v1.2d}{2009/10/09}{\package{setspace} package support revised}
+% \changes{v2.3}{2021/11/20}{The font option \opt{stretch} does not require the \package{setspace} package anymore}
%
% \begin{macrocode}
\DeclareCaptionFont{singlespacing}{%
- \caption@ifdefined\setspace@singlespace{%
- \setstretch\setspace@singlespace}{}}% normally 1
+ \caption@ifdefined\setspace@singlespace
+ {\setstretch\setspace@singlespace}% usually 1, could be changed by \SetSinglespace
+ {}}
+\DeclareCaptionFont{stretch}{%
+ \caption@ifdefined\setstretch
+ {\setstretch{#1}}%
+ {\def\baselinestretch{#1}\selectfont}}
+% \end{macrocode}
+% \begin{macrocode}
\DeclareCaptionFont[setspace]{onehalfspacing}{\onehalfspacing}
\DeclareCaptionFont[setspace]{doublespacing}{\doublespacing}
-\DeclareCaptionFont[setspace]{stretch}{\setstretch{#1}}
% \end{macrocode}
%
% \subsection{The subfig package}
@@ -3675,7 +3758,7 @@
\let\caption@setfloattype\@gobble
\let\@dottedxxxline\sf@NEW@dottedxxxline
\let\sf@subfloat\sf@NEW@subfloat
- \let\sf@ifpositiontop\caption@iftop
+ \def\sf@ifpositiontop{\caption@iftop}%
% \end{macrocode}
% \begin{macrocode}
\fi
@@ -3744,6 +3827,7 @@
% \changes{v1.7}{2015/09/15}{Argument \#3 which holds the environment name added to \cs{caption@lstfmt}}
% \changes{v1.7}{2015/09/20}{Unfortunately \package{subfig} defines and uses \cs{caption@lstfmt} as well, so I replaced the third argument with \cs{captionlisttype}}
% \changes{v1.8}{2018/09/06}{Adapted to the \package{chkfloat} package}
+% \changes{v2.3}{2021/01/06}{Usage of \cs{p@xxx} and \cs{thexxx} replaced by \cs{caption@p} and \cs{caption@the}}
% |\caption@addcontentsline|\marg{type}\marg{list entry}\\
% makes an entry in the list-of-whatever, if requested, i.e.~the argument
% \meta{list entry} is not empty and |list|\-|of=| was set to |true|.
@@ -3762,7 +3846,7 @@
\@tempa
{\caption@Debug{addcontentsline: #1 => \caption@listtype}%
% \caption@setoptions\caption@listtype
- \@namedef{the\caption@listtype}{\@nameuse{the#1}}}%
+ \@namedef{the\caption@listtype}{\caption@the{#1}}}%
\expandafter\caption@@addcontentsline\expandafter{\caption@listtype}{#2}%
\endgroup}%
\caption@addsubcontentslines{#1}}
@@ -3776,7 +3860,7 @@
\caption@add@contentsline
{\csname ext@#1\endcsname}%
{#1}%
- {\caption@listformat{\@nameuse{p@#1}}{\@nameuse{the#1}}}%
+ {\caption@listformat{\caption@p{#1}}{\caption@the{#1}}}%
{\ignorespaces #2}%
\caption@chkfloat{#1}{#2}}}}
% \end{macrocode}
@@ -3838,20 +3922,71 @@
% \begin{macro}{\caption@fnum}
% \changes{v1.1}{2007/08/21}{This macro added}
% \changes{v2.0}{2020/08/03}{The original definition will be stored in \cs{caption@original@fnum}}
+% \changes{v2.3}{2021/01/06}{Usage of \cs{thexxx} replaced by \cs{caption@the}}
+% \changes{v2.3}{2022/01/05}{Definition of \cs{caption@@fnum} added}
% |\caption@fnum|\marg{float type}\\
+% |\caption@@fnum|\marg{float type}\marg{name}\marg{number}\\
% typesets the caption label; this acts as replacement for |\fnum@|\meta{float type}.
% \begin{macrocode}
\newcommand*\caption@fnum[1]{%
+ \caption@@fnum{#1}{\@nameuse{#1name}}{\caption@the{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@fnum[1]{%
\expandafter\let\expandafter\caption@original@fnum\csname caption@fnum@#1\endcsname % for label format `original'
- \caption@labelformat{\@nameuse{#1name}}{\@nameuse{the#1}}}
+ \caption@labelformat}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setfnum}
+% \changes{v1.1}{2007/03/10}{This macro added}
+% \changes{v2.0}{2020/08/03}{Adapted to \package{caption3} v2.0}
+% \changes{v2.3}{2022/01/05}{Definition moved from package to kernel}
+% |\caption@setfnum|\marg{type}\\
+% stores the original definition of |\fnum@|\meta{type} in |\caption@fnum@|\meta{type}
+% and re-defines it according the caption label format set with |label|\-|format=|.
+% \begin{macrocode}
+\newcommand*\caption@setfnum[1]{%
+ \@ifundefined{caption@fnum@#1}%
+ {\expandafter\let\csname caption@fnum@#1\expandafter\endcsname\csname fnum@#1\endcsname
+ \@namedef{fnum@#1}{\caption@fnum{#1}}}%
+ {}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@p}
+% \changes{v2.3}{2021/01/06}{This macro added}
+% |\caption@p| is a simple wrapper macro for |\@nameuse{p@#1}|.
+% \begin{macrocode}
+\newcommand*\caption@p[1]{\@nameuse{p@#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@the}
+% \changes{v2.3}{2021/01/06}{This macro added}
+% |\caption@the| is a simple wrapper macro for |\@nameuse{the#1}|.
+% \begin{macrocode}
+\newcommand*\caption@the[1]{\@nameuse{the#1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@make}
-% |\caption@make|\marg{float name}\marg{ref.\ number}\marg{text}\\
+% \changes{v2.3}{2022/01/05}{Optional argument \meta{float type} added}
+% |\caption@make|\oarg{float type}\marg{float name}\marg{ref.\ number}\marg{text}\\
% typesets the caption.
% \begin{macrocode}
-\newcommand\caption@make[2]{\caption@@make{\caption@labelformat{#1}{#2}}}
+\newcommand*\caption@make{%
+ \kernel@ifnextchar[%]
+ \caption@make@
+ {\caption@make@@\caption@labelformat}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@make@[#1]{%
+ \caption@make@@{\caption@@fnum{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@make@@[3]{%
+ \caption@@make{#1{#2}{#3}}}
% \end{macrocode}
% \end{macro}
%
@@ -3877,6 +4012,7 @@
% \changes{v1.6}{2013/05/01}{Usage of \cs{caption@box} added}
% \changes{v1.7}{2016/01/31}{Adapted to the \package{bicaption} package}
% \changes{v1.8f}{2019/12/18}{Usage of \cs{linewidth} replaced by \cs{hsize}}
+% \changes{v2.3}{2021/01/16}{Some code encapsulated as \cs{caption@make@leftmargin}, \cs{caption@make@parbox}, \cs{caption@make@indention}, and \cs{caption@make@rightmargin}}
% |\caption@@make|\marg{caption label}\marg{caption text}
% \begin{macrocode}
\newcommand\caption@@make[2]{%
@@ -3901,32 +4037,20 @@
% Typeset the left margin (option |margin=|)
% \begin{macrocode}
\caption@calcmargin
- \caption@tempdima\captionmargin
- \ifdim\captionmargin@=\z@ \else
- \caption@ifoddpage{}{\advance\caption@tempdima\captionmargin@\relax}%
- \fi
- \caption@ifhmode{\advance\caption@tempdima\caption@indent\relax}%
- \hspace\caption@tempdima
+ \caption@make@leftmargin
% \end{macrocode}
-% We actually use a |\vbox| of width |\captionwidth - \caption@indent|
+% We actually use a |\vbox| of width |\caption@width - \caption@indent|
% to typeset the caption.
% \Note{\cs{captionindent} is \emph{not} supported if the caption format
% was defined with \cs{DeclareCaptionFormat*}.}
% \begin{macrocode}
- \caption@tempdima\captionwidth
- \caption@ifhmode{\advance\caption@tempdima-\caption@indent\relax}%
- \caption@parbox\caption@tempdima{%
+ \caption@make@parbox{%
% \end{macrocode}
% Typeset the indention (option |indention=|)\\
% {\small Bugfix 04-05-05:
% |\hskip-\caption@indent| replaced by |\ifdim\caption@indent=\z@|\ldots}
% \begin{macrocode}
- \caption@ifhmode{%
- \ifdim\caption@indent=\z@
- \leavevmode
- \else
- \hskip-\caption@indent
- \fi}%
+ \caption@make@indention
% \end{macrocode}
% Typeset the caption itself and close the |\caption@parbox|
% \begin{macrocode}
@@ -3934,11 +4058,7 @@
% \end{macrocode}
% Typeset the right margin (option |margin=|)
% \begin{macrocode}
- \caption@tempdima\captionmargin
- \ifdim\captionmargin@=\z@ \else
- \caption@ifoddpage{\advance\caption@tempdima\captionmargin@\relax}{}%
- \fi
- \hspace\caption@tempdima
+ \caption@make@rightmargin
% \end{macrocode}
% Close the outer box |\caption@box|
% \begin{macrocode}
@@ -3948,7 +4068,30 @@
\caption@endhook}
% \end{macrocode}
% \begin{macrocode}
-\newcommand\caption@@make@epilogue{%
+\newcommand*\caption@make@leftmargin{%
+ \caption@tempdima\caption@leftmargin
+ \caption@ifhmode{\advance\caption@tempdima\caption@indent\relax}%
+ \hspace\caption@tempdima}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@make@parbox{%
+ \caption@tempdima\caption@width
+ \caption@ifhmode{\advance\caption@tempdima-\caption@indent\relax}%
+ \caption@parbox\caption@tempdima}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@make@indention{%
+ \caption@ifhmode{%
+ \ifdim\caption@indent=\z@
+ \leavevmode
+ \else
+ \hskip-\caption@indent
+ \fi}}
+\newcommand*\caption@make@rightmargin{%
+ \hspace\caption@rightmargin}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@make@epilogue{%
\global\caption@starfalse}
% \end{macrocode}
% \end{macro}
@@ -3959,47 +4102,70 @@
% \changes{v1.1}{2006/05/13}{Check of \cs{@listdepth} removed (not necessary anymore), use \cs{linewidth} instead of \cs{hsize}}
% \changes{v1.5}{2012/12/26}{max-margin stuff moved from \cs{caption@@make} to here}
% \changes{v1.8f}{2019/12/18}{Usage of \cs{linewidth} replaced by \cs{hsize}}
+% \changes{v2.3}{2021/01/17}{Uses \cs{caption@width} resp.~\cs{caption@leftmargin} and \cs{caption@rightmargin} now}
% |\caption@calcmargin|\\
-% calculates |\caption|\-|margin| and |\caption|\-|width|, so both contain
-% valid values.
+% calculates |\caption|\-|@left|\-|margin|, |\caption|\-|@width|, and |\caption|\-|@right|\-|margin|,
+% so all three contain valid values afterwards.
% \begin{macrocode}
\newcommand*\caption@calcmargin{%
\caption@calcmargin@hook
+ \ifdim\caption@width=\z@
% \end{macrocode}
-% Check margin, if |\caption@min|\-|margin| or |\caption@max|\-|margin| is set
+% If |\caption|\-|margin| is set use this value instead of |\caption@left|\-|margin| and |\caption@right|\-|margin|
% \begin{macrocode}
- \ifx\caption@maxmargin\@undefined \else
- \ifdim\captionmargin>\caption@maxmargin\relax
- \captionmargin\caption@maxmargin\relax
+ \ifdim\captionmargin=\z@ \else
+ \caption@leftmargin\captionmargin
+ \caption@rightmargin\captionmargin
\fi
- \fi
- \ifx\caption@minmargin\@undefined \else
- \ifdim\captionmargin<\caption@minmargin\relax
- \captionmargin\caption@minmargin\relax
+% \end{macrocode}
+% Check the margin values if |\caption@min|\-|margin| or |\caption@max|\-|margin| is set
+% \begin{macrocode}
+ \ifx\caption@maxmargin\@undefined \else
+ \ifdim\caption@leftmargin>\caption@maxmargin
+ \caption@leftmargin\caption@maxmargin
+ \fi
+ \ifdim\caption@rightmargin>\caption@maxmargin
+ \caption@rightmargin\caption@maxmargin
+ \fi
+ \fi
+ \ifx\caption@minmargin\@undefined \else
+ \ifdim\caption@leftmargin<\caption@minmargin
+ \caption@leftmargin\caption@minmargin
+ \fi
+ \ifdim\caption@rightmargin<\caption@minmargin
+ \caption@rightmargin\caption@minmargin
+ \fi
\fi
- \fi
+% \end{macrocode}
+% Check if the left and right margins needs to be swapped
+% \begin{macrocode}
+ \ifdim\caption@leftmargin=\caption@rightmargin \else
+ \caption@ifoddpage{}{%
+ \caption@tempdima\caption@leftmargin
+ \caption@leftmargin\caption@rightmargin
+ \caption@rightmargin\caption@tempdima}%
+ \fi
+% \end{macrocode}
+% Set |\caption@width|
+% \begin{macrocode}
+ \caption@width\hsize
+ \advance\caption@width by -\caption@leftmargin\relax
+ \advance\caption@width by -\caption@rightmargin\relax
% \end{macrocode}
% \begin{macrocode}
- \ifdim\captionwidth=\z@
- \captionwidth\hsize\relax
- \advance\captionwidth by -2\captionmargin\relax
- \advance\captionwidth by -\captionmargin@\relax
\else
- \captionmargin\hsize\relax
- \advance\captionmargin by -\captionwidth\relax
- \divide\captionmargin by 2\relax
- \captionmargin@\z@\relax
+ \caption@leftmargin\hsize
+ \advance\caption@leftmargin by -\caption@width\relax
+ \divide\caption@leftmargin by 2\relax
+ \caption@rightmargin\caption@leftmargin
\fi
% \end{macrocode}
% \begin{macrocode}
\caption@Debug{%
- \string\hsize=\the\hsize,
- \string\captionwidth=\the\captionwidth,\MessageBreak
- \string\captionmargin=\the\captionmargin,
- \string\captionmargin@=\the\captionmargin@}%
-% \end{macrocode}
-% \begin{macrocode}
-}
+ hsize=\the\hsize,
+ width=\the\caption@width,\MessageBreak
+ leftmargin=\the\caption@leftmargin,
+ rightmargin=\the\caption@rightmargin}}
% \end{macrocode}
% \end{macro}
%
@@ -4020,10 +4186,10 @@
\begingroup
\caption@singleline
\let\caption@justification\relax
- \caption@calcmargin % calculate \captionwidth
+ \caption@calcmargin % calculate \caption@width
\caption@prepareslc
\sbox\@tempboxa{\caption@@@make{#1}{#2}}%
- \ifdim\wd\@tempboxa>\captionwidth
+ \ifdim\wd\@tempboxa>\caption@width
\endgroup
\singlelinecaptionfalse
#4%
@@ -4069,8 +4235,19 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\AtCaptionSingleLineCheck}
+% \changes{v2.3}{2021/06/30}{This macro added}
+% |\AtCaptionSingleLineCheck|\marg{code}\\
+% adds code to be expanded right before the single-line-check.
+% (This will be done in an extra group, so all changes done are unually limited to the check.)
+% \begin{macrocode}
+\newcommand*\AtCaptionSingleLineCheck{%
+ \g@addto@macro\caption@prepareslc}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\caption@prepareslc}
-% \changes{v1.0b}{2004/05/16}{Bugfix: Redefinition of \cs{label} \& \cs{@footnotetext} added}
+% \changes{v1.0b}{2004/05/16}{Redefinition of \cs{label} \& \cs{@footnotetext} added}
% \changes{v1.0b}{2004/05/16}{Redefine \cs{stepcounter} instead of \cs{footnote(mark)}}
% \changes{v1.0c}{2005/02/12}{\cs{let}\cs{caption@justification}\cs{relax} added}
% \changes{v1.0f}{2005/07/09}{Support of \package{endnotes} package added}
@@ -4078,18 +4255,18 @@
% \changes{v1.1}{2007/06/13}{Redefinition of \cs{(H@)refstepcounter} added}
% \changes{v1.1}{2007/08/12}{Redefinition of \cs{label} improved}
% \changes{v1.1c}{2007/10/06}{Definition of \cs{caption@l@stepcounter} added}
-% \changes{v1.3}{2011/07/07}{Bugfix 11-07-06: Redefinition of \cs{footnote} and \cs{footnotemark} added, redefinition of \cs{stepcounter} and \cs{refstepcounter} dropped}
-% \changes{v1.4a}{2011/10/22}{Redefinition of \cs{footnote} revised}
+% \changes{v1.3}{2011/07/07}{Redefinition of \cs{footnote} and \cs{footnotemark} added, redefinition of \cs{stepcounter} and \cs{refstepcounter} dropped}
% \changes{v1.5}{2013/04/13}{Redefinition os \cs{glsunset} added}
% \changes{v1.8}{2018/01/21}{Redefinition of \cs{endnote} added (thanks to Markus Kohm)}
% \changes{v1.8}{2018/05/16}{Redefinition of \cs{acused} added}
% \changes{v1.8}{2018/05/26}{Definition method changed so it can be pre-defined by other packages}
% \changes{v1.8}{2018/05/27}{Redefinition of \cs{hypertarget} added}
+% \changes{v2.3}{2021/07/03}{Redefinition of \cs{footnote} and \cs{endnote} stuff revised}
% |\caption@prepareslc|\\
% re-defines anything which could disturb the single-line-check.
% \begin{macrocode}
\providecommand*\caption@prepareslc{}
-\g@addto@macro\caption@prepareslc{%
+\AtCaptionSingleLineCheck{%
\let\label\caption@gobble
\let\hypertarget\@gobbletwo
% \end{macrocode}
@@ -4100,21 +4277,29 @@
% \item The footnote text will not be evaluated twice
% \end{enumerate}
% \begin{macrocode}
- \let\caption@footnote@ORI\footnote
- \def\footnote{\caption@withoptargs\caption@footnote}%
- \let\caption@footnotemark@ORI\footnotemark
- \def\footnotemark{\caption@withoptargs\caption@footnotemark}%
- \let\caption@footnotetext@ORI\@footnotetext
- \let\@footnotetext\caption@gobble
+ \let\footnote\caption@footnote
+ \let\footnotemark\caption@footnotemark
+ \let\footnotetext\caption@footnotetext
+ \let\@footnotetext\@gobble
+% \end{macrocode}
+% Adaption to the \package{hyperref} package
+% \begin{macrocode}
+ \let\H@@footnotetext\@gobble
+ \let\H@@mpfootnotetext\@gobble
+ \caption@ifdefined\H@@footnotemark
+ {\let\@footnotemark\H@@footnotemark}%
+ {}%
+% \end{macrocode}
+% Adaption to the \package{tablefootnote} package
+% \begin{macrocode}
+ \let\tablefootnote\caption@footnote
% \end{macrocode}
% Same for \cs{endnote}
% \begin{macrocode}
- \let\caption@endnote@ORI\endnote
- \def\endnote{\caption@withoptargs\caption@endnote}%
- \let\caption@endnotemark@ORI\endnotemark
- \def\endnotemark{\caption@withoptargs\caption@endnotemark}%
- \let\caption@endnotetext@ORI\@endnotetext
- \let\@endnotetext\caption@gobble
+ \let\endnote\caption@endnote
+ \let\endnotemark\caption@endnotemark
+ \let\endnotetext\caption@endnotetext
+ \let\@endnotetext\@gobble
% \end{macrocode}
% Adaption to the \package{acronym} package\par
% See also \url{https://tex.stackexchange.com/questions/428788}
@@ -4135,28 +4320,106 @@
% \begin{macrocode}
}
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@footnote}
+% \changes{v1.3}{2011/07/07}{This macro added}
+% \changes{v1.4a}{2011/10/22}{This macro revised}
+% \changes{v2.3}{2021/07/03}{This macro re-written}
+% The following code was taken from |base/ltfloat.dtx| but |\step|\-|counter|
+% is replaced by |\caption@l@step|\-|counter| so the footnote counter will
+% only be incremented temporarily for the single-line-check.
+% (In the past we had re-used the original code but with re-defined
+% |\step|\-|counter| but this has proofed as non-sufficient when
+% using footnote related packages like the \package{footmisc} package.
+% Now we might end up getting a wrong footnote marker, but this code has to
+% be sufficient for the single-line-check.))
% \begin{macrocode}
-\newcommand\caption@footnote[2]{%
- \caption@footnotemark{#1}}
+\newcommand*\caption@footnote{%
+ \@ifnextchar[%]
+ \@xfootnote
+ {\caption@l@stepcounter\@mpfn
+ \protected@xdef\@thefnmark{\thempfn}%
+ \@footnotemark\@footnotetext}}
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@footnotemark}
+% \changes{v1.3}{2011/07/07}{This macro added}
+% \changes{v2.3}{2021/07/03}{This macro re-written}
+% The following code was taken from |base/ltfloat.dtx| but |\step|\-|counter|
+% is replaced by |\caption@l@step|\-|counter| so the footnote counter will
+% only be incremented temporarily for the single-line-check.
% \begin{macrocode}
-\newcommand\caption@footnotemark[1]{%
- \begingroup
- \let\stepcounter\caption@l@stepcounter
- \caption@footnotemark@ORI#1\relax
- \endgroup}
+\newcommand*\caption@footnotemark{%
+ \@ifnextchar[%]
+ \@xfootnotemark
+ {\caption@l@stepcounter{footnote}%
+ \protected@xdef\@thefnmark{\thefootnote}%
+ \@footnotemark}}
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@footnotetext}
+% \changes{v2.3}{2021/07/03}{This macro added}
+% The following code was taken from |base/ltfloat.dtx|.
% \begin{macrocode}
-\newcommand\caption@endnote[2]{%
- \caption@endnotemark{#1}}
+\newcommand*\caption@footnotetext{%
+ \@ifnextchar[%]
+ \@xfootnotenext
+ {\protected@xdef\@thefnmark{\thempfn}%
+ \@footnotetext}}
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@endnote}
+% \changes{v1.8}{2018/01/21}{This macro added}
+% \changes{v2.3}{2021/07/03}{This macro re-written}
+% The following code was taken from |endnotes/endnotes.sty| but |\step|\-|counter|
+% is replaced by |\caption@l@step|\-|counter| so the footnote counter will
+% only be incremented temporarily for the single-line-check.
+% (In the past we had re-used the original code but with re-defined
+% |\step|\-|counter|.)
% \begin{macrocode}
-\newcommand\caption@endnotemark[1]{%
- \begingroup
- \let\stepcounter\caption@l@stepcounter
- \caption@endnotemark@ORI#1\relax
- \endgroup}
+\newcommand*\caption@endnote{%
+ \@ifnextchar[%]
+ \@xendnote
+ {\caption@l@stepcounter{endnote}%
+ \protected@xdef\@theenmark{\theendnote}%
+ \@endnotemark\@endnotetext}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@endnotemark}
+% \changes{v1.8}{2018/01/21}{This macro added}
+% \changes{v2.3}{2021/07/03}{This macro re-written}
+% The following code was taken from |endnotes/endnotes.sty| but |\step|\-|counter|
+% is replaced by |\caption@l@step|\-|counter| so the footnote counter will
+% only be incremented temporarily for the single-line-check.
+% \begin{macrocode}
+\newcommand*\caption@endnotemark{%
+ \@ifnextchar[%]
+ \@xendnotemark
+ {\caption@l@stepcounter{endnote}%
+ \protected@xdef\@theenmark{\theendnote}%
+ \@endnotemark}}
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@endnotetext}
+% \changes{v2.3}{2021/07/03}{This macro added}
+% The following code was taken from |endnotes/endnotes.sty|.
+% \begin{macrocode}
+\newcommand*\caption@endnotetext{%
+ \@ifnextchar[%]
+ \@xendnotenext
+ {\protected@xdef\@theenmark{\theendnote}%
+ \@endnotetext}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@l@stepcounter}
+% \changes{v1.3}{2011/07/07}{This macro added}
% \begin{macrocode}
\newcommand*\caption@l@stepcounter[1]{%
\advance\csname c@#1\endcsname\@ne\relax}
@@ -4457,7 +4720,7 @@
% Check if the sub-type was already defined by |\Declare|\-|Sub|\-|Type|.
% If not, define the counter and list entry.
% \begin{macrocode}
- \caption@ifsubtype{#4}%
+ \caption@ifdefined@subtype{#4}%
{\caption@Debug{Modify subtype `#4'}}%
{\caption@Debug{New subtype `#4'}%
\newcounter{#4}[{#3}]%
@@ -4551,14 +4814,14 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\caption@ifsubtype}
-% \changes{v1.8g}{2020/01/02}{This macro added}
+% \begin{macro}{\caption@ifdefined@subtype}
+% \changes{v1.8g}{2020/01/02}{This macro definition added}
% \changes{v1.13}{2020/07/28}{Uses \cs{caption@ifin@list} now}
-% |\caption@ifsubtype|\marg{yes-code}\marg{no-code}\\
-% checks if the given subtype was defined with
-% |\Declare|\-|Caption|\-|Sub|\-|Type|.
+% \changes{v2.3}{2022/01/07}{Renamed from \cs{caption@ifsubtype} to \cs{caption@ifdefined@subtype}}
+% |\caption@ifdefined@subtype|\marg{subtype}\marg{yes-code}\marg{no-code}\\
+% checks if the given subtype was defined with |\Declare|\-|Caption|\-|Sub|\-|Type|.
% \begin{macrocode}
-\newcommand*\caption@ifsubtype{%
+\newcommand*\caption@ifdefined@subtype{%
\caption@ifin@list\caption@subtypelist}
% \end{macrocode}
% \end{macro}
@@ -4606,7 +4869,7 @@
\caption@ifdefined\@memresetsubcounter
{\let\caption@memresetsubcounter\@memresetsubcounter
\renewcommand*\@memresetsubcounter[1]{%
- \caption@ifsubtype{sub#1}\@gobble\caption@memresetsubcounter{#1}}}%
+ \caption@ifdefined@subtype{sub#1}\@gobble\caption@memresetsubcounter{#1}}}%
{}
% \end{macrocode}
% \end{macro}
diff --git a/Master/texmf-dist/source/latex/caption/fallback/v1/caption.dtx b/Master/texmf-dist/source/latex/caption/fallback/v1/caption.dtx
new file mode 100644
index 00000000000..5d84d0cc957
--- /dev/null
+++ b/Master/texmf-dist/source/latex/caption/fallback/v1/caption.dtx
@@ -0,0 +1,489 @@
+% \iffalse
+% caption.dtx - The caption package
+% (c) 1994-95 Axel Sommerfeldt (axel@hp1.ang-physik.uni-kiel.de)
+%
+% --------------------------------------------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.2
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.2 or later is part of all distributions of LaTeX
+% version 1999/12/01 or later.
+%
+%<*driver>
+\documentclass{ltxdoc}
+\setlength{\parindent}{0pt}
+\setlength{\parskip}{\smallskipamount}
+\usepackage[hang,small,bf]{caption}[1995/01/30]
+\setlength{\captionmargin}{20pt}
+\begin{document}
+ \DocInput{caption.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \providecommand{\LaTeXcomp}{The \LaTeX{} Companion}
+% \newcommand{\purerm}[1]{{\upshape\mdseries\rmfamily #1}}
+% \newcommand{\puresf}[1]{{\upshape\mdseries\sffamily #1}}
+% \newenvironment{Options}[1]%
+% {\begin{list}{}{\renewcommand{\makelabel}[1]{\texttt{##1}\hfil}%
+% \settowidth{\labelwidth}{\texttt{#1\space}}%
+% \setlength{\leftmargin}{\labelwidth}%
+% \addtolength{\leftmargin}{\labelsep}}}%
+% {\end{list}}
+%
+% \def\packageversion{1.4b}
+% \def\packagedate{1995/04/05}
+% \changes{v1.0}{27 Oct 94}{First release}
+% \changes{v1.2}{28 Nov 94}{Works now with the {\tt figure*} and {\tt table*} environments, too}
+%
+% \title{The \puresf{caption} package\thanks{This package has version number
+% \packageversion, last revised \packagedate.}}
+% \author{Axel Sommerfeldt\\\texttt{axel@hp1.ang-physik.uni-kiel.de}}
+% \date{1995/04/05}
+% \maketitle
+%
+% \begin{abstract}
+% The \textsf{caption} package provides many ways to customise the captions
+% in floating environments such |figure| and |table|.
+% The |\rotcaption| command and the |sidewaysfigure| and |sidewaystable|
+% environments provided by the \textsf{rotating} package from S.~Rahtz and
+% L.~Barroca are also supported.
+% The \textsf{caption} package also cooperates with the \textsf{float}
+% package written by A.~Lingnau and the \textsf{subfigure} package written by
+% S.D.~Cochran.
+% \end{abstract}
+%
+% \section{The user interface}
+% \changes{v1.1}{3 Nov 94}{New captiontype: {\tt centerlast}}
+% \changes{v1.4}{30 Jan 95}{New option: {\tt nooneline}}
+%
+% To use this package just type
+% \begin{quote}
+% |\usepackage|\oarg{options}|{caption}|
+% \end{quote}
+% in the preamble of your document,
+% where the following options are supported:
+% \begin{quote}\begin{Options}{scriptsize\purerm{, \ldots,\ }Large}
+% \item[normal]
+% provides `normal' captions, this is the default
+% \item[hang \purerm{or} isu]
+% provides captions with hanging indention
+% \item[center]
+% provides captions where each line is centered
+% \item[centerlast]
+% provides captions where the last line of the paragraph is centered
+% \item[nooneline]
+% if a caption fits on \emph{one} line on the page, it will be centered.
+% If you don't like this behaviour, just select this option.
+% \item[scriptsize\purerm{, \ldots,\ }Large]
+% sets the font size of the captions
+% \item[\vbox{\hbox{up{\rm,} it{\rm,} sl{\rm,} sc{\rm,}}
+% \hbox{md{\rm,} bf{\rm,} rm{\rm,} sf{\rm, or} tt}}]
+% sets the font attribute of the caption labels.
+% \item[ruled] supports ruled floats of the \textsf{float} package, see
+% section \ref{sec:float} for details
+% \end{Options}\end{quote}
+%
+% \changes{v1.4}{29 Jan 95}{{\tt\protect\bslash captionsize} changed to {\tt\protect\bslash captionfont}}
+% \DescribeMacro{\captionfont}
+% \DescribeMacro{\captionlabelfont}
+% To setup the font size and attributes of the captions, this package also provides
+% the commands |\captionfont| and |\captionlabelfont| to allow a more
+% flexible way to customize the captions than the above options could do.
+% |\captionfont| is called before each caption, |\captionlabelfont| is
+% called just before the label of the caption, so the whole caption
+% will be created as
+% \begin{quote}
+% |{\captionfont{\captionlabelfont |\meta{label}|: }|\meta{caption}|}| \quad.
+% \end{quote}
+% Note that these commands are used by the options, e.g.\ the options
+% |small| and |sf| are identical to
+% \begin{quote} |\renewcommand{\captionfont}{\small}| \quad and\\
+% |\renewcommand{\captionlabelfont}{\sffamily}| \quad. \end{quote}
+%
+% \DescribeMacro{\captionmargin}
+% Furthermore there is a new length |\captionmargin| to setup an extra left and
+% right margin for the captions, e.g.\ the command
+% \begin{quote} |\setlength{\captionmargin}{10pt}| \end{quote}
+% sets this margin to 10pt.
+%
+% \DescribeMacro{\abovecaptionskip}
+% \DescribeMacro{\belowcaptionskip}
+% The lengths |\abovecaptionskip| and |\belowcaptionskip| contain the amount of
+% white space to leave above and below the caption.
+% |\abovecaptionskip| is preset (in the \textsf{article}, \textsf{report} and
+% \textsf{book} document class) to 10pt, |\belowcaptionskip| to 0pt.
+%
+% \subsection{The \puresf{rotating}, \puresf{float} and \puresf{subfigure} package}
+% \changes{v1.2}{28 Nov 94}{Support of the {\sf float} package}
+% \label{sec:float}
+%
+% If you want to use this package together with the \textsf{rotating}\cite{rotating},
+% \textsf{float}\cite{float} and/or the \textsf{subfigure} package, you have to
+% input this package \emph{after} the other ones, like
+% \begin{quote}
+% |\usepackage{float,rotating,subfigure}|\\
+% |\usepackage[centerlast,small,sc]{caption}|
+% \end{quote}
+% The \textsf{caption} package now redefines the |sidewaysfigure| and
+% |sidewaystable| environments and the |\rotcaption| command provided
+% by the \textsf{rotating} package from S.~Rahtz and L.~Barroca.
+% Note that the |\captionmargin| does not affect the |\rotcaption| command.
+%
+% It also redefines the captions of the |plain| and |boxed| styled floats
+% provided by the \textsf{float} package from A.~Lingnau.
+% |ruled| floats are not supported by default, but you can change this via
+% setting the option |ruled|.
+% Note that the |\captionmargin| is not supported in ruled floats.
+%
+% \changes{v1.3}{8 Jan 95}{Support of {\tt\protect\bslash captionlabelfont} in subcaptions}
+% If the \textsf{subfigure} package from S.D.~Cochran is detected, the options
+% |scriptsize|, \ldots, |large| will redefine |\subcapsize| in an adequate way.
+% If you redefine |\captionfont| by yourself and use the \textsf{subfigure}
+% package, you also have to redefine |\subcapsize| by yourself.
+% Also the commands |\@thesubfigure| and |\@thesubtable| will be redefined to
+% use the |\captionlabelfont| command, please take this into consideration if
+% you redefine |\@thesubfigure| or |\@thesubtable| by yourself.
+% E.g.\ a adequate version of the second example in |subfigure.sty| will be:
+% \begin{verbatim}
+% \renewcommand{\thesubfigure}{\thefigure.\arabic{subfigure}}
+% \makeatletter
+% \renewcommand{\@thesubfigure}{{\captionlabelfont\thesubfigure:}\space}
+% \renewcommand{\p@subfigure}{}
+% \makeatother
+% ...
+% \end{verbatim}
+%
+% \changes{v1.4b}{5 Apr 95}{Adapted to version 2.8 of the rotating package}
+% This package cooperates with the version 2.8 (1995/04/02) of the
+% \textsf{rotating} package, version 1.2c (1995/03/29) of the \textsf{float}
+% package and version 1.6 (1993/05/13) of the \textsf{subfigure} package,
+% but will hopefully work with future versions, too.
+%
+% \section{Example}
+% Here's an example figure which was produced with the following code in the
+% preamble of this document:
+% \begin{quote}
+% |\usepackage[hang,small,bf]{caption}|\\
+% |\setlength{\captionmargin}{20pt}|
+% \end{quote}
+% \begin{figure}[!ht]
+% \centerline{EXAMPLE FIGURE}
+% \caption[Huba]{This is an example caption with a small font and a sans serif label.
+% The hang option was used. There is a left and right margin of 20pt.}
+% \end{figure}
+%
+% \StopEventually{
+% \begin{thebibliography}{9}
+% \bibitem{rotating}
+% Sebastian Rahtz and Leonor Barroca:
+% \emph{A style option for rotated objects in \LaTeX},
+% 1994/10/02
+% \bibitem{float}
+% Anselm Lingnau:
+% \emph{An Improved Environment for Floats},
+% 1995/03/25
+% \bibitem{A-W:GMS94}
+% Michel Goossens, Frank Mittelbach and Alexander Samarin:
+% \newblock {\em The {\LaTeX} Companion},
+% \newblock Addison-Wesley, Reading, Massachusetts, 1994.
+% \bibitem{Anne}
+% Anne Br\"uggemann-Klein:
+% \emph{Einf\"uhrung in die Dokumentverarbeitung},
+% B.G. Teubner, Stuttgart, 1989
+% \bibitem{Kopka-E}
+% Helmut Kopka:
+% \emph{\LaTeX -- Erweiterungsm\"oglichkeiten},
+% 3. \"uberarbeitete Auf\/lage, Addison-Wesley, Bonn, 1991
+% \end{thebibliography}
+% }
+% \setlength{\parskip}{0pt plus 1pt}
+%
+% \CheckSum{295}
+% \DoNotIndex{\\,\_,\ }
+% \DoNotIndex{\p@}
+% \DoNotIndex{\active,\addtolength,\begin,\bfseries}
+% \DoNotIndex{\catcode,\def,\else,\empty,\end,\fi,\footnotesize,\global}
+% \DoNotIndex{\hangindent,\hspace,\ifcase,\ifdim,\ifx,\itshape}
+% \DoNotIndex{\Large,\large,\leavevmode,\leftskip,\let,\linewidth}
+% \DoNotIndex{\mdseries,\newcommand,\newlength,\newsavebox,\noindent,\normalsize}
+% \DoNotIndex{\or,\par,\parbox,\parfillskip,\renewcommand,\rightskip,\rmfamily}
+% \DoNotIndex{\sbox,\scriptsize,\scshape,\setlength,\sffamily,\slshape,\small,\space}
+% \DoNotIndex{\textheight,\typeout,\ttfamily,\undefined,\upshape,\usebox}
+% \DoNotIndex{\vsize,\vskip,\wd}
+% \DoNotIndex{\AtBeginDocument,\DeclareOption,\ExecuteOptions,\NeedsTeXFormat}
+% \DoNotIndex{\ProcessOptions,\ProvidesPackage}
+%
+% \section{The code}
+% \iffalse
+%<*package>
+% \fi
+%
+% \subsection{Identification}
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/06/01]
+\ProvidesPackage{caption}[1995/04/05 v1.4b caption package (AS)]
+% \end{macrocode}
+%
+% \subsection{Initial code}
+% \begin{macro}{\captionfont}
+% \begin{macro}{\captionlabelfont}
+% \begin{macro}{\captionmargin}
+% |\captionsize| is defined for backward compatibility with v1.3
+% of this package.
+% \begin{macrocode}
+\newcommand{\captionsize}{}
+\newcommand{\captionfont}{\captionsize}
+\newcommand{\captionlabelfont}{}
+\newlength{\captionmargin}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% Here are the different basic types of captions implemented:
+% \begin{macro}{\as@normalcaption}
+% \changes{v1.4a}{12 Feb 95}{{\tt\protect\bslash par} added}
+% The `normal' caption
+% \begin{macrocode}
+\newcommand{\as@normalcaption}[2]{%
+ #1 #2\par}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\as@isucaption}
+% \changes{v1.4}{27 Jan 95}{{\tt\protect\bslash leavevmode} added}
+% The `iso' or `hang' caption;
+% this code was taken from \LaTeXcomp\cite[p155]{A-W:GMS94} and modified
+% \iffalse
+% \hangindent\wd\as@captionbox\noindent\usebox{\as@captionbox}#2}
+% \fi
+% \begin{macrocode}
+\newcommand{\as@isucaption}[2]{%
+ \sbox{\as@captionbox}{#1\space}%
+ \addtolength{\as@captionwidth}{-\wd\as@captionbox}%
+ \usebox{\as@captionbox}\parbox[t]{\as@captionwidth}{\leavevmode#2}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\as@centercaption}
+% \changes{v1.4a}{12 Feb 95}{{\tt center} environment changed to {\tt\protect\bslash centering}}
+% The `center' caption
+% \begin{macrocode}
+\newcommand{\as@centercaption}[2]{%
+ \parbox[t]{\as@captionwidth}{{\centering#1 #2\par}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\as@annecaption}
+% \changes{v1.4a}{12 Feb 95}{{\tt\protect\bslash par} added}
+% The `centerlast' caption; the idea how to do this was taken from Br\"uggemann-Klein\cite{Anne},
+% it is also mentioned in Kopka\cite[p227]{Kopka-E}
+% \begin{macrocode}
+\newcommand{\as@annecaption}[2]{%
+ \addtolength{\leftskip}{0pt plus 1fil}%
+ \addtolength{\rightskip}{0pt plus -1fil}%
+ \setlength{\parfillskip}{0pt plus 2fil}%
+ #1 #2\par}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\as@shortcaption}
+% Short captions are centered by default
+% \begin{macrocode}
+\let\as@shortcaption\as@centercaption
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Detection of the \puresf{subfigure} package}
+% \begin{macro}{\as@subcapsize}
+% \begin{macro}{\@thesubfigure}
+% \begin{macro}{\@thesubtable}
+% If the \textsf{subfigure} package is loaded, a little message will be typeout
+% and |\as@subcapsize| -- which sets the size of the subcaptions -- will be
+% defined. Also |\@thesubfigure| and |\@thesubtable| will be redefined here to
+% support the |\captionlabelfont| in subcaptions, too (thanks to Kevin Ruland for
+% this idea!).
+% If you don't like this behaviour, just load the |caption| package \emph{after}
+% the |subfigure| package (and eventually redefine the |\subcapsize| by yourself)
+% or redefine |\@thesubfigure| and |\@thesubtable| after loading the |caption|
+% package as shown in the documentation of the \textsf{subfigure} package.
+% \begin{macrocode}
+\ifx\thesubfigure\undefined
+ \newcommand{\as@subcapsize}[1]{}
+\else%
+ \typeout{\space\space\space\space\space\space\space\space\space
+ `subfigure' package detected}
+ \let\as@subcapsize\subcapsize
+ \renewcommand{\@thesubfigure}{{\captionlabelfont\thesubfigure}\space}
+ \renewcommand{\@thesubtable}{{\captionlabelfont\thesubtable}\space}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Declaration of options}
+% There are four different types of captions supported: |normal|,
+% |isu|, |center| and |centerlast|. |hang| is exactly the same as |isu|.
+% \begin{macrocode}
+\DeclareOption{normal}{\let\as@caption\as@normalcaption}
+\DeclareOption{isu}{\let\as@caption\as@isucaption}
+\DeclareOption{hang}{\ExecuteOptions{isu}}
+\DeclareOption{center}{\let\as@caption\as@centercaption}
+\DeclareOption{anne}{\let\as@caption\as@annecaption}
+\DeclareOption{centerlast}{\ExecuteOptions{anne}}
+% \end{macrocode}
+% If option |nooneline| is set, only-one-line captions will behave like normal
+% ones.
+% \begin{macrocode}
+\DeclareOption{nooneline}{\AtBeginDocument{\let\as@shortcaption\as@caption}}
+% \end{macrocode}
+% There are options for six different font sizes available, they also
+% redefine the |\subcapsize| provided by the \textsf{subfigure} package
+% (if detected).
+% \begin{macrocode}
+\DeclareOption{scriptsize}{%
+ \renewcommand{\captionsize}{\scriptsize}
+ \as@subcapsize{\scriptsize}}
+\DeclareOption{footnotesize}{%
+ \renewcommand{\captionsize}{\footnotesize}
+ \as@subcapsize{\scriptsize}}
+\DeclareOption{small}{%
+ \renewcommand{\captionsize}{\small}
+ \as@subcapsize{\footnotesize}}
+\DeclareOption{normalsize}{%
+ \renewcommand{\captionsize}{\normalsize}
+ \as@subcapsize{\footnotesize}}
+\DeclareOption{large}{%
+ \renewcommand{\captionsize}{\large}
+ \as@subcapsize{\normalsize}}
+\DeclareOption{Large}{%
+ \renewcommand{\captionsize}{\Large}
+ \as@subcapsize{\large}}
+% \end{macrocode}
+% There are nine options available to set the font attributes of the caption labels.
+% \begin{macrocode}
+\DeclareOption{up}{\renewcommand{\captionlabelfont}{\upshape}}
+\DeclareOption{it}{\renewcommand{\captionlabelfont}{\itshape}}
+\DeclareOption{sl}{\renewcommand{\captionlabelfont}{\slshape}}
+\DeclareOption{sc}{\renewcommand{\captionlabelfont}{\scshape}}
+\DeclareOption{md}{\renewcommand{\captionlabelfont}{\mdseries}}
+\DeclareOption{bf}{\renewcommand{\captionlabelfont}{\bfseries}}
+\DeclareOption{rm}{\renewcommand{\captionlabelfont}{\rmfamily}}
+\DeclareOption{sf}{\renewcommand{\captionlabelfont}{\sffamily}}
+\DeclareOption{tt}{\renewcommand{\captionlabelfont}{\ttfamily}}
+% \end{macrocode}
+% If the option |ruled| is set, the captions of ruled floats provided
+% by the \textsf{float} package will also be supported.
+% \begin{macrocode}
+\DeclareOption{ruled}{\newcommand\as@ruled{}}
+% \end{macrocode}
+%
+% \subsection{Execution of options}
+% The `normal' type of caption is preselected.
+% \begin{macrocode}
+\ExecuteOptions{normal}
+\ProcessOptions
+% \end{macrocode}
+%
+% \subsection{Main code}
+% \begin{macro}{\as@captionbox}
+% \begin{macro}{\as@captionwidth}
+% \begin{macro}{\as@makecaption}
+% \begin{macro}{\@makecaption}
+% \changes{v1.4}{30 Jan 95}{{\tt center} environment changed to {\tt\protect\bslash as@shortcaption}}
+% \changes{v1.4a}{12 Feb 95}{{\tt\protect\bslash par} removed}
+% And now \ldots\ it's \ldots\ the new |\@makecaption| code!
+% \begin{macrocode}
+\newsavebox{\as@captionbox}
+\newlength{\as@captionwidth}
+\newcommand{\as@makecaption}[2]{%
+ \setlength{\leftskip}{\captionmargin}%
+ \setlength{\rightskip}{\captionmargin}%
+ \addtolength{\as@captionwidth}{-2\captionmargin}%
+ \captionfont%
+ \sbox{\as@captionbox}{{\captionlabelfont #1:} #2}%
+ \ifdim \wd\as@captionbox >\as@captionwidth
+ \as@caption{{\captionlabelfont #1:}}{#2}%
+ \else%
+ \as@shortcaption{{\captionlabelfont #1:}}{#2}%
+ \fi}
+\renewcommand{\@makecaption}[2]{%
+ \vskip\abovecaptionskip%
+ \setlength{\as@captionwidth}{\linewidth}%
+ \as@makecaption{#1}{#2}%
+ \vskip\belowcaptionskip}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Support of the \puresf{rotating} package}
+% \begin{macro}{\@makercaption}
+% \changes{v1.4b}{5 Apr 95}{{\tt\protect\bslash @makercaption} removed}
+% \begin{macro}{\@makerotcaption}
+% If the \textsf{rotating} package is loaded, the command |\@makerotcaption|
+% (for support of |\rotcaption|) will be
+% redefined here. The code was taken from the \textsf{rotating} package
+% \cite{rotating} itself and adapted.
+% \begin{macrocode}
+\ifx\@makerotcaption\undefined
+\else
+ \typeout{\space\space\space\space\space\space\space\space\space
+ `rotating' package detected}
+% \let\@makercaption\undefined
+ \renewcommand{\@makerotcaption}[2]{%
+ \captionfont%
+ \sbox{\as@captionbox}{{\captionlabelfont #1:} #2}%
+ \ifdim \wd\as@captionbox > .8\vsize
+ \rotatebox{90}{%
+ \setlength{\as@captionwidth}{.8\textheight}%
+ \begin{minipage}{\as@captionwidth}%
+ \as@caption{{\captionlabelfont #1:}}{#2}%
+ \end{minipage}}\par
+ \else%
+ \rotatebox{90}{\usebox{\as@captionbox}}%
+ \fi
+ \hspace{12pt}}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Support of the \puresf{float} package}
+% \begin{macro}{\floatc@plain}
+% \begin{macro}{\floatc@ruled}
+% \changes{v1.3}{8 Jan 95}{{\tt\protect\bslash as@normalcaption} changed to {\tt\protect\bslash as@caption}}
+% \changes{v1.4a}{12 Feb 95}{{\tt\protect\bslash par} removed}
+% If the \textsf{float} package is loaded, the command |\floatc@plain|
+% (and the command |\floatc@ruled| if the option |ruled| is given)
+% will be redefined here.
+% \begin{macrocode}
+\ifx\floatc@plain\undefined
+\else
+ \typeout{\space\space\space\space\space\space\space\space\space
+ `float' package detected}
+ \renewcommand\floatc@plain[2]{%
+ \setlength{\as@captionwidth}{\linewidth}%
+ \as@makecaption{#1}{#2}}
+ \ifx\as@ruled\undefined
+ \else
+ \renewcommand\floatc@ruled[2]{%
+ \setlength{\as@captionwidth}{\linewidth}%
+ \captionfont%
+ \as@caption{{\captionlabelfont #1:}}{#2}}
+ \fi
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \Finale
+%
+\endinput
+
diff --git a/Master/texmf-dist/source/latex/caption/fallback/v2.0/caption2.dtx b/Master/texmf-dist/source/latex/caption/fallback/v2.0/caption2.dtx
new file mode 100644
index 00000000000..339aa29a8fd
--- /dev/null
+++ b/Master/texmf-dist/source/latex/caption/fallback/v2.0/caption2.dtx
@@ -0,0 +1,606 @@
+% \iffalse
+% caption.dtx - The caption package
+% (c) 1994-95 Axel Sommerfeldt (axel@hp1.ang-physik.uni-kiel.de)
+%
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\documentclass{ltxdoc}
+\newlength\artparindent
+\setlength\artparindent{\parindent}
+\setlength\parindent{0pt}
+\setlength\parskip{\smallskipamount}
+\usepackage{caption2}[1995/10/09]
+\IfFileExists{ltxdoc.cfg}{}{\OnlyDescription\RecordChanges\CodelineIndex}
+\begin{document}
+ \DocInput{caption2.dtx}
+ \IfFileExists{ltxdoc.cfg}{}{\PrintChanges\PrintIndex}
+\end{document}
+%</driver>
+% \fi
+%
+% \providecommand{\LaTeXcomp}{The \LaTeX{} Companion}
+% \newcommand{\purerm}[1]{{\upshape\mdseries\rmfamily #1}}
+% \newcommand{\puresf}[1]{{\upshape\mdseries\sffamily #1}}
+% \newenvironment{Options}[1]%
+% {\begin{list}{}{\renewcommand{\makelabel}[1]{\texttt{##1}\hfil}%
+% \settowidth{\labelwidth}{\texttt{#1\space}}%
+% \setlength{\leftmargin}{\labelwidth}%
+% \addtolength{\leftmargin}{\labelsep}}}%
+% {\end{list}}
+%
+% \def\packageversion{2.0(BETA)}
+% \def\packagedate{1995/10/09}
+% \changes{v1.0}{27 Oct 94}{First release}
+% \changes{v1.2}{28 Nov 94}{Works now with the {\tt figure*} and {\tt table*}
+% environments, too}
+% \changes{v2.0}{ 9 Oct 95}{Totally rewritten; many new commands and features}
+%
+% \title{The \puresf{caption} package\thanks{This package has version number
+% \packageversion, last revised \packagedate.}}
+% \author{Axel Sommerfeldt\\
+% {\small axel@hp1.ang-physik.uni-kiel.de}}
+% \date{1995/10/09}
+% \maketitle
+%
+% \begin{abstract}
+% The \textsf{caption} package provides many ways to customise the captions
+% in floating environments such |figure|, |table|, |sidewaysfigure|, and
+% |sidewaystable|.
+% The following \LaTeXe\ packages are supported:
+% float, longtable, and subfigure.
+% But it works fine with the following packages as well:
+% floatfig, rotating, supertabular, and wrapfig.
+% \end{abstract}
+%
+% \section{Documentation? What documentation?}
+% I'm sorry to say this, but there is no documentation provided with the
+% new version of this package, yet. And it's still beta. I hope I can
+% eleminate both circumstances in the near future; at the moment my spare time
+% is very very very limited, so I decided to make this beta public.
+%
+% This new version is nearly compatible with the lastest official release
+% (version 1.4b), so you can use the old documentation so far.
+% Here is what differs this version from version 1.4b:
+%
+% \begin{itemize}
+% \item
+% If the caption package will detect a loaded float package, it will
+% \emph{not} redefine the boxed style of floats anymore. If you want to
+% have the old behaviour, you have to specify the new option |boxed| to
+% the caption2 package.
+% \item
+% Anything said about the subfigure package in the old doc isn't
+% true anymore; the caption package is now adapted to the new version
+% 2.0 of this package. Especially the caption package will \emph{not}
+% redefine |\@thesubfigure| and |\@thesubtable| anymore and it will
+% \emph{not} set |\subcapsize| -- you have to do this now for yourself
+% if you want to, e.g.\ with the following code:
+% \begin{quote}
+% |\usepackage[normalsize]{subfigure}|\\
+% |\usepackage[large]{caption}|
+% \end{quote}
+%
+% So you can load the caption2 package \emph{before} loading the subfigure
+% package now without problems, in fact this is recommend now. Don't care
+% about what the old doc or the doc of the subfigure package is telling you!
+% \end{itemize}
+%
+% As a summary, the new caption package won't lead into different results
+% of your documents just because of loading it (without options).
+%
+% If you are really interested in the (many!) new features of this totally
+% rewritten package, take a look in the provided test document (test2.tex)
+% to get a idea of the new commands and possibilities.
+% And feel yourself free to write a email to me, if any questions occur.
+%
+% \subsection{Just a few notes\dots}
+% If you use the new command |\setcaptionwidth| to set the absolut width of a
+% caption, you are not allowed to change |\captionmargin| anymore!
+% Instead, use the new command |\setcaptionmargin| to do this.
+%
+% Longtables will still take care of |\LTcapwidth|, even if you are setting
+% your own width via |\setcaptionwidth| or |\setcaptionmargin|. To get rid
+% of this, use the following code just after loading the caption2 package:
+% \begin{quote}
+% |\dummycaptionstyle{longtable}{}|
+% \end{quote}
+% or just specify the new package option |longtable|.
+%
+% This package was developed and tested with following versions of the
+% other packages:
+% \begin{quote}\begin{tabular}{lll}
+% package & version & date \\\hline
+% float & 1.2c & 1995/03/29 \\
+% longtable & 3.15 & 1995/06/15 \\
+% rotating & 2.9 & 1995/04/07 \\
+% subfigure & 2.0 & 1995/03/06 \\
+% \end{tabular}\end{quote}
+%
+% Maybe it will work with older versions, maybe not\dots
+%
+% BTW:
+% If you are interested in rotated versions (like |sidewaysfigure| or
+% |sidewaystable|) of new floats (defined with the float package), take a look
+% at the rotfloat package, which comes from a very talented young man with a
+% very german style of writing english docs (if he ever writes any!) and a
+% very big mouth - myself |:-)|
+%
+% \section{Thanks}
+% I would like to thank David Carlisle for his help writing the longtable
+% support; without the changes in his package this wouldn't become possible.
+%
+% \changes{v1.1}{ 3 Nov 94}{New captiontype: {\tt centerlast}}
+% \changes{v1.4}{30 Jan 95}{New option: {\tt nooneline}}
+% \changes{v1.4}{29 Jan 95}{{\tt\protect\bslash captionsize} changed to
+% {\tt\protect\bslash captionfont}}
+% \changes{v1.2}{28 Nov 94}{Support of the {\sf float} package}
+% \changes{v1.3}{ 8 Jan 95}{Support of {\tt\protect\bslash captionlabelfont} in
+% subcaptions}
+% \changes{v1.4b}{5 Apr 95}{Adapted to version 2.8 of the rotating package}
+% \changes{v2.0}{ 9 Oct 95}{support of the longtable package}
+%
+% \StopEventually{
+% \begin{thebibliography}{9}
+% \bibitem{float}
+% Anselm Lingnau:
+% \textsl{An Improved Environment for Floats},
+% 1995/03/25
+% \bibitem{rotating}
+% Sebastian Rahtz and Leonor Barroca:
+% \textsl{A style option for rotated objects in \LaTeX},
+% 1994/10/02
+% \bibitem{rotfloat}
+% Axel Sommerfeldt:
+% \textsl{The rotfloat package},
+% 1995/03/30
+% \bibitem{subfigure}
+% Steven Douglas Cochran:
+% \textsl{The subfigure package},
+% 1995/03/06
+% \bibitem{A-W:GMS94}
+% Michel Goossens, Frank Mittelbach and Alexander Samarin:
+% \newblock \textsl{The {\LaTeX} Companion},
+% \newblock Addison-Wesley, Reading, Massachusetts, 1994.
+% \bibitem{Anne}
+% Anne Br\"uggemann-Klein:
+% \textsl{Einf\"uhrung in die Dokumentverarbeitung},
+% B.G. Teubner, Stuttgart, 1989
+% \bibitem{Kopka-E}
+% Helmut Kopka:
+% \textsl{\LaTeX -- Erweiterungsm\"oglichkeiten},
+% 3. \"uberarbeitete Auf\/lage, Addison-Wesley, Bonn, 1991
+% \end{thebibliography}
+% }
+% \setlength{\parskip}{0pt plus 1pt}
+%
+% \CheckSum{647}
+% \DoNotIndex{\\,\_,\ }
+% \DoNotIndex{\@gobble,\@ifundefined,\@namedef,\@nameuse,\@tempdima}
+% \DoNotIndex{\p@,\z@}
+% \DoNotIndex{\active,\addtolength,\advance,\begin,\bfseries}
+% \DoNotIndex{\catcode,\centering,\csname,\def,\divide}
+% \DoNotIndex{\else,\empty,\end,\endcsname,\endgraf,\expandafter}
+% \DoNotIndex{\fi,\footnotesize,\global}
+% \DoNotIndex{\hangindent,\hbox,\hskip,\hspace,\hss}
+% \DoNotIndex{\ifcase,\ifdim,\ifx,\itshape}
+% \DoNotIndex{\Large,\large,\leavevmode,\leftskip,\let,\linewidth}
+% \DoNotIndex{\mdseries,\message}
+% \DoNotIndex{\newcommand,\newdimen,\newlength,\newif,\newsavebox,\noindent}
+% \DoNotIndex{\normalsize,\or}
+% \DoNotIndex{\par,\parbox,\parfillskip,\protect}
+% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\rightskip}
+% \DoNotIndex{\rmfamily}
+% \DoNotIndex{\sbox,\scriptsize,\scshape,\setlength,\sffamily,\slshape,\small}
+% \DoNotIndex{\space,\strut}
+% \DoNotIndex{\textheight,\typeout,\ttfamily,\undefined,\upshape,\usebox}
+% \DoNotIndex{\vsize,\vskip,\wd}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
+% \DoNotIndex{\ExecuteOptions,\InputIfFileExists,\NeedsTeXFormat,\MessageBreak}
+% \DoNotIndex{\PackageError,\PackageWarningNoLine,\ProcessOptions}
+% \DoNotIndex{\ProvidesPackage}
+%
+% \clearpage
+% \section{The (not well documented) code}
+% \iffalse
+%<*package>
+% \fi
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesPackage{caption2}[1995/10/09 v2.0 caption package (AS)]
+%
+% package detection message
+\let\caption@message\undefined
+\newcommand*\caption@package[1]{%
+ \ifx\caption@message\undefined
+ \message{\space\space\space\space\space\space\space\space\space
+ packages detected:}
+ \let\caption@message\empty
+ \fi
+ \message{#1}}
+%
+% `internal' stuff
+\newlength\realcaptionwidth
+\newsavebox\captionbox
+%
+% Code initialisation, `normal' stuff
+\newcommand*\captionsize{}
+\newcommand*\captionfont{\captionsize}
+\newcommand*\captionlabelfont{}
+\newcommand*\captionlabeldelim{:}
+\newdimen\captionlabelsep
+ \sbox\captionbox{ }
+ \setlength\captionlabelsep{\wd\captionbox}
+\newdimen\captionmargin
+\newdimen\captionwidth
+% only used by captionstyle `indent', but can be used in user-defines styles
+\newdimen\captionindent
+\newif\ifonelinecaptions
+\newif\iftakecaptionwidth
+%
+%\newcommand*\setcaptionfont[1]{%
+% \def\captionfont{#1}}
+%\newcommand*\setcaptionlabelfont[1]{%
+% \def\captionlabelfont{#1}}
+\newcommand*\setcaptionmargin[1]{%
+ \setlength\captionmargin{#1}%
+ \takecaptionwidthfalse}
+\newcommand*\setcaptionwidth[1]{%
+ \setlength\captionwidth{#1}%
+ \takecaptionwidthtrue}
+%
+% \newcaptionstyle, \renewcaptionstyle & \defcaptionstyle
+\newcommand\newcaptionstyle[2]{%
+ \expandafter\ifx\csname caption@@#1\endcsname\relax
+ \defcaptionstyle{#1}{#2}%
+ \else
+ \PackageError{caption}{Caption style `#1' already defined}{}%
+ \fi}
+\newcommand\renewcaptionstyle[2]{%
+ \expandafter\ifx\csname caption@@#1\endcsname\relax
+ \PackageError{caption}{Caption style `#1' undefined}{}%
+ \else
+ \defcaptionstyle{#1}{#2}%
+ \fi}
+\newcommand\defcaptionstyle[2]{%
+ \@namedef{caption@@#1}{#2}}
+\newcommand*\dummycaptionstyle[2]{%
+ \defcaptionstyle{#1}{%
+ \expandafter\ifx\csname caption@@\caption@style\expandafter\endcsname%
+ \csname caption@@#1\endcsname
+ \PackageError{caption}{You can't use the caption style `#1' directy}{%
+ The caption style `#1' is only a dummy and does not really exists.%
+ \MessageBreak You have to redefine it (with \protect\renewcaptionstyle)
+ before you can select\MessageBreak it with \protect\captionstyle.}%
+ \else
+ #2\usecaptionstyle{\caption@style}%
+ \fi}}
+%
+% preimplemented types of captions, all with a label and text,
+% separated by \captionlabeldelim
+\newcaptionstyle{normal}{\caption@make{normal}}
+\newcaptionstyle{center}{\caption@make{center}}
+\newcaptionstyle{flushleft}{\caption@make{flushleft}}
+\newcaptionstyle{flushright}{\caption@make{flushright}}
+\newcaptionstyle{centerlast}{\caption@make{centerlast}}
+\newcaptionstyle{hang}{\caption@make{hang}}
+\newcaptionstyle{indent}{\caption@make{indent}}
+%
+% \captionstyle
+\newcommand*\captionstyle[1]{%
+ \expandafter\ifx\csname caption@@#1\endcsname\relax
+ \PackageError{caption}{Undefined caption style `#1'}{}%
+ \else
+ \def\caption@style{#1}%
+ \fi}
+%
+% Options
+\DeclareOption{normal}{\captionstyle{normal}}
+\DeclareOption{center}{\captionstyle{center}}
+\DeclareOption{flushleft}{\captionstyle{flushleft}}
+\DeclareOption{flushright}{\captionstyle{flushright}}
+\DeclareOption{centerlast}{\captionstyle{centerlast}}
+\DeclareOption{anne}{\ExecuteOptions{centerlast}}
+\DeclareOption{hang}{\captionstyle{hang}}
+\DeclareOption{isu}{\ExecuteOptions{hang}}
+\DeclareOption{indent}{\captionstyle{indent}}
+%
+\DeclareOption{oneline}{\onelinecaptionstrue}
+\DeclareOption{nooneline}{\onelinecaptionsfalse}
+%
+\DeclareOption{scriptsize}{\renewcommand*\captionsize{\scriptsize}}
+\DeclareOption{footnotesize}{\renewcommand*\captionsize{\footnotesize}}
+\DeclareOption{small}{\renewcommand*\captionsize{\small}}
+\DeclareOption{normalsize}{\renewcommand*\captionsize{\normalsize}}
+\DeclareOption{large}{\renewcommand*\captionsize{\large}}
+\DeclareOption{Large}{\renewcommand*\captionsize{\Large}}
+%
+\DeclareOption{up}{\renewcommand*\captionlabelfont{\upshape}}
+\DeclareOption{it}{\renewcommand*\captionlabelfont{\itshape}}
+\DeclareOption{sl}{\renewcommand*\captionlabelfont{\slshape}}
+\DeclareOption{sc}{\renewcommand*\captionlabelfont{\scshape}}
+\DeclareOption{md}{\renewcommand*\captionlabelfont{\mdseries}}
+\DeclareOption{bf}{\renewcommand*\captionlabelfont{\bfseries}}
+\DeclareOption{rm}{\renewcommand*\captionlabelfont{\rmfamily}}
+\DeclareOption{sf}{\renewcommand*\captionlabelfont{\sffamily}}
+\DeclareOption{tt}{\renewcommand*\captionlabelfont{\ttfamily}}
+%
+\DeclareOption{boxed}{\AtEndOfPackage{%
+ \ifx\caption@@ruled\undefined
+ \PackageWarningNoLine{caption}{%
+ Option `boxed' is set but there is no `float' package\MessageBreak
+ around here, so this option will be totally ignored}
+ \else
+ \dummycaptionstyle{boxed}{}%
+ \fi}}
+\DeclareOption{ruled}{\AtEndOfPackage{%
+ \ifx\caption@@ruled\undefined
+ \PackageWarningNoLine{caption}{%
+ Option `ruled' is set but there is no `float' package\MessageBreak
+ around here, so this option will be totally ignored}
+ \else
+ \dummycaptionstyle{ruled}{\onelinecaptionsfalse\setcaptionmargin{0pt}}%
+ \fi}}
+%
+\DeclareOption{longtable}{\AtEndOfPackage{%
+ \ifx\caption@@longtable\undefined
+ \PackageWarningNoLine{caption}{%
+ Option `longtable' is set but there is no `longtable' package\MessageBreak
+ around here, so this option will be totally ignored}
+ \else
+ \dummycaptionstyle{longtable}{}%
+ \fi}}
+%
+\DeclareOption*{\AtEndOfPackage{%
+ \InputIfFileExists{\CurrentOption.caption}{}{%
+ \PackageError{caption}{File `\CurrentOption.caption' not found}{%
+ You selected the unknown package option `\CurrentOption', so I
+ thought you want to\MessageBreak
+ input the definition file `\CurrentOption.caption' here
+ -- but there is no one!}}}}
+%
+\ExecuteOptions{normal,oneline}
+\ProcessOptions
+%
+% \@makecaption
+\renewcommand\@makecaption[2]{%
+ \vskip\abovecaptionskip
+ \realcaptionwidth\linewidth
+ \def\captionlabel{#1}%
+ \def\captiontext{#2}%
+ \usecaptionstyle{\caption@style}%
+ \vskip\belowcaptionskip}
+%
+% Helpers for caption style authors
+\newcommand*\caption@canterr[1]{%
+ \PackageError{caption}{You can't use \protect#1
+ in normal text}{The usage of \protect#1 is only
+ allowed inside code declared with\MessageBreak \protect\defcaptionstyle,
+ \protect\newcaptionstyle \space or \protect\renewcaptionstyle.}}
+\newcommand\onelinecaption[2]{%
+ \ifx\captiontext\undefined
+ \caption@canterr{\onelinecaption}%
+ \else
+ \def\caption@temp{#2}%
+ \ifonelinecaptions
+ \sbox\captionbox{#1}%
+ \ifdim\wd\captionbox >\realcaptionwidth
+ \caption@temp
+ \else
+ {\centering\usebox{\captionbox}\par}%
+ \fi
+ \else
+ \caption@temp
+ \fi
+ \let\caption@temp\undefined
+ \fi}
+\newcommand*\usecaptionmargin{%
+ \ifx\captiontext\undefined
+ \caption@canterr{\usecaptionmargin}%
+ \else
+ \iftakecaptionwidth
+ \leftskip\realcaptionwidth
+ \advance\leftskip by -\captionwidth
+ \divide\leftskip by 2
+ \rightskip\leftskip
+ \realcaptionwidth\captionwidth
+ \else
+ \leftskip\captionmargin
+ \rightskip\captionmargin
+ \advance\realcaptionwidth by -2\captionmargin
+ \fi
+ \fi}
+\newcommand*\usecaptionstyle[1]{%
+ \ifx\captiontext\undefined
+ \caption@canterr{\usecaptionstyle}%
+ \else
+ \@ifundefined{caption@@#1}%
+ {\PackageError{caption}{Caption style `#1' undefined}{}}%
+ {\@nameuse{caption@@#1}}
+ \fi}
+%
+% equal code for normal, center, centerlast, hang, and indent
+\newcommand*\caption@make[1]{%
+ \usecaptionmargin\captionfont
+ \def\caption@label{%
+ {\captionlabelfont\captionlabel\captionlabeldelim}%
+ \hskip\captionlabelsep}%
+ \onelinecaption{\caption@label\captiontext}%
+ {\@nameuse{caption@@@#1}}}
+%
+% the preimplemented caption styles
+\newcommand*\caption@@@normal{%
+ \caption@label\captiontext\par}
+\newcommand*\caption@@@center{%
+ \parbox[t]{\realcaptionwidth}{\centering
+ \caption@label\captiontext\par}}%
+\newcommand*\caption@@@flushleft{%
+ \parbox[t]{\realcaptionwidth}{\raggedright
+ \caption@label\captiontext\par}}%
+\newcommand*\caption@@@flushright{%
+ \parbox[t]{\realcaptionwidth}{\raggedleft
+ \caption@label\captiontext\par}}%
+\newcommand*\caption@@@centerlast{%
+ \advance\leftskip by 0pt plus 1fil%
+ \advance\rightskip by 0pt plus -1fil%
+ \parfillskip0pt plus 2fil%
+ \caption@label\captiontext\par}
+\newcommand*\caption@@@hang{%
+ \sbox\captionbox{\caption@label}%
+ \hangindent\wd\captionbox\noindent
+ \usebox\captionbox\captiontext\par}
+\newcommand*\caption@@@indent{%
+ \hangindent\captionindent\noindent
+ \caption@label\captiontext\par}
+% \end{macrocode}
+%
+% \subsection*{Support of the float package}
+% \begin{macrocode}
+\ifx\floatc@plain\undefined
+\else
+ \caption@package{float}
+%
+% interface float package -> caption package
+ \newcommand\caption@floatc[3]{%
+ \realcaptionwidth\linewidth
+ \def\captionlabel{#2}%
+ \def\captiontext{#3}%
+ \usecaptionstyle{#1}}
+%
+% floatstyle plain verwendet jetzt den gesetzten captionstyle
+ \renewcommand\floatc@plain{\caption@floatc{\caption@style}}
+%
+% floatstyle boxed auch (kann aber mit \renewcaptionstyle geaendert werden)
+ \dummycaptionstyle{boxed}{\def\captionlabelfont{\bfseries}}
+ \newcommand\floatc@boxed{\caption@floatc{boxed}}
+% jetzt muessen wir nur noch dafuer sorgen, dass es auch (statt floatc@plain)
+% in \fs@boxed verwendet wird...
+ \let\caption@boxed\fs@boxed
+ \renewcommand\fs@boxed{\let\floatc@plain\floatc@boxed\caption@boxed}
+%
+% floatstyle ruled, dies geht zum Glueck wieder geradeaus
+ \newcaptionstyle{ruled}{{\bfseries\captionlabel} \captiontext\par}
+ \renewcommand*\floatc@ruled{\caption@floatc{ruled}}
+%
+\fi
+% \end{macrocode}
+%
+% \subsection*{Support of the longtable package}
+% \begin{macrocode}
+\ifx\LT@makecaption\undefined
+\else
+ \caption@package{longtable}
+ \dummycaptionstyle{longtable}{\setcaptionwidth\LTcapwidth}
+ \renewcommand\LT@makecaption[3]{%
+ \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\linewidth{%
+ \realcaptionwidth\linewidth
+ \ifx#1\@gobble
+ \def\captionlabel{}%
+ \def\captionlabeldelim{}%
+ \captionlabelsep\z@
+ \else
+ \def\captionlabel{#2}%
+ \fi
+ \def\captiontext{#3}%
+ \usecaptionstyle{longtable}%
+ \endgraf\vskip\baselineskip}%
+ \hss}}}
+\fi
+% \end{macrocode}
+%
+% \subsection*{Support of the subfigure package}
+% \begin{macrocode}
+\newcommand*\addtosubcaption[1]{}
+\@ifundefined{@makesubfigurecaption}{}{%
+ \caption@package{subfigure}
+% \end{macrocode}
+%
+% \begin{macro}{\subcapsize}
+% \begin{macrocode}
+ \newcommand*\subcapstyle[1]{%
+ \expandafter\ifx\csname caption@@#1\endcsname\relax
+ \PackageError{caption}{Undefined caption style `#1'}{}%
+ \else
+ \def\caption@substyle{#1}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% Detection of |\caption@substyle|.
+% \begin{macrocode}
+ \subcapstyle{normal}
+ \ifsubcaphang
+ \subcapstyle{hang}
+ \fi
+ \ifsubcapcenter
+ \subcapstyle{center}
+ \fi
+ \ifsubcapcenterlast
+ \subcapstyle{centerlast}
+ \fi
+% \end{macrocode}
+%
+% NOTE: \cs{subfigcapmargin} is \emph{not} a length, it's a command.
+% So we make \cs{subfigcapwidth} also a command!
+% \begin{macrocode}
+ \newif\iftakesubfigcapwidth
+ \newcommand*\subfigcapwidth{0pt}
+% only used by captionstyle `indent', but can be used in user-defines styles
+ \newlength\subcapindent
+% \end{macrocode}
+%
+% \begin{macro}{\setsubcapmargin}
+% \begin{macro}{\setsubcapwidth}
+% \begin{macrocode}
+ \newcommand*\setsubcapmargin[1]{%
+ \renewcommand*\subcapfigmargin{#1}%
+ \takesubfigcapwidthfalse}
+ \newcommand*\setsubcapwidth[1]{%
+ \renewcommand*\subcapfigwidth{#1}%
+ \takesubfigcapwidthtrue}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+ \renewcommand\@makesubfigurecaption[2]{%
+ \realcaptionwidth\@tempdima
+ \def\captionlabel{#1}%
+ \def\captiontext{#2}%
+ \let\captionfont\subcapsize
+ \let\captionlabelfont\relax
+ \let\captionlabeldelim\empty
+ \captionlabelsep0pt
+ \ifsubcapnooneline\onelinecaptionsfalse\else\onelinecaptionstrue\fi
+ \iftakesubfigcapwidth\takecaptionwidthtrue\else\takecaptionwidthfalse\fi
+ \setlength\captionmargin{\subfigcapmargin}%
+ \setlength\captionwidth{\subfigcapwidth}%
+ \captionindent\subcapindent
+ \hbox{\parbox[t]\@tempdima{\strut\usecaptionstyle{\caption@substyle}}}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \renewcommand*\addtosubcaption[1]{%
+ \let\caption@makesubfigurecaption\@makesubfigurecaption
+ \renewcommand\@makesubfigurecaption[2]{%
+ #1\caption@makesubfigurecaption}
+ \let\@makesubtablecaption\@makesubfigurecaption}}
+% \end{macrocode}
+%
+% \subsection*{Cleaning up}
+% \begin{macrocode}
+\ifx\caption@message\undefined
+\else\message{^^J}\let\caption@message\undefined\fi
+\let\caption@package\undefined
+\let\caption@subcapsize\undefined
+% \end{macrocode}
+% \clearpage
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \Finale
+%
+\endinput
+
diff --git a/Master/texmf-dist/source/latex/caption/fallback/v2.1/caption2.dtx b/Master/texmf-dist/source/latex/caption/fallback/v2.1/caption2.dtx
new file mode 100644
index 00000000000..23c1f26b862
--- /dev/null
+++ b/Master/texmf-dist/source/latex/caption/fallback/v2.1/caption2.dtx
@@ -0,0 +1,1329 @@
+% \iffalse meta-comment
+%
+% This is file `caption2.dtx'.
+%
+% Copyright (C) 1994-2005 Axel Sommerfeldt (caption@sommerfee.de)
+%
+% --------------------------------------------------------------------------
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Axel Sommerfeldt.
+%
+% This work consists of the files caption.ins, caption.dtx,
+% caption2.dtx, caption.xml, and anleitung.tex and the derived files
+% caption.sty, caption2.sty, caption3.sty, and manual.tex.
+%
+% \fi
+% \CheckSum{843}
+%
+% \iffalse
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\documentclass{ltxdoc}
+\setlength\parindent{0pt}
+\setlength\parskip{\smallskipamount}
+%
+\ifx\pdfoutput\undefined\else
+ \ifcase\pdfoutput\else
+ \usepackage{mathptmx,courier}
+ \usepackage[scaled=0.90]{helvet}
+ \fi
+\fi
+%
+\usepackage{caption2}[2004/04/16]
+%
+%<+driver>\OnlyDescription
+%
+\begin{document}
+ \DocInput{caption2.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \newcommand*{\purerm}[1]{{\upshape\mdseries\rmfamily #1}}
+% \newcommand*{\puresf}[1]{{\upshape\mdseries\sffamily #1}}
+% \newcommand*{\purett}[1]{{\upshape\mdseries\ttfamily #1}}
+% \let\package\puresf\def\thispackage{\package{caption2}}
+% \let\env\purett \let\opt\purett
+%
+% \GetFileInfo{caption2.sty}
+% \title{The \thispackage\ package\thanks{This package has version number
+% \fileversion, last revised \filedate.}}
+% \author{Axel Sommerfeldt\\\texttt{caption@sommerfee.de}}
+% \date{2005/11/02}
+% \maketitle
+%
+% \changes{v2.0}{ 9 Oct 95}{New experimental version: Many new commands and features}
+% \changes{v2.0}{ 9 Oct 95}{Support of the longtable package added}
+% \changes{v2.1}{20 Feb 02}{Revised: New commands and options}
+% \changes{v2.1}{26 Feb 02}{Adapted to version 2.1 of the subfigure package}
+% \changes{v2.1a}{12 Nov 03}{Some minor bug fixes and improved compatibility to v2.0}
+% \changes{v2.1b}{16 Apr 04}{Some minor bug fixes and improved compatibility to v2.0}
+% \changes{v2.1c}{10 May 04}{Some minor bug fixes and improved compatibility to v2.0}
+% \changes{v2.1d}{ 3 Oct 05}{Some superfluous brackets removed; warning added}
+%
+% \providecommand\LaTeXcomp{The \LaTeX{} Companion}
+%
+% \section*{This package is obsolete!}
+%
+% The \package{caption2} package used to be an experimental side-version of
+% the regular \package{caption} package. It was made public as beta test version
+% without documentation in 1995 because of the demand for new features and
+% adaptations to other packages like the \package{longtable} and
+% \package{subfigure} package.
+%
+% Even in the next years I found no time to reintegrate some of the
+% well-tried features into the regular \package{caption} package. So I
+% decided to release a version $2.1$ of the \package{caption2} package in 2002
+% instead, which included some minor bug fixes and adaptations to the new
+% version $2.1$ of the \package{subfigure} package. Furthermore I started
+% to write a documentation for this package, but unfortunately did not get
+% very far with this\ldots
+%
+% In 2003 I finally found some (more) time, so a new regular release $3.0$
+% of the \package{caption} package could be build with massive help from
+% Frank Mittelbach\cite{A-W:GMS94} and Steven Cochran\cite{subfigure}.
+% It was released in December 2003 and superseded the neglected
+% \package{caption2} package.
+%
+% {\small (In parallel, Steven Cochran released the \package{subfig} package which
+% superseded the \package{subfigure} package.)}
+%
+% So please don't use this package for new documents. It's old, it's obsolete
+% and it starts to begin smell bad!
+% Please ignore all hints in books or other documents which try to tell you
+% that the \package{caption2} package should be used instead of the
+% \package{caption} package -- these hints are outdated since December 2003.
+%
+% \section*{How to migrate to the regular \package{caption} package?}
+%
+% Usually replacing \package{caption2} by \package{caption} is sufficient
+% because the \package{caption} package emulates most of the options and
+% commands of the \package{caption2} package.
+% If you get some errors or wired results afterwards, please take a closer
+% look at the \package{caption} package documentation which will hopefully
+% help you clearing these problems.
+% If all this should fail you can write me an e-mail asking for help.
+%
+% \section*{What will happen to this package?}
+%
+% The \package{caption2} package is still some kind of supported, that means
+% it will be part of future releases and bugs will still be fixed so existing
+% documents using this package will still compile.
+% But it will \emph{not} be enhanced in the future or adapted to future versions
+% of foreign packages.
+%
+% This means migrating to the actual \package{caption} package should not be
+% necessary for old documents.
+%
+% \StopEventually{}
+%
+% \DoNotIndex{\\,\_,\ ,\@@par}
+% \DoNotIndex{\@classoptionslist,\@currext,\@currname}
+% \DoNotIndex{\@ehc,\@ehd,\@empty,\@expandtwoargs}
+% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
+% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
+% \DoNotIndex{\@ifnextchar,\@ifstar,\@ifundefined,\@latex@error}
+% \DoNotIndex{\@namedef,\@nameuse}
+% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
+% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setpar}
+% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempb,\@tempc}
+% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
+% \DoNotIndex{\p@,\z@}
+% \DoNotIndex{\active,\addtocounter,\addtolength,\advance}
+% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\bgroup,\box}
+% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
+% \DoNotIndex{\edef,\egroup,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
+% \DoNotIndex{\fi,\footnotesize,\global}
+% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
+% \DoNotIndex{\if,\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
+% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
+% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
+% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
+% \DoNotIndex{\next,\nobreakspace,\noexpand,\noindent,\numberline}
+% \DoNotIndex{\normalsize,\or,\par,\parbox,\parfillskip}
+% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\providecommand}
+% \DoNotIndex{\quad}
+% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
+% \DoNotIndex{\rightskip,\rmfamily}
+% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
+% \DoNotIndex{\small,\string,\space,\strut}
+% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
+% \DoNotIndex{\undefined,\unvbox,\uparrow,\upshape,\usebox,\usepackage}
+% \DoNotIndex{\vbox,\vsize,\vskip,\wd,\width,\z@skip}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
+% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
+% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
+% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
+% \DoNotIndex{\ProcessOptions,\ProvidesPackage}
+%
+% \clearpage
+%
+% \section{The Implementation}
+% \iffalse
+%<*package>
+% \fi
+%
+% \subsection{Identificaton}
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesPackage{caption2}[2005/10/03 v2.1d Customising captions (AS)]
+%\PackageWarning{caption2}{THIS PACKAGE IS OBSOLETE, PLEASE USE caption INSTEAD}
+% \end{macrocode}
+%
+% \subsection{Preliminary declarations}
+%
+% \begin{macro}{\captionfont}
+% \begin{macro}{\captionlabelfont}
+% \cs{captionfont} and \cs{captionlabelfont} will hold the font specifications for the caption.
+% \begin{macrocode}
+\newcommand*\captionfont{}
+\newcommand*\captionlabelfont{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\captionlabeldelim}
+% \begin{macro}{\captionlabelsep}
+% \cs{captionlabeldelim} \& \cs{captionlabelsep} will hold the iterim
+% space between caption label and text.
+% (\cs{captionlabeldelim} will be typeset within \cs{captionlabelfont},
+% \cs{captionlabelsep} not.)
+% \begin{macrocode}
+\newcommand*\captionlabeldelim{}
+\newcommand*\captionlabelsep{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\captionsize}
+% The macro \cs{captionsize} is obsolete since v1.4 of the \textsf{caption} package,
+% but we still support it to provide backward compatibility.
+% \begin{macrocode}
+\newcommand*\captionsize{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionmargin}
+% \begin{macro}{\captionwidth}
+% \begin{macro}{\ifcaptionwidth}
+% Either \cs{captionmargin} (with specifies an extra margin) or \cs{captionwidth}
+% (with specifies an explicit width) can be set, therefore we need the flag \cs{ifcaptionwidth}
+% to determine with parameter we should pay attention to.
+% \begin{macrocode}
+\newdimen\captionmargin
+\newdimen\captionwidth
+\newif\ifcaptionwidth
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\captionindent}
+% \cs{captionindent} will be used in caption style \texttt{indent} and specifies the indention
+% after the first line.
+% \begin{macrocode}
+\newdimen\captionindent
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifcaptionlabel}
+% \begin{macro}{\ifonelinecaptions}
+% \begin{macro}{\ifignoreLTcapwidth}
+% More flags. If \cs{ifcaptionlabel} is not set the caption label should be suppressed;
+% we need this flag to support the \cs{caption*} command.
+% If \cs{ifonelinecaptions} is set we support the \LaTeX\ base style 'one line captions',
+% that means the caption will be typeset centered if it fits to one line.
+% If \cs{ifignoreLTcapwidth} is set we ignore the \cs{LTcapwidth} of \textsf{longtable}.
+% \changes{v2.1}{20 Feb 02}{New ifs \cs{ifcaptionlabel} and \cs{ifignoreLTcapwidth}}
+% \begin{macrocode}
+\newif\ifcaptionlabel\captionlabeltrue
+\newif\ifonelinecaptions
+\newif\ifignoreLTcapwidth
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\setcaptionmargin}
+% \begin{macro}{\setcaptionwidth}
+% User-friendly commands to set the caption margin resp.\ width.
+% Note that they additionally set the \cs{ifcaptionwidth} flag.
+% \begin{macrocode}
+\newcommand*\setcaptionmargin{%
+ \captionwidthfalse
+ \setlength\captionmargin}
+\newcommand*\setcaptionwidth{%
+ \captionwidthtrue
+ \setlength\captionwidth}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\normalcaptionparams}
+% \cs{normalcaptionparams} resets all caption related parameters to it's normal default values.
+% \cs{captionfont} will be set to \cs{captionsize} so setting the obsolete \cs{captionsize} will still work.
+% Same story with \cs{captiondelim} and the obsolete \cs{captionlabeldelim}.
+% \changes{v2.1}{29 Jan 02}{New command \cs{normalcaptionparams}}
+% \begin{macrocode}
+\newcommand*\normalcaptionparams{%
+ \let\captionsize\@empty
+ \renewcommand*\captionfont{\captionsize}%
+ \let\captionlabelfont\@empty
+ \renewcommand*\captionlabeldelim{:}%
+ \renewcommand*\captionlabelsep{\space}%
+ \setcaptionmargin\z@\setlength\captionindent\z@
+ \onelinecaptionstrue}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@eh}
+% Some commands will produce an error message, use this as help text.
+% \begin{macrocode}
+\newcommand*\caption@eh{%
+ If you do not understand this error, please take a closer look\MessageBreak
+ at the documentation of the `caption2' package.\MessageBreak
+ \@ehc}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\defcaptionstyle}
+% \begin{macro}{\newcaptionstyle}
+% \begin{macro}{\renewcaptionstyle}
+% These macros will define a new caption style. \cs{newcaptionstyle} and \cs{renewcaptionstyle}
+% will additionally check if the caption style already exists or not.
+% \begin{macrocode}
+\newcommand*\defcaptionstyle[1]{%
+ \@namedef{caption@@#1}}
+%
+\newcommand*\newcaptionstyle[1]{%
+ \expandafter\ifx\csname caption@@#1\endcsname\relax
+ \expandafter\defcaptionstyle
+ \else
+ \PackageError{caption2}{Caption style `#1' already defined}{\caption@eh}%
+ \expandafter\@gobbletwo
+ \fi
+ {#1}}
+%
+\newcommand*\renewcaptionstyle[1]{%
+ \expandafter\ifx\csname caption@@#1\endcsname\relax
+ \PackageError{caption2}{Caption style `#1' undefined}{\caption@eh}%
+ \expandafter\@gobbletwo
+ \else
+ \expandafter\defcaptionstyle
+ \fi
+ {#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\dummycaptionstyle}
+% This macro will also define a new caption style, but a one which is based on the
+% actual set caption style. Therefore you can't set a caption style made with this
+% command with \cs{captionstyle} -- we check this to avoid an endless recursion.
+% \begin{macrocode}
+\newcommand*\dummycaptionstyle[2]{%
+ \defcaptionstyle{#1}{%
+ \expandafter\ifx\csname caption@@\caption@style\expandafter\endcsname%
+ \csname caption@@#1\endcsname
+ \PackageError{caption2}{You can't use the caption style `#1' directy}{%
+ The caption style `#1' is only a dummy and does not really exists.%
+ \MessageBreak You have to redefine it (with \protect\renewcaptionstyle)
+ before you can select\MessageBreak it with \protect\captionstyle.
+ \space\caption@eh}%
+ \else
+ #2\usecaptionstyle\caption@style
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionstyle}
+% \cs{captionstyle} sets the actual caption style. It includes a check if the given caption
+% style is defined or not.
+% \begin{macrocode}
+\newcommand*\captionstyle[1]{%
+ \expandafter\ifx\csname caption@@#1\endcsname\relax
+ \PackageError{caption2}{Undefined caption style `#1'}{\caption@eh}%
+ \else
+ \def\caption@style{#1}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{style `normal'}
+% \begin{macro}{style `center'}
+% \begin{macro}{style `centerlast'}
+% \begin{macro}{style `flushleft'}
+% \begin{macro}{style `flushright'}
+% \begin{macro}{style `hang'}
+% \begin{macro}{style `indent'}
+% The predefined caption styles `normal', `center', `flushleft', `flushright', `centerlast',
+% `hang', `hang+X', and `indent'. Because they are quite similar they all are based on the macro
+% \cs{caption@make}.
+% \begin{macrocode}
+\newcaptionstyle{normal}{\caption@make{normal}}
+\newcaptionstyle{center}{\caption@make{center}}
+\newcaptionstyle{centerlast}{\caption@make{centerlast}}
+\newcaptionstyle{flushleft}{\caption@make{flushleft}}
+\newcaptionstyle{flushright}{\caption@make{flushright}}
+\newcaptionstyle{hang}{\caption@make{hang}}
+\newcaptionstyle{hang+center}{\caption@make{hang@center}}
+\newcaptionstyle{hang+centerlast}{\caption@make{hang@centerlast}}
+\newcaptionstyle{hang+flushleft}{\caption@make{hang@flushleft}}
+\newcaptionstyle{indent}{\caption@make{indent}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@makecaption}
+% Our predefined caption styles. \cs{caption@makecaption} takes the style
+% name as parameter, it does the common stuff and calls a macro
+% (build out of the style name) to do the uncommon stuff if neccessary.
+% \changes{v2.1}{26 Feb 02}{Renamed from \cs{caption@make} to \cs{caption@makecaption}}
+% \changes{v2.1b}{16 Apr 04}{We offer and use \cs{caption@make}, again}
+% \changes{v2.1c}{10 May 04}{Bugfix: Extra \cs{par} added}
+% \begin{macrocode}
+\newcommand*\caption@makecaption[1]{%
+ \usecaptionmargin
+%
+ \ifcaptionlabel
+ \def\caption@label{%
+ {\captionlabelfont\captionlabel\captionlabeldelim}\captionlabelsep}%
+ \else
+ \let\caption@label\@empty
+ \fi
+%
+ \captionfont
+ \onelinecaption
+ {\caption@label\captiontext}%
+ {\parbox[b]\captionlinewidth{\strut\@nameuse{caption@@@#1}\par}\par}}
+\newcommand*\caption@make{\caption@makecaption}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v2.1}{26 Feb 02}{Removed all extra parboxes from caption styles}
+% \changes{v2.1a}{12 Nov 03}{\ldots and put the parbox into \cs{caption@makecaption} instead}
+%
+% \begin{macro}{\caption@@@normal}
+% The `normal' caption style. Just typeset caption (label \& text) as paragraph.
+% \begin{macrocode}
+\newcommand*\caption@@@normal{%
+ \caption@label\captiontext}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@@center}
+% The `center' caption style. Typeset the caption centered within a parbox.
+% \begin{macrocode}
+\newcommand*\caption@@@center{%
+ \centering\caption@label\captiontext}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@@centerlast}
+% The `centerlast' caption style.
+% The idea how to do this was taken from Br\"uggemann-Klein\cite{Anne},
+% it is also mentioned in Kopka\cite[p227]{Kopka-E}.
+% \begin{macrocode}
+\newcommand*\caption@centerlast{%
+ \advance\leftskip by 0pt plus 1fil%
+ \advance\rightskip by 0pt plus -1fil%
+ \parfillskip0pt plus 2fil\relax}
+%
+\newcommand*\caption@@@centerlast{%
+ \caption@centerlast\caption@label\captiontext}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@@flushleft}
+% The `flushleft' caption style. Typeset the caption raggedright within a parbox.
+% \begin{macrocode}
+\newcommand*\caption@@@flushleft{%
+ \raggedright\caption@label\captiontext}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@@flushright}
+% The `flushright' caption style. Typeset the caption raggedleft within a parbox.
+% \begin{macrocode}
+\newcommand*\caption@@@flushright{%
+ \raggedleft\caption@label\captiontext}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@@hang}
+% \begin{macro}{\caption@hangplus}
+% The `hang' caption style.
+% This code was taken from \LaTeXcomp\cite[p155]{A-W:GMS94} and modified.
+% \begin{macrocode}
+\newcommand*\caption@@@hang{%
+ \sbox\@tempboxa{\caption@label}%
+ \hangindent\wd\@tempboxa\noindent
+ \usebox\@tempboxa\caption@hangplus\captiontext}
+%
+\newcommand*\caption@hangplus{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@@@hang@center}
+% The `hang+flushleft' caption style.
+% \begin{macrocode}
+\newcommand*\caption@@@hang@center{%
+ \let\caption@hangplus\centering\caption@@@hang}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@@hang@centerlast}
+% The `hang+flushleft' caption style.
+% \begin{macrocode}
+\newcommand*\caption@@@hang@centerlast{%
+ \let\caption@hangplus\caption@centerlast\caption@@@hang}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@@hang@flushleft}
+% The `hang+flushleft' caption style.
+% \begin{macrocode}
+\newcommand*\caption@@@hang@flushleft{%
+ \let\caption@hangplus\raggedright\caption@@@hang}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@@indent}
+% The `indent' caption style. Is is quite like the `hang' style but the
+% indention is given as \cs{captionindent}.
+% \begin{macrocode}
+\newcommand*\caption@@@indent{%
+ \hangindent\captionindent\noindent
+ \caption@label\captiontext}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Options}
+%
+% \begin{macro}{normal}
+% \begin{macro}{center}
+% \begin{macro}{centerlast,anne}
+% \begin{macro}{flushleft}
+% \begin{macro}{flushright}
+% \begin{macro}{hang,isu}
+% \begin{macro}{indent}
+% These options will set the caption style.
+% (`normal' is the default one.)
+%
+% The options `anne' and `isu' are for
+% backward compatibility only.
+% \begin{macrocode}
+\DeclareOption{normal}{\captionstyle{normal}}
+\DeclareOption{center}{\captionstyle{center}}
+\DeclareOption{centerlast}{\captionstyle{centerlast}}
+\DeclareOption{flushleft}{\captionstyle{flushleft}}
+\DeclareOption{flushright}{\captionstyle{flushright}}
+\DeclareOption{anne}{\ExecuteOptions{centerlast}}
+\DeclareOption{hang}{\captionstyle{hang}}
+\DeclareOption{hang+center}{\captionstyle{hang+center}}
+\DeclareOption{hang+centerlast}{\captionstyle{hang+centerlast}}
+\DeclareOption{hang+flushleft}{\captionstyle{hang+flushleft}}
+\DeclareOption{isu}{\ExecuteOptions{hang}}
+\DeclareOption{indent}{\captionstyle{indent}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{scriptsize}
+% \begin{macro}{footnotesize}
+% \begin{macro}{small}
+% \begin{macro}{normalsize}
+% \begin{macro}{large,Large}
+% These options will set the caption size. We use \cs{g@addto@macro} so more that one
+% option can be set.
+% \begin{macrocode}
+\DeclareOption{scriptsize}{\g@addto@macro\captionsize\scriptsize}
+\DeclareOption{footnotesize}{\g@addto@macro\captionsize\footnotesize}
+\DeclareOption{small}{\g@addto@macro\captionsize\small}
+\DeclareOption{normalsize}{\g@addto@macro\captionsize\normalsize}
+\DeclareOption{large}{\g@addto@macro\captionsize\large}
+\DeclareOption{Large}{\g@addto@macro\captionsize\Large}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{up,it,sl,sc}
+% \begin{macro}{md,bf}
+% \begin{macro}{rm,sf,tt}
+% These options will set the caption label.
+% \begin{macrocode}
+\DeclareOption{up}{\g@addto@macro\captionlabelfont\upshape}
+\DeclareOption{it}{\g@addto@macro\captionlabelfont\itshape}
+\DeclareOption{sl}{\g@addto@macro\captionlabelfont\slshape}
+\DeclareOption{sc}{\g@addto@macro\captionlabelfont\scshape}
+\DeclareOption{md}{\g@addto@macro\captionlabelfont\mdseries}
+\DeclareOption{bf}{\g@addto@macro\captionlabelfont\bfseries}
+\DeclareOption{rm}{\g@addto@macro\captionlabelfont\rmfamily}
+\DeclareOption{sf}{\g@addto@macro\captionlabelfont\sffamily}
+\DeclareOption{tt}{\g@addto@macro\captionlabelfont\ttfamily}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{oneline}
+% \begin{macro}{nooneline}
+% These options will set the `oneline' flag.
+% (`oneline' is the default.)
+% \begin{macrocode}
+\DeclareOption{oneline}{\onelinecaptionstrue}
+\DeclareOption{nooneline}{\onelinecaptionsfalse}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@package}
+% A helper macro, a value of 1 within parameter \#2 will activate the support
+% of the package given in parameter \#1, a value of 0 will deactivate it.
+% \begin{macrocode}
+\newcommand*\caption@package[1]{\@namedef{caption@pkt@#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{float}
+% \begin{macro}{longtable}
+% \begin{macro}{subfigure}
+% \changes{v2.1}{19 Feb 02}{New options for interaction with other packages}
+% These options will enable or suppress the support of the packages
+% \textsf{float}, \textsf{longtable}, and \textsf{subfigure}.
+% \begin{macrocode}
+\DeclareOption{float}{\caption@twozerofalse\caption@package{float}{1}}
+\DeclareOption{longtable}{\caption@twozerofalse\caption@package{longtable}{1}}
+\DeclareOption{subfigure}{\caption@twozerofalse\caption@package{subfigure}{1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{none}
+% \begin{macro}{all}
+% These options will enable or suppress the support of all the above packages.
+% \begin{macrocode}
+\DeclareOption{none}{\caption@twozerofalse
+ \caption@package{float}{0}\caption@package{longtable}{0}%
+ \caption@package{subfigure}{0}}
+\DeclareOption{all}{\ExecuteOptions{float,longtable,subfigure}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{ruled}
+% \begin{macro}{boxed}
+% The option `ruled' introduced in \textsf{caption} v1.2 is obsolete now, but
+% we will still support it. The option `boxed' was introduced in version 2.0
+% and is obsolete now, too.
+% \begin{macrocode}
+\newif\ifcaption@ruled
+\DeclareOption{ruled}{\caption@ruledtrue}
+\DeclareOption{boxed}{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{ignoreLTcapwidth}
+% This option will make the caption code ignore the setting of \cs{LTcapwidth}
+% and use the setting of \cs{setcaptionmargin} or \cs{setcaptionwidth} instead.
+% \begin{macrocode}
+\DeclareOption{ignoreLTcapwidth}{\ignoreLTcapwidthtrue}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{debug}
+% This option will put additional debug information in the log file.
+% \begin{macrocode}
+\DeclareOption{debug}{\caption@debugtrue}
+% \end{macrocode}
+% \end{macro}
+%
+% That's it! Now set the default values and start processing the options.
+% (If \cs{caption@twozero} is set to true (default) we will emulate the package
+% load algorithm of \textsf{caption} v2.0: If the package is already loaded
+% patch it, otherwise do nothing.)
+% \changes{v2.1}{19 Feb 02}{\cs{ProcessOptions} changed to \cs{ProcessOptions*}}
+% \begin{macrocode}
+\newif\ifcaption@debug
+\newif\ifcaption@twozero
+\normalcaptionparams
+\ExecuteOptions{none,normal}
+\caption@twozerotrue
+\ProcessOptions*
+\ifcaption@twozero
+ \PackageInfo{caption2}{Running in caption2 v2.0 compatibility mode}
+\fi
+% \end{macrocode}
+%
+% \subsection{More declarations}
+%
+% \begin{macro}{\captionof}
+% \begin{macro}{\captionof*}
+% \cs{captionof} resp.\ \cs{captionof*} will just set \cs{@captype} and do the normal
+% \cs{caption} resp.\ \cs{caption*}, so we can also typeset captions outside floating
+% environments.
+% \changes{v2.1}{19 Feb 02}{New commands \cs{captionof} and \cs{captionof*}}
+% \begin{macrocode}
+\def\captionof{\@ifstar{\caption@of{\caption*}}{\caption@of\caption}}
+\newcommand*\caption@of[2]{\def\@captype{#2}#1}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\abovecaptionskip}
+% \begin{macro}{\belowcaptionskip}
+% Not all document classes define \cs{abovecaptionskip} and \cs{belowcaptionskip}
+% (like \textsf{ucthesis}), so we do it here if not already done.
+% \changes{v2.1}{19 Feb 02}{\cs{abovecaptionskip} and \cs{belowcaptionskip} will be defined if neccessary}
+% \begin{macrocode}
+\@ifundefined{abovecaptionskip}{%
+ \newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@}}{}
+\@ifundefined{belowcaptionskip}{%
+ \newlength\belowcaptionskip\setlength\belowcaptionskip{0\p@}}{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\captionlinewidth}
+% \changes{v2.1}{26 Feb 02}{Renamed from \cs{realcaptionwidth} to \cs{captionlinewidth}}
+% \changes{v2.1a}{12 Nov 03}{We offer \cs{realcaptionwidth}, again}
+% \begin{macro}{\captionlabel}
+% \begin{macro}{\captiontext}
+% These values are only set and used within the caption code itself.
+% \cs{captionlinewidth} will be set to the given vertical space for the caption,
+% normally this is \cs{linewidth}. (This value was called \cs{realcaptionwidth}
+% within \thispackage\ \mbox{2.0}, so we will offer this, too.)
+%
+% \cs{captionlabel} and \cs{captiontext} will be set to the caption label
+% resp.\ the caption text.
+% (Because \cs{captionlabel} and \cs{captiontext} will be locally defined with
+% \cs{def} we do not need to define them here.)
+% \begin{macrocode}
+\newdimen\captionlinewidth
+\newdimen\realcaptionwidth
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\usecaptionmargin}
+% A helper macro for caption style authors:
+% It calculates \cs{leftskip} and \cs{rightskip} out of
+% \cs{captionlinewidth} and \cs{captionmargin} resp.\ \cs{captionwidth}.
+% Also \cs{captionlinewidth} will be corrected to the appropriate value.
+% \begin{macrocode}
+\newcommand*\usecaptionmargin{%
+ \ifcaptionwidth
+ \leftskip\captionlinewidth
+ \advance\leftskip by -\captionwidth
+ \divide\leftskip by 2
+ \rightskip\leftskip
+ \captionlinewidth\captionwidth
+ \else
+ \leftskip\captionmargin
+ \rightskip\captionmargin
+ \advance\captionlinewidth by -2\captionmargin
+ \fi
+ \realcaptionwidth\captionlinewidth}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\onelinecaption}
+% This macro definition helps setting captions the \LaTeX\ base classes way:
+% If \cs{ifonelinecaptions} is set and the 1st argument fits within \cs{captionlinewidth},
+% we typeset it centered -- otherway we typeset the 2nd argument.
+% (We use the savebox \cs{@tempboxa} as helper for this.)
+% \begin{macrocode}
+\newcommand\onelinecaption[1]{%
+ \let\next\@firstofone
+ \ifonelinecaptions
+ \sbox\@tempboxa{#1}%
+ \ifdim\wd\@tempboxa >\captionlinewidth
+ \else
+ \def\next{{\centering\usebox\@tempboxa\par}\@gobble}%
+ \fi
+ \fi\next}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\usecaptionstyle}
+% First we check if we are inside a caption -- if \cs{captiontext} is undefined we are not.
+% If we are we call the appropriate caption definition.
+%
+% \changes{v2.1b}{16 Apr 04}{Missing percent added (and extra space removed)}
+% \begin{macrocode}
+\newcommand*\usecaptionstyle[1]{%
+ \@ifundefined{captiontext}{%
+ \PackageError{caption2}{You can't use \protect#1
+ in normal text}{The usage of \protect#1 is only
+ allowed inside code declared with\MessageBreak \protect\defcaptionstyle,
+ \protect\newcaptionstyle \space or \protect\renewcaptionstyle.
+ \space\caption@eh}
+ }{%
+ \@ifundefined{caption@@#1}%
+ {\PackageError{caption2}{Caption style `#1' undefined}{\caption@eh}}%
+ {\@nameuse{caption@@#1}}%
+ }}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makecaption}
+% This is the heart of the \thispackage\ package -- the redefinition of the
+% core caption code. It was taken from the \LaTeXe\ standard classes and modified.
+% It's very easy -- apart from using \cs{abovecaptionskip} and \cs{belowcaptionskip}
+% we just set \cs{captionlinewidth}, \cs{captionlabel} and \cs{captiontext}
+% to its appropriate values and using the code of the actual caption style via
+% \cs{usecaptionstyle}.
+% \begin{macrocode}
+\renewcommand\@makecaption[2]{%
+ \vskip\abovecaptionskip
+ \captionlinewidth\hsize
+ \realcaptionwidth\hsize
+ \def\captionlabel{#1}%
+ \def\captiontext{#2}%
+ \usecaptionstyle\caption@style
+ \vskip\belowcaptionskip}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Support of other packages}
+%
+% \begin{macro}{\caption@package}
+% This macro will execute the code needed to support the package
+% named within argument \#1. The parameter \#2 is the command
+% which shows if the package is loaded -- it is defined, it is
+% already loaded, otherwise not. The parameter \#3 contains code
+% which will be executed if no support is required -- this is for
+% cleanup purposes. The final parameter \#4 contains the code itself.
+% \changes{v2.1c}{9 May 04}{Compatibility warning removed}
+% \begin{macrocode}
+\renewcommand*\caption@package[3]{%
+ \if1\@nameuse{caption@pkt@#1}%
+ \@ifundefined{#2}%
+ {\let\next\AtBeginDocument}%
+ {\let\next\@firstofone}%
+ \else\ifcaption@twozero
+ \@ifundefined{#2}%
+ {#3\let\next\@gobble}%
+ {\let\next\@firstofone}%
+ \else
+ #3\let\next\@gobble
+ \fi\fi
+ \expandafter\let\csname caption@pkt@#1\endcsname\undefined
+ \ifcaption@debug
+ \ifx\next\@gobble\PackageInfo{caption2}{#1 => gobble}%
+ \else\ifx\next\@firstofone\PackageInfo{caption2}{#1 => firstofone}%
+ \else\ifx\next\AtBeginDocument\PackageInfo{caption2}{#1 => AtBeginDocument}%
+ \fi\fi\fi
+ \fi
+ \next}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Support of the \puresf{float} package}
+%
+% \begin{macrocode}
+\caption@package{float}{floatc@plain}{}{%
+ \ifx\floatc@plain\relax
+ \PackageWarning{caption2}{%
+ Option `float' was set but there is no float package loaded}
+ \else
+ \PackageInfo{caption2}{float package v1.2 (or newer) detected}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@floatc}
+% First we define a helper macro to typeset the caption via \cs{usecaptionstyle},
+% the 1st parameter is the caption style name,
+% the 2nd and 3rd are the caption label and text.
+%
+% \textsf{caption2} has the goal not to modify the output just by
+% loading it (without options), therefore we have to be tricky here to
+% support \cs{@fs@cfont} which is in fact the same as our \cs{captionlabelfont}.
+% So we test if a \cs{captionlabelfont} has been set by the user -- if not
+% \cs{@fs@cfont} will be used, otherwise \cs{captionlabelfont}.
+%
+% \changes{v2.1b}{19 Mar 04}{\cs{realcaptionwidth}$=$\cs{hsize} was missing here}
+% \begin{macrocode}
+ \newcommand\caption@floatc[3]{%
+ \ifx\captionlabelfont\@empty
+ \let\captionlabelfont\@fs@cfont
+ \fi
+ \captionlinewidth\hsize
+ \realcaptionwidth\hsize
+ \def\captionlabel{#2}%
+ \def\captiontext{#3}%
+ \usecaptionstyle{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\floatc@plain}
+% Now we can redefine the caption code of the \textsf{float} package.
+% Here we redefine \cs{floatc@plain} to use our caption code, so
+% \texttt{plain} and \texttt{boxed} float types will use the actual
+% caption style set by the user.
+% \begin{macrocode}
+ \renewcommand*\floatc@plain{\caption@floatc{\caption@style}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\floatc@ruled}
+% The support of the \texttt{ruled} float type is a little
+% more complex. First we define a caption style `ruled' so the end-user
+% can change this caption style afterwards. If the (obsolete) option
+% `ruled' is set, we define it in a \textsf{caption} v1.x compatible way,
+% otherwise we define it in a \textsf{float} compatible way.
+%
+% Then we redefine \cs{floatc@ruled} so the caption style `ruled' will
+% be used.
+% \begin{macrocode}
+ \ifcaption@ruled
+ \dummycaptionstyle{ruled}{\onelinecaptionsfalse\setcaptionmargin{\z@}}%
+ \else
+ \newcaptionstyle{ruled}{%
+ \ifcaptionlabel
+ {\@fs@cfont\captionlabel}\space%
+ \fi\captiontext\par}%
+ \fi
+%
+ \renewcommand*\floatc@ruled{\caption@floatc{ruled}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@of}
+% Typesetting captions outside floats is not so easy with redefined floats,
+% because
+% \begin{itemize}
+% \item The caption code of the \textsf{float} package needs not only
+% \cs{@captype} defined, but \cs{@fs@capt} (the command which will typeset the
+% caption itself) either.
+% \item The caption is only saved within a \cs{vbox}, so the \textsf{float}
+% package can typeset the caption later at it's float style specific place
+% (that means at top or at the bottom of the float).
+% \end{itemize}
+%
+% Here is the new code: First we check if it's a restyled float by checking if
+% \cs{fst@<floattype>} is defined. If yes, we use this command (it will define
+% \cs{@fs@capt}).
+% Then we execute \cs{@float@setevery}, if it exists (that means we are
+% dealing with the \textsf{float} package 1.3 or newer here).
+% Now comes the basic trick:
+% We redefine the caption typesetting command \cs{@fs@capt}, so it will close
+% the \cs{vbox}, typeset the caption outside the vbox and finally start the
+% group again so the original \cs{@fs@capt} is happy with closing the group.
+%
+% \begin{macrocode}
+ \renewcommand*\caption@of[2]{\def\@captype{#2}%
+ \@ifundefined{fst@#2}{}{%
+ \@nameuse{fst@#2}%
+ \@ifundefined{@float@setevery}{}{\@float@setevery{#2}}%
+ \let\caption@fs@capt\@fs@capt
+ \let\@fs@capt\caption@of@float}%
+ #1}
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \newcommand\caption@of@float[2]{\egroup
+ \vskip\abovecaptionskip
+ \normalsize\caption@fs@capt{#1}{#2}%
+ \vskip\belowcaptionskip
+ \bgroup}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \fi}
+% \end{macrocode}
+%
+% \subsubsection{Support of the \puresf{longtable} package}
+%
+% \begin{macrocode}
+\caption@package{longtable}{LT@makecaption}{}{%
+ \ifx\LT@makecaption\relax
+ \PackageWarning{caption2}{%
+ Option `longtable' was set but there is no longtable package loaded}
+ \else
+ \PackageInfo{caption2}{longtable package v3.15 (or newer) detected}
+% \end{macrocode}
+%
+% \begin{macro}{\LT@makecaption}
+% David Carlisle was so kind to introduce a macro called
+% \cs{LT@makecaption} in version 3.15 of the \textsf{longtable}
+% package which typeset the caption and can be easily redefined.
+%
+% This is the original definition:
+% \begin{quote}
+% |\def\LT@makecaption#1#2#3{%|\\
+% | \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{%|\\
+% | |$\langle$\textit{typeset} |#1{#2: }#3| \textit{as caption}$\rangle$\\
+% | \endgraf\vskip\baselineskip}%|\\
+% | \hss}}}|
+% \end{quote}
+%
+% So we do here:
+% First we define a new (dummy) caption style `longtable',
+% than we redefine \cs{LT@makecaption} so this style will be used.
+% (Remember: |#1| is |\@gobble| in star form of |\caption|,
+% and |\@firstofone| otherwise.)
+% \begin{macrocode}
+ \dummycaptionstyle{longtable}{}
+%
+ \renewcommand\LT@makecaption[3]{%
+ \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\hsize{%
+ \ifignoreLTcapwidth
+ \else
+ \setcaptionwidth\LTcapwidth
+ \fi
+ \captionlinewidth\hsize
+ \realcaptionwidth\hsize
+ \captionlabelfalse#1\captionlabeltrue
+ \def\captionlabel{#2}%
+ \def\captiontext{#3}%
+ \usecaptionstyle{longtable}%
+ \endgraf\vskip\baselineskip}%
+ \hss}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \fi}
+% \end{macrocode}
+%
+% \subsubsection{Support of the \puresf{subfigure} package}
+%
+% Some of the following code will not work within \cs{if},
+% because of the (yet) undefined \cs{if}\textit{xxx}s. So we simply define
+% the critical code within the helper commands \cs{setsubcapstyle}
+% and \cs{caption@makesubcaption} already here.
+%
+% \begin{macro}{\setsubcapstyle}
+% This sets the subcaptionstyle to a appropriate value.
+%
+% If \cs{ifsubcapraggedright} is undefined (it was introduced
+% into v2.1 of the \textsf{subfigure} package) we define it first.
+% \begin{macrocode}
+\newcommand*\setsubcapstyle{%
+ \@ifundefined{subcapraggedrightfalse}{%
+ \newif\ifsubcapraggedright}{}%
+ \ifsubcaphang
+ \ifsubcapcenter
+ \subcapstyle{hang+center}%
+ \else\ifsubcapcenterlast
+ \subcapstyle{hang+centerlast}%
+ \else\ifsubcapraggedright
+ \subcapstyle{hang+flushleft}%
+ \else
+ \subcapstyle{hang}%
+ \fi\fi\fi
+ \else\ifsubcapcenter
+ \subcapstyle{center}%
+ \else\ifsubcapcenterlast
+ \subcapstyle{centerlast}%
+ \else\ifsubcapraggedright
+ \subcapstyle{flushleft}%
+ \else
+ \subcapstyle{normal}%
+ \fi\fi\fi\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makesubcaption}
+% This will typeset the subcaption.
+% We just set all our \cs{caption}\textit{xxx} values to
+% the values of \cs{subcap}\textit{xxx} and typeset the
+% caption like \textsf{subfigure} within a \cs{hbox},
+% but with the help of \cs{usecaptionstyle}.
+%
+% But this is not as easy as it seems. We typeset the caption like this:
+% \begin{quote}
+% |\captionfont|\\
+% | {\capionlabelfont\captionlabel\captionlabeldelim}%|\\
+% |\captionlabelsep\captiontext|
+% \end{quote}
+% Within \textsf{subfigure} 2.0 the caption will be set quite similar to:
+% \begin{quote}
+% |\subcapsize|\\
+% | {\subcaplabelfont\captionlabel}%|\\
+% |\space\captiontext|
+% \end{quote}
+% But within \textsf{subfigure} 2.1 this has changed to:
+% \begin{quote}
+% |\subcapsize|\\
+% | {\subcaplabelfont\captionlabel}%|\\
+% |\hskip\subfiglabelskip|\\
+% | {\subcapfont\captiontext}}|
+% \end{quote}
+% So we have to be tricky here: We set \cs{captionlabelfont} to \cs{normalfont} plus
+% \cs{subcapsize} \& \cs{subcaplabelfont}, so the font setting in \cs{captionfont}
+% will not affect the caption label in subfigure captions.
+%
+% Note that \cs{hfil} has changed to \cs{hss} from subfigure 2.0 to 2.1,
+% so we use \cs{caption@subfig@hss} instead. (We will define this later on.)
+% \begin{macrocode}
+\newcommand\caption@makesubcaption[2]{%
+ \renewcommand*\captionfont{\subcapsize\subcapfont}%
+ \renewcommand*\captionlabelfont{\normalfont\subcapsize\subcaplabelfont}%
+ \let\captionlabeldelim\subcaplabeldelim
+ \let\captionlabelsep\subcaplabelsep
+ \ifsubfigcapwidth\captionwidthtrue\else\captionwidthfalse\fi
+ \setlength\captionmargin\subfigcapmargin
+ \setlength\captionwidth\subfigcapwidth
+ \captionindent\subcapindent
+ \ifsubcapnooneline\onelinecaptionsfalse\else\onelinecaptionstrue\fi
+ \hbox to\@tempdima{%
+ \caption@subfig@hss\parbox[t]\@tempdima{%
+ \captionlinewidth\@tempdima
+ \realcaptionwidth\@tempdima
+ \captionlabeltrue
+ \def\captionlabel{#1}%
+ \def\captiontext{\ignorespaces #2}%
+ \usecaptionstyle\caption@substyle}%
+ \caption@subfig@hss}}
+% \end{macrocode}
+% \end{macro}
+%
+% If the subfigure support is not needed, we throw
+% the helper macros in the garbage can.
+%
+% \begin{macrocode}
+\caption@package{subfigure}{@makesubfigurecaption}{%
+ \let\setsubcapstyle\undefined
+ \let\caption@makesubcaption\undefined}{%
+ \ifx\@makesubfigurecaption\relax
+ \PackageWarning{caption2}{%
+ Option `subfigure' was set but there is no subfigure package loaded}
+ \let\setsubcapstyle\undefined
+ \let\caption@makesubcaption\undefined
+ \else
+% \end{macrocode}
+%
+% Some stuff has changed from version 2.0 to 2.1 of the
+% \textsf{subfigure} package, so we make a branch here.
+% If \cs{subcapfont} is undefined we assume v2.0,
+% otherwise we assume v2.1 or newer.
+%
+% \begin{macrocode}
+ \ifx\subcapfont\undefined
+ \PackageInfo{caption2}{subfigure package v2.0 detected}
+% \end{macrocode}
+%
+% \begin{macro}{\subcapfont}
+% We define \cs{subcapfont} here so we can use it later
+% in common code for \textsf{subfigure} v2.0 and v2.1 (or newer).
+% \begin{macrocode}
+ \let\subcapfont\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\subfigcapwidth}
+% \begin{macro}{\setsubcapmargin}
+% \begin{macro}{\setsubcapwidth}
+% Analogous to \cs{captionwidth}, \cs{setcaptionmargin}, and
+% \cs{setcaptionwidth} we define \cs{subfigcapwidth},
+% \cs{setsubcapmargin}, and \cs{setsubcapwidth}.
+%
+% Note: \cs{subfigcapmargin} is a command in v2.0 of \textsf{subfigure}.
+% So we make \cs{subfigcapwidth} a command, too.
+% \begin{macrocode}
+ \newcommand*\subfigcapwidth{\z@}
+ \newcommand*\setsubcapmargin{%
+ \subfigcapwidthfalse
+ \renewcommand*\subfigcapmargin}
+ \newcommand*\setsubcapwidth{%
+ \subfigcapwidthtrue
+ \renewcommand*\subfigcapwidth}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\subcaplabelsep}
+% Analogous to \cs{captionlabelsep} we define \cs{subcaplabelsep}.
+% \begin{macrocode}
+ \newcommand*\subcaplabelsep{\space}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@subfig@hss}
+% This will be uses within the caption code itself.
+% \begin{macrocode}
+ \let\caption@subfig@hss\hfil
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \else
+ \PackageInfo{caption2}{subfigure package v2.1 (or newer) detected}
+% \end{macrocode}
+%
+% \begin{macro}{\subfigcapwidth}
+% \begin{macro}{\setsubcapmargin}
+% \begin{macro}{\setsubcapwidth}
+% Analogous to \cs{captionwidth}, \cs{setcaptionmargin}, and
+% \cs{setcaptionwidth} we define \cs{subfigcapwidth},
+% \cs{setsubcapmargin}, and \cs{setsubcapwidth}.
+%
+% Note: \cs{subfigcapmargin} is a length in v2.1 of \textsf{subfigure}.
+% So we make \cs{subfigcapwidth} a length, too.
+% \begin{macrocode}
+ \newdimen\subfigcapwidth
+ \newcommand*\setsubcapmargin{%
+ \subfigcapwidthfalse
+ \setlength\subfigcapmargin}
+ \newcommand*\setsubcapwidth{%
+ \subfigcapwidthtrue
+ \setlength\subfigcapwidth}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\subcaplabelsep}
+% Analogous to \cs{captionlabelsep} we define \cs{subcaplabelsep}.
+% \begin{macrocode}
+ \newcommand*\subcaplabelsep{\hskip\subfiglabelskip}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@subfig@hss}
+% This will be uses within the caption code itself.
+% \begin{macrocode}
+ \let\caption@subfig@hss\hss
+% \end{macrocode}
+%
+% \end{macro}
+% \begin{macrocode}
+ \fi
+% \end{macrocode}
+%
+% Here starts the common code for \textsf{subfigure} v2.0 and v2.1.
+%
+% \begin{macro}{\ifsubfigcapwidth}
+% \begin{macro}{\subcapindent}
+% \begin{macro}{\subcaplabeldelim}
+% Analogous to \cs{ifcaptionwidth}, \cs{captionindent} \& \cs{captionlabeldelim}
+% we define \cs{ifsubfigcapwidth}, \cs{subcapindent} \& \cs{subcaplabeldelim}
+% \begin{macrocode}
+ \newif\ifsubfigcapwidth
+ \newdimen\subcapindent
+ \newcommand*\subcaplabeldelim{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\subcapstyle}
+% Analogous to \cs{captionstyle} we define \cs{subcapstyle}
+% and set it (via \cs{setsubcapstyle}) to a appropriate value.
+% \begin{macrocode}
+ \newcommand*\subcapstyle[1]{%
+ \expandafter\ifx\csname caption@@#1\endcsname\relax
+ \PackageError{caption2}{Undefined caption style `#1'}{\caption@eh}%
+ \else
+ \def\caption@substyle{#1}%
+ \fi}
+ \setsubcapstyle
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@thesubfigure}
+% \begin{macro}{\@thesubtable}
+% The \textsf{subfigure} package makes use of \cs{subcaplabelfont} and
+% \cs{subfiglabelskip} within its \cs{@thesub}\textit{xxx} macros.
+% This is totally in contrast to the way the \textsf{caption2} package
+% handle these settings. So we redefine the \cs{@thesub}\textit{xxx}
+% to be just the plain label and nothing else.
+%
+% \begin{macrocode}
+ \renewcommand*\@thesubfigure{\thesubfigure}
+ \renewcommand*\@thesubtable{\thesubtable}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@makesubfigurecaption}
+% \begin{macro}{\@makesubtablecaption}
+% Now we are ready to redefine \cs{@makesubfigurecaption}.
+% \begin{macrocode}
+ \let\@makesubfigurecaption\caption@makesubcaption
+ \let\@makesubtablecaption\caption@makesubcaption
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+ \fi}
+% \end{macrocode}
+%
+% That's all folks!
+%
+% \begin{macrocode}
+\let\caption@package\undefined
+% \end{macrocode}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \begin{thebibliography}{9}
+% \bibitem{float}
+% Anselm Lingnau:
+% \textsl{An Improved Environment for Floats},
+% 2001/11/08
+% \bibitem{longtable}
+% David Carlisle:
+% \textsl{The longtable package},
+% 2000/10/22
+% \bibitem{rotating}
+% Sebastian Rahtz and Leonor Barroca:
+% \textsl{A style option for rotated objects in \LaTeX},
+% 1997/09/26
+% \bibitem{subfigure}
+% Steven Douglas Cochran:
+% \textsl{The subfigure package},
+% 2002/02/14
+% \bibitem{A-W:GMS94}
+% Michel Goossens, Frank Mittelbach and Alexander Samarin:
+% \newblock \textsl{The {\LaTeX} Companion},
+% \newblock Addison-Wesley, Reading, Massachusetts, 1994.
+% \bibitem{Anne}
+% Anne Br\"uggemann-Klein:
+% \textsl{Einf\"uhrung in die Dokumentverarbeitung},
+% B.G. Teubner, Stuttgart, 1989
+% \bibitem{Kopka-E}
+% Helmut Kopka:
+% \textsl{\LaTeX -- Erweiterungsm\"oglichkeiten},
+% 3. \"uberarbeitete Auf\/lage, Addison-Wesley, Bonn, 1991
+% \end{thebibliography}
+%
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/caption/fallback/v3.0/caption.dtx b/Master/texmf-dist/source/latex/caption/fallback/v3.0/caption.dtx
new file mode 100644
index 00000000000..7f7b4a49d1b
--- /dev/null
+++ b/Master/texmf-dist/source/latex/caption/fallback/v3.0/caption.dtx
@@ -0,0 +1,5077 @@
+% \iffalse meta-comment
+%
+% This is file `caption.dtx'.
+%
+% Copyright (C) 1994-2007 Axel Sommerfeldt (caption@sommerfee.de)
+%
+% --------------------------------------------------------------------------
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Axel Sommerfeldt.
+%
+% This work consists of the files caption.ins, caption.dtx,
+% caption2.dtx, and anleitung.tex and the derived files
+% caption.sty, caption2.sty, caption3.sty, and manual.tex.
+%
+% \fi
+% \CheckSum{2178}
+%
+% \iffalse
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\documentclass{ltxdoc}
+\setlength\parindent{0pt}
+\setlength\parskip{\smallskipamount}
+%
+\newcommand\NEWfeature{\NEW{New feature}}
+\newcommand\NEWdescription{\NEW{New description}}
+\newcommand\NEW[2]{\hskip 1sp \marginpar{\footnotesize\sffamily\raggedleft#1\\#2}}
+%
+\font\manual=manfnt
+\newcommand\DANGER{\hskip 1sp \marginpar{\raggedleft\textcolor{blue}{{\manual\char127}}}}
+%
+\ifx\pdfoutput\undefined\else
+ \ifcase\pdfoutput\else
+ \usepackage{mathptmx,courier}
+ \usepackage[scaled=0.90]{helvet}
+ \addtolength\marginparwidth{15pt}
+ \fi
+\fi
+%
+%\usepackage[french,USenglish]{babel}
+\usepackage{color,setspace}
+%
+%\usepackage{float}
+\usepackage{longtable}
+%\usepackage[raggedright]{sidecap}
+%
+\usepackage{caption}[2005/08/24]
+\DeclareCaptionLabelSeparator{endash}{\space\textendash\space}
+\usepackage{hyperref}
+%
+\DeclareCaptionFont{red}{\color{red}}
+\DeclareCaptionFont{green}{\color{green}}
+\DeclareCaptionFont{blue}{\color{blue}}
+%
+\DeclareCaptionLabelSeparator{period-newline}{. \\}
+\DeclareCaptionStyle{period-newline}[labelsep=period]{labelsep=period-newline}
+\DeclareCaptionStyle{period-newline2}[labelsep=period,justification=centering]{labelsep=period-newline}
+\DeclareCaptionStyle{period-newline3}[labelsep=period]{labelsep=period-newline,justification=centering}
+\DeclareCaptionFormat{reverse}{#3#2#1}
+\DeclareCaptionFormat{llap}{\llap{#1#2}#3\par}
+\DeclareCaptionLabelFormat{fullparens}{(\bothIfFirst{#1}{ }#2)}
+\DeclareCaptionLabelSeparator{fill}{\hfill}
+%
+\DeclareRobustCommand{\KOMAScript}{\textsf{K\kern.05em O\kern.05em%
+ M\kern.05em A\kern.1em-\kern.1em Script}}
+%
+%<+driver>\OnlyDescription
+%
+\begin{document}
+ \DocInput{caption.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \newcommand*\purerm[1]{{\upshape\mdseries\rmfamily #1}}
+% \newcommand*\puresf[1]{{\upshape\mdseries\sffamily #1}}
+% \newcommand*\purett[1]{{\upshape\mdseries\ttfamily #1}}
+% \let\package\puresf\def\thispackage{\package{caption}}
+% \let\env\purett \let\opt\purett
+%
+% \newcommand*\version[2][]{$v#2$}
+%
+% \newenvironment{Options}[1]%
+% {\list{}{\renewcommand{\makelabel}[1]{\texttt{##1}\hfil}%
+% \settowidth{\labelwidth}{\texttt{#1\space}}%
+% \setlength{\leftmargin}{\labelwidth}%
+% \addtolength{\leftmargin}{\labelsep}}}%
+% {\endlist}
+%
+% \newenvironment{Example}%
+% {\ifvmode\else\unskip\par\fi
+% \minipage{\linewidth}\smallskip}%
+% {\smallskip\endminipage}
+% \newcommand\example[3][figure]{%
+% \begingroup
+% \captionsetup{#2}%
+% \captionof{#1}[]{#3}%
+% \endgroup}
+%
+% \GetFileInfo{caption.sty}
+% \title{Typesetting captions with the
+% \thispackage\ package\thanks{This package has version number
+% \fileversion, last revised \filedate.}}
+% \author{Axel Sommerfeldt\\\href{mailto:caption@sommerfee.de}{\texttt{caption@sommerfee.de}}}
+% \date{2007/04/09}
+% \maketitle
+%
+% \begin{abstract}
+% The \thispackage\ package offers customization of captions
+% in floating environments such |figure| and |table| and cooperates with
+% many other packages.\footnote{A complete re-work of the user interface
+% done with Steven D. Cochran and Frank Mittelbach has lead to
+% this new enhanced version 3.0.}
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \newcommand\figuretext{^^A
+% White sand beaches. The pink smoothness of the conch shell. A sea abundant
+% with possibilities. Duty-free shops filled with Europe's finest gifts and
+% perfumes. Play your favorite game of golf amidst the tropical greens on one
+% of the many championship courses.}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \section{Introduction}
+%
+% Within the standard \LaTeX\ classes captions haven't received the attention
+% they deserve. Simply typeset as an ordinary paragraph there is no
+% remarkable visual difference from the rest of the text, like here:
+%
+% \example{belowskip=\abovecaptionskip}{\figuretext}
+%
+% There should be possibilities to change this; for example, it would be nice
+% if you could make the text of the caption a little bit smaller as the normal
+% text, add an extra margin, typeset the caption label with the same font
+% family and shape as your headings etc. Just like this one:
+%
+% \example{belowskip=\abovecaptionskip,size=small,margin=10pt,labelfont=bf,labelsep=endash}{\figuretext}
+%
+% You can do this easily with this package as there are many ready-to-use
+% caption formatting options, but you are free to define your very own stuff, too.
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \pagebreak[4]
+% \section{Using the package}
+% \label{usage}
+%
+% \DescribeMacro{\usepackage}
+% Insert
+% \begin{quote}
+% |\usepackage|\oarg{options}|{caption}[|\texttt{\filedate}|]|
+% \end{quote}
+% into the preamble of your document, i.e.~the part of your document
+% between |\documentclass| and |\begin{document}|.
+% The options control how your captions will look like; e.g.,
+% \begin{quote}
+% |\usepackage[margin=10pt,font=small,labelfont=bf]{caption}|
+% \end{quote}
+% would result in captions looking like the second one in the introduction.
+%
+% \DescribeMacro{\captionsetup}
+% For a later change of options the \thispackage\ package provides the command
+% \begin{quote}
+% |\captionsetup|\oarg{float type}\marg{options}
+% \end{quote}
+% So
+% \begin{quote}
+% |\usepackage[margin=10pt,font=small,labelfont=bf]{caption}|
+% \end{quote}
+% and
+% \begin{quote}
+% |\usepackage{caption}|\\
+% |\captionsetup{margin=10pt,font=small,labelfont=bf}|
+% \end{quote}
+% are equal in their results.
+%
+% It's good to know that |\captionsetup| has an effect on the current
+% environment only. So if you want to change some settings for the
+% current |figure| or |table| only, just place the |\captionsetup| command
+% inside the |figure| or |table| right before the |\caption| command.
+% For example
+% \begin{quote}
+% |\begin{figure}|\\
+% | |\ldots\\
+% | \captionsetup{singlelinecheck=off}|\\
+% | \caption{|\ldots|}|\\
+% |\end{figure}|
+% \end{quote}
+% switches the single-line-check off, but only for this |figure| so all
+% the other captions remain untouched.
+%
+% (For a description of the optional parameter \meta{float type} see
+% section \ref{misc}: \textit{``Useful stuff''}.)
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \pagebreak[3]
+% \section{Options}
+%
+% \def\OptionLabel{RaggedRight}
+% \def\UserDefined{\ldots}
+% \makeatletter
+% \newcommand*\Section{\@ifstar{\@Section\relax}{\@Section{section}}}
+% \newcommand*\@Section[3]{#1 \ref{#2}: \textit{``#3''}}
+% \makeatother
+% \newcommand*\See[1]{{\small (See #1)}}
+% \newcommand*\SeeUserDefined[1][]{%
+% \See{\Section{declare}{Do it yourself}#1}}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{Formatting}
+%
+% \DescribeMacro{format=}
+% A figure or table caption mainly consits of three parts: the caption label,
+% which says if this object is a `Figure' or `Table' and what number is
+% associated with it, the caption text itself, which is normally a short
+% description of contents, and the caption separator which separates the text
+% from the label.
+%
+% The \textit{caption format} determines how this information will be presented;
+% it is specified with the option
+% \begin{quote}
+% |format=|\meta{format name}\quad ,
+% \end{quote}
+% having the name of the caption format as its argument.
+%
+% There are two standard caption formats:
+% \iffalse
+% \footnote{You have the option to
+% define your own ones, too. See section \ref{declare}:
+% \textit{``Do it yourself!''} for details.}
+% \fi
+%
+% \begin{Options}{\OptionLabel}
+% \item[plain]\NEWdescription{v3.0h}
+% Typesets the captions as a normal paragraph.
+% (This is the default behaviour, it
+% is adapted from the standard \LaTeX\ document classes.)
+%
+% \item[hang]
+% Indents the caption text, so it will `hang' under the first line of the text.
+%
+% \item[\UserDefined]
+% Own formats can be defined using |\DeclareCaptionFormat|.
+% \SeeUserDefined
+% \end{Options}
+%
+% \begin{Example}
+% An example: Specifying the option
+% \begin{quote}
+% |format=hang|
+% \end{quote}
+% yields captions like this:
+% \example{format=hang}{\figuretext}
+% \end{Example}
+%
+% \DescribeMacro{indention=}
+% For both formats (\texttt{plain} and \texttt{hang}) you can setup an extra
+% indention starting at the second line of the caption. You do this with the
+% option
+% \begin{quote}
+% |indention=|\meta{amount}.
+% \end{quote}
+%
+% Two examples:
+%
+% \begin{Example}
+% \begin{quote}
+% |format=plain,indention=.5cm|
+% \end{quote}
+% \captionsetup{aboveskip=0pt}
+% \example{format=plain,indention=.5cm}{\figuretext}
+% \end{Example}
+%
+% \begin{Example}
+% \begin{quote}
+% |format=hang,indention=-0.5cm|
+% \end{quote}
+% \captionsetup{aboveskip=0pt}
+% \example{format=hang,indention=-0.5cm}{\figuretext}
+% \end{Example}
+%
+% \pagebreak[3]
+% \DescribeMacro{labelformat=}
+% With the option
+% \nopagebreak[3]
+% \begin{quote}
+% |labelformat=|\meta{label format name}
+% \end{quote}
+% \NEWdescription{v3.0e}
+% you specify how the caption label will be typeset.
+% There are four standard caption label formats:
+%
+% \begin{Options}{\OptionLabel}
+% \item[default]
+% The caption label will be typeset as specified by the document class,
+% usually this means the name and the number (like \texttt{simple}).
+% (This is the default behaviour.)
+%
+% \item[empty]
+% The caption label will be empty. (This option makes sense when used
+% together with other options like \texttt{labelsep=none}.)
+%
+% \item[simple]
+% The caption label will be typeset as a name and a number.
+%
+% \item[parens]
+% The number of the caption label will be typeset in parentheses.
+%
+% \item[\UserDefined]
+% Own label formats can be defined using |\DeclareCaptionLabelFormat|.
+% \SeeUserDefined
+% \end{Options}
+%
+% \begin{Example}
+% An example: Using the options
+% \begin{quote}
+% |labelformat=parens,labelsep=quad|
+% \end{quote}
+% gives captions like this one:
+% \example{labelformat=parens,labelsep=quad}{\figuretext}
+% \end{Example}
+%
+% \DescribeMacro{labelsep=}
+% With the option
+% \begin{quote}
+% |labelsep=|\meta{label separator name}
+% \end{quote}
+% you specify what caption separator will be used.
+% You can choose one of the following:
+%
+% \begin{Options}{\OptionLabel}
+% \item[none]
+% There is no caption separator. (This option makes sense when used
+% together with other options like \texttt{labelformat=empty}.)
+%
+% \item[colon]
+% The caption label and text will be separated by a colon and a space.
+% (This is the default one.)
+%
+% \item[period]
+% The caption label and text will be separated by a period and a space.
+%
+% \item[space]
+% The caption label and text will be separated by a single space.
+%
+% \item[quad]
+% The caption label and text will be separated by a |\quad|.
+%
+% \item[newline]
+% The caption label and text will be separated by a line break (|\\|).
+%
+% \item[endash]\NEWfeature{v3.0h}
+% The caption label and text will be separated by an en-dash,
+% surrounded by spaces (| -- |).
+%
+% \item[\UserDefined]
+% Own separators can be defined using |\DeclareCaptionLabelSeparator|.
+% \SeeUserDefined
+% \end{Options}
+%
+% Three examples:
+% \begin{Example}
+% \begin{quote}
+% |labelsep=period|
+% \end{quote}
+% \captionsetup{aboveskip=0pt}
+% \example{labelsep=period}{\figuretext}
+% \end{Example}
+%
+% \begin{Example}
+% \begin{quote}
+% |labelsep=newline,singlelinecheck=false|
+% \end{quote}
+% \captionsetup{aboveskip=0pt}
+% \example{labelsep=newline,singlelinecheck=false}{\figuretext}
+% \end{Example}
+%
+% \begin{Example}
+% \begin{quote}
+% |labelsep=endash|
+% \end{quote}
+% \captionsetup{aboveskip=0pt}
+% \example{labelsep=endash}{\figuretext}
+% \end{Example}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{Justification}
+% \label{justification}
+%
+% \DescribeMacro{justification=}
+% As addition to the caption format you could also specify a
+% \emph{caption justification}; it is specified with the option
+% \begin{quote}
+% |justification=|\meta{justification name}\quad.
+% \end{quote}
+%
+% You can choose one of the following:
+%
+% \begin{Options}{\OptionLabel}
+% \item[justified]
+% Typesets the caption as a normal paragraph. (This is the default.)
+%
+% \item[centering]
+% Each line of the caption will be centered.
+%
+% \iffalse
+% \item[Centering]
+% Each line of the caption will be centered, too.
+% But this time the command |\Centering| of the \package{ragged2e} package
+% will be used to achieve this. This difference is that this time the word
+% breaking algorithm of \TeX\ will work inside the caption.
+% \fi
+%
+% \item[centerlast]
+% The last line of each paragraph of the caption text will be centered.
+%
+% \item[centerfirst]
+% Only the first line of the caption will be centered.
+%
+% \item[raggedright]
+% Each line of the caption will be moved to the left margin.
+%
+% \iffalse
+% \item[RaggedRight]
+% Each line of the caption will be moved to the left margin using
+% the command |\RaggedRight| from the \package{ragged2e} package.
+% \fi
+% \item[RaggedRight]
+% Each line of the caption will be moved to the left margin, too.
+% But this time the command |\RaggedRight| of the \package{ragged2e} package
+% will be used to achieve this. The main difference is that the word
+% breaking algorithm of \TeX\ will work inside captions.
+%
+% \item[raggedleft]
+% Each line of the caption will be moved to the right margin.
+%
+% \iffalse
+% \item[RaggedLeft]
+% Each line of the caption will be moved to the right margin using
+% the command |\RaggedLeft| from the \package{ragged2e} package.
+% \fi
+%
+% \item[\UserDefined]
+% Own justifications can be defined using |\DeclareCaptionJustification|.
+% \SeeUserDefined
+% \end{Options}
+%
+% Three examples:
+% \begin{Example}
+% \begin{quote}
+% |justification=centerlast|
+% \end{quote}
+% \captionsetup{aboveskip=0pt}
+% \example{justification=centerlast}{\figuretext}
+% \end{Example}
+%
+% \begin{Example}
+% \begin{quote}
+% |format=hang,justification=raggedright|
+% \end{quote}
+% \captionsetup{aboveskip=0pt}
+% \example{format=hang,justification=raggedright}{\figuretext}
+% \end{Example}
+%
+% \begin{Example}
+% \begin{quote}
+% |labelsep=newline,justification=centering|
+% \end{quote}
+% \captionsetup{aboveskip=0pt}
+% \example{belowskip=\abovecaptionskip,labelsep=newline,justification=centering}{\figuretext}
+% \end{Example}
+%
+% \DescribeMacro{singlelinecheck=}
+% The standard \LaTeX\ document classes (|article|, |report|, and |book|)
+% automatically center a caption if it fits in one single line:
+%
+% \example{belowskip=\abovecaptionskip}{A short caption.}
+%
+% \DANGER
+% The \thispackage\ package adapts this behaviour and therefore usually
+% ignores the justification you have set with |justification=| in such case.
+% But you can switch this special treatment of such short captions off
+% with the option
+% \begin{quote}
+% |singlelinecheck=|\meta{bool}\quad.
+% \end{quote}
+% Using |false|, |no|, |off| or |0| for \meta{bool} switches the
+% extra centering off:
+% \begin{quote}
+% |singlelinecheck=false|
+% \end{quote}
+% Doing so the above short caption would look like
+%
+% \begingroup
+% \captionsetup{type=figure}
+% \ContinuedFloat
+% \endgroup
+% \example{belowskip=\abovecaptionskip,singlelinecheck=false}{A short caption.}
+%
+% You switch the extra centering on again by using |true|, |yes|, |on| or |1|
+% for \meta{bool}. (The default is on.)
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{Fonts}
+% \label{fonts}
+%
+% \DescribeMacro{font=}
+% \DescribeMacro{labelfont=}
+% \DescribeMacro{textfont=}
+% There are three font options which affects different parts of the caption:
+% One affecting the whole caption (|font|), one which only affects the caption
+% label and separator (|labelfont|) and at least one which only affects the
+% caption text (|textfont|).
+% You set them up using the options
+% \begin{quote}\begin{tabular}{@{}r@{}ll}
+% |font=| & \marg{font options} & ,\\
+% |labelfont=| & \marg{font options} & , and\\
+% |textfont=| & \marg{font options} & .\\
+% \end{tabular}\end{quote}
+%
+% And these are the available font options:
+%
+% \begin{Options}{\OptionLabel}
+% \item[scriptsize] {\scriptsize Very small size}
+% \item[footnotesize] {\footnotesize The size usually used for footnotes}
+% \item[small] {\small Small size}
+% \item[normalsize] {\normalsize Normal size}
+% \item[large] {\large Large size}
+% \item[Large] {\Large Even larger size}
+%
+% \item[up] {\upshape Upright shape}
+% \item[it] {\itshape Italic shape}
+% \item[sl] {\slshape Slanted shape}
+% \item[sc] {\scshape Small Caps shape}
+%
+% \item[md] {\mdseries Medium series}
+% \item[bf] {\bfseries Bold series}
+%
+% \item[rm] {\rmfamily Roman family}
+% \item[sf] {\sffamily Sans Serif family}
+% \item[tt] {\ttfamily Typewriter family}
+%
+% \item[\UserDefined]
+% Own font options can be defined using |\DeclareCaptionFont|.
+% \SeeUserDefined
+% \end{Options}
+%
+% If you use only one of these options you can omit the braces;
+% e.g., the options
+% \iffalse
+% \begin{quote}
+% \fi
+% |font={small}|
+% \iffalse
+% \end{quote}
+% \fi
+% and
+% \iffalse
+% \begin{quote}
+% \fi
+% |font=small|
+% \iffalse
+% \end{quote}
+% \fi
+% will give the same result.
+%
+% Two examples:
+% \begin{Example}
+% \begin{quote}
+% |font={small,it},labelfont=bf|
+% \end{quote}
+% \captionsetup{aboveskip=0pt}
+% \example{font={small,it},labelfont=bf}{\figuretext}
+% \end{Example}
+%
+% \begin{Example}
+% \begin{quote}
+% |font=small,labelfont=bf,textfont=it|
+% \end{quote}
+% \captionsetup{aboveskip=0pt}
+% \example{font=small,labelfont=bf,textfont=it}{\figuretext}
+% \end{Example}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{Margins and further paragraph options}
+% \label{margins}
+%
+% \DescribeMacro{margin=}
+% \DescribeMacro{width=}
+% For all captions you can specify \emph{either} an extra margin \emph{or}
+% a fixed width. You do this by using the options
+% \begin{quote}\begin{tabular}{@{}r@{}ll}
+% |margin=| & \meta{amount} & \emph{or}\\
+% |width=| & \meta{amount} & \\
+% \end{tabular}\end{quote}
+% Nevertheless what option you use, the left and right margin will be the
+% same.
+%
+% Two examples will illustrating this:
+% \begin{Example}
+% \begin{quote}
+% |margin=10pt|
+% \end{quote}
+% \captionsetup{aboveskip=0pt}
+% \example{margin=10pt}{\figuretext}
+% \end{Example}
+%
+% \begin{Example}
+% \begin{quote}
+% |width=.75\textwidth|
+% \end{quote}
+% \captionsetup{aboveskip=0pt}
+% \example{width=.75\textwidth}{\figuretext}
+% \end{Example}
+%
+% \DescribeMacro{parskip=}
+% This option is useful for captions containing more than one paragraph.
+% It specifies the extra vertical space inserted between them:
+% \begin{quote}
+% |parskip=|\meta{amount}
+% \end{quote}
+% One example:
+% \begin{Example}
+% \begin{quote}
+% |margin=10pt,parskip=5pt|
+% \end{quote}
+% \captionsetup{aboveskip=0pt}
+% \example{margin=10pt,parskip=5pt}{
+% First paragraph of the caption. This one contains some test, just to
+% show how these options affect the layout of the caption.
+%
+% Second paragraph of the caption. This one contains some text, too, to
+% show how these options affect the layout of the caption.}
+% \end{Example}
+%
+% \DescribeMacro{hangindent=}
+% The option
+% \begin{quote}
+% |hangindent=|\meta{amount}
+% \end{quote}
+% is for setting up a hanging indention starting from the second line of each
+% paragraph. If the caption contains just a single paragraph, using this option
+% leads to the same result as the option |indention=| you already know about.
+% But if the caption contains multiple paragraphs you will notice the difference:
+%
+% \begin{Example}
+% \begin{quote}
+% |format=hang,indention=-.5cm|
+% \end{quote}
+% \captionsetup{aboveskip=0pt}
+% \example{format=hang,indention=-.5cm}{
+% First paragraph of the caption. This one contains some test, just to
+% show how these options affect the layout of the caption.
+%
+% Second paragraph of the caption. This one contains some text, too, to
+% show how these options affect the layout of the caption.}
+% \end{Example}
+%
+% \begin{Example}
+% \begin{quote}
+% |format=hang,hangindent=-.5cm|
+% \end{quote}
+% \captionsetup{aboveskip=0pt}
+% \example{format=hang,hangindent=-.5cm}{
+% First paragraph of the caption. This one contains some test, just to
+% show how these options affect the layout of the caption.
+%
+% Second paragraph of the caption. This one contains some text, too, to
+% show how these options affect the layout of the caption.}
+% \end{Example}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{Styles}
+% \label{style}
+%
+% \DescribeMacro{style=}
+% A suitable combination of caption options is called \emph{caption style}.
+% You can compare them more or less to page styles which you set up with
+% |\pagestyle|: The caption style provides all settings for a whole caption layout.
+%
+% You switch to an already defined caption style with the option
+% \begin{quote}
+% |style=|\meta{style name}\quad.
+% \end{quote}
+% The \thispackage\ package usually defines only the style |default| which
+% puts all options you already know about to the default ones.
+% This means that specifying the option
+% \begin{quote}
+% |style=default|
+% \end{quote}
+% has the same effect as specifying all these options:
+% \begin{quote}
+% |format=default,labelformat=default,labelsep=default,|\\
+% |justification=default,font=default,labelfont=default,|\\
+% |textfont=default,margin=0pt,indention=0pt,parindent=0pt|\\
+% |hangindent=0pt,singlelinecheck=true|
+% \end{quote}
+%
+% Own caption styles can be defined using |\DeclareCaptionStyle|.
+% \SeeUserDefined
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{Skips}
+%
+% \DescribeMacro{aboveskip=}
+% \DescribeMacro{belowskip=}
+% The spaces above and below the caption are controlled by the skips
+% |\abovecaptionskip| and |\belowcaptionskip|. The standard \LaTeX\ document
+% classes |article|, |report| and |book| set |\abovecaptionskip| to |10pt|
+% and |\belowcaptionskip| to |0pt|.
+%
+% \pagebreak[3]
+% Both skips can be changed with the command |\setlength|, but you can
+% use these options, too:
+% \nopagebreak[3]
+% \begin{quote}\begin{tabular}{@{}r@{}ll}
+% |aboveskip=| & \meta{amount} & and\\
+% |belowskip=| & \meta{amount} & .\\
+% \end{tabular}\end{quote}
+%
+% \DescribeMacro{position=}
+% Using |\abovecaptionskip| and |\belowcaptionskip| has a major design flaw:
+% If the caption is typeset \emph{above} (and not \emph{below}) the figure
+% or table they are not set up very useful at default, because there will be
+% some extra space above the caption but no space between the caption and the
+% figure or table itself. (Remember: |\belowcaptionskip| is usually set to |0pt|.)
+%
+% Please compare the spacing in these small tables:
+% \begin{Example}
+% \begin{minipage}[c]{.5\linewidth}
+% \iffalse
+% \captionsetup{aboveskip=0pt}%
+% \fi
+% \captionof{table}{A table}
+% \centering\begin{tabular}{ll}
+% A & B \\
+% C & D \\
+% \end{tabular}
+% \end{minipage}
+% \begin{minipage}[c]{.5\linewidth}
+% \centering\begin{tabular}{ll}
+% A & B \\
+% C & D \\
+% \end{tabular}
+% \captionof{table}{A table}
+% \end{minipage}
+% \end{Example}
+%
+% But you can fix this by using the option |position=|: It specifies how the
+% spacing above and below the caption will be used:
+% \begin{quote}
+% |position=top|\quad(or |position=above|)
+% \end{quote}
+% tells the \thispackage\ package to use the spacing useful for caption
+% \emph{above} the figure or table and
+% \begin{quote}
+% |position=bottom|\quad(or |position=below|)
+% \end{quote}
+% tells the \thispackage\ package to use the spacing useful for captions
+% \emph{below} the figure or table. (The last one is the default setting
+% except for |longtable|s.)
+%
+% So adding an extra |\captionsetup{position=top}| to the left example
+% table gives you proper spacing around both captions:
+% \begin{Example}
+% \begin{minipage}[c]{.5\linewidth}
+% \captionsetup{position=top}
+% \captionof{table}{A table}
+% \centering\begin{tabular}{ll}
+% A & B \\
+% C & D \\
+% \end{tabular}
+% \end{minipage}
+% \begin{minipage}[c]{.5\linewidth}
+% \centering\begin{tabular}{ll}
+% A & B \\
+% C & D \\
+% \end{tabular}
+% \captionof{table}{A table}
+% \end{minipage}
+% \end{Example}
+%
+% (Technically speaking |\abovecaptionskip| and |\belowcaptionskip| will
+% be swapped if you specify the option |position=top|, so in both cases
+% |\abovecaptionskip| will be used between the caption and the figure or
+% table itself.)
+%
+% This option is especially useful when used together with the optional
+% argument of the |\captionsetup| command.
+% \See{\Section{misc}{Useful stuff} for details}\par
+% For example
+% \begin{quote}
+% |\captionsetup[table]{position=top}|
+% \end{quote}
+% causes all captions within tables to be treated as captions \emph{above}
+% the table (regarding spacing around it).
+% \DescribeMacro{tableposition=}
+% \NEWfeature{v3.0a}
+% Because this is a very common setting the \thispackage\ package offers
+% an abbreviating option for the use with |\usepackage|:
+% \begin{quote}
+% |\usepackage[|\ldots|,tableposition=top]{caption}|\footnote{Please
+% note that this is \emph{not} sufficient when using a
+% \KOMAScript\ document class, you need to use the \emph{global}
+% option |tablecaptionabove|, too.}
+% \end{quote}
+% is equivalent to
+% \begin{quote}
+% |\usepackage[|\ldots|]{caption}|\\
+% |\captionsetup[table]{position=top}|
+% \end{quote}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \pagebreak[3]
+% \section{Useful stuff}
+% \label{misc}
+%
+% \DescribeMacro{\caption}
+% The command
+% \nopagebreak[3]
+% \begin{quote}
+% |\caption|\oarg{lst\_entry}\marg{heading}
+% \end{quote}
+% \nopagebreak[3]
+% typesets the caption inside a floating environment like |figure| or |table|.
+% Well, you already know this, but the \thispackage\ package offers an extension:
+% If you leave the argument \meta{lst\_entry} empty, no entry in the list of
+% figures or tables will be made. For example:
+% \begin{quote}
+% |\caption[]{A figure without entry in the list of figures.}|
+% \end{quote}
+%
+% \DescribeMacro{\caption*}
+% The \package{longtable} package defines the command |\caption*| which
+% typesets the caption without label and without entry in the list of tables.
+% An example:
+% \begin{quote}
+% |\begin{longtable}{cc}|\\
+% | \caption*{A table}\\|\\
+% | A & B \\|\\
+% | C & D \\|\\
+% |\end{longtable}|
+% \end{quote}
+% looks like
+% \begin{longtable}{cc}
+% \caption*{A table}\\
+% A & B \\
+% C & D \\
+% \end{longtable}
+%
+% This package offers this feature, too, so you can use this command now within
+% every floating environment like |figure| or |table|, like:
+% \begin{quote}
+% |\begin{table}|\\
+% | \caption*{A table}|\\
+% | \begin{tabular}{cc}|\\
+% | A & B \\|\\
+% | C & D \\|\\
+% | \end{tabular}|\\
+% |\end{table}|
+% \end{quote}
+%
+% \DescribeMacro{\captionof}
+% \DescribeMacro{\captionof*}
+% Sometimes you want to typeset a caption \emph{outside} a floating environment,
+% putting a figure within a |minipage| for instance. For this purpose the
+% \thispackage\ package offers the command
+% \begin{quote}
+% |\captionof|\marg{float type}\oarg{lst\_entry}\marg{heading}\quad.
+% \end{quote}
+% Note that the first argument, the \meta{float type}, is mandatory here, because
+% the |\captionof| command needs to know which name to put into the caption label
+% (e.g. ``Figure'' or ``Table'') and in which list to put the contents entry.
+% An example:
+% \begin{quote}
+% |\captionof{figure}{A figure}|\\
+% |\captionof{table}{A table}|
+% \end{quote}
+% typesets captions like this:
+% \begin{Example}
+% \captionof{figure}{A figure}
+% \captionsetup{belowskip=\abovecaptionskip}
+% \captionof{table}{A table}
+% \end{Example}
+%
+% The star variant |\captionof*| has the same behaviour as the |\caption*| command:
+% it typesets the caption without label and without entry to the list of figures
+% or tables.
+%
+% Please use both |\captionof| and |\captionof*| only \emph{inside} environments
+% (like |minipage| or |\parbox|), otherwise a page break can appear between content
+% and caption. Furthermore some strange effects could occur (e.g., wrong spacing
+% around captions).
+%
+% \DescribeMacro{\ContinuedFloat}
+% Sometimes you want to split figures or tables without giving them
+% their own reference number. This is what the command
+% \begin{quote}
+% |\ContinuedFloat|
+% \end{quote}
+% is for; it should be used as first command inside the floating environment.
+% It prevents the increment of the relevant counter (usually done by |\caption|)
+% so a figure or table with a |\ContinuedFloat| in it gets the same reference
+% number as the figure or table before.
+%
+% An example:
+% \begin{quote}
+% |\begin{table}|\\
+% |\caption{A table}|\\
+% \ldots\\
+% |\end{table}|\\
+% \ldots\\
+% |\begin{table}\ContinuedFloat|\\
+% |\caption{A table (cont.)}|\\
+% \ldots\\
+% |\end{table}|
+% \end{quote}
+% gives the following result:
+% \begin{Example}
+% \makeatletter\def\@captype{table}\makeatother
+% \caption[]{A table}
+% \centerline{\ldots}
+% \ContinuedFloat
+% \captionsetup{aboveskip=0pt}
+% \caption[]{A table (cont.)}
+% \end{Example}
+%
+% \DescribeMacro{\captionsetup}
+% We already know the |\captionsetup| command (see \Section{usage}
+% {Using the package}), but this time we get enlighten about
+% its optional argument \meta{float type}.
+%
+% Remember, the syntax of this command is
+% \begin{quote}
+% |\captionsetup|\oarg{float type}\marg{options}\quad.
+% \end{quote}
+%
+% If a \meta{float type} gets specified, all the \meta{options} don't
+% change anything at this time. Instead they only get marked for a later use,
+% when a caption inside of a floating environment of the particular type
+% \meta{float type} gets typeset.
+% For example
+% \begin{quote}
+% |\captionsetup[figure]|\marg{options}
+% \end{quote}
+% forces captions within a |figure| environment to use the given \meta{options}.
+%
+% Here comes an example to illustrate this:
+% \begin{quote}
+% |\captionsetup{font=small}|\\
+% |\captionsetup[figure]{labelfont=bf}|
+% \end{quote}
+% gives captions like this:
+% \begin{Example}
+% \captionsetup{font=small}
+% \captionsetup[figure]{labelfont=bf}
+% \captionof{figure}[]{A figure}
+% \captionsetup{belowskip=\abovecaptionskip}
+% \captionof{table}[]{A table}
+% \end{Example}
+%
+% As you see the command |\captionsetup[figure]{labelfont=bf}| only changed
+% the font of the figure caption labels, not touching all other ones.
+%
+% \DescribeMacro{\clearcaptionsetup}
+% If you want to get rid of these parameters marked for an automatic use within
+% a particular environment you can use the command
+% \begin{quote}
+% |\clearcaptionsetup|\marg{float type}\quad.
+% \end{quote}
+%
+% For example |\clearcaptionsetup{figure}| would clear the extra handling in the
+% example above:
+% \begin{Example}
+% \captionsetup{font=small}
+% \captionof{figure}[]{A figure}
+% \captionsetup{belowskip=\abovecaptionskip}
+% \captionof{table}[]{A table}
+% \end{Example}
+%
+% As \meta{float type} you can usually give one of these two only:
+% |figure| or |table|.
+% But as we will see later some \LaTeX\ packages (like the
+% \package{float}, \package{longtable}, and \package{sidecap} package
+% for example) offer additional floating environments and these two
+% commands can also be used with them.
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \pagebreak[3]
+% \section{Do it yourself!}
+% \label{declare}
+%
+% A family of commands is provided to allow users to define their own formats.
+% This enables information on separators, justification, fonts, and styles to
+% be associated with a name and kept in one place
+% (these commands need to appear in the document preamble,
+% this is the part between |\documentclass| and |\begin{document}|).
+%
+% \pagebreak[2]
+% \DescribeMacro{\DeclareCaptionFormat}
+% You can define your own caption formats using the command
+% \begin{quote}
+% |\DeclareCaptionFormat|\marg{name}\marg{code using \#1, \#2 and \#3}\quad.
+% \end{quote}
+% At usage the system replaces \#1 with the caption label, \#2 with the
+% separator and \#3 with the text. So the standard format |plain| is
+% pre-defined by the \thispackage\ package as
+% \begin{quote}
+% |\DeclareCaptionFormat{plain}{#1#2#3\par}|
+% \end{quote}
+%
+% \DescribeMacro{\DeclareCaptionLabelFormat}
+% Likewise you can define your own caption label formats:
+% \begin{quote}
+% |\DeclareCaptionLabelFormat|\marg{name}\marg{code using \#1 and \#2}
+% \end{quote}
+% At usage \#1 gets replaced with the name (e.g. ``figure'') and \#2
+% gets replaced with the reference number (e.g. ``12'').
+%
+% \DescribeMacro{\bothIfFirst}
+% \DescribeMacro{\bothIfSecond}
+% If you define your own caption label formats and use the \package{subfig}
+% package\cite{subfig}, you should take care of empty caption label names.
+% For this purpose the commands
+% \begin{quote}
+% |\bothIfFirst|\marg{first arg}\marg{second arg}\quad and\\
+% |\bothIfSecond|\marg{first arg}\marg{second arg}
+% \end{quote}
+% are offered. |\bothIfFirst| tests if the first argument exists (means: is
+% not empty), |\bothIfSecond| tests if the second argument exists. If yes,
+% both arguments get typeset, otherwise none of them.
+%
+% For example the standard label format |simple| is \emph{not} defined as
+% \begin{quote}
+% |\DeclareCaptionLabelFormat{simple}{#1 #2}|\quad,
+% \end{quote}
+% because this could cause an extra space if \#1 is empty. Instead |simple|
+% is defined as
+% \begin{quote}
+% |\DeclareCaptionLabelFormat{simple}{\bothIfFirst{#1}{ }#2}|\quad,
+% \end{quote}
+% causing the space to appear only if the label name is present.
+%
+% \pagebreak[3]
+% \DescribeMacro{\DeclareCaptionLabelSeparator}
+% You can define your own caption label separators with
+% \nopagebreak[3]
+% \begin{quote}
+% |\DeclareCaptionLabelSeparator|\marg{name}\marg{code}\quad.
+% \end{quote}
+% \nopagebreak[3]
+% Again an easy example taken from the \thispackage\ package itself:
+% \nopagebreak[3]
+% \begin{quote}
+% |\DeclareCaptionLabelSeparator{colon}{: }|
+% \end{quote}
+% \pagebreak[3]
+%
+% \DescribeMacro{\DeclareCaptionJustification}
+% You can define your own caption justifications with
+% \begin{quote}
+% |\DeclareCaptionJustification|\marg{name}\marg{code}\quad.
+% \end{quote}
+% The \meta{code} simply gets typeset just before the caption.
+% E.g.~using the justification |raggedright|, which is defined as
+% \begin{quote}
+% |\DeclareCaptionJustification{raggedright}{\raggedright}|\quad,
+% \end{quote}
+% lets captions with all lines moved to the left margin.
+%
+% \DescribeMacro{\DeclareCaptionFont}
+% You can define your own caption fonts with
+% \begin{quote}
+% |\DeclareCaptionFont|\marg{name}\marg{code}\quad.
+% \end{quote}
+% For example this package defines the options |small| and |bf| as
+% \begin{quote}
+% |\DeclareCaptionFont{small}{\small}|\quad and\\
+% |\DeclareCaptionFont{bf}{\bfseries}|\quad.
+% \end{quote}
+% The line spacing could be customized using the \package{setspace} package,
+% for example:\NEWdescription{v3.0h}
+% \begin{quote}
+% |\usepackage{setspace}|\\
+% \iffalse
+% |\DeclareCaptionFont{singlespacing}{\setstretch{1}}|\quad\footnote{%
+% \emph{Note:} Using \cs{singlespacing} does not work here since it contains
+% a \cs{vskip} command.}\\
+% |\DeclareCaptionFont{onehalfspacing}{\onehalfspacing}|\\
+% |\DeclareCaptionFont{doublespacing}{\doublespacing}|\\
+% \fi
+% |\captionsetup{font={onehalfspacing,small},labelfont=bf}|
+% \end{quote}
+% \example{font={onehalfspacing,small},labelfont=bf,singlelinecheck=off}\figuretext
+% An example which brings color into life:
+% \begin{quote}
+% |\usepackage{color}|\\
+% |\DeclareCaptionFont{red}{\color{red}}|\\
+% |\DeclareCaptionFont{green}{\color{green}}|\\
+% |\DeclareCaptionFont{blue}{\color{blue}}|\\
+% |\captionsetup{labelfont=blue,textfont=green}|
+% \end{quote}
+% \example{labelfont=blue,textfont=green,singlelinecheck=off}\figuretext
+%
+% \DescribeMacro{\DeclareCaptionStyle}
+% You can define your own caption styles with
+% \begin{quote}
+% |\DeclareCaptionStyle|\marg{name}\oarg{additional options}\marg{options}
+% \end{quote}
+% Remember, caption styles are just a collection of suitable options, saved
+% under a given name. You can wake up these options at any time with the
+% option |style=|\meta{style name}.
+%
+% All caption styles are based on the default set of options. (See \Section
+% {style}{Styles} for a complete list.) So you only need
+% to specify options which are different to them.
+%
+% If you specify \meta{additional options} they get used in addition when
+% the caption fits into a single line and this check was not disabled with
+% the option |singlelinecheck=off|.
+%
+% Again a very easy example taken from the core of this package: The
+% caption style |default| is pre-defined as
+% \begin{quote}
+% |\DeclareCaptionStyle{default}[justification=centering]{}|\quad.
+% \end{quote}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{Further Examples}
+%
+% If you would like to have a colon \emph{and} a line break as caption
+% separator you could define it this way:
+% \begin{quote}
+% |\DeclareCaptionLabelSeparator{period-newline}{. \\}|
+% \end{quote}
+% Selecting this separator with |\captionsetup{labelsep=period-newline}| you
+% get captions like this:
+% \begin{Example}
+% \captionsetup{labelsep=period-newline,labelfont=bf,margin=10pt}
+% \captionsetup{aboveskip=0pt,type=figure}
+% \caption[]{\figuretext}
+% \end{Example}
+%
+% For short captions---which fit into one single line---this separator
+% may not be satisfying, even when the automatically centering process
+% is switched off (with |singlelinecheck=off|):
+% \begin{Example}
+% \captionsetup{labelsep=period-newline,labelfont=bf,margin=10pt,singlelinecheck=0}
+% \captionsetup{aboveskip=0pt,type=figure}
+% \caption[]{A figure.}
+% \end{Example}
+%
+% An own caption style which selects another caption separator automatically
+% puts this right:
+% \begin{quote}
+% |\DeclareCaptionStyle{period-newline}%|\\
+% | [labelsep=period]{labelsep=period-newline}|
+% \end{quote}
+% \begin{Example}
+% \captionsetup{style=period-newline,labelfont=bf,margin=10pt}
+% \captionsetup{aboveskip=0pt,type=figure}
+% \ContinuedFloat
+% \caption[]{A figure.}
+% \end{Example}
+% If you would like to keep the centering of these captions instead, an
+% appropriate definition would be something like
+% \begin{quote}
+% |\DeclareCaptionStyle{period-newline}%|\\
+% | [labelsep=period,justification=centering]%|\\
+% | {labelsep=period-newline}|\quad.
+% \end{quote}
+% Using this definition short captions look like
+% \begin{Example}
+% \captionsetup{style=period-newline2,labelfont=bf,margin=10pt}
+% \captionsetup{aboveskip=0pt,type=figure}
+% \ContinuedFloat
+% \caption[]{A figure.}
+% \end{Example}
+% while long ones still have a line break after the caption label.
+%
+% Slightly changed, you also get centered captions if they are longer than
+% one line:
+% \begin{quote}
+% |\DeclareCaptionStyle{period-newline}%|\\
+% | [labelsep=period]%|\\
+% | {labelsep=period-newline,justification=centering}|
+% \end{quote}
+% \begin{Example}
+% \captionsetup{style=period-newline3,labelfont=bf,margin=10pt}
+% \captionsetup{aboveskip=0pt,type=figure}
+% \caption[]{\figuretext}
+% \end{Example}
+%
+% \bigskip\pagebreak[3]
+% Another example: You want captions to look like this:
+% \begin{Example}
+% \captionsetup{format=reverse,labelformat=fullparens,labelsep=fill,font=small,labelfont=it}
+% \captionsetup{aboveskip=0pt}
+% \captionof{figure}[]{\figuretext}
+% \end{Example}
+% \pagebreak[2]
+% You could do it this way:
+% \nopagebreak[3]
+% {\leftmargini=10pt
+% \begin{quote}
+% |\DeclareCaptionFormat{reverse}{#3#2#1}|\\
+% |\DeclareCaptionLabelFormat{fullparens}{(\bothIfFirst{#1}{ }#2)}|\\
+% |\DeclareCaptionLabelSeparator{fill}{\hfill}|\\
+% |\captionsetup{format=reverse,labelformat=fullparens,|\\
+% | labelsep=fill,font=small,labelfont=it}|
+% \end{quote}}
+%
+% \bigskip\pagebreak[3]
+% Another example: The caption text should go into the left margin; a possible
+% solution would be:
+% {\leftmargini=10pt
+% \begin{quote}
+% |\DeclareCaptionFormat{llap}{\llap{#1#2}#3\par}|\\
+% |\captionsetup{format=llap,labelsep=quad,singlelinecheck=no}|
+% \end{quote}}
+% As a result you would get captions like this:
+% \begin{Example}
+% \captionsetup{format=llap,singlelinecheck=no,labelsep=quad}
+% \captionsetup{aboveskip=0pt}
+% \captionof{figure}[]{\figuretext}
+% \end{Example}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \pagebreak[3]
+% \section{Using non-standard document classes}
+%
+% \NEWdescription{v3.0p}
+% The \thispackage\ package was developed using the standard document classes
+% |article|, |report| and |book|, it also works with the Dutch document classes
+% |artikel|, |rapport| and |boek|. It is \emph{incompatible} with all other
+% document classes, except the ones based on one of the above.
+%
+% If you are unsure if your document class is supported or not, it's better
+% \emph{not} to use this package. You could try if your document will compile
+% fine with the \thispackage\ package anyway, but you should watch carefully
+% if side-effects occur, i.e. the look and feel of your captions should
+% \emph{not} change if you just include the caption package without options.
+% (If it does, you can carry on, but you should be warned that the output
+% could change with upcoming versions of the \thispackage\ package.)
+% If this is fine, you can start setting options with
+% |\usepackage[|\ldots|]{caption}| or |\captionsetup| and keep your fingers
+% crossed.
+%
+% The upcoming version \version{3.1} of the \thispackage\ package will be
+% adapted to several document classes, e.g. the \package{beamer} class and
+% the \KOMAScript\ ones. It's planned for release during Summer 2007.
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \section{Compatibility to other packages}
+% \label{packages}
+%
+% The \thispackage\ package contains special adaptations to other packages,
+% so the captions should always look like you have specified them to look like.
+%
+% These are the packages the \thispackage\ package is adapted to:
+%
+% \begin{tabular}{ll}
+% |float| & Gives you the possibility to define new floating environments\\
+% |listings| & Typesets source code listings\\
+% |longtable| & Typesets tables spanned over multiple pages\\
+% |rotating| & Supports rotated figures and tables\\
+% |sidecap| & Offers captions \emph{beside} figures or tables\\
+% |supertabular| & Typesets tables spanned over multiple pages\\
+% \end{tabular}
+%
+% \NEWfeature{v3.0b}
+% If you use one of the above packages together with the {\thispackage} package
+% you get the additional possibility to set up captions with
+% \begin{quote}|\captionsetup|\oarg{environment}\marg{options}\quad,\end{quote}
+% where \meta{environment} stands for any environment the above packages offer.
+% (Please note that this do not work with the |sideways| environments offered by
+% the \package{rotating} package.)
+% For example
+% \begin{quote}|\captionsetup[lstlisting]{labelfont=bf}|\end{quote}
+% forces captions inside the |lstlisting| environment to have bold labels.
+%
+% If a certain support is not desired you can switch it off using the
+% \thispackage\ package option
+% \begin{quote}
+% |\usepackage[|\ldots|,|\meta{package}|=no]{caption}|\quad.
+% \end{quote}
+% For example specifying the option |float=no| means you don't like the
+% \thispackage\ package to support the \package{float} package.
+% (Note: You can specify these options only within the |\usepackage| command,
+% especially \emph{not} at a later time with |\captionsetup|.)
+%
+% For further information about the packages mentioned above please take a look
+% at the documentation belonging to them or buy yourself
+% The \LaTeX\ Companion\cite{companion}.
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{The \package{float} package}
+% \label{float}
+%
+% A very useful feature is provided by the \package{float} package\cite{float}:
+% It offers the float placement specifier |H| which is much more restrictive
+% than the specifier |h| offered by \LaTeX. While the latter one is only a
+% recommendation to \LaTeX\ to set the float ``here'', the |H| forces the
+% float to appear exactly at the spot where it occurs in your input file
+% and nowhere else.
+%
+% Furthermore it offers different styles for floating environments, these
+% styles are |plain|, |plaintop|, |ruled|, and |boxed|.
+% You can link one of these styles to either new floating environments or
+% to one of the existing environments |figure| and |table|.
+%
+% If you are using the \thispackage\ package together with the \package{float}
+% package a caption style called |ruled| gets defined automatically:
+% \begin{quote}
+% |\DeclareCaptionStyle{ruled}{labelfont=bf,labelsep=space}|
+% \end{quote}
+% This style represents the caption layout in |ruled| styled floats.
+% For you as an end user this means that captions within |ruled| floats will
+% always look like this, nevertheless what generic caption options do you
+% specify:
+%
+% \ifx\floatstyle\undefined
+%
+% \begin{Example}
+% \hrule height.8pt depth0pt \kern2pt
+% \vbox{\strut{\bfseries Program 7.1}
+% The first program. This hasn't got anything to do with the package
+% but is included as an example. Note the \texttt{ruled} float style.}
+% \kern2pt\hrule\kern2pt
+% \begin{verbatim}
+% #include <stdio.h>
+%
+% int main(int argc, char **argv)
+% {
+% for (int i = 0; i < argc; ++i)
+% printf("argv[%d] = %s\n", i, argv[i]);
+% return 0;
+% }
+% \end{verbatim}
+% \kern2pt\hrule\relax
+% \end{Example}
+%
+% \else
+%
+% \floatstyle{ruled}
+% \newfloat{Program}{tbp}{lop}[section]
+% \floatname{Program}{Program}
+%
+% \begin{Program}[H]
+% \begin{verbatim}
+% #include <stdio.h>
+%
+% int main(int argc, char **argv)
+% {
+% for (int i = 0; i < argc; ++i)
+% printf("argv[%d] = %s\n", i, argv[i]);
+% return 0;
+% }
+% \end{verbatim}
+% \caption{The first program. This hasn't got anything to do with the package
+% but is included as an example. Note the \texttt{ruled} float style.}
+% \end{Program}
+%
+% \fi
+%
+% If you want a different layout for |ruled| captions you have to define
+% your own one using the command
+% \begin{quote}
+% |\DeclareCaptionStyle{ruled}|\marg{options}\quad.
+% \end{quote}
+%
+% This mechanism also works with all other float styles. If you want a special
+% caption layout---for |plain| or |boxed| floats for example---you can simply define
+% a suitable caption style with the same name as the float style.
+%
+% \textbf{Note:} For successful cooperation you need the float package
+% version 1.3 or newer.
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{The \package{listings} package}
+% \label{listings}
+%
+% \NEWdescription{v3.0b}
+% The \package{listings} package\cite{listings} is a source code printer for \LaTeX.
+% You can typeset stand alone files as well as listings with an environment
+% similar to \texttt{verbatim} as well as you can print code snippets using
+% a command similar to |\verb|.
+% Many parameters control the output and if your preferred programming
+% language isn't already supported, you can make your own definition.
+%
+% \textbf{Note:} For successful cooperation you need the listings package
+% version 1.2 or higher. You'll get an error message when using an
+% older version!
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{The \package{longtable} package}
+% \label{longtable}
+%
+% The \package{longtable} package\cite{longtable} offers the environment
+% |longtable| which behaves similar to the |tabular| environment, but
+% the table itself can span multiple pages.
+%
+% \textbf{Note:} For successful cooperation you need the longtable package
+% version 3.15 or newer.
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{The \package{rotating} package}
+% \label{rotating}
+%
+% The \package{rotating} package\cite{rotating} offers the floating
+% environments \texttt{sideways\-figure} and \texttt{sideways\-table}
+% which are just like normal figures and tables but rotated by 90 degree.
+% Furthermore they always use a full page on their own.
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{The \package{sidecap} package}
+% \label{sidecap}
+%
+% \NEWdescription{v3.0b}
+% The \package{sidecap} package\cite{sidecap} offers the floating
+% environments |SCfigure| and |SCtable| which are like normal figures
+% and tables but the caption will be put \emph{beside} the contents.
+%
+% The \package{sidecap} package offers it's own options for justification.
+% If set, they will override the one specified with the caption option
+% |justification=| for captions beside their contents.
+%
+% \DescribeMacro{listof=}
+% Using the \package{sidecap} package you will probably notice that
+% suppressing the entry in the list of figures or tables with
+% |\caption[]{|\ldots|}| won't work inside these environments.
+% This is caused by the implementation design of the \package{sidecap}
+% package, but you can use |\captionsetup{listof=false}| inside the
+% figure or table as an alternative here.
+%
+% \ifx\SCfigure\undefined
+%
+% \begin{Example}
+% \newsavebox\scbox
+% \begin{lrbox}{\scbox}
+% \setlength{\unitlength}{.75cm}
+% \setlength{\fboxsep}{0pt}
+% \fbox{\begin{picture}(4,4)
+% \put(1,3){\circle{1}}
+% \put(3,3){\circle{1}}
+% \put(2,2){\circle{1}}
+% \put(1,1){\circle{1}}
+% \put(3,1){\circle{1}}
+% \end{picture}}
+% \end{lrbox}
+% \newlength\scboxwidth
+% \setlength\scboxwidth{\wd\scbox}
+% \makebox[\linewidth][c]{
+% \parbox[b]{\scboxwidth}{\unhbox\scbox}
+% \hspace\marginparsep
+% \parbox[b]{1.5\scboxwidth}{
+% \captionsetup{justification=raggedright,labelfont=bf}
+% \captionof{figure}[]{A small example with the caption beside the figure.}
+% }
+% }
+% \end{Example}
+%
+% \else
+%
+% \captionsetup{labelfont=bf}
+% \begin{SCfigure}[1.5][!ht]
+% \setlength{\unitlength}{.75cm}
+% \setlength{\fboxsep}{0pt}
+% \fbox{\begin{picture}(4,4)
+% \put(1,3){\circle{1}}
+% \put(3,3){\circle{1}}
+% \put(2,2){\circle{1}}
+% \put(1,1){\circle{1}}
+% \put(3,1){\circle{1}}
+% \end{picture}}
+% \iffalse
+% \captionsetup{labelfont=bf}
+% \fi
+% \caption[]{A small example with the caption beside the figure.}
+% \end{SCfigure}
+% \captionsetup{labelfont=default}
+%
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{The \package{supertabular} package}
+% \label{supertabular}
+%
+% The \package{supertabular} package\cite{supertabular} offers the environment
+% |supertabular| which is quite similar to the |longtable| environment provided
+% by the \package{longtable} package. Both offers the typesetting of tables
+% which can span multiple pages. For a detailed discussion about the
+% differences between these powerful packages please take a look at
+% The \LaTeX\ Companion\cite{companion}.
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{Known incompatibilities}
+%
+% \NEWdescription{v3.0b}
+% Using the \thispackage\ package together with one of the following packages
+% is not recommended; usually this would cause unwanted side effects or even
+% errors:
+% \begin{quote}
+% \package{ccaption}, \package{ftcap}, \package{hvfloat}, and
+% \package{nonfloat}
+% \end{quote}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \section{Compatibility to older versions}
+% \label{compatibility}
+%
+% \subsection{The \thispackage\ package version $1.x$}
+%
+% This version of the \thispackage\ package still supports the old options
+% and commands provided by the version $1.x$ of this package. So there
+% shouldn't occur any problems compiling old documents, but please don't mix
+% old options and commands with the new ones. This isn't supported and can
+% cause ugly side effects.
+%
+% Here comes a short oversight of the obsolete options and commands and how
+% they have been replaced within this version of the \thispackage\ package:
+%
+% {\small\begin{longtable}{ll}
+% \thispackage\ \version{1.x} & \thispackage\ \version{3.x}\\
+% \hline
+% \endhead
+% |normal| & |format=plain|\\
+% |hang| & |format=hang|\\
+% |isu| & |format=hang|\\
+% |center| & |justification=centering|\\
+% |centerlast| & |justification=centerlast|\\
+% \iffalse
+% |anne| & |justification=centerlast|\\
+% \fi
+% |nooneline| & |singlelinecheck=off|\\
+% |scriptsize| & |font=scriptsize|\\
+% |footnotesize| & |font=footnotesize|\\
+% |small| & |font=small|\\
+% |normalsize| & |font=normalsize|\\
+% |large| & |font=large|\\
+% |Large| & |font=Large|\\
+% |up| & |labelfont=up|\\
+% |it| & |labelfont=it|\\
+% |sl| & |labelfont=sl|\\
+% |sc| & |labelfont=sc|\\
+% |md| & |labelfont=md|\\
+% |bf| & |labelfont=bf|\\
+% |rm| & |labelfont=rm|\\
+% |sf| & |labelfont=sf|\\
+% |tt| & |labelfont=tt|\\
+% \end{longtable}}
+%
+% Beside the options for setting up the desired font there were also
+% the commands |\captionsize| resp.~|\captionfont| and |\captionlabelfont|
+% who could be redefined with |\renewcommand| and allowed an alternate and
+% more flexible way to change the font used for captions.
+% This mechanism was replaced by the commands
+% \begin{quote}
+% |\DeclareCaptionFont{|\ldots|}{|\ldots|}|\qquad and\\
+% |\captionsetup{font=|\ldots|,labelfont=|\ldots|}|\qquad.
+% \end{quote}\SeeUserDefined
+%
+% Setting the margin for captions was done in \version{1.x} with
+% \begin{quote}
+% |\setlength{\captionmargin}{|\ldots|}|\quad.
+% \end{quote}
+% This was replaced by
+% \begin{quote}
+% |\captionsetup{margin=|\ldots|}|\qquad.
+% \end{quote}
+% \See{\Section{margins}{Margins and further paragraph options}}
+%
+% For example the old-style code
+% \begin{quote}
+% |\usepackage[hang,bf]{caption}|\\
+% |\renewcommand\captionfont{\small\sffamily}|\\
+% |\setlength\captionmargin{10pt}|
+% \end{quote}
+% will still work fine, but should be written today as
+% \begin{quote}
+% |\usepackage[format=hang,labelfont=bf,font={small,sf},|\\
+% | margin=10pt]{caption}|
+% \end{quote}
+% or
+% \begin{quote}
+% |\usepackage{caption}|\\
+% |\captionsetup{format=hang,labelfont=bf,font={small,sf},|\\
+% | margin=10pt}|\qquad.
+% \end{quote}
+%
+% The quite exotic option |ruled| which allowed a partial usage of
+% the caption settings for |ruled| floats defined with the
+% \package{float} package will be emulated by this version of the
+% caption package, too.
+% But using this option is not recommended anymore since this
+% version of the \thispackage\ package offers a more flexible way
+% for changing the captions of these floating environments:
+% \begin{quote}
+% |\DeclareCaptionStyle{ruled}{|\ldots|}|
+% \end{quote}
+% resp.
+% \begin{quote}
+% |\captionsetup[ruled]{|\ldots|}|\qquad.
+% \end{quote}
+% \SeeUserDefined[, \Section*{misc}{Useful stuff}, and
+% \Section*{float}{The \package{float} package}]
+%
+% \subsection{The \package{caption2} package version $2.x$}
+%
+% Although they do very similar stuff, the packages \package{caption} and
+% its experimental and now obsolete variant \package{caption2} have a
+% very different implementation design.
+% Therefore a full compatibility could not be offered.
+% For that reason you will still find a file called |caption2.sty| in
+% this package distribution, so old documents using the \package{caption2}
+% package will still compile fine.
+%
+% Newly created documents should use the actual version of the
+% \thispackage\ package instead. In most cases it's sufficient to replace
+% the command
+% \begin{quote}
+% |\usepackage[...]{caption2}|
+% \end{quote}
+% by
+% \begin{quote}
+% |\usepackage[...]{caption}|\qquad.
+% \end{quote}
+% But some options and commands will not be emulated, so you can get
+% error messages afterwards. This section will hopefully help you removing
+% these errors. If you have problems migrating from \package{caption2}
+% to \package{caption} please don't hesitate to send me an e-mail asking
+% for help.
+%
+% In addition to the obsolete options shown in the last section
+% these ones will be emulated, too:
+%
+% {\small\begin{longtable}{ll}
+% \package{caption2} \version{2.x} & \thispackage\ \version{3.x}\\
+% \hline
+% \endhead
+% |flushleft| & |justification=raggedright|\\
+% |flushright| & |justification=raggedleft|\\
+% |oneline| & |singlelinecheck=on|\\
+% \end{longtable}}
+%
+% Setting the margin for captions was done in \version{2.x} with
+% \begin{quote}\leavevmode\hbox{%
+% |\setcaptionmargin{|\ldots|}| resp.
+% |\setcaptionwidth{|\ldots|}|\quad.
+% }\end{quote}
+% This was replaced by
+% \begin{quote}\leavevmode\hbox{%
+% |\captionsetup{margin=|\ldots|}| resp.
+% |\captionsetup{width=|\ldots|}|\quad.
+% }\end{quote}
+% \See{\Section{margins}{Margins and further paragraph options}}
+%
+% Setting an indention was done in \version{2.x} with
+% \begin{quote}
+% |\captionstyle{indent}|\\
+% |\setlength\captionindent{|\ldots|}|\quad.
+% \end{quote}
+% This is now done with
+% \begin{quote}
+% |\captionsetup{format=plain,indention=|\ldots|}|\quad.
+% \end{quote}
+%
+% The so-called single-line-check was controlled by the commands
+% |\oneline|\-|captions|\-|false| (for switching the check off) and
+% |\oneline|\-|captions|\-|true| (for switching the check on).
+% This was replaced by
+% |\captionsetup{|\discretionary{}{}{}|singlelinecheck=|\discretionary{}{}{}|off}|
+% resp.
+% |\captionsetup{|\discretionary{}{}{}|singlelinecheck=|\discretionary{}{}{}|on}|.
+% \See{\Section{justification}{Justification}}
+%
+% The commands
+% \begin{quote}
+% |\captionlabeldelim|, |\captionlabelsep|, |\captionstyle|,\\
+% |\defcaptionstyle|, |\newcaptionstyle|, and |\renewcaptionstyle|
+% \end{quote}
+% do not have a simple replacement and therefore will not be emulated
+% by this version of the \thispackage\ package. (So using them will
+% cause error messages.) Rewriting such code is not always easy and
+% straight-ahead, but by conscientious reading of this manual you should
+% find appropriate options and commands instead.
+%
+% \iffalse
+% ... (some examples)
+% \fi
+%
+% The \version{2.x} option |ignoreLTcapwidth| do not have a replacement, too.
+% But in most cases you can simply drop using that option because
+% in this version of the \thispackage\ package the value of |\LTcapwidth|
+% will be ignored anyway (unless you set it to a different value than the
+% default one).
+% \See{\Section{longtable}{The \package{longtable} package}}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \pagebreak[4]
+% \section{Further reading}
+%
+% I recommend the following documents for further reading:
+%
+% \begin{itemize}
+% \item
+% The \TeX\ FAQ - Frequently asked questions about \TeX\ and \LaTeX :
+% \begin{quote}\url{http://faq.tug.org/}\end{quote}
+%
+% \item
+% A French FAQ can be found at
+% \begin{quote}\url{http://www.grappa.univ-lille3.fr/FAQ-LaTeX/}\end{quote}
+%
+% \item
+% \textsf{epslatex} from Keith Reckdahl contains many tips around
+% including graphics in \LaTeXe\ documents.
+% You will find this document in the directory
+% \begin{quote}\url{ftp://ftp.ctan.org/pub/tex/info/epslatex/}\end{quote}
+% \end{itemize}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \section{Thanks}
+%
+% I would like to thank Katja Melzner,
+% Steven D. Cochran, Frank Mittelbach,
+% David Carlisle, Carsten Heinz, Olga Lapko, and Keith Reckdahl.
+% Thanks a lot for all your help, ideas, patience, spirit, and support!
+%
+% Also I would like to thank
+% Harald Harders,
+% Peter L\"offler,
+% Peng Yu,
+% Alexander Zimmermann,
+% Matthias Pospiech,
+% J\"urgen Wieferink,
+% Christoph Bartoschek,
+% Uwe St\"ohr,
+% Ralf Stubner,
+% Geoff Vallis,
+% Florian Keiler,
+% J\"urgen G\"obel,
+% Uwe Siart,
+% Sang-Heon Shim,
+% Henrik Lundell,
+% David Byers,
+% William Asquith,
+% and
+% Prof.~Dr.~Dirk Hoffmann,
+% who all helped to make this package a better one.
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \StopEventually{\begin{thebibliography}{9}
+% \bibitem{companion}
+% Frank Mittelbach and Michel Goossens:
+% \newblock {\em The {\LaTeX} Companion (2nd.~Ed.)},
+% \newblock Addison-Wesley, 2004.
+%
+% \bibitem{float}
+% Anselm Lingnau:
+% \emph{An Improved Environment for Floats},
+% 2001/11/08
+%
+% \bibitem{floatrow}
+% Olga Lapko:
+% \emph{The floatrow package documentation},
+% 2005/05/22
+%
+% \bibitem{hyperref}
+% Sebastian Rahtz \& Heiko Oberdiek:
+% \emph{Hypertext marks in \LaTeX},
+% 2007/01/25
+%
+% \bibitem{hypcap}
+% Heiko Oberdiek:
+% \emph{The hypcap package -- Adjusting anchors of captions}
+% 2007/02/19
+%
+% \bibitem{listings}
+% Carsten Heinz:
+% \emph{The Listings Package},
+% 2004/02/13
+%
+% \bibitem{longtable}
+% David Carlisle:
+% \emph{The longtable package},
+% 2000/10/22
+%
+% \bibitem{rotating}
+% Sebastian Rahtz and Leonor Barroca:
+% \emph{A style option for rotated objects in \LaTeX},
+% 1997/09/26
+%
+% \bibitem{sidecap}
+% Rolf Niepraschk und Hubert G\"a\ss lein:
+% \emph{The sidecap package},
+% 2003/06/06
+%
+% \bibitem{subfig}
+% Steven D. Cochran:
+% \emph{The subfig package},
+% 2005/07/05
+%
+% \bibitem{supertabular}
+% Johannes Braams und Theo Jurriens:
+% \emph{The supertabular environment},
+% 2002/07/19
+%
+% \bibitem{Anne}
+% Anne Br\"uggemann-Klein:
+% \emph{Einf\"uhrung in die Dokumentverarbeitung},
+% B.G. Teubner, Stuttgart, 1989
+% \end{thebibliography}}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \DoNotIndex{\\,\_,\ ,\@@par}
+% \DoNotIndex{\@classoptionslist,\@currext,\@currname}
+% \DoNotIndex{\@ehc,\@ehd,\@empty,\@expandtwoargs}
+% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
+% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
+% \DoNotIndex{\@ifnextchar,\@ifstar,\@ifundefined,\@latex@error}
+% \DoNotIndex{\@namedef,\@nameuse}
+% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
+% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setpar}
+% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
+% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
+% \DoNotIndex{\p@,\z@}
+% \DoNotIndex{\active,\addtocounter,\addtolength,\advance}
+% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
+% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
+% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
+% \DoNotIndex{\fi,\footnotesize,\global}
+% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
+% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
+% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
+% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
+% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
+% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
+% \DoNotIndex{\normalsize,\or,\par,\parbox,\parfillskip}
+% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\providecommand}
+% \DoNotIndex{\quad}
+% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
+% \DoNotIndex{\rightskip,\rmfamily}
+% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
+% \DoNotIndex{\small,\string,\space,\strut}
+% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
+% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
+% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
+% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
+% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
+% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
+% \DoNotIndex{\ProcessOptions,\ProvidesPackage}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \setlength{\parskip}{0pt plus 1pt}
+%
+% \section{The Implementation}
+%
+% \changes{v1.0}{1994/10/27}{First release}
+% \changes{v1.1}{1994/11/03}{New captiontype \cs{centerlast}}
+% \changes{v1.2}{1994/11/28}{Support of the \package{float} package}
+% \changes{v1.3}{1995/01/09}{Support of \cs{captionlabelfont} in subcaptions}
+% \changes{v1.4}{1995/01/30}{New option \cs{nooneline}}
+% \changes{v1.4b}{1995/04/05}{Bugfix release}
+% \changes{v3.0}{2003/12/20}{Rewritten; many new commands and features}
+% \changes{v3.0d}{2004/11/28}{Split into two packages: \package{caption} \& \package{caption3}}
+% \changes{v3.0l}{2007/01/20}{Usage of \cs{PackageError} replaced by \cs{caption@error}}
+%
+% The \package{caption} package consists of two parts -- the kernel
+% (|caption3.sty|) and the main package (|caption.sty|).
+%
+% The kernel provides all the user commands and internal macros which are
+% necessary for typesetting captions and setting parameters regarding these.
+% While the standard \LaTeX\ document classes provides an internal command
+% called |\@makecaption| and no options to control its behavior (except the
+% vertical skips above and below the caption itself), we provide similar
+% commands called |\caption@make| and |\caption@@make|, but with a lot of
+% options which can be selected with |\captionsetup|.
+% Loading the kernel part do not change the output of a \LaTeX\ document
+% -- it just provides functionality which can be used by \LaTeXe\ packages
+% which typesets captions, like the \package{caption} package or the
+% \package{subfig} package.
+%
+% The \package{caption} package itself redefines the \LaTeX\ commands
+% |\caption|, |\@caption|, and |\@makecaption| and maps the latter one to
+% |\caption@@make|, giving the user the possibility to control the captions of
+% the floating environments |figure| and |table|. Furthermore it does similar
+% to the caption stuff coming from other packages (like the \package{longtable}
+% or \package{supertabular} package):
+% Mapping the appropriate internal commands (like |\LT@makecaption| or
+% |\ST@caption|) to the ones offered by the \package{caption} kernel.
+% So you can think of the \package{caption} package as a layer package, it
+% simply provides adaptation layers between the caption stuff coming from
+% \LaTeXe\ itself or a \LaTeXe\ package and the caption stuff offered by the
+% \package{caption} kernel.
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{Kernel}
+% \iffalse
+%<*kernel>
+% \fi
+%
+% \subsubsection*{Identification}
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesPackage{caption3}[2007/04/11 v1.0q caption3 kernel (AR)]
+% \end{macrocode}
+%
+% \subsubsection*{Generic helpers}
+%
+% \begin{macro}{\@nameundef}
+% This is the opposite to |\@namedef| which is offered by the \LaTeX\ kernel.
+% We use it to remove the definition of some commands and keyval options after
+% |\begin{document}| (to save \TeX\ memory) and to remove caption options defined
+% with |\captionsetup|\oarg{type}.
+% \begin{macrocode}
+\providecommand*\@nameundef[1]{%
+ \expandafter\let\csname #1\endcsname\@undefined}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@addto@macro}
+% The \LaTeXe\ kernel offers the internal helper macro |\g@addto@macro| which
+% globally adds commands to any existising macro, like in |\AtBeginDocument|.
+% This is the same but it works local, not global
+% (using \cs{edef} instead of \cs{xdef}).
+% \begin{macrocode}
+\providecommand{\l@addto@macro}[2]{%
+ \begingroup
+ \toks@\expandafter{#1#2}%
+ \edef\@tempa{\endgroup\def\noexpand#1{\the\toks@}}%
+ \@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bothIfFirst}
+% \begin{macro}{\bothIfSecond}
+% |\bothIfFirst| tests if the first argument is not empty, |\bothIfSecond|
+% tests if the second argument is not empty. If yes both arguments get
+% typeset, otherwise none of them.
+% \begin{macrocode}
+\def\bothIfFirst#1#2{%
+ \protected@edef\caption@tempa{#1}%
+ \ifx\caption@tempa\@empty\else
+ #1#2%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\def\bothIfSecond#1#2{%
+ \protected@edef\caption@tempa{#2}%
+ \ifx\caption@tempa\@empty\else
+ #1#2%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifinlist}
+% This helper macro checks if the first argument is in the comma separated
+% list which is offered as second argument. So for example
+% \begin{quote}
+% |\caption@ifinlist{frank}{axel,frank,steven}{yes}{no}|
+% \end{quote}
+% would expand to |yes|.
+% \begin{macrocode}
+\def\caption@ifinlist#1#2{%
+ \let\next\@secondoftwo
+ \edef\caption@tempa{#1}%
+ \@for\caption@tempb:={#2}\do{%
+ \ifx\caption@tempa\caption@tempb
+ \let\next\@firstoftwo
+ \fi}%
+ \next}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setbool}
+% \begin{macro}{\caption@ifbool}
+% \begin{macro}{\caption@undefbool}
+% For setting and testing boolean options we offer these three helper macros:
+% \begin{quote}
+% |\caption@setbool|\marg{name}\marg{value}\\
+% | |(with |value = false/true/no/yes/off/on/0/1|)\\
+% |\caption@ifbool|\marg{name}\marg{if-clause}\marg{else-clause}\\
+% |\caption@undefbool|\marg{name}
+% \end{quote}
+% \begin{macrocode}
+\def\caption@setbool#1#2{%
+ \caption@ifinlist{#2}{1,true,yes,on}{%
+ \expandafter\let\csname caption@if#1\endcsname\@firstoftwo
+ }{\caption@ifinlist{#2}{0,false,no,off}{%
+ \expandafter\let\csname caption@if#1\endcsname\@secondoftwo
+ }{%
+ \caption@Error{Undefined boolean value `#2'}%
+ }}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@ifbool#1{\@nameuse{caption@if#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@undefbool#1{\@nameundef{caption@if#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@newcounter}
+% \changes{v3.0p}{2007/04/08}{\cs{caption@XXXcounter} added}
+% \begin{macro}{\caption@setcounter}
+% \begin{macro}{\caption@addtocounter}
+% \begin{macro}{\caption@stepcounter}
+% To save counter space we use commands instead of counters.
+% \begin{macrocode}
+\def\caption@newcounter#1{\gdef#1{0}}
+\def\caption@setcounter#1#2{\xdef#1{#2}}
+\def\caption@addtocounter#1#2{%
+ \begingroup
+ \@tempcnta#1%
+ \advance\@tempcnta#2%
+ \xdef#1{\the\@tempcnta}%
+ \endgroup}
+\def\caption@stepcounter#1{\caption@addtocounter#1\@ne}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection*{Errors}
+%
+% \begin{macro}{\caption@Error}
+% \changes{v3.0l}{2007/01/20}{This macro added}
+% \changes{v3.0q}{2007/04/11}{Renamed from \cs{caption@error} to \cs{caption@Error}}
+% This is mainly identical to |\PackageError{caption}{#1}{\caption@eh}|.
+% \begin{macrocode}
+\newcommand\caption@Package{caption}
+\newcommand*\caption@Error[1]{%
+ \PackageError\caption@Package{#1}\caption@eh}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@eh}
+% At the moment we only offer this simple error message as generic helper
+% for the user.
+% \begin{macrocode}
+\newcommand\caption@eh{%
+ If you do not understand this error, please take a closer look\MessageBreak
+ at the documentation of the `\caption@Package' package.\MessageBreak
+ \@ehc}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection*{Using the keyval package}
+%
+% We need the \package{keyval} package for option handling, so we load it here.
+% \begin{macrocode}
+\RequirePackage{keyval}[1997/11/10]
+% \end{macrocode}
+%
+% \begin{macro}{\undefine@key}
+% This helper macro is the opposite of |\define@key|, it removes a keyval
+% definition.
+% \begin{macrocode}
+\providecommand*\undefine@key[2]{%
+ \@nameundef{KV@#1@#2}\@nameundef{KV@#1@#2@default}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionOption}
+% |\DeclareCaptionOption|\marg{option}\marg{code}\\
+% |\DeclareCaptionOption*|\marg{option}\marg{code}\par
+% We declare our options using these commands (instead of using
+% |\DeclareOption| offered by \LaTeXe), so the keyval package is used.
+% The starred form makes the option available during the lifetime of the
+% current package only, so they can be used with |\usepackage|, but
+% \emph{not} with |\captionsetup| later on.
+% \begin{macrocode}
+\newcommand\DeclareCaptionOption{%
+ \@ifstar{\caption@declareoption\AtEndOfPackage}%
+ {\caption@declareoption\@gobble}}
+\newcommand*\caption@declareoption[2]{%
+ #1{\undefine@key{caption}{#2}}\define@key{caption}{#2}}
+\@onlypreamble\DeclareCaptionOption
+\@onlypreamble\caption@declareoption
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionsetup}
+% \changes{v3.0a}{2004/01/17}{Bugfix: Missing \% added}
+% |\captionsetup|\oarg{type}\marg{keyval-list of options}\par
+% If the optional argument `type' is specified, we simply save or append
+% the option list, otherwise we `execute' it with |\setkeys|.
+% \begin{macrocode}
+\newcommand\captionsetup{\@ifnextchar[\caption@setuptype\caption@setup}
+\newcommand\caption@typ@{caption@typ@} % This saves 74 words of TeX memory
+\def\caption@setuptype[#1]#2{%
+ \@ifundefined{\caption@typ@#1}%
+ {\@namedef{\caption@typ@#1}{#2}}%
+ {\expandafter\l@addto@macro\csname\caption@typ@#1\endcsname{,#2}}}
+\newcommand\caption@setup{\caption@setkeys{caption}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setkeys}
+% \changes{v3.0i}{2006/01/03}{This macro added}
+% \changes{v3.0l}{2007/01/20}{Bugfix: Usage of \cs{caption@keydepth} added}
+% \changes{v3.0l}{2007/01/30}{Optional argument added}
+% \changes{v3.0p}{2007/04/08}{\cs{caption@keydepth} is now a command instead of a counter}
+% This one simply calls |\setkeys|\marg{package}\marg{args} but lets the
+% error messages refer to the \meta{package} package instead of the
+% \package{keyval} package.
+% \begin{macrocode}
+\newcommand*\caption@setkeys{%
+ \@dblarg\caption@@setkeys}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@setkeys[#1]#2#3{%
+ \ifnum\caption@keydepth=0\relax
+ \let\caption@KV@errx\KV@errx
+ \let\caption@KV@err\KV@err
+ \let\KV@errx\caption@Error
+ \let\KV@err\caption@Error
+ \fi
+ \caption@stepcounter\caption@keydepth
+%
+ \def\caption@Package{#1}%
+ \caption@Debug{\protect\setkeys{#2}{#3}}%
+ \setkeys{#2}{#3}%
+ \def\caption@Package{caption}%
+%
+ \caption@addtocounter\caption@keydepth\m@ne
+ \ifnum\caption@keydepth=0\relax
+ \let\KV@errx\caption@KV@errx
+ \let\KV@err\caption@KV@err
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@newcounter\caption@keydepth
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@settype}
+% \changes{v3.0i}{2006/01/03}{Optional argument added}
+% \changes{v3.0j}{2006/01/26}{Revised}
+% \changes{v3.0l}{2007/01/30}{Optional argument removed}
+% |\caption@settype|\marg{type}\par
+% Caption options which have been saved with |\captionsetup|\oarg{type} can
+% be executed using this command.
+% (It simply executes the saved option list, if there is any.)
+% \begin{macrocode}
+\newcommand*\caption@settype[1]{%
+ \@ifundefined{\caption@typ@#1}{}{%
+ \caption@esetup{\csname\caption@typ@#1\endcsname}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@esetup}
+% |\caption@esetup|\marg{keyval-list of options}\par
+% To execute a keyval-list of options saved within a macro we
+% need this special version of |\caption@setup| which expands the
+% argument first.
+% \begin{macrocode}
+\newcommand*\caption@esetup[1]{%
+ \edef\caption@tempa{\noexpand\caption@setup{#1}}%
+ \caption@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clearcaptionsetup}
+% |\clearcaptionsetup|\marg{type}\par
+% This removes the saved option list associated with \meta{type}.
+% \begin{macrocode}
+\newcommand*\clearcaptionsetup[1]{\@nameundef{\caption@typ@#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\showcaptionsetup}
+% \changes{v3.0e}{2005/05/03}{Optimized for memory usage}
+% |\showcaptionsetup|\oarg{package}\marg{type}\par
+% This comes for debugging issues: It shows the saved option list which
+% is associated with \meta{type}.
+% \begin{macrocode}
+\newcommand*\showcaptionsetup[2][\@firstofone]{%
+ \GenericWarning{}{%
+ #1 Caption Info: KV list on `#2'\MessageBreak
+ #1 Caption Data: (%
+ \@ifundefined{\caption@typ@#2}{%
+ % empty -- print nothing
+ }{%
+ \@nameuse{\caption@typ@#2}%
+ }%
+ )}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ProcessOptions}
+% \changes{v3.0a}{2004/01/23}{Bugfix, see \purett{news:400D360C.9678329F@gmx.net} for details}
+% \changes{v3.0i}{2006/01/03}{Improvement, uses \cs{caption@setkeys} instead of \cs{setkeys}}
+% \changes{v3.0j}{2006/02/23}{Bugfix, now processes only those global options which have a default value}
+% \changes{v3.0l}{2007/01/30}{\cs{ProcessOptionsWithKV} renamed to \cs{caption@ProcessOptions} and moved from the package to the kernel}
+% We process our options using the keyval package, so we use this one
+% instead of |\ProcessOptions| offered by \LaTeXe.
+% (This code was taken from the \package{hyperref} package and improved.)
+% \begin{macrocode}
+\newcommand*\caption@ProcessOptions[1]{%
+ \let\@tempc\relax
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \let\caption@tempa\@empty
+ \@for\CurrentOption:=\@classoptionslist\do{%
+ \@ifundefined{KV@#1@\CurrentOption}{%
+ }{%
+ \@ifundefined{KV@#1@\CurrentOption @default}{%
+ \PackageInfo{#1}{Global option `\CurrentOption' ignored}%
+ }{%
+ \PackageInfo{#1}{Global option `\CurrentOption' processed}%
+ \edef\caption@tempa{\caption@tempa,\CurrentOption,}%
+ \@expandtwoargs\@removeelement\CurrentOption
+ \@unusedoptionlist\@unusedoptionlist
+ }%
+ }%
+ }%
+ \edef\caption@tempa{%
+ \noexpand\caption@setkeys{#1}{%
+ \caption@tempa\@ptionlist{\@currname.\@currext}%
+ }%
+ }%
+ \caption@tempa
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \let\CurrentOption\@empty
+ \AtEndOfPackage{\let\@unprocessedoptions\relax}}
+\@onlypreamble\caption@ProcessOptions
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection*{Margin resp. width}
+% \changes{v3.0p}{2007/04/01}{\cs{captionmarginx} renamed to \cs{captionmargin@}}
+% \changes{v3.0p}{2007/04/03}{Option `twoside' added to kernel}
+%
+% \begin{macro}{\captionmargin}
+% \begin{macro}{\captionwidth}
+% |\captionmargin| and |\captionwidth| contain the extra margin
+% resp. the total width used for captions. Please never set these values in
+% a direct way, they are just accessible in user documents to provide
+% compatibility to |caption.sty| \version{1.x}.\par
+% Note that we can only set one value at a time, `margin' \emph{or} `width'.
+% If |\captionwidth| is not zero we will take this value afterwards,
+% otherwise |\captionmargin| and |\captionmargin@|.
+% \begin{macrocode}
+\newdimen\captionmargin
+\newdimen\captionmargin@
+\newdimen\captionwidth
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{margin}{\setcaptionmargin{#1}}
+\DeclareCaptionOption{width}{\setcaptionwidth{#1}}
+\DeclareCaptionOption{twoside}[1]{\caption@setbool{twoside}{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\setcaptionmargin}
+% |\setcaptionmargin|\marg{amount}
+% \changes{v3.0h}{2005/10/24}{Renamed from \cs{caption@setmargin} to \cs{setcaptionmargin}}
+% \changes{v3.0h}{2005/10/24}{\cs{setcaptionmargin} enhanced so it can take left+right margin}
+% |\setcaptionmargin|\marg{amount}\par
+% Please never use this in user documents, it's just there to
+% provide compatibility to |caption2.sty| \version{2.x}.
+% \begin{macrocode}
+\newcommand*\setcaptionmargin[1]{%
+ \captionwidth\z@
+ \caption@@setmargin#1,#1,\@nil\@@}
+\def\caption@@setmargin#1,#2,#3\@@{%
+ \setlength\captionmargin{#1}%
+ \setlength\captionmargin@{#2}%
+ \advance\captionmargin@ by -\captionmargin}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\setcaptionwidth}
+% |\setcaptionwidth|\marg{amount}
+% \changes{v3.0h}{2005/10/24}{Renamed from \cs{caption@setwidth} to \cs{setcaptionwidth}}
+% |\setcaptionwidth|\marg{amount}\par
+% Please never use this in user documents, it's just there to
+% provide compatibility to |caption2.sty| \version{2.x}.
+% \begin{macrocode}
+\newcommand\setcaptionwidth{%
+ \setlength\captionwidth}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@count}
+% \changes{v3.0p}{2007/04/03}{This counter added}
+% This counter numbers the captions. It will be used inside |\caption@ifoddpage| only.
+% \begin{macrocode}
+\caption@newcounter\caption@count
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@newlabel}
+% \changes{v3.0p}{2007/04/03}{This macro added}
+% This command is a modified version of |\newlabel| from \LaTeX2e.
+% It will be written to the \texttt{.aux} file to
+% pass label information from one run to another.
+% It will be used inside |\caption@ifoddpage| and |\caption@ragged|.
+% \begin{macrocode}
+\newcommand*\caption@newlabel{\@newl@bel{caption}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@thepage}
+% \changes{v3.0p}{2007/04/03}{This macro added}
+% This command is a modified version of |\thepage| from \LaTeX2e.
+% It will be used inside |\caption@ifoddpage| only.
+% \begin{macrocode}
+\newcommand*\caption@thepage{\the\c@page}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifoddpage}
+% \changes{v3.0p}{2007/04/03}{This macro added}
+% \emph{Note:} This macro re-defines itself so the \texttt{.aux} file will
+% only be used once per group.
+% \begin{macrocode}
+\def\caption@ifoddpage{%
+ \caption@iftwoside{%
+% \end{macrocode}
+% |\refstepcounter{caption@count}|
+% \begin{macrocode}
+ \caption@stepcounter\caption@count
+% \end{macrocode}
+% |\label{\the\caption@count}|
+% \begin{macrocode}
+ \protected@write\@auxout{\let\caption@thepage\relax}%
+ {\string\caption@newlabel{\caption@count}{\caption@thepage}}%
+% \end{macrocode}
+% |\edef\caption@thepage{\pageref{\the\caption@count}}|
+% \begin{macrocode}
+ \expandafter\ifx\csname caption@\caption@count\endcsname\relax
+ \G@refundefinedtrue % => 'There are undefined references.'
+ \PackageWarning{caption3}{Reference on page \thepage \space undefined}%
+ \else
+ \expandafter\let\expandafter\caption@thepage
+ \csname caption@\caption@count\endcsname
+ \fi
+% \end{macrocode}
+% |\ifodd\caption@thepage|\ldots
+% \begin{macrocode}
+ \ifodd\caption@thepage
+ \let\caption@ifoddpage\@firstoftwo
+ \else
+ \let\caption@ifoddpage\@secondoftwo
+ \fi
+ }{\let\caption@ifoddpage\@firstoftwo}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@ifoddpage}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection*{Indentions}
+%
+% \begin{macro}{\captionindent}
+% \begin{macro}{\captionparindent}
+% \begin{macro}{\captionhangindent}
+% These are the indentions we support.
+% \begin{macrocode}
+\newdimen\captionindent
+\newdimen\captionparindent
+\newdimen\captionhangindent
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \changes{v3.0b}{2004/05/16}{Defaults added for options \opt{parindent=} and \opt{hangindent=}}
+% \changes{v3.0h}{2005/08/22}{Option \opt{parskip=}: \cs{AtBeginCaption} replaced by \cs{caption@@par}}
+% \changes{v3.0h}{2005/08/22}{Undocumented defaults for \opt{parindent=}, \opt{hangindent=},
+% and \opt{parskip=} removed}
+% \begin{macrocode}
+\DeclareCaptionOption{indent}[\leftmargini]{\setlength\captionindent{#1}}% obsolete!
+\DeclareCaptionOption{indention}[\leftmargini]{\setlength\captionindent{#1}}
+\DeclareCaptionOption{hangindent}{\setlength\captionhangindent{#1}}
+\DeclareCaptionOption{parindent}{\setlength\captionparindent{#1}}
+\DeclareCaptionOption{parskip}{\l@addto@macro\caption@@par{\setlength\parskip{#1}}}
+% \end{macrocode}
+%
+% \changes{v3.0h}{2005/08/22}{Increased compatibility to KOMA-Script: A special version of options
+% `parindent' and `parskip' added}
+% \changes{v3.0i}{2006/01/03}{Bugfix 06-01-03: KOMA-Script variants of `parskip' and `parindent' options
+% revised and moved into caption kernel}
+% \changes{v3.0j}{2006/02/23}{KOMA-Script variants of `parskip' and `parindent' are obsolete now, removed}
+% \changes{v3.0o}{2007/03/30}{KOMA-Script variants of `parskip' and `parindent' re-added, since they
+% still collide with the actual version of subfig (Sigh!)}
+%
+% \begin{macrocode}
+\@ifundefined{scr@caption}{}{%
+% \end{macrocode}
+%
+% There is an option clash between the \KOMAScript\ document classes
+% and the \package{caption} kernel,
+% both define the options |parindent| and |parskip| but with different meaning.
+% Furthermore the ones defined by the \package{caption} kernel take a
+% value as parameter but the \KOMAScript\ ones do not.
+% So we need special versions of the options |parindent| and |parskip| here,
+% ones who determine if a value is given (and therefore should be treated as
+% our option) or not (and therefore should be ignored by us).
+%
+% \begin{macrocode}
+ \let\caption@KV@parindent\KV@caption@parindent
+ \DeclareCaptionOption{parindent}[]{%
+ \def\caption@tempa{#1}%
+ \ifx\caption@tempa\@empty
+ \PackageInfo{caption3}{Option `parindent' ignored}%
+ \else
+ \caption@KV@parindent{#1}%
+ \fi}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \let\caption@KV@parskip\KV@caption@parskip
+ \DeclareCaptionOption{parskip}[]{%
+ \def\caption@tempa{#1}%
+ \ifx\caption@tempa\@empty
+ \PackageInfo{caption3}{Option `parskip' ignored}%
+ \else
+ \caption@KV@parskip{#1}%
+ \fi}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection*{Styles}
+%
+% \begin{macro}{\DeclareCaptionStyle}
+% \changes{v3.0a}{2004/01/17}{Pass through argument \#3 so extra spaces between arguments do make any harm}
+% |\DeclareCaptionStyle|\marg{name}\oarg{single-line-list-of-KV}\marg{list-of-KV}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionStyle[1]{%
+ \@ifnextchar[{\caption@declarestyle{#1}}{\caption@declarestyle{#1}[]}}
+\def\caption@declarestyle#1[#2]#3{%
+ \global\@namedef{caption@sls@#1}{#2}%
+ \global\@namedef{caption@sty@#1}{#3}}
+\@onlypreamble\DeclareCaptionStyle
+\@onlypreamble\caption@declarestyle
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{style}{\caption@setstyle{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setstyle}
+% \changes{v3.0f}{2005/06/01}{Starred variant added}
+% |\caption@setstyle|\marg{name}\\
+% |\caption@setstyle*|\marg{name}\par
+% Selecting a caption style means saving the additional
+% \meta{single-line-list-of-KV} (this will be done by |\caption@sls|),
+% resetting the caption options to the default ones (this will be done using
+% |\caption@setdefault|) and executing the \meta{list-of-KV} options
+% (this will be done using |\caption@esetup|).\par
+% The starred version will give no error message if the given style is not
+% defined.
+% \begin{macrocode}
+\newcommand\caption@setstyle{%
+ \@ifstar{\caption@@setstyle\@gobble}{\caption@@setstyle\@firstofone}}
+\newcommand*\caption@@setstyle[2]{%
+ \@ifundefined{caption@sty@#2}%
+ {#1{\caption@Error{Undefined caption style `#2'}}}%
+ {\expandafter\let\expandafter\caption@sls\csname caption@sls@#2\endcsname
+ \caption@setdefault\caption@esetup{\csname caption@sty@#2\endcsname}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setdefault}
+% This resets (nearly) all caption options to the default ones.
+% \emph{Note that this does not touch the skips and the positioning!}
+% \begin{macrocode}
+\newcommand\caption@setdefault{\captionsetup{%
+ format=default,labelformat=default,labelsep=default,textformat=default,%
+ justification=default,font=default,labelfont=default,textfont=default,%
+ margin=0pt,indent=0pt,parindent=0pt,hangindent=0pt,%
+ singlelinecheck=1,strut=1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0d}{2005/02/12}{\opt{indent=0pt} added to caption style \opt{default}}
+% Currently there is only one pre-defined style, called `default'.
+% It's a perfect match to the behaviour of |\@makecaption| offered by the
+% standard \LaTeX\ document classes:
+% If the caption fits in one single line, it is typeset centered.
+%
+% \begin{macrocode}
+\DeclareCaptionStyle{default}[indent=0pt,justification=centering]{}
+% \end{macrocode}
+%
+% \subsubsection*{Formats}
+%
+% \begin{macro}{\DeclareCaptionFormat}
+% \changes{v3.0a}{2004/01/17}{Pass through argument \#3 so extra spaces between arguments do make any harm}
+% \changes{v3.0d}{2005/02/09}{Starred variant added}
+% |\DeclareCaptionFormat|\marg{name}\marg{code with \#1, \#2, and \#3}\\
+% |\DeclareCaptionFormat*|\marg{name}\marg{code with \#1, \#2, and \#3}\par
+% The starred form causes the code being typeset in vertical (instead of
+% horizontal) mode, but does not support the |indention=| option.
+% \begin{macrocode}
+\newcommand\DeclareCaptionFormat{%
+ \@ifstar{\caption@declareformat\@gobble}%
+ {\caption@declareformat\@firstofone}}
+\newcommand\caption@declareformat[3]{%
+ \global\expandafter\let\csname caption@ifh@#2\endcsname#1%
+ \global\long\@namedef{caption@fmt@#2}##1##2##3{#3}}
+\@onlypreamble\DeclareCaptionFormat
+\@onlypreamble\caption@declareformat
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{format}{\caption@setformat{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setformat}
+% |\caption@setformat|\marg{name}\par
+% Selecting a caption format simply means saving the code (in |\caption@fmt|)
+% and if the code should be used in horizontal or vertical mode (|\caption@ifh|).
+% \begin{macrocode}
+\newcommand*\caption@setformat[1]{%
+ \@ifundefined{caption@fmt@#1}%
+ {\caption@Error{Undefined caption format `#1'}}%
+ {\expandafter\let\expandafter\caption@ifh\csname caption@ifh@#1\endcsname
+ \expandafter\let\expandafter\caption@fmt\csname caption@fmt@#1\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0a}{2004/01/23}{Caption format \opt{default} renamed to \opt{normal}}
+% \changes{v3.0f}{2005/05/12}{Caption format \opt{normal} renamed to \opt{@normal}}
+% \changes{v3.0h}{2005/08/25}{Caption format \opt{@normal} renamed to \opt{plain} and documented}
+% There are two pre-defined formats, called `plain' and `hang'.
+%
+% \begin{macrocode}
+\DeclareCaptionFormat{plain}{#1#2#3\par}
+\DeclareCaptionFormat{hang}{%
+ \@hangfrom{#1#2}%
+ \advance\captionparindent\hangindent
+ \advance\captionhangindent\hangindent
+ \caption@@par
+ #3\par}
+% \end{macrocode}
+%
+% \changes{v3.0a}{2004/01/23}{Caption format \opt{default} linked to \opt{normal}}
+% \changes{v3.0e}{2005/04/28}{Bugfix 05-04-28: Missing \cs{caption@ifh@default} added}
+% `default' usually maps to `plain'.
+%
+% \begin{macrocode}
+\def\caption@fmt@default{\caption@fmt@plain}
+\def\caption@ifh@default{\caption@ifh@plain}
+% \end{macrocode}
+%
+% \subsubsection*{Label formats}
+%
+% \begin{macro}{\DeclareCaptionLabelFormat}
+% \changes{v3.0a}{2004/01/17}{Pass through argument \#2 so extra spaces between arguments do make any harm}
+% |\DeclareCaptionLabelFormat|\marg{name}\marg{code with \#1 and \#2}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionLabelFormat[2]{%
+ \global\@namedef{caption@lfmt@#1}##1##2{#2}}
+\@onlypreamble\DeclareCaptionLabelFormat
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{labelformat}{\caption@setlabelformat{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlabelformat}
+% |\caption@setlabelformat|\marg{name}\par
+% Selecting a caption label format simply means saving the code (in |\caption@lfmt|).
+% \begin{macrocode}
+\newcommand*\caption@setlabelformat[1]{%
+ \@ifundefined{caption@lfmt@#1}%
+ {\caption@Error{Undefined caption label format `#1'}}%
+ {\expandafter\let\expandafter\caption@lfmt\csname caption@lfmt@#1\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% There are three pre-defined label formats, called `empty', `simple', and `parens'.
+%
+% \begin{macrocode}
+\DeclareCaptionLabelFormat{empty}{}
+\DeclareCaptionLabelFormat{simple}{\bothIfFirst{#1}{\nobreakspace}#2}
+\DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{\nobreakspace}(#2)}
+% \end{macrocode}
+%
+% `default' usually maps to `simple'.
+%
+% \begin{macrocode}
+\def\caption@lfmt@default{\caption@lfmt@simple}
+% \end{macrocode}
+%
+% \subsubsection*{Label separators}
+%
+% \begin{macro}{\DeclareCaptionLabelSeparator}
+% \changes{v3.0a}{2004/01/17}{Pass through argument \#2 so extra spaces between arguments do make any harm}
+% \changes{v3.0h}{2005/08/25}{Starred variant added}
+% |\DeclareCaptionLabelSeparator|\marg{name}\marg{code}\\
+% |\DeclareCaptionLabelSeparator*|\marg{name}\marg{code}\par
+% The starred form causes the label separator to be typeset \emph{without} using |\captionlabelfont|.
+% \begin{macrocode}
+\newcommand\DeclareCaptionLabelSeparator{%
+ \@ifstar{\caption@declarelabelseparator\@gobble}%
+ {\caption@declarelabelseparator\@firstofone}}
+\newcommand\caption@declarelabelseparator[3]{%
+ \global\expandafter\let\csname caption@iflf@#2\endcsname#1%
+ \global\long\@namedef{caption@lsep@#2}{#3}}
+\@onlypreamble\DeclareCaptionLabelSeparator
+\@onlypreamble\caption@declarelabelseparator
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{labelsep}{\caption@setlabelseparator{#1}}
+\DeclareCaptionOption{labelseparator}{\caption@setlabelseparator{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlabelseparator}
+% |\caption@setlabelseparator|\marg{name}\par
+% Selecting a caption label separator simply means saving the code (in |\caption@lsep|).
+% \begin{macrocode}
+\newcommand*\caption@setlabelseparator[1]{%
+ \@ifundefined{caption@lsep@#1}%
+ {\caption@Error{Undefined caption label separator `#1'}}%
+ {\expandafter\let\expandafter\caption@iflf\csname caption@iflf@#1\endcsname
+ \expandafter\let\expandafter\caption@lsep\csname caption@lsep@#1\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0f}{2005/06/11}{Bugfix 05-03-23: Caption label separator \opt{newline} implementation
+% changed from \cs{newline} to \cs{\textbackslash}}
+% \changes{v3.0h}{2005/08/24}{Caption label separator \opt{endash} added}
+% There are seven pre-defined label separators, called `none', `colon', `period', `space',
+% `quad', `newline', and `endash'.
+%
+% \begin{macrocode}
+\DeclareCaptionLabelSeparator{none}{}
+\DeclareCaptionLabelSeparator{colon}{: }
+\DeclareCaptionLabelSeparator{period}{. }
+\DeclareCaptionLabelSeparator{space}{ }
+\DeclareCaptionLabelSeparator*{quad}{\quad}
+\DeclareCaptionLabelSeparator*{newline}{\\}
+\DeclareCaptionLabelSeparator*{endash}{\space\textendash\space}
+% \end{macrocode}
+%
+% `default' usually maps to `colon'.
+%
+% \begin{macrocode}
+\def\caption@lsep@default{\caption@lsep@colon}
+\def\caption@iflf@default{\caption@iflf@colon}
+% \end{macrocode}
+%
+% \subsubsection*{Text formats}
+%
+% \begin{macro}{\DeclareCaptionTextFormat}
+% \changes{v3.0l}{2007/02/18}{This macro added}
+% |\DeclareCaptionTextFormat|\marg{name}\marg{code with \#1}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionTextFormat[2]{%
+ \global\long\@namedef{caption@tfmt@#1}##1{#2}}
+\@onlypreamble\DeclareCaptionTextFormat
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{textformat}{\caption@settextformat{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@settextformat}
+% \changes{v3.0l}{2007/02/18}{This macro added}
+% |\caption@settextformat|\marg{name}\par
+% Selecting a caption text format simply means saving the code (in |\caption@tfmt|).
+% \begin{macrocode}
+\newcommand*\caption@settextformat[1]{%
+ \@ifundefined{caption@tfmt@#1}%
+ {\caption@Error{Undefined caption text format `#1'}}%
+ {\expandafter\let\expandafter\caption@tfmt\csname caption@tfmt@#1\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% There are two pre-defined text formats, called `simple' and `period'.
+%
+% \begin{macrocode}
+\DeclareCaptionTextFormat{simple}{#1}
+\DeclareCaptionTextFormat{period}{#1.}
+% \end{macrocode}
+%
+% `default' usually maps to `simple'.
+%
+% \begin{macrocode}
+\def\caption@tfmt@default{\caption@tfmt@simple}
+% \end{macrocode}
+%
+% \subsubsection*{Justifications}
+%
+% \begin{macro}{\DeclareCaptionJustification}
+% \changes{v3.0a}{2004/01/17}{Pass through argument \#2 so extra spaces between arguments do make any harm}
+% |\DeclareCaptionJustification|\marg{name}\marg{code}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionJustification[2]{%
+ \global\@namedef{caption@hj@#1}{#2}}
+%\newcommand\DeclareCaptionJustification{\DeclareCaptionFont}
+\@onlypreamble\DeclareCaptionJustification
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{justification}{\caption@setjustification{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setjustification}
+% |\caption@setjustification|\marg{name}\par
+% Selecting a caption justification simply means saving the code (in |\caption@hj|).
+% \begin{macrocode}
+\newcommand*\caption@setjustification[1]{%
+ \@ifundefined{caption@hj@#1}%
+ {\caption@Error{Undefined caption justification `#1'}}%
+ {\expandafter\let\expandafter\caption@hj\csname caption@hj@#1\endcsname}}
+%\newcommand\caption@setjustification{\caption@setfont{@hj}}
+% \end{macrocode}
+% \end{macro}
+%
+% These are the pre-defined justification code snippets.
+%
+% \begin{macrocode}
+\DeclareCaptionJustification{justified}{}
+\DeclareCaptionJustification{centering}{\centering}
+\DeclareCaptionJustification{centerfirst}{\centerfirst}
+\DeclareCaptionJustification{centerlast}{\centerlast}
+\DeclareCaptionJustification{raggedleft}{\raggedleft}
+\DeclareCaptionJustification{raggedright}{\raggedright}
+% \end{macrocode}
+%
+% `default' usually maps to `justified'.
+%
+% \begin{macrocode}
+\def\caption@hj@default{\caption@hj@justified}
+% \end{macrocode}
+%
+% \begin{macro}{\centerfirst}
+% \changes{v3.0l}{2007/01/21}{Bugfix: Usage of \cs{@centercr} added (Thanks to Olga!)}
+% \changes{v3.0l}{2007/01/21}{This macro renamed from \cs{caption@centerfirst} to \cs{centerfirst}}
+% Please blame Frank Mittelbach for |\caption@centerfirst| |:-)|
+% \begin{macrocode}
+\providecommand\centerfirst{%
+ \let\\\@centercr
+ \edef\caption@normaladjust{%
+ \leftskip\the\leftskip
+ \rightskip\the\rightskip
+ \parfillskip\the\parfillskip\relax}%
+ \leftskip\z@\@plus -1fil%
+ \rightskip\z@\@plus 1fil%
+ \parfillskip\z@skip
+ \noindent\hskip\z@\@plus 2fil%
+ \@setpar{\@@par\@restorepar\caption@normaladjust}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\centerlast}
+% \changes{v3.0l}{2007/01/21}{Bugfix: Usage of \cs{@centercr} added (Thanks to Olga!)}
+% \changes{v3.0l}{2007/01/21}{This macro renamed from \cs{caption@centerlast} to \cs{centerlast}}
+% This is based on code from Anne Br\"uggemann-Klein\cite{Anne}
+% \begin{macrocode}
+\providecommand\centerlast{%
+ \let\\\@centercr
+ \leftskip\z@\@plus 1fil%
+ \rightskip\z@\@plus -1fil%
+ \parfillskip\z@\@plus 2fil\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0b}{2004/05/16}{Improved \package{ragged2e} package support}
+% We also support the upper-case commands offered by the \package{ragged2e}
+% package.
+% Note that these just map to their lower-case variants if the
+% \package{ragged2e} package is not available.
+% \begin{macrocode}
+\DeclareCaptionJustification{Centering}{%
+ \caption@ragged\Centering\centering}
+\DeclareCaptionJustification{RaggedLeft}{%
+ \caption@ragged\RaggedLeft\raggedleft}
+\DeclareCaptionJustification{RaggedRight}{%
+ \caption@ragged\RaggedRight\raggedright}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@ragged}
+% \changes{v3.0p}{2007/04/07}{The `ragged2e' package will now only been loaded when needed}
+% \changes{v3.0q}{2007/04/11}{Bugfix: Usage of \cs{caption@Info} replaced by \cs{caption@Debug}}
+% \changes{v3.0q}{2007/04/16}{Warnung will be suppressed on first \LaTeX\ run}
+% |\caption@ragged| will be basically defined as\par
+% |\AtBeginDocument{\IfFileExists{ragged2e.sty}%|\\
+% | {\RequirePackage{ragged2e}\let\caption@ragged\@firstoftwo}%|\\
+% | {\let\caption@ragged\@secondoftwo}}|\par
+% but with an additional warning if the ragged2e package is not loaded (yet).
+% (This warning will be typeout only one time per option, that's why
+% we need the |caption\string#1| stuff.)
+% Furthermore we load the \package{ragged2e} package, if needed and available.
+% \begin{macrocode}
+\newcommand*\caption@ragged{%
+ \caption@Debug{We need ragged2e}%
+ \protected@write\@auxout{}{\string\caption@newlabel{ragged2e}{}}%
+ \global\let\caption@ragged\caption@@ragged
+ \caption@@ragged}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@ragged[2]{%
+ \@ifundefined{caption\string#1}{%
+ \PackageWarning{caption3}{%
+ `ragged2e' package not loaded, therefore\MessageBreak
+ substituting \string#2 for \string#1\MessageBreak}%
+ \global\@namedef{caption\string#1}}{}%
+ #2}
+% \end{macrocode}
+% \begin{macrocode}
+\AtBeginDocument{%
+ \@ifundefined{caption@ragged2e}{%
+ \let\caption@@ragged\@secondoftwo % suppress warning above
+ }{%
+ \caption@Debug{We load ragged2e}%
+ \IfFileExists{ragged2e.sty}{%
+ \RequirePackage{ragged2e}\let\caption@@ragged\@firstoftwo}{}%
+ }}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection*{Fonts}
+%
+% \begin{macro}{\DeclareCaptionFont}
+% \changes{v3.0a}{2004/01/22}{Bugfix: Multi token arguments are allowed now}
+% |\DeclareCaptionFont|\marg{name}\marg{code}
+% \begin{macrocode}
+\newcommand\DeclareCaptionFont[2]{%
+ \define@key{caption@fnt}{#1}[]{\g@addto@macro\caption@tempa{#2}}}
+\@onlypreamble\DeclareCaptionFont
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{font}{\caption@setfont{font}{#1}}
+\DeclareCaptionOption{labelfont}{\caption@setfont{labelfont}{#1}}
+\DeclareCaptionOption{textfont}{\caption@setfont{textfont}{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setfont}
+% \changes{v3.0l}{2007/01/30}{Usage of \cs{caption@setkeys} with optional argument}
+% |\caption@setfont|\marg{name}\marg{keyval-list of names}\par
+% Selecting a caption font means saving all the code snippets
+% (in |\caption#1|).
+% Because we use |\setkeys| recursive here we need to do this inside an
+% extra group and collect all the code snippets in |\caption@tempa| first.
+% \begin{macrocode}
+\newcommand*\caption@setfont[2]{%
+ \let\caption@tempa\@empty
+ \begingroup
+% \define@key{caption@fnt}{default}[]{%
+% \global\expandafter\let\expandafter\caption@tempa
+% \csname caption#1@default\endcsname}%
+ \caption@setkeys[caption]{caption@fnt}{#2}%
+ \endgroup
+ \expandafter\let\csname caption#1\endcsname\caption@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionFont{default}{}
+% \end{macrocode}
+%
+% These are the pre-defined font code snippets.
+%
+% \begin{macrocode}
+\DeclareCaptionFont{scriptsize}{\scriptsize}
+\DeclareCaptionFont{footnotesize}{\footnotesize}
+\DeclareCaptionFont{small}{\small}
+\DeclareCaptionFont{normalsize}{\normalsize}
+\DeclareCaptionFont{large}{\large}
+\DeclareCaptionFont{Large}{\Large}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionFont{up}{\upshape}
+\DeclareCaptionFont{it}{\itshape}
+\DeclareCaptionFont{sl}{\slshape}
+\DeclareCaptionFont{sc}{\scshape}
+\DeclareCaptionFont{md}{\mdseries}
+\DeclareCaptionFont{bf}{\bfseries}
+\DeclareCaptionFont{rm}{\rmfamily}
+\DeclareCaptionFont{sf}{\sffamily}
+\DeclareCaptionFont{tt}{\ttfamily}
+% \end{macrocode}
+%
+% \subsubsection*{\package{setspace} package support}
+% \changes{v3.0p}{2007/04/02}{\package{setspace} package support added to kernel}
+%
+% \begin{macrocode}
+\DeclareCaptionFont{singlespacing}{\setstretch{\setspace@singlespace}}% normally 1
+\DeclareCaptionFont{onehalfspacing}{\onehalfspacing}
+\DeclareCaptionFont{doublespacing}{\doublespacing}
+% \end{macrocode}
+%
+% \begin{macro}{\captionsize}
+% \changes{v3.0a}{2004/01/23}{Implementation changed from \cs{captionfont} to \cs{@empty}}
+% \changes{v3.0c}{2004/07/16}{Use \cs{providecommand} instead of \cs{newcommand} in respect of the memoir class}
+% The old versions \version{1.x} of the \package{caption} package offered this
+% command to setup the font size used for captions. We still do
+% so old documents will work fine.
+% \begin{macrocode}
+\providecommand\captionsize{}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0a}{2004/01/23}{Option \opt{size=} now sets \cs{captionsize} instead of \cs{captionfont}}
+% \begin{macrocode}
+\DeclareCaptionOption{size}{\caption@setfont{size}{#1}}
+% \end{macrocode}
+%
+% \subsubsection*{Vertical spaces before and after captions}
+%
+% \begin{macro}{\abovecaptionskip}
+% \begin{macro}{\belowcaptionskip}
+% Usually these skips are defined within the document class, but some
+% document classes don't do so.
+% \begin{macrocode}
+\@ifundefined{abovecaptionskip}{%
+ \newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@}}{}
+\@ifundefined{belowcaptionskip}{%
+ \newlength\belowcaptionskip\setlength\belowcaptionskip{0\p@}}{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \changes{v3.0d}{2005/02/12}{Option \opt{skip=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{aboveskip}{\setlength\abovecaptionskip{#1}}
+\DeclareCaptionOption{belowskip}{\setlength\belowcaptionskip{#1}}
+\DeclareCaptionOption{skip}{\setlength\abovecaptionskip{#1}}
+% \end{macrocode}
+%
+% \subsubsection*{Positioning}
+%
+% These macros handle the right position of the caption.
+% Note that the position is actually \emph{not} controlled by the
+% \package{caption} kernel options, but by the user (or a specific package
+% like the \package{float} package) instead.
+% The user can put the |\caption| command wherever he likes! So this stuff
+% is only to give us a \emph{hint} where to put the right skips, the user
+% usually has to take care for himself that this hint actually matches the
+% right position.
+% The user can also try out the experimental setting |position=auto| which
+% means that the \package{caption} package should try to guess the actual
+% position of the caption for himself. (But in many cases, for example in
+% |longtable|s, this is doomed to fail, so it's not documented in the
+% user part of the documentation.)
+%
+% \begin{macrocode}
+\DeclareCaptionOption{position}{\caption@setposition{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setposition}
+% \changes{v3.0a}{2004/01/22}{Now the positions \opt{t}, \opt{above}, \opt{b},
+% \opt{below}, and \opt{a} are allowed, too}
+% \changes{v3.0d}{2004/08/10}{Usage of \cs{caption@defaultpos} added}
+% |\caption@setposition|\marg{position}\par
+% Selecting the caption position means that we put |\caption@position| to
+% the right value. \emph{Please do \textbf{not} use the internal macro
+% \cs{caption@position} in your own package or document, but use the wrapper
+% macro \cs{caption@iftop} instead.}
+% \begin{macrocode}
+\newcommand*\caption@setposition[1]{%
+ \caption@ifinlist{#1}{d,default}{%
+ \def\caption@position{\caption@defaultpos}%
+ }{\caption@ifinlist{#1}{t,top,above}{%
+ \let\caption@position\@firstoftwo
+ }{\caption@ifinlist{#1}{b,bottom,below}{%
+ \let\caption@position\@secondoftwo
+ }{\caption@ifinlist{#1}{a,auto}{%
+ \let\caption@position\@undefined
+ }{%
+ \caption@Error{Undefined caption position `#1'}%
+ }}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@defaultpos}
+% The default `position' is usually `bottom', this means that the (larger)
+% skip will be typeset above the caption.
+% This correspondents to the |\@makecaption| implementation in the standard
+% \LaTeX\ document classes.
+% \begin{macrocode}
+%\caption@setdefaultpos{b}% default = bottom
+\let\caption@defaultpos\@secondoftwo
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@iftop}
+% \changes{v3.0a}{2004/01/23}{Split into \cs{caption@iftop} \& \cs{caption@fixposition}}
+% \changes{v3.0d}{2005/02/12}{Adapted to \cs{caption@defaultpos}}
+% |\caption@iftop|\marg{true-code}\marg{false-code}\par
+% (If the |position=| is set to |auto| we assume a |bottom| position.)
+% \begin{macrocode}
+\newcommand\caption@iftop{%
+ \ifx\caption@position\@undefined
+ \expandafter\@secondoftwo
+ \else
+ \expandafter\caption@position
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@fixposition}
+% \changes{v3.0b}{2004/05/16}{Split into \cs{caption@fixposition} & \cs{caption@autoposition}}
+% |\caption@fixposition|\par
+% This macro checks if the `position' is set to `auto'.
+% If yes, |\caption@autoposition| will be called to
+% set |\caption@position| to a proper value we can actually use.
+% \begin{macrocode}
+\newcommand\caption@fixposition{%
+ \ifx\caption@position\@undefined
+ \caption@autoposition
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@autoposition}
+% \changes{v3.0a}{2004/01/23}{\cs{ifvmode} added}
+% |\caption@autoposition|\par
+% We guess the actual position of the caption by checking |\prevdepth|.
+% \begin{macrocode}
+\newcommand\caption@autoposition{%
+ \ifvmode
+ \edef\caption@tempa{\the\prevdepth}%
+ \caption@Debug{\protect\prevdepth=\caption@tempa}%
+% \caption@setposition{\ifdim\prevdepth>-\p@ b\else t\fi}%
+ \ifdim\prevdepth>-\p@
+ \let\caption@position\@secondoftwo
+ \else
+ \let\caption@position\@firstoftwo
+ \fi
+ \else
+ \caption@Debug{no \protect\prevdepth}%
+% \caption@setposition{b}%
+ \let\caption@position\@secondoftwo
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection*{Hooks}
+%
+% \begin{macro}{\AtBeginCaption}
+% \begin{macro}{\AtEndCaption}
+% |\AtBeginCaption| \marg{code}\\
+% |\AtEndCaption| \marg{code}\par
+% These hooks can be used analogous to |\AtBeginDocument| and |\AtEndDocument|.
+% \begin{macrocode}
+\newcommand\caption@beginhook{}
+\newcommand\caption@endhook{}
+\newcommand\AtBeginCaption{\l@addto@macro\caption@beginhook}
+\newcommand\AtEndCaption{\l@addto@macro\caption@endhook}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection*{Miscellaneous options}
+%
+% \changes{v3.0b}{2004/05/16}{Option \opt{listof=} added}
+% \changes{v3.0d}{2005/02/12}{Option \opt{strut=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{listof}{\caption@setbool{lof}{#1}}
+\DeclareCaptionOption{singlelinecheck}{\caption@setbool{slc}{#1}}
+\DeclareCaptionOption{strut}{\caption@setbool{strut}{#1}}
+% \end{macrocode}
+%
+% \subsubsection*{Debug option}
+% \changes{v3.0m}{2007/03/04}{Debug option added to kernel}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{debug}[1]{%
+ \caption@setbool{debug}{#1}%
+ \caption@ifdebug{%
+ \def\caption@Debug{\PackageInfo{caption3}}%
+ }{%
+ \let\caption@Debug\@gobble
+ }}
+\setkeys{caption}{debug=0}
+% \end{macrocode}
+%
+% \subsubsection*{Initialization of parameters}
+%
+% \begin{macrocode}
+\captionsetup{style=default,position=default,listof=1,%
+ twoside=\if@twoside 1\else 0\fi}
+% \end{macrocode}
+%
+% \begin{macro}{\ifcaption@star}
+% If the starred form of |\caption| is used, this will be set to |true|.
+% (It will be reset to |false| at the end of |\caption@@make|.)
+% \begin{macrocode}
+\newif\ifcaption@star
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection*{Typesetting the caption}
+%
+% \begin{macro}{\caption@make}
+% |\caption@make|\marg{float name}\marg{ref.\ number}\marg{text}
+% \begin{macrocode}
+\newcommand\caption@make[2]{%
+ \caption@@make{\caption@lfmt{#1}{#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@make}
+% \changes{v3.0b}{2004/05/16}{Bugfix 04-05-05: \cs{ifdim}\cs{captionindent=}\cs{z@} added}
+% \changes{v3.0d}{2005/02/12}{Bugfix 04-10-26: Use \cs{@tempdima} instead of \cs{captionmargin} resp. \cs{captionwidth};
+% check for \cs{z@} added}
+% \changes{v3.0d}{2005/02/12}{Bugfix: \cs{hskip}\cs{captionmargin} to the end of caption added}
+% \changes{v3.0d}{2005/02/12}{Bugfix: \cs{strut} moved from here to \cs{caption@@@make}}
+% \changes{v3.0d}{2005/02/12}{Single-line-check moved up so it can affect margins now}
+% \changes{v3.0d}{2005/02/09}{Improvement: \cs{caption@ifh} added}
+% \changes{v3.0d}{2005/02/09}{Bugfix: \cs{leavevmode} added}
+% \changes{v3.0h}{2005/08/24}{Uses \cs{sbox} instead of \cs{setbox} in single-line-check}
+% \changes{v3.0i}{2005/12/04}{Uses \cs{caption@slc}}
+% \changes{v3.0i}{2006/01/11}{Bugfix: \cs{caption@calcmargin} inside single-line-check replaced by \cs{relax}}
+% \changes{v3.0i}{2006/01/11}{Bugfix: \cs{caption@startbox} will always be typeset in horizontal mode}
+% \changes{v3.0k}{2006/05/13}{Uses \cs{captionbox} instead of \cs{caption@start/endbox}}
+% \changes{v3.0l}{2007/01/04}{Oops, bugfix 04-05-05 got lost in v3.0j, re-added}
+% \changes{v3.0p}{2007/04/03}{Usage of \cs{caption@ifoddpage} added}
+% |\caption@@make|\marg{caption label}\marg{caption text}
+% \begin{macrocode}
+\newcommand\caption@@make[2]{%
+ \begingroup
+ \caption@beginhook
+ \caption@calcmargin
+% \end{macrocode}
+%
+% Special single-line treatment (option |singlelinecheck=|)
+%
+% \begin{macrocode}
+ \caption@ifslc{\ifx\caption@sls\@empty\else
+ \caption@slc{#1}{#2}\captionwidth\relax
+ \fi}{}%
+% \end{macrocode}
+%
+% Typeset the left margin (option |margin=|)
+%
+% \begin{macrocode}
+ \@tempdima\captionmargin
+ \ifdim\captionmargin@=\z@\else
+ \caption@ifoddpage{}{\advance\@tempdima\captionmargin@}%
+ \fi
+ \caption@ifh{\advance\@tempdima\captionindent}%
+ \hskip\@tempdima
+% \end{macrocode}
+%
+% We actually use a |\vbox| of width |\captionwidth - \captionindent|
+% to typeset the caption
+% (Note: |\captionindent| is \emph{not} supported if the caption format
+% was defined with |\DeclareCaptionFormat*|.)
+%
+% \begin{macrocode}
+ \@tempdima\captionwidth
+ \caption@ifh{\advance\@tempdima by -\captionindent}%
+ \captionbox\@tempdima{%
+% \end{macrocode}
+%
+% Typeset the indention (option |indention=|)\\
+% Bugfix 04-05-05: |\hskip-\captionindent| replaced by |\ifdim\captionindent=\z@|\ldots
+%
+% \begin{macrocode}
+ \caption@ifh{%
+ \ifdim\captionindent=\z@
+ \leavevmode
+ \else
+ \hskip-\captionindent
+ \fi}%
+% \end{macrocode}
+%
+% Typeset the caption itself and close the |\captionbox|
+%
+% \begin{macrocode}
+ \caption@@@make{#1}{#2}}%
+% \end{macrocode}
+%
+% Typeset the right margin (option |margin=|)
+%
+% \begin{macrocode}
+ \@tempdima\captionmargin
+ \ifdim\captionmargin@=\z@\else
+ \caption@ifoddpage{\advance\@tempdima\captionmargin@}{}%
+ \fi
+ \hskip\@tempdima
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@endhook
+ \endgroup
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \global\caption@starfalse}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@calcmargin}
+% Calculate |\captionmargin| \& |\captionwidth|, so both contain valid
+% values.
+% \changes{v3.0h}{2005/10/24}{Internal: \cs{ifcaption@width} replaced by \cs{ifdim}\cs{captionwidth=}\cs{z@}}
+% \changes{v3.0i}{2006/01/12}{Improvement: Takes care of list environment now}
+% \begin{macrocode}
+\newcommand\caption@calcmargin{%
+% \end{macrocode}
+% \emph{Note:} Inside a |list| environment |\linewidth| do not contain
+% the proper value, because |\@caption| calls |\@parboxrestore| which
+% resets |\linewidth| to |\hsize|. Therefore we have to calculate the
+% proper line width on our own in this case.
+% \begin{macrocode}
+ \@tempdima\hsize
+ \ifnum\@listdepth>0\relax
+ \advance\@tempdima by -\leftmargin
+ \advance\@tempdima by -\rightmargin
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \ifdim\captionwidth=\z@
+ \captionwidth\@tempdima
+ \advance\captionwidth by -2\captionmargin
+ \advance\captionwidth by -\captionmargin@
+ \else
+ \captionmargin\@tempdima
+ \advance\captionmargin by -\captionwidth
+ \divide\captionmargin by 2
+ \captionmargin@\z@
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@Debug{%
+ \protect\hsize=\the\hsize,
+ \protect\margin=\the\captionmargin,
+ \protect\marginx=\the\captionmargin@,
+ \protect\width=\the\captionwidth}%
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@slc}
+% This one does the single-line-check.
+% \begin{macrocode}
+\newcommand\caption@slc[4]{%
+ \caption@startslc
+ \sbox\@tempboxa{\caption@@@make{#1}{#2}}%
+ \ifdim\wd\@tempboxa >#3%
+ \caption@endslc
+ \else
+ \caption@endslc
+ \caption@esetup\caption@sls
+ #4%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@startslc}
+% \changes{v3.0b}{2004/05/16}{Bugfix: Redefinition of \cs{label} \& \cs{@footnotetext} added}
+% \changes{v3.0b}{2004/05/16}{Redefine \cs{stepcounter} instead of \cs{footnote(mark)}}
+% \changes{v3.0d}{2005/02/12}{\cs{let}\cs{caption@hj}\cs{relax} added}
+% \changes{v3.0h}{2005/07/09}{Support of \package{endnotes} package added}
+% Re-define anything which would disturb the single-line-check.
+% \begin{macrocode}
+\newcommand\caption@startslc{%
+ \begingroup
+ \let\label\@gobble
+ \let\@footnotetext\@gobble\let\@endnotetext\@gobble
+ \def\stepcounter##1{\advance\csname c@##1\endcsname\@ne\relax}%
+ \let\caption@hj\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@endslc}
+% This ends the single-line-check.
+% \begin{macrocode}
+\newcommand\caption@endslc{%
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionbox}
+% \changes{v3.0k}{2006/05/13}{We define \cs{captionbox} instead of \cs{caption@start/endbox}}
+% \changes{v3.0n}{2006/03/09}{Bugfix 07-03-09: \cs{captionbox} changed from \cs{parbox-t} to \cs{parbox-b}}
+% This macro defines the box which surrounds the caption paragraph.
+% \begin{macrocode}
+\newcommand\captionbox{\parbox[b]}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@@make}
+% \changes{v3.0b}{2004/05/16}{Bugfix 04-05-06: \cs{allowhyphens} added}
+% \changes{v3.0d}{2005/02/12}{Bugfix 04-12-16: Use some kind of \cs{@startstrut}\cs{strutbox} instead of \cs{strut}}
+% \changes{v3.0d}{2005/02/12}{Bugfix 05-01-23: \cs{@finalstrut}\cs{strutbox} added}
+% \changes{v3.0e}{2005/05/05}{Use \cs{caption@ifempty}; \cs{let}\cs{caption@ifstrut}\cs{@secondoftwo} added}
+% \changes{v3.0e}{2005/05/05}{Bugfix: Handling of \cs{ifcaption@star} changed}
+% \changes{v3.0h}{2005/08/24}{Check for empty label added}
+% \changes{v3.0h}{2005/08/25}{\cs{caption@iflf} added}
+% \changes{v3.0l}{2007/02/18}{Usage of \cs{caption@tfmt} added}
+% |\caption@@@make|\marg{caption label}\marg{caption text}\par
+% This one finally typesets the caption paragraph, without margin and indention.
+% \begin{macrocode}
+\newcommand\caption@@@make[2]{%
+% \end{macrocode}
+%
+% If the label is empty, we use no caption label separator.
+%
+% \begin{macrocode}
+ \sbox\@tempboxa{#1}%
+ \ifdim\wd\@tempboxa=\z@
+ \let\caption@lsep\relax
+ \fi
+% \end{macrocode}
+%
+% If the text is empty, we use no caption label separator, too.
+%
+% \begin{macrocode}
+ \caption@ifempty{#2}{%
+ \let\caption@lsep\relax
+% \let\caption@ifstrut\@secondoftwo
+ }%
+% \end{macrocode}
+%
+% Take care that |\captionparindent| and |\captionhangindent| will be used
+% to typeset the paragraph.
+%
+% \begin{macrocode}
+ \@setpar{\@@par\caption@@par}\caption@@par
+% \end{macrocode}
+%
+% Finally the caption will be typeset.
+%
+% \begin{macrocode}
+ \caption@hj\captionsize\captionfont\caption@fmt
+ {\ifcaption@star\else{\captionlabelfont#1}\fi}%
+ {\ifcaption@star\else{\caption@iflf\captionlabelfont\caption@lsep}\fi}%
+ {{\captiontextfont
+ \caption@ifstrut{\vrule\@height\ht\strutbox\@width\z@}{}%
+ \nobreak\hskip\z@skip
+ \caption@tfmt{#2}%
+% \caption@ifstrut{\vrule\@height\z@\@depth\dp\strutbox\@width\z@}{}%
+ \caption@ifstrut{\@finalstrut\strutbox}{}%
+ \par}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifempty}
+% \changes{v3.0e}{2005/05/05}{This macro added}
+% |\caption@ifempty|\marg{text}\marg{if-clause}\par
+% This one tests if the \meta{text} is actually empty.\par
+% \emph{Note:} This will be done without expanding the text, therefore this
+% is far away from being bullet-proof.
+% \begin{macrocode}
+\newcommand\caption@ifempty[1]{%
+ \def\caption@tempa{#1}%
+ \def\caption@tempb{\ignorespaces}%
+ \ifx\caption@tempa\caption@tempb
+ \let\caption@tempa\@empty
+ \fi
+ \ifx\caption@tempa\@empty
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@par}
+% \changes{v3.0h}{2005/08/22}{Made this definition global}
+% |\caption@@par|\par
+% This command will be executed with every |\par| inside the caption.
+% \begin{macrocode}
+\newcommand*\caption@@par{%
+ \parindent\captionparindent\hangindent\captionhangindent}%
+% \end{macrocode}
+% \end{macro}
+%
+% \iffalse
+%</kernel>
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \subsection{Main package}
+% \iffalse
+%<*package>
+% \fi
+%
+% \subsubsection*{Identification}
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesPackage{caption}[2007/04/16 v3.0q Customising captions (AR)]
+% \end{macrocode}
+%
+% \subsubsection*{Loading the kernel}
+%
+% \begin{macrocode}
+\RequirePackage{caption3}[=2007/01/31] % needs v1.0l or newer
+% \end{macrocode}
+%
+% \subsection*{Check against the obsolete \package{caption2} package}
+% \changes{v3.0p}{2007/04/06}{Check against obsolete \package{caption2} package added}
+%
+% \begin{macrocode}
+\@ifpackageloaded{caption2}{%
+ \caption@Error{You can't use both the caption *and* caption2 package}%
+ \endinput
+}{}
+% \end{macrocode}
+%
+% \subsubsection*{Option for configuration files}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{config}[caption]{%
+ \InputIfFileExists{#1.cfg}{\typeout{*** Local configuration file
+ #1.cfg used ***}}%
+ {\PackageWarning{caption}{Configuration
+ file #1.cfg not found}}}
+% \end{macrocode}
+%
+% \subsubsection*{Options for |figure| and |table|}
+%
+% \changes{v3.0a}{2004/01/09}{Options \opt{figureposition} and \opt{tableposition} added}
+% \begin{macrocode}
+\DeclareCaptionOption*{figureposition}{\captionsetup[figure]{position=#1}}
+\DeclareCaptionOption*{tableposition}{\captionsetup[table]{position=#1}}
+% \end{macrocode}
+%
+% \changes{v3.0d}{2004/08/03}{Options \opt{figurename} and \opt{tablename} added}
+% \begin{macrocode}
+\DeclareCaptionOption*{figurename}{\captionsetup[figure]{name=#1}}
+\DeclareCaptionOption*{tablename}{\captionsetup[table]{name=#1}}
+% \end{macrocode}
+%
+% \subsubsection*{caption \version{1.x} compatibility options}
+%
+% \begin{macrocode}
+\DeclareCaptionOption*{normal}[]{\caption@setformat{normal}}
+\DeclareCaptionOption*{isu}[]{\caption@setformat{hang}}
+\DeclareCaptionOption*{hang}[]{\caption@setformat{hang}}
+\DeclareCaptionOption*{center}[]{\caption@setjustification{centering}}
+\DeclareCaptionOption*{anne}[]{\caption@setjustification{centerlast}}
+\DeclareCaptionOption*{centerlast}[]{\caption@setjustification{centerlast}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOption*{scriptsize}[]{\def\captionfont{\scriptsize}}
+\DeclareCaptionOption*{footnotesize}[]{\def\captionfont{\footnotesize}}
+\DeclareCaptionOption*{small}[]{\def\captionfont{\small}}
+\DeclareCaptionOption*{normalsize}[]{\def\captionfont{\normalsize}}
+\DeclareCaptionOption*{large}[]{\def\captionfont{\large}}
+\DeclareCaptionOption*{Large}[]{\def\captionfont{\Large}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOption*{up}[]{\l@addto@macro\captionlabelfont\upshape}
+\DeclareCaptionOption*{it}[]{\l@addto@macro\captionlabelfont\itshape}
+\DeclareCaptionOption*{sl}[]{\l@addto@macro\captionlabelfont\slshape}
+\DeclareCaptionOption*{sc}[]{\l@addto@macro\captionlabelfont\scshape}
+\DeclareCaptionOption*{md}[]{\l@addto@macro\captionlabelfont\mdseries}
+\DeclareCaptionOption*{bf}[]{\l@addto@macro\captionlabelfont\bfseries}
+\DeclareCaptionOption*{rm}[]{\l@addto@macro\captionlabelfont\rmfamily}
+\DeclareCaptionOption*{sf}[]{\l@addto@macro\captionlabelfont\sffamily}
+\DeclareCaptionOption*{tt}[]{\l@addto@macro\captionlabelfont\ttfamily}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOption*{nooneline}[]{\caption@setbool{slc}{0}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\caption@setbool{ruled}{0}
+\DeclareCaptionOption*{ruled}[]{\caption@setbool{ruled}{1}}
+% \end{macrocode}
+%
+% \subsubsection*{Some caption2 \version{2.x} compatibility options}
+% \changes{v3.0h}{2005/07/08}{caption2 \version{2.x} compatibility options added}
+%
+% \begin{macrocode}
+\DeclareCaptionOption*{flushleft}[]{\caption@setjustification{raggedright}}
+\DeclareCaptionOption*{flushright}[]{\caption@setjustification{raggedleft}}
+\DeclareCaptionOption*{oneline}[]{\caption@setbool{slc}{1}}
+\DeclareCaptionOption*{ignoreLTcapwidth}[]{}
+% \end{macrocode}
+%
+% \subsubsection*{Some \KOMAScript\ compatibility options}
+% \changes{v3.0h}{2005/08/22}{\KOMAScript\ compatibility options added}
+%
+% \begin{macrocode}
+\DeclareCaptionOption*{onelinecaption}[]{\caption@setbool{slc}{1}}
+\DeclareCaptionOption*{noonelinecaption}[]{\caption@setbool{slc}{0}}
+\DeclareCaptionOption*{tablecaptionabove}[]{\captionsetup[table]{position=t}}
+\DeclareCaptionOption*{tablecaptionbelow}[]{\captionsetup[table]{position=b}}
+% \end{macrocode}
+%
+% \subsubsection*{Generic package support}
+%
+% \begin{macro}{\caption@declarepackage}
+% |\caption@declarepackage|\marg{package name}\par
+% Each single package support can be switched on or off by using the
+% appropriate option. By default all of them are enabled.
+% \begin{macrocode}
+\newcommand*\caption@declarepackage[1]{%
+ \caption@setbool{pkt@#1}{1}%
+ \DeclareCaptionOption*{#1}{\caption@setbool{pkt@#1}{##1}}}
+\AtEndOfPackage{\let\caption@declarepackage\@undefined}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifpackage}
+% \changes{v3.0f}{2005/05/29}{3rd argument \meta{code} added, so no extra check is needed}
+% |\caption@ifpackage|\marg{package name}\marg{package macro}\marg{code}\par
+% If a certain package support is requested the appropriate code will
+% be used. `Requested' means that the option belonging to it is set to
+% |true| and the macro called \meta{package macro} is defined.
+% (If \meta{package macro} is not yet defined we use |\AtBeginDocument|
+% here, so the package could be loaded after this package, too.)
+% \begin{macrocode}
+\newcommand\caption@ifpackage[3]{%
+% \end{macrocode}
+% \begin{macrocode}
+ \edef\caption@tempa{%
+ \caption@ifbool{pkt@#1}%
+ {\@ifundefined{#2}{AtBeginDocument}{firstofone}}%
+ {gobble}}%
+ \caption@Info{#1=\caption@ifbool{pkt@#1}{1}{0} %
+ (\@ifundefined{#2}{not }{}loaded->\caption@tempa)}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@ifbool{pkt@#1}{%
+ \@ifundefined{#2}%
+ {\let\caption@tempa\AtBeginDocument}%
+ {\let\caption@tempa\@firstofone}%
+ }{%
+ \let\caption@tempa\@gobble
+ }%
+ \caption@tempa{\@ifundefined{#2}{}{#3}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@undefbool{pkt@#1}}
+\AtEndOfPackage{\let\caption@ifpackage\@undefined}
+% \end{macrocode}
+% \end{macro}
+%
+% You can also switch the caption support off using the package option
+% |caption=false|.
+% This may look strange, but there are certain circumstances where this could
+% be useful.
+% Such a situation might be the usage of the \package{subfig} package without
+% disturbing the main caption code of the document class.\par
+% \emph{Note: This mechanism is obsolete now, it has been superseeded by the
+% \package{subfig} package option {\rm|caption=false|} which causes that only the
+% caption kernel \package{caption3} is loaded.}
+%
+% \begin{macrocode}
+\caption@declarepackage{caption}
+% \end{macrocode}
+%
+% These are the packages we support:
+%
+% \begin{macrocode}
+\caption@declarepackage{float}
+\caption@declarepackage{floatrow}
+\caption@declarepackage{hyperref}
+\caption@declarepackage{hypcap}
+\caption@declarepackage{listings}
+\caption@declarepackage{longtable}
+\caption@declarepackage{picins}
+\caption@declarepackage{rotating}
+\caption@declarepackage{sidecap}
+\caption@declarepackage{supertabular}
+% \end{macrocode}
+%
+% \subsubsection*{Processing of options}
+%
+% \changes{v3.0m}{2007/03/04}{Verbose option added to package}
+% \begin{macrocode}
+\DeclareCaptionOption{verbose}[1]{%
+ \caption@setbool{verbose}{#1}%
+ \caption@ifverbose{%
+ \def\caption@Info{\PackageInfo{caption}}%
+ }{%
+ \let\caption@Info\@gobble
+ }}
+\setkeys{caption}{verbose=0}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\caption@ProcessOptions{caption}
+% \end{macrocode}
+%
+% If the option |caption=false| was given we stop processing this file
+% immediately.
+% \begin{macrocode}
+\caption@ifbool{pkt@caption}{}{\endinput}
+\caption@undefbool{pkt@caption}
+% \end{macrocode}
+%
+% \subsubsection*{Useful stuff}
+%
+% \begin{macro}{\captionof}
+% |\captionof|(|*|)\marg{type}\oarg{lst\_entry}\marg{heading}
+% \begin{macrocode}
+\def\captionof{\@ifstar{\caption@of{\caption*}}{\caption@of\caption}}
+\newcommand*\caption@of[2]{\def\@captype{#2}#1}
+% \end{macrocode}
+% \end{macro}
+%
+% Note: Like |\captionof| the option |type=| should only be used inside a
+% group or environment and does not check if the argument is a valid
+% floating environment or not.
+%
+% \changes{v3.0d}{2004/08/03}{Option \opt{name=} added}
+% \changes{v3.0d}{2004/08/03}{Option \opt{type=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{name}{\caption@setfloatname\@captype{#1}}
+\DeclareCaptionOption{type}{\def\@captype{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\ContinuedFloat}
+% \changes{v3.0f}{2005/06/11}{Call of \cs{caption@ContinuedFloat} added}
+% \changes{v3.0i}{2005/11/12}{Optional argument and call of \cs{caption@@ContinuedFloat} added}
+% |\ContinuedFloat|\oarg{type}\par
+% This mainly decreases the appropriate counter by $-1$.
+% \begin{macrocode}
+\providecommand\ContinuedFloat{%
+ \@ifnextchar[%]
+ \@ContinuedFloat
+ {\ifx\@captype\@undefined
+ \@latex@error{\noexpand\ContinuedFloat outside float}\@ehd
+ \else
+ \@ContinuedFloat[\@captype]%
+ \fi}}
+\def\@ContinuedFloat[#1]{%
+ \addtocounter{#1}\m@ne
+ \caption@ContinuedFloat{#1}%
+ \caption@@ContinuedFloat{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ContinuedFloat}
+% \begin{macro}{\caption@resetContinuedFloat}
+% |\caption@ContinuedFloat|\marg{type}\par
+% |\caption@resetContinuedFloat|\marg{type}\par
+% The first one will be called inside |\ContinuedFloat|, the second one
+% inside |\caption|. Usually they do nothing but this changes if the
+% \package{hyperref} package is loaded. (See \package{hyperref} package
+% support for details.)
+% \begin{macrocode}
+\let\caption@ContinuedFloat\@gobble
+\let\caption@resetContinuedFloat\@gobble
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@@ContinuedFloat}
+% This hook is for foreign packages which link themself into |\ContinuedFloat|,
+% for example the \package{subfig} package\cite{subfig}.
+% \begin{macrocode}
+\providecommand*\caption@@ContinuedFloat[1]{}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection*{Internal helpers}
+%
+% \begin{macro}{\caption@begin}
+% \changes{v3.0a}{2004/01/23}{\cs{caption@settype} changed by \cs{caption@setfloattype}}
+% \changes{v3.0e}{2005/04/12}{Check for default label format added}
+% \changes{v3.0f}{2005/06/11}{Call of \cs{caption@resetContinuedFloat} added}
+% Our handling of |\caption| will always be surrounded by
+% |\caption@begin| (or |\caption@beginex|) and |\caption@end|.\par
+% |\caption@begin|\marg{type} performs these tasks:
+% \begin{itemize}
+% \item Call |\caption@resetContinuedFloat| (see above)
+% and start a new group
+% \item Execute the options set with |\captionsetup|\oarg{type}
+% \item Define |\fnum@|\meta{type} if the caption label format is set
+% to non-default
+% \item Override the |position=| setting, if necessary
+% (for example if set to |auto| or used inside a |supertabular|)
+% \end{itemize}
+% \begin{macrocode}
+\newcommand*\caption@begin[1]{%
+ \caption@resetContinuedFloat{#1}%
+ \begingroup
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@setfloattype{#1}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \ifx\caption@lfmt\caption@lfmt@default\else
+ \@namedef{fnum@#1}{%
+ \caption@lfmt{\caption@floatname{#1}}{\@nameuse{the#1}}}%
+ \fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@fixposition
+ \global\let\caption@fixedposition\caption@position}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@beginex}
+% \changes{v3.0b}{2004/05/16}{Support of \opt{listof=} added}
+% \changes{v3.0h}{2005/09/16}{Bugfix: Made this macro and \cs{addcontentsline} \cs{long}}
+% \changes{v3.0l}{2007/02/04}{Takes now 3 args instead of 2, check for empty heading added}
+% |\caption@beginex|\marg{type}\marg{list entry}\marg{heading}\\
+% performs the same tasks as |\caption@begin| and additionally:
+% Redefine |\addcontentsline| if no list-of entry is requested, that
+% means either the argument \meta{list entry} is empty or |listof=| was
+% set to |false|.
+% \begin{macrocode}
+\newcommand\caption@beginex[3]{%
+ \caption@begin{#1}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@iflof%
+ {\def\caption@tempa{#2}}%
+ {\let\caption@tempa\@empty}%
+ \ifx\caption@tempa\@empty
+ \long\def\addcontentsline##1##2##3{}% There is no \@gobblethree...
+ \fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@ifempty{#3}{\let\caption@ifempty\@secondoftwo}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@end}
+% |\caption@end| closes the group.
+% \begin{macrocode}
+\newcommand*\caption@end{%
+ \endgroup
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \let\caption@position\caption@fixedposition}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setfloattype}
+% \changes{v3.0a}{2004/01/23}{This macro added}
+% |\caption@setfloattype|\marg{type}\\
+% sets up the right float type within |\@caption|, |\LT@makecaption| etc.
+% Usually this is equivalent to |\caption@settype| but I made it an own macro so
+% I can extend it later on, for example if the \package{float} or
+% \package{sidecap} package is loaded.
+% \begin{macrocode}
+\let\caption@setfloattype\caption@settype
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@letfloattype}
+% \changes{v3.0b}{2004/05/16}{This macro added}
+% \changes{v3.0e}{2005/05/05}{Argument \meta{extra code} added}
+% |\caption@letfloattype|\marg{type}\marg{extra code}\\
+% redefines |\caption@setfloattype| so it does not only
+% |\caption@settype|\marg{type} but two additional tasks:
+% Executing extra code given as second argument and
+% execute options with |\caption@settype{#1}| afterwards.\par
+% You can find an example of its usage in the \package{longtable}
+% support, where this macro is called so
+% |\captionsetup[longtable]{|\ldots|}| can be used to setup options
+% for longtables which have a higher priority than the options which
+% have been setup with |\captionsetup[table]{|\ldots|}| or
+% |\setlength\LTcapwidth{|\ldots|}|.
+% \begin{macrocode}
+\newcommand*\caption@letfloattype[2]{%
+ \def\caption@setfloattype##1{%
+ \caption@settype{##1}#2\caption@settype{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0a}{2004/01/23}{Internal hooks \cs{caption@@begin} \& \cs{caption@@end} added}
+% \changes{v3.0h}{2005/10/06}{Internal hooks \cs{caption@@begin} \& \cs{caption@@end} removed}
+% \changes{v3.0d}{2004/08/03}{\cs{caption@setfloatname} added}
+%
+% \begin{macro}{\caption@floatname}
+% |\caption@floatname|\marg{type}\par
+% Usually all float names (which partly build the caption label)
+% follow the same naming convention. But some packages (for example
+% the \package{float} package) do not, so we use this wrapper macro which
+% can be changed later on.
+% \begin{macrocode}
+\newcommand*\caption@floatname[1]{\@nameuse{#1name}}
+\newcommand*\caption@setfloatname[1]{\@namedef{#1name}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection*{Caption support}
+%
+% \iffalse\begin{quote}
+% \small\emph{Note:}
+% Our aim is patching the existing |\caption| code so changes done by other
+% packages will not get lost. We do similar in our \package{float},
+% \package{hyperref}, and \package{hypcap} support so get the disadvantage
+% of having ugly code with some negative side-effects, like the non-working
+% |\caption{}| feature when the \package{french(le)} or \package{hyperref}
+% package is loaded.
+% \end{quote}\fi
+%
+% Some packages (like the \package{hyperref} package for example) redefines
+% |\caption| and |\@caption|, too, but without chaining to their previous
+% definitions. So we have to use |\AtBeginDocument| here, so we can make sure
+% our definition don't get lost.
+%
+% \begin{macrocode}
+\AtBeginDocument{%
+% \end{macrocode}
+%
+% We only patch |\caption| and |\@caption| if the \package{captcont} package
+% (which brings it's own definition of |\caption*|) is not used.
+% It does not make much sense using the actual version of the \package{caption}
+% package with the \package{captcont} package, but this was different in the
+% old (\version{1.x}) days so we take care to be backward compatible.
+%
+% \begin{macrocode}
+ \@ifundefined{cc@caption}{%
+ \@ifundefined{caption@old}{%
+% \end{macrocode}
+%
+% \begin{macro}{\caption}
+% \iffalse\changes{v3.0}{2003/07/18}{Bugfix: \cs{global} added, so this works with sidecap}\fi
+% \changes{v3.0f}{2005/05/22}{Bugfix: \cs{ContinuedFloat} added}
+% \changes{v3.0f}{2005/06/13}{Support of \cs{caption*[]} removed}
+% \changes{v3.0l}{2007/01/19}{Minimal support of \textsf{combine} package added}
+% Here comes our definition of |\caption| and |\caption*|.
+% (We set |\caption@startrue| globally so it works with the \package{sidecap} package, too.)
+% \begin{macrocode}
+ \let\caption@old\caption
+ \def\caption{\caption@caption\caption@old}%
+ \def\caption@caption#1{%
+ \@ifstar{\ContinuedFloat\global\caption@startrue#1[]}{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@caption}
+% Our definition of |\@caption| simply calls the old definition,
+% nested by |\caption@beginex| and |\caption@end|.
+% \begin{macrocode}
+ \let\caption@@old\@caption
+ \long\def\@caption#1[#2]#3{%
+ \caption@beginex{#1}{#2}{#3}%
+ \caption@@old{#1}[{#2}]{#3}%
+ \caption@end}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ }{}}{%
+% \end{macrocode}
+%
+% \changes{v3.0c}{2004/07/16}{Bugfix 04-07-15: \package{captcont} support fixed}
+% Minimum \package{captcont} package support:\\
+% We define |\caption@caption| here so it's there but does not make any harm.
+%
+% \begin{macrocode}
+ \caption@Info{captcont package v2.0 detected}%
+ \def\caption@caption#1{#1}%
+ }%
+}
+% \end{macrocode}
+%
+% \begin{macro}{\@makecaption}
+% |\@makecaption|\marg{label}\marg{text}\par
+% The original code (from |latex/base/classes.dtx|):
+% \begin{verbatim}
+% \long\def\@makecaption#1#2{%
+% \vskip\abovecaptionskip
+% \sbox\@tempboxa{#1: #2}%
+% \ifdim \wd\@tempboxa >\hsize
+% #1: #2\par
+% \else
+% \global \@minipagefalse
+% \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+% \fi
+% \vskip\belowcaptionskip}
+% \end{verbatim}
+% We do basically the same, but take care of the |position=| setting
+% and use |\caption@@make| from the \package{caption} kernel to actually
+% typeset the caption.
+% \begin{macrocode}
+\renewcommand\@makecaption[2]{%
+ \caption@iftop{\vskip\belowcaptionskip}{\vskip\abovecaptionskip}%
+ \caption@@make{#1}{#2}%
+ \caption@iftop{\vskip\abovecaptionskip}{\vskip\belowcaptionskip}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection*{\package{\KOMAScript} classes support}
+% \changes{v3.0a}{2004/01/18}{Minimum adaptation to \KOMAScript\ added}
+% \changes{v3.0h}{2005/08/22}{\cs{PackageInfo} added to \KOMAScript\ support}
+% \changes{v3.0i}{2005/11/17}{\KOMAScript\ compatibility commands added}
+% \changes{v3.0l}{2007/02/18}{\KOMAScript\ compatibility revised}
+% \changes{v3.0q}{2007/04/16}{\KOMAScript\ compatibility revised}
+%
+% \begin{macrocode}
+\@ifundefined{scr@caption}{}{%
+ \caption@Info{KOMA-Script class detected}
+ \AtBeginDocument{\let\scr@caption\caption}
+% \end{macrocode}
+%
+% \begin{macro}{\onelinecaptionsfalse}
+% \begin{macro}{\onelinecaptionstrue}
+% \begin{macrocode}
+ \def\onelinecaptionstrue{\caption@setbool{slc}{1}}
+ \def\onelinecaptionsfalse{\caption@setbool{slc}{0}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\captionabove}
+% \begin{macro}{\captionbelow}
+% \changes{v3.0j}{2006/03/21}{Bugfix 06-03-21: \cs{let}\cs{caption@setposition}\cs{@gobble} added}
+% \changes{v3.0n}{2006/03/09}{Accidentally this got broken in \version{3.0m}, fixed}
+% Original code:
+% \begin{verbatim}
+% \newcommand{\captionabove}{\@captionabovetrue\scr@caption}
+% \newcommand{\captionbelow}{\@captionabovefalse\scr@caption}
+% \end{verbatim}
+% \begin{macrocode}
+ \def\captionabove{%
+ \caption@setposition{t}\let\caption@setposition\@gobble
+ \scr@caption}
+ \def\captionbelow{%
+ \caption@setposition{b}\let\caption@setposition\@gobble
+ \scr@caption}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection*{\package{french(le)} package support}
+% \changes{v3.0h}{2005/10/03}{Minimum adaptation to \package{french(le)} added}
+%
+% \begin{macrocode}
+\AtBeginDocument{\@ifundefined{f@ffrench}{}{%
+ \caption@Info{french(le) package detected}%
+% \end{macrocode}
+%
+% If |\GOfrench| is defined as |\relax| all the re-definitions regarding
+% captions have already been done, so we can do our patches immediately.
+% Otherwise we must add our stuff to |\GOfrench|.
+%
+% \begin{macrocode}
+ \@ifundefined{GOfrench}%
+ {\let\caption@tempa\@firstofone}%
+ {\def\caption@tempa{\g@addto@macro\GOfrench}}%
+ \caption@tempa{%
+% \end{macrocode}
+%
+% \begin{macro}{\@cnORI}
+% We update the definition of |\@cnORI| so it actually reflects
+% our definition of |\caption|.
+% \begin{macrocode}
+ \let\@cnORI\caption
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@tablescaption}
+% The \package{french(le)} package sets |\caption| to |\@tablescaption| at
+% |\begin{table}| for special treatment of footnotes.
+% Therefore we have to patch |\@tablescaption| so |\caption*| will work
+% inside the |table| environment.
+% \begin{macrocode}
+ \let\caption@tablescaption\@tablescaption
+ \def\@tablescaption{\caption@caption\caption@tablescaption}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\f@ffrench}
+% \begin{macro}{\f@tfrench}
+% |\f@ffrench| and |\f@tfrench| reflect |\fnum@figure| and |\fnum@table|
+% when used in french mode. These contain additional code which typesets
+% the caption separator |\captionseparator| instead of the usual colon.
+% Because this breaks with our |\@makecaption| code we have to remove
+% this additional code here.
+% \begin{macrocode}
+ \let\@eatDP\@undefined
+ \let\caption@tempa\@empty
+ \ifx\f@ffrench\fnum@figure
+ \l@addto@macro\caption@tempa{\let\fnum@figure\f@ffrench}%
+ \fi
+ \ifx\f@tfrench\fnum@table
+ \l@addto@macro\caption@tempa{\let\fnum@table\f@tfrench}%
+ \fi
+ \def\f@ffrench{\ifx\listoffigures\relax\else\figurename~\thefigure\fi}%
+ \def\f@tfrench{\ifx\listoftables\relax\else\tablename~\thetable\fi}%
+ \caption@tempa
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+}}}
+% \end{macrocode}
+%
+% \subsubsection*{\package{float} package support}
+% \changes{v3.0f}{2005/05/31}{\package{float} package support rewritten and improved}
+% \iffalse
+% (This is a more straight-ahead implementation, but it only works with v1.3
+% now, so v1.2 is no longer supported. The old code including documentation
+% can be found in caption-30f-050530.zip)
+% \fi
+%
+% The \package{float} package usually do not use the \LaTeX\ kernel command
+% |\@caption| to typeset the caption but |\float@caption| instead.
+% (|\@caption| will only be used if the float is re-styled with
+% |\restylefloat*|.)
+%
+% The main two things |\float@caption| is doing different are:
+% \begin{itemize}
+% \item The caption will be typeset inside a savebox called |\@floatcapt| so
+% it can be placed above or below the float contents afterwards.
+% \item |\@makecaption| will not be used to finally typeset the caption.
+% Instead |\@fs@capt| will be used which definition is part of the float
+% style.
+% (Note that |\@fs@capt| will not typeset any vertical space above or below
+% the caption; instead this space will be typeset by the float style code
+% itself.)
+% \end{itemize}
+%
+% So our main goal is to re-define |\float@caption| so our macro
+% |\caption@@make| will be used instead of |\@fs@capt|.
+%
+% To allow different caption styles for different float styles we will also
+% determine the current float style (e.g. `ruled') at run time and select
+% a caption style (and additional settings) with the same name, if defined.
+%
+% \begin{macro}{\caption@setfloatposition}
+% First of all we provide a macro which converts |\@fs@iftopcapt| (which
+% is part of a float style and controls where the caption will be typeset,
+% above or below the float contents) to our |position=| setting. Since the
+% spacing above and below the caption will be done by the float style and
+% \emph{not} by us this sounds quite useless. But in fact it isn't, since some
+% packages based on the \package{caption} package (like the \package{subfig}
+% package) could have an interest for this information and therefore use the
+% |\caption@iftop| macro we provide in our kernel. Furthermore we need this
+% information for ourself in |\captionof| which uses |\@makecaption| to
+% finally typeset the caption with skips.
+% \begin{macrocode}
+\def\caption@setfloatposition{%
+ \caption@setposition{\@fs@iftopcapt t\else b\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@ifpackage{float}{@float@setevery}{%
+ \caption@Info{float package v1.3 (or newer) detected}%
+% \end{macrocode}
+%
+% Since |\float@caption| puts the float contents into a savebox we need
+% a special version of |\captionof| which `unfolds' this box afterwards,
+% so the caption actually gets typeset. Furthermore we have to typeset
+% the spacing above and below the caption for ourself, since this space is
+% not part of the box.
+%
+% Please note that this version of |\captionof| only works \emph{outside}
+% floating environments defined with the float package, so for example
+% a |\captionof{Program}| used within a `standard' |figure| or a
+% |minipage| will work fine, but not within a re-styled |figure| or
+% an |Example| environment defined with |\newfloat|.
+% (We don't check for this so you'll get wired errors if you try to do so!)
+%
+% \begin{macro}{\caption@of@float}
+% Usually no special action is necessary, so we define |\caption@of@float|
+% to |\@gobble|. We will redefine it later on to |\@firstofone| to activate
+% the code which `unfolds' the savebox.
+% \begin{macrocode}
+ \let\caption@of@float\@gobble
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@of}
+% If the float is defined by the float package (which means |\fst@|\meta{type}
+% is defined) we activate the special treatment for such captions typeset
+% with |\captionof|. Furthermore we `execute' this float style, so
+% |\@fs@iftopcapt| is set to its proper value.
+% \begin{macrocode}
+ \renewcommand*\caption@of[2]{%
+ \@ifundefined{fst@#2}{}{%
+ \let\caption@of@float\@firstofone
+ \@nameuse{fst@#2}\@float@setevery{#2}}%
+ \def\@captype{#2}#1}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\float@caption}
+% \changes{v3.0h}{2005/08/23}{Bugfix 05-08-12: \cs{captionof} sets hyperref anchor now}
+% Our version of |\float@caption| nearly looks like our version of |\@caption|.
+% The main differences are that |\@fs@capt| will be replaced by our |\caption@@make|
+% and that the savebox called |\@floatcapt| will be unfolded if requested by
+% |\captionof|. (see above)
+% \begin{macrocode}
+ \let\caption@@float\float@caption
+ \long\def\float@caption#1[#2]#3{%
+ \caption@beginex{#1}{#2}{#3}%
+ \let\@fs@capt\caption@@make
+ \caption@@float{#1}[{#2}]{#3}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@of@float{%
+% \end{macrocode}
+% If the \package{hyperref} package is loaded, we need to set the appropriate
+% anchor for ourself. To do so without adding extra vertical space we need
+% to save (and restore) |\prevdepth| and switch off the interline skip.
+% \begin{macrocode}
+ \@ifundefined{hyper@@anchor}{}{%
+ \begingroup
+ \@tempdima\prevdepth
+ \nointerlineskip
+ \let\leavevmode\relax
+ \hyper@@anchor\@currentHref\relax
+ \prevdepth\@tempdima
+ \endgroup}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \def\caption@@make##1##2{\unvbox\@floatcapt}%
+ \@makecaption{}{}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@end}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@float@setevery}
+% |\@float@setevery|\marg{float type} is provided by the \package{float} package;
+% it's called every time a floating environment defined with |\newfloat| or
+% |\restylefloat| begins.
+% We use this hook to do some adaptations and to setup the proper caption style
+% (if defined) and additional settings declared with
+% |\captionsetup|\oarg{float style}.
+% \begin{macrocode}
+ \let\caption@float@setevery\@float@setevery
+ \def\@float@setevery#1{%
+% \end{macrocode}
+%
+% \LaTeX{} and most packages use |\|\meta{type}|name|
+% to provide a macro for the float name -- for example the command
+% |\figurename| will usually contain the name of the floating environment
+% |figure|:
+% \begin{quote}
+% |\newcommand\figurename{Figure}|
+% \end{quote}
+%
+% But the \package{float} package don't follow this naming convention,
+% it uses |\fname@|\meta{type} instead. So we have to adapt
+% |\caption@floatname| here, so our captions will be still ok.
+%
+% \begin{macrocode}
+ \def\caption@floatname##1{\@nameuse{fname@#1}}%
+ \def\caption@setfloatname##1{\@namedef{fname@#1}}%
+% \end{macrocode}
+%
+% Both |\newfloat| and |\restylefloat| save the \emph{actual} definition of
+% |\@caption| or |\float@caption| in |\@float@c@|\meta{captype} with |\let|
+% (instead of using |\def|), so redefinitions of |\@caption| (and of course
+% our redefinition of |\float@caption|) will never been used if the
+% |\newfloat| or |\restylefloat| command takes place in front of the
+% redefinitions provided by the \package{caption} or other packages like the
+% \package{hyperref} package.
+%
+% So here we determine if the user has used |\restylefloat| or
+% |\restylefloat*| and bring |\@float@c@|\meta{captype} up-to-date.
+% This is quite easy: If |\@float@c@|\meta{captype} is the same as the
+% original or our own definition of |\float@caption|, the user has used
+% |\restylefloat| (and |\float@caption| should be used), otherwise
+% we assume he has used |\restylefloat*| (and |\@caption| should be used).
+% (This test will fail if some other package re-defines |\float@caption|,
+% too, so we have to assume that we are the only one.)
+%
+% \begin{macrocode}
+ \expandafter\let\expandafter\caption@tempa\csname @float@c@#1\endcsname
+ \ifx\caption@tempa\float@caption
+ \else\ifx\caption@tempa\@caption
+ \else\ifx\caption@tempa\caption@@float
+ \caption@Info{\protect\@float@c@#1\space := \protect\float@caption}%
+ \expandafter\let\csname @float@c@#1\endcsname\float@caption
+ \else
+ \caption@Info{\protect\@float@c@#1\space := \protect\@caption}%
+ \expandafter\let\csname @float@c@#1\endcsname\@caption
+ \fi\fi\fi
+% \end{macrocode}
+%
+% If the floating environment is defined with |\newfloat| or |\restylefloat|
+% (and \emph{not} with |\restylefloat*|), |\@float@c@|\meta{type}
+% will now be identical to |\float@caption|.
+%
+% \begin{macrocode}
+ \expandafter\ifx\csname @float@c@#1\endcsname\float@caption
+% \end{macrocode}
+%
+% First of all we set the caption position to it's proper value.
+% (See above definition of |\caption@setfloatposition|)
+%
+% \begin{macrocode}
+ \caption@setfloatposition
+% \end{macrocode}
+%
+% Now we'll have to determine the current float style.
+% This is not so easy because the only hint provided by the \package{float}
+% package is the macro |\fst@|\meta{float type} which points to the macro
+% which represents the float style.
+% So for example after
+% \begin{quote}
+% |\floatstyle{ruled}|\\
+% |\newfloat{Program}{tbp}{lop}|
+% \end{quote}
+% |\fst@Program| will be defined as
+% \begin{quote}
+% |\def\fst@Program{\fs@ruled}|\quad.
+% \end{quote}
+%
+% So here is what we do: We copy |\fst@|\meta{float type} to |\caption@fst| and
+% make it a string so we can gobble the first four tokens (= |\fs@|), so only the
+% the name of the float style is left.
+%
+% \begin{macrocode}
+ \expandafter\let\expandafter\caption@fst\csname fst@#1\endcsname
+ \edef\caption@fst{\noexpand\string\expandafter\noexpand\caption@fst}%
+ \edef\caption@fst{\noexpand\@gobblefour\caption@fst}%
+% \edef\caption@fst{\caption@fst}%
+% \end{macrocode}
+%
+% |\caption@fst| now contains the float style (e.g. `ruled')
+% so we can use it to set the corresponding style (if defined) and additional options.
+%
+% \begin{macrocode}
+ \caption@setstyle*\caption@fst
+ \caption@settype\caption@fst
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@float@setevery{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0f}{2005/06/26}{Skips of \env{plaintop} and \env{boxed} floats corrected}
+%
+% \begin{macro}{\fs@plaintop}
+% \begin{macro}{\fs@boxed}
+% The float styles |plaintop| and |boxed| don't use our skip which can be set
+% with |skip=| : |plaintop| uses |\belowcaptionskip| instead of
+% |\abovecaptionskip|, and |boxed| uses a fixed space of |2pt|.
+% So we patch the according float style macros here to change this.
+% \begin{macrocode}
+ \g@addto@macro\fs@plaintop{\def\@fs@mid{\vspace\abovecaptionskip\relax}}%
+ \g@addto@macro\fs@boxed{\def\@fs@mid{\kern\abovecaptionskip\relax}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% The skip between `boxed' floats and their caption defaults to |2pt|.
+%
+% \begin{macrocode}
+\captionsetup[boxed]{skip=2pt}
+% \end{macrocode}
+%
+% \changes{v3.0f}{2005/05/26}{\opt{strut=0} added to caption style \opt{ruled}}
+% \changes{v3.0f}{2005/05/27}{Option \opt{ruled} fixed}
+% To emulate the `ruled' definition of |\@fs@capt| we provide a caption style
+% `ruled' with appropriate options. But if the package option |ruled| was
+% specified, we setup some caption parameters to emulate the behaviour
+% of the \package{caption} package \version{1.x} option |ruled| instead:
+% The current caption settings will be used, but without margin and without
+% `single-line-check'.
+% \begin{macrocode}
+\caption@ifbool{ruled}{%
+ \captionsetup[ruled]{margin=0pt,singlelinecheck=0}%
+}{%
+ \DeclareCaptionStyle{ruled}{labelfont=bf,labelsep=space,strut=0}%
+}
+\caption@undefbool{ruled}
+% \end{macrocode}
+%
+% \subsubsection*{\package{floatrow} package support}
+% \changes{v3.0f}{2005/06/01}{Support of the \package{floatrow} package added}
+%
+% The \package{floatrow} package is already adapted for usage with the
+% \package{caption} package. So the main work has already been done by
+% Mrs.Lapko, there are only two little things we have to take care about:
+%
+% \begin{macrocode}
+\caption@ifpackage{floatrow}{flrow@setlist}{%
+ \caption@Info{floatrow package v0.1f (or newer) detected}%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@of}
+% Captions typeset with |\captionof| should have the correct layout,
+% so we have to `activate' this layout here with |\flrow@setlist|.
+% \par{\small (Please note that this version of |\captionof| has the same
+% restrictions than the |\captionof| offered for floating environments
+% defined with the \package{float} package, see above.)}
+% \begin{macrocode}
+ \renewcommand*\caption@of[2]{%
+ \def\@captype{#2}\flrow@setlist{{#2}}#1}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@floatname}
+% The \package{floatrow} package follows the same naming convention
+% as the \package{float} package; so we have to adapt |\caption@floatname|
+% here, too.
+% \begin{macrocode}
+ \renewcommand*\caption@floatname[1]{%
+ \@nameuse{\@ifundefined{fname@#1}{#1name}{fname@#1}}}%
+ \renewcommand*\caption@setfloatname[1]{%
+ \@namedef{\@ifundefined{fname@#1}{#1name}{fname@#1}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection*{\package{hyperref} package support}
+% \changes{v3.0f}{2005/06/11}{Support of the \package{hyperref} package added}
+%
+% When the \package{hyperref} package is used we have the problem
+% that the usage of |\ContinuedFloat| will create duplicate
+% hyperlinks -- both |\@currentHlabel| and |\@currentHref| will be the same
+% for the main float and the continued ones. So we have to make sure
+% unique labels and references will be created each time. We do this
+% by extending |\theHfigure| and |\theHtable|, so for continued floats
+% the scheme
+% \begin{quote}\meta{type}|.|\meta{type \#}|.|\meta{continue \#}\end{quote}
+% will be used instead of
+% \begin{quote}\meta{type}|.|\meta{type \#}\quad\quad.\end{quote}
+% \par{\small(This implementation follows an idea from Steven Douglas Cochran.)}
+% \par{\small Note: This does not help if |\Hy@naturalnamestrue| is set.}
+%
+% \begin{macrocode}
+\caption@ifpackage{hyperref}{theHfigure}{%
+ \caption@Info{hyperref package v6.74m (or newer) detected}%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@ContinuedFloat}
+% \changes{v3.0g}{2005/06/28}{Bugfix: \cs{newcounter} replaced by \cs{newcount}}
+% \changes{v3.0p}{2007/04/08}{\cs{newcount} replaced by \cs{caption@newcounter}}
+% If |\theH|\meta{type} is defined, we extend it with |.|\meta{continue \#}.
+% Furthermore we set |\caption@resetContinuedFloat| to |\@gobble| so the
+% continuation counter will not be reset to zero inside |\caption|.
+% \begin{macrocode}
+ \def\caption@ContinuedFloat#1{%
+ \@ifundefined{theH#1}{}{%
+ \@ifundefined{CF@#1}{%
+ \expandafter\caption@newcounter\csname CF@#1\endcsname
+ \caption@resetContinuedFloat{#1}}{}%
+ \expandafter\caption@stepcounter\csname CF@#1\endcsname
+ \expandafter\l@addto@macro\csname theH#1\endcsname{%
+ .\csname CF@#1\endcsname}%
+ \let\caption@resetContinuedFloat\@gobble
+ }}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@resetContinuedFloat}
+% If a continuation counter is defined, we reset it.
+% \begin{macrocode}
+ \def\caption@resetContinuedFloat#1{%
+ \@ifundefined{CF@#1}{}{%
+ \expandafter\caption@setcounter\csname CF@#1\endcsname0}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection*{\package{hypcap} package support}
+% \changes{v3.0f}{2005/06/22}{Support of the \package{hypcap} package added}
+% \changes{v3.0l}{2007/02/20}{Adapted to \package{hypcap} v1.6}
+% \changes{v3.0p}{2007/04/09}{Adapted to \package{hypcap} v1.7}
+%
+% When the \package{hypcap} package is used the following problems occur:
+% \begin{enumerate}
+% \item The \package{hypcap} package uses |\capstart|, |\hc@caption|, and
+% |\hc@@caption| instead of |\caption| and |\@caption|.\footnote{This issue
+% was fixed in \package{hypcap} \version{1.7}}
+% So we have to patch these macros, too.
+% \item |\caption| will be saved to |\hc@org@caption| when the
+% \package{hypcap} package is loaded.
+% We have to change this so our definition of |\caption| will always be
+% used.
+% \item Both, |\capstart| and |\hc@@caption|, call |\hyper@makecurrent|.
+% But since we offer |\ContinuedFloat| the float counters could have changed
+% between these both calls! So we fix this by saving the \package{hyperref}
+% reference (= |\@currentHref|) in |\capstart| and restoring it later on in
+% |\hc@@caption|.
+% \par{\small (This also fixes the problem that \package{hypcap} does not
+% work if |\Hy@hypertexnamesfalse| is set.\footnote{This issue was fixed
+% in \package{hypcap} \version{1.6}} This come in handy; we set
+% it locally to avoid duplicated \package{hyperref} labels which could
+% occur if |\ContinuedFloat| will be used.)}
+% \item |\capstart| will call |\H@refstepcounter| to increase the float
+% number. This collides with a following |\ContinuedFloat|, too, so we have
+% to move this call from here to |\caption|. (Since we set
+% |\Hy@hypertexnamesfalse| we can do this without problems.)
+% \end{enumerate}
+%
+% \begin{macrocode}
+\caption@ifpackage{hypcap}{hc@caption}{%
+ \caption@Info{hypcap package v1.0 (or newer) detected}%
+% \end{macrocode}
+%
+% \begin{macro}{\capstart}
+% \changes{v3.0l}{2007/02/20}{\cs{caption@currentHref} renamed to \cs{hc@currentHref}}
+% Here comes our version of |\capstart|:
+% \begin{macrocode}
+ \let\caption@capstart\capstart
+ \def\capstart{%
+% \end{macrocode}
+% First of all we update |\hc@org@caption| to correct the problem that the
+% \package{hypcap} package has saved an older definition of |\caption|.
+% \begin{macrocode}
+ \let\hc@org@caption\caption
+% \end{macrocode}
+% Since we don't know the float counter yet (it could be changed with
+% |\ContinuedFloat| afterwards!) we make sure |\H@refstepcounter| will
+% not be used and |\Hy@hypertexnamesfalse| is set, so unique
+% \package{hyperref} labels will be generated by the original
+% definition of |\capstart|.
+% Afterwards we save the reference which was generated by
+% |\hyper@makecurrent|.
+% \begin{macrocode}
+ \begingroup
+ \let\H@refstepcounter\@gobble
+ \Hy@hypertexnamesfalse
+ \caption@capstart
+ \@ifundefined{hc@hyperref}{}{% hypcap v1.7
+ \global\advance\csname c@\@captype\endcsname\@ne}%
+ \global\let\hc@currentHref\@currentHref
+ \endgroup
+% \end{macrocode}
+%
+% The \package{hypcap} package restores the previous definition of |\caption|
+% inside |\hc@@caption|. But since we will call this inside a group later on
+% (making this restauration non-working), we have to make this for ourself
+% inside |\caption|.
+% (This would not be necessary if \package{hypcap} would do this inside
+% |\hc@caption| instead of |\hc@@caption|.)\par
+% Additionally we increase the float counter here (since we have suppressed this
+% in |\capstart|) and use |\caption@caption| here, so |\caption*| will work as
+% expected.
+% (This is surrounded by |\hc@hyperref| so it does not make any harm when used
+% with \package{hypcap} \version{1.7}.)
+% \begin{macrocode}
+ \@ifundefined{hc@hyperref}%
+ {\let\next\@firstofone}{\let\next\hc@hyperref}% hypcap v1.7
+ \next{\def\caption{%
+ \let\caption\hc@org@caption
+ \H@refstepcounter\@captype
+ \@ifundefined{hc@hyperref}{}{% hypcap v1.7
+ \global\advance\csname c@\@captype\endcsname\m@ne}%
+ \caption@caption\hc@caption}}%
+% \end{macrocode}
+% \begin{macrocode}
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hc@@caption}
+% Here comes our version of |\hc@@caption|:
+% \begin{macrocode}
+ \let\caption@hc@@caption\hc@@caption
+ \long\def\hc@@caption#1[#2]#3{%
+ \caption@beginex{#1}{#2}{#3}%
+% \end{macrocode}
+%
+% Beside the usual |\caption@begin| and |\caption@end| stuff (to support local
+% options etc.) we make sure our saved \package{hyperref} reference will be
+% used.
+% \begin{macrocode}
+ \let\caption@hyper@makecurrent\hyper@makecurrent
+ \def\hyper@makecurrent\@captype{%
+ \let\hyper@makecurrent\caption@hyper@makecurrent
+ \global\let\@currentHref\hc@currentHref}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@hc@@caption{#1}[{#2}]{#3}%
+ \caption@end}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection*{\package{listings} package support}
+% \changes{v3.0b}{2004/05/16}{Support of the \package{listings} package added}
+%
+% \begin{macrocode}
+\caption@ifpackage{listings}{lst@MakeCaption}{%
+ \caption@Info{listings package v1.2 (or newer) detected}%
+% \end{macrocode}
+%
+% \begin{macro}{\lst@MakeCaption}
+% To support the \package{listings} package we need to redefine
+% |\lst@MakeCaption| so the original stuff is nested with
+% |\caption@begin| and |\caption@end|.
+% \begin{macrocode}
+ \let\caption@lst@MakeCaption\lst@MakeCaption
+ \def\lst@MakeCaption#1{%
+% \end{macrocode}
+%
+% If the |position=| is set to |auto|, we take over the |captionpos=| setting
+% from the \package{listings} package.
+% Note that we won't do this otherwise, so \package{listings} settings like
+% |abovecaptionskip=0pt,belowcaptionskip=10pt,captionpos=t| will \emph{not}
+% cause different outputs with or without the \package{caption} package loaded.
+% \begin{macrocode}
+ \def\caption@autoposition{\caption@setposition{#1}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@begin{lstlisting}%
+ \caption@lst@MakeCaption{#1}%
+ \caption@end}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection*{\package{longtable} package support}
+%
+% \begin{macrocode}
+\caption@ifpackage{longtable}{LT@makecaption}{%
+ \caption@Info{longtable package v3.15 (or newer) detected}%
+% \end{macrocode}
+%
+% \begin{macro}{\LT@makecaption}
+% \changes{v3.0d}{2004/08/10}{Bugfix 04-08-04: \cs{abovecaptionskip} \& \cs{belowcaptionskip} will be used now}
+% \changes{v3.0e}{2005/05/05}{Bugfix: \cs{captionsetup[longtable]} overrides \cs{LTcapwidth} now}
+% \changes{v3.0h}{2005/10/07}{\cs{caption@LT@make} introduced}
+% |\LT@makecaption|\marg{cmd}\marg{label}\marg{text}\par
+% Original code:
+% \begin{verbatim}
+% \def\LT@makecaption#1#2#3{%
+% \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{%
+% % Based on article class "\@makecaption", "#1" is "\@gobble" in star
+% % form, and "\@firstofone" otherwise.
+% \sbox\@tempboxa{#1{#2: }#3}%
+% \ifdim\wd\@tempboxa>\hsize
+% #1{#2: }#3%
+% \else
+% \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
+% \fi
+% \endgraf\vskip\baselineskip}%
+% \hss}}}
+% \end{verbatim}
+% \begin{macrocode}
+ \def\LT@makecaption#1#2#3{%
+ \caption@LT@make{%
+% \end{macrocode}
+%
+% We set |\ifcaption@star| according the 1st argument.
+% \begin{macrocode}
+ \caption@startrue#1\caption@starfalse
+% \end{macrocode}
+%
+% If |\LTcapwidth| is not set to its default value |4in| we assume
+% that it shall overwrite our own setting.
+% (But |\captionsetup[longtable]{width=|\ldots|}| will overwrite |\LTcapwidth|.)
+% \begin{macrocode}
+ \caption@letfloattype{longtable}{%
+ \ifdim\LTcapwidth=4in \else
+ \setcaptionwidth\LTcapwidth
+ \fi}%
+% \end{macrocode}
+%
+% The default |position=| setting for longtables is |top|.
+% (This emulates the standard behaviour of the \package{longtable} package
+% which has no skip above the caption but a skip below it.)
+% \begin{macrocode}
+% \caption@setdefaultpos{t}%
+ \let\caption@defaultpos\@firstoftwo
+% \end{macrocode}
+%
+% |position=auto| is a bad idea for longtables, but we do our very best.
+% This works quite well for captions inside the longtable contents, but
+% not for captions inside the longtable (end)foot.
+% \begin{macrocode}
+ \def\caption@autoposition{%
+ \caption@setposition{\ifcase\LT@rows t\else b\fi}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@begin{table}%
+% \end{macrocode}
+%
+% The following skip has the purpose to correct the height of the
+% |\parbox[t]|. Usually it's the height of the very first line, but
+% because of our extra skips (|\abovecaptionskip| and |\belowcaptionskip|)
+% it's always |0pt|.
+% (A different idea would be typesetting the first skip outside the longtable
+% column with |\noalign{\vskip|\ldots|}|, but this means we have to move
+% |\caption@begin| to some other place because it does not work in tabular
+% mode\ldots)
+% \begin{macrocode}
+ \vskip-\ht\strutbox
+% \end{macrocode}
+%
+% This should look familiar. We do our skips and use |\caption@@make| to
+% typeset the caption itself.
+% \begin{macrocode}
+ \caption@iftop{\vskip\belowcaptionskip}{\vskip\abovecaptionskip}%
+ \caption@@make{#2}{#3}\endgraf
+ \caption@iftop{\vskip\abovecaptionskip}{\vskip\belowcaptionskip}%
+ \caption@end}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@LT@make}
+% Typesets the caption as centered |\multicolumn|\ldots
+% \begin{macrocode}
+ \newcommand\caption@LT@make[1]{%
+ \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\hsize{#1}\hss}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection*{\package{picins} package support}
+% \changes{v3.0j}{2006/01/26}{Support of the \package{picins} package added}
+%
+% \begin{macrocode}
+\caption@ifpackage{picins}{piccaption}{%
+ \caption@Info{picins package v3.0 (or newer) detected}%
+% \end{macrocode}
+%
+% \begin{macro}{\piccaption}
+% Original code:
+% \begin{verbatim}
+% \def\piccaption{\@ifnextchar [{\@piccaption}{\@piccaption[]}}
+% \end{verbatim}
+% \begin{macrocode}
+ \def\piccaption{\@dblarg\@piccaption}
+% \def\piccaption{\caption@caption{\@dblarg\@piccaption}}
+% \end{macrocode}
+% \end{macro}
+%
+% {\itshape TODO: Make |\piccaption[]{|\ldots|}| and |\piccaption{}| work}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection*{\package{rotating} package support}
+%
+% \begin{macrocode}
+\caption@ifpackage{rotating}{@rotcaption}{%
+ \caption@Info{rotating package v2.0 (or newer) detected}%
+% \end{macrocode}
+%
+% \begin{macro}{\rotcaption}
+% \changes{v3.0c}{2004/07/16}{Bugfix: Check for \cs{caption@caption} removed}
+% \changes{v3.0i}{2005/12/07}{Rewritten, works with \package{hyperref} now}
+% Make |\rotcaption*| work.
+% \begin{macrocode}
+ \def\rotcaption{\let\@makecaption\@makerotcaption\caption}%
+% \let\@rotcaption\@undefined
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\rotcaptionof}
+% \changes{v3.0i}{2005/12/07}{New}
+% Make |\rotcaptionof(*)| work.
+% \begin{macrocode}
+ \def\rotcaptionof{%
+ \@ifstar{\caption@of{\rotcaption*}}{\caption@of\rotcaption}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makerotcaption}
+% \changes{v3.0i}{2005/12/06}{Rewritten, should finally work proper now}
+% \changes{v3.0m}{2007/03/04}{Uses \cs{captionbox} instead of \cs{caption@start/endbox} now}
+% Original (bugfixed) code:
+% \begin{verbatim}
+% \long\def\@makerotcaption#1#2{%
+% \setbox\@tempboxa\hbox{#1: #2}%
+% \ifdim \wd\@tempboxa > .8\vsize
+% \rotatebox{90}{%
+% \begin{minipage}{.8\textheight}#1: #2\end{minipage}%
+% }%\par % <== \par removed (AR)
+% \else%
+% \rotatebox{90}{\box\@tempboxa}%
+% \fi
+% \nobreak\hspace{12pt}% <== \nobreak added (AR)
+% }
+% \end{verbatim}
+% Our version emulates this behaviour, but if |width=| is set,
+% the rotated caption is always typeset as |minipage|.
+% (Note that |margin=| is not supported here.)
+% \begin{macrocode}
+ \long\def\@makerotcaption#1#2{%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \ifdim\captionwidth=\z@
+ \setcaptionwidth{.8\textheight}%
+ \caption@slc{#1}{#2}{.8\vsize}{%
+ \let\caption@makerot\caption@@make
+ \setcaptionmargin\z@
+% \setlength\captionindent\z@
+% \long\def\captionbox##1##2{\hbox{\hsize=.8\textheight\relax##2}}%
+% (not needed because \rotatebox uses an \hbox anyway)
+ \let\captionbox\@secondoftwo}%
+ \caption@setbool{slc}{0}% been there, done that
+ \fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \rotatebox{90}{\caption@makerot{#1}{#2}}%
+ \nobreak\hspace{12pt}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \newcommand\caption@makerot[2]{%
+ \begin{minipage}\captionwidth\caption@@make{#1}{#2}\end{minipage}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection*{\package{sidecap} package support}
+%
+% \begin{macrocode}
+\caption@ifpackage{sidecap}{endSC@FLOAT}{%
+ \caption@Info{sidecap package v1.4d (or newer) detected}%
+% \end{macrocode}
+%
+% \begin{macro}{\SC@caption}
+% \changes{v3.0d}{2004/11/28}{Bugfix: Definition of \cs{@captype} added}
+% \changes{v3.0e}{2005/05/05}{Bugfix: Empty captions are handled correctly now}
+% \changes{v3.0e}{2005/05/05}{Priority of options fixed}
+% \changes{v3.0h}{2005/10/03}{Bugfix: Always use \cs{AtBeginDocument} to set \cs{SC@caption}}
+% First of all, we let sidecap use an actual definition of |\caption|.\\
+% (This is only required for version 1.5d of the sidecap package.)
+% \begin{macrocode}
+ \@ifundefined{caption@caption}%
+ {\let\caption@tempa\AtBeginDocument}%
+ {\let\caption@tempa\@firstofone}%
+ \caption@tempa{\let\SC@caption=\caption}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SC@zfloat}
+% \changes{v3.0b}{2004/05/16}{Local definition of \cs{captionsetup} added}
+% \changes{v3.0c}{2004/07/16}{Bugfix 04-07-15: Check for \cs{caption@caption} removed}
+% This macro will be called at the start of the environment, here is a good
+% opportunity to do some adaptations to |\caption| and |\captionsetup|.
+% \begin{macrocode}
+ \let\caption@SC@zfloat\SC@zfloat
+ \def\SC@zfloat#1#2#3[#4]{%
+% \end{macrocode}
+%
+% Note: |#2| is either |figure| or |table| and will be stored to |\SC@captype|
+% by the original version of |\SC@zfloat|.
+% \begin{macrocode}
+ \caption@SC@zfloat{#1}{#2}{#3}[#4]%
+% \end{macrocode}
+%
+% Since the sidecap package uses our |\caption| code outside the
+% floating environment the regular |\captionsetup| will not work.
+% So we need a special version here which saves the given argument list
+% which will be executed later on.
+% \begin{macrocode}
+ \global\let\SC@CAPsetup\@empty
+ \def\captionsetup##1{\g@addto@macro\SC@CAPsetup{,##1}}%
+% \end{macrocode}
+%
+% Make |\caption*| work.
+% \begin{macrocode}
+ \let\caption@SC\caption
+% \def\caption{\renewcommand\captionsetup[1]{}\caption@caption\caption@SC}%
+ \def\caption{\caption@caption\caption@SC}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\endSC@FLOAT}
+% \changes{v3.0i}{2006/01/12}{\cs{@listdepth}\cs{z@} added}
+% This macro will be called at the end of the environment, here we need to
+% setup our stuff before the \package{sidecap} package actually typesets
+% its caption.
+% \begin{macrocode}
+ \let\caption@endSC@FLOAT\endSC@FLOAT
+ \def\endSC@FLOAT{%
+% \end{macrocode}
+%
+% Note that |\@captype| isn't defined so far, this will be done inside
+% the original definition of |\endSC@FLOAT|.
+% But we define |\@captype| already here to make |\captionsetup| work
+% with |\@captype|-based options (like |type=|).
+% \begin{macrocode}
+ \let\@captype\SC@captype
+% \end{macrocode}
+%
+% Here we execute the options set with |\captionsetup| inside this environment.
+% \begin{macrocode}
+ \caption@esetup\SC@CAPsetup
+% \end{macrocode}
+%
+% Before we can typeset the caption we need to set the margin to zero
+% because any extra margin would only be disturbing here.\par
+% (We don't need to take care about the caption position because
+% the sidecap package set both |\abovecaptionskip| and |\belowcaptionskip|
+% to a skip of zero anyway.)\par
+% Furthermore |\SC@justify| will override the caption justification, if set.
+% The usage of |\SC@justify| differs from version to version of the
+% \package{sidecap} package:\par
+% \begin{tabular}{ll}
+% Version 1.4: & |\SC@justify| is not defined\\
+% Version 1.5: & |\SC@justify| is |\relax| when not set\\
+% Version 1.6: & |\SC@justify| is |\@empty| when not set\\
+% \end{tabular}
+% \begin{macrocode}
+ \caption@letfloattype{SC\@captype}{%
+ \@listdepth\z@
+ \setcaptionmargin\z@
+ \@ifundefined{SC@justify}{}{%
+ \ifx\SC@justify\@empty\else
+ \let\caption@hj\SC@justify
+ \let\SC@justify\@empty
+ \fi}}%
+% \end{macrocode}
+%
+% We adapt |\caption@ifempty| so |\caption{}| will work within these
+% environments, too.
+% \begin{macrocode}
+ \long\def\caption@ifempty##1{%
+ \ifx\SC@CAPtext\@empty
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi}%
+% \end{macrocode}
+%
+% \iffalse % Does not work anyway...
+% Furthermore we adapt |\caption@ifnocontentsline| so |\caption[]{|\ldots|}|
+% will work within these environments, too.
+% \begin{macrocode}
+% \long\def\caption@ifnocontentsline##1{%
+% \ifx\SC@OPTCAPtext\@empty
+% \expandafter\@firstofone
+% \else
+% \expandafter\@gobble
+% \fi}%
+% \end{macrocode}
+% \fi
+%
+% Finally we call the original definition of |\endSC@FLOAT| which will
+% call our version of |\caption| to typeset the caption.
+% \begin{macrocode}
+ \caption@endSC@FLOAT}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection*{\package{supertabular} package support}
+%
+% \begin{macro}{\caption@setSTposition}
+% The |position=| setting will be overwritten by the
+% \package{supertabular} package: If |\topcaption| is used,
+% the position will be |top| automatically, |bottom| otherwise.
+% \begin{macrocode}
+\def\caption@setSTposition{%
+ \caption@setposition{\if@topcaption t\else b\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@ifpackage{supertabular}{ST@caption}{%
+ \caption@Info{supertabular package detected}%
+% \end{macrocode}
+%
+% \begin{macro}{\tablecaption}
+% \changes{v3.0e}{2005/05/05}{Made \cs{topcaption*} and \cs{bottomcaption*} work}
+% Make |\topcaption*| and |\bottomcaption*| work.
+% \begin{macrocode}
+ \let\caption@tablecaption\tablecaption
+ \def\tablecaption{\caption@caption\caption@tablecaption}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@caption}
+% \changes{v3.0a}{2004/01/23}{Bugfix: Missing \cs{par} added}
+% Original code:
+% \begin{verbatim}
+% \long\def\ST@caption#1[#2]#3{\par%
+% \addcontentsline{\csname ext@#1\endcsname}{#1}%
+% {\protect\numberline{%
+% \csname the#1\endcsname}{\ignorespaces #2}}
+% \begingroup
+% \@parboxrestore
+% \normalsize
+% \if@topcaption \vskip -10\p@ \fi
+% \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+% \if@topcaption \vskip 10\p@ \fi
+% \endgroup}
+% \end{verbatim}
+% \begin{macrocode}
+ \long\def\ST@caption#1[#2]#3{\par%
+ \caption@letfloattype{supertabular}{}%
+ \let\caption@fixposition\caption@setSTposition
+ \caption@beginex{#1}{#2}{#3}%
+ \addcontentsline{\csname ext@#1\endcsname}{#1}%
+ {\protect\numberline{%
+ \csname the#1\endcsname}{\ignorespaces #2}}%
+ \@parboxrestore
+ \normalsize
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+ \caption@end}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \clearpage
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/caption/fallback/v3.1/caption.dtx b/Master/texmf-dist/source/latex/caption/fallback/v3.1/caption.dtx
new file mode 100644
index 00000000000..4bc736fdb9c
--- /dev/null
+++ b/Master/texmf-dist/source/latex/caption/fallback/v3.1/caption.dtx
@@ -0,0 +1,7985 @@
+% \iffalse meta-comment
+%
+% This is file `caption.dtx'.
+%
+% Copyright (C) 1994-2010 Axel Sommerfeldt (caption@sommerfee.de)
+%
+% --------------------------------------------------------------------------
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Axel Sommerfeldt.
+%
+% This work consists of the files caption.ins, caption.dtx, caption2.dtx,
+% ltcaption.dtx, and subcaption.dtx, the derived files caption.sty,
+% caption2.sty, caption3.sty, ltcaption.sty, and subcaption.sty, and the
+% user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex.
+%
+% \fi
+% \CheckSum{7218}
+%
+% \iffalse
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption.drv}[2010/01/14 v3.1m Implementation of the caption package]
+\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
+%\errorcontextlines=3
+%
+\documentclass{ltxdoc}
+\setlength\parindent{0pt}
+\setlength\parskip{\smallskipamount}
+%
+%\let\ORIsubsection\subsection
+%\def\subsection{\clearpage\ORIsubsection}
+%
+\makeatletter % make room for subsections like 2.16.14 in the TOC
+%\newcommand*\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
+\renewcommand*\l@subsubsection{\@dottedtocline{3}{3.8em}{3.6em}}
+\makeatother
+%
+\usepackage{ifpdf}
+\ifpdf
+ \usepackage{mathptmx,courier}
+ \usepackage[scaled=0.90]{helvet}
+ \addtolength\marginparwidth{15pt}
+\fi
+%
+\usepackage{hypdoc}
+\ifpdf\usepackage{hypdestopt}\fi
+\hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}}
+%
+\usepackage[debug]{caption}[2009/10/09]
+%
+\DeclareRobustCommand*\eTeX{\texorpdfstring
+ {\leavevmode\hbox{$\varepsilon$}-\TeX}%
+ {e-TeX}}
+\DeclareRobustCommand*\AmS{\texorpdfstring
+ {{\protect\usefont{OMS}{cmsy}{m}{n}A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}%
+ {AMS}}
+\DeclareRobustCommand*\KOMAScript{\texorpdfstring
+ {\textsf{K\kern.05em O\kern.05em M\kern.05em A\kern.1em-\kern.1em Script}}%
+ {KOMA-Script}}
+\DeclareRobustCommand*\NTG{NTG}
+\DeclareRobustCommand*\SmF{SMF}
+%
+\begin{document}
+ \DocInput{caption.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \newcommand*\purerm[1]{{\upshape\mdseries\rmfamily #1}}
+% \newcommand*\puresf[1]{{\upshape\mdseries\sffamily #1}}
+% \newcommand*\purett[1]{{\upshape\mdseries\ttfamily #1}}
+% \let\class\puresf \let\package\puresf
+% \let\env\purett \let\opt\purett
+%
+% \def\thispackage{the \package{caption} package}
+% \def\Thispackage{The \package{caption} package}
+%
+% \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
+% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
+% \newcommand*\version[2][]{\textit{v#2}}
+% \newcommand*\x{\discretionary{-}{}{}}
+% \newcommand*\xx{\discretionary{}{}{}}
+%
+% \GetFileInfo{caption.drv}
+% \let\docdate\filedate
+% \GetFileInfo{caption.sty}
+%
+% \title{The Implementation of
+% \texorpdfstring{\thispackage\thanks{%^^A
+% This package has version number \fileversion, last revised \filedate.}}%^^A
+% {the caption package}}
+% \author{Axel Sommerfeldt\\
+% \href{mailto:caption@sommerfee.de}{\texttt{caption@sommerfee.de}}}
+% \date{\docdate}
+% \maketitle
+%
+% \begin{abstract}
+% \Thispackage\ consists of two parts -- the kernel
+% (|caption3.sty|) and the main package (|caption.sty|).
+%
+% The kernel provides all the user commands and internal macros which are
+% necessary for typesetting captions and setting parameters regarding these.
+% While the standard \LaTeX\ document classes provide an internal command
+% called |\@makecaption| and no options to control its behavior (except the
+% vertical skips above and below the caption itself), we provide similar
+% commands called |\caption@make| and |\caption@@make|, but with a lot of
+% options which can be selected with |\captionsetup|.
+% Loading the kernel part do not change the output of a \LaTeX\ document
+% -- it just provides functionality which can be used by \LaTeXe\ packages
+% which typesets captions, for example the \package{caption} and
+% \package{subfig} packages.
+%
+% \Thispackage\ redefines the \LaTeX\ commands
+% |\caption|, |\@caption|, and |\@makecaption| and maps the latter one to
+% |\caption@@make|, giving the user the possibility to control the look \& feel
+% of the captions from floating environments like |figure| and |table|.
+% Furthermore it does similar to the caption stuff coming from other packages
+% (like the \package{longtable} or \package{supertabular} package):
+% Mapping the appropriate internal commands (like |\LT@makecaption| or
+% |\ST@caption|) to the ones offered by the \package{caption3} kernel.
+% So you can think of \thispackage\ as a layer package, it
+% simply provides adaptation layers between the caption stuff coming from
+% \LaTeXe\ or packages, and the caption stuff offered by the
+% \package{caption3} kernel.
+% \end{abstract}
+%
+% \section*{User manuals}
+%
+% This document is describing the code implementation only. The user
+% documentation can be found in
+% \nopagebreak\begin{quote}
+% \begin{tabular}{ll}
+% \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/caption/caption-eng.pdf}%
+% {\texttt{caption-eng.pdf}} & The English documentation \\
+% \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/caption/caption-rus.pdf}%
+% {\texttt{caption-rus.pdf}} & The Russian documentation\footnotemark \\
+% \href{ftp://dante.ctan.org/tex-archive/macros/latex/contrib/caption/caption-deu.pdf}%
+% {\texttt{caption-deu.pdf}} & The German documentation \\
+% \end{tabular}
+% \footnotetext{Thanks a lot to Olga Lapko for this translation}
+% \end{quote}
+%
+% \StopEventually{}
+% \clearpage
+% \tableofcontents
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \DoNotIndex{\\,\_,\ ,\@@par}
+% \DoNotIndex{\@bsphack}
+% \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
+% \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
+% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
+% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
+% \DoNotIndex{\if@minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@minipagefalse,\@minipagetrue}
+% \DoNotIndex{\@namedef,\@nameuse}
+% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
+% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setminipage,\@setpar}
+% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
+% \DoNotIndex{\@testopt}
+% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
+% \DoNotIndex{\p@,\z@}
+% \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
+% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
+% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
+% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
+% \DoNotIndex{\fi,\footnotesize,\global}
+% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
+% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
+% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
+% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
+% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
+% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
+% \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
+% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
+% \DoNotIndex{\providecommand,\quad}
+% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
+% \DoNotIndex{\rightskip,\rmfamily}
+% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
+% \DoNotIndex{\small,\string,\space,\strut}
+% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
+% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
+% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
+% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
+% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
+% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
+% \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \setlength{\parskip}{0pt plus 1pt}
+%
+% \changes{v1.0}{1994/10/27}{First release}
+% \changes{v1.1}{1994/11/03}{New option \cs{centerlast}}
+% \changes{v1.2}{1994/11/28}{Support of the \package{float} package}
+% \changes{v1.3}{1995/01/09}{Support of \cs{captionlabelfont} in subcaptions}
+% \changes{v1.4}{1995/01/30}{New option \cs{nooneline}}
+% \changes{v1.4b}{1995/04/05}{Bugfix release}
+% \changes{v3.0}{2003/12/20}{Rewritten; many new commands and features}
+% \changes{v3.0d}{2004/11/28}{Split into two packages:
+% \package{caption} \& \package{caption3}}
+%
+% \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \section{Kernel}
+% \iffalse
+%<*kernel>
+% \fi
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesPackage{caption3}[2010/01/14 v1.1m caption3 kernel (AR)]
+% \end{macrocode}
+%
+% \subsection{Generic helpers}
+%
+% \begin{macro}{\@nameundef}
+% This is the opposite to |\@namedef| which is offered by the \LaTeX\ kernel.
+% We use it to remove the definition of some commands and keyval options after
+% |\begin{document}| (to save \TeX\ memory) and to remove caption options defined
+% with |\captionsetup|\oarg{type}.
+% \begin{macrocode}
+\providecommand*\@nameundef[1]{%
+ \expandafter\let\csname #1\endcsname\@undefined}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@addto@macro}
+% The \LaTeXe\ kernel offers the internal helper macro |\g@addto@macro| which
+% globally adds tokens to existing macros, like in |\AtBeginDocument|.
+% This is the same but it works local, not global
+% (using \cs{edef} instead of \cs{xdef}).
+% \begin{macrocode}
+\providecommand\l@addto@macro[2]{%
+ \begingroup
+ \toks@\expandafter{#1#2}%
+ \edef\@tempa{\endgroup\def\noexpand#1{\the\toks@}}%
+ \@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bothIfFirst}
+% \begin{macro}{\bothIfSecond}
+% |\bothIfFirst| tests if the first argument is not empty, |\bothIfSecond|
+% tests if the second argument is not empty. If yes both arguments get
+% typeset, otherwise none of them.
+% \begin{macrocode}
+\def\bothIfFirst#1#2{%
+ \protected@edef\caption@tempa{#1}%
+ \ifx\caption@tempa\@empty \else
+ #1#2%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\def\bothIfSecond#1#2{%
+ \protected@edef\caption@tempa{#2}%
+ \ifx\caption@tempa\@empty \else
+ #1#2%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifinlist}
+% \changes{v3.1}{2007/07/29}{Rewritten}
+% This helper macro checks if the first argument is in the comma separated
+% list which is offered as second argument. So for example
+% \begin{quote}
+% |\caption@ifinlist{frank}{axel,frank,olga,steven}{yes}{no}|
+% \end{quote}
+% would expand to |yes|.
+% \begin{macrocode}
+\newcommand*\caption@ifinlist{%
+ \@expandtwoargs\caption@@ifinlist}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@ifinlist[2]{%
+ \begingroup
+ \def\@tempa##1,#1,##2\@nil{%
+ \endgroup
+ \ifx\relax##2\relax
+ \expandafter\@secondoftwo
+ \else
+ \expandafter\@firstoftwo
+ \fi}%
+ \@tempa,#2,#1,\@nil}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifin@list}
+% \changes{v3.1}{2007/08/12}{This macro added}
+% |\caption@ifin@list|\marg{cmd}\marg{list entry}\marg{yes}\marg{no}
+% \begin{macrocode}
+\newcommand*\caption@ifin@list[2]{%
+ \caption@ifempty@list#1%
+ {\@secondoftwo}%
+ {\@expandtwoargs\caption@@ifinlist{#2}{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@g@addto@list}
+% \changes{v3.1}{2007/07/29}{This macro added}
+% |\caption@g@addto@list|\marg{cmd}\marg{list entry}
+% \begin{macrocode}
+\newcommand*\caption@g@addto@list[2]{%
+ \caption@ifempty@list#1{\gdef#1{#2}}{\g@addto@macro#1{,#2}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@l@addto@list}
+% \changes{v3.1}{2007/07/29}{This macro added}
+% |\caption@l@addto@list|\marg{cmd}\marg{list entry}
+% \begin{macrocode}
+\newcommand*\caption@l@addto@list[2]{%
+ \caption@ifempty@list#1{\def#1{#2}}{\l@addto@macro#1{,#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@g@removefrom@list}
+% \changes{v3.1}{2007/07/29}{This macro added}
+% |\caption@g@removefrom@list|\marg{cmd}\marg{list entry}
+% \begin{macrocode}
+\newcommand*\caption@g@removefrom@list[2]{%
+ \caption@l@removefrom@list#1{#2}%
+ \global\let#1#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@l@removefrom@list}
+% \changes{v3.1}{2007/07/29}{This macro added}
+% |\caption@l@removefrom@list|\marg{cmd}\marg{list entry}\par
+% \Note[Caveat]{\meta{cmd} will be expanded during this process since
+% \cs{@removeelement} is using \cs{edef} to build the new list!}
+% \begin{macrocode}
+\newcommand*\caption@l@removefrom@list[2]{%
+ \caption@ifempty@list#1{}{\@expandtwoargs\@removeelement{#2}#1#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@for@list}
+% \changes{v3.1}{2007/07/29}{This macro added}
+% |\caption@for@list|\marg{cmd}\marg{code with \#1}
+% \begin{macrocode}
+\newcommand*\caption@for@list[2]{%
+ \caption@ifempty@list#1{}{%
+ \def\caption@tempb##1{#2}%
+ \@for\caption@tempa:=#1\do{%
+ \expandafter\caption@tempb\expandafter{\caption@tempa}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifempty@list}
+% \changes{v3.1}{2007/07/29}{This macro added}
+% |\caption@ifempty@list|\marg{cmd}\marg{true}\marg{false}
+% \begin{macrocode}
+\newcommand*\caption@ifempty@list[1]{%
+ \ifx#1\@undefined
+ \expandafter\@firstoftwo
+ \else\ifx#1\relax
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else\ifx#1\@empty
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \fi\fi\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \pagebreak[3]
+% \begin{macro}{\caption@setbool}
+% \begin{macro}{\caption@set@bool}
+% \changes{v3.1}{2007/04/05}{\cs{caption@set@bool}\marg{cmd}\marg{value} added}
+% \begin{macro}{\caption@ifbool}
+% \begin{macro}{\caption@undefbool}
+% For setting and testing boolean options we offer these three helper macros:
+% \begin{quote}
+% |\caption@setbool|\marg{name}\marg{value}\\
+% | |(with |value = false/true/no/yes/off/on/0/1|)\\
+% |\caption@ifbool|\marg{name}\marg{if-clause}\marg{else-clause}\\
+% |\caption@undefbool|\marg{name}
+% \end{quote}
+% \begin{macrocode}
+\newcommand*\caption@setbool[1]{%
+ \expandafter\caption@set@bool\csname caption@if#1\endcsname}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@set@bool[2]{%
+ \caption@ifinlist{#2}{1,true,yes,on}{%
+ \let#1\@firstoftwo
+ }{\caption@ifinlist{#2}{0,false,no,off}{%
+ \let#1\@secondoftwo
+ }{%
+ \caption@Error{Undefined boolean value `#2'}%
+ }}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@ifbool[1]{\@nameuse{caption@if#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@undefbool[1]{\@nameundef{caption@if#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@teststar}
+% \changes{v3.1}{2007/05/08}{This macro and its usage added}
+% \changes{v3.1e}{2007/10/28}{\cs{caption@teststar@} added}
+% |\caption@teststar|\marg{cmd}\marg{star arg}\marg{non-star arg}\\
+% |\caption@teststar@|\marg{cmd}\marg{star arg}\marg{non-star arg}
+% \begin{macrocode}
+\newcommand*\caption@teststar[3]{\@ifstar{#1{#2}}{#1{#3}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@teststar@[3]{%
+ \@ifstar{#1{#2}}{\caption@ifatletter{#1{#2}}{#1{#3}}}}
+\AtBeginDocument{\let\caption@teststar@\caption@teststar}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@ifatletter{%
+ \ifnum\the\catcode`\@=11
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+\AtBeginDocument{\let\caption@ifatletter\@secondoftwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@withoptargs}
+% \changes{v3.1}{2007/08/12}{This macro added}
+% |\caption@withoptargs|\marg{cmd}
+% \begin{macrocode}
+\newcommand*\caption@withoptargs[1]{%
+ \@ifstar
+ {\def\caption@tempa{*}\caption@@withoptargs#1}%
+ {\def\caption@tempa{}\caption@@withoptargs#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@withoptargs#1{%
+ \@ifnextchar[%]
+ {\caption@@@withoptargs#1}%
+ {\caption@@@@withoptargs#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@@withoptargs#1[#2]{%
+ \l@addto@macro\caption@tempa{[{#2}]}%
+ \caption@@withoptargs#1}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@@@withoptargs#1{%
+ \expandafter#1\expandafter{\caption@tempa}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@CheckCommand}
+% \changes{v3.1}{2007/04/10}{This macro added}
+% \begin{macro}{\caption@IfCheckCommand}
+% \changes{v3.1}{2007/04/10}{This macro added}
+% \changes{v3.1i}{2008/08/02}{Revised so \cs{next} is no longer used}
+% |\caption@CheckCommand|\marg{macro}\marg{definition of macro}\par
+% checks if a command already exists, with the same definition.
+% It can be used more-than-once to check if one of multiple definitions will
+% finally match.
+% (It redefines itself later on to |\@gobbletwo| if the two commands match
+% fine, making further checks harmless.)\par
+% |\caption@IfCheckCommand|\marg{true}\marg{false}\par
+% will execute the \meta{true} code if one match was finally given,
+% the \meta{false} code otherwise.
+% (It simply checks if |\caption@CheckCommand| is |\@gobbletwo| and
+% restores the starting definition of |\caption@CheckCommand|.)
+% \begin{macrocode}
+\newcommand\caption@DoCheckCommand[2]{%
+ \begingroup
+ \let\@tempa#1%
+ #2%
+ \ifx\@tempa#1%
+ \endgroup
+ \let\caption@CheckCommand\@gobbletwo
+ \else
+ \endgroup
+ \fi}
+\@onlypreamble\caption@DoCheckCommand
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@CheckCommand\caption@DoCheckCommand
+\@onlypreamble\caption@CheckCommand
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@IfCheckCommand{%
+ \ifx\caption@CheckCommand\@gobbletwo
+ \let\caption@CheckCommand\caption@DoCheckCommand
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+\@onlypreamble\caption@IfCheckCommand
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@AtBeginDocument}
+% \changes{v3.1}{2007/04/13}{This macro and its usage added}
+% \changes{v3.1l}{2010/01/09}{Adapted to the combine document class}
+% |\caption@AtBeginDocument*|\marg{code}\\
+% Same as |\AtBeginDocument| but the execution of code
+% will be surrounded by two |\PackageInfo|s.
+% The starred variant causes the code to be executed after all code
+% specified using the non-starred variant.
+% \begin{macrocode}
+\let\caption@begindocumenthook\@empty
+\let\caption@@begindocumenthook\@empty
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@AtBeginDocument{%
+ \caption@teststar\g@addto@macro
+ \caption@@begindocumenthook\caption@begindocumenthook}
+%\@onlypreamble\caption@AtBeginDocument
+% \end{macrocode}
+% \begin{macrocode}
+\AtBeginDocument{%
+ \PackageInfo{caption}{Begin \noexpand\AtBeginDocument code\@gobble}%
+% \end{macrocode}
+% \begin{macrocode}
+ \def\caption@AtBeginDocument{%
+ \@ifstar{\g@addto@macro\caption@@begindocumenthook}\@firstofone}%
+ \caption@begindocumenthook
+ \let\caption@begindocumenthook\relax
+% \end{macrocode}
+% \begin{macrocode}
+ \def\caption@AtBeginDocument{%
+ \@ifstar\@firstofone\@firstofone}%
+ \caption@@begindocumenthook
+ \let\caption@@begindocumenthook\relax
+% \end{macrocode}
+% \begin{macrocode}
+ \PackageInfo{caption}{End \noexpand\AtBeginDocument code\@gobble}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Errors}
+%
+% \begin{macro}{\caption@Warning}
+% \changes{v3.1c}{2007/10/14}{This macro added, will now be used for warnings}
+% \begin{macro}{\caption@WarningNoLine}
+% \changes{v3.1c}{2007/10/14}{This macro added, will now be used for warnings}
+% \begin{macro}{\caption@Error}
+% \changes{v3.0l}{2007/01/20}{This macro added, will now be used for errors}
+% \changes{v3.0q}{2007/04/11}{Renamed from \cs{caption@error} to \cs{caption@Error}}
+% \changes{v3.1b}{2007/09/18}{Usage of \cs{caption@Package} removed}
+% \begin{macro}{\caption@KV@err}
+% \changes{v3.1b}{2007/09/18}{This macro added}
+% |\caption@Error|\marg{message}
+% \begin{macrocode}
+\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
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@wh}
+% \begin{macro}{\caption@eh}
+% At the moment we only offer these two simple warning resp. error helpers.
+% \begin{macrocode}
+\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, especially the\MessageBreak
+ section about errors.\MessageBreak\@ehc}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Using the keyval package}
+%
+% We need the \package{keyval} package for option handling, so we load it here.
+% \begin{macrocode}
+\RequirePackage{keyval}[1997/11/10]
+% \end{macrocode}
+%
+% \begin{macro}{\undefine@key}
+% |\undefine@key|\marg{family}\marg{key}\par
+% This helper macro is the opposite of |\define@key|, it removes a keyval
+% definition.
+% \begin{macrocode}
+\providecommand*\undefine@key[2]{%
+ \@nameundef{KV@#1@#2}\@nameundef{KV@#1@#2@default}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@onlypreamble@key}
+% \changes{v3.1}{2007/07/22}{This macro added}
+% \changes{v3.1e}{2007/11/01}{\cs{KV@err} will be used now instead of \cs{@notprerr}}
+% |\onlypreamble@key|\marg{family}\marg{key}\par
+% Analogous to |\@onlypreamble| from \LaTeXe.
+% \begin{macrocode}
+\providecommand*\@preamble@keys{}
+\providecommand*\@onlypreamble@key[2]{\@cons\@preamble@keys{{#1}{#2}}}
+\@onlypreamble\@onlypreamble@key
+\@onlypreamble\@preamble@keys
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\@notprerr@key[1]{\KV@err{Can be used only in preamble}}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@AtBeginDocument*{%
+ \def\@elt#1#2{\expandafter\let\csname KV@#1@#2\endcsname\@notprerr@key}%
+ \@preamble@keys
+ \let\@elt\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionOption}
+% |\DeclareCaptionOption|\marg{option}\oarg{default value}\marg{code}\\
+% |\DeclareCaptionOption*|\marg{option}\oarg{default value}\marg{code}\par
+% We declare our options using these commands (instead of using
+% |\DeclareOption| offered by \LaTeXe), so the keyval package is used.
+% The starred form makes the option available during the lifetime of the
+% current package only, so they can be used with |\usepackage|, but
+% \emph{not} with |\captionsetup| later on.
+% \begin{macrocode}
+\newcommand*\DeclareCaptionOption{%
+ \caption@teststar\caption@declareoption\AtEndOfPackage\@gobble}
+\@onlypreamble\DeclareCaptionOption
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declareoption[2]{%
+ #1{\undefine@key{caption}{#2}}\define@key{caption}{#2}}
+\@onlypreamble\caption@declareoption
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionOptionNoValue}
+% \changes{v3.1c}{2007/10/06}{This macro added}
+% |\DeclareCaptionOptionNoValue|\marg{option}\marg{code}\\
+% |\DeclareCaptionOptionNoValue*|\marg{option}\marg{code}\par
+% Same as \cs{DeclareCaptionOption} but issues an error if a value is given.
+% \begin{macrocode}
+\newcommand*\DeclareCaptionOptionNoValue{%
+ \caption@teststar\caption@declareoption@novalue\AtEndOfPackage\@gobble}
+\@onlypreamble\DeclareCaptionOptionNoValue
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@declareoption@novalue[3]{%
+ \caption@declareoption{#1}{#2}[\KV@err]{%
+ \caption@option@novalue{#2}{##1}{#3}}}
+\@onlypreamble\caption@declareoption@novalue
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@option@novalue[2]{%
+ \ifx\KV@err#2%
+ \expandafter\@firstofone
+ \else
+ \KV@err{No value allowed for #1}%
+ \expandafter\@gobble
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifcaptionsetup@star}
+% \changes{v3.1g}{2008/01/12}{This macro added}
+% If the starred form of |\captionsetup| is used, this will be set to |true|.
+% (It will be reset to |false| at the end of |\caption@setkeys|.)
+% \begin{macrocode}
+\newif\ifcaptionsetup@star
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionsetup}
+% \changes{v3.0a}{2004/01/17}{Bugfix: Missing \% added}
+% \changes{v3.1}{2007/07/22}{Starred-variant added}
+% \changes{v3.1e}{2007/07/27}{Inside packages the starred variant will be used automatically}
+% \changes{v3.1f}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% \changes{v3.1g}{2008/01/12}{\cs{ifcaptionsetup@star} will be set now}
+% |\captionsetup|\oarg{type}\marg{keyval-list of options}\\
+% |\captionsetup*|\oarg{type}\marg{keyval-list of options}\par
+% If the optional argument `type' is specified, we simply save or append
+% the option list, otherwise we `execute' it with |\setkeys|.
+% (The non-starred variant issues a warning if \meta{keyval-list of options}
+% is not used later on.)
+% \Note{The starred variant will be used inside packages automatically.}
+% \begin{macrocode}
+\newcommand*\captionsetup{%
+ \caption@teststar@\@captionsetup\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\@captionsetup[1]{%
+ \captionsetup@startrue#1\captionsetup@starfalse
+ \@ifnextchar[\caption@setup@options\caption@setup}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setup{\caption@setkeys{caption}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@setup@options[#1]#2{%
+ \@bsphack
+ \ifcaptionsetup@star\captionsetup@starfalse\else\caption@addtooptlist{#1}\fi
+ \expandafter\caption@l@addto@list\csname caption@opt@#1\endcsname{#2}%
+ \@esphack}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clearcaptionsetup}
+% \changes{v3.1}{2007/07/29}{Optional argument added}
+% \changes{v3.1}{2007/08/17}{Starred variant added}
+% \changes{v3.1e}{2007/07/27}{Inside packages the starred variant will be used automatically}
+% \changes{v3.1f}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% |\clearcaptionsetup|\oarg{option}\marg{type}\\
+% |\clearcaptionsetup*|\oarg{option}\marg{type}\par
+% This removes the saved option list associated with \meta{type}.
+% If \meta{option} is given, only this option will be removed from the list.
+% (The starred variant does not issue warnings.)
+% \Note{The starred variant will be used inside packages automatically.}
+% \begin{macrocode}
+\newcommand*\clearcaptionsetup{%
+ \caption@teststar@\@clearcaptionsetup\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\@clearcaptionsetup[1]{%
+ \let\caption@tempa#1%
+ \@testopt\@@clearcaptionsetup{}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\@@clearcaptionsetup[#1]#2{%
+ \@bsphack
+ \expandafter\caption@ifempty@list\csname caption@opt@#2\endcsname
+ {\caption@tempa{\caption@Warning{Option list `#2' undefined}}}%
+ {\ifx,#1,%
+ \caption@clearsetup{#2}%
+ \else
+ \caption@@removefromsetup{#1}{#2}%
+ \fi}%
+ \@esphack}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@clearsetup[1]{%
+ \caption@removefromoptlist{#1}%
+ \@nameundef{caption@opt@#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@removefromsetup{%
+ \let\caption@tempa\@gobble
+ \caption@@removefromsetup}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@removefromsetup[2]{%
+ \expandafter\let\expandafter\@tempa\csname caption@opt@#2\endcsname
+ \expandafter\let\csname caption@opt@#2\endcsname\@undefined
+ \def\@tempb##1=##2\@nil{##1}%
+ \edef\@tempc{#1}%
+ \@for\@tempa:=\@tempa\do{%
+ \edef\@tempd{\expandafter\@tempb\@tempa=\@nil}%
+ \ifx\@tempd\@tempc
+ \let\caption@tempa\@gobble
+ \else
+ \expandafter\expandafter\expandafter\caption@l@addto@list
+ \expandafter\csname caption@opt@#2\expandafter\endcsname
+ \expandafter{\@tempa}%
+ \fi}%
+ \expandafter\caption@ifempty@list\csname caption@opt@#2\endcsname
+ {\caption@removefromoptlist{#2}}{}%
+ \caption@tempa{\caption@Warning{%
+ Option `#1' was not in list `#2'\MessageBreak}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\showcaptionsetup}
+% \changes{v3.0e}{2005/05/03}{Optimized for memory usage}
+% \changes{v3.1}{2007/07/29}{Bugfix: Does not expand option list anymore}
+% \changes{v3.1f}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% |\showcaptionsetup|\oarg{package}\marg{type}\par
+% This comes for debugging issues: It shows the saved option list which
+% is associated with \meta{type}.
+% \begin{macrocode}
+\newcommand*\showcaptionsetup[2][\@firstofone]{%
+ \@bsphack
+ \GenericWarning{}{%
+ #1 Caption Info: Option list on `#2'\MessageBreak
+ #1 Caption Data: \@ifundefined{caption@opt@#2}{%
+ -none-%
+ }{%
+ {\expandafter\expandafter\expandafter\strip@prefix
+ \expandafter\meaning\csname caption@opt@#2\endcsname}%
+ }}%
+ \@esphack}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.1}{2007/07/02}{Option \opt{options=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{options}{\caption@setoptions{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setoptions}
+% \changes{v3.0i}{2006/01/03}{Optional argument added}
+% \changes{v3.0j}{2006/01/26}{Revised}
+% \changes{v3.0l}{2007/01/30}{Optional argument removed}
+% \changes{v3.1}{2007/04/11}{Usage of \cs{clearcaptionsetup} added}
+% \changes{v3.1}{2007/05/09}{Renamed from \cs{caption@settype} to \cs{caption@setoptions}}
+% \changes{v3.1f}{2007/12/03}{Definition of \cs{caption@iftypewarning} removed}
+% |\caption@setoptions|\marg{type or environment or\ldots}\par
+% Caption options which have been saved with |\captionsetup|\oarg{type} can
+% be executed by using this command.
+% It simply executes the saved option list (and clears it afterwards),
+% if there is any.
+% \begin{macrocode}
+\newcommand*\caption@setoptions[1]{%
+ \caption@Debug{options=#1}%
+ \expandafter\let\expandafter\caption@opt\csname caption@opt@#1\endcsname
+ \ifx\caption@opt\relax \else
+ \caption@xsetup\caption@opt
+ \caption@clearsetup{#1}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@xsetup[1]{\expandafter\caption@setup\expandafter{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@addtooptlist}
+% \changes{v3.1}{2007/07/22}{This macro added}
+% \begin{macro}{\caption@removefromoptlist}
+% \changes{v3.1}{2007/07/22}{This macro added}
+% \changes{v3.1j}{2008/08/24}{Fatal typo corrected}
+% |\caption@addtooptlist|\marg{type}\\
+% |\caption@removefromoptlist|\marg{type}\par
+% Adds or removes an \meta{type} to the list of unused caption options.
+% Note that the catcodes of \meta{type} are sanitized here so removing
+% \meta{type} from the list do not fail when the \package{float} package
+% is used (since |\float@getstyle| gives a result which tokens have catcode
+% 12 $=$ ``other'').
+% \begin{macrocode}
+\newcommand*\caption@addtooptlist[1]{%
+ \@ifundefined{caption@opt@#1@lineno}{%
+ \caption@dooptlist\caption@g@addto@list{#1}%
+ \expandafter\xdef\csname caption@opt@#1@lineno\endcsname{\the\inputlineno}%
+ }{}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@removefromoptlist[1]{%
+ \caption@dooptlist\caption@g@removefrom@list{#1}%
+ \global\expandafter\let\csname caption@opt@#1@lineno\endcsname\@undefined}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@dooptlist[2]{%
+ \begingroup
+ \edef\@tempa{#2}\@onelevel@sanitize\@tempa
+ \expandafter#1\expandafter\caption@optlist\expandafter{\@tempa}%
+ \endgroup}
+% \end{macrocode}
+% \begin{macrocode}
+\AtEndDocument{%
+ \caption@for@list\caption@optlist{%
+ \caption@WarningNoLine{%
+ Unused \string\captionsetup[#1]
+ on input line \csname caption@opt@#1@lineno\endcsname}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@setkeys}
+% \changes{v3.0i}{2006/01/03}{This macro added}
+% \changes{v3.0l}{2007/01/20}{Bugfix: Usage of \cs{caption@keydepth} added}
+% \changes{v3.0l}{2007/01/30}{Optional argument added}
+% \changes{v3.0p}{2007/04/08}{\cs{caption@keydepth} is now a command instead of a counter}
+% \changes{v3.1b}{2007/09/18}{Usage of \cs{caption@Package} removed, we use \cs{caption@KV@err} instead}
+% \changes{v3.1f}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% \changes{v3.1g}{2008/01/12}{\cs{captionsetup@starfalse} added}
+% \changes{v3.1k}{2009/09/30}{Bugfix 09-09-29: Missing error handler will be defined automatically}
+% |\caption@setkeys|\oarg{package}\marg{family}\marg{key-values}\par
+% This one simply calls |\setkeys|\marg{family}\marg{key-values}
+% but lets the error messages not refer to the \package{keyval} package,
+% but to the \meta{package} package instead.
+% \begin{macrocode}
+\newcommand*\caption@setkeys{\@dblarg\caption@@setkeys}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@setkeys[#1]#2#3{%
+ \@bsphack
+% \end{macrocode}
+% \begin{macrocode}
+ \expandafter\let\csname ORI@KV@err\caption@keydepth\endcsname\KV@err
+ \expandafter\let\csname ORI@KV@errx\caption@keydepth\endcsname\KV@errx
+ \expandafter\let\expandafter\KV@err\csname #1@KV@err\endcsname
+ \ifx\KV@err\relax
+ \def\KV@err##1{\PackageError{#1}{##1}{%
+ See the #1 package documentation for explanation.}}%
+ \fi
+ \let\KV@errx\KV@err
+ \edef\caption@keydepth{\caption@keydepth i}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@Debug{\protect\setkeys{#2}{#3}}%
+ \setkeys{#2}{#3}%
+% \end{macrocode}
+% \begin{macrocode}
+ \edef\caption@keydepth{\expandafter\@gobble\caption@keydepth}%
+ \expandafter\let\expandafter\KV@err\csname ORI@KV@err\caption@keydepth\endcsname
+ \expandafter\let\expandafter\KV@errx\csname ORI@KV@errx\caption@keydepth\endcsname
+% \end{macrocode}
+% \begin{macrocode}
+ \ifx\caption@keydepth\@empty \captionsetup@starfalse \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \@esphack}
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@keydepth\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ExecuteOptions}
+% \changes{v3.1}{2007/07/15}{This macro added}
+% |\caption@ExecuteOptions|\marg{family}\marg{key-values}\par
+% We execute our options using the keyval interface, so we use this one
+% instead of |\ExecuteOptions| offered by \LaTeXe.
+% \begin{macrocode}
+\newcommand*\caption@ExecuteOptions[2]{%
+ \@expandtwoargs\caption@setkeys{#1}{#2}}%
+\@onlypreamble\caption@ExecuteOptions
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ProcessOptions}
+% \changes{v3.0a}{2004/01/23}{Bugfix, see
+% \purett{news:400D360C.9678329F@gmx.net} for details}
+% \changes{v3.0i}{2006/01/03}{Improvement, uses \cs{caption@setkeys}
+% instead of \cs{setkeys}}
+% \changes{v3.0j}{2006/02/23}{Bugfix, now processes only those global
+% options which have a default value}
+% \changes{v3.0l}{2007/01/30}{\cs{ProcessOptionsWithKV} renamed to
+% \cs{caption@ProcessOptions} and moved from the package to the kernel}
+% \changes{v3.1}{2007/04/17}{Star variant added}
+% |\caption@ProcessOptions*|\marg{family}\par
+% We process our options using the keyval package, so we use this one
+% instead of |\ProcessOptions| offered by \LaTeXe.
+% The starred variant do not process the global options.
+% (This code was taken from the \package{hyperref} package\cite{hyperref}
+% \version{6.74} and improved.)
+% \begin{macrocode}
+\newcommand*\caption@ProcessOptions{%
+ \caption@teststar\caption@@ProcessOptions\@gobble\@firstofone}
+\@onlypreamble\caption@ProcessOptions
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@ProcessOptions[2]{%
+ \let\@tempc\relax
+ \let\caption@tempa\@empty
+ #1{% \@firstofone -or- \@gobble
+ \@for\CurrentOption:=\@classoptionslist\do{%
+ \@ifundefined{KV@#2@\CurrentOption}{}{%
+ \@ifundefined{KV@#2@\CurrentOption @default}{%
+ \PackageInfo{#2}{Global option `\CurrentOption' ignored}%
+ }{%
+ \PackageInfo{#2}{Global option `\CurrentOption' processed}%
+ \edef\caption@tempa{\caption@tempa,\CurrentOption,}%
+ \@expandtwoargs\@removeelement\CurrentOption
+ \@unusedoptionlist\@unusedoptionlist
+ }%
+ }%
+ }%
+ \let\CurrentOption\@empty
+ }%
+ \caption@ExecuteOptions{#2}{\caption@tempa\@ptionlist{\@currname.\@currext}}%
+ \AtEndOfPackage{\let\@unprocessedoptions\relax}}
+\@onlypreamble\caption@@ProcessOptions
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Margin resp. width}
+% \changes{v3.0p}{2007/04/01}{\cs{captionmarginx} renamed to \cs{captionmargin@}}
+% \changes{v3.0p}{2007/04/03}{Option `twoside' added}
+% \changes{v3.1}{2007/08/11}{Options `margin*', `minmargin', and `maxmargin' added}
+% \changes{v3.1f}{2007/11/10}{Option `oneside' added}
+%
+% \begin{macro}{\captionmargin}
+% \begin{macro}{\captionwidth}
+% |\captionmargin| and |\captionwidth| contain the extra margin
+% resp. the total width used for captions. Please never set these values in
+% a direct way, they are just accessible in user documents to provide
+% compatibility to \version{1.x}.\par
+% Note that we can only set one value at a time, `margin' \emph{or} `width'.
+% If |\captionwidth| is not zero we will take this value afterwards,
+% otherwise |\captionmargin| and |\captionmargin@|.
+% \begin{macrocode}
+\newdimen\captionmargin
+\newdimen\captionmargin@
+\newdimen\captionwidth
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{margin}{\setcaptionmargin{#1}}
+\DeclareCaptionOption{margin*}{\setcaptionmargin*{#1}}
+\DeclareCaptionOption{width}{\setcaptionwidth{#1}}
+\DeclareCaptionOption{twoside}[1]{\caption@set@bool\caption@iftwoside{#1}}
+\DeclareCaptionOptionNoValue{oneside}{\caption@set@bool\caption@iftwoside0}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{minmargin}{\caption@setoptcmd\caption@minmargin{#1}}
+\DeclareCaptionOption{maxmargin}{\caption@setoptcmd\caption@maxmargin{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\setcaptionmargin}
+% \changes{v3.0h}{2005/10/24}{Renamed from \cs{caption@setmargin} to \cs{setcaptionmargin}}
+% \changes{v3.0h}{2005/10/24}{\cs{setcaptionmargin} enhanced so it can take
+% left+right margin}
+% \changes{v3.1}{2007/08/11}{Starred variant added}
+% \changes{v3.1}{2007/08/12}{\cs{setlength}\cs{captionmargin} \&
+% \cs{setlength}\cs{captionmargin@} swapped so
+% `\texttt{margin*=}\cs{captionmargin}' works in singleline options}
+% |\setcaptionmargin|\marg{amount}\\
+% |\setcaptionmargin*|\marg{amount}\par
+% Please never use them in user documents, it's just there to
+% provide compatibility to the \package{caption2} package.
+% \begin{macrocode}
+\newcommand*\setcaptionmargin{%
+ \caption@teststar\caption@setmargin\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setmargin[2]{%
+ #1{\captionwidth\z@}%
+ \caption@@setmargin#2,#2,\@nil}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@setmargin#1,#2,#3\@nil{%
+ \setlength\captionmargin@{#2}%
+ \setlength\captionmargin{#1}%
+ \addtolength\captionmargin@{-\captionmargin}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\setcaptionwidth}
+% \changes{v3.0h}{2005/10/24}{Renamed from \cs{caption@setwidth} to \cs{setcaptionwidth}}
+% |\setcaptionwidth|\marg{amount}\par
+% Please never use this in user documents, it's just there to
+% provide compatibility to the \package{caption2} package.
+% \begin{macrocode}
+\newcommand*\setcaptionwidth{%
+ \captionmargin\z@
+ \captionmargin@\z@
+ \setlength\captionwidth}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@counter}
+% \changes{v3.0p}{2007/04/03}{This counter added}
+% \changes{v3.1e}{2007/10/28}{Renamed to \cs{caption@thecounter}; \cs{caption@stepcounter} added}
+% This counter numbers the captions. At the moment it will be used inside
+% |\caption@ifoddpage| only.
+% \begin{macrocode}
+\newcommand*\caption@thecounter{0}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@stepcounter{%
+ \@tempcnta\caption@thecounter
+ \advance\@tempcnta\@ne
+ \xdef\caption@thecounter{\the\@tempcnta}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@newlabel}
+% \changes{v3.0p}{2007/04/03}{This macro added}
+% This command is a modified version of |\newlabel| from \LaTeX2e.
+% It will be written to the \texttt{.aux} file to
+% pass label information from one run to another.
+% (We use it inside |\caption@ifoddpage| and |\caption@ragged|.)
+% \begin{macrocode}
+\newcommand*\caption@newlabel{\@newl@bel{caption@r}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@thepage}
+% \changes{v3.0p}{2007/04/03}{This macro added}
+% This command is a modified version of |\thepage| from \LaTeX2e.
+% It will be used inside |\caption@ifoddpage| only.
+% \begin{macrocode}
+\newcommand*\caption@thepage{\the\c@page}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@label}
+% \changes{v3.1}{2007/09/01}{This macro added}
+% \changes{v3.1f}{2007/12/03}{Definition of \cs{caption@newlabel} in AUX file added}
+% This command is a modified version of |\label| from \LaTeX2e.
+% It will be used inside |\caption@ifoddpage| and |\FP@helpNote|.
+% \begin{macrocode}
+\newcommand*\caption@label[1]{%
+ \caption@@label
+ \protected@write\@auxout{\let\caption@thepage\relax}%
+ {\string\caption@newlabel{#1}{\caption@thepage}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@label{%
+ \global\let\caption@@label\relax
+ \protected@write\@auxout{}%
+ {\string\providecommand*\string\caption@newlabel[2]{}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@pageref}
+% \changes{v3.1}{2007/09/01}{This macro added}
+% \changes{v3.1k}{2009/10/09}{Uses \cs{@latex@warning} instead of \cs{caption@Warning} now}
+% This command is a modified version of |\pageref| from \LaTeX2e.
+% It will be used inside |\caption@ifoddpage| and |\FP@helpNote|.
+% \begin{macrocode}
+\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}%
+ \else
+ \expandafter\let\expandafter\caption@thepage\csname caption@r@#1\endcsname
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifoddpage}
+% \changes{v3.0p}{2007/04/03}{This macro added}
+% \changes{v3.1e}{2007/10/28}{Incrementation of counter moved to \cs{caption@@make}}
+% At the moment this macro uses an own label\ldots ref mechanism,
+% but an alternative implementation method would be using the
+% \package{refcount} package\cite{refcount} and |\ifodd\getpagerefnumber{|\ldots|}|.
+% \Note{This macro re-defines itself so the \texttt{.aux} file will
+% only be used once per group.}
+% \begin{macrocode}
+\newcommand*\caption@ifoddpage{%
+ \caption@iftwoside{%
+ \caption@label\caption@thecounter
+ \caption@pageref\caption@thecounter
+ \ifodd\caption@thepage
+ \let\caption@ifoddpage\@firstoftwo
+ \else
+ \let\caption@ifoddpage\@secondoftwo
+ \fi
+ }{\let\caption@ifoddpage\@firstoftwo}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@ifoddpage}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setoptcmd}
+% \changes{v3.1}{2007/08/11}{This macro added}
+% |\caption@setoptcmd|\marg{cmd}\marg{off -or- value}
+% \begin{macrocode}
+\newcommand*\caption@setoptcmd[2]{%
+ \caption@ifinlist{#2}{0,false,no,off}{\let#1\@undefined}{\def#1{#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Indentions}
+%
+% \begin{macro}{\caption@indent}
+% \changes{v3.1}{2007/07/29}{Renamed from \cs{captionindent} to \cs{caption@indent}}
+% \begin{macro}{\caption@parindent}
+% \begin{macro}{\caption@hangindent}
+% These are the indentions we support.
+% \begin{macrocode}
+\newdimen\caption@indent
+\newdimen\caption@parindent
+\newdimen\caption@hangindent
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \changes{v3.0b}{2004/05/16}{Defaults added for options \opt{parindent=}
+% and \opt{hangindent=}}
+% \changes{v3.0h}{2005/08/22}{Option \opt{parskip=}: \cs{AtBeginCaption}
+% replaced by \cs{caption@@par}}
+% \changes{v3.0h}{2005/08/22}{Undocumented defaults for \opt{parindent=},
+% \opt{hangindent=}, and \opt{parskip=} removed}
+% \begin{macrocode}
+\DeclareCaptionOption{indent}[\leftmargini]{% obsolete!
+ \setlength\caption@indent{#1}}
+\DeclareCaptionOption{indention}[\leftmargini]{%
+ \setlength\caption@indent{#1}}
+\DeclareCaptionOption{parindent}{%
+ \setlength\caption@parindent{#1}}
+\DeclareCaptionOption{hangindent}{%
+ \setlength\caption@hangindent{#1}}
+\DeclareCaptionOption{parskip}{%
+ \l@addto@macro\caption@@par{\setlength\parskip{#1}}}
+% \end{macrocode}
+%
+% \changes{v3.0h}{2005/08/22}{Increased compatibility to KOMA-Script:
+% A special version of options `parindent' and `parskip' added}
+% \changes{v3.0i}{2006/01/03}{Bugfix 06-01-03: KOMA-Script variants of
+% `parskip' and `parindent' options revised and moved into caption kernel}
+% \changes{v3.0j}{2006/02/23}{KOMA-Script variants of `parskip' and
+% `parindent' are obsolete now, removed}
+% \changes{v3.0o}{2007/03/30}{KOMA-Script variants of `parskip' and
+% `parindent' re-added, since they still collide with the current
+% version of the subfig package (Sigh!)}
+%
+% There is an option clash between the \KOMAScript\ document classes
+% and the \package{caption} kernel, both define the options |parindent| and
+% |parskip| but with different meaning.
+% Furthermore the ones defined by the \package{caption} kernel take a
+% value as parameter but the \KOMAScript\ ones do not.
+% So we need special versions of the options |parindent| and |parskip| here
+% which determine if a value is given (and therefore should be treated as
+% our option) or not (and therefore should be ignored by us).\footnote{%^^A
+% This problem was completely solved due a change of \cs{caption@ProcessOptions}
+% in \thispackage\ \version{3.0j}, but we still need this workaround since
+% these options would otherwise still collide with the current version $1.3$
+% of the \package{subfig} package (Sigh!)}
+% \begin{macrocode}
+\providecommand*\caption@ifkomaclass{%
+ \@ifundefined{scr@caption}\@gobble\@firstofone}
+\@onlypreamble\caption@ifkomaclass
+% \end{macrocode}
+% \begin{macrocode}
+\caption@ifkomaclass{%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@KV@parindent\KV@caption@parindent
+ \DeclareCaptionOption{parindent}[]{%
+ \ifx,#1,%
+ \caption@Debug{Option `parindent' ignored}%
+ \else
+ \caption@KV@parindent{#1}%
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@KV@parskip\KV@caption@parskip
+ \DeclareCaptionOption{parskip}[]{%
+ \ifx,#1,%
+ \caption@Debug{Option `parskip' ignored}%
+ \else
+ \caption@KV@parskip{#1}%
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsection{Styles}
+%
+% \begin{macro}{\DeclareCaptionStyle}
+% \changes{v3.0a}{2004/01/17}{Pass through argument \#3 so extra spaces
+% between arguments do make any harm}
+% |\DeclareCaptionStyle|\marg{name}\oarg{single-line-list-of-KV}\marg{list-of-KV}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionStyle[1]{%
+ \@testopt{\caption@declarestyle{#1}}{}}
+\@onlypreamble\DeclareCaptionStyle
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@declarestyle#1[#2]#3{%
+ \global\@namedef{caption@sls@#1}{#2}%
+ \global\@namedef{caption@sty@#1}{#3}}
+\@onlypreamble\caption@declarestyle
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.1g}{2008/01/20}{Option \opt{style*=} added}
+% \changes{v3.1i}{2008/05/06}{Option \opt{slc=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{style}{\caption@setstyle{#1}}
+\DeclareCaptionOption{style*}{\caption@setstyle*{#1}}
+\DeclareCaptionOption{singlelinecheck}[1]{\caption@set@bool\caption@ifslc{#1}}
+\DeclareCaptionOption{slc}[1]{\KV@caption@singlelinecheck{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setstyle}
+% \changes{v3.0f}{2005/06/01}{Starred variant added}
+% \changes{v3.1}{2007/07/29}{Recursive style definitions should work now}
+% \changes{v3.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency}
+% \changes{v3.1f}{2007/12/03}{Definition of \cs{caption@iftypewarning} removed}
+% |\caption@setstyle|\marg{name}\\
+% |\caption@setstyle*|\marg{name}\par
+% Selecting a caption style means saving the additional
+% \meta{single-line-list-of-KV} (this will be done by |\caption@sls|),
+% resetting the caption options to the base ones (this will be done using
+% |\caption@resetstyle|) and executing the \meta{list-of-KV} options
+% (this will be done using |\caption@setup|).\par
+% The starred version will give no error message if the given style is not
+% defined.
+% \begin{macrocode}
+\newcommand*\caption@setstyle{%
+ \caption@teststar\caption@@setstyle\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setstyle[2]{%
+ \@ifundefined{caption@sty@#2}%
+ {#1{\caption@Error{Undefined style `#2'}}}%
+ {\expandafter\let\expandafter\caption@sty\csname caption@sty@#2\endcsname
+ \ifx\caption@setstyle@flag\@undefined
+ \let\caption@setstyle@flag\relax
+ \caption@resetstyle
+ \caption@xsetup\caption@sty
+ \let\caption@setstyle@flag\@undefined
+ \else
+ \caption@xsetup\caption@sty
+ \fi
+ \expandafter\let\expandafter\caption@sls\csname caption@sls@#2\endcsname
+ \expandafter\caption@l@addto@list\expandafter\caption@opt@singleline
+ \expandafter{\caption@sls}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@resetstyle}
+% \changes{v3.1}{2007/02/04}{%
+% This macro renamed from \cs{caption@setdefault} to \cs{caption@resetstyle}}
+% \changes{v3.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency}
+% \changes{v3.1f}{2007/11/17}{Usage of \texttt{size=} added}
+% \changes{v3.1i}{2008/05/06}{Usage of \texttt{rule} added}
+% This resets (nearly) all caption options to the base ones.
+% \emph{Note that this does not touch the skips and the positioning!}
+% \begin{macrocode}
+\newcommand*\caption@resetstyle{%
+ \caption@setup{%
+ format=plain,labelformat=default,labelsep=colon,textformat=simple,%
+ justification=justified,font=,size=,labelfont=,textfont=,%
+ margin=0pt,minmargin=0,maxmargin=0,%
+ indent=0pt,parindent=0pt,hangindent=0pt,%
+ slc,rule,strut}%
+ \caption@clearsetup{singleline}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0d}{2005/02/12}{\opt{indent=0pt} added to caption style \opt{default}}
+% \changes{v3.1}{2007/02/04}{Caption style `default' renamed to `base', and a new `default' added}
+% \changes{v3.1}{2007/03/31}{\opt{format=plain} added to caption style \opt{default}}
+% \changes{v3.1c}{2007/10/14}{\opt{format=plain} removed from caption style \opt{default}}
+% Currently there are two pre-defined styles, called `base' \& `default'.
+% The first one is a perfect match to the behavior of |\@makecaption| offered
+% by the standard \LaTeX\ document classes (and was called `default' in
+% \thispackage\ \version{3.0}), the second one matches the document
+% class actually used.
+% \begin{macrocode}
+\DeclareCaptionStyle{base}[indent=0pt,justification=centering]{}
+\DeclareCaptionStyle{default}[indent=0pt,justification=centering]{%
+ format=default,labelsep=default,textformat=default,%
+ justification=default,font=default,labelfont=default,textfont=default}
+% \end{macrocode}
+%
+% \subsection{Formats}
+%
+% \begin{macro}{\DeclareCaptionFormat}
+% \changes{v3.0a}{2004/01/17}{Pass through argument \#3 so extra spaces
+% between arguments do make any harm}
+% \changes{v3.0d}{2005/02/09}{Starred variant added}
+% \changes{v3.1c}{2007/10/15}{Optional argument added}
+% |\DeclareCaptionFormat|\marg{name}\marg{code with \#1, \#2, and \#3}\\
+% |\DeclareCaptionFormat*|\marg{name}\marg{code with \#1, \#2, and \#3}\par
+% The starred form causes the code being typeset in vertical (instead of
+% horizontal) mode, but does not support the |indention=| option.
+% \begin{macrocode}
+\newcommand*\DeclareCaptionFormat{%
+ \caption@teststar\caption@declareformat\@gobble\@firstofone}
+\@onlypreamble\DeclareCaptionFormat
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declareformat[2]{%
+ \@dblarg{\caption@@declareformat#1{#2}}}
+\@onlypreamble\caption@declareformat
+% \end{macrocode}
+% \begin{macrocode}
+\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
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{format}{\caption@setformat{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setformat}
+% |\caption@setformat|\marg{name}\par
+% Selecting a caption format simply means saving the code (in |\caption@fmt|)
+% and if the code should be used in horizontal or vertical mode (|\caption@ifh|).
+% \begin{macrocode}
+\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}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionDefaultFormat}
+% \changes{v3.1g}{2008/01/31}{This macro added}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionDefaultFormat[1]{%
+ \expandafter\def\expandafter\caption@fmt@default\expandafter
+ {\csname caption@fmt@#1\endcsname}%
+ \expandafter\def\expandafter\caption@slfmt@default\expandafter
+ {\csname caption@slfmt@#1\endcsname}%
+ \expandafter\def\expandafter\caption@ifh@default\expandafter
+ {\csname caption@ifh@#1\endcsname}}
+\@onlypreamble\DeclareCaptionDefaultFormat
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0a}{2004/01/23}{%
+% Caption format \opt{default} renamed to \opt{normal}}
+% \changes{v3.0f}{2005/05/12}{%
+% Caption format \opt{normal} renamed to \opt{@normal}}
+% \changes{v3.0h}{2005/08/25}{%
+% Caption format \opt{@normal} renamed to \opt{plain} and documented}
+% \changes{v3.1c}{2007/10/14}{%
+% Single-line variant of caption format \opt{hang} added}
+% There are two pre-defined formats, called `plain' and `hang'.
+% \begin{macrocode}
+\DeclareCaptionFormat{plain}{#1#2#3\par}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionFormat{hang}[#1#2#3\par]{%
+ \caption@ifin@list\caption@lsepcrlist\caption@lsepname
+ {\caption@Error{%
+ The option `labelsep=\caption@lsepname' does not work\MessageBreak
+ with `format=hang'}}%
+ {\@hangfrom{#1#2}%
+ \advance\caption@parindent\hangindent
+ \advance\caption@hangindent\hangindent
+ \caption@@par#3\par}}
+% \end{macrocode}
+%
+% \changes{v3.0a}{2004/01/23}{Caption format \opt{default} linked to \opt{plain}}
+% \changes{v3.0e}{2005/04/28}{Bugfix 05-04-28: Missing \cs{caption@ifh@default} added}
+% `default' usually maps to `plain'.
+% \begin{macrocode}
+\DeclareCaptionDefaultFormat{plain}
+% \end{macrocode}
+%
+% \subsection{Label formats}
+%
+% \begin{macro}{\DeclareCaptionLabelFormat}
+% \changes{v3.0a}{2004/01/17}{%
+% Pass through argument \#2 so extra spaces between arguments do make any harm}
+% |\DeclareCaptionLabelFormat|\marg{name}\marg{code with \#1 and \#2}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionLabelFormat[2]{%
+ \global\@namedef{caption@lfmt@#1}##1##2{#2}}
+\@onlypreamble\DeclareCaptionLabelFormat
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{labelformat}{\caption@setlabelformat{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlabelformat}
+% |\caption@setlabelformat|\marg{name}\par
+% Selecting a caption label format simply means saving the code (in |\caption@lfmt|).
+% \begin{macrocode}
+\newcommand*\caption@setlabelformat[1]{%
+ \@ifundefined{caption@lfmt@#1}%
+ {\caption@Error{Undefined label format `#1'}}%
+ {\expandafter\let\expandafter\caption@lfmt\csname caption@lfmt@#1\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.1f}{2007/12/16}{Caption label format \opt{brace} added}
+% There are four pre-defined label formats, called `empty', `simple',
+% `parens', and `brace'.
+% \begin{macrocode}
+\DeclareCaptionLabelFormat{empty}{}
+\DeclareCaptionLabelFormat{simple}{\bothIfFirst{#1}{\nobreakspace}#2}
+\DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{\nobreakspace}(#2)}
+\DeclareCaptionLabelFormat{brace}{\bothIfFirst{#1}{\nobreakspace}#2)}
+% \end{macrocode}
+%
+% `default' usually maps to `simple'.
+% \begin{macrocode}
+\def\caption@lfmt@default{\caption@lfmt@simple}
+% \end{macrocode}
+%
+% \subsection{Label separators}
+%
+% \begin{macro}{\DeclareCaptionLabelSeparator}
+% \changes{v3.0a}{2004/01/17}{Pass through argument \#2 so extra spaces
+% between arguments do make any harm}
+% \changes{v3.0h}{2005/08/25}{Starred variant added}
+% \changes{v3.1}{2007/07/13}{Test for CR added}
+% |\DeclareCaptionLabelSeparator|\marg{name}\marg{code}\\
+% |\DeclareCaptionLabelSeparator*|\marg{name}\marg{code}\par
+% The starred form causes the label separator to be typeset \emph{without} using |\captionlabelfont|.
+% \begin{macrocode}
+\newcommand\DeclareCaptionLabelSeparator{%
+ \caption@teststar\caption@declarelabelseparator\@gobble\@firstofone}
+\@onlypreamble\DeclareCaptionLabelSeparator
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@declarelabelseparator[3]{%
+ \global\expandafter\let\csname caption@iflf@#2\endcsname#1%
+ \global\long\@namedef{caption@lsep@#2}{#3}%
+ \caption@@declarelabelseparator{#2}#3\\\@nil}
+\@onlypreamble\caption@declarelabelseparator
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@declarelabelseparator#1#2\\#3\@nil{%
+ \def\@tempa{#3}\ifx\@tempa\@empty \else
+ \caption@g@addto@list\caption@lsepcrlist{#1}%
+ \fi}
+\@onlypreamble\caption@@declarelabelseparator
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{labelsep}{\caption@setlabelseparator{#1}}
+\DeclareCaptionOption{labelseparator}{\caption@setlabelseparator{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlabelseparator}
+% |\caption@setlabelseparator|\marg{name}\par
+% Selecting a caption label separator simply means saving the code (in |\caption@lsep|).
+% \begin{macrocode}
+\newcommand*\caption@setlabelseparator[1]{%
+ \@ifundefined{caption@lsep@#1}%
+ {\caption@Error{Undefined label separator `#1'}}%
+ {\edef\caption@lsepname{#1}%
+ \expandafter\let\expandafter\caption@iflf\csname caption@iflf@#1\endcsname
+ \expandafter\let\expandafter\caption@lsep\csname caption@lsep@#1\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0f}{2005/06/11}{Bugfix 05-03-23: Caption label separator
+% \opt{newline} implementation changed from \cs{newline} to \cs{\textbackslash}}
+% \changes{v3.0h}{2005/08/24}{Caption label separator \opt{endash} added}
+% There are seven pre-defined label separators, called `none', `colon', `period', `space',
+% `quad', `newline', and `endash'.
+% \begin{macrocode}
+\DeclareCaptionLabelSeparator{none}{}
+\DeclareCaptionLabelSeparator{colon}{: }
+\DeclareCaptionLabelSeparator{period}{. }
+\DeclareCaptionLabelSeparator{space}{ }
+\DeclareCaptionLabelSeparator*{quad}{\quad}
+\DeclareCaptionLabelSeparator*{newline}{\\}
+\DeclareCaptionLabelSeparator*{endash}{\space\textendash\space}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setdefaultlabelsep}
+% \changes{v3.1k}{2009/03/29}{This macro added}
+% \begin{macrocode}
+\newcommand*\caption@setdefaultlabelsep[1]{%
+ \ifx\caption@lsep\caption@lsep@default
+ \caption@set@default@labelsep{#1}%
+ \caption@setlabelseparator{default}%
+ \else
+ \caption@set@default@labelsep{#1}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@set@default@labelsep[1]{%
+ \def\caption@lsep@default{\@nameuse{caption@lsep@#1}}%
+ \def\caption@iflf@default{\@nameuse{caption@iflf@#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% `default' usually maps to `colon'.
+% \begin{macrocode}
+\caption@set@default@labelsep{colon}
+% \end{macrocode}
+%
+% \subsection{Text formats}
+%
+% \begin{macro}{\DeclareCaptionTextFormat}
+% \changes{v3.0l}{2007/02/18}{This macro added}
+% |\DeclareCaptionTextFormat|\marg{name}\marg{code with \#1}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionTextFormat[2]{%
+ \global\long\@namedef{caption@tfmt@#1}##1{#2}}
+\@onlypreamble\DeclareCaptionTextFormat
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0d}{2005/02/12}{Option \opt{strut=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{textformat}{\caption@settextformat{#1}}
+\DeclareCaptionOption{strut}[1]{\caption@set@bool\caption@ifstrut{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@settextformat}
+% \changes{v3.0l}{2007/02/18}{This macro added}
+% |\caption@settextformat|\marg{name}\par
+% Selecting a caption text format simply means saving the code (in |\caption@tfmt|).
+% \begin{macrocode}
+\newcommand*\caption@settextformat[1]{%
+ \@ifundefined{caption@tfmt@#1}%
+ {\caption@Error{Undefined text format `#1'}}%
+ {\expandafter\let\expandafter\caption@tfmt\csname caption@tfmt@#1\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% There are two pre-defined text formats, called `simple' and `period'.
+% \begin{macrocode}
+\DeclareCaptionTextFormat{simple}{#1}
+\DeclareCaptionTextFormat{period}{#1.}
+% \end{macrocode}
+%
+% `default' usually maps to `simple'.
+% \begin{macrocode}
+\def\caption@tfmt@default{\caption@tfmt@simple}
+% \end{macrocode}
+%
+% \subsection{Fonts}
+%
+% \begin{macro}{\DeclareCaptionFont}
+% \changes{v3.0a}{2004/01/22}{%
+% Bugfix: Multi token arguments are allowed now}
+% \changes{v3.1}{2007/05/07}{%
+% Internal: Uses \cs{caption@fnt} instead of \cs{caption@temp} now}
+% |\DeclareCaptionFont|\marg{name}\marg{code}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionFont[2]{%
+ \define@key{caption@fnt}{#1}[]{\l@addto@macro\caption@fnt{#2}}}
+\@onlypreamble\DeclareCaptionFont
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionDefaultFont}
+% \changes{v3.1}{2006/05/14}{This macro added}
+% \changes{v3.1g}{2008/01/31}{Renamed from \cs{DeclareDefaultCaptionFont} to \cs{DeclareCaptionDefaultFont}}
+% |\DeclareCaptionDefaultFont|\marg{name}\marg{code}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionDefaultFont[2]{%
+ \global\@namedef{caption#1@default}{#2}}
+\@onlypreamble\DeclareCaptionDefaultFont
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{font}{\caption@setfont{font}{#1}}
+\DeclareCaptionOption{font+}{\caption@addtofont{font}{#1}}
+\DeclareCaptionDefaultFont{font}{}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{labelfont}{\caption@setfont{labelfont}{#1}}
+\DeclareCaptionOption{labelfont+}{\caption@addtofont{labelfont}{#1}}
+\DeclareCaptionDefaultFont{labelfont}{}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{textfont}{\caption@setfont{textfont}{#1}}
+\DeclareCaptionOption{textfont+}{\caption@addtofont{textfont}{#1}}
+\DeclareCaptionDefaultFont{textfont}{}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setfont}
+% \changes{v3.0l}{2007/01/30}{Usage of \cs{caption@setkeys} with optional argument}
+% \changes{v3.1}{2006/05/14}{Support of \cs{DeclareDefaultCaptionFont} added}
+% |\caption@setfont|\marg{name}\marg{keyval-list of names}\par
+% Selecting a caption font means saving all the code snippets
+% in |\caption|\meta{name}.
+% \begin{macrocode}
+\newcommand*\caption@setfont[1]{%
+ \expandafter\let\csname caption#1\endcsname\@empty
+ \caption@addtofont{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@addtofont}
+% \changes{v3.1f}{2007/11/17}{This macro added}
+% |\caption@addtofont|\marg{name}\marg{keyval-list of names}\par
+% Like |\caption@setfont|, but adds the code snippets to |\caption|\meta{name}.\par
+% Because we use |\setkeys| recursive here we need to do this inside an
+% extra group.
+% \begin{macrocode}
+\newcommand*\caption@addtofont[2]{%
+ \begingroup
+ \expandafter\let\expandafter\caption@fnt\csname caption#1\endcsname
+ \define@key{caption@fnt}{default}[]{%
+ \l@addto@macro\caption@fnt{\csname caption#1@default\endcsname}}%
+ \caption@setkeys[caption]{caption@fnt}{#2}%
+ \global\let\caption@tempa\caption@fnt
+ \endgroup
+ \expandafter\let\csname caption#1\endcsname\caption@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@font}
+% \changes{v3.1}{2007/05/07}{This macro added}
+% |\caption@font|\marg{keyval-list of names}\\
+% |\caption@font*|\marg{keyval-code}\par
+% Sets the given font, e.g.~|\caption@font{small,it}|
+% is equivalent to |\small\itshape|.
+% \begin{macrocode}
+\newcommand*\caption@font{%
+ \caption@teststar\caption@@font\@firstofone
+ {\caption@setkeys[caption]{caption@fnt}}}
+\newcommand*\caption@@font[2]{%
+ \begingroup
+ \def\caption@fnt{\endgroup}%
+ #1{#2}%
+ \caption@fnt}
+% \end{macrocode}
+% \end{macro}
+%
+% These are the pre-defined font code snippets.
+%
+% \changes{v3.1}{2007/05/07}{Color font support added (kernel)}
+% \begin{macrocode}
+\DeclareCaptionFont{normalcolor}{\normalcolor}
+\DeclareCaptionFont{color}{\color{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionFont{normalfont}{\normalfont}
+\DeclareCaptionFont{up}{\upshape}
+\DeclareCaptionFont{it}{\itshape}
+\DeclareCaptionFont{sl}{\slshape}
+\DeclareCaptionFont{sc}{\scshape}
+\DeclareCaptionFont{md}{\mdseries}
+\DeclareCaptionFont{bf}{\bfseries}
+\DeclareCaptionFont{rm}{\rmfamily}
+\DeclareCaptionFont{sf}{\sffamily}
+\DeclareCaptionFont{tt}{\ttfamily}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionFont{scriptsize}{\scriptsize}
+\DeclareCaptionFont{footnotesize}{\footnotesize}
+\DeclareCaptionFont{small}{\small}
+\DeclareCaptionFont{normalsize}{\normalsize}
+\DeclareCaptionFont{large}{\large}
+\DeclareCaptionFont{Large}{\Large}
+% \end{macrocode}
+%
+% \changes{v3.0p}{2007/04/02}{\package{setspace} package support added (kernel)}
+% \changes{v3.1k}{2009/10/09}{Bugfix 09-05-18: \package{setspace} package support revised (kernel)}
+% \begin{macrocode}
+\DeclareCaptionFont{singlespacing}{%
+ \@ifundefined{setspace@singlespace}{}{%
+ \setstretch\setspace@singlespace}}% normally 1
+\DeclareCaptionFont{onehalfspacing}{\onehalfspacing}
+\DeclareCaptionFont{doublespacing}{\doublespacing}
+\DeclareCaptionFont{stretch}{\setstretch{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%\DeclareCaptionFont{normal}{%
+% \caption@font{normalcolor,normalfont,normalsize,singlespacing}
+\DeclareCaptionFont{normal}{%
+ \caption@font*{%
+ \KV@caption@fnt@normalcolor\@unused
+ \KV@caption@fnt@normalfont\@unused
+ \KV@caption@fnt@normalsize\@unused
+ \KV@caption@fnt@singlespacing\@unused}}
+% \end{macrocode}
+%
+% \changes{v3.0a}{2004/01/23}{Option \opt{size=} now sets \cs{captionsize} instead of \cs{captionfont}}
+% The old versions \version{1.x} of \thispackage\ offered this
+% command to setup the font size used for captions. We still do
+% so old documents will work fine.
+% \begin{macrocode}
+\DeclareCaptionOption{size}{\caption@setfont{size}{#1}}
+\DeclareCaptionDefaultFont{size}{}
+% \end{macrocode}
+%
+% \subsection{Justifications}
+%
+% \begin{macro}{\DeclareCaptionJustification}
+% \changes{v3.0a}{2004/01/17}{Pass through argument \#2 so extra spaces
+% between arguments do make any harm}
+% \changes{v3.1}{2007/07/03}{Mapped to \cs{DeclareCaptionFont}}
+% |\DeclareCaptionJustification|\marg{name}\marg{code}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionJustification[2]{%
+ \global\@namedef{caption@hj@#1}{#2}% for compatibility to v3.0
+ \DeclareCaptionFont{#1}{#2}}
+\@onlypreamble\DeclareCaptionJustification
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionDefaultJustification}
+% \changes{v3.1}{2007/07/03}{This macro added}
+% \changes{v3.1g}{2008/01/31}{Renamed from \cs{DeclareDefaultCaptionJustification} to \cs{DeclareCaptionDefaultJustification}}
+% |\DeclareCaptionDefaultJustification|\marg{code}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionDefaultJustification[1]{%
+ \global\@namedef{caption@hj@default}{#1}% for compatibility to v3.0
+ \DeclareCaptionDefaultFont{@hj}{#1}}
+\@onlypreamble\DeclareCaptionDefaultJustification
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{justification}{\caption@setjustification{#1}}
+\DeclareCaptionDefaultJustification{}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setjustification}
+% \changes{v3.1}{2007/07/03}{Mapped to \cs{caption@setfont}}
+% |\caption@setjustification|\marg{name}\par
+% Selecting a caption justification simply means saving the code (in |\caption@hj|).
+% \begin{macrocode}
+\newcommand*\caption@setjustification{\caption@setfont{@hj}}
+% \end{macrocode}
+% \end{macro}
+%
+% These are the pre-defined justification code snippets.
+% \begin{macrocode}
+\DeclareCaptionJustification{justified}{}
+\DeclareCaptionJustification{centering}{\centering}
+\DeclareCaptionJustification{centerfirst}{\centerfirst}
+\DeclareCaptionJustification{centerlast}{\centerlast}
+\DeclareCaptionJustification{raggedleft}{\raggedleft}
+\DeclareCaptionJustification{raggedright}{\raggedright}
+% \end{macrocode}
+%
+% \begin{macro}{\centerfirst}
+% \changes{v3.0l}{2007/01/21}{Bugfix: Usage of \cs{@centercr} added (Thanks to Olga!)}
+% \changes{v3.0l}{2007/01/21}{This macro renamed from \cs{caption@centerfirst} to \cs{centerfirst}}
+% Please blame Frank Mittelbach for the code of |\centerfirst| |:-)|
+% \begin{macrocode}
+\providecommand\centerfirst{%
+ \let\\\@centercr
+ \edef\caption@normaladjust{%
+ \leftskip\the\leftskip
+ \rightskip\the\rightskip
+ \parfillskip\the\parfillskip\relax}%
+ \leftskip\z@\@plus -1fil%
+ \rightskip\z@\@plus 1fil%
+ \parfillskip\z@skip
+ \noindent\hskip\z@\@plus 2fil%
+ \@setpar{\@@par\@restorepar\caption@normaladjust}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\centerlast}
+% \changes{v3.0l}{2007/01/21}{Bugfix: Usage of \cs{@centercr} added (Thanks to Olga!)}
+% \changes{v3.0l}{2007/01/21}{This macro renamed from \cs{caption@centerlast} to \cs{centerlast}}
+% This is based on code from Anne Br\"uggemann-Klein\cite{Anne}
+% \begin{macrocode}
+\providecommand\centerlast{%
+ \let\\\@centercr
+ \leftskip\z@\@plus 1fil%
+ \rightskip\z@\@plus -1fil%
+ \parfillskip\z@\@plus 2fil\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{The ragged2e package}
+% \changes{v3.0b}{2004/05/16}{Improved \package{ragged2e} package support}
+%
+% We also support the upper-case commands offered by the \package{ragged2e}
+% package.
+% Note that these just map to their lower-case variants if the
+% \package{ragged2e} package is not available.
+% \begin{macrocode}
+\DeclareCaptionJustification{Centering}{%
+ \caption@ragged\Centering\centering}
+\DeclareCaptionJustification{RaggedLeft}{%
+ \caption@ragged\RaggedLeft\raggedleft}
+\DeclareCaptionJustification{RaggedRight}{%
+ \caption@ragged\RaggedRight\raggedright}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@ragged}
+% \changes{v3.0p}{2007/04/07}{The `ragged2e' package will now only been
+% loaded when needed}
+% \changes{v3.0q}{2007/04/11}{Bugfix: Usage of \cs{caption@Info} replaced
+% by \cs{caption@Debug}}
+% \changes{v3.1}{2007/04/16}{A different warning will be given on first \LaTeX\ run}
+% |\caption@ragged| will be basically defined as
+% \begin{quote}
+% |\AtBeginDocument{\IfFileExists{ragged2e.sty}%|\\
+% | {\RequirePackage{ragged2e}\let\caption@ragged\@firstoftwo}%|\\
+% | {\let\caption@ragged\@secondoftwo}}|
+% \end{quote}
+% but with an additional warning if the ragged2e package is not loaded (yet).
+% (This warning will be type out only one time per option, that's why
+% we need the |caption\string#1| stuff.)
+% Furthermore we load the \package{ragged2e} package, if needed and available.
+% \begin{macrocode}
+\newcommand*\caption@ragged{%
+ \caption@Debug{We need ragged2e}%
+ \protected@write\@auxout{}{\string\caption@newlabel{ragged2e}{}}%
+ \global\let\caption@ragged\caption@@ragged
+ \caption@ragged}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \@ifundefined{caption@r@ragged2e}{%
+ \newcommand*\caption@@ragged{%
+ \caption@Warning{%
+ `ragged2e' support has been changed.\MessageBreak
+ Rerun to get captions right}%
+ \global\let\caption@ragged\@secondoftwo % suppress further warnings
+ \caption@ragged}%
+ }{%
+ \caption@Debug{We load ragged2e}%
+ \IfFileExists{ragged2e.sty}{%
+ \RequirePackage{ragged2e}%
+ \let\caption@@ragged\@firstoftwo
+ }{%
+ \newcommand*\caption@@ragged[2]{%
+ \@ifundefined{caption\string#1}{%
+ \caption@Warning{%
+ `ragged2e' package not loaded, therefore\MessageBreak
+ substituting \string#2 for \string#1\MessageBreak}%
+ \global\@namedef{caption\string#1}}{}%
+ #2}%
+ }%
+ }}
+% \end{macrocode}
+% \begin{macrocode}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Vertical spaces before and after captions}
+%
+% \begin{macro}{\abovecaptionskip}
+% \begin{macro}{\belowcaptionskip}
+% Usually these skips are defined within the document class, but some
+% document classes don't do so.
+% \begin{macrocode}
+\@ifundefined{abovecaptionskip}{%
+ \newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@}}{}
+\@ifundefined{belowcaptionskip}{%
+ \newlength\belowcaptionskip\setlength\belowcaptionskip{0\p@}}{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \changes{v3.0d}{2005/02/12}{Option \opt{skip=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{aboveskip}{\setlength\abovecaptionskip{#1}}
+\DeclareCaptionOption{belowskip}{\setlength\belowcaptionskip{#1}}
+\DeclareCaptionOption{skip}{\setlength\abovecaptionskip{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@rule}
+% \changes{v3.1i}{2008/05/06}{This macro added}
+% |\caption@rule|\par
+% Draws an invisible rule to adjust the ``skip'' setting.
+% \begin{macrocode}
+\newcommand*\caption@rule{\caption@ifrule\caption@hrule\relax}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@hrule{\hrule\@height\z@}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.1i}{2008/05/06}{Option \opt{rule=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{rule}[1]{\caption@set@bool\caption@ifrule{#1}}
+% \end{macrocode}
+%
+% \subsection{Positioning}
+%
+% These macros handle the right position of the caption.
+% Note that the position is actually \emph{not} controlled by the
+% \package{caption3} kernel options, but by the user (or a specific package
+% like the \package{float} package) instead.
+% The user can put the |\caption| command wherever he likes! So this stuff
+% is only to give us a \emph{hint} where to put the right skips, the user
+% usually has to take care for himself that this hint actually matches the
+% right position.
+%
+% \begin{macrocode}
+\DeclareCaptionOption{position}{\caption@setposition{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setposition}
+% \changes{v3.0a}{2004/01/22}{Now the positions \opt{t}, \opt{above}, \opt{b},
+% \opt{below}, and \opt{a} are allowed, too}
+% \changes{v3.0d}{2004/08/10}{Usage of \cs{caption@defaultpos} added}
+% |\caption@setposition|\marg{position}\par
+% Selecting the caption position means that we put |\caption@position| to
+% the right value. \emph{Please do \textbf{not} use the internal macro
+% \cs{caption@position} in your own package or document, but use the wrapper
+% macro \cs{caption@iftop} instead.}
+% \begin{macrocode}
+\newcommand*\caption@setposition[1]{%
+ \caption@ifinlist{#1}{d,default}{%
+ \let\caption@position\caption@defaultpos
+ }{\caption@ifinlist{#1}{t,top,above}{%
+ \let\caption@position\@firstoftwo
+ }{\caption@ifinlist{#1}{b,bottom,below}{%
+ \let\caption@position\@secondoftwo
+ }{\caption@ifinlist{#1}{a,auto}{%
+ \let\caption@position\@undefined
+ }{%
+ \caption@Error{Undefined position `#1'}%
+ }}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@defaultpos}
+% \changes{v3.1}{2007/05/08}{Default position changed from `bottom' to `auto'}
+% The default `position' is `auto', this means that \thispackage\ will try
+% to guess the current position of the caption.
+% (But in many cases, for example in |longtable|s, this is doomed to fail!)\par
+% The setting `bottom' correspondents to the |\@makecaption| implementation
+% in the standard \LaTeX\ document classes, but `auto' should give better
+% results in most cases.
+% \begin{macrocode}
+%\caption@setdefaultpos{a}% default = auto
+\let\caption@defaultpos\@undefined
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@iftop}
+% \changes{v3.0a}{2004/01/23}{Split into \cs{caption@iftop} \& \cs{caption@fixposition}}
+% \changes{v3.0d}{2005/02/12}{Adapted to \cs{caption@defaultpos}}
+% \changes{v3.1}{2007/05/08}{Position will be fixed to `bottom' if `auto'}
+% |\caption@iftop|\marg{true-code}\marg{false-code}\par
+% (If the |position=| is set to |auto| we assume a |bottom| position here.)
+% \begin{macrocode}
+\newcommand*\caption@iftop{%
+ \ifx\caption@position\@undefined
+ \let\caption@position\@secondoftwo
+% = \caption@setposition b%
+ \fi
+ \caption@position}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@fixposition}
+% \changes{v3.0b}{2004/05/16}{%
+% Split into \cs{caption@fixposition} & \cs{caption@autoposition}}
+% |\caption@fixposition|\par
+% This macro checks if the `position' is set to `auto'.
+% If yes, |\caption@autoposition| will be called to
+% set |\caption@position| to a proper value we can actually use.
+% \begin{macrocode}
+\newcommand*\caption@fixposition{%
+ \ifx\caption@position\@undefined
+ \caption@autoposition
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@autoposition}
+% \changes{v3.0a}{2004/01/23}{\cs{ifvmode} added}
+% |\caption@autoposition|\par
+% We guess the current position of the caption by checking |\prevdepth|.\par
+% A different solution would be setting the |\spacefactor| to something
+% not much less than 1000 (for example 994) in |\caption@start| and
+% checking this value here by |\ifnum\spacefactor=994|.
+% (It's implemented in the \package{threeparttable}
+% package\cite{threeparttable} this way.)\par
+% Another idea would be checking |\@ifminipage|, but since some packages
+% typeset the caption within a simple |\vbox| this does not seem to be a
+% good one.
+% \begin{macrocode}
+\newcommand*\caption@autoposition{%
+ \ifvmode
+ \edef\caption@tempa{\the\prevdepth}%
+ \caption@Debug{\protect\prevdepth=\caption@tempa}%
+ \ifdim\prevdepth>-\p@
+ \let\caption@position\@secondoftwo
+ \else
+ \let\caption@position\@firstoftwo
+ \fi
+% = \caption@setposition{\ifdim\prevdepth>-\p@ b\else t\fi}%
+ \else
+ \caption@Debug{no \protect\prevdepth}%
+ \let\caption@position\@secondoftwo
+% = \caption@setposition b%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@setautoposition}
+% \changes{v3.1}{2007/06/10}{This macro added}
+% |\caption@setautoposition|\marg{position}\par
+% replaces the above algorithm by a different one (or a fixed position setting).
+% \begin{macrocode}
+\newcommand*\caption@setautoposition[1]{%
+ \def\caption@autoposition{\caption@setposition{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Hooks}
+%
+% \begin{macro}{\AtBeginCaption}
+% \begin{macro}{\AtEndCaption}
+% |\AtBeginCaption| \marg{code}\\
+% |\AtEndCaption| \marg{code}\par
+% These hooks can be used analogous to |\AtBeginDocument| and |\AtEndDocument|.
+% \begin{macrocode}
+\newcommand*\caption@beginhook{}
+\newcommand*\caption@endhook{}
+\newcommand*\AtBeginCaption{\l@addto@macro\caption@beginhook}
+\newcommand*\AtEndCaption{\l@addto@macro\caption@endhook}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Lists}
+%
+% \changes{v3.0b}{2004/05/16}{Option \opt{listof=} added}
+% \changes{v3.1f}{2007/11/17}{Option \opt{list=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{list}[1]{\caption@setlist{#1}}
+\DeclareCaptionOption{listof}[1]{\caption@setlist{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlist}
+% \changes{v3.1g}{2008/03/20}{This macro added}
+% |\caption@setlist|\marg{boolean}
+% \begin{macrocode}
+\newcommand*\caption@setlist{\caption@set@bool\caption@iflist}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionListFormat}
+% \changes{v3.1}{2004/07/15}{This macro added}
+% \changes{v3.1f}{2007/11/17}{Renamed from \cs{DeclareCaptionListOfFormat} to \cs{DeclareCaptionListFormat}}
+% |\DeclareCaptionListFormat|\marg{name}\marg{code with \#1 and \#2}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionListFormat[2]{%
+ \global\@namedef{caption@lstfmt@#1}##1##2{#2}}
+\@onlypreamble\DeclareCaptionListFormat
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.1}{2007/07/15}{Option \opt{listofformat=} added}
+% \changes{v3.1f}{2007/11/17}{Option \opt{listofformat=} renamed to \opt{listformat=}}
+% \begin{macrocode}
+\DeclareCaptionOption{listformat}{\caption@setlistformat{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlistformat}
+% \changes{v3.1}{2004/07/15}{This macro added}
+% \changes{v3.1f}{2007/11/17}{Renamed from \cs{caption@setlistofformat} to \cs{caption@setlistformat}}
+% |\caption@setlistformat|\marg{name}\par
+% Selecting a caption list format simply means saving the code (in |\caption@lstfmt|).
+% \begin{macrocode}
+\newcommand*\caption@setlistformat[1]{%
+ \@ifundefined{caption@lstfmt@#1}%
+ {\caption@Error{Undefined list format `#1'}}%
+ {\expandafter\let\expandafter\caption@lstfmt
+ \csname caption@lstfmt@#1\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% There are five pre-defined list formats, taken from the \package{subfig} package.
+% \begin{macrocode}
+\DeclareCaptionListFormat{empty}{}
+\DeclareCaptionListFormat{simple}{#1#2}
+\DeclareCaptionListFormat{parens}{#1(#2)}
+\DeclareCaptionListFormat{subsimple}{#2}
+\DeclareCaptionListFormat{subparens}{(#2)}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setdefaultlistformat}
+% \changes{v3.1k}{2009/03/29}{This macro added}
+% \begin{macrocode}
+\newcommand*\caption@setdefaultlistformat[1]{%
+ \ifx\caption@lstfmt\caption@lstfmt@default
+ \caption@set@default@listformat{#1}%
+ \caption@setlistformat{default}%
+ \else
+ \caption@set@default@listformat{#1}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@set@default@listformat[1]{%
+ \def\caption@lstfmt@default{\@nameuse{caption@lstfmt@#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% `default' usually maps to `subsimple'.
+% \begin{macrocode}
+\caption@set@default@listformat{subsimple}
+% \end{macrocode}
+%
+% \subsection{Debug option}
+% \changes{v3.0m}{2007/03/04}{Debug option added (kernel)}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{debug}[1]{%
+ \caption@set@bool\caption@ifdebug{#1}%
+ \caption@ifdebug
+ {\def\caption@Debug{\PackageInfo{caption}}}%
+ {\let\caption@Debug\@gobble}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareOption{debug}{\setkeys{caption}{debug}}
+% \end{macrocode}
+% \begin{macrocode}
+\setkeys{caption}{debug=0}
+% \end{macrocode}
+%
+% \subsection{Document classes \& Babel support}
+%
+% \subsubsection{The standard \texorpdfstring{\LaTeX{}}{LaTeX} classes}
+%
+% \begin{macrocode}
+\caption@CheckCommand\@makecaption{%
+ % article|report|book [2005/09/16 v1.4f Standard LaTeX document class]
+ \long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1: #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ #1: #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}}
+% \end{macrocode}
+%
+% \subsubsection{The \AmS{} \& \SmF{} classes}
+% \changes{v3.1}{2007/07/29}{\AmS\ \& \SmF\ classes support added (kernel)}
+%
+% \begin{macrocode}
+\providecommand*\caption@ifamsclass{%
+ \@ifundefined{@captionheadfont}\@gobble\@firstofone}
+\@onlypreamble\caption@ifamsclass
+% \end{macrocode}
+% \begin{macrocode}
+\caption@ifamsclass{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % amsart|amsproc|amsbook [2004/08/06 v2.20]
+ \long\def\@makecaption#1#2{%
+ \setbox\@tempboxa\vbox{\color@setgroup
+ \advance\hsize-2\captionindent\noindent
+ \@captionfont\@captionheadfont#1\@xp\@ifnotempty\@xp
+ {\@cdr#2\@nil}{.\@captionfont\upshape\enspace#2}%
+ \unskip\kern-2\captionindent\par
+ \global\setbox\@ne\lastbox\color@endgroup}%
+ \ifhbox\@ne % the normal case
+ \setbox\@ne\hbox{\unhbox\@ne\unskip\unskip\unpenalty\unkern}%
+ \fi
+ \ifdim\wd\@tempboxa=\z@ % this means caption will fit on one line
+ \setbox\@ne\hbox to\columnwidth{\hss\kern-2\captionindent\box\@ne\hss}%
+ \else % tempboxa contained more than one line
+ \setbox\@ne\vbox{\unvbox\@tempboxa\parskip\z@skip
+ \noindent\unhbox\@ne\advance\hsize-2\captionindent\par}%
+ \fi
+ \ifnum\@tempcnta<64 % if the float IS a figure...
+ \addvspace\abovecaptionskip
+ \hbox to\hsize{\kern\captionindent\box\@ne\hss}%
+ \else % if the float IS NOT a figure...
+ \hbox to\hsize{\kern\captionindent\box\@ne\hss}%
+ \nobreak
+ \vskip\belowcaptionskip
+ \fi
+ \relax
+ }}
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % smfart|smfbook [1999/11/15 v1.2f Classe LaTeX pour les articles publies par la SMF]
+ \long\def\@makecaption#1#2{%
+ \ifdim\captionindent>.1\hsize \captionindent.1\hsize \fi
+ \setbox\@tempboxa\vbox{\color@setgroup
+ \advance\hsize-2\captionindent\noindent
+ \@captionfont\@captionheadfont#1\@xp\@ifnotempty\@xp
+ {\@cdr#2\@nil}{\@addpunct{.}\@captionfont\upshape\enspace#2}%
+ \unskip\kern-2\captionindent\par
+ \global\setbox\@ne\lastbox\color@endgroup}%
+ \ifhbox\@ne % the normal case
+ \setbox\@ne\hbox{\unhbox\@ne\unskip\unskip\unpenalty\unkern}%
+ \fi
+ \ifdim\wd\@tempboxa=\z@ % this means caption will fit on one line
+ \setbox\@ne\hbox to\columnwidth{\hss\kern-2\captionindent\box\@ne\hss}%
+ \@tempdima\wd\@ne\advance\@tempdima-\captionindent
+ \wd\@ne\@tempdima
+ \else % tempboxa contained more than one line
+ \setbox\@ne\vbox{\rightskip=0pt plus\captionindent\relax
+ \unvbox\@tempboxa\parskip\z@skip
+ \noindent\unhbox\@ne\advance\hsize-2\captionindent\par}%
+ \fi
+ \ifnum\@tempcnta<64 % if the float IS a figure...
+ \addvspace\abovecaptionskip
+ \noindent\kern\captionindent\box\@ne
+ \else % if the float IS NOT a figure...
+ \noindent\kern\captionindent\box\@ne
+ \nobreak
+ \vskip\belowcaptionskip
+ \fi
+ \relax
+ }}
+% \end{macrocode}
+% \begin{macrocode}
+ \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
+ \@ifundefined{smf@makecaption}{}{,maxmargin=.1\linewidth}}}
+ \@tempa
+ \caption@g@addto@list\caption@sls@default{margin*=.5\captionmargin}
+ \DeclareCaptionLabelSeparator{default}{.\enspace}
+ \DeclareCaptionDefaultFont{font}{\@captionfont}
+ \DeclareCaptionDefaultFont{labelfont}{\@captionheadfont}
+ \DeclareCaptionDefaultFont{textfont}{\@captionfont\upshape}
+ \captionsetup[figure]{position=b}
+ \captionsetup[table]{position=t}
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection{The beamer class}
+% \changes{v3.1}{2007/03/10}{beamer class support added (kernel)}
+%
+% \begin{macrocode}
+\providecommand*\caption@ifbeamerclass{%
+ \@ifclassloaded{beamer}\@firstofone\@gobble}
+\@onlypreamble\caption@ifbeamerclass
+% \end{macrocode}
+% \begin{macrocode}
+\caption@ifbeamerclass{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\beamer@makecaption{%
+ % beamerbaselocalstructure.sty,v 1.53 2007/01/28 20:48:21 tantau
+ \long\def\beamer@makecaption#1#2{%
+ \def\insertcaptionname{\csname#1name\endcsname}%
+ \def\insertcaptionnumber{\csname the#1\endcsname}%
+ \def\insertcaption{#2}%
+ \nobreak\vskip\abovecaptionskip\nobreak
+ \sbox\@tempboxa{\usebeamertemplate**{caption}}%
+ \ifdim \wd\@tempboxa >\hsize
+ \usebeamertemplate**{caption}\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \nobreak\vskip\belowcaptionskip\nobreak}}
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionLabelFormat{default}{#1}
+ \DeclareCaptionDefaultJustification{\raggedright}
+ \DeclareCaptionDefaultFont{font}{%
+ \usebeamerfont*{caption}%
+ \usebeamercolor[fg]{caption}}
+ \DeclareCaptionDefaultFont{labelfont}{%
+ \usebeamercolor[fg]{caption name}%
+ \usebeamerfont*{caption name}}
+% \end{macrocode}
+% If the \package{beamer} document class is used, we offer a beamer
+% template called `caption3' which can be used with option `beamer' or
+% |\setbeamertemplate{caption}[caption3]|.\par
+% (Note that this is of no use when \thispackage\ is used, too.)
+% \begin{macrocode}
+ \defbeamertemplate{caption}{caption3}{%
+ \caption@make\insertcaptionname\insertcaptionnumber\insertcaption}
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareOption{beamer}{%
+ % \usebeamertemplate**{caption} will set font
+ \DeclareCaptionDefaultFont{font}{}%
+ \setbeamertemplate{caption}[caption3]}
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection{The \KOMAScript{} classes}
+% \changes{v3.1}{2007/03/31}{\KOMAScript\ classes support added (kernel)}
+%
+% \begin{macrocode}
+\providecommand*\caption@ifkomaclass{%
+ \@ifundefined{scr@caption}\@gobble\@firstofone}
+\@onlypreamble\caption@ifkomaclass
+% \end{macrocode}
+% \begin{macrocode}
+\caption@ifkomaclass{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % scrartcl|scrreprt|scrbook [2007/03/07 v2.97a KOMA-Script document class]
+ \long\def\@makecaption#1#2{%
+ \if@captionabove
+ \vskip\belowcaptionskip
+ \else
+ \vskip\abovecaptionskip
+ \fi
+ \@@makecaption\@firstofone{#1}{#2}%
+ \if@captionabove
+ \vskip\abovecaptionskip
+ \else
+ \vskip\belowcaptionskip
+ \fi}}
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionFormat{default}[#1#2#3\par]{%
+ \ifdofullc@p
+ \caption@ifin@list\caption@lsepcrlist\caption@lsepname
+ {\caption@Error{%
+ The option `labelsep=\caption@lsepname' does not work\MessageBreak
+ with \noexpand\setcaphanging (which is set by default)}}%
+ {\caption@fmt@hang{#1}{#2}{#3}}%
+ \else
+ #1#2%
+ \ifdim\cap@indent<\z@
+ \par
+ \noindent\hspace*{-\cap@indent}%
+ \else\if@capbreak
+ \par
+ \fi\fi
+ #3\par
+ \fi}
+ \DeclareCaptionLabelSeparator{default}{\captionformat}
+ \DeclareCaptionDefaultFont{font}{\scr@fnt@caption}
+ \DeclareCaptionDefaultFont{labelfont}{\scr@fnt@captionlabel}
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection{The \NTG{} Dutch classes}
+% \changes{v3.1}{2007/04/06}{NTG classes support added (kernel)}
+%
+% \begin{macrocode}
+\providecommand*\caption@ifntgclass{%
+ \@ifundefined{CaptionFonts}\@gobble\@firstofone}
+\@onlypreamble\caption@ifntgclass
+% \end{macrocode}
+% \begin{macrocode}
+\caption@ifntgclass{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % artikel|rapport|boek [2004/06/07 v2.1a NTG LaTeX document class]
+ \long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{{\CaptionLabelFont#1:} \CaptionTextFont#2}%
+ \ifdim \wd\@tempboxa >\hsize
+ {\CaptionLabelFont#1:} \CaptionTextFont#2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}}
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionDefaultFont{labelfont}{\CaptionLabelFont}
+ \DeclareCaptionDefaultFont{textfont}{\CaptionTextFont}
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection{The thesis class}
+% \changes{v3.1g}{2008/01/31}{thesis class support added (kernel)}
+% \changes{v3.1l}{2009/11/15}{Bugfix 09-11-14: thesis class support revised (kernel)}
+%
+% \begin{macrocode}
+\providecommand*\caption@ifthesisclass{%
+ \@ifundefined{cph@font}{\@gobble}{\@ifundefined{cpb@font}\@gobble\@firstofone}}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@ifthesisclass{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % thesis.cls 1996/25/01 1.0g LaTeX document class (wm).
+ \long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \setbox\@tempboxa\hbox{{\cph@font #1:} {\cpb@font #2}}%
+ \ifdim \wd\@tempboxa >\hsize
+ \@hangfrom{\cph@font #1: }{\cpb@font #2\par}%
+ \else
+ \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}}
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionDefaultFormat{hang}
+ \DeclareCaptionDefaultFont{labelfont}{\cph@font}
+ \DeclareCaptionDefaultFont{textfont}{\cpb@font}
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection{The frenchb Babel option}
+% \changes{v3.1}{2006/05/14}{\package{frenchb} package support added (kernel)}
+%
+% \begin{macrocode}
+\@ifundefined{FB@makecaption}{}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % frenchb.ldf [2005/02/06 v1.6g French support from the babel system]
+ % frenchb.ldf [2007/10/05 v2.0e French support from the babel system]
+ \long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1\CaptionSeparator #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ #1\CaptionSeparator #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}}
+% \end{macrocode}
+% \begin{macrocode}
+ \ifx\@makecaption\STD@makecaption
+ \DeclareCaptionLabelSeparator{default}{\CaptionSeparator}
+ \def\caption@frenchb{% supress frenchb warning
+ \let\STD@makecaption\@makecaption
+ \let\FB@makecaption\@makecaption}
+ \else
+ \ifx\@makecaption\@undefined\else
+ \PackageInfo{caption}{%
+ The definition of \protect\@makecaption\space
+ has been changed,\MessageBreak
+ frenchb will NOT customize it}%
+ \fi
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection{The frenchle/pro package}
+% \changes{v3.1}{2006/05/14}{\package{frenchle/pro} package support added (kernel)}
+%
+% \begin{macrocode}
+\@ifundefined{frenchTeXmods}{}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % french(le).sty [2006/10/03 The french(le) package /V5,9991/]
+ % french(le).sty [2007/06/28 The french(le) package /V5,9994/]
+ \def\@makecaption#1#2{%
+ \ifFTY%
+ \def\@secondofmany##1##2\void{##2}%
+ \def\@tempa{\@secondofmany#2\void}%
+ \ifx\@tempa\empty%
+ \let\captionseparator\empty%
+ \fi%
+ \@mcORI{#1}{\relax\captionfont{#2}}%
+ \else
+ \@mcORI{#1}{#2}%
+ \fi}}
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % french(le).sty [2007/02/11 The french(le) package /V5,9993/]
+ \def\@makecaption#1#2{%
+ \ifFTY%
+ \def\@secondofmany##1##2\void{##2}%
+ \protected@edef\@tempa{\@secondofmany#2\void}%
+ \ifx\@tempa\empty%
+ \let\captionseparator\empty%
+ \fi%
+ \@mcORI{#1}{\relax\captionfont{#2}}%
+ \else
+ \@mcORI{#1}{#2}%
+ \fi}}
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionDefaultFont{textfont}{\itshape}%
+ \DeclareCaptionLabelSeparator{default}{\captionseparator\space}%
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \iffalse
+% \subsubsection{The hungarian and magyar Babel option}
+% \changes{v3.2}{2009/03/29}{\package{magyar} package support added (kernel)}
+%
+% \begin{macrocode}
+\DeclareCaptionListFormat{subperiod}{#2.}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%%% \def\caption@tempa#1{\@ifundefined{extras#1}{}{%
+%%% \expandafter\addto\csname extras#1\endcsname{%
+%%% % reverse changes made by magyar.ldf
+%%% \let\@makecaption\caption@makecaption
+%%% \babel@save\@makecaption
+%%% \caption@redefine
+%%% \babel@save\@caption
+%%% % change default labelsep and listformat
+%%% \caption@setdefaultlabelsep{period}%
+%%% \caption@setdefaultlistformat{subperiod}}%
+%%% \expandafter\addto\csname noextras#1\endcsname{%
+%%% % change default labelsep and listformat
+%%% \caption@setdefaultlabelsep{colon}%
+%%% \caption@setdefaultlistformat{subsimple}}%
+%%% }}
+% \end{macrocode}
+% \begin{macrocode}
+%%% \caption@tempa{hungarian}
+%%% \caption@tempa{magyar}
+% \end{macrocode}
+% \fi
+%
+% \subsection{Execution of options}
+%
+% \begin{macrocode}
+\captionsetup{style=default,position=default,%
+ list,listformat=default,twoside=\if@twoside 1\else 0\fi}
+% \end{macrocode}
+% \begin{macrocode}
+\ProcessOptions*
+% \end{macrocode}
+%
+% \changes{v3.1}{2007/04/10}{Check of document class added}
+% \begin{macrocode}
+\caption@IfCheckCommand{%
+ \caption@setbool{documentclass}{1}%
+}{%
+ \caption@setbool{documentclass}{0}%
+ \PackageInfo{caption}{%
+ Unknown document class (or package),\MessageBreak
+ standard defaults will be used}%
+ \caption@Debug{\string\@makecaption\space=\space\meaning\@makecaption\@gobble}%
+}
+% \end{macrocode}
+%
+% \subsection{Making an `List of' entry}
+%
+% \begin{macro}{\caption@addcontentsline}
+% \changes{v3.1}{2007/07/01}{This macro added}
+% |\caption@addcontentsline|\marg{type}\marg{list entry}\par
+% Makes an entry in the list-of-whatever, if requested,
+% i.e.~the argument \meta{list entry} is not empty and
+% |listof=| was set to |true|.
+% \begin{macrocode}
+\newcommand*\caption@addcontentsline[2]{%
+ \caption@iflist
+ {\def\@tempa{#2}}%
+ {\let\@tempa\@empty}%
+ \ifx\@tempa\@empty \else
+ {\let\\\space
+ \addcontentsline{\csname ext@#1\endcsname}{#1}%
+ {\protect\numberline
+ {\caption@lstfmt{\@nameuse{p@#1}}{\@nameuse{the#1}}}%
+ {\ignorespaces #2}}}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Typesetting the caption}
+%
+% \begin{macro}{\ifcaption@star}
+% If the starred form of |\caption| is used, this will be set to |true|.
+% (It will be reset to |false| at the end of |\caption@@make|.)
+% \begin{macrocode}
+\newif\ifcaption@star
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@fnum}
+% \changes{v3.1}{2007/08/21}{This macro added}
+% |\caption@fnum|\marg{float type}\par
+% Typesets the caption label; as replacement for |\fnum@|\meta{float type}.
+% \begin{macrocode}
+\newcommand*\caption@fnum[1]{\caption@lfmt{\@nameuse{#1name}}{\@nameuse{the#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@make}
+% |\caption@make|\marg{float name}\marg{ref.\ number}\marg{text}\par
+% Typesets the caption.
+% \begin{macrocode}
+\newcommand\caption@make[2]{\caption@@make{\caption@lfmt{#1}{#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@make}
+% \changes{v3.0b}{2004/05/16}{Bugfix 04-05-05: \cs{ifdim}\cs{captionindent=}\cs{z@} added}
+% \changes{v3.0d}{2005/02/12}{Bugfix 04-10-26: Use \cs{@tempdima} instead of
+% \cs{captionmargin} resp. \cs{captionwidth}; check for \cs{z@} added}
+% \changes{v3.0d}{2005/02/12}{Bugfix: \cs{hskip}\cs{captionmargin} to the end
+% of caption added}
+% \changes{v3.0d}{2005/02/12}{Bugfix: \cs{strut} moved from here to \cs{caption@@@make}}
+% \changes{v3.0d}{2005/02/12}{Single-line-check moved up so it can affect margins now}
+% \changes{v3.0d}{2005/02/09}{Improvement: \cs{caption@ifh} added}
+% \changes{v3.0d}{2005/02/09}{Bugfix: \cs{leavevmode} added}
+% \changes{v3.0h}{2005/08/24}{Uses \cs{sbox} instead of \cs{setbox} in single-line-check}
+% \changes{v3.0i}{2005/12/04}{Uses \cs{caption@slc} now}
+% \changes{v3.0i}{2006/01/11}{Bugfix: \cs{caption@calcmargin} inside
+% single-line-check replaced by \cs{relax}}
+% \changes{v3.0i}{2006/01/11}{Bugfix: \cs{caption@startbox} will always be
+% typeset in horizontal mode}
+% \changes{v3.0k}{2006/05/13}{Uses \cs{caption@parbox} instead of \cs{caption@start/endbox}}
+% \changes{v3.0l}{2007/01/04}{Oops, bugfix 04-05-05 got lost in v3.0j, re-added}
+% \changes{v3.0p}{2007/04/03}{Usage of \cs{caption@ifoddpage} added}
+% \changes{v3.1}{2007/07/29}{\cs{caption@calcmargin} moved below single-line-check}
+% \changes{v3.1e}{2007/10/28}{\cs{caption@stepcounter} added}
+% |\caption@@make|\marg{caption label}\marg{caption text}
+% \begin{macrocode}
+\newcommand\caption@@make[2]{%
+ \begingroup
+ \caption@stepcounter
+ \caption@beginhook
+% \end{macrocode}
+%
+% Check margin, if |\caption@minmargin| or |\caption@maxmargin| is set
+% \begin{macrocode}
+ \ifx\caption@maxmargin\@undefined \else
+ \ifdim\captionmargin>\caption@maxmargin\relax
+ \captionmargin\caption@maxmargin\relax
+ \fi
+ \fi
+ \ifx\caption@minmargin\@undefined \else
+ \ifdim\captionmargin<\caption@minmargin\relax
+ \captionmargin\caption@minmargin\relax
+ \fi
+ \fi
+% \end{macrocode}
+%
+% Special single-line treatment (option |singlelinecheck=|)
+% \begin{macrocode}
+ \caption@ifslc{\caption@slc{#1}{#2}\captionwidth\relax}{}%
+% \end{macrocode}
+%
+% Typeset the left margin (option |margin=|)
+% \begin{macrocode}
+ \caption@calcmargin
+ \@tempdima\captionmargin
+ \ifdim\captionmargin@=\z@ \else
+ \caption@ifoddpage{}{\advance\@tempdima\captionmargin@}%
+ \fi
+ \caption@ifh{\advance\@tempdima\caption@indent}%
+ \hspace\@tempdima
+% \end{macrocode}
+%
+% We actually use a |\vbox| of width |\captionwidth - \caption@indent|
+% to typeset the caption.
+% \Note{\cs{captionindent} is \emph{not} supported if the caption format
+% was defined with \cs{DeclareCaptionFormat*}.}
+% \begin{macrocode}
+ \@tempdima\captionwidth
+ \caption@ifh{\advance\@tempdima-\caption@indent}%
+ \caption@parbox\@tempdima{%
+% \end{macrocode}
+%
+% Typeset the indention (option |indention=|)\\
+% {\small Bugfix 04-05-05:
+% |\hskip-\caption@indent| replaced by |\ifdim\caption@indent=\z@|\ldots}
+% \begin{macrocode}
+ \caption@ifh{%
+ \ifdim\caption@indent=\z@
+ \leavevmode
+ \else
+ \hskip-\caption@indent
+ \fi}%
+% \end{macrocode}
+%
+% Typeset the caption itself and close the |\caption@parbox|
+% \begin{macrocode}
+ \caption@@@make{#1}{#2}}%
+% \end{macrocode}
+%
+% Typeset the right margin (option |margin=|)
+% \begin{macrocode}
+ \@tempdima\captionmargin
+ \ifdim\captionmargin@=\z@ \else
+ \caption@ifoddpage{\advance\@tempdima\captionmargin@}{}%
+ \fi
+ \hspace\@tempdima
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@endhook
+ \endgroup
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \global\caption@starfalse}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@calcmargin}
+% \changes{v3.0h}{2005/10/24}{Internal: \cs{ifcaption@width} replaced by
+% \cs{ifdim}\cs{captionwidth=}\cs{z@}}
+% \changes{v3.0i}{2006/01/12}{Improvement: Takes care of list environment now}
+% \changes{v3.1}{2006/05/13}{Check of \cs{@listdepth} removed (not necessary anymore),
+% use \cs{linewidth} instead of \cs{hsize}}
+% |\caption@calcmargin|\par
+% Calculate |\captionmargin| \& |\captionwidth|, so both contain valid
+% values.
+% \begin{macrocode}
+\newcommand*\caption@calcmargin{%
+ \ifdim\captionwidth=\z@
+ \captionwidth\linewidth
+ \advance\captionwidth by -2\captionmargin
+ \advance\captionwidth by -\captionmargin@
+ \else
+ \captionmargin\linewidth
+ \advance\captionmargin by -\captionwidth
+ \divide\captionmargin by 2
+ \captionmargin@\z@
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@Debug{%
+ \string\hsize=\the\hsize,
+ \string\linewidth=\the\linewidth,\MessageBreak
+ \string\leftmargin=\the\leftmargin,
+ \string\rightmargin=\the\rightmargin,\MessageBreak
+ \string\margin=\the\captionmargin,
+ \string\margin@=\the\captionmargin@,
+ \string\width=\the\captionwidth}%
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@slc}
+% \changes{v3.1}{2007/06/13}{\cs{let}\cs{caption@hj}\cs{relax} added}
+% \changes{v3.1}{2007/07/29}{\cs{caption@setup}\cs{caption@sls} added after \cs{begingroup}}
+% \changes{v3.1}{2007/07/29}{\cs{caption@calcmargin} added}
+% \changes{v3.1c}{2007/10/14}{Support of \cs{caption@slfmt} added}
+% \changes{v3.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency}
+% |\caption@slc|\marg{label}\marg{text}\marg{width}\marg{extra code}\par
+% This one does the single-line-check.
+% \begin{macrocode}
+\newcommand\caption@slc[4]{%
+ \caption@Debug{Begin SLC}%
+ \begingroup
+ \caption@singleline
+ \let\caption@hj\@empty
+ \caption@calcmargin % calculate #3 if necessary
+ \caption@prepareslc
+ \sbox\@tempboxa{\caption@@@make{#1}{#2}}%
+ \ifdim\wd\@tempboxa>#3%
+ \endgroup
+ \else
+ \endgroup
+ \caption@singleline
+ #4%
+ \fi
+ \caption@Debug{End SLC}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@singleline{%
+ \caption@xsetup\caption@opt@singleline
+ \let\caption@fmt\caption@slfmt}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@prepareslc}
+% \changes{v3.0b}{2004/05/16}{Bugfix: Redefinition of \cs{label} \& \cs{@footnotetext} added}
+% \changes{v3.0b}{2004/05/16}{Redefine \cs{stepcounter} instead of \cs{footnote(mark)}}
+% \changes{v3.0d}{2005/02/12}{\cs{let}\cs{caption@hj}\cs{relax} added}
+% \changes{v3.0h}{2005/07/09}{Support of \package{endnotes} package added}
+% \changes{v3.1}{2007/06/13}{\cs{let}\cs{caption@hj}\cs{relax} moved to \cs{caption@slc}}
+% \changes{v3.1}{2007/06/13}{Redefinition of \cs{(H@)refstepcounter} added}
+% \changes{v3.1}{2007/08/12}{Redefinition of \cs{label} improved}
+% \changes{v3.1c}{2007/10/06}{Definition of \cs{caption@l@stepcounter} added}
+% |\caption@prepareslc|\par
+% Re-define anything which would disturb the single-line-check.
+% \begin{macrocode}
+\newcommand*\caption@prepareslc{%
+ \let\@footnotetext\@gobble\let\@endnotetext\@gobble
+ \def\label{\caption@withoptargs\@gobbletwo}%
+ \let\stepcounter\caption@l@stepcounter
+ \let\refstepcounter\stepcounter\let\H@refstepcounter\stepcounter}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@l@stepcounter[1]{\advance\csname c@#1\endcsname\@ne\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@parbox}
+% \changes{v3.0k}{2006/05/13}{We define \cs{caption@parbox} instead of
+% \cs{caption@start/endbox}}
+% \changes{v3.0n}{2006/03/09}{Bugfix 07-03-09: \cs{caption@parbox} changed from
+% \cs{parbox-t} to \cs{parbox-b}}
+% \changes{v3.1f}{2007/11/11}{Renamed from \cs{captionbox} to \cs{caption@parbox}}
+% |\caption@parbox|\marg{width}\marg{contents}\par
+% This macro defines the box which surrounds the caption paragraph.
+% \begin{macrocode}
+\newcommand*\caption@parbox{\parbox[b]}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@@make}
+% \changes{v3.0b}{2004/05/16}{Bugfix 04-05-06: \cs{allowhyphens} added}
+% \changes{v3.0d}{2005/02/12}{Bugfix 04-12-16: Use some kind of
+% \cs{@startstrut}\cs{strutbox} instead of \cs{strut}}
+% \changes{v3.0d}{2005/02/12}{Bugfix 05-01-23: \cs{@finalstrut}\cs{strutbox} added}
+% \changes{v3.0e}{2005/05/05}{Use \cs{caption@ifempty};
+% \cs{let}\cs{caption@ifstrut}\cs{@secondoftwo} added}
+% \changes{v3.0e}{2005/05/05}{Bugfix: Handling of \cs{ifcaption@star} changed}
+% \changes{v3.0h}{2005/08/24}{Check for empty label added}
+% \changes{v3.0h}{2005/08/25}{\cs{caption@iflf} added}
+% \changes{v3.0l}{2007/02/18}{Usage of \cs{caption@tfmt} added}
+% \changes{v3.1}{2007/05/07}{Bugfix: \cs{ifhmode} added to \cs{@finalstrut}}
+% \changes{v3.1f}{2007/11/17}{Made option \opt{size=} stronger than \opt{font=}}
+% |\caption@@@make|\marg{caption label}\marg{caption text}\par
+% This one finally typesets the caption paragraph, without margin and indention.
+% \begin{macrocode}
+\newcommand\caption@@@make[2]{%
+% \end{macrocode}
+%
+% If the label is empty, we use no caption label separator.
+% \begin{macrocode}
+ \sbox\@tempboxa{#1}%
+ \ifdim\wd\@tempboxa=\z@
+ \let\caption@lsep\relax
+% \@capbreakfalse
+ \fi
+% \end{macrocode}
+%
+% If the text is empty, we use no caption label separator, too.
+% \begin{macrocode}
+ \caption@ifempty{#2}{%
+ \let\caption@lsep\relax
+% \@capbreakfalse
+% \let\caption@ifstrut\@secondoftwo
+ }%
+% \end{macrocode}
+%
+% Take care that |\caption@parindent| and |\caption@hangindent| will be used
+% to typeset the paragraph.
+% \begin{macrocode}
+ \@setpar{\@@par\caption@@par}\caption@@par
+% \end{macrocode}
+%
+% Finally typeset the caption.
+% \begin{macrocode}
+ \caption@hj\captionfont\captionsize\caption@fmt
+ {\ifcaption@star\else{\captionlabelfont#1}\fi}%
+ {\ifcaption@star\else{\caption@iflf\captionlabelfont\caption@lsep}\fi}%
+ {{\captiontextfont
+ \caption@ifstrut{\vrule\@height\ht\strutbox\@width\z@}{}%
+ \nobreak\hskip\z@skip % enable hyphenation
+ \caption@tfmt{#2}%
+% \caption@ifstrut{\vrule\@height\z@\@depth\dp\strutbox\@width\z@}{}%
+ \caption@ifstrut{\ifhmode\@finalstrut\strutbox\fi}{}%
+ \par}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifempty}
+% \changes{v3.0e}{2005/05/05}{This macro added}
+% \changes{v3.1}{2007/07/04}{Re-defines itself now}
+% \changes{v3.1g}{2007/01/22}{Revised so \cs{label} will be detected, too}
+% \changes{v3.1i}{2008/08/02}{Revised so \cs{index} and \cs{glossary} will be detected, too}
+% |\caption@ifempty|\marg{text}\marg{true} (\emph{no} \meta{false})\par
+% This one tests if the \meta{text} is actually empty.
+% \Note{This will be done without expanding the text,
+% therefore this is far away from being bullet-proof.}
+% \Note{This macro is re-defining itself so only
+% the first test (in a group) will actually be done.}
+% \begin{macrocode}
+\newcommand\caption@ifempty[1]{%
+ \caption@if@empty{#1}%
+ \caption@ifempty\@unused}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@if@empty[1]{%
+ \def\caption@tempa{#1}%
+ \ifx\caption@tempa\@empty
+ \let\caption@ifempty\@secondoftwo
+ \else
+ \expandafter\def\expandafter\caption@tempa\expandafter{%
+ \caption@car#1\caption@if@empty\caption@nil}%
+ \def\caption@tempb{\caption@if@empty}%
+ \ifx\caption@tempa\caption@tempb
+ \let\caption@ifempty\@secondoftwo
+ \else
+ \def\caption@tempb{\ignorespaces}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\caption@if@empty\expandafter{\@gobble#1}%
+ \else
+ \def\caption@tempb{\label}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
+ \else
+ \def\caption@tempb{\index}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
+ \else
+ \def\caption@tempb{\glossary}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
+ \else
+ \let\caption@ifempty\@gobbletwo
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@car#1#2\caption@nil{#1}% same as \@car, but \long
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@par}
+% \changes{v3.0h}{2005/08/22}{Made this definition global}
+% |\caption@@par|\par
+% This command will be executed with every |\par| inside the caption.
+% \begin{macrocode}
+\newcommand*\caption@@par{%
+ \parindent\caption@parindent\hangindent\caption@hangindent}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Types \& sub-types}
+%
+% \begin{macro}{\DeclareCaptionType}
+% \changes{v3.1}{2007/08/12}{This macro added}
+% \changes{v3.1a}{2007/09/07}{Three optional arguments added}
+% \changes{v3.1f}{2007/12/06}{Renamed from \cs{DeclareFloatingEnvironment} to \cs{DeclareCaptionType}}
+% \changes{v3.1f}{2007/12/21}{Optional argument revised, uses key-value syntax now}
+% \changes{v3.1i}{2008/04/13}{Uses \cs{caption@within@default} now}
+% \changes{v3.1i}{2008/08/02}{Support of \cs{float@exts} and \cs{float@addtolists} added}
+% \changes{v3.1l}{2010/01/09}{Usage of \cs{caption@DeclareWithinOption} added}
+% |\DeclareCaptionType|\oarg{options}\marg{environment}\oarg{name}\oarg{list name}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionType{%
+ \@testopt\@DeclareCaptionType{}}
+\@onlypreamble\DeclareCaptionType
+% \end{macrocode}
+% \begin{macrocode}
+\def\@DeclareCaptionType[#1]#2{%
+ \def\caption@type{#2}%
+ \caption@Debug{New type `#2'}%
+ \newcounter{#2}\@namedef{theH#2}{}%
+ \KV@caption@DCT@within\caption@within@default
+ \caption@DeclareWithinOption{#2}%
+ \KV@caption@DCT@placement{tbp}%
+ \@ifundefined{c@float@type}%
+ {\newcounter{float@type}%
+ \setcounter{float@type}{\@ifundefined{c@figure}14}}%
+ {}%
+ \caption@Debug{float type `#2'=\the\value{float@type}}%
+ \expandafter\xdef\csname ftype@#2\endcsname{\the\value{float@type}}%
+ \addtocounter{float@type}{\value{float@type}}%
+ \KV@caption@DCT@fileext{lo#2}%
+ \@namedef{fnum@#2}{\@nameuse{#2name}\nobreakspace\@nameuse{the#2}}%
+ \newenvironment{#2}{\@float{#2}}{\end@float}%
+ \newenvironment{#2*}{\@dblfloat{#2}}{\end@dblfloat}%
+ \expandafter\newcommand\csname listof#2s\endcsname{\caption@listof{#2}}%
+ \@ifundefined{l@figure}%
+ {\@namedef{l@#2}{\@dottedtocline{1}{1.5em}{2.3em}}}%
+ {\expandafter\let\csname l@#2\endcsname\l@figure}%
+% \end{macrocode}
+% \begin{macrocode}
+ \expandafter\newcommand\csname #2name\endcsname{}%
+ \edef\@tempa{\def\noexpand\@tempa{\@car#2\@nil}}%
+ \uppercase\expandafter{\@tempa}%
+ \edef\@tempb{\noexpand\g@addto@macro\noexpand\@tempa{\@cdr#2\@nil}}%
+ \@tempb
+ \expandafter\let\csname #2name\endcsname\@tempa
+ \expandafter\newcommand\csname list#2name\endcsname{}%
+ \expandafter\xdef\csname list#2name\endcsname{List of \@tempa s}%
+% \end{macrocode}
+% \begin{macrocode}
+ \@cons\caption@typelist{{#2}}%
+ \caption@setkeys[caption]{caption@DCT}{#1}%
+% \end{macrocode}
+% \begin{macrocode}
+ \@ifundefined{float@exts}{\newtoks\float@exts}{}%
+ \let\float@do=\relax
+ \edef\@tempa{\noexpand\float@exts{\the\float@exts\float@do{\@nameuse{ext@#2}}}}%
+ \@tempa
+ \@ifundefined{float@addtolists}{%
+ \newcommand\float@addtolists[1]{%
+ \def\float@do####1{\addtocontents{####1}{##1}}\the\float@exts}%
+ \@ifundefined{@chapter}{}{\caption@PatchChapter}}{}%
+% \end{macrocode}
+% \begin{macrocode}
+ \@ifnextchar[\@@DeclareCaptionType\relax}
+\@onlypreamble\@DeclareCaptionType
+% \end{macrocode}
+% \begin{macrocode}
+\def\@@DeclareCaptionType[#1]{%
+ \KV@caption@DCT@name{#1}%
+ \@ifnextchar[\@@@DeclareCaptionType\relax}
+\@onlypreamble\@@DeclareCaptionType
+% \end{macrocode}
+% \begin{macrocode}
+\def\@@@DeclareCaptionType[#1]{%
+ \KV@caption@DCT@listname{#1}}
+\@onlypreamble\@@@DeclareCaptionType
+% \end{macrocode}
+% \begin{macrocode}
+\let\DeclareFloatingEnvironment\DeclareCaptionType % old command name
+\@onlypreamble\DeclareFloatingEnvironment
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@within@default}
+% \changes{v3.1i}{2008/04/13}{This macro added}
+% The default `within' value.
+% \begin{macrocode}
+\newcommand*\caption@within@default{\@ifundefined{c@chapter}{none}{chapter}}
+\@onlypreamble\caption@within@default
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@listof}
+% \changes{v3.1f}{2007/12/21}{This macro added}
+% |\caption@listof|\marg{float type}
+% \begin{macrocode}
+\newcommand*\caption@listof[1]{%
+ \begingroup
+ \expandafter\let\expandafter\listfigurename\csname list#1name\endcsname
+ \expandafter\let\expandafter\ext@figure\csname ext@#1\endcsname
+ \let\caption@ORI@starttoc\@starttoc
+ \renewcommand*\@starttoc[1]{%
+ \expandafter\caption@ORI@starttoc\expandafter{\ext@figure}}%
+ \listoffigures
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@typelist}
+% An \cs{@elt}-list containing the caption types defined
+% with |\Declare|\x|Caption|\x|Type|.
+% \begin{macrocode}
+\newcommand*\caption@typelist{}
+% \end{macrocode}
+% \end{macro}
+%
+% The available \meta{options} are:
+% |fileext=|\meta{file extension},
+% |listname=|\meta{list name},
+% |name=|\meta{prosa name},
+% |placement=|\meta{htbp},
+% |within=|\meta{none,chapter,section}, and
+% |without|.
+% \begin{macrocode}
+\define@key{caption@DCT}{fileext}{\@namedef{ext@\caption@type}{#1}}
+\@onlypreamble@key{caption@DCT}{fileext}
+\define@key{caption@DCT}{listname}{\@namedef{list\caption@type name}{#1}}
+\@onlypreamble@key{caption@DCT}{listname}
+\define@key{caption@DCT}{name}{\@namedef{\caption@type name}{#1}}
+\@onlypreamble@key{caption@DCT}{name}
+\define@key{caption@DCT}{placement}{\@namedef{fps@\caption@type}{#1}}
+\@onlypreamble@key{caption@DCT}{placement}
+\define@key{caption@DCT}{within}{%
+ \@ifundefined{c@chapter}{}{\@removefromreset\caption@type{chapter}}%
+ \@removefromreset\caption@type{section}%
+ \begingroup
+ \caption@setkeys[caption]{caption@within}{#1}%
+ \endgroup}
+%\@onlypreamble@key{caption@DCT}{within}
+\define@key{caption@DCT}{without}{\KV@caption@DCT@within{none}}
+%\@onlypreamble@key{caption@DCT}{without}
+% \end{macrocode}
+% \changes{v3.1k}{2009/03/29}{Bugfix 08-09-25: \texttt{within=section} fixed}
+% \begin{macrocode}
+\define@key{caption@within}{none}[]{%
+ \caption@within{}{}}
+%\@onlypreamble@key{caption@within}{none}
+\define@key{caption@within}{section}[]{%
+ \@addtoreset\caption@type{section}%
+ \caption@within{\ifnum\c@section>\z@ \thesection.\fi}{\theHsection.}}
+%\@onlypreamble@key{caption@within}{section}
+\@ifundefined{c@chapter}{}{%
+ \define@key{caption@within}{chapter}[]{%
+ \@addtoreset\caption@type{chapter}%
+ \caption@within{\ifnum\c@chapter>\z@ \thechapter.\fi}{\theHchapter.}}
+}% \@onlypreamble@key{caption@within}{chapter}}
+% \end{macrocode}
+% \begin{macro}{\caption@within}
+% \changes{v3.1f}{2007/12/21}{This macro added}
+% |\caption@within|\marg{thecode}\marg{theHcode}
+% \begin{macrocode}
+\newcommand*\caption@within{%
+ \expandafter\caption@within@\expandafter{\caption@type}}
+%\@onlypreamble\caption@within
+\newcommand*\caption@within@[3]{%
+ \global\@namedef{the#1}{#2\arabic{#1}}%
+ \@ifundefined{theH#1}\caption@AtBeginDocument\@firstofone
+ {\global\@namedef{theH#1}{#3\arabic{#1}}}}
+%\@onlypreamble\caption@within@
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@removefromreset}
+% \changes{v3.1f}{2007/12/21}{This macro added}
+% This code was taken from the \package{remreset} package
+% which is part of the `carlisle' package bundle.
+% (Copyright 1997 David Carlisle)
+% \begin{macrocode}
+\providecommand*\@removefromreset[2]{{%
+ \expandafter\let\csname c@#1\endcsname\@removefromreset
+ \def\@elt##1{%
+ \expandafter\ifx\csname c@##1\endcsname\@removefromreset
+ \else
+ \noexpand\@elt{##1}%
+ \fi}%
+ \expandafter\xdef\csname cl@#2\endcsname{%
+ \csname cl@#2\endcsname}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@PatchChapter}
+% \changes{v3.1i}{2008/08/02}{This macro added}
+% We try to patch \cs{@chapter} so \cs{float@addtolists} will be supported.
+% (Note: The \KOMAScript\ classes already support \cs{float@addtolists}.)
+% \begin{macrocode}
+\newcommand*\caption@PatchChapter{%
+ \providecommand*\@chapterlistsgap{10\p@}%
+% \end{macrocode}
+% \begin{macrocode}
+ % report.cls [2005/09/16 v1.4f Standard LaTeX document class]
+ \caption@patch@chapter{report}{%
+ \ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{chapter}%
+ \typeout{\@chapapp\space\thechapter.}%
+ \addcontentsline{toc}{chapter}%
+ {\protect\numberline{\thechapter}##1}%
+ \else
+ \addcontentsline{toc}{chapter}{##1}%
+ \fi
+ \chaptermark{##1}%
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{##2}]%
+ \else
+ \@makechapterhead{##2}%
+ \@afterheading
+ \fi
+ }{%
+ \ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{chapter}%
+ \typeout{\@chapapp\space\thechapter.}%
+ \addcontentsline{toc}{chapter}%
+ {\protect\numberline{\thechapter}##1}%
+ \else
+ \addcontentsline{toc}{chapter}{##1}%
+ \fi
+ \chaptermark{##1}%
+ \ifdim \@chapterlistsgap>\z@
+ \addtocontents{lof}{\protect\addvspace{\@chapterlistsgap}}%
+ \addtocontents{lot}{\protect\addvspace{\@chapterlistsgap}}%
+ \float@addtolists{\protect\addvspace{\@chapterlistsgap}}%
+ \fi
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{##2}]%
+ \else
+ \@makechapterhead{##2}%
+ \@afterheading
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+ % book.cls [2005/09/16 v1.4f Standard LaTeX document class]
+ \caption@patch@chapter{book}{%
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \refstepcounter{chapter}%
+ \typeout{\@chapapp\space\thechapter.}%
+ \addcontentsline{toc}{chapter}%
+ {\protect\numberline{\thechapter}##1}%
+ \else
+ \addcontentsline{toc}{chapter}{##1}%
+ \fi
+ \else
+ \addcontentsline{toc}{chapter}{##1}%
+ \fi
+ \chaptermark{##1}%
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{##2}]%
+ \else
+ \@makechapterhead{##2}%
+ \@afterheading
+ \fi
+ }{%
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \refstepcounter{chapter}%
+ \typeout{\@chapapp\space\thechapter.}%
+ \addcontentsline{toc}{chapter}%
+ {\protect\numberline{\thechapter}##1}%
+ \else
+ \addcontentsline{toc}{chapter}{##1}%
+ \fi
+ \else
+ \addcontentsline{toc}{chapter}{##1}%
+ \fi
+ \chaptermark{##1}%
+ \ifdim \@chapterlistsgap>\z@
+ \addtocontents{lof}{\protect\addvspace{\@chapterlistsgap}}%
+ \addtocontents{lot}{\protect\addvspace{\@chapterlistsgap}}%
+ \float@addtolists{\protect\addvspace{\@chapterlistsgap}}%
+ \fi
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{##2}]%
+ \else
+ \@makechapterhead{##2}%
+ \@afterheading
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+ % amsbook.cls [2004/08/06 v2.20]
+ % smfbook.cls [1999/11/15 v1.2f Classe LaTeX pour les monographies editees par la SMF]
+ \caption@patch@chapter{ams/smfbook}{%
+ \refstepcounter{chapter}%
+ \ifnum\c@secnumdepth<\z@ \let\@secnumber\@empty
+ \else \let\@secnumber\thechapter \fi
+ \typeout{\chaptername\space\@secnumber}%
+ \def\@toclevel{0}%
+ \ifx\chaptername\appendixname \@tocwriteb\tocappendix{chapter}{##2}%
+ \else \@tocwriteb\tocchapter{chapter}{##2}\fi
+ \chaptermark{##1}%
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+ \@makechapterhead{##2}\@afterheading
+ }{%
+ \refstepcounter{chapter}%
+ \ifnum\c@secnumdepth<\z@ \let\@secnumber\@empty
+ \else \let\@secnumber\thechapter \fi
+ \typeout{\chaptername\space\@secnumber}%
+ \def\@toclevel{0}%
+ \ifx\chaptername\appendixname \@tocwriteb\tocappendix{chapter}{##2}%
+ \else \@tocwriteb\tocchapter{chapter}{##2}\fi
+ \chaptermark{##1}%
+ \ifdim \@chapterlistsgap>\z@
+ \addtocontents{lof}{\protect\addvspace{\@chapterlistsgap}}%
+ \addtocontents{lot}{\protect\addvspace{\@chapterlistsgap}}%
+ \float@addtolists{\protect\addvspace{\@chapterlistsgap}}%
+ \fi
+ \@makechapterhead{##2}\@afterheading}%
+% \end{macrocode}
+% \begin{macrocode}
+ % scrreprt/scrbook.cls
+ \@ifundefined{KOMAClassName}{}{%
+ \caption@Debug{document class `\KOMAClassName' detected}%
+ \let\caption@patch@chapter\@gobblethree}%
+% \end{macrocode}
+% \begin{macrocode}
+ % rapport1/3.cls [2004/06/07 v2.1a NTG LaTeX document class]
+ \caption@patch@chapter{rapport}{%
+ \ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{chapter}%
+ \typeout{\@chapapp\space\thechapter.}%
+ \addcontentsline{toc}{chapter}%
+ {\protect\numberline{\thechapter}\toc@font0 ##1}%
+ \else
+ \addcontentsline{toc}{chapter}{\toc@font0 ##1}%
+ \fi
+ \chaptermark{##1}%
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{##2}]%
+ \else
+ \@makechapterhead{##2}%
+ \@afterheading
+ \fi
+ }{%
+ \ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{chapter}%
+ \typeout{\@chapapp\space\thechapter.}%
+ \addcontentsline{toc}{chapter}%
+ {\protect\numberline{\thechapter}\toc@font0 ##1}%
+ \else
+ \addcontentsline{toc}{chapter}{\toc@font0 ##1}%
+ \fi
+ \chaptermark{##1}%
+ \ifdim \@chapterlistsgap>\z@
+ \addtocontents{lof}{\protect\addvspace{\@chapterlistsgap}}%
+ \addtocontents{lot}{\protect\addvspace{\@chapterlistsgap}}%
+ \float@addtolists{\protect\addvspace{\@chapterlistsgap}}%
+ \fi
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{##2}]%
+ \else
+ \@makechapterhead{##2}%
+ \@afterheading
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+ % boek(3).cls [2004/06/07 v2.1a NTG LaTeX document class]
+ \caption@patch@chapter{boek}{%
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \refstepcounter{chapter}%
+ \typeout{\@chapapp\space\thechapter.}%
+ \addcontentsline{toc}{chapter}%
+ {\protect\numberline{\thechapter}\toc@font0 ##1}%
+ \else
+ \addcontentsline{toc}{chapter}{\toc@font0 ##1}%
+ \fi
+ \else
+ \addcontentsline{toc}{chapter}{\toc@font0 ##1}%
+ \fi
+ \chaptermark{##1}%
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{##2}]%
+ \else
+ \@makechapterhead{##2}%
+ \@afterheading
+ \fi
+ }{%
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \refstepcounter{chapter}%
+ \typeout{\@chapapp\space\thechapter.}%
+ \addcontentsline{toc}{chapter}%
+ {\protect\numberline{\thechapter}\toc@font0 ##1}%
+ \else
+ \addcontentsline{toc}{chapter}{\toc@font0 ##1}%
+ \fi
+ \else
+ \addcontentsline{toc}{chapter}{\toc@font0 ##1}%
+ \fi
+ \chaptermark{##1}%
+ \ifdim \@chapterlistsgap>\z@
+ \addtocontents{lof}{\protect\addvspace{\@chapterlistsgap}}%
+ \addtocontents{lot}{\protect\addvspace{\@chapterlistsgap}}%
+ \float@addtolists{\protect\addvspace{\@chapterlistsgap}}%
+ \fi
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{##2}]%
+ \else
+ \@makechapterhead{##2}%
+ \@afterheading
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+ % thesis.cls [1996/25/01 1.0g LaTeX document class (wm).]
+ \caption@patch@chapter{thesis}{%
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \refstepcounter{chapter}%
+ \typeout{\chaptername\space\thechapter.}
+ \if@thema
+ \ifx\@shortauthor\@empty
+ \addcontentsline{toc}{chapter}{%
+ \protect\numberline{\thechapter.}##1}%
+ \else
+ \addcontentsline{toc}{chapter}{%
+ \protect\numberline{\thechapter.}%
+ \@shortauthor\hfill\mbox{}\vskip\normallineskip ##1}%
+ \fi
+ \else
+ \addcontentsline{toc}{chapter}{%
+ \protect\numberline{\thechapter.}##1}%
+ \fi
+ \else
+ \addcontentsline{toc}{chapter}{##1}
+ \fi
+ \else
+ \addcontentsline{toc}{chapter}{##1}
+ \fi
+ \chaptermark{##1}
+ \addtocontents{lof}{\protect\addvspace{10pt}}
+ \addtocontents{lot}{\protect\addvspace{10pt}}
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{##2}]
+ \else
+ \@makechapterhead{##2}
+ \@afterheading
+ \fi
+ }{%
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \refstepcounter{chapter}%
+ \typeout{\chaptername\space\thechapter.}%
+ \if@thema
+ \ifx\@shortauthor\@empty
+ \addcontentsline{toc}{chapter}{%
+ \protect\numberline{\thechapter.}##1}%
+ \else
+ \addcontentsline{toc}{chapter}{%
+ \protect\numberline{\thechapter.}%
+ \@shortauthor\hfill\mbox{}\vskip\normallineskip ##1}%
+ \fi
+ \else
+ \addcontentsline{toc}{chapter}{%
+ \protect\numberline{\thechapter.}##1}%
+ \fi
+ \else
+ \addcontentsline{toc}{chapter}{##1}%
+ \fi
+ \else
+ \addcontentsline{toc}{chapter}{##1}%
+ \fi
+ \chaptermark{##1}%
+ \ifdim \@chapterlistsgap>\z@
+ \addtocontents{lof}{\protect\addvspace{\@chapterlistsgap}}%
+ \addtocontents{lot}{\protect\addvspace{\@chapterlistsgap}}%
+ \float@addtolists{\protect\addvspace{\@chapterlistsgap}}%
+ \fi
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{##2}]%
+ \else
+ \@makechapterhead{##2}%
+ \@afterheading
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+ \ifx\caption@patch@chapter\@gobblethree \else
+ \caption@Debug{%
+ Unsupported document class detected,\MessageBreak
+ or \noexpand\@chapter was redefined by another package}%
+ \fi
+ \let\caption@PatchChapter\@undefined}
+%\@onlypreamble\caption@PatchChapter
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@patch@chapter[3]{%
+ \begingroup
+% \let\if@twocolumn\iffalse
+ \let\if@mainmatter\iffalse
+ \let\if@thema\iffalse
+ \def\@tempa[##1]##2{#2}%
+ \ifx\@tempa\@chapter
+ \caption@Debug{document class `#1' detected}%
+ \gdef\@chapter[##1]##2{#3}%
+ \global\let\caption@patch@chapter\@gobblethree
+ \fi
+ \endgroup}
+%\@onlypreamble\caption@patch@chapter
+% \end{macrocode}
+% \begin{macrocode}
+\long\def \@gobblethree #1#2#3{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@stpelt}
+% We patch \cs{@stpelt} so a list of `connected' counters will be reset, too.
+% (Like \cs{stepcounter} does in |ltcounts.dtx|.)
+% \begin{macrocode}
+\newcommand*\caption@patch@stpelt{%
+ \let\caption@stpelt\@stpelt
+ \def\@stpelt##1{%
+ \caption@stpelt{##1}%
+ \begingroup
+ \let\@elt\caption@stpelt
+ \csname caption@cl@##1\endcsname
+ \endgroup}%
+ \let\caption@patch@stpelt\relax}
+\@onlypreamble\caption@patch@stpelt
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@addtoreset}
+% \changes{v3.1k}{2009/10/09}{This macro added}
+% Like \cs{@addtoreset} from |ltcounts.dtx|
+% \begin{macrocode}
+\newcommand*\caption@addtoreset[2]{%
+ \caption@patch@stpelt
+ \@ifundefined{caption@cl@#2}{\@namedef{caption@cl@#2}{}}{}%
+ \expandafter\@cons\csname caption@cl@#2\endcsname{{#1}}}
+\@onlypreamble\caption@addtoreset
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@addtoreset}
+% \changes{v3.1k}{2009/10/09}{This macro added}
+% Like \cs{@removefromreset} from |remreset.sty|
+% \begin{macrocode}
+\newcommand*\caption@removefromreset[2]{%
+ \begingroup
+ \expandafter\let\csname c@#1\endcsname\caption@removefromreset
+ \def\@elt##1{%
+ \expandafter\ifx\csname c@##1\endcsname\caption@removefromreset
+ \else
+ \noexpand\@elt{##1}%
+ \fi}%
+ \expandafter\xdef\csname caption@cl@#2\endcsname{%
+ \csname caption@cl@#2\endcsname}%
+ \endgroup}
+\@onlypreamble\caption@removefromreset
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionSubType}
+% \changes{v3.1f}{2007/11/16}{This macro added}
+% \changes{v3.1g}{2008/03/11}{Bugfix: \cs{subfigurename} will be defined now}
+% \changes{v3.1k}{2009/10/09}{Bugfix 08-10-01: Usage of \cs{caption@addtoreset} added}
+% |\DeclareCaptionSubType|\oarg{numbering scheme}\marg{type}\\
+% |\DeclareCaptionSubType*|\oarg{numbering scheme}\marg{type}\par
+% The starred variant provides the numbering format
+% \meta{type}|.|\meta{subtype} while the non-starred variant simply
+% uses \meta{subtype}.
+% \begin{macrocode}
+\newcommand*\DeclareCaptionSubType{%
+ \caption@teststar\@DeclareCaptionSubType\@firstoftwo\@secondoftwo}
+\@onlypreamble\DeclareCaptionSubType
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\@DeclareCaptionSubType[1]{%
+ \@testopt{\@@DeclareCaptionSubType{#1}}{alph}}
+\@onlypreamble\@DeclareCaptionSubType
+% \end{macrocode}
+% \begin{macrocode}
+\def\@@DeclareCaptionSubType#1[#2]#3{%
+ \@ifundefined{c@#3}%
+ {\caption@Error{No float type '#3' defined}}%
+% \end{macrocode}
+% \begin{macrocode}
+ {\@ifundefined{c@sub#3}%
+ {\caption@Debug{New subtype `sub#3'}%
+ \newcounter{sub#3}%
+ \caption@addtoreset{sub#3}{#3}%
+ \@namedef{ext@sub#3}{\csname ext@#3\endcsname}%
+ \@ifundefined{l@chapter}%
+ {\edef\@tempa{\expandafter\expandafter\expandafter\noexpand
+ \expandafter\@car\l@subsubsection\@nil}%
+ \def\@tempb{\@dottedtocline}%
+ \ifx\@tempa\@tempb % \l@subsubsection starts with \@dottedtocline
+ \expandafter\edef\csname l@sub#3\endcsname{%
+ \noexpand\@dottedtocline{2}%
+ \expandafter\expandafter\expandafter\noexpand
+ \expandafter\@gobbletwo\l@subsubsection}%
+ \else
+ \@namedef{l@sub#3}{\@dottedtocline{2}{3.8em}{3.2em}}%
+ \fi}%
+ {\expandafter\let\csname l@sub#3\endcsname\l@subsection}%
+ \@cons\caption@subtypelist{{#3}}}%
+ {\caption@Debug{Modify caption `sub#3'}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \@namedef{sub#3name}{}%
+ \@namedef{sub#3autorefname}{\csname #3name\endcsname}%
+ #1% is \@firstoftwo in star form, and \@secondoftwo otherwise
+ {\@namedef{p@sub#3}{}%
+ \@namedef{thesub#3}{\csname the#3\endcsname.\@nameuse{#2}{sub#3}}}%
+ {\@namedef{p@sub#3}{\csname the#3\endcsname}%
+ \@namedef{thesub#3}{\@nameuse{#2}{sub#3}}}%
+ \@namedef{theHsub#3}{\csname theH#3\endcsname.\arabic{sub#3}}%
+ }}
+% \end{macrocode}
+% \begin{macrocode}
+\@onlypreamble\@@DeclareCaptionSubType
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@subtypelist}
+% An \cs{@elt}-list containing the subtypes defined
+% with |\Declare|\x|Caption|\x|Sub|\x|Type|.
+% \begin{macrocode}
+\newcommand*\caption@subtypelist{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@For}
+% \changes{v3.1a}{2007/09/07}{This macro added}
+% \changes{v3.1f}{2007/11/16}{Renamed from \cs{ForFloatingEnvironments} to \cs{caption@For}}
+% |\caption@For|\marg{elt-list}\marg{code with \#1}\\
+% |\caption@For*|\marg{elt-list}\marg{code with \#1}
+% \begin{macrocode}
+\newcommand*\caption@For{\caption@withoptargs\caption@@For}
+%\@onlypreamble\caption@For
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@@For[3]{%
+ \caption@AtBeginDocument#1{%
+ \def\@elt##1{#3}%
+ \@nameuse{caption@#2}%
+ \let\@elt\relax}}%
+%\@onlypreamble\caption@@For
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{subfig package adaptions}
+% \changes{v3.1}{2007/07/07}{Several adaptions to the \package{subfig} package added}
+%
+% We have to make several adaptions to \thispackage~\version{3.1} here.
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \def\@tempa{\@ifstar\sf@@subref\sf@subref}%
+ \ifx\subref\@tempa
+ \PackageInfo{caption3}{subfig package 1.2 or 1.3 is loaded\@gobble}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@setfloattype\@gobble
+ \let\@dottedxxxline\sf@NEW@dottedxxxline
+ \let\sf@subfloat\sf@NEW@subfloat
+% \end{macrocode}
+% \begin{macrocode}
+ \fi
+ \let\sf@NEW@dottedxxxline\@undefined
+ \let\sf@NEW@subfloat\@undefined}
+% \end{macrocode}
+% \begin{macrocode}
+\def\sf@NEW@dottedxxxline#1#2#3#4#5#6#7{%
+ \begingroup
+ \caption@setfloattype{#1}%
+ \caption@setoptions{subfloat}%
+ \caption@setoptions{sub#1}%
+ \ifnum #3>\@nameuse{c@#2depth}\else
+ \@dottedtocline{\z@}{#4}{#5}{#6}{#7}%
+ \fi
+ \endgroup}
+% \end{macrocode}
+% \begin{macrocode}
+\def\sf@NEW@subfloat{%
+ \begingroup
+ \caption@setfloattype\@captype
+ \sf@ifpositiontop{%
+ \maincaptiontoptrue
+ }{%
+ \maincaptiontopfalse
+ }%
+ \caption@setoptions{subfloat}%
+ \caption@setoptions{sub\@captype}%
+ \let\sf@oldlabel=\label
+ \let\label=\subfloat@label
+ \ifmaincaptiontop\else
+ \advance\@nameuse{c@\@captype}\@ne
+ \fi
+ \refstepcounter{sub\@captype}%
+ \setcounter{sub\@captype @save}{\value{sub\@captype}}%
+ \@ifnextchar [% %] match left bracket
+ {\sf@@subfloat}%
+ {\sf@@subfloat[\@empty]}}
+% \end{macrocode}
+%
+% \iffalse
+%</kernel>
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \section{Main package}
+% \iffalse
+%<*package>
+% \fi
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesPackage{caption}[2010/01/09 v3.1m Customizing captions (AR)]
+%\@ifundefined{PackageRedefines}{}{\PackageRedefines{caption}{caption}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@Info}
+% \Note{The \cs{@gobble} at the end of the 2nd argument of
+% \cs{PackageInfo} suppresses the line number info.
+% See TLC2\cite{TLC2}, A.4.7, p885 for details.}
+% \begin{macrocode}
+\newcommand*\caption@Info[1]{\PackageInfo{caption}{#1\@gobble}}
+\@onlypreamble\caption@Info
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Loading the kernel}
+%
+% \begin{macrocode}
+\RequirePackage{caption3}[=2008/08/24] % needs v1.1j or newer
+% \end{macrocode}
+%
+% \subsection{Check against incompatible document classes}
+%
+% \begin{macrocode}
+\caption@ifbool{documentclass}{}{%
+ \caption@WarningNoLine{%
+ Unsupported document class (or package) detected,\MessageBreak
+ usage of the caption package is not recommended}%
+ \caption@Info{\string\@makecaption\space=\space\meaning\@makecaption}%
+}
+% \end{macrocode}
+%
+% \subsection{Check against incompatible packages}
+%
+% \changes{v3.0p}{2007/04/06}{Check against obsolete \package{caption2} package added}
+% \begin{macrocode}
+\@ifpackageloaded{caption2}{%
+ \caption@Error{%
+ You can't use both, the (obsolete) caption2 *and*\MessageBreak
+ the (current) caption package}%
+ \endinput
+}{}
+% \end{macrocode}
+%
+% \changes{v3.1}{2007/06/15}{Check against incompatible \package{ftcap} package added}
+% \changes{v3.1}{2007/06/15}{Check against incompatible \package{nonfloat} package added}
+% \changes{v3.1}{2007/06/18}{Check against incompatible \package{topcapt} package added}
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \@ifpackageloaded{ftcap}{\caption@DisablePositionOption{ftcap}}{}%
+ \@ifpackageloaded{nonfloat}{\caption@DisablePositionOption{nonfloat}}{}%
+ \@ifpackageloaded{topcapt}{\caption@DisablePositionOption{topcapt}}{}}
+% \end{macrocode}
+% \begin{macro}{\caption@DisablePositionOption}
+% \changes{v3.1g}{2008/03/20}{\texttt{position=b} added}
+% \changes{v3.1h}{2008/03/29}{%
+% Name changed from \cs{caption@IncompatiblePackage} to \cs{caption@DisablePositionOption};
+% moved from package to kernel; disables the `position' option now instead of issuing a warning}
+% |\caption@DisablePositionOption|\marg{package}\par
+% disables the `position' option.
+% \begin{macrocode}
+\newcommand*\caption@DisablePositionOption[1]{%
+ \caption@Info{%
+ `#1' package detected; setting `position=b' for compatibility reasons}%
+ \caption@setposition b%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionOption{position}{%
+ \caption@Error{Usage of the `position' option is incompatible\MessageBreak
+ to the `#1' package}}}
+% \end{macrocode}
+% \begin{macrocode}
+\@onlypreamble\caption@DisablePositionOption
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Declaration of options}
+%
+% \subsubsection{Options for figure and table}
+%
+% \changes{v3.0a}{2004/01/09}{Options \opt{figureposition} and \opt{tableposition} added}
+% \begin{macrocode}
+\DeclareCaptionOption{figureposition}{%
+ \captionsetup*[figure]{position=#1}}
+\@onlypreamble@key{caption}{figureposition}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{tableposition}{%
+ \captionsetup*[table]{position=#1}}
+\@onlypreamble@key{caption}{tableposition}
+% \end{macrocode}
+%
+% \changes{v3.0d}{2004/08/03}{Options \opt{figurename} and \opt{tablename} added}
+% \changes{v3.1}{2007/07/04}{Options \opt{figurename} and \opt{tablename} re-written}
+% \changes{v3.1f}{2007/11/18}{Options \opt{figurename} and \opt{tablename} are now
+% available after the document preamble, too.}
+% \changes{v3.1f}{2007/11/18}{Option \opt{name} added}
+% \begin{macrocode}
+\DeclareCaptionOption{figurename}{\caption@SetName{figure}{#1}}
+\DeclareCaptionOption{tablename}{\caption@SetName{table}{#1}}
+\DeclareCaptionOption{name}{\caption@setname\@captype{#1}}
+% \end{macrocode}
+%
+% \changes{v3.1g}{2008/02/28}{Options \opt{listfigurename} and \opt{listtablename} added}
+% \begin{macrocode}
+\DeclareCaptionOption{listfigurename}{\caption@SetName{listfigure}{#1}}
+\DeclareCaptionOption{listtablename}{\caption@SetName{listtable}{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@SetName}
+% \changes{v3.1}{2007/07/04}{This macro added}
+% \changes{v3.1f}{2007/11/18}{After-preamble variant added}
+% \changes{v3.1g}{2008/02/28}{Renamed from \cs{caption@SetFloatName} to \cs{caption@SetName}}
+% \changes{v3.1i}{2008/08/02}{Bugfix: Works now without \cs{addto}, too}
+% |\caption@SetName|\marg{cmd}\marg{value}
+% \begin{macrocode}
+\newcommand*\caption@SetName[2]{%
+ \caption@setname{#1}{#2}%
+ \begingroup
+ \@ifundefined{languagename}{}{%
+ \@ifundefined{captions\languagename}{}{%
+ \expandafter\g@addto@macro\csname captions\languagename\endcsname
+ {\caption@setname{#1}{#2}}}}%
+ \endgroup}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setname[2]{\@namedef{#1name}{#2}}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@AtBeginDocument{\let\caption@SetName\caption@setname}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.1f}{2007/12/21}{Options \opt{figurewithin} and \opt{tablewithin} added}
+% \changes{v3.1i}{2008/04/13}{Option \opt{within} added}
+% \changes{v3.1l}{2010/01/09}{The \opt{within} options are now available within the document, too}
+% \changes{v3.1l}{2010/01/09}{The global \opt{within} option will now affect user-defined floats
+% declared with \cs{DeclareCaptionType}, too}
+%
+% \begin{macro}{\caption@DeclareWithinOption}
+% \changes{v3.1l}{2010/01/09}{This macro and its usage added}
+% \begin{macrocode}
+\newcommand*\caption@DeclareWithinOption[1]{%
+ \DeclareCaptionOption{#1within}{\caption@Within{#1}{##1}}%
+ \DeclareCaptionOption{#1without}{\caption@Within{#1}{none}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\caption@DeclareWithinOption{figure}
+\caption@DeclareWithinOption{table}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{within}{%
+ \@ifundefined{c@figure}{}{\caption@Within{figure}{#1}}%
+ \@ifundefined{c@table}{}{\caption@Within{table}{#1}}%
+ \caption@For{typelist}{\caption@Within{##1}{#1}}%
+ \def\caption@within@default{#1}}
+\DeclareCaptionOption{without}{\KV@caption@within{none}}
+% \end{macrocode}
+% \begin{macro}{\caption@within}
+% \changes{v3.1}{2007/12/21}{This macro added}
+% \begin{macrocode}
+\newcommand*\caption@Within[1]{\def\caption@type{#1}\KV@caption@DCT@within}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Miscellaneous options}
+%
+% \begin{macrocode}
+\DeclareCaptionOption*{config}[caption]{%
+ \InputIfFileExists{#1.cfg}%
+ {\typeout{*** Local configuration file #1.cfg used ***}}%
+ {\caption@Warning{Configuration file #1.cfg not found}}}
+% \end{macrocode}
+%
+% \changes{v3.1f}{2007/11/28}{Option \opt{@minipage=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{@minipage}{%
+ \caption@ifinlist{#1}{auto,default}%
+ {\let\caption@if@minipage\@gobbletwo}%
+ {\caption@set@bool\caption@if@minipage{#1}}}
+\captionsetup{@minipage=default}
+% \end{macrocode}
+%
+% \subsubsection{caption v1.x compatibility options}
+% \changes{v3.1}{2007/07/21}{Option `compatibility' added}
+% \changes{v3.1}{2007/09/01}{caption v1.x compatibility options revised}
+% \changes{v3.1d}{2007/10/24}{Bugfix 07-10-24 in caption v1.x$ compatibility options}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{compatibility}[1]{\caption@setbool{compatibility}{#1}}
+\@onlypreamble@key{caption}{compatibility}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{normal}{%
+ \caption@setformat{plain}%
+ \caption@setjustification{justified}}
+\DeclareCaptionOptionNoValue*{isu}{%
+ \caption@setformat{hang}%
+ \caption@setjustification{justified}}
+\DeclareCaptionOptionNoValue*{hang}{%
+ \caption@setformat{hang}%
+ \caption@setjustification{justified}}
+\DeclareCaptionOptionNoValue*{center}{%
+ \caption@setformat{plain}%
+ \caption@setjustification{centering}}
+\DeclareCaptionOptionNoValue*{anne}{%
+ \caption@setformat{plain}%
+ \caption@setjustification{centerlast}}
+\DeclareCaptionOptionNoValue*{centerlast}{%
+ \caption@setformat{plain}%
+ \caption@setjustification{centerlast}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{scriptsize}{\def\captionfont{\scriptsize}}
+\DeclareCaptionOptionNoValue*{footnotesize}{\def\captionfont{\footnotesize}}
+\DeclareCaptionOptionNoValue*{small}{\def\captionfont{\small}}
+\DeclareCaptionOptionNoValue*{normalsize}{\def\captionfont{\normalsize}}
+\DeclareCaptionOptionNoValue*{large}{\def\captionfont{\large}}
+\DeclareCaptionOptionNoValue*{Large}{\def\captionfont{\Large}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{up}{\l@addto@macro\captionlabelfont\upshape}
+\DeclareCaptionOptionNoValue*{it}{\l@addto@macro\captionlabelfont\itshape}
+\DeclareCaptionOptionNoValue*{sl}{\l@addto@macro\captionlabelfont\slshape}
+\DeclareCaptionOptionNoValue*{sc}{\l@addto@macro\captionlabelfont\scshape}
+\DeclareCaptionOptionNoValue*{md}{\l@addto@macro\captionlabelfont\mdseries}
+\DeclareCaptionOptionNoValue*{bf}{\l@addto@macro\captionlabelfont\bfseries}
+\DeclareCaptionOptionNoValue*{rm}{\l@addto@macro\captionlabelfont\rmfamily}
+\DeclareCaptionOptionNoValue*{sf}{\l@addto@macro\captionlabelfont\sffamily}
+\DeclareCaptionOptionNoValue*{tt}{\l@addto@macro\captionlabelfont\ttfamily}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{nooneline}{\caption@setbool{slc}{0}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\caption@setbool{ruled}{0}
+\DeclareCaptionOptionNoValue*{ruled}{\caption@setbool{ruled}{1}}
+% \end{macrocode}
+%
+% \subsubsection{caption2 v2.x compatibility options}
+% \changes{v3.0h}{2005/07/08}{caption2 \version{2.x} compatibility options added}
+% \changes{v3.1}{2007/09/01}{caption2 v2.x compatibility options revised}
+% \changes{v3.1d}{2007/10/24}{Bugfix 07-10-24 in caption v2.x$ compatibility options}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{flushleft}{%
+ \caption@setformat{plain}%
+ \caption@setjustification{raggedright}}
+\DeclareCaptionOptionNoValue*{flushright}{%
+ \caption@setformat{plain}%
+ \caption@setjustification{raggedleft}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{oneline}{\caption@setbool{slc}{1}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{ignoreLTcapwidth}{%
+ \caption@WarningNoLine{Obsolete option `ignoreLTcapwidth' ignored}}
+% \end{macrocode}
+%
+% \subsubsection{Obsolete caption v3.0 options}
+% \changes{v3.1}{2007/05/07}{Package option \opt{caption} marked as obsolete,
+% gives error now}
+%
+% \begin{macrocode}
+\DeclareCaptionOption*{caption}{%
+ \caption@setbool{temp}{#1}%
+ \caption@ifbool{temp}{}{%
+ \caption@Error{%
+ The package option `caption=#1' is obsolete.\MessageBreak
+ Please pass this option to the subfig package instead\MessageBreak
+ and do *not* load the caption package anymore}}}
+% \end{macrocode}
+%
+% \subsubsection{fltpage package support options}
+%
+% \changes{v3.1}{2007/09/01}{Options `FPlist' \& `FPref' added}
+% With these options is controlled where the list-of entry and |\ref| resp.
+% |\pageref| or |\autoref| will link to.
+% Defaults are |FPlist=caption| and |FPref=figure| which is inconsistent,
+% but compatible to the usual behaviour of the \package{fltpage} package.
+% \begin{macrocode}
+\DeclareCaptionOption{FPlist}[1]{\caption@setFPoption{list}{#1}}
+\DeclareCaptionOption{FPref}[1]{\caption@setFPoption{ref}{#1}}
+\@onlypreamble@key{caption}{FPlist}
+\@onlypreamble@key{caption}{FPref}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setFPoption[2]{%
+ \edef\caption@tempa{\@car#2\@nil}%
+ \caption@setbool{FP#1cap}{\if c\caption@tempa 1\else 0\fi}}
+\@onlypreamble\caption@setFPoption
+% \end{macrocode}
+% \begin{macrocode}
+\captionsetup{FPlist=caption,FPref=figure}
+% \end{macrocode}
+%
+% \subsubsection{hyperref package support options}
+%
+% \changes{v3.1}{2007/06/21}{Options `hypcap' \& `hypcapspace' added}
+% With |hypcap=off| one can turn the \package{hypcap} support off
+% (default is |on|).
+% \begin{macrocode}
+\DeclareCaptionOption{hypcap}[1]{\caption@setbool{hypcap}{#1}}
+\DeclareCaptionOption{hypcapspace}{\def\caption@hypcapspace{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\captionsetup{hypcap=1,hypcapspace=.5\baselineskip}
+% \end{macrocode}
+%
+% \subsection{\AmS{} \& \SmF{} document classes support}
+% \changes{v3.1}{2007/07/29}{\AmS\ \& \SmF\ document classes support added (package)}
+%
+% \begin{macrocode}
+\caption@ifamsclass{%
+ \caption@Info{AMS or SMF document class}%
+% \end{macrocode}
+% \begin{macrocode}
+ \setlength\belowcaptionskip{0pt}% set to 12pt by AMS class
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsection{\KOMAScript{} document classes support}
+% \changes{v3.0a}{2004/01/18}{Minimum adaptation to \KOMAScript\ added (package)}
+% \changes{v3.0h}{2005/08/22}{\KOMAScript\ compatibility options added (package)}
+% \changes{v3.0i}{2005/11/17}{\KOMAScript\ compatibility commands added (package)}
+% \changes{v3.0l}{2007/02/18}{\KOMAScript\ compatibility revised (package)}
+% \changes{v3.1}{2007/03/17}{\KOMAScript\ compatibility options removed (package)}
+% \changes{v3.1}{2007/04/05}{\KOMAScript\ compatibility revised \& enhanced (package)}
+%
+% \begin{macrocode}
+\caption@ifkomaclass{%
+ \caption@Info{KOMA-Script document class}%
+% \end{macrocode}
+%
+% Here we emulate the caption related commands and take over the caption
+% related settings from the \KOMAScript\ classes.
+%
+% \begin{macro}{\@tablecaptionabovetrue}
+% \begin{macro}{\@tablecaptionabovefalse}
+% \changes{v3.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
+% \begin{macrocode}
+ \g@addto@macro\@tablecaptionabovetrue{\captionsetup*[table]{position=t}}
+ \g@addto@macro\@tablecaptionabovefalse{\captionsetup*[table]{position=b}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+ \if@tablecaptionabove
+ \@tablecaptionabovetrue
+ \else
+ \@tablecaptionabovefalse
+ \fi
+% \end{macrocode}
+%
+% \begin{macro}{\onelinecaptionstrue}
+% \begin{macro}{\onelinecaptionsfalse}
+% \changes{v3.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
+% \begin{macrocode}
+ \g@addto@macro\onelinecaptionstrue{\let\caption@ifslc\@firstoftwo}
+ \g@addto@macro\onelinecaptionsfalse{\let\caption@ifslc\@secondoftwo}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+ \ifonelinecaptions
+ \onelinecaptionstrue
+ \else
+ \onelinecaptionsfalse
+ \fi
+% \end{macrocode}
+%
+% \begin{macro}{\@captionabovetrue}
+% \begin{macro}{\@captionabovefalse}
+% \changes{v3.0j}{2006/03/21}{Bugfix 06-03-21:
+% \cs{let}\cs{caption@setposition}\cs{@gobble} added}
+% \changes{v3.0n}{2006/03/09}{Accidentally this got broken in \version{3.0m}, fixed}
+% \changes{v3.1}{2007/03/31}{We redefine \cs{captionabovetrue/false} now
+% instead of \cs{captionabove/below}}
+% \changes{v3.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
+% \changes{v3.1k}{2009/10/09}{\opt{figureposition} and \opt{tableposition} will issue a warning now}
+% Please note that these are stronger than the \opt{position} setting, therefore we
+% override the options \opt{figureposition} and \opt{tableposition} to typeout a warning.
+% \begin{macrocode}
+ \g@addto@macro\@captionabovetrue{\let\caption@position\@firstoftwo}
+ \g@addto@macro\@captionabovefalse{\let\caption@position\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionOption{figureposition}{%
+ \caption@WarningNoLine{Option `figureposition=#1' has no effect\MessageBreak
+ when used with a KOMA script document class}}
+ \DeclareCaptionOption{tableposition}{%
+ \caption@WarningNoLine{Option `tableposition=#1' has no effect\MessageBreak
+ when used with a KOMA script document class}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\setcapindent}
+% \begin{macrocode}
+ \let\caption@KOMA@setcapindent\@setcapindent
+ \renewcommand*\@setcapindent[1]{%
+ \caption@KOMA@setcapindent{#1}\caption@setcapindent}
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@KOMA@@setcapindent\@@setcapindent
+ \renewcommand*\@@setcapindent[1]{%
+ \caption@KOMA@@setcapindent{#1}\caption@setcapindent}
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\caption@setcapindent{%
+ \captionsetup{indent=\ifdim\cap@indent<\z@\z@\else\cap@indent\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \@ifundefined{cap@indent}{}{\caption@setcapindent}
+% \end{macrocode}
+%
+% \begin{macro}{\setcapwidth}
+% \Note{The optional argument of \cs{setcapwidth} if not supported (yet),
+% so we issue a warning if used.
+% (Since this does not seem to have an negative effect when used
+% by the \texttt{captionbeside} environment, we suppress the warning here.)}
+% \begin{macrocode}
+ \expandafter\let\expandafter\caption@KOMA@setcapwidth
+ \csname\string\setcapwidth\endcsname
+ \@namedef{\string\setcapwidth}[#1]#2{%
+ \caption@KOMA@setcapwidth[#1]{#2}\caption@setcapwidth{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\caption@setcapwidth[1]{%
+ \ifx\\#1\\\else
+ \@ifundefined{cap@margin}{}{%
+ \def\@tempa{captionbeside}%
+ \ifx\@tempa\@currenvir\else\caption@Warning{%
+ Ignoring optional argument [#1] of \string\setcapwidth\MessageBreak}%
+ \fi}%
+ \fi
+ \captionsetup{width=\cap@width}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \def\caption@tempa{\hsize}%
+ \ifx\caption@tempa\cap@width \else
+ \caption@setcapwidth{?}
+ \fi
+% \end{macrocode}
+%
+% \begin{macro}{\setcapmargin}
+% \begin{macrocode}
+ \expandafter\let\expandafter\caption@KOMA@setcapmargin
+ \csname\string\@setcapmargin\endcsname
+ \@namedef{\string\@setcapmargin}[#1]#2{%
+ \caption@KOMA@setcapmargin[#1]{#2}\caption@setcapmargin}
+% \end{macrocode}
+% \begin{macrocode}
+ \expandafter\let\expandafter\caption@KOMA@@setcapmargin
+ \csname\string\@@setcapmargin\endcsname
+ \@namedef{\string\@@setcapmargin}[#1]#2{%
+ \caption@KOMA@@setcapmargin[#1]{#2}\caption@setcapmargin}
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\caption@setcapmargin{%
+ \begingroup
+ \let\onelinecaptionsfalse\relax
+ \def\@twoside{0}%
+ \def\if@twoside{\def\@twoside{1}\iffalse}%
+ \cap@margin
+ \def\@tempa{\endgroup}%
+ \ifx\cap@left\hfill\else\ifx\cap@right\hfill\else
+ \def\hspace##1##{\@firstofone}%
+ \edef\@tempa{\endgroup
+ \noexpand\captionsetup{%
+ twoside=\@twoside,slc=0,%
+ margin={\cap@left,\cap@right}}}%
+ \fi\fi
+ \@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \ifx\cap@margin\relax \else
+ \caption@setcapmargin
+ \fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsection{Processing of options}
+%
+% \changes{v3.0m}{2007/03/04}{Verbose option added (package)}
+% \changes{v3.1}{2007/07/02}{Verbose option removed from package}
+%
+% \changes{v3.1}{2007/03/17}{We do not process global options anymore}
+% \begin{macrocode}
+\caption@ProcessOptions*{caption}
+% \end{macrocode}
+%
+% \subsection{\cs{captionof} and \cs{captionlistentry}}
+%
+% \changes{v3.0d}{2004/08/03}{Option \opt{type=} added}
+% \changes{v3.1}{2007/06/25}{Option \opt{type*=} added}
+% \changes{v3.1f}{2007/11/16}{Option \opt{subtype} \& \opt{subtype*} added}
+%
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionOption{type}{\caption@settype{#1}}%
+ \DeclareCaptionOption{type*}{\caption@settype*{#1}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionOption{subtype}[sub\@captype]{\caption@setsubtype{#1}}%
+ \DeclareCaptionOption{subtype*}[sub\@captype]{\caption@setsubtype*{#1}}%
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \emph{Important Note:}
+% Like |\captionof| the option |type=| should only be used inside a
+% group, box, or environment and does not check if the argument is a valid
+% floating environment or not.
+%
+% \begin{macro}{\caption@settype}
+% \changes{v3.1}{2007/05/09}{This macro added}
+% \changes{v3.1b}{2007/09/22}{Usage of \cs{caption@xlabel} added}
+% \changes{v3.1d}{2007/10/23}{Error message for \cs{caption@checkgrouplevel} revised}
+% \changes{v3.1f}{2007/11/16}{\cs{caption@setsubtype} added}
+% \changes{v3.1f}{2007/12/03}{Crappy \cs{caption@iftypewarning} replaced}
+% \changes{v3.1g}{2008/01/12}{Usage of \cs{ifcaptionsetup@star} added}
+% |\caption@settype*|\marg{type}\par
+% sets |\@captype| and executes the options associated with it
+% (using |\caption@setoptions|).
+% Furthermore we check |\currentgrouplevel| (if avail),
+% redefine |\@currentlabel| so a |\label| before |\caption| will result
+% in a hint instead of a wrong reference, and
+% use the macro |\caption@|(|sub|)|typehook| (which will be used by our
+% \package{float} package support).\par
+% The non-starred version sets a \package{hyperref} anchor additionally
+% (if |hypcap=true| and the \package{hypcap} package is not loaded).
+% \begin{macrocode}
+\newcommand*\caption@settype{%
+ \caption@@settype{}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setsubtype{%
+ \caption@iftype
+ {\caption@@settype{sub}}%
+ {\caption@Error{Option `subtype=' outside float}}}%
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@settype[1]{%
+ \caption@teststar{\caption@@@settype{#1}}\@firstoftwo\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@settype[3]{%
+% #1 = "" or "sub"
+% #2 = \@firstoftwo in star form, \@secondoftwo otherwise
+% #3 = <type>, e.g. "figure" or "table"
+ \@ifundefined{c@#3}%
+ {\caption@Error{No float type '#3' defined}}%
+ {\caption@Debug{#1type=#3}%
+ \caption@checkgrouplevel{#1}{%
+ \captionsetup{#1type#2*\@empty=...}#2{ or
+ \@backslashchar#1captionof}{}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \edef\caption@tempa{#3}%
+ \expandafter\ifx\csname @#1captype\endcsname\caption@tempa \else
+ \ifcaptionsetup@star\else\@nameuse{caption@#1type@warning}\fi
+ \fi
+ \expandafter\let\csname @#1captype\endcsname\caption@tempa
+% \end{macrocode}
+% \begin{macrocode}
+ \@nameuse{caption@#1typehook}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@setoptions{#3}%
+ \ifx\caption@opt\relax
+ \@nameundef{caption@#1type@warning}%
+ \else
+ \@namedef{caption@#1type@warning}{\caption@Warning{%
+ The #1caption type was already set to
+ `\csname @#1captype\endcsname'\MessageBreak}}%
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@ifrefstepcounter\@secondoftwo
+ #2{}{%
+ \let\@currentlabel\caption@undefinedlabel
+% \let\@currentHlabel\@undefined
+ \ifx\caption@ORI@label\@undefined
+ \let\caption@ORI@label\label
+ \let\label\caption@xlabel
+ \fi
+ \caption@start}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@typehook}
+% Hook, will be extended later on, e.g.~by our \package{float} package
+% support.
+% \begin{macrocode}
+\newcommand*\caption@typehook{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@iftype}
+% \changes{v3.1}{2007/04/11}{This macro and its usage added}
+% Since we often need to check if |\@captype| is defined (means: we
+% are inside a floating environment) this helper macro was introduced.
+% \begin{macrocode}
+\newcommand*\caption@iftype{%
+ \@ifundefined{@captype}{\let\@captype\@undefined\@secondoftwo}\@firstoftwo}
+% \end{macrocode}
+% \iffalse
+% \newcommand*\caption@iftype{%
+% \begingroup
+% \@ifundefined{@captype}%
+% {\aftergroup\@secondoftwo}%
+% {\aftergroup\@firstoftwo}%
+% \endgroup}
+% \fi
+% \end{macro}
+%
+% \begin{macro}{\caption@checkgrouplevel}
+% \changes{v3.1}{2007/07/15}{This macro and its usage added}
+% \changes{v3.1f}{2007/11/28}{Error changed to warning (compatibility)}
+% Checks if |\captionsetup{type=|\ldots|}| or |\caption| is done
+% inside a group or not -- in the latter case a warning message will
+% be issued. (needs \eTeX)
+% \begin{macrocode}
+\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}
+ \newcommand*\caption@checkgrouplevel[2]{%
+ \@ifundefined{#1caption@grouplevel}{%
+ \@ifundefined{caption@grouplevel}{\let\caption@grouplevel\z@}{}%
+ \ifnum\currentgrouplevel>\caption@grouplevel\relax
+ \expandafter\edef\csname #1caption@grouplevel\endcsname{%
+ \the\currentgrouplevel}%
+ \else
+ \caption@Warning{\string#2\MessageBreak outside box or environment}%
+ \fi
+ }{}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@undefinedlabel}
+% \changes{v3.1}{2007/07/03}{This macro and its usage added}
+% \changes{v3.1b}{2007/09/22}{Contents changed to \texttt{??}}
+% \changes{v3.1i}{2008/04/13}{Contents changed to \cs{caption@xref}(\ldots)}
+% \changes{v3.1k}{2009/03/30}{Bugfix 08-12-08: \cs{caption@xref} is robust now}
+% This label will be used for |\currentlabel| inside (floating) environments
+% as default. (see above)
+% \iffalse\Note{All commands used have to be robust here.}\fi
+% \begin{macrocode}
+\newcommand*\caption@undefinedlabel{%
+ \protect\caption@xref{\caption@labelname}{\on@line}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareRobustCommand*\caption@xref[2]{%
+ \caption@WarningNoLine{\noexpand\label before \string\caption#2}%
+ \@setref\relax\@undefined{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@labelname{??}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@xlabel}
+% \changes{v3.1b}{2007/09/22}{This macro and its usage added}
+% \changes{v3.1f}{2007/11/11}{Revised}
+% \changes{v3.1i}{2008/04/13}{Bugfix: \cs{pageref} should always work now}
+% The new code of |\label| inside floating environments.
+% |\label| will be redefined using |\caption@withoptargs|, so
+% |#1| are the optional arguments (if any), and
+% |#2| is the mandatory argument here.
+% \begin{macrocode}
+\newcommand*\caption@xlabel[1]{%
+ \caption@@xlabel
+ \def\caption@labelname{#1}%
+ \caption@ORI@label{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@xlabel{%
+ \global\let\caption@@xlabel\@empty
+ \@bsphack
+ \protected@write\@auxout{}%
+ {\string\providecommand*\string\caption@xref[2]{%
+ \string\@setref\string\relax\string\@undefined{\string##1}}}%
+ \@esphack}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionof}
+% \changes{v3.1}{2007/05/09}{Uses \cs{caption@settype} instead of \cs{def}\cs{@captype}}
+% \changes{v3.1c}{2007/09/22}{Bugfix: Redefinition of \cs{caption@setfloatcapt} removed}
+% \changes{v3.1e}{2007/10/30}{Better compatibility: Will be defined with \cs{AtBeginDocument} now}
+% |\captionof|\marg{type}\oarg{lst\_entry}\marg{heading}\\
+% |\captionof*|\oarg{lst\_entry}\marg{heading}\par
+% \Note{This will be defined with \cs{AtBeginDocument} so
+% \cs{usepackage}\csmarg{caption,capt-of} will still work.
+% (Compatibility to \version{1.x})}
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \def\captionof{\caption@teststar\caption@of{\caption*}\caption}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@of[2]{\caption@settype*{#2}#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionlistentry}
+% \changes{v3.1}{2007/07/28}{This macro added}
+% \changes{v3.1f}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% \changes{v3.1g}{2008/01/20}{Starred variant added}
+% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% |\captionlistentry|\oarg{float type}\marg{list entry}\\
+% |\captionlistentry*|\oarg{float type}\marg{list entry}
+% \begin{macrocode}
+\newcommand*\captionlistentry{%
+ \caption@teststar\@captionlistentry\@firstoftwo\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\@captionlistentry[1]{%
+ \@testopt{\caption@listentry{#1}}\@captype}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@listentry#1[#2]#3{%
+ \@bsphack
+ #1{\caption@gettitle{#3}}%
+ {\caption@refstepcounter{#2}%
+ \caption@makecurrent{#2}{#3}}%
+ \caption@addcontentsline{#2}{#3}%
+ \@esphack}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{ContinuedFloat}}
+%
+% \begin{macro}{\ContinuedFloat}
+% \changes{v3.0f}{2005/06/11}{%
+% Call of \cs{caption@ContinuedFloat} added}
+% \changes{v3.0i}{2005/11/12}{%
+% Optional argument and call of \cs{caption@@ContinuedFloat} added}
+% \changes{v3.0g}{2005/06/28}{%
+% Bugfix: \cs{newcounter} replaced by \cs{newcount}}
+% \changes{v3.1}{2007/07/02}{Format of \package{hyperref} extension changed}
+% \changes{v3.1}{2007/07/07}{\cs{caption@setoptions} added}
+% \changes{v3.1g}{2008/01/29}{Starred variant and hook \cs{sf@ContinuedFloat} added}
+% |\ContinuedFloat|\\
+% |\ContinuedFloat*|\par
+% This mainly decrements the appropriate counter and increments the
+% continuation counter instead.
+% Furthermore we set |\caption@resetContinuedFloat| to |\@gobble| so the
+% continuation counter will not be reset to zero inside |\caption@refstepcounter|.
+% Please forget about the optional argument, it was never working well, is
+% incompatible to the \package{subfig} package, but is still there for
+% compatibility reasons.
+% \Note{The definition of \cs{ContinuedFloat} itself is compatible
+% to the one inside the \package{subfig} package, except for the
+% starred variant and the optional argument.}
+% When the \package{hyperref} package is used we have the problem
+% that the usage of |\ContinuedFloat| will create duplicate
+% hyper links -- |\@currentHref| will be the same for the main float and
+% the continued ones. So we have to make sure unique labels and references
+% will be created each time. We do this by extending |\theHfigure| and
+% |\theHtable|, so for continued floats the scheme
+% \begin{quote}\meta{type}|.|\meta{type \#}|\alph{|\meta{continued \#}|}|\end{quote}
+% will be used instead of
+% \begin{quote}\meta{type}|.|\meta{type \#}\quad\quad.\end{quote}
+% \par{\small(This implementation follows an idea from Steven Douglas Cochran.)}
+% \Note{This does not help if the \package{hyperref} package option
+% \texttt{naturalnames=true} is set.}
+% \begin{macrocode}
+\def\ContinuedFloat{%
+ \@ifnextchar[\@Continued@Float\@ContinuedFloat}
+% \end{macrocode}
+% \begin{macrocode}
+\def\@Continued@Float[#1]{\addtocounter{#1}\m@ne}
+% \end{macrocode}
+% \begin{macrocode}
+\def\@ContinuedFloat{%
+ \caption@iftype
+ {\addtocounter\@captype\m@ne
+ \caption@ContinuedFloat\@captype}%
+ {\caption@Error{\noexpand\ContinuedFloat outside float}}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@ContinuedFloat#1{%
+ \@ifstar{\caption@Continued@Float@{#1}}{\caption@Continued@Float{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@Continued@Float@{%
+ \addtocounter\@captype\@ne
+ \@stpelt{ContinuedFloat}\stepcounter{ContinuedFloat}%
+ \def\caption@resetContinuedFloat##1{\xdef\caption@CFtype{##1}}%
+ \caption@@ContinuedFloat}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@Continued@Float#1{%
+ \edef\caption@tempa{#1}%
+ \ifx\caption@tempa\caption@CFtype
+ \stepcounter{ContinuedFloat}%
+ \let\caption@resetContinuedFloat\@gobble
+ \caption@@ContinuedFloat{#1}%
+ \sf@ContinuedFloat{#1}%
+ \else
+ \caption@Error{Continued `#1' after `\caption@CFtype'}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@ContinuedFloat#1{%
+ \expandafter\l@addto@macro\csname the#1\endcsname\theContinuedFloat
+ \@ifundefined{theH#1}{}{%
+ \expandafter\l@addto@macro\csname theH#1\endcsname{%
+ \@alph\c@ContinuedFloat}}%
+ \caption@setoptions{ContinuedFloat}%
+ \caption@setoptions{continued#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\sf@ContinuedFloat[1]{}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@CFtype{??}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\theContinuedFloat}
+% Its preset to \cs{@empty}, so usually the continuation counter is not
+% included in the caption label or references.
+% \begin{macrocode}
+\newcounter{ContinuedFloat}
+\let\theContinuedFloat\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@resetContinuedFloat}
+% |\caption@resetContinuedFloat|\marg{type}\par
+% If a continuation counter is defined, we reset it.
+% (This one will be called inside |\@caption|.)
+% \begin{macrocode}
+\newcommand*\caption@resetContinuedFloat[1]{%
+ \@stpelt{ContinuedFloat}\xdef\caption@CFtype{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Internal helpers}
+%
+% \begin{macro}{\caption@refstepcounter}
+% \changes{v3.1}{2007/07/28}{This macro added}
+% Resets the continuation counter, increments the float (i.e. |figure| or
+% |table|) counter, and sets the |refstepcounter| flag.
+% \begin{macrocode}
+\newcommand*\caption@refstepcounter[1]{%
+ \caption@resetContinuedFloat{#1}%
+ \caption@@refstepcounter{#1}%
+ \let\caption@ifrefstepcounter\@firstoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@refstepcounter{\refstepcounter}
+\let\caption@ifrefstepcounter\@secondoftwo
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@dblarg}
+% \changes{v3.1}{2007/02/05}{This macro added}
+% \changes{v3.1f}{2007/12/06}{Bugfix 07-12-06: Changed so it works without \cs{kernel@ifnextchar}
+% (which was introduced in \LaTeXe\ 2004/01/23), too}
+% A |\relax| was added compared to |\@dblarg| so |\caption{}| will be
+% expanded to |\caption[\relax]{}| (and not to |\caption[]{}|).
+% \begin{macrocode}
+\@ifundefined{kernel@ifnextchar}%
+ {\newcommand\caption@dblarg[1]{\@ifnextchar[{#1}{\caption@xdblarg{#1}}}}%
+ {\newcommand\caption@dblarg[1]{\kernel@ifnextchar[{#1}{\caption@xdblarg{#1}}}}%
+\newcommand\caption@xdblarg[2]{#1[{#2\relax}]{#2}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@begin}
+% \changes{v3.0a}{2004/01/23}{\cs{caption@settype} changed to \cs{caption@setfloattype}}
+% \changes{v3.0e}{2005/04/12}{Check for default label format added}
+% \changes{v3.0f}{2005/06/11}{Usage of \cs{caption@resetContinuedFloat} added}
+% \changes{v3.1}{2007/05/09}{Usage of \cs{caption@setfloattype} \&
+% \cs{caption@resetContinuedFloat} removed}
+% Our handling of |\caption| will always be surrounded by
+% |\caption@begin| (or |\caption@beginex|) and |\caption@end|.\par
+% |\caption@begin|\marg{type} performs these tasks:
+% \begin{enumerate}
+% \item[1.] Start a new group.
+% \item[2.] Define |\fnum@|\meta{type} if the caption label format is set
+% to non-default.
+% \item[3.] Override the |position=| setting, if necessary.
+% (for example if set to |auto| or used inside a |supertabular|)
+% \end{enumerate}
+% \begin{macrocode}
+\newcommand*\caption@begin[1]{%
+ \begingroup
+ \caption@setfnum{#1}%
+ \caption@fixposition
+ \global\let\caption@fixedposition\caption@position}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@beginex}
+% \changes{v3.0b}{2004/05/16}{Support of \opt{listof=} added}
+% \changes{v3.0l}{2007/02/04}{Takes now 3 args instead of 2, check for empty heading added}
+% \changes{v3.1}{2007/07/01}{Makes lst-entry now instead of redefining \cs{addcontentsline}}
+% |\caption@beginex|\marg{type}\marg{list entry}\marg{heading}\par
+% performs the same tasks as |\caption@begin| and additionally:
+% \begin{enumerate}
+% \item[4.] Make an entry in the list-of-whatever.
+% \item[5.] Set |\caption@ifempty| according argument \meta{heading}.
+% \end{enumerate}
+% \begin{macrocode}
+\newcommand\caption@beginex[3]{%
+ \caption@begin{#1}%
+ \caption@addcontentsline{#1}{#2}%
+ \caption@ifempty{#3}{}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@end}
+% |\caption@end| closes the group.
+% \begin{macrocode}
+\newcommand*\caption@end{%
+ \endgroup
+ \let\caption@position\caption@fixedposition}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0a}{2004/01/23}{%
+% Internal hooks \cs{caption@@begin} \& \cs{caption@@end} added}
+% \changes{v3.0h}{2005/10/06}{%
+% Internal hooks \cs{caption@@begin} \& \cs{caption@@end} removed}
+%
+% \begin{macro}{\caption@setfnum}
+% \changes{v3.1}{2007/03/10}{This macro added}
+% |\caption@setfnum|\marg{type}\\
+% redefines |\fnum@|\meta{type} according the caption label format
+% set with |labelformat=|. But if |labelformat=default| is set,
+% |\fnum@|\meta{type} will not be overwritten by us.
+% \begin{macrocode}
+\newcommand*\caption@setfnum[1]{%
+ \@ifundefined{fnum@#1}{\iftrue}{\ifx\caption@lfmt\caption@lfmt@default\else}%
+ \@namedef{fnum@#1}{\caption@fnum{#1}}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@boxrestore}
+% \changes{v3.1}{2007/03/03}{This macro and its usage added}
+% \changes{v3.1b}{2007/09/17}{Bugfix: Redefinition of CR added}
+% The original code (from |latex/base/ltboxes.dtx|):
+% \begin{verbatim}
+% \def\@parboxrestore{\@arrayparboxrestore\let\\\@normalcr}
+% \def\@arrayparboxrestore{%
+% \let\if@nobreak\iffalse
+% \let\if@noskipsec\iffalse
+% \let\par\@@par
+% \let\-\@dischyph
+% \let\'\@acci\let\`\@accii\let\=\@acciii
+% \parindent\z@ \parskip\z@skip
+% \everypar{}%
+% \linewidth\hsize
+% \@totalleftmargin\z@
+% \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
+% \parfillskip\@flushglue \lineskip\normallineskip
+% \baselineskip\normalbaselineskip
+% \sloppy}
+% \end{verbatim}%^^A
+% This one will be used by |\@caption| instead of |\@parboxrestore|.
+% \begin{macrocode}
+\newcommand*\caption@boxrestore{%
+ \let\if@nobreak\iffalse
+ \let\if@noskipsec\iffalse
+ \let\par\@@par
+% \let\-\@dischyph
+% \let\'\@acci\let\`\@accii\let\=\@acciii
+ \parindent\z@ \parskip\z@skip
+ \everypar{}%
+% \linewidth\hsize
+% \@totalleftmargin\z@
+ \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
+ \parfillskip\@flushglue \lineskip\normallineskip
+ \baselineskip\normalbaselineskip
+ \sloppy
+ \let\\\@normalcr
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@normalsize}
+% \changes{v3.1}{2007/05/05}{This macro and its usage added}
+% This one will be used by |\@caption| instead of |\normalsize|.\par
+% Its code is equivalent to
+% \begin{quote}
+% |\caption@font{normal}%|
+% \end{quote}
+% but executes faster (since the starred form of |\caption@font|
+% does not use |\setkeys| internally).
+% \begin{macrocode}
+\newcommand*\caption@normalsize{%
+ \caption@font*{\KV@caption@fnt@normal\@unused}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setfloatcapt}
+% Needed for support of the \package{float} package, where the caption will
+% not be typeset directly, but catched in a |\vbox| called |\@floatcapt|
+% instead.
+% \begin{macrocode}
+\let\caption@setfloatcapt\@firstofone
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makecurrent}
+% \begin{macro}{\caption@makeanchor}
+% \begin{macro}{\caption@start}
+% \begin{macro}{\caption@@start}
+% \begin{macro}{\caption@freezeHref}
+% \begin{macro}{\caption@defrostHref}
+% All these are needed for support of the \package{hyperref} package.
+% \begin{macrocode}
+\newcommand*\caption@makecurrent[2]{}
+\let\caption@makeanchor\@firstofone
+\let\caption@start\relax
+\let\caption@@start\relax
+\let\caption@freezeHref\relax
+\let\caption@defrostHref\relax
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@gettitle}
+% \changes{v3.1}{2007/05/05}{This macro and its usage added}
+% This one is needed for support of the \package{nameref} package.
+% \begin{macrocode}
+\newcommand\caption@gettitle[1]{%
+ \@ifundefined{NR@gettitle}%
+ {\def\@currentlabelname{#1}}%
+ {\NR@gettitle{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{caption}, \cs{@caption}, and \cs{@makecaption}}
+%
+% \begin{macro}{\caption@caption}
+% \changes{v3.0f}{2005/05/22}{Bugfix: \cs{ContinuedFloat} added}
+% \changes{v3.0f}{2005/06/13}{Support of \cs{caption*[]} removed}
+% \changes{v3.0l}{2007/01/19}{Minimal support of \textsf{combine} package added}
+% \changes{v3.1}{2007/02/04}{Re-written, does not save\&use original definition anymore}
+% Here comes our definition of |\caption| and |\caption*|.
+% Beside the support of the starred variant this code was adapted to the
+% various packages we support.
+% We are using |\caption@dblarg| instead of |\@dblarg| so |\caption{}|
+% (with an empty arg.) will produce a list-of entry, but |\caption[]{}|
+% won't.
+% \begin{macrocode}
+\def\caption@caption{%
+ \caption@iftype
+ {\caption@checkgrouplevel\@empty\caption
+ \caption@star
+ {\caption@refstepcounter\@captype}%
+ {\caption@dblarg{\@caption\@captype}}}%
+ {\caption@Error{\noexpand\caption outside float}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@star}
+% \changes{v3.1}{2007/06/24}{Renamed from \cs{caption@caption} to \cs{caption@star}}
+% A helper macro which processes the optional |*| after |\caption|.
+% \Note{We set \cs{caption@startrue} globally so it works with the
+% \package{sidecap} package, too.}
+% \begin{macrocode}
+\newcommand*\caption@star[2]{%
+ \@ifstar{\global\caption@startrue#2[]}{#1#2}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@caption}
+% \changes{v3.1}{2007/02/04}{Re-written, does not save\&use original definition anymore}
+% \changes{v3.1f}{2007/11/28}{Bugfix: Handling of \texttt{@minipage} flag added}
+% \changes{v3.1f}{2007/11/28}{Support of option \opt{@minipage} added}
+% \changes{v3.1g}{2008/03/16}{Internal: Uses \cs{caption@prepareanchor} now}
+% As above, our version has been adapted to the packages we support.
+% Additionally our code is nested by |\caption@beginex| \&
+% |\caption@end| instead of |\begingroup| \& |\endgroup|.
+% Furthermore we use |\caption@boxrestore| instead of |\@parboxrestore|
+% so this code also works correctly inside list-based environments
+% like |wide| \& |addmargin|. (This, and the fact that we use
+% |\linewidth| instead of |\hsize| inside |\@makecaption|, solves
+% \href{http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=latex/2472}%^^A
+% {\LaTeX\ PR \texttt{latex/2472}}.)
+% \begin{macrocode}
+\long\def\caption@@caption#1[#2]#3{%
+% \end{macrocode}
+% \begin{macrocode}
+ \ifcaption@star \else
+ \caption@prepareanchor{#1}{#2}%
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \par
+ \caption@beginex{#1}{#2}{#3}%
+ \caption@setfloatcapt{%
+ \caption@boxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \caption@normalsize
+ \ifcaption@star
+ \let\caption@makeanchor\@firstofone
+ \fi
+ \@makecaption{\csname fnum@#1\endcsname}%
+ {\ignorespaces\caption@makeanchor{#3}}\par
+ \caption@if@minipage\@minipagetrue\@minipagefalse}%
+ \caption@end}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@prepareanchor}
+% \changes{v3.1g}{2008/03/16}{This macro added}
+% \begin{macrocode}
+\newcommand*\caption@prepareanchor[2]{%
+ \caption@makecurrent{#1}{#2}%
+ \caption@ifhypcap\caption@@start{}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makecaption}
+% \changes{v3.1i}{2008/05/06}{Usage of \cs{caption@rule} added}
+% |\@makecaption|\marg{label}\marg{text}\par
+% We do basically the same as the original code (from the standard
+% \LaTeX\ document classes), but take care of the |position=| setting
+% and use |\caption@@make| from the \package{caption} kernel to finally
+% typeset the caption.
+% \begin{macrocode}
+\long\def\caption@makecaption#1#2{%
+ \caption@iftop
+ {\vskip\belowcaptionskip}%
+ {\caption@rule\vskip\abovecaptionskip}%
+ \caption@@make{#1}{#2}%
+ \caption@iftop
+ {\vskip\abovecaptionskip\caption@rule}%
+ {\vskip\belowcaptionskip}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@redefine}
+% \changes{v3.1k}{2009/03/30}{This macro added, it contains the patching code now}
+% We only redefine |\caption| and |\@caption| if the current definitions
+% are well known, so documents written in the old (\package{caption}
+% package \version{1.x}) days (where |\caption| \& |\@caption| were not
+% redefined by us) will still compile fine.
+% For example the usage of the \package{captcont} package, which brings
+% it's own definition of |\caption*|, was quite common these days.
+% \begin{macrocode}
+\newcommand*\caption@redefine{}
+\g@addto@macro\caption@redefine{%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@setbool{incompatible}{0}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\caption{%
+ % ltfloat.dtx [2002/10/01 v1.1v LaTeX Kernel (Floats)]
+ \def\caption{%
+ \ifx\@captype\@undefined
+ \@latex@error{\noexpand\caption outside float}\@ehd
+ \expandafter\@gobble
+ \else
+ \refstepcounter\@captype
+ \expandafter\@firstofone
+ \fi
+ {\@dblarg{\@caption\@captype}}%
+ }}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\caption{%
+ % beamerbaselocalstructure.sty,v 1.53 2007/01/28 20:48:21 tantau
+ \def\caption{
+ \ifx\@captype\@undefined
+ \@latex@error{\noexpand\caption outside figure or table}\@ehd
+ \expandafter\@gobble
+ \else
+ \refstepcounter\@captype
+ \expandafter\@firstofone
+ \fi
+ {\@dblarg{\@caption\@captype}}%
+ }}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\caption{%
+ % float.sty [2001/11/08 v1.3d Float enhancements (AL)]
+ \renewcommand\caption{%
+ \ifx\@captype\@undefined
+ \@latex@error{\noexpand\caption outside float}\@ehd
+ \expandafter\@gobble
+ \else
+ \refstepcounter\@captype
+ \let\@tempf\@caption
+ \expandafter\ifx\csname @float@c@\@captype\endcsname\relax\else
+ \expandafter\expandafter\let
+ \expandafter\@tempf\csname @float@c@\@captype\endcsname
+ \fi
+ \fi
+ \@dblarg{\@tempf\@captype}}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\caption{%
+ % hyperref.sty [2007/02/27 v6.75t Hypertext links for LaTeX]
+ % hyperref.sty [2007/04/09 v6.76a Hypertext links for LaTeX]
+ % hyperref.sty [2007/06/12 v6.76h Hypertext links for LaTeX]
+ \def\caption{%
+ \ifx\@captype\@undefined
+ \@latex@error{\noexpand\caption outside float}\@ehd
+ \expandafter\@gobble
+ \else
+ \H@refstepcounter\@captype
+ \@ifundefined{fst@\@captype}{%
+ \let\Hy@tempa\@caption
+ }{%
+ \let\Hy@tempa\Hy@float@caption
+ }%
+ \expandafter\@firstofone
+ \fi
+ {\@dblarg{\Hy@tempa\@captype}}%
+ }}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\caption{%
+ % hyperref.sty [2007/08/05 v6.76j Hypertext links for LaTeX]
+ \def\caption{%
+ \ifx\@captype\@undefined
+ \@latex@error{\noexpand\caption outside float}\@ehd
+ \expandafter\@gobble
+ \else
+ \H@refstepcounter\@captype
+ \let\Hy@tempa\@caption
+ \@ifundefined{float@caption}{%
+ }{%
+ \expandafter\ifx\csname @float@c@\@captype\endcsname\float@caption
+ \let\Hy@tempa\Hy@float@caption
+ \fi
+ }%
+ \expandafter\@firstofone
+ \fi
+ {\@dblarg{\Hy@tempa\@captype}}%
+ }}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@IfCheckCommand{}{%
+ \caption@Info{%
+ Incompatible package detected (regarding \string\caption).\MessageBreak
+ \string\caption\space=\space\meaning\caption}%
+ \caption@setbool{incompatible}{1}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % ltfloat.dtx [2002/10/01 v1.1v LaTeX Kernel (Floats)]
+ \long\def\@caption#1[#2]#3{%
+ \par
+ \addcontentsline{\csname ext@#1\endcsname}{#1}%
+ {\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+ \endgroup}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % beamerbaselocalstructure.sty,v 1.53 2007/01/28 20:48:21 tantau
+ \long\def\@caption#1[#2]#3{% second argument ignored
+ \par\nobreak
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \beamer@makecaption{#1}{\ignorespaces #3}\par\nobreak
+ \endgroup}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+% \caption@CheckCommand\float@caption{%
+% % float.sty [2001/11/08 v1.3d Float enhancements (AL)]
+% \long\def\float@caption#1[#2]#3{%
+% \addcontentsline{\@nameuse{ext@#1}}{#1}%
+% {\protect\numberline{\@nameuse{the#1}}{\ignorespaces #2}}
+% \global\setbox\@floatcapt\vbox\bgroup\@parboxrestore
+% \normalsize\@fs@capt{\@nameuse{fnum@#1}}{\ignorespaces #3}%
+% \@ifnextchar[{\float@ccon}{\egroup}}%
+% \long\def\float@ccon[#1]{#1\par\egroup}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % hyperref.sty [2007/02/27 v6.75t Hypertext links for LaTeX]
+ \long\def\@caption#1[#2]#3{%
+ \hyper@makecurrent{\@captype}%
+ \def\@currentlabelname{#2}%
+ \par\addcontentsline{\csname ext@#1\endcsname}{#1}{%
+ \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}%
+ }%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \@makecaption{\csname fnum@#1\endcsname}{%
+ \ignorespaces
+ \ifHy@nesting
+ \hyper@@anchor{\@currentHref}{#3}%
+ \else
+ \Hy@raisedlink{\hyper@@anchor{\@currentHref}{\relax}}#3%
+ \fi
+ }%
+ \par
+ \endgroup
+ }}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % hyperref.sty [2007/04/09 v6.76a Hypertext links for LaTeX]
+ % hyperref.sty [2007/06/12 v6.76h Hypertext links for LaTeX]
+ % hyperref.sty [2007/08/05 v6.76j Hypertext links for LaTeX]
+ \long\def\@caption#1[#2]#3{%
+ \expandafter\ifx\csname if@capstart\expandafter\endcsname
+ \csname iftrue\endcsname
+ \global\let\@currentHref\hc@currentHref
+ \else
+ \hyper@makecurrent{\@captype}%
+ \fi
+ \def\@currentlabelname{#2}%
+ \par\addcontentsline{\csname ext@#1\endcsname}{#1}{%
+ \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}%
+ }%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \expandafter\ifx\csname if@capstart\expandafter\endcsname
+ \csname iftrue\endcsname
+ \global\@capstartfalse
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces#3}%
+ \else
+ \@makecaption{\csname fnum@#1\endcsname}{%
+ \ignorespaces
+ \ifHy@nesting
+ \hyper@@anchor{\@currentHref}{#3}%
+ \else
+ \Hy@raisedlink{\hyper@@anchor{\@currentHref}{\relax}}#3%
+ \fi
+ }%
+ \fi
+ \par
+ \endgroup
+ }}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % hyperref.sty [2009/11/27 v6.79k Hypertext links for LaTeX]
+ \long\def\@caption#1[#2]#3{%
+ \expandafter\ifx\csname if@capstart\expandafter\endcsname
+ \csname iftrue\endcsname
+ \global\let\@currentHref\hc@currentHref
+ \else
+ \hyper@makecurrent{\@captype}%
+ \fi
+ \def\@currentlabelname{#2}%
+ \par\addcontentsline{\csname ext@#1\endcsname}{#1}{%
+ \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}%
+ }%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \expandafter\ifx\csname if@capstart\expandafter\endcsname
+ \csname iftrue\endcsname
+ \global\@capstartfalse
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces#3}%
+ \else
+ \@makecaption{\csname fnum@#1\endcsname}{%
+ \ignorespaces
+ \ifHy@nesting
+ \expandafter\hyper@@anchor\expandafter{\@currentHref}{#3}%
+ \else
+ \Hy@raisedlink{%
+ \expandafter\hyper@@anchor\expandafter{\@currentHref}{\relax}%
+ }%
+ #3%
+ \fi
+ }%
+ \fi
+ \par
+ \endgroup
+ }}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % hyperref.sty [2009/12/09 v6.79m Hypertext links for LaTeX]
+ % hyperref.sty [2009/12/28 v6.79z Hypertext links for LaTeX]
+ \long\def\@caption#1[#2]#3{%
+ \expandafter\ifx\csname if@capstart\expandafter\endcsname
+ \csname iftrue\endcsname
+ \global\let\@currentHref\hc@currentHref
+ \else
+ \hyper@makecurrent{\@captype}%
+ \fi
+ \@ifundefined{NR@gettitle}{%
+ \def\@currentlabelname{#2}%
+ }{%
+ \NR@gettitle{#2}%
+ }%
+ \par\addcontentsline{\csname ext@#1\endcsname}{#1}{%
+ \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}%
+ }%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \expandafter\ifx\csname if@capstart\expandafter\endcsname
+ \csname iftrue\endcsname
+ \global\@capstartfalse
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces#3}%
+ \else
+ \@makecaption{\csname fnum@#1\endcsname}{%
+ \ignorespaces
+ \ifHy@nesting
+ \expandafter\hyper@@anchor\expandafter{\@currentHref}{#3}%
+ \else
+ \Hy@raisedlink{%
+ \expandafter\hyper@@anchor\expandafter{%
+ \@currentHref
+ }{\relax}%
+ }%
+ #3%
+ \fi
+ }%
+ \fi
+ \par
+ \endgroup
+ }}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % nameref.sty [2006/12/27 v2.28 Cross-referencing by name of section]
+ \long\def\@caption#1[#2]{%
+ \def\@currentlabelname{#2}%
+ \NR@@caption{#1}[{#2}]%
+ }}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % nameref.sty [2009/11/27 v2.32 Cross-referencing by name of section]
+ \long\def\@caption#1[#2]{%
+ \NR@gettitle{#2}%
+ \NR@@caption{#1}[{#2}]%
+ }}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % subfigure.sty [2002/07/30 v2.1.4 subfigure package]
+ \long\def\@caption#1[#2]#3{%
+ \@ifundefined{if#1topcap}%
+ {\subfig@oldcaption{#1}[{#2}]{#3}}%
+ {\@nameuse{if#1topcap}%
+ \@listsubcaptions{#1}%
+ \subfig@oldcaption{#1}[{#2}]{#3}%
+ \else
+ \subfig@oldcaption{#1}[{#2}]{#3}%
+ \@listsubcaptions{#1}%
+ \fi}}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % subfig.sty [2005/06/28 ver: 1.3 subfig package]
+ \def\@caption{\caption@}%
+% \long\def\caption@#1[#2]#3{%
+% \@ifundefined{caption@setfloattype}%
+% \caption@settype
+% \caption@setfloattype
+% \@captype
+% \sf@ifpositiontop{%
+% \@listsubcaptions{#1}%
+% \sf@old@caption{#1}[{#2}]{#3}%
+% }{%
+% \sf@old@caption{#1}[{#2}]{#3}%
+% \@listsubcaptions{#1}%
+% }}%
+ }%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@IfCheckCommand{}{%
+ \caption@Info{%
+ Incompatible package detected (regarding \string\@caption).\MessageBreak
+ \string\@caption\space=\space\meaning\@caption}%
+ \caption@setbool{incompatible}{1}}%
+% \end{macrocode}
+%
+% The option |compatibility=| will override the compatibility mode.
+% \begin{macrocode}
+ \@ifundefined{caption@ifcompatibility}%
+ {\let\caption@ifcompatibility\caption@ifincompatible
+ \let\caption@tempa\caption@WarningNoLine}%
+ {\let\caption@tempa\@gobble}% suppress warning
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@ifcompatibility{%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@tempa{%
+ \noexpand\caption will not be redefined since it's already\MessageBreak
+ redefined by a document class or package which is\MessageBreak
+ unknown to the caption package}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \renewcommand*\caption@redefine{}%
+% \end{macrocode}
+%
+% |\ContinuedFloat| is not supported in compatibility mode.
+% \begin{macrocode}
+ \renewcommand*\caption@ContinuedFloat[1]{%
+ \caption@Error{Not available in compatibility mode}}%
+% \end{macrocode}
+%
+% |\caption@start| is not supported in compatibility mode.
+% \begin{macrocode}
+ \caption@AtBeginDocument*{%
+ \let\caption@start\relax
+ \@ifundefined{caption@ORI@capstart}{}{%
+ \caption@Debug{%
+ Restore hypcap definition of \string\capstart\@gobble}%
+ \let\capstart\caption@ORI@capstart}%
+ \@ifundefined{caption@ORI@float@makebox}{}{%
+ \caption@Debug{%
+ Restore hyperref redefinition of \string\float@makebox\@gobble}%
+ \let\float@makebox\caption@ORI@float@makebox}%
+ }%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@star}
+% We redefine |\caption@star| here so it does not make any harm.
+% \begin{macrocode}
+ \renewcommand*\caption@star[2]{#1#2}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ }{%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@ifincompatible{%
+ \caption@WarningNoLine{%
+ Forced redefinition of \noexpand\caption since the\MessageBreak
+ unsupported(!) package option `compatibility=false'\MessageBreak
+ was given}%
+ }{}%
+% \end{macrocode}
+%
+% \begin{macro}{\caption}
+% \begin{macro}{\@caption}
+% \begin{macrocode}
+ \renewcommand*\caption@redefine{%
+ \let\caption\caption@caption
+ \let\@caption\caption@@caption}%
+ \caption@redefine
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+ }%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@AtBeginDocument*{%
+ \let\caption@ORI@capstart\@undefined
+ \let\caption@ORI@float@makebox\@undefined}%
+% \end{macrocode}
+%
+% \begin{macro}{\@xfloat}
+% \changes{v3.1}{2007/05/09}{This re-definition added}
+% \changes{v3.1b}{2007/09/22}{Will now be redefined in compatibility mode, too}
+% We redefine |\@xfloat| so inside floating environments our
+% type-specific options will be used, a \package{hyperref}
+% anchor will be set etc.
+% \begin{macrocode}
+ \let\caption@ORI@xfloat\@xfloat
+ \def\@xfloat#1[#2]{%
+ \caption@ORI@xfloat{#1}[#2]%
+ \caption@settype{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% Some packages (like the \package{hyperref} package for example) redefines
+% |\caption| and |\@caption|, too.
+% So we have to use |\AtBeginDocument| here, so we can make sure
+% our definition is the one which will be valid at last.
+% \begin{macrocode}
+\caption@AtBeginDocument{\caption@redefine}
+% \end{macrocode}
+%
+% \begin{macro}{\@makecaption}
+% \begin{macrocode}
+\let\@makecaption\caption@makecaption
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Support for sub-captions}
+% \changes{v3.1f}{2007/11/16}{Support for sub-captions added}
+%
+% \begin{macro}{\caption@DeclareSubType}
+% |\caption@DeclareSub| initializes the usage of \cs{caption}
+% in sub-floats.
+% \begin{macrocode}
+\def\caption@DeclareSubType sub#1\@nil{%
+ \caption@Debug{Initializing subtype for `#1'\@gobble}%
+ \@namedef{caption@c@#1}{0}%
+ \@namedef{caption@beginsub#1}{\caption@beginsubfloat{#1}}}
+\@onlypreamble\caption@DeclareSubType
+% \end{macrocode}
+% \end{macro}
+%
+% Initialize the sub-captions defined with \cs{DeclareCaptionSubType}\ldots
+% \begin{macrocode}
+\caption@For*{subtypelist}{\caption@DeclareSubType sub#1\@nil}
+% \end{macrocode}
+%
+% Initialize the sub-captions defined with \cs{newsubfloat}\cite{subfig}\ldots
+% \begin{macrocode}
+\caption@AtBeginDocument*{%
+ \@ifundefined{sf@counterlist}{}{%
+ \@for\sf@temp:=\sf@counterlist\do{%
+ \expandafter\caption@DeclareSubType\sf@temp\@nil}}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@subtypehook}
+% \changes{v3.1g}{2008/03/20}{Redefinition of \cs{caption@setlist} added}
+% \changes{v3.1k}{2009/10/09}{Bugfix 09-08-12b: \cs{@makecaption} will now be restored here, too}
+% Hook, will be used inside \cs{caption@setsubtype}.
+% \begin{macrocode}
+\newcommand*\caption@subtypehook{%
+ \ifx\caption\caption@subcaption \else
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@ifrefstepcounter{}{%
+ % no \caption or \subcaption in this (floating) environment yet
+ \caption@Debug{Increment \@captype\ counter =\the\value\@captype}%
+ \caption@l@stepcounter\@captype
+ \let\addcontentsline\caption@addsubcontentsline}%
+% \end{macrocode}
+% \begin{macrocode}
+ \ifnum\csname caption@c@\@captype\endcsname=\value\@captype \else
+ \caption@Debug{Reset sub\@captype\ counter}%
+ \expandafter\xdef\csname caption@c@\@captype\endcsname{%
+ \the\value\@captype}%
+ \@stpelt\@subcaptype
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \c@ContinuedFloat=0\relax
+ \let\caption@resetContinuedFloat\@gobble
+ \let\caption@addcontentsline\caption@kernel@addcontentsline
+ \let\caption@setfloatcapt\@firstofone
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@clearmargin
+ \caption@iflist{}{\let\caption@setlist\@gobble}%
+ \caption@setoptions{sub}%
+ \caption@setoptions{subfloat}% for subfig-package compatibility
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption\caption@subcaption
+ \let\@makecaption\caption@makecaption
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@subcaption}
+% Makes a sub-caption.
+% \begin{macrocode}
+\newcommand*\caption@subcaption{%
+ \caption@iftype
+ {\caption@checkgrouplevel{sub}\subcaption
+ \caption@star
+ {\caption@refstepcounter\@subcaptype}%
+ {\caption@dblarg{\@caption\@subcaptype}}}%
+ {\caption@Error{\noexpand\subcaption outside float}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@addcontentsline}
+% \changes{v3.1g}{2008/01/12}{Argument of \cs{caption@addsubcontentslines} removed}
+% \changes{v3.1i}{2008/08/02}{Argument of \cs{caption@addsubcontentslines} re-added}
+% We extend |\caption@addcontentsline| so it handles sub-captions, too.
+% \Note{\cs{sf@ifpositiontop} \& \cs{@listsubcaptions} are defined by the
+% \package{subfigure} \& \package{subfig} packages.}
+% \begin{macrocode}
+\let\caption@kernel@addcontentsline\caption@addcontentsline
+\renewcommand*\caption@addcontentsline[2]{%
+ \sf@ifpositiontop{\@listsubcaptions{#1}}{}%
+ \caption@kernel@addcontentsline{#1}{#2}%
+ \sf@ifpositiontop{}{\@listsubcaptions{#1}}%
+ \caption@addsubcontentslines{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@addsubcontentslines[1]{%
+ \begingroup
+ \caption@subcontentslines
+ \endgroup
+ \caption@clearsubcontentslines}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@AtBeginDocument*{%
+ \@ifundefined{sf@ifpositiontop}{\let\sf@ifpositiontop\@gobbletwo}{}%
+ \caption@clearsubcontentslines
+ \g@addto@macro\caption@typehook{\caption@checksubcontentslines}%
+ \AtEndDocument{\caption@checksubcontentslines}}%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@addsubcontentsline}
+% \changes{v3.1i}{2008/08/02}{Bugfix 08-07-28:
+% \cs{label}, \cs{index}, and \cs{glossary} are allowed inside the list entry now}
+% Add a pending sub-caption list entry.
+% \begin{macrocode}
+\newcommand*\caption@addsubcontentsline[3]{%
+ \begingroup
+ \let\label\@gobble \let\index\@gobble \let\glossary\@gobble
+ \protected@edef\@tempa{\endgroup
+ \noexpand\g@addto@macro\noexpand\caption@subcontentslines{%
+ \noexpand\@namedef{the#2}{\csname the#2\endcsname}%
+ \ifx\@currentHref\@undefined \else
+ \noexpand\def\noexpand\@currentHref{\@currentHref}%
+ \fi
+ \protect\addcontentsline{#1}{#2}{#3}}}%
+ \@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@checksubcontentslines}
+% \changes{v3.1g}{2008/01/07}{Bugfix: Uses \cs{caption@Error} instead of \cs{subcaption@Error} now}
+% Checks if the list of pending sub-captions is empty, if not,
+% a warning will be issued.
+% \begin{macrocode}
+\newcommand*\caption@checksubcontentslines{%
+ \ifx\caption@subcontentslines\@empty \else
+ \caption@Error{%
+ Something's wrong--perhaps a missing \protect\caption\MessageBreak
+ in the last figure or table}%
+ \caption@clearsubcontentslines
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@clearsubcontentslines}
+% Clear pending sub-caption list entries.
+% \begin{macrocode}
+\newcommand*\caption@clearsubcontentslines{%
+ \global\let\caption@subcontentslines\@empty}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Document class \& Babel package support}
+%
+% \subsubsection{The \AmS{} \& \SmF{} classes}
+% \changes{v3.1}{2007/07/29}{\AmS\ \& \SmF\ classes support added (package)}
+%
+% \begin{macrocode}
+\@ifundefined{smf@makecaption}{}{\let\smf@makecaption\@makecaption}
+% \end{macrocode}
+%
+% \subsubsection{The beamer class}
+% \changes{v3.1}{2007/03/10}{beamer class support added (package)}
+%
+% \begin{macrocode}
+\@ifclassloaded{beamer}{%
+ \caption@Info{beamer document class}%
+% \end{macrocode}
+%
+% Since the beamer class do not offer a `list of figures' we switch
+% this support in \thispackage\ off.
+% \begin{macrocode}
+ \captionsetup{list=false}
+ \DeclareCaptionOption{list}[1]{}
+ \DeclareCaptionOption{listof}[1]{}
+% \end{macrocode}
+%
+% \begin{macro}{\figure}
+% \changes{v3.1f}{2007/12/17}{This re-definition for \class{beamer} document class added}
+% \begin{macro}{\table}
+% \changes{v3.1f}{2007/12/17}{This re-definition for \class{beamer} document class added}
+% We redefine |figure| \& |table| so our type-specific options will be used,
+% a \package{hyperref} anchor will be set etc.
+% \begin{macrocode}
+ \expandafter\let\expandafter\caption@ORI@figure
+ \csname\string\figure\endcsname
+ \@namedef{\string\figure}[#1]{%
+ \caption@ORI@figure[#1]%
+ \caption@settype{figure}}
+% \end{macrocode}
+% \begin{macrocode}
+ \expandafter\let\expandafter\caption@ORI@table
+ \csname\string\table\endcsname
+ \@namedef{\string\table}[#1]{%
+ \caption@ORI@table[#1]%
+ \caption@settype{table}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The \KOMAScript{} classes}
+%
+% \KOMAScript\ contains the code
+% |\AtBeginDocument{\let\scr@caption\caption}|
+% so we need to update |\scr@caption| here, too.
+%
+% \begin{macrocode}
+\@ifundefined{scr@caption}{}{%
+ \caption@AtBeginDocument{\let\scr@caption\caption}}
+% \end{macrocode}
+%
+% \subsubsection{The frenchb Babel option}
+% \changes{v3.1}{2006/05/14}{Adaptation to \package{frenchb} added (package)}
+%
+% Suppress
+% ``Package |frenchb.ldf| Warning: The definition of |\@makecaption| has been
+% changed, frenchb will NOT customize it.''
+% (but only if we emulate this customization)
+% \begin{macrocode}
+\@nameuse{caption@frenchb}\@nameundef{caption@frenchb}
+% \end{macrocode}
+%
+% \subsubsection{The frenchle/pro package}
+% \changes{v3.0h}{2005/10/03}{Adaptation to \package{frenchle/pro} added (package)}
+%
+% \begin{macrocode}
+\caption@AtBeginDocument{\@ifundefined{frenchTeXmods}{}{%
+ \caption@Info{frenchle/pro package is loaded}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \let\captionfont@ORI\captionfont
+ \let\captionlabelfont@ORI\captionlabelfont
+ \let\@makecaption@ORI\@makecaption
+% \end{macrocode}
+
+% If |\GOfrench| is defined as |\relax| all the re-definitions regarding
+% captions have already been done, so we can do our patches immediately.
+% Otherwise we must add our stuff to |\GOfrench|.
+% \begin{macrocode}
+ \@ifundefined{GOfrench}%
+ {\let\caption@tempa\@firstofone}%
+ {\def\caption@tempa{\g@addto@macro\GOfrench}}%
+ \caption@tempa{%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \let\captionfont\captionfont@ORI
+ \let\captionfont@ORI\@undefined
+ \let\captionlabelfont\captionlabelfont@ORI
+ \let\captionlabelfont@ORI\@undefined
+ \let\@makecaption\@makecaption@ORI
+ \let\@makecaption@ORI\@undefined
+% \end{macrocode}
+%
+% \begin{macro}{\@cnORI}
+% We update the definition of |\@cnORI| so it actually reflects
+% our definition of |\caption|.
+% \begin{macrocode}
+ \let\@cnORI\caption
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@tablescaption}
+% The \package{frenchle/pro} package sets |\caption| to |\@tablescaption| at
+% |\begin{table}| for special treatment of footnotes.
+% Therefore we have to patch |\@tablescaption| so |\caption*| will work
+% inside the |table| environment.
+% \begin{macrocode}
+ \let\caption@tcORI\@tablescaption
+ \def\@tablescaption{\caption@star\relax\caption@tcORI}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\f@ffrench}
+% \begin{macro}{\f@tfrench}
+% |\f@ffrench| and |\f@tfrench| reflect |\fnum@figure| and |\fnum@table|
+% when used in French mode. These contain additional code which typesets
+% the caption separator |\captionseparator| instead of the usual colon.
+% Because this breaks with our |\@makecaption| code we have to remove
+% this additional code here.
+% \begin{macrocode}
+ \let\@eatDP\@undefined
+ \let\caption@tempa\@empty
+ \ifx\f@ffrench\fnum@figure
+ \l@addto@macro\caption@tempa{\let\fnum@figure\f@ffrench}%
+ \fi
+ \ifx\f@tfrench\fnum@table
+ \l@addto@macro\caption@tempa{\let\fnum@table\f@tfrench}%
+ \fi
+ \def\f@ffrench{\ifx\listoffigures\relax\else\figurename~\thefigure\fi}%
+ \def\f@tfrench{\ifx\listoftables\relax\else\tablename~\thetable\fi}%
+ \caption@tempa
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+ }%
+}}
+% \end{macrocode}
+%
+% \subsection{Package support}
+% \changes{v3.1}{2007/04/11}{Package options `float', `longtable' etc.
+% are not supported anymore, removed}
+%
+% \begin{macro}{\caption@IfPackageLoaded}
+% \changes{v3.0f}{2005/05/29}{3rd argument \meta{code} added,
+% so no extra check is needed}
+% \changes{v3.1}{2007/07/04}{Re-written \& renamed from \cs{caption@ifpackage}
+% to \cs{caption@IfPackageLoaded}}
+% |\caption@IfPackageLoaded|\marg{package}\oarg{version}\marg{true}\marg{false}\par
+% Some kind of combination of |\@ifpackageloaded| and |\@ifpackagelater|.
+% If the \meta{package} is not loaded yet, the check will be (re-)done
+% |\AtBeginDocument|, so the \meta{package} could be loaded later on, too.
+% \begin{macrocode}
+\newcommand\caption@IfPackageLoaded[1]{%
+ \@testopt{\caption@@IfPackageLoaded{#1}}{}}
+\@onlypreamble\caption@IfPackageLoaded
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@IfPackageLoaded#1[#2]#3#4{%
+ \@ifpackageloaded{#1}\@firstofone{%
+ \caption@Debug{#1 package is not loaded (yet)\@gobble}%
+ \caption@AtBeginDocument}{%
+ \caption@@ifpackageloaded{#1}[#2]{#3}{#4}}}
+\@onlypreamble\caption@@IfPackageLoaded
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@ifpackageloaded[1]{%
+ \@testopt{\caption@@ifpackageloaded{#1}}{}}
+\@onlypreamble\caption@ifpackageloaded
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@ifpackageloaded#1[#2]{%
+ \@ifpackageloaded{#1}{%
+ \caption@Info{#1 package is loaded}%
+ \@ifpackagelater{#1}{#2}\@firstoftwo{%
+ \caption@Error{%
+ For a successful cooperation we need at least version\MessageBreak
+ `#2' of package #1,\MessageBreak
+ but only version\MessageBreak
+ `\csname ver@#1.\@pkgextension\endcsname'\MessageBreak
+ is available}%
+ \@secondoftwo}%
+ }{\@secondoftwo}}
+\@onlypreamble\caption@@ifpackageloaded
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@clearmargin}
+% \changes{v3.1}{2007/05/05}{This macro and its usage added}
+% This macro will be used by some package support stuff where the usual
+% margin setting is not welcome, e.g. in the \package{sidecap} package.
+% \begin{macrocode}
+\newcommand*\caption@clearmargin{%
+ \setcaptionmargin\z@
+ \let\caption@minmargin\@undefined}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@setbool{needfreeze}{0}
+\caption@AtBeginDocument*{%
+ \caption@ifneedfreeze{%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@freeze}
+% \changes{v3.1}{2007/07/22}{This macro added}
+% \changes{v3.1c}{2007/10/06}{\cs{caption} \& \cs{@caption} revised for enhanced compatibility}
+% \changes{v3.1c}{2007/10/06}{Bugfix: Made \cs{@caption} long}
+% \changes{v3.1f}{2007/11/16}{Uses `space hack' instead of \cs{ignorespaces} now}
+% \changes{v3.1g}{2008/01/29}{Starred variants of \cs{ContinuedFloat} and \cs{captionsetup} added}
+% |\caption@freeze*|\par
+% Used by the \package{fltpage} \& \package{sidecap} package support.
+% \begin{macrocode}
+ \newcommand*\caption@freeze{%
+ \caption@teststar\caption@@freeze\@gobble\@firstofone}%
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\caption@@freeze[1]{%
+ \global\let\caption@SCcontinued\relax
+ \global\let\caption@SCsetup\@undefined
+ \global\let\caption@SClentry\@undefined
+ \global\let\caption@SCtext\@undefined
+ \global\let\caption@SClabel\@undefined
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@ORI@ContinuedFloat\ContinuedFloat
+ \def\ContinuedFloat{%
+ \caption@withoptargs\caption@SC@ContinuedFloat}%
+ \def\caption@SC@ContinuedFloat##1{%
+ \let\caption@ORI@setcounter\setcounter
+ \let\caption@ORI@addtocounter\addtocounter
+ \def\setcounter####1####2{\csname c@####1\endcsname####2\relax}%
+ \def\addtocounter####1####2{\advance\csname c@####1\endcsname ####2\relax}%
+ \caption@ORI@ContinuedFloat##1%
+ \global\let\caption@SCcontinued\caption@ORI@ContinuedFloat
+ \let\setcounter\caption@ORI@setcounter
+ \let\addtocounter\caption@ORI@addtocounter}%
+ \let\caption@ORI@setup\captionsetup
+ \def\captionsetup{%
+ \caption@withoptargs\caption@SC@setup}%
+ \def\caption@SC@setup##1##2{%
+ \caption@g@addto@list\caption@SCsetup{##2}%
+ \caption@ORI@setup##1{##2}}%
+ \let\caption@ORI\caption
+ \def\caption{%
+ \def\caption{\caption@Error{%
+ Only one \noexpand\caption can be placed in this environment}}%
+ \let\captionsetup\caption@setup
+ \let\caption@@refstepcounter\caption@l@stepcounter
+ \caption@ORI}%
+ \long\def\@caption##1[##2]##3{%
+ \@bsphack
+ \gdef\caption@SClentry{##2}%
+ \gdef\caption@SCtext{##3}%
+ \@esphack}%
+ #1{% is \@gobble in star form, and \@firstofone otherwise
+ \def\label##1{\@bsphack\gdef\caption@SClabel{##1}\@esphack}}%
+% \end{macrocode}
+% \begin{macrocode}
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@defrost}
+% \changes{v3.1}{2007/07/22}{This macro added}
+% \changes{v3.1g}{2008/01/30}{\cs{caption@defrost@setup} added}
+% |\caption@defrost|
+% \begin{macrocode}
+ \newcommand*\caption@defrost{%
+ \ifx\caption@ORI@ContinuedFloat\@undefined
+ \caption@defrost@setup
+ \ifx\caption@SCtext\@undefined \else
+ \expandafter\expandafter\expandafter\caption
+ \expandafter\expandafter\expandafter[%
+ \expandafter\expandafter\expandafter{%
+ \expandafter\caption@SClentry\expandafter}\expandafter]%
+ \expandafter{\caption@SCtext}%
+ \fi
+ \ifx\caption@SClabel\@undefined \else
+ \expandafter\label\expandafter{\caption@SClabel}%
+ \fi
+ \else
+ \caption@Error{Internal Error:\MessageBreak
+ \noexpand\caption@defrost in same group as \string\caption@freeze}%
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\caption@defrost@setup{%
+ \caption@SCcontinued
+ \ifx\caption@SCsetup\@undefined \else
+ \expandafter\captionsetup\expandafter{\caption@SCsetup}%
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ }{}%
+ \caption@undefbool{needfreeze}}
+% \end{macrocode}
+%
+% \subsubsection{The float package}
+% \changes{v3.0f}{2005/05/31}{\package{float} package support rewritten and improved}
+% \iffalse
+% (This is a more straight-ahead implementation, but it only works with v1.3
+% now, so v1.2 is no longer supported. The old code including documentation
+% can be found in caption-30f-050530.zip)
+% \fi
+%
+% The \package{float} package usually do not use the \LaTeX\ kernel command
+% |\@caption| to typeset the caption but |\float@caption| instead.
+% (|\@caption| will only be used if the float is re-styled with
+% |\restylefloat*|.)
+%
+% The main two things |\float@caption| is doing different are:
+% \begin{itemize}
+% \item The caption will be typeset inside a |\savebox| called |\@floatcapt|
+% so it can be placed above or below the float contents afterwards.
+% \item |\@makecaption| will not be used to finally typeset the caption.
+% Instead |\@fs@capt| will be used which definition is part of the float
+% style.
+% (Note that |\@fs@capt| will not typeset any vertical space above or below
+% the caption; instead this space will be typeset by the float style code
+% itself.)
+% \end{itemize}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{float}[2001/11/08 v1.3d]{%
+ \@ifpackageloaded{floatrow}{%
+ \caption@ifpackageloaded{floatrow}[2007/08/24 v0.2a]{}{}%
+ }{%
+% \end{macrocode}
+%
+% \iffalse
+% \begin{macro}{\caption@of}
+% If the float is defined by the float package (which means |\fst@|\meta{type}
+% is defined) we `execute' this float style, so |\@fs@iftopcapt| is set to its
+% proper value.
+% Furthermore we undo the re-definition of |\caption@setfloatcapt| which was
+% done by |\float@dostyle|.
+% \begin{macrocode}
+% \renewcommand*\caption@of[2]{%
+% \float@ifstyle{#2}{%
+% \float@dostyle{#2}%
+% \let\caption@setfloatcapt\@firstofone}{}%
+% \caption@settype*{#2}#1}%
+% \end{macrocode}
+% \end{macro}
+% \fi
+%
+% \begin{macro}{\@float@setevery}
+% \changes{v3.1k}{2009/10/09}{Bugfix 08-12-05: \cs{color@begin/endgroup} added
+% to redefinition of \cs{caption@setfloatcapt}}
+% |\@float@setevery|\marg{float type} is provided by the \package{float}
+% package; it's called every time a floating environment defined with
+% |\newfloat| or |\restylefloat| begins.
+% We use this hook to do some adaptations and to setup the proper caption
+% style (if defined) and additional settings declared with
+% |\captionsetup|\oarg{float style}.
+% \begin{macrocode}
+ \let\caption@ORI@float@setevery\@float@setevery
+ \def\@float@setevery#1{%
+ \float@ifcaption{#1}{%
+% \end{macrocode}
+%
+% First of all we set the caption position to it's proper value by
+% converting |\@fs@iftopcapt| (which is part of a float style and
+% controls where the caption will be typeset, above or below the float
+% contents) to our |position=| setting.
+% Since the spacing above and below the caption will be done by the float
+% style and \emph{not} by us this sounds quite useless. But in fact it isn't,
+% since some packages based on \thispackage\ (like the \package{subfig}
+% package) could have an interest for this information and therefore use the
+% |\caption@iftop| macro we provide in our kernel. Furthermore we need this
+% information for ourself in |\captionof| which uses |\@makecaption| to
+% finally typeset the caption with skips.
+% \begin{macrocode}
+ \caption@setposition{\@fs@iftopcapt t\else b\fi}%
+% \end{macrocode}
+%
+% Afterward we redefine |\caption@setfloatcapt| (which will be used inside
+% |\@caption|) so the caption will be set inside the box |\@floatcapt|,
+% without extra vertical space.
+% \begin{macrocode}
+ \renewcommand\caption@setfloatcapt[1]{%
+ \let\@makecaption\caption@@make
+ \global\setbox\@floatcapt\vbox{%
+ \color@begingroup ##1\color@endgroup}}%
+% \end{macrocode}
+%
+% To allow different caption styles for different float styles we also
+% determine the current float style (e.g. `ruled') and select
+% a caption style (and additional settings) with the same name, if defined.
+% \begin{macrocode}
+ \float@getstyle\float@style{#1}%
+ \caption@setstyle*\float@style
+ \caption@setoptions\float@style
+% \end{macrocode}
+%
+% \begin{macrocode}
+ }{}%
+ \caption@freezeHref % will be defrosted in \float@makebox
+ \caption@ORI@float@setevery{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@typehook}
+% \changes{v3.1}{2007/07/08}{float package hook added}
+% \LaTeX\ and almost every other packages use
+% |\|\meta{type}|name|
+% to provide a macro for the type resp.~environment name -- for example
+% the command |\figurename| will usually contain the name of the floating
+% environment |figure|:
+% \begin{quote}
+% |\newcommand\figurename{Figure}|
+% \end{quote}
+% But the \package{float} package doesn't follow this common naming
+% convention:
+% For floats defined with |\newfloat| it uses |\fname@|\meta{type} instead,
+% which breaks with our code (and with |\autoref| and some other things as
+% well).
+% So we have to map the \package{float} package name to the common one here.\par
+% \Note{If the float was not defined with \cs{newfloat} but with
+% \cs{restylefloat} instead, \cs{fname@}\meta{type} is not defined.}
+% \begin{macrocode}
+ \g@addto@macro\caption@typehook{%
+ \expandafter\ifx\csname #1name\endcsname\relax
+ \expandafter\let\csname #1name\expandafter\endcsname
+ \csname fname@#1\endcsname
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0f}{2005/06/26}{Skips of \env{plaintop} and \env{boxed} floats corrected}
+% \begin{macro}{\fs@plaintop}
+% \begin{macro}{\fs@boxed}
+% Since the float styles |plaintop| and |boxed| don't use |\abovecaptionskip|
+% which could be set with |skip=| (|plaintop| uses |\belowcaptionskip| instead of
+% |\abovecaptionskip|, and |boxed| uses a fixed space of |2pt|)
+% we patch the according float style macros here to change this.
+% \begin{macrocode}
+ \g@addto@macro\fs@plaintop{\def\@fs@mid{\vspace\abovecaptionskip\relax}}%
+ \g@addto@macro\fs@boxed{\def\@fs@mid{\kern\abovecaptionskip\relax}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\float@ifstyle}
+% \changes{v3.1}{2007/06/10}{This macro added}
+% |\float@ifstyle|\marg{type}\marg{if-clause}\marg{else-clause}\par
+% Checks if the given \meta{type} (e.g.~|figure|) is associated with a
+% float style (e.g.~|boxed|).
+% \begin{macrocode}
+ \providecommand*\float@ifstyle[1]{%
+ \expandafter\ifx\csname fst@#1\endcsname\relax
+ \expandafter\@secondoftwo
+ \else
+ \expandafter\@firstoftwo
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\float@getstyle}
+% \changes{v3.1}{2007/06/10}{This macro added}
+% |\float@getstyle|\marg{cmd}\marg{type}\par
+% Determining the float style is not so easy because the only hint
+% provided by the \package{float} package is the macro
+% |\fst@|\meta{float type} which points to the macro which represents the
+% float style. So for example after
+% \begin{quote}
+% |\floatstyle{ruled}|\\
+% |\newfloat{Program}{tbp}{lop}|
+% \end{quote}
+% |\fst@Program| will be defined as
+% \begin{quote}
+% |\def\fst@Program{\fs@ruled}|\quad.
+% \end{quote}\par
+% So here is what we do: We make the first level expansion of
+% |\fst@|\meta{float type} a string so we can gobble the first four tokens
+% (= |\fs@|), so only the the name of the float style is left.\par
+% \emph{TODO:} We need to convert the catcodes here.
+% \begin{macrocode}
+ \providecommand*\float@getstyle[2]{%
+ \edef#1{%
+ \noexpand\expandafter\noexpand\@gobblefour\noexpand\string
+ \expandafter\expandafter\expandafter\noexpand
+ \csname fst@#2\endcsname}%
+ \edef#1{#1}%
+ \caption@Debug{floatstyle{#2} = `#1'}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\float@setstyle}
+% \changes{v3.1}{2007/06/10}{This macro added}
+% |\float@setstyle|\marg{type}\marg{style}\par
+% Sets or changes the float style associated with \meta{type}.
+% \begin{macrocode}
+ \providecommand*\float@setstyle[2]{%
+ \expandafter\edef\csname fst@#1\endcsname{%
+ \expandafter\noexpand\csname fs@#2\endcsname}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\float@dostyle}
+% \changes{v3.1}{2007/07/23}{This macro added}
+% |\float@dostyle|\marg{type}
+% \begin{macrocode}
+ \providecommand*\float@dostyle[1]{%
+ \@nameuse{fst@#1}\@float@setevery{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\float@ifcaption}
+% \changes{v3.1}{2007/06/23}{This macro added}
+% |\float@ifcaption|\marg{type}\marg{if-clause}\marg{else-clause}\par
+% Here we determine if the user has used |\newfloat| resp.~|\restylefloat|,
+% or |\restylefloat*|.
+% This is quite easy: If |\@float@c@|\meta{captype} is the same as
+% |\float@caption|, the user has used |\newfloat| or |\restylefloat|,
+% otherwise we assume he has used |\restylefloat*|.
+% (This test will fail if some package re-defines |\float@caption|,
+% so we have to assume that there is no one.)
+% \begin{macrocode}
+ \providecommand*\float@ifcaption[1]{%
+ \expandafter\ifx\csname @float@c@#1\endcsname\float@caption
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}}{%
+ \providecommand*\float@ifstyle[1]{\@secondoftwo}%
+ \providecommand*\float@ifcaption[1]{\@secondoftwo}%
+% \clearcaptionsetup{boxed}% used by the floatrow package?
+}
+% \end{macrocode}
+%
+% The skip between `boxed' floats and their caption defaults to |2pt|.
+%
+% \begin{macrocode}
+\captionsetup[boxed]{skip=2pt} % do not issue a warning when not used
+% \end{macrocode}
+%
+% \changes{v3.0f}{2005/05/26}{\opt{strut=0} added to caption style \opt{ruled}}
+% \changes{v3.0f}{2005/05/27}{Option \opt{ruled} fixed}
+% To emulate the `ruled' definition of |\@fs@capt| we provide a caption style
+% `ruled' with appropriate options. But if the package option |ruled| was
+% specified, we setup some caption parameters to emulate the behavior
+% of \thispackage\ \version{1.x} option |ruled| instead, i.e.,
+% the current caption settings will be used, but without margin and without
+% `single-line-check'.
+% \begin{macrocode}
+\caption@ifbool{ruled}{%
+ \captionsetup[ruled]{margin=0pt,minmargin=0,slc=0}%
+}{%
+ \DeclareCaptionStyle{ruled}{labelfont=bf,labelsep=space,strut=0}%
+}
+\caption@undefbool{ruled}
+% \end{macrocode}
+%
+% \subsubsection{The floatflt package}
+% \changes{v3.1}{2007/06/10}{Support of the \package{floatflt} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{floatflt}[1996/02/27 v1.3]{%
+% \end{macrocode}
+%
+% \begin{macro}{\floatingfigure}
+% We patch |\floatingfigure| so |\caption@floatflt| will be used.
+% \begin{macrocode}
+ \let\caption@ORI@floatingfigure\floatingfigure
+ \def\floatingfigure{%
+ \caption@floatflt{figure}%
+ \caption@ORI@floatingfigure}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\floatingtable}
+% Same with |\floatingtable|\ldots
+% \begin{macrocode}
+ \let\caption@ORI@floatingtable\floatingtable
+ \def\floatingtable{%
+ \caption@floatflt{table}%
+% \caption@setautoposition b%
+ \caption@ORI@floatingtable}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@floatflt}
+% \changes{v3.1c}{2007/10/06}{Bugfix: \cs{caption@clearmargin} added}
+% Here we do two things:
+% \begin{enumerate}
+% \item We use |\caption@setoptions{floating|\meta{type}|}| so
+% |\captionsetup[floating|\meta{type}|]{|\ldots|}| is supported.
+% \item |\linewidth| must be set correctly.
+% Usually this is done by |\@parboxrestore| inside |\@caption|,
+% but since we use |\@caption@boxrestore| we have to map this to
+% |\@parboxrestore| instead.
+% \end{enumerate}
+% \begin{macrocode}
+ \newcommand*\caption@floatflt[1]{%
+ \caption@settype{#1}%
+ \caption@clearmargin
+ \caption@setoptions{floating#1}%
+ \let\caption@boxrestore\@parboxrestore}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \iffalse
+% \subsubsection{The floatrow package}
+% \changes{v3.0f}{2005/06/01}{Support of the \package{floatrow} package added}
+%
+% \begin{macrocode}
+%\caption@IfPackageLoaded{floatrow}[2007/07/01 v0.1p]{%
+% \end{macrocode}
+%
+% The \package{floatrow} package is already adapted for usage with
+% \thispackage. So the main work has already been done by
+% Mrs.~Lapko, there is only one little thing we have to take care about:
+%
+% \begin{macro}{\caption@of}
+% Captions typeset with |\captionof| should have the correct layout,
+% therefore we have to `activate' this layout here with |\flrow@setlist|.
+% \begin{macrocode}
+% \renewcommand*\caption@of[2]{%
+% \flrow@setlist{{#2}}% TODO: always do this?
+% \caption@settype*{#2}#1}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%}{}
+% \end{macrocode}
+% \fi
+%
+% \subsubsection{The fltpage package}
+% \changes{v3.1}{2007/07/22}{Support of the \package{fltpage} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{fltpage}[1998/10/29 v.0.3]{%
+ \caption@setbool{needfreeze}{1}%
+% \end{macrocode}
+%
+% \begin{macro}{\FP@helpNote}
+% Original code:
+% \begin{verbatim}
+% \newcommand{\FP@helpNote}[2]{%
+% \typeout{FP#1 is inserted on page \pageref{#2}!}}%
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \renewcommand\FP@helpNote[2]{%
+ \begingroup % save \caption@thepage
+ \caption@pageref{#2}%
+ \typeout{FP#1 is inserted on page \caption@thepage!}%
+ \endgroup}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FP@floatBegin}
+% \changes{v3.1f}{2007/11/16}{Uses `space hack' instead of \cs{ignorespaces} now}
+% \changes{v3.1k}{2009/10/09}{Bugfix 09-09-11: Missing \cs{ignorespaces} added}
+% Original code:
+% \begin{verbatim}
+% \newcommand{\FP@floatBegin}[1]{%
+% \gdef\@captype{#1}%
+% \global\let\FP@savedCaptionCommand\caption%
+% \global\let\FP@savedLabelCommand\label%
+% \ifthenelse{\equal{\@captype}{figure}}
+% {\global\let\old@Fnum\fnum@figure}%
+% {\global\let\old@Fnum\fnum@table}%
+% \let\FP@LabelText\@empty%
+% \let\FP@CaptionText\@empty%
+% \let\FP@optionalCaptionText\@empty%
+% \renewcommand\label[1]{\gdef\FP@LabelText{##1}}%
+% \renewcommand\caption[2][]{%
+% \gdef\FP@optionalCaptionText{##1}\gdef\FP@CaptionText{##2}}%
+% \begin{lrbox}{\FP@floatCorpusBOX}%
+% }%
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \renewcommand*\FP@floatBegin[1]{%
+ \def\@captype{#1}%
+ \let\FP@LabelText\@empty
+ \begin{lrbox}{\FP@floatCorpusBOX}%
+ \caption@ifFPrefcap
+ {\caption@freeze\relax}%
+ {\def\label##1{\@bsphack\gdef\FP@LabelText{##1}\@esphack}%
+ \caption@freeze*}%
+ \ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FP@floatEnd}
+% \changes{v3.1g}{2008/01/30}{Some minor bugfixes}
+% Original code:
+% \begin{verbatim}
+% \newcommand{\FP@floatEnd}{%
+% \end{lrbox}%
+% \global\setbox\FP@floatCorpusBOX=\box\FP@floatCorpusBOX
+% \stepcounter{FP@\@captype C}%
+% \FP@savedLabelCommand{\FP@positionLabel}%
+% \FP@helpNote{\@captype}{\FP@positionLabel}%
+% \FP@float
+% {\FP@positionLabel}% location label test
+% {\begin{\@captype}[p!]
+% \usebox{\FP@floatCorpusBOX}%
+% \refstepcounter{\@captype}%
+% \ifthenelse{\equal{\FP@LabelText}{\@empty}}
+% {}{\FP@savedLabelCommand{\expandafter\protect\FP@LabelText}}%
+% \end{\@captype}}
+% {\addtocounter{\@captype}{-1}}
+% {\begin{\@captype}[b!]%
+% \ifthenelse{\equal{\FP@guide}{\@empty}}%
+% {}{\ifthenelse{\equal{\@captype}{figure}}%
+% {\renewcommand{\fnum@figure}{\old@Fnum\ {\FP@guide}}}%
+% {\renewcommand{\fnum@table}{\old@Fnum\ {\FP@guide}}}}%
+% \setlength{\abovecaptionskip}{2pt plus2pt minus 1pt} % length above caption
+% \setlength{\belowcaptionskip}{2pt plus2pt minus 1pt} % length above caption
+% \FP@separatorCaption%
+% \ifthenelse{\equal{\FP@optionalCaptionText}{\@empty}}%
+% {\FP@savedCaptionCommand{\expandafter\protect\FP@CaptionText}}%
+% {\FP@savedCaptionCommand[\expandafter\protect\FP@optionalCaptionText]%
+% {\expandafter\protect\FP@CaptionText}}%
+% \end{\@captype}}%
+% }%
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \renewcommand*\FP@floatEnd{%
+ \end{lrbox}%
+% \end{macrocode}
+% \begin{macrocode}
+ \stepcounter{FP@\@captype C}%
+ \caption@label\FP@positionLabel
+ \FP@helpNote\@captype\FP@positionLabel
+% \end{macrocode}
+% \begin{macrocode}
+ \edef\FP@RestoreCounter{%
+ \noexpand\setcounter{\@captype}{\the\value\@captype}%
+ \noexpand\setcounter{ContinuedFloat}{\the\value{ContinuedFloat}}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \FP@float
+ {\FP@positionLabel}% location label test
+ {\begin\@captype[p!]%
+ \usebox\FP@floatCorpusBOX
+ \caption@defrost@setup
+ \caption@ifFPlistcap
+ {\caption@refstepcounter\@captype
+ \expandafter\caption@makecurrent\expandafter\@captype
+ \expandafter{\caption@SClentry}}%
+ {\expandafter\captionlistentry\expandafter{\caption@SClentry}}%
+ \caption@makeanchor\relax
+ \ifx\FP@LabelText\@empty \else
+ \expandafter\label\expandafter{\FP@LabelText}%
+ \fi
+ \end\@captype}%
+ {\FP@RestoreCounter
+ \@ifundefined{theH\@captype}{}{%
+ \expandafter\l@addto@macro\csname theH\@captype\endcsname{.FP}}}%
+ {\begin\@captype[b!]%
+ \let\FP@savedSetfnumCommand\caption@setfnum
+ \def\caption@setfnum##1{%
+ \FP@savedSetfnumCommand{##1}%
+ \ifx\FP@guide\@empty \else
+ \expandafter\l@addto@macro\csname fnum@##1\endcsname{\ {\FP@guide}}%
+ \fi}%
+ \setlength\abovecaptionskip{2pt plus 2pt minus 1pt}% length above caption
+ \setlength\belowcaptionskip{2pt plus 2pt minus 1pt}% length below caption
+ \caption@setoptions{FP\@captype}%
+ \FP@separatorCaption
+ \caption@ifFPlistcap{}{\let\caption@addcontentsline\@gobbletwo}%
+ \caption@defrost
+ \end\@captype}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.1a}{2007/09/07}{\cs{DeclareFloatingEnvironment} defines FP-variant, too}
+% \changes{v3.1k}{2009/09/28}{Bugfix regarding newly defined \package{fltpage} environments}
+% \begin{macrocode}
+ \caption@For{typelist}{%
+ \newcounter{FP@#1C}%
+ \newenvironment{FP#1}{\FP@floatBegin{#1}}{\FP@floatEnd}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+}{%
+ \let\caption@ifFPlistcap\@undefined
+ \let\caption@ifFPrefcap\@undefined
+}
+% \end{macrocode}
+%
+% \subsubsection{The hyperref package}
+% \changes{v3.0f}{2005/06/11}{Support of the \package{hyperref} package added}
+% \changes{v3.1}{2007/03/09}{Usage of \cs{hyper@makecurrent} instead of
+% \cs{theHfigure} as indicator for \package{hyperref} package}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{hyperref}[2003/11/30 v6.74m]{%
+ \@ifundefined{hyper@makecurrent}{% hyperref has stopped early
+ \caption@WarningNoLine{%
+ Hyperref support is turned off\MessageBreak
+ because hyperref has stopped early}%
+ }{%
+ \g@addto@macro\caption@prepareslc{\measuring@true}%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@@refstepcounter}
+% We redefine |\caption@@refstepcounter| so |\H@refstepcounter| will be used
+% instead of |\refstepcounter| inside |\caption| \& |\captionlistentry|.
+% \begin{macrocode}
+ \renewcommand*\caption@@refstepcounter{\H@refstepcounter}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makecurrent}
+% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% We redefine |\caption@makecurrent| so a \package{hyperref} label
+% will be defined inside |\@caption|.
+% \Note{Will be redefined by \cs{caption@start}.}
+% \begin{macrocode}
+ \renewcommand*\caption@makecurrent[2]{%
+ \caption@makecurrentHref{#1}%
+ \caption@Debug{hyperref current=\@currentHref}%
+ \caption@gettitle{#2}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\caption@makecurrentHref{\hyper@makecurrent}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makeanchor}
+% \changes{v3.1l}{2010/01/09}{Adapted to the current hyperref package}
+% We redefine |\caption@makeanchor| so a \package{hyperref} anchor
+% will be set inside |\@caption|.
+% \Note{Will be redefined by \cs{caption@start}.}
+% \begin{macrocode}
+ \renewcommand\caption@makeanchor[1]{%
+ \caption@Debug{hyperref anchor: \@currentHref}%
+ % If we cannot have nesting, the anchor is empty.
+ \ifHy@nesting
+ \expandafter\hyper@@anchor\expandafter{\@currentHref}{#1}%
+ \else
+ \Hy@raisedlink{%
+ \expandafter\hyper@@anchor\expandafter{\@currentHref}{\relax}%
+ }#1%
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+ \g@addto@macro\caption@prepareslc{\let\caption@makeanchor\@firstofone}%
+% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{The hypcap option}
+%
+% \begin{macro}{\if@capstart}
+% Like the \package{hypcap} package we define the switch |\if@capstart|, too.
+% \begin{macrocode}
+ \newif\if@capstart
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@start}
+% \changes{v3.0l}{2007/02/20}{%
+% \cs{caption@currentHref} renamed to \cs{hc@currentHref}}
+% \changes{v3.1}{2007/06/21}{%
+% This macro renamed from \cs{capstart} to \cs{caption@start} and revised}
+% While the \package{hypcap} package defines a macro called |\capstart|
+% our variant is called |\caption@start| and is controlled by the option
+% |hypcap=||false|/|true|.
+% \begin{macrocode}
+ \def\caption@start{\caption@ifhypcap\caption@start@\relax}%
+ \def\caption@start@{%
+% \end{macrocode}
+% Generate the \package{hyperref} label and set the \package{hyperref} anchor,
+% usually (if |hypcap=false|) both is done inside |\@caption|.
+% \begin{macrocode}
+ \caption@makestart\@captype
+ \caption@startanchor\@currentHref
+% \end{macrocode}
+% Prevent |\@caption| from generating a new \package{hyperref} label,
+% use the label we save in |\hc@currentHref| instead.
+% (We also support the |@capstart| flag from the \package{hypcap} package.)
+% \begin{macrocode}
+ \global\@capstarttrue
+ \let\hc@currentHref\@currentHref
+ \def\caption@makecurrentHref##1{%
+ \global\@capstartfalse
+ \global\let\@currentHref\hc@currentHref}%
+% \end{macrocode}
+% Prevent |\@caption| from generating a \package{hyperref} anchor since this
+% has already been done.
+% \begin{macrocode}
+ \let\caption@makeanchor\@firstofone
+% \end{macrocode}
+% \begin{macrocode}
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makestart}
+% \changes{v3.1c}{2007/09/30}{\cs{@currentHref} will be extended by \texttt{caption}
+% instead of \texttt{xxx} now}
+% |\caption@makestart|\marg{type}
+% defines a \package{hyperref} anchor inside |\caption@start|.\par
+% Since we offer |\ContinuedFloat| the float counter can change between
+% `now' and |\caption|, i.e., we simply don't know the figure or table counter
+% yet and therefore we are not able to generate the `right' \package{hyperref}
+% label.
+% Two different solutions of this problem came into my mind:
+% \begin{enumerate}
+% \item I could use the aux file for this purpose.\par
+% -or-
+% \item I set |hypertexnames=false| locally.
+% Furthermore I use |#1.caption.|\meta{counter} (instead of |#1.|\meta{counter})
+% as naming scheme for |\@currentHref| to avoid conflicts with other hyper
+% links which are generated with |hypertexnames=true|.
+% \end{enumerate}
+% The first idea has the advantage that the `right' anchor name will be
+% generated, but one needs an additional \LaTeX\ run if figures or tables
+% will be inserted or removed.\par
+% The second idea has the advantage that it's very easy to implement, but
+% has some side-effects, e.g. the anchor names don't follow the figure or
+% table label names anymore.\par
+% Since I'm lazy I implemented the second idea, maybe I will revise this
+% later on.
+% \begin{macrocode}
+ \newcommand*\caption@makestart[1]{%
+ \begingroup
+ \Hy@hypertexnamesfalse
+% \gdef\@currentHlabel{}%
+ \hyper@makecurrent{#1.caption}%
+ \endgroup
+ \caption@Debug{hypcap start=\@currentHref}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@startanchor}
+% \changes{v3.1b}{2007/09/17}{Bugfix 06-09-17: We use \cs{caption@anchor} instead of \cs{hyper@@anchor}}
+% \changes{v3.1g}{2008/03/16}{Warning about TeX mode replaced with debug info}
+% |\caption@startanchor|\marg{Href}
+% sets a \package{hyperref} anchor inside |\caption@start|.\par
+% This code was taken from the \package{hypcap} package\cite{hypcap} and adapted.
+% \Note{Since \cs{hyper@@anchor}\marg{Href}\csmarg{\string\relax} can cause
+% a change from vertical mode to horizontal mode (design flaw in
+% \package{hyperref} package!?), and since the workaround
+% \cs{let}\cs{leavevmode}\cs{relax} which can be found in the
+% \package{hypcap} package is not always sufficient
+% (for example with ``Direct pdfmark support'' and \texttt{breaklinks=true}),
+% we use \cs{caption@anchor} instead of \cs{hyper@@anchor} here.}
+% \begin{macrocode}
+ \newcommand*\caption@startanchor[1]{%
+ \ifvmode\begingroup
+ \caption@Debug{hypcap anchor: #1 (vertical mode)}%
+ \@tempdima\prevdepth
+ \nointerlineskip
+ \vspace*{-\caption@hypcapspace}%
+ \caption@anchor{#1}%
+ \vspace*{\caption@hypcapspace}%
+ \prevdepth\@tempdima
+ \endgroup\else
+ \caption@Debug{hypcap anchor: #1 (horizontal mode)}%
+ \caption@anchor{#1}%
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@anchor}
+% \changes{v3.1c}{2007/10/17}{Workaround 07-10-17: We use \cs{caption@raisedlink} instead of \cs{Hy@raisedlink} now}
+% |\caption@anchor|\marg{Href} sets a \package{hyperref} anchor.
+% \begin{macrocode}
+ \newcommand*\caption@anchor[1]{%
+ \ifmeasuring@ \else
+ \caption@raisedlink{\hyper@anchorstart{#1}\hyper@anchorend}%
+ \fi}%
+% \end{macrocode}
+% \Note{Since \cs{Hy@raisedlink} change \cs{@tempdima} we surrounded it by \cs{ifvmode},
+% suppressing ``\texttt{LaTeX Warning: Float too large for page by 1.0pt}'' in \texttt{sideways} floats.
+% (This is not necessary since \package{hyperref} \version{6.77}.)}
+% \begin{macrocode}
+ \ifx\HyperRaiseLinkLength\@tempdima
+ \def\caption@raisedlink#1{\ifvmode#1\else\Hy@raisedlink{#1}\fi}%
+ \else
+ \let\caption@raisedlink\Hy@raisedlink
+ \fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@start}
+% Will be used by |\caption@freezeHref|. Apart from that we issue a warning
+% if we expect a saved \package{hyperref} label coming from |\caption@start|,
+% but there isn't any.
+% \begin{macrocode}
+ \def\caption@@start{%
+ \@ifundefined{hc@currentHref}{%
+ \caption@Warning{%
+ The option `hypcap=true' will be ignored for this\MessageBreak
+ particular \string\caption}}{}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@freezeHref}
+% Suppress |\caption@start| from generating a \package{hyperref} label and
+% setting a \package{hyperref} anchor. Instead if |\@caption| generates a
+% \package{hyperref} label, it will be stored in |\caption@currentHref|.
+% Furthermore we need to redefine |\caption@setfloatcapt| so no
+% \package{hyperref} anchor will be placed in |\@caption|.
+% \iffalse
+% (Since |\caption@setfloatcapt| will be set to |\@firstofone| inside
+% |\subcaption| there is no need to add its restauration to
+% |\caption@subtypehook|.)
+% \fi
+% \begin{macrocode}
+ \def\caption@freezeHref{%
+ \let\caption@ORI@start\caption@start
+ \def\caption@start{\let\caption@start\caption@ORI@start}%
+% \end{macrocode}
+% \begin{macrocode}
+% \let\caption@ORI@@start\caption@@start
+% \l@addto@macro\caption@subtypehook{%
+% \let\caption@@start\caption@ORI@@start}%
+% \end{macrocode}
+% \begin{macrocode}
+ \global\let\caption@currentHref\@undefined
+ \def\caption@@start{\global\let\caption@currentHref\@currentHref}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@ORI@setfloatcapt\caption@setfloatcapt
+ \renewcommand*\caption@setfloatcapt{%
+ \ifx\caption@currentHref\@undefined \else
+ \let\caption@makeanchor\@firstofone
+ \fi
+ \caption@ORI@setfloatcapt}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@defrostHref}
+% If there is a freezed |\@currentHref|, we set the \package{hyperref}
+% anchor here.
+% \begin{macrocode}
+ \def\caption@defrostHref{%
+ \ifx\caption@currentHref\@undefined \else
+ \caption@startanchor\caption@currentHref
+ \global\let\caption@currentHref\@undefined
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\float@makebox}
+% Do our own redefinition of |\float@makebox|, if it was redefined by
+% the \package{hyperref} package.
+% \begin{macrocode}
+ \@ifundefined{HyOrg@float@makebox}{}{%
+ \caption@Debug{%
+ Redefining \noexpand\float@makebox (again)\@gobble}%
+ \let\caption@ORI@float@makebox\float@makebox % save for compatibility mode
+ \renewcommand\float@makebox[1]{%
+ \HyOrg@float@makebox{#1\relax \caption@defrostHref}}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}}{}
+% \end{macrocode}
+%
+% \subsubsection{The hypcap package}
+% \changes{v3.0f}{2005/06/22}{Support of the \package{hypcap} package added}
+% \changes{v3.0l}{2007/02/20}{Adapted to \package{hypcap} \version{1.6}}
+% \changes{v3.1e}{2007/11/04}{\package{hypcap} support adapted to \package{hyperref} \version{6.77}}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{hypcap}{% v1.0
+ \ifx\caption@start\relax \else % hyperref hasn't stopped early
+% \end{macrocode}
+%
+% If the \package{hypcap} package was loaded, we give up our own
+% hyperlink placement algorithm and give the control over the placement
+% to the \package{hypcap} package instead.
+%
+% \begin{macro}{\capstart}
+% \changes{v3.1k}{2009/10/09}{Support of \cs{ifcapstart} (\package{hypcap} package \version{1.10}) added}
+% We do this simply by mapping |\capstart| to |\caption@start@|,
+% although our code does not behave exactly like the original one:
+% The original |\capstart| has an effect on the next |\caption|
+% only but our version affects \emph{all} |\caption|s in the same
+% environment, at least unless a new |\capstart| will be placed.
+% \begin{macrocode}
+ \let\caption@ORI@capstart\capstart % save for compatibility mode
+ \@ifundefined{capstarttrue}% check for v1.10 of hypcap package
+ {\def\capstart{\caption@start@}}%
+ {\def\capstart{\ifcapstart\caption@start@\fi}}%
+ \let\caption@start\relax
+ \let\caption@@start\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@hypcapspace}
+% Furthermore we map our |\caption@hypcapspace| to |\hypcapspace|
+% offered by the \package{hypcap} package.
+% \begin{macrocode}
+ \caption@set@bool\caption@ifhypcap 1%
+ \renewcommand*\caption@hypcapspace{\hypcapspace}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \fi}{}
+% \end{macrocode}
+%
+% \subsubsection{The listings package}
+% \changes{v3.0b}{2004/05/16}{Support of the \package{listings} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{listings}[2004/02/13 v1.2]{%
+% \end{macrocode}
+%
+% \begin{macro}{\lst@MakeCaption}
+% \changes{v3.1g}{2008/01/20}{Bugfix: Skips are handled correctly now}
+% \changes{v3.1k}{2008/03/29}{Bugfix 08-10-16-dctt: \texttt{rule=0} added}
+% To support the \package{listings} package we need to redefine
+% |\lst@MakeCaption| so the original stuff is nested with
+% |\caption@begin| and |\caption@end| etc.
+% \Note{This macro is always called twice (with `t' resp. `b' as
+% parameter), therefore we need an extra group here.}
+% \begin{macrocode}
+ \let\caption@ORI@lst@MakeCaption\lst@MakeCaption
+ \def\lst@MakeCaption#1{% #1 is `t' or `b'
+ \begingroup
+% \end{macrocode}
+% First of all, we set |position=#1| and if it was set to `top',
+% we swap the skips so the default behavior of the \package{listings} package
+% will not be changed. (Note that the \package{listings} package has set its
+% own |\abovecaptionskip| \& |\belowcaptionskip| values prior to calling
+% \cs{lst@MakeCaption}.)
+% \begin{macrocode}
+ \caption@setposition{#1}%
+ \caption@iftop{%
+ \@tempdima\belowcaptionskip
+ \belowcaptionskip\abovecaptionskip
+ \abovecaptionskip\@tempdima}{}%
+% \end{macrocode}
+% Workaround for issue with wrong skips (should be examined further)
+% \begin{macrocode}
+ \caption@setup{rule=0}%
+% \end{macrocode}
+% Afterwards we set the local `lstlisting' options.
+% \begin{macrocode}
+ \caption@setoptions{lstlisting}%
+% \end{macrocode}
+% If the |position=| is now set to |auto|, we take over the |captionpos=|
+% setting from the \package{listings} package.
+% \begin{macrocode}
+ \caption@setautoposition{#1}%
+% \end{macrocode}
+% At the end we do similar stuff as in our \cs{@caption} code.
+% \begin{macrocode}
+ \caption@begin{lstlisting}%
+ \caption@ORI@lst@MakeCaption{#1}%
+ \caption@end
+% \end{macrocode}
+% \begin{macrocode}
+ \endgroup}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\lst@makecaption}
+% \begin{macro}{\lst@maketitle}
+% Wrapper macros for typesetting the |caption=| resp. |title=| value.
+% \begin{macrocode}
+ \def\lst@makecaption{\caption@starfalse\@makecaption}%
+ \def\lst@maketitle{\caption@startrue\@makecaption\@empty}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ext@lstlisting}
+% \changes{v3.1}{2007/03/03}{This macro added}
+% Since the \package{listings} package do not define |\ext@lstlisting|,
+% but we needed it when |\captionof{lstlisting}| will be done by the end user,
+% we define it here.
+% \begin{macrocode}
+ \providecommand*\ext@lstlisting{lol}%
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.1a}{2007/07/13}{Bugfix 07-09-13: \cs{lst@@caption} will not be re-defined anymore}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The longtable package}
+%
+% \begin{macro}{\LTcaptype}
+% \changes{v3.1}{2007/07/06}{This macro and its support added}
+% |\LTcaptype| is preset to |table|.
+% \begin{macrocode}
+\providecommand*\LTcaptype{table}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{longtable}[1995/05/24 v3.14]{%
+% \end{macrocode}
+% \begin{macrocode}
+ \RequirePackage{ltcaption}[=2007/09/01]%
+ \let\LT@@makecaption\@undefined
+% \end{macrocode}
+%
+% \begin{macro}{\LT@array}
+% \changes{v3.1}{2007/07/22}{This redefinition added}
+% \changes{v3.1a}{2007/09/14}{Bugfix 07-09-14: Redefinition of \cs{@captionabovetrue} \& \cs{@captionabovefalse} added}
+% \changes{v3.1a}{2007/09/16}{Bugfix: This redefinition will always be done \cs{AtBeginDocument}}
+% \changes{v3.1g}{2008/01/20}{Bugfix in \cs{captionlistentry}: Table counter will not be incremented anymore, \cs{nameref} works}
+% We redefine |\LT@array| here to get |\captionsetup|\marg{options}
+% working inside |longtable|s.
+% \Note{Since the \package{hyperref} package patches \cs{LT@array} as well
+% and since this only works with the original definition of \cs{LT@array},
+% we have to do this after the \package{hyperref} package,
+% i.e.~\cs{AtBeginDocument}.}
+% \begin{macrocode}
+ \caption@AtBeginDocument{%
+ \let\caption@ORI@LT@array\LT@array
+ \renewcommand*\LT@array{%
+% \end{macrocode}
+% |\captionsetup| for longtable:
+% \begin{macrocode}
+ \global\let\caption@opt@@longtable\@undefined
+ \def\captionsetup{%
+ \noalign\bgroup
+ \@ifstar\@captionsetup\@captionsetup}% gobble *
+ \def\@captionsetup##1{\LT@captionsetup{##1}\egroup}%
+ \def\LT@captionsetup##1{%
+ \captionsetup@startrue\caption@setup@options[@longtable]{##1}%
+ \global\let\caption@opt@@longtable\caption@opt@@longtable}%
+% \end{macrocode}
+% |\captionabove| \& |\captionbelow| for longtable: (\KOMAScript\ document class)
+% \begin{macrocode}
+ \def\@captionabovetrue{\LT@captionsetup{position=t}}%
+ \def\@captionabovefalse{\LT@captionsetup{position=b}}%
+% \end{macrocode}
+% |\captionlistentry| for longtable:
+% \begin{macrocode}
+ \def\captionlistentry{%
+ \noalign\bgroup
+ \@ifstar{\egroup\LT@captionlistentry}% gobble *
+ {\egroup\LT@captionlistentry}}%
+ \def\LT@captionlistentry##1{%
+ \caption@listentry\@firstoftwo[\LTcaptype]{##1}}%
+% \end{macrocode}
+% |\ContinuedFloat| for longtable:\\
+% {\small(Commented out, since it's not deeply tested and quite useless anyway)}
+% \Note{\package{hyperref} versions $<$ v6.76j uses $2\times$ \cs{hyper@makecurrent}}
+% \begin{macrocode}
+% \caption@ifhypcap{%
+% \let\caption@ORI@hyper@makecurrent\hyper@makecurrent
+% \def\hyper@makecurrent##1{%
+% \let\hyper@makecurrent\caption@ORI@hyper@makecurrent
+% \caption@makestart{##1}%
+%% \let\Hy@LT@currentHlabel\@currentHlabel
+% \let\Hy@LT@currentHref\@currentHref
+% \def\hyper@makecurrent####1{%
+%% \let\@currentHlabel\Hy@LT@currentHlabel
+% \let\@currentHref\Hy@LT@currentHref}}%
+% \let\caption@ORI@ContinuedFloat\ContinuedFloat
+% \def\ContinuedFloat{\noalign{%
+% \gdef\caption@setContinuedFloat{%
+% \let\caption@resetContinuedFloat\@gobble}%
+% \def\caption@setoptions####1{%
+% \g@addto@macro\caption@setContinuedFloat{%
+% \caption@setoptions{####1}}}%
+% \let\@captype\LTcaptype
+% \caption@ORI@ContinuedFloat}}%
+% }{%
+% \def\ContinuedFloat{\noalign{%
+% \caption@Error{%
+% \noexpand\ContinuedFloat inside longtables\MessageBreak
+% is only available with `hypcap=true'}}}%
+% }%
+% \global\let\caption@setContinuedFloat\@empty
+ \def\ContinuedFloat{\noalign{%
+ \caption@Error{\noexpand\ContinuedFloat outside float}}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@ORI@LT@array}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LT@c@ption}
+% \changes{v3.1g}{2008/01/22}{Made it \cs{long}}
+% The original implementation:
+% \begin{verbatim}
+% \def\LT@c@ption#1[#2]#3{%
+% \LT@makecaption#1\fnum@table{#3}%
+% \def\@tempa{#2}%
+% \ifx\@tempa\@empty\else
+% {\let\\\space
+% \addcontentsline{lot}{table}{\protect\numberline{\thetable}{#2}}}%
+% \fi}
+% \end{verbatim}%^^A
+% Our implementation uses |\LTcaptype| instead of |{table}|:
+% \begin{macrocode}
+ \long\def\LT@c@ption#1[#2]#3{%
+ \LT@makecaption#1{\csname fnum@\LTcaptype\endcsname}{#3}%
+ \LT@captionlistentry{#2}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LT@makecaption}
+% \changes{v3.0d}{2004/08/10}{%
+% Bugfix 04-08-04: \cs{abovecaptionskip} \& \cs{belowcaptionskip} will be used now}
+% \changes{v3.0e}{2005/05/05}{%
+% Bugfix: \cs{captionsetup[longtable]} overrides \cs{LTcapwidth} now}
+% \changes{v3.0h}{2005/10/07}{\cs{caption@LT@make} introduced}
+% |\LT@makecaption|\marg{cmd}\marg{label}\marg{text}\par
+% \smallskip
+% The original definition:
+% \begin{verbatim}
+% \def\LT@makecaption#1#2#3{%
+% \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{%
+% % Based on article class "\@makecaption", "#1" is "\@gobble" in star
+% % form, and "\@firstofone" otherwise.
+% \sbox\@tempboxa{#1{#2: }#3}%
+% \ifdim\wd\@tempboxa>\hsize
+% #1{#2: }#3%
+% \else
+% \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
+% \fi
+% \endgraf\vskip\baselineskip}%
+% \hss}}}
+% \end{verbatim}%^^A
+% Our definition:
+% \begin{macrocode}
+ \renewcommand\LT@makecaption[3]{%
+ \caption@LT@make{%
+% \end{macrocode}
+%
+% If |\LTcapwidth| is not set to its default value |4in| we assume
+% that it shall overwrite our own setting.
+% (But |\captionsetup[longtable]{width=|\ldots|}| will overwrite |\LTcapwidth|.)
+% \begin{macrocode}
+ \caption@settype*\LTcaptype
+ \ifdim\LTcapwidth=4in \else
+ \setcaptionwidth\LTcapwidth
+ \fi
+ \caption@setoptions{longtable}%
+% \caption@setContinuedFloat
+ \caption@setoptions{@longtable}%
+% \end{macrocode}
+%
+% \iffalse
+% The default |position=| setting for longtables is |top|.
+% (This emulates the standard behavior of the \package{longtable} package
+% which has no skip above the caption but a skip below it.)
+% \fi
+%
+% |position=auto| is a bad idea for longtables, but we do our very best.
+% This works quite well for captions inside the longtable contents, but
+% not for captions inside the longtable (end)foot.
+% \Note{This should be `top' if unclear!}
+% \begin{macrocode}
+ \caption@setautoposition{\ifcase\LT@rows t\else b\fi}%
+% \end{macrocode}
+%
+% We set |\ifcaption@star| according the 1st argument.
+% \begin{macrocode}
+ \caption@startrue#1\caption@starfalse
+% \end{macrocode}
+%
+% \changes{v3.1}{2007/05/05}{\cs{caption@normalsize} added}
+% \begin{macrocode}
+ \caption@resetContinuedFloat\LTcaptype
+ \caption@begin\LTcaptype
+ \caption@normalsize
+% \end{macrocode}
+%
+% The following skip has the purpose to correct the height of the
+% |\parbox[t]|. Usually it's the height of the very first line, but
+% because of our extra skips (|\abovecaptionskip| and |\belowcaptionskip|)
+% it's always |0pt|.\par
+% (A different idea would be typesetting the first skip outside the longtable
+% column with |\noalign{\vskip|\ldots|}|, but this means we have to move
+% |\caption@begin| to some other place because it does not work in tabular
+% mode. And at the moment I have no idea on how to do this in an elegant
+% way\ldots)
+% \begin{macrocode}
+ \vskip-\ht\strutbox
+% \end{macrocode}
+%
+% The following code should look familiar. We do our skips and use
+% |\caption@@make| to typeset the caption itself.
+% \begin{macrocode}
+ \caption@iftop{\vskip\belowcaptionskip}{\vskip\abovecaptionskip}%
+ \caption@@make{#2}{#3}\endgraf
+ \caption@iftop{\vskip\abovecaptionskip}{\vskip\belowcaptionskip}%
+ \caption@end}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The picinpar package}
+% \changes{v3.1}{2007/06/13}{Support of the \package{picinpar} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{picinpar}{%
+% \end{macrocode}
+%
+% \begin{macro}{\figwindow}
+% \begin{macro}{\tabwindow}
+% The \package{picinpar} package comes with its own caption code
+% (|\wincaption|, |\@wincaption|, |\@makewincaption|, \ldots)
+% so we redefine |\figwindow| \& |\tabwindow| to use |\caption| instead.
+% \begin{macrocode}
+ \long\def\figwindow[#1,#2,#3,#4] {%
+ \caption@window{figure}%
+ \caption@setoptions{figwindow}%
+ \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }%
+% \end{macrocode}
+% \begin{macrocode}
+ \long\def\tabwindow[#1,#2,#3,#4] {%
+ \caption@window{table}%
+ \caption@setoptions{tabwindow}%
+ \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@window}
+% \changes{v3.1c}{2007/10/06}{Bugfix: \cs{caption@clearmargin} added}
+% Beside calling |\caption@settype| we redefine |\caption@boxrestore|
+% (as in \package{floatflt} \& \package{picins} package support)
+% and |\@makecaption| (as in \package{float} package support) here.
+% \begin{macrocode}
+ \newcommand*\caption@window[1]{%
+ \let\caption@boxrestore\@parboxrestore
+ \let\@makecaption\caption@@make
+ \caption@setautoposition b%
+ \caption@settype{#1}%
+ \caption@clearmargin}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@wincaption}
+% \changes{v3.1d}{2007/10/25}{Missing \% added}
+% This one finally typesets the caption using |\caption|.
+% \begin{macrocode}
+ \newcommand\caption@wincaption[1]{%
+% \end{macrocode}
+% This will be done twice for every |figwindow| \& |tabwindow| caption --
+% on the first run |\picwd| is |0pt|, on the second run |\picwd| is |\hsize|.
+% \begin{macrocode}
+ \ifdim\picwd=\z@
+ \let\caption@makecurrent\@gobbletwo
+ \let\caption@@start\relax
+ \caption@prepareslc
+ \fi
+% \end{macrocode}
+% The argument |#1| could contain simply the caption text
+% (e.g.~|A figure caption|), but it could also contain an optional argument,
+% the \meta{lst\_entry}
+% (e.g.~|[An| |entry| |to| |the| |LOF]||{A| |figure| |caption}|).
+% Therefore we have to test if |#1| begins with~|[| or not; furthermore we
+% support a starred variant -- as in |\caption*| -- so we test for~|*|, too.
+% \begin{macrocode}
+ \edef\@tempa{\expandafter\noexpand\@car#1\@nil}%
+ \if\@tempa*%
+ \let\@tempa\@firstofone
+ \else\if\@tempa[%]
+ \let\@tempa\@firstofone
+ \else
+ \let\@tempa\@empty
+ \fi\fi
+ \expandafter\caption\@tempa{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The picins package}
+% \changes{v3.0j}{2006/01/26}{Support of the \package{picins} package added}
+%
+% \begin{macro}{\piccaptiontype}
+% |\piccaptiontype|\marg{type}\par
+% We offer this macro for changing the \meta{type} of the caption, so the user
+% doesn't have to redefine |\@captype|, as proposed in the \package{picins}
+% documentation.
+% \Note{We define this macro here so it can be used in the
+% preamble of the document, even when \thispackage\ was loaded prior to the
+% \package{picins} package.}
+% \begin{macrocode}
+\newcommand*\piccaptiontype[1]{\def\@piccaptype{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{picins}{%
+% \end{macrocode}
+%
+% Initial set |\@piccaptype| and undefine |\@captype| which was set to
+% |figure| by the \package{picins} package.
+% \begin{macrocode}
+ \@ifundefined{@piccaptype}{%
+ \caption@iftype{%
+ \let\@piccaptype\@captype
+ }{%
+ \def\@piccaptype{figure}%
+ }%
+ }{}%
+ \let\@captype\@undefined
+% \end{macrocode}
+%
+% \begin{macro}{\piccaption}
+% The original code:
+% \begin{verbatim}
+% \def\piccaption{\@ifnextchar [{\@piccaption}{\@piccaption[]}}
+% \end{verbatim}%^^A
+% Our code uses |\caption@star| so |\piccaption*| works,
+% and |\caption@dblarg| so |\piccaption{}| works correctly.
+% \begin{macrocode}
+ \def\piccaption{\caption@star\relax{\caption@dblarg\@piccaption}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\make@piccaption}
+% \changes{v3.1}{2007/12/06}{Bugfix: \cs{caption@clearmargin} will always be used now}
+% The original code:
+% \begin{verbatim}
+% \def\make@piccaption{%
+% [...]
+% \setbox\@TEXT=\vbox{\hsize\hsiz@\caption[\sh@rtf@rm]{\capti@nt@xt}}%
+% }
+% \end{verbatim}%^^A
+% In our code we have to correct several things:
+% \begin{enumerate}
+% \item |\@captype| must be defined, since we have removed the global
+% definition.
+% \item We use |\caption@setoptions{parpic}| so
+% |\captionsetup[parpic]{|\ldots|}| is supported.
+% \item |\linewidth| must be set correctly.
+% Usually this is done by |\@parboxrestore| inside |\@caption|,
+% but since we use |\@caption@boxrestore| we have to map this to
+% |\@parboxrestore| instead.
+% \item The two arguments of |\caption| (|\sh@rtf@rm| \& |\capti@nt@xt|)
+% should be expanded on first level so |\caption[]{|\ldots|}| and
+% |\caption[|\ldots|]{}| work correctly.
+% \end{enumerate}
+% \begin{macrocode}
+ \let\caption@ORI@make@piccaption\make@piccaption
+ \def\make@piccaption{%
+ \let\caption@ORI\caption
+% \end{macrocode}
+% \begin{macrocode}
+ \long\def\caption[##1]##2{%
+ \caption@freezeHref % will be defrosted in \ivparpic
+ \caption@settype\@piccaptype
+% \ifnum\c@piccaptionpos>2\relax
+ \caption@clearmargin
+% \else
+% \captionwidth\z@ % do not use "width=" setting
+% \fi
+ \caption@setoptions{parpic}%
+ \let\caption@boxrestore\@parboxrestore
+ \caption@setautoposition b%
+% \end{macrocode}
+% \begin{macrocode}
+ \expandafter\expandafter\expandafter\caption@ORI
+ \expandafter\expandafter\expandafter[%
+ \expandafter\expandafter\expandafter{%
+ \expandafter##1\expandafter}\expandafter]\expandafter{##2}}%
+% \end{macrocode}
+% {\footnotesize\begin{quote}
+% \leavevmode\llap{-or-\quad}%^^A
+% |\begingroup|\\
+% | \toks0\expandafter{##1}| |\toks2\expandafter{##2}|\\
+% | \edef\x{\endgroup|\\
+% | \noexpand\caption@ORI[{\the\toks0}]{\the\toks2}}|\\
+% | \x|
+% \end{quote}
+% \begin{quote}
+% \leavevmode\llap{-or-\quad}%^^A
+% |\edef\x{%|\\
+% | \noexpand\caption@ORI[{\unexpanded\expandafter{##1}}]%|\\
+% | {\unexpanded\expandafter{##2}}}|\\
+% |\x|
+% \end{quote}}
+% \begin{macrocode}
+ \caption@ORI@make@piccaption
+ \let\caption\caption@ORI}%
+% \end{macrocode}
+% \end{macro}
+%
+
+% \begin{macro}{\ivparpic}
+% We need to set our \package{hyperref} anchor here.
+% Not bullet-proof since we have to redefine |\noindent| here!
+% \begin{macrocode}
+ \let\caption@ORI@ivparpic\ivparpic
+ \def\ivparpic(#1,#2)(#3,#4)[#5][#6]#7{%
+ \let\caption@ORI@noindent\noindent
+ \def\noindent{%
+ \caption@defrostHref
+ \let\noindent\caption@ORI@noindent
+ \noindent}%
+ \caption@ORI@ivparpic(#1,#2)(#3,#4)[#5][#6]{#7}%
+ \let\noindent\caption@ORI@noindent}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{%
+ \let\piccaptiontype\@undefined
+}
+% \end{macrocode}
+%
+% \subsubsection{The rotating package}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{rotating}[1995/08/22 v2.10]{%
+% \end{macrocode}
+%
+% \begin{macro}{\rotcaption}
+% \changes{v3.0c}{2004/07/16}{Bugfix: Check for \cs{caption@star} removed}
+% \changes{v3.0i}{2005/12/07}{Rewritten, works with \package{hyperref} now}
+% Make |\rotcaption*| work.
+% \begin{macrocode}
+ \def\rotcaption{\let\@makecaption\@makerotcaption\caption}%
+% \let\@rotcaption\@undefined
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\rotcaptionof}
+% \changes{v3.0i}{2005/12/07}{New}
+% Make |\rotcaptionof(*)| work.
+% \begin{macrocode}
+ \def\rotcaptionof{%
+ \caption@teststar\caption@of{\rotcaption*}\rotcaption}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makerotcaption}
+% \changes{v3.0i}{2005/12/06}{Rewritten, should finally work proper now}
+% \changes{v3.0m}{2007/03/04}{Uses \cs{caption@parbox} instead of \cs{caption@start/endbox} now}
+% Original (bugfixed) code:
+% \begin{verbatim}
+% \long\def\@makerotcaption#1#2{%
+% \setbox\@tempboxa\hbox{#1: #2}%
+% \ifdim \wd\@tempboxa > .8\vsize
+% \rotatebox{90}{%
+% \begin{minipage}{.8\textheight}#1: #2\end{minipage}%
+% }%\par % <== \par removed (AR)
+% \else%
+% \rotatebox{90}{\box\@tempboxa}%
+% \fi
+% \nobreak\hspace{12pt}% <== \nobreak added (AR)
+% }
+% \end{verbatim}%^^A
+% Our version emulates this behavior, but if |width=| is set,
+% the rotated caption is always typeset as |minipage|.
+% (Note that |margin=| is not supported here.)
+% \begin{macrocode}
+ \long\def\@makerotcaption#1#2{%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \ifdim\captionwidth=\z@
+ \setcaptionwidth{.8\textheight}%
+ \caption@slc{#1}{#2}{.8\vsize}{%
+ \let\caption@makerot\caption@@make
+ \caption@clearmargin
+% \long\def\caption@parbox##1##2{\hbox{\hsize=.8\textheight\relax##2}}%
+% (not needed because \rotatebox uses an \hbox anyway)
+ \let\caption@parbox\@secondoftwo}%
+ \caption@set@bool\caption@ifslc0% been there, done that
+ \fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \rotatebox{90}{\caption@makerot{#1}{#2}}%
+ \nobreak\hspace{12pt}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \newcommand\caption@makerot[2]{%
+ \begin{minipage}\captionwidth\caption@@make{#1}{#2}\end{minipage}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.1a}{2007/09/07}{\cs{DeclareFloatingEnvironment} defines sideways-variant, too}
+% \begin{macrocode}
+ \caption@For{typelist}{%
+ \newenvironment{sideways#1}{\@rotfloat{#1}}{\end@rotfloat}%
+ \newenvironment{sideways#1*}{\@rotdblfloat{#1}}{\end@rotdblfloat}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The sidecap package}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{sidecap}[1999/05/11 v1.4d]{%
+ \caption@setbool{needfreeze}{1}%
+% \end{macrocode}
+%
+% \begin{macro}{\SC@caption}
+% \changes{v3.0d}{2004/11/28}{Bugfix: Definition of \cs{@captype} added}
+% \changes{v3.0e}{2005/05/05}{Bugfix: Empty captions are handled correctly now}
+% \changes{v3.0e}{2005/05/05}{Priority of options fixed}
+% \changes{v3.0h}{2005/10/03}{Bugfix: Always use \cs{AtBeginDocument} to set \cs{SC@caption}}
+% First of all, we let \package{sidecap} use a current definition of |\caption|.\\
+% (This is only required for version 1.5d of the \package{sidecap} package.)
+% \begin{macrocode}
+ \caption@AtBeginDocument{\let\SC@caption=\caption}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SC@zfloat}
+% \changes{v3.0b}{2004/05/16}{Local definition of \cs{captionsetup} added}
+% \changes{v3.0c}{2004/07/16}{Bugfix 04-07-15: Check for \cs{caption@star} removed}
+% \changes{v3.1c}{2007/10/06}{\cs{caption} will be saved \& restored now}
+% This macro will be called at the start of the environment, here is a good
+% opportunity to do some adaptations to |\caption| and |\captionsetup|.
+% \begin{macrocode}
+ \let\caption@ORI@SC@zfloat\SC@zfloat
+ \def\SC@zfloat#1#2#3[#4]{%
+% \end{macrocode}
+% First we use the original definition, but save \& restore \cs{caption}
+% so \cs{caption@freeze} will work correctly.
+% \begin{macrocode}
+ \let\caption@ORI\caption
+ \caption@ORI@SC@zfloat{#1}{#2}{#3}[#4]%
+ \let\caption\caption@ORI
+% \end{macrocode}
+% Since the sidecap package uses our |\caption| code outside the
+% environment the regular |\captionsetup| will not work.
+% So we need a special version here which saves the given argument list
+% which will be executed later on.
+% Furthermore we need to make |\caption*| work.
+% \begin{macrocode}
+ \caption@settype*{#2}%
+ \caption@freeze*}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\endSC@FLOAT}
+% \changes{v3.0i}{2006/01/12}{\cs{@listdepth}\cs{z@} added}
+% \changes{v3.1}{2007/05/05}{Call of \cs{caption@setoptions}\arg{SCfloat} added}
+% This macro will be called at the end of the environment, here we need to
+% setup our stuff before the \package{sidecap} package actually typesets
+% its caption.
+% \begin{macrocode}
+ \let\caption@ORI@endSC@FLOAT\endSC@FLOAT
+ \def\endSC@FLOAT{%
+% \end{macrocode}
+% \Note{\cs{@captype} isn't defined here, this will be done inside
+% the original definition of \cs{endSC@FLOAT}. But \cs{SC@captype} is
+% defined and can be used here, if needed.}
+% \begin{macrocode}
+ \let\caption@ORI@settype\caption@settype
+ \def\caption@settype##1{% will be done in \@xfloat
+ \caption@ORI@settype*{##1}% do not change \@currentlabel
+ \caption@setSC@justify
+%%% \caption@setoptions{SCfloat}%
+ \caption@setoptions{SC\@captype}%
+ \caption@start}%
+% \end{macrocode}
+% Before we can typeset the caption we need to set the margin to zero
+% because any extra margin would only be disturbing here.\par
+% (We don't need to take care about the caption position because
+% the sidecap package set both |\abovecaptionskip| and |\belowcaptionskip|
+% to a skip of zero anyway.)\par
+% Furthermore |\SC@justify| will override the caption justification, if set.
+% The usage of |\SC@justify| differs from version to version of the
+% \package{sidecap} package:\par
+% \begin{tabular}{ll}
+% Version 1.4: & |\SC@justify| is not defined\\
+% Version 1.5: & |\SC@justify| is |\relax| when not set\\
+% Version 1.6: & |\SC@justify| is |\@empty| when not set\\
+% \end{tabular}
+% \begin{macrocode}
+ \def\caption@setSC@justify{%
+ \caption@clearmargin
+ \@ifundefined{SC@justify}{}{%
+ \ifx\SC@justify\@empty \else
+ \let\caption@hj\SC@justify
+ \let\SC@justify\@empty
+ \fi}}%
+% \end{macrocode}
+% Make the original definition of |\endSC@FLOAT| to use our caption
+% stuff instead of its own.
+% \Note{At this point the \package{sidecap} definition of \cs{caption} is valid,
+% not the regular one!}
+% \begin{macrocode}
+ \let\caption\SC@orig@caption
+ \def\SC@orig@caption[##1]##2{\caption@defrost}%
+% \end{macrocode}
+% Finally we call the original definition of |\endSC@FLOAT|.
+% \begin{macrocode}
+ \caption@setSC@justify % for compatibility mode
+ \caption@ORI@endSC@FLOAT}%
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.1a}{2007/09/07}{\cs{DeclareFloatingEnvironment} defines SC-variant, too}
+% \changes{v3.1f}{2007/12/23}{Bugfix in definition of SC-variant}
+% \begin{macrocode}
+ \newcommand*\caption@For@SC[2]{%
+ \def#1{b}% = \sidecaptionvpos{#2}{b} (v1.6)
+ \newenvironment{SC#2}%
+ {\SC@float[#1]{#2}}{\endSC@float}%
+ \newenvironment{SC#2*}%
+ {\SC@dblfloat[#1]{#2}}{\endSC@dblfloat}}%
+ \@onlypreamble\caption@For@SC
+ \caption@For{typelist}{%
+ \expandafter\caption@For@SC\csname SC@#1@vpos\endcsname{#1}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The subfigure package}
+% \changes{v3.1}{2007/04/06}{subfigure package support added (package)}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{subfigure}[2002/01/23 v2.1]{%
+% \end{macrocode}
+%
+% \begin{macro}{\sf@ifpositiontop}
+% \changes{v3.1a}{2007/09/15}{Bugfix 07-09-15: Check for \cs{@captype} added}
+% If the \package{subfigure} package is loaded, we map |\sf@ifpositiontop|
+% to |\iffiguretopcap| resp. |\iftabletopcap|, so the \package{subfigure}
+% \version{2.1} options \opt{figbotcap} etc. will still work.
+% \begin{macrocode}
+ \def\sf@ifpositiontop{%
+ \ifx\@captype\@undefined
+ \expandafter\@gobbletwo
+ \else\ifx\@captype\relax
+ \expandafter\expandafter\expandafter\@gobbletwo
+ \else
+ \expandafter\expandafter\expandafter\sf@if@position@top
+ \fi\fi}
+% \end{macrocode}
+% \begin{macrocode}
+ \def\sf@if@position@top{%
+ \@ifundefined{if\@captype topcap}%
+ {\@gobbletwo}%
+ {\@nameuse{if\@captype topcap}%
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The supertabular and xtab packages}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{supertabular}[2002/07/19 v4.1e]{%
+% \end{macrocode}
+%
+% \begin{macro}{\tablecaption}
+% \changes{v3.0e}{2005/05/05}{Made \cs{topcaption*} and \cs{bottomcaption*} work}
+% \changes{v3.1h}{2008/04/01}{Bugfix: Star variant does not increment table counter anymore}
+% Make |\topcaption*| and |\bottomcaption*| work.
+% \begin{macrocode}
+ \renewcommand*\tablecaption{%
+ \caption@star
+ {\refstepcounter{table}}%
+ {\caption@dblarg{\@xtablecaption}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@xtablecaption}
+% \changes{v3.1h}{2008/04/01}{Made \cs{nameref} \& \cs{autoref} work}
+% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% Make |\nameref| and |\autoref| work.
+% \begin{macrocode}
+ \let\caption@ORI@xtablecaption\@xtablecaption
+ \long\def\@xtablecaption[#1]#2{%
+ \caption@gettitle{#2}%
+ \caption@ORI@xtablecaption[#1]{#2}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@caption}
+% \changes{v3.0a}{2004/01/23}{Bugfix: Missing \cs{par} added}
+% \changes{v3.1h}{2008/04/01}{Bugfix: \cs{@currentlabelname} will be set now}
+% The original code:
+% \begin{verbatim}
+% \long\def\ST@caption#1[#2]#3{\par%
+% \addcontentsline{\csname ext@#1\endcsname}{#1}%
+% {\protect\numberline{%
+% \csname the#1\endcsname}{\ignorespaces #2}}
+% \begingroup
+% \@parboxrestore
+% \normalsize
+% \if@topcaption \vskip -10\p@ \fi
+% \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+% \if@topcaption \vskip 10\p@ \fi
+% \endgroup}
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \long\def\ST@caption#1[#2]#3{\par%
+ \caption@settype*{#1}%
+ \caption@setoptions{supertabular}%
+% \end{macrocode}
+% The |position=| setting will be overwritten by the
+% \package{supertabular} package: If |\topcaption| was used,
+% the position will be |top| automatically, |bottom| otherwise.
+% \begin{macrocode}
+ \def\caption@fixposition{%
+ \caption@setposition{\if@topcaption t\else b\fi}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@beginex{#1}{#2}{#3}%
+ \caption@boxrestore
+ \caption@normalsize
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+ \caption@end}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \changes{v3.1h}{2008/04/01}{Support of the xtab package added}
+% \begin{macrocode}
+\caption@IfPackageLoaded{xtab}[2000/04/09 v2.3]{%
+% \end{macrocode}
+%
+% \begin{macro}{\tablecaption}
+% Make |\topcaption*| and |\bottomcaption*| work.
+% \begin{macrocode}
+ \renewcommand*\tablecaption{%
+ \caption@star
+ {\refstepcounter{table}}%
+ {\caption@dblarg{\@xtablecaption}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@xtablecaption}
+% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% Make |\nameref| and |\autoref| work.
+% \begin{macrocode}
+ \let\caption@ORI@xtablecaption\@xtablecaption
+ \long\def\@xtablecaption[#1]#2{%
+ \caption@gettitle{#2}%
+ \caption@ORI@xtablecaption[#1]{#2}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@caption}
+% The original code:
+% \begin{verbatim}
+% \long\def\ST@caption#1[#2]#3{\par%
+% \@initisotab
+% \addcontentsline{\csname ext@#1\endcsname}{#1}%
+% {\protect\numberline{%
+% \csname the#1\endcsname}{\ignorespaces #2}}%
+% \begingroup
+% \@parboxrestore
+% \normalsize
+% %% \if@topcaption \vskip -10\p@ \fi
+% \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+% %% \if@topcaption \vskip 10\p@ \fi
+% \endgroup
+% \global\advance\ST@pageleft -\PWSTcapht
+% \ST@trace\tw@{Added caption. Space left for xtabular: \the\ST@pageleft}}
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \long\def\ST@caption#1[#2]#3{\par%
+ \caption@settype*{#1}%
+ \caption@setoptions{xtabular}%
+% \end{macrocode}
+% \begin{macrocode}
+ \def\caption@fixposition{%
+ \caption@setposition{\if@topcaption t\else b\fi}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \@initisotab
+ \caption@beginex{#1}{#2}{#3}%
+ \caption@boxrestore
+ \caption@normalsize
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+ \caption@end
+ \global\advance\ST@pageleft -\PWSTcapht
+ \ST@trace\tw@{Added caption. Space left for xtabular: \the\ST@pageleft}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The threeparttable package}
+% \changes{v3.1}{2007/05/08}{Support of the \package{threeparttable} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{threeparttable}[2003/06/13 v3.0]{%
+% \end{macrocode}
+%
+% \begin{macro}{\threeparttable}
+% Unfortunately |\@captype| is not set when |\TPT@common| will be used,
+% so we have to redefine |\threeparttable| and |\measuredfigure| instead.
+% \begin{macrocode}
+ \let\caption@ORI@threeparttable\threeparttable
+ \renewcommand*\threeparttable{%
+ \caption@settype{table}%
+ \caption@setposition a% ?
+ \caption@clearmargin
+ \caption@setoptions{threeparttable}%
+ \caption@ORI@threeparttable}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\measuredfigure}
+% Same here\ldots
+% \begin{macrocode}
+ \let\caption@ORI@measuredfigure\measuredfigure
+ \renewcommand*\measuredfigure{%
+ \caption@settype{figure}%
+ \caption@setposition a% ?
+ \caption@clearmargin
+ \caption@setoptions{measuredfigure}%
+ \caption@ORI@measuredfigure}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TPT@caption}
+% The original code:
+% \begin{verbatim}
+% \def\TPT@caption#1[#2]#3{\gdef\TPT@docapt
+% {\par\global\let\TPT@docapt\@undefined \TPT@LA@caption{#1}[{#2}]%
+% {\strut\ignorespaces#3\ifhmode\unskip\@finalstrut\strutbox\fi}}%
+% \ifx\TPT@hsize\@empty \let\label\TPT@gatherlabel \abovecaptionskip\z@skip
+% \else \TPT@docapt \fi \ignorespaces}
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \def\TPT@caption#1[#2]#3{%
+ \gdef\TPT@docapt{%
+ \global\let\TPT@docapt\@undefined
+ \caption@setautoposition\caption@TPT@position
+ \TPT@LA@caption{#1}[{#2}]{#3}}%
+ \ifx\TPT@hsize\@empty
+ \let\label\TPT@gatherlabel % Bug: does not work for measuredfigures
+ \gdef\caption@TPT@position{t}%
+ \g@addto@macro\TPT@docapt\caption@TPT@eatvskip
+ \else
+ \def\caption@TPT@position{b}%
+ \TPT@docapt
+ \fi
+ \ignorespaces}%
+% \end{macrocode}
+% \begin{macrocode}
+ %\newcommand*\caption@TPT@eatvskip{\vskip-.2\baselineskip}%
+ \def\caption@TPT@eatvskip#1\vskip{#1\@tempdima=}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The wrapfig package}
+% \changes{v3.1}{2007/05/05}{Support of the \package{wrapfig} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{wrapfig}{% ver 3.3 (Oct 12, 1999)
+% \end{macrocode}
+%
+% \begin{macro}{\float@ifstyle}
+% \changes{v3.1}{2007/06/10}{This macro added}
+% |\float@ifstyle|\marg{type}\marg{if-clause}\marg{else-clause}\par
+% (see \package{float} package support for details)
+% \begin{macrocode}
+ \providecommand*\float@ifstyle[1]{%
+ \expandafter\ifx\csname fst@#1\endcsname\relax
+ \expandafter\@secondoftwo
+ \else
+ \expandafter\@firstoftwo
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@restylewrapfloat}
+% This one redefines the |wrap#1| environment, e.g.~|wrapfigure|.
+% Our code uses |\caption@setoptions{wrapfigure}| so
+% |\captionsetup[wrapfigure]{|\ldots|}| will work.\par
+% But first we check if our redefinition was already done, this could
+% happen inside |\float@restyle| when the \package{wrapfig} support of
+% the \package{float} package was not installed successfully, so it has
+% not redefined |\wrap#1| there.
+% \begin{macrocode}
+ \newcommand*\caption@restylewrapfloat[1]{%
+ \expandafter\ifx\csname caption@OUR@wrap#1\expandafter\endcsname
+ \csname wrap#1\endcsname
+ \caption@Error{%
+ For a successful cooperation of the `wrapfig' package\MessageBreak
+ with the `float' package you should load the `wrapfig'\MessageBreak
+ package *after* the `float' package}%
+ \else
+ \expandafter\let\csname caption@ORI@wrap#1\expandafter\endcsname
+ \csname wrap#1\endcsname
+ \@namedef{wrap#1}{\caption@wrapfloat{#1}}%
+ \expandafter\let\csname caption@OUR@wrap#1\expandafter\endcsname
+ \csname wrap#1\endcsname
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@wrapfloat}
+% \begin{macrocode}
+ \newcommand*\caption@wrapfloat[1]{%
+ \caption@settype*{#1}%
+ \float@ifstyle{#1}{%
+ \ifx\WF@floatstyhook\@undefined
+ \caption@Error{%
+ For a successful cooperation of the `wrapfig' package\MessageBreak
+ with the `float' package you should use at least\MessageBreak
+ `wrapfig' version 3.6}%
+ \else
+ \float@dostyle{#1}%
+ \fi}{}%
+ \caption@clearmargin
+%%% \caption@setoptions{wrapfloat}%
+ \caption@setoptions{wrap#1}%
+ \@nameuse{caption@ORI@wrap#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% Now we redefine the \package{wrapfig} environments we know about.\par
+% If someone has placed a |\newfloat| right between |\usepackage{wrapfig}|
+% and |\usepackage{caption}| (or loads \thispackage\ first, so all these
+% patches will be done with |\AtBeginDocument|) we have bad luck since the
+% \package{float} package do not offer a list of (re)styled floats.
+% (This would finally lead to an error in |\caption@setfloatcapt|.)
+%
+% \begin{macrocode}
+ \caption@restylewrapfloat{figure}%
+ \caption@restylewrapfloat{table}%
+% \end{macrocode}
+%
+% \changes{v3.1a}{2007/09/07}{\cs{DeclareFloatingEnvironment} defines wrap-variant, too}
+% \begin{macrocode}
+ \caption@For{typelist}{%
+ \newenvironment{wrap#1}{\wrapfloat{#1}}{\endwrapfloat}%
+ \caption@restylewrapfloat{#1}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \ifx\WF@floatstyhook\@undefined \else % wrapfig v3.6
+% \end{macrocode}
+%
+% \begin{macro}{\float@restyle}
+% If the \package{wrapfig} package \version{3.6} is used, we patch
+% |\float@restyle| (if defined), too, so new or restyled floats will be
+% handled correctly, too.
+% \begin{macrocode}
+ \@ifundefined{float@restyle}{}{%
+ \toks@=\expandafter{\float@restyle{#1}% (env may or may not be defined)
+ \caption@restylewrapfloat{#1}}%
+ \edef\@tempa{\def\noexpand\float@restyle##1{\the\toks@}}%
+ \@tempa}% perform redefinitions
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\wrapfloat}
+% An additional check of the package load order:
+% If both, neither the \package{wrapfig} package nor \thispackage\ haven't
+% catch |\float@restyle|, we finally splash down at |\wrapfloat|.
+% \begin{macrocode}
+ \let\caption@ORI@wrapfloat\wrapfloat
+ \def\wrapfloat#1{%
+ \float@ifstyle{#1}{%
+ \caption@Error{%
+ For a successful cooperation of the `wrapfig' package\MessageBreak
+ with the `float' package you should load the `wrapfig'\MessageBreak
+ package *right after* the `float' package}}{}%
+ \caption@ORI@wrapfloat{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \fi % wrapfig v3.6
+% \end{macrocode}
+%
+% \begin{macro}{\WF@rapt}
+% We place our \package{hyperref} anchor here.\par
+% Original code:
+% \begin{verbatim}
+% \def\WF@rapt[#1]#2{% final two args: #1 = overhang, #2 = width,
+% \gdef\WF@ovh{#1}% hold overhang for later, when \width is known
+% \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}%
+% \ifdim\hsize>\z@ \@parboxrestore \else
+% \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption
+% \ignorespaces \fi}
+% \end{verbatim}%^^A
+% Our code:
+% \begin{macrocode}
+ \def\WF@rapt[#1]#2{% final two args: #1 = overhang, #2 = width,
+ \gdef\WF@ovh{#1}% hold overhang for later, when \width is known
+ \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}%
+ \caption@start
+ \ifdim\hsize>\z@ \@parboxrestore \else
+ \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption
+ \ignorespaces \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \begin{thebibliography}{99}
+% \bibitem{TLC2}
+% Frank Mittelbach and Michel Goossens:\\
+% \newblock {\em The {\LaTeX} Companion (2nd.~Ed.)},\\
+% \newblock Addison-Wesley, 2004.
+%
+% \bibitem{beamer}
+% Till Tantau:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/beamer/}%
+% {\emph{User Guide to the Beamer Class, Version 3.07}},\\
+% March 11, 2007
+%
+% \bibitem{KOMAScript}
+% Markus Kohm \& Jens-Uwe-Morawski:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/koma-script/}%
+% {\emph{KOMA-Script -- a versatile \LaTeXe\ bundle}},\\
+% 2007-01-09
+%
+% \bibitem{NTG}
+% Victor Eijkhout:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/ntgclass/}%
+% {\emph{An introduction to the Dutch \LaTeX\ document classes}},\\
+% 3 September 1989
+%
+% \bibitem{float}
+% Anselm Lingnau:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/float/}%
+% {\emph{An Improved Environment for Floats}},\\
+% 2001/11/08
+%
+% \bibitem{floatflt}
+% Mats Dahlgren:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/floatflt/}%
+% {\emph{Welcome to the floatflt package}},\\
+% 1998/06/05
+%
+% \bibitem{floatrow}
+% Olga Lapko:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/floatrow/}%
+% {\emph{The floatrow package documentation}},\\
+% 2007/08/24
+%
+% \bibitem{fltpage}
+% Sebastian Gross:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/fltpage/}%
+% {\emph{Welcome to the beta test of fltpage package!}},\\
+% 1998/11/13
+%
+% \bibitem{hyperref}
+% Sebastian Rahtz \& Heiko Oberdiek:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/hyperref/}%
+% {\emph{Hypertext marks in \LaTeX}},\\
+% November 12, 2007
+%
+% \bibitem{hypcap}
+% Heiko Oberdiek:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/oberdiek/}%
+% {\emph{The hypcap package -- Adjusting anchors of captions}},\\
+% 2007/04/09
+%
+% \bibitem{listings}
+% Carsten Heinz \& Brooks Moses:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/listings/}%
+% {\emph{The Listings Package}},\\
+% 2007/02/22
+%
+% \bibitem{longtable}
+% David Carlisle:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/required/tools/}%
+% {\emph{The longtable package}},\\
+% 2004/02/01
+%
+% \bibitem{picinpar}
+% Friedhelm Sowa:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex209/contrib/picinpar/}%
+% {\emph{Pictures in Paragraphs}},\\
+% July 13, 1993
+%
+% \bibitem{picins}
+% Joachim Bleser and Edmund Lang:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex209/contrib/picins/}%
+% {\emph{PicIns-Benutzerhandbuch Version 3.0}},\\
+% September~1992
+%
+% \bibitem{rotating}
+% Sebastian Rahtz and Leonor Barroca:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/rotating/}%
+% {\emph{A style option for rotated objects in \LaTeX}},\\
+% 1997/09/26
+%
+% \bibitem{sidecap}
+% Rolf Niepraschk \& Hubert G\"a\ss lein:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/sidecap/}%
+% {\emph{The sidecap package}},\\
+% 2003/06/06
+%
+% \bibitem{subfigure}
+% Steven D. Cochran:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/subfigure/}%
+% {\emph{The subfigure package}},\\
+% 2002/07/02
+%
+% \bibitem{subfig}
+% Steven D. Cochran:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/subfig/}%
+% {\emph{The subfig package}},\\
+% 2005/07/05
+%
+% \bibitem{supertabular}
+% Johannes Braams and Theo Jurriens:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/supertabular/}%
+% {\emph{The supertabular environment}},\\
+% 2002/07/19
+%
+% \bibitem{threeparttable}
+% Donald Arseneau:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/misc/}%
+% {\emph{Three part tables: title, tabular environment, notes}},\\
+% 2003/06/13
+%
+% \bibitem{wrapfig}
+% Donald Arseneau:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/wrapfig/}%
+% {\emph{WRAPFIG.STY ver 3.6}},\\
+% 2003/01/31
+%
+% \bibitem{xtab}
+% Peter Wilson:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/xtab/}%
+% {\emph{The xtab package}},\\
+% 2004/05/24
+%
+% \bibitem{Anne}
+% Anne Br\"uggemann-Klein:\\
+% \emph{Einf\"uhrung in die Dokumentverarbeitung},\\
+% B.G. Teubner, Stuttgart, 1989
+%
+% \bibitem{refcount}
+% Heiko Oberdiek:\\
+% \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/oberdiek/refcount.pdf}%
+% {\emph{The refcount package}},\\
+% 2006/02/20
+% \end{thebibliography}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/caption/fallback/v3.2/caption.dtx b/Master/texmf-dist/source/latex/caption/fallback/v3.2/caption.dtx
new file mode 100644
index 00000000000..7f31da44f24
--- /dev/null
+++ b/Master/texmf-dist/source/latex/caption/fallback/v3.2/caption.dtx
@@ -0,0 +1,4521 @@
+% \iffalse meta-comment
+%
+% This is file `caption.dtx'.
+%
+% Copyright (C) 1994-2011 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%
+% --------------------------------------------------------------------------
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Axel Sommerfeldt.
+%
+% This work consists of the files caption.ins, caption.dtx, caption2.dtx,
+% caption3.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx, and newfloat.dtx,
+% the derived files caption.sty, caption2.sty, caption3.sty,
+% bicaption.sty, ltcaption.sty, subcaption.sty, and newfloat.sty,
+% and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex.
+%
+% \fi
+% \CheckSum{3534}
+%
+% \iffalse
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption.drv}[2011/08/06 v3.2 Implementation of the caption package]
+\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
+%\errorcontextlines=3
+%
+\documentclass{ltxdoc}
+\setlength\parindent{0pt}
+\setlength\parskip{\smallskipamount}
+%
+\makeatletter % make room for subsections like 2.16.14 in the TOC
+%\newcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
+\renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.7em}}
+\makeatother
+%
+\usepackage{ifpdf}
+\ifpdf
+ \usepackage{mathptmx,courier}
+ \usepackage[scaled=0.90]{helvet}
+ \addtolength\marginparwidth{15pt}
+\fi
+%
+\usepackage{hypdoc}
+\ifpdf\usepackage{hypdestopt}\fi
+\hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}}
+%
+\usepackage[debug]{caption}[2010/09/01]
+%
+\DeclareRobustCommand*\eTeX{\texorpdfstring
+ {\leavevmode\hbox{$\varepsilon$}-\TeX}%
+ {e-TeX}}
+\DeclareRobustCommand*\AmS{\texorpdfstring
+ {{\protect\usefont{OMS}{cmsy}{m}{n}A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}%
+ {AMS}}
+\DeclareRobustCommand*\KOMAScript{\texorpdfstring
+ {\textsf{K\kern.05em O\kern.05em M\kern.05em A\kern.1em-\kern.1em Script}}%
+ {KOMA-Script}}
+\DeclareRobustCommand*\NTG{NTG}
+\DeclareRobustCommand*\SmF{SMF}
+%
+\begin{document}
+ \DocInput{caption.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \newcommand*\purerm[1]{{\upshape\mdseries\rmfamily #1}}
+% \newcommand*\puresf[1]{{\upshape\mdseries\sffamily #1}}
+% \newcommand*\purett[1]{{\upshape\mdseries\ttfamily #1}}
+% \let\class\puresf \let\package\puresf
+% \let\env\purett \let\opt\purett
+%
+% \def\thispackage{the \package{caption} package}
+% \def\Thispackage{The \package{caption} package}
+%
+% \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
+% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
+% \newcommand*\version[2][]{\textit{v#2}}
+% \newcommand*\x{\discretionary{-}{}{}}
+% \newcommand*\xx{\discretionary{}{}{}}
+%
+% \GetFileInfo{caption.drv}
+% \let\docdate\filedate
+% \GetFileInfo{caption.sty}
+%
+% \title{The Implementation of
+% \texorpdfstring{\thispackage\thanks{%^^A
+% This package has version number \fileversion, last revised \filedate.}}%^^A
+% {the caption package}}
+% \author{Axel Sommerfeldt\\
+% \href{mailto:axel.sommerfeldt@f-m.fm}{\texttt{axel.sommerfeldt@f-m.fm}}}
+% \date{\docdate}
+% \maketitle
+%
+% \begin{abstract}
+% \Thispackage\ consists of two parts -- the kernel
+% (|caption3.sty|) and the main package (|caption.sty|).
+%
+% \Thispackage\ redefines the \LaTeX\ commands
+% |\caption|, |\@caption|, and |\@makecaption| and maps the latter one to
+% |\caption@@make|, giving the user the possibility to control the look \& feel
+% of the captions from floating environments like |figure| and |table|.
+% Furthermore it does similar to the caption stuff coming from other packages
+% (like the \package{longtable} or \package{supertabular} package):
+% Mapping the appropriate internal commands (like |\LT@makecaption| or
+% |\ST@caption|) to the ones offered by the \package{caption3} kernel.
+% So you can think of \thispackage\ as a layer package, it
+% simply provides adaptation layers between the caption stuff coming from
+% \LaTeXe\ or packages, and the caption stuff offered by the
+% \package{caption3} kernel.
+% \end{abstract}
+%
+% \section*{User manuals}
+%
+% This document is describing the code implementation only. The user
+% documentation can be found in
+% \nopagebreak\begin{quote}
+% \begin{tabular}{ll}
+% \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/caption/caption-eng.pdf}%
+% {\texttt{caption-eng.pdf}} & The English documentation \\
+% \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/caption/caption-rus.pdf}%
+% {\texttt{caption-rus.pdf}} & The Russian documentation\footnotemark \\
+% \href{ftp://dante.ctan.org/tex-archive/macros/latex/contrib/caption/caption-deu.pdf}%
+% {\texttt{caption-deu.pdf}} & The German documentation \\
+% \end{tabular}
+% \footnotetext{Thanks a lot to Olga Lapko for this translation}
+% \end{quote}
+%
+% \StopEventually{}
+% \clearpage
+% \tableofcontents
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \DoNotIndex{\\,\_,\ ,\@@par}
+% \DoNotIndex{\@bsphack}
+% \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
+% \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
+% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
+% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
+% \DoNotIndex{\if@minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@minipagefalse,\@minipagetrue}
+% \DoNotIndex{\@namedef,\@nameuse}
+% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
+% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setminipage,\@setpar}
+% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
+% \DoNotIndex{\@testopt}
+% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
+% \DoNotIndex{\p@,\z@}
+% \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
+% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
+% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
+% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
+% \DoNotIndex{\fi,\footnotesize,\global}
+% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
+% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
+% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
+% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
+% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
+% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
+% \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
+% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
+% \DoNotIndex{\providecommand,\quad}
+% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
+% \DoNotIndex{\rightskip,\rmfamily}
+% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
+% \DoNotIndex{\small,\string,\space,\strut}
+% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
+% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
+% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
+% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
+% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
+% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
+% \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \setlength{\parskip}{0pt plus 1pt}
+% \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
+%
+% \changes{v1.0}{1994/10/27}{First release}
+% \changes{v1.1}{1994/11/03}{New option \texttt{centerlast}}
+% \changes{v1.2}{1994/11/28}{Support of the \package{float} package}
+% \changes{v1.3}{1995/01/09}{Support of \cs{captionlabelfont} in subcaptions}
+% \changes{v1.4}{1995/01/30}{New option \texttt{nooneline}}
+% \changes{v1.4b}{1995/04/05}{Bugfix release}
+% \changes{v3.0}{2003/12/20}{Rewritten; many new commands and features}
+% \changes{v3.0d}{2004/11/28}{Split into two packages:
+% \package{caption} \& \package{caption3}}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \let\subsubsection\subsection
+% \let\subsection\section
+%
+% \iffalse
+%<*package>
+% \fi
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesPackage{caption}[2011/11/10 v3.2e Customizing captions (AR)]
+%\@ifundefined{PackageRedefines}{}{\PackageRedefines{caption}{caption}}
+% \end{macrocode}
+%
+% \subsection{Loading the kernel}
+%
+% \begin{macrocode}
+\RequirePackage{caption3}[=2011/08/30] % needs v1.4 or newer
+% \end{macrocode}
+%
+% \subsection{Check against incompatible document classes}
+%
+% \begin{macrocode}
+\caption@ifbool{documentclass}{}{%
+ \caption@WarningNoLine{%
+ Unsupported document class (or package) detected,\MessageBreak
+ usage of the caption package is not recommended}%
+ \caption@InfoNoLine{\string\@makecaption\space=\space\meaning\@makecaption}%
+}
+% \end{macrocode}
+%
+% \subsection{Check against incompatible packages}
+%
+% \changes{v3.0p}{2007/04/06}{Check against obsolete \package{caption2} package added}
+% \begin{macrocode}
+\@ifpackageloaded{caption2}{%
+ \caption@Error{%
+ You can't use both, the (obsolete) caption2 *and*\MessageBreak
+ the (current) caption package}%
+ \endinput
+}{}
+% \end{macrocode}
+%
+% \changes{v3.1}{2007/06/15}{Check against incompatible \package{ftcap} package added}
+% \changes{v3.1}{2007/06/15}{Check against incompatible \package{nonfloat} package added}
+% \changes{v3.1}{2007/06/18}{Check against incompatible \package{topcapt} package added}
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \@ifpackageloaded{ftcap}{\caption@DisablePositionOption{ftcap}}{}%
+ \@ifpackageloaded{nonfloat}{\caption@DisablePositionOption{nonfloat}}{}%
+ \@ifpackageloaded{topcapt}{\caption@DisablePositionOption{topcapt}}{}}
+% \end{macrocode}
+% \begin{macro}{\caption@DisablePositionOption}
+% \changes{v3.1g}{2008/03/20}{\texttt{position=b} added}
+% \changes{v3.1h}{2008/03/29}{%
+% Name changed from \cs{caption@IncompatiblePackage} to \cs{caption@DisablePositionOption};
+% moved from package to kernel; disables the `position' option now instead of issuing a warning}
+% |\caption@DisablePositionOption|\marg{package}\par
+% disables the `position' option.
+% \begin{macrocode}
+\newcommand*\caption@DisablePositionOption[1]{%
+ \caption@InfoNoLine{%
+ `#1' package detected; setting `position=b' for compatibility reasons}%
+ \caption@setposition b%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionOption{position}{%
+ \caption@Error{Usage of the `position' option is incompatible\MessageBreak
+ to the `#1' package}}}
+% \end{macrocode}
+% \begin{macrocode}
+\@onlypreamble\caption@DisablePositionOption
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Declaration of options}
+%
+% \subsubsection{Options for figure and table}
+%
+% \changes{v3.0a}{2004/01/09}{Options \opt{figureposition} and \opt{tableposition} added}
+% \begin{macrocode}
+\DeclareCaptionOption{figureposition}{%
+ \captionsetup*[figure]{position=#1}}
+\@onlypreamble@key{caption}{figureposition}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{tableposition}{%
+ \captionsetup*[table]{position=#1}}
+\@onlypreamble@key{caption}{tableposition}
+% \end{macrocode}
+%
+% \changes{v3.0d}{2004/08/03}{Options \opt{figurename} and \opt{tablename} added}
+% \changes{v3.1}{2007/07/04}{Options \opt{figurename} and \opt{tablename} re-written}
+% \changes{v3.1f}{2007/11/18}{Options \opt{figurename} and \opt{tablename} are now
+% available after the document preamble, too.}
+% \changes{v3.1f}{2007/11/18}{Option \opt{name} added}
+% \begin{macrocode}
+\DeclareCaptionOption{figurename}{\caption@SetName{figure}{#1}}
+\DeclareCaptionOption{tablename}{\caption@SetName{table}{#1}}
+\DeclareCaptionOption{name}{\caption@setname\@captype{#1}}
+% \end{macrocode}
+%
+% \changes{v3.1g}{2008/02/28}{Options \opt{listfigurename} and \opt{listtablename} added}
+% \begin{macrocode}
+\DeclareCaptionOption{listfigurename}{\caption@SetName{listfigure}{#1}}
+\DeclareCaptionOption{listtablename}{\caption@SetName{listtable}{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@SetName}
+% \changes{v3.1}{2007/07/04}{This macro added}
+% \changes{v3.1f}{2007/11/18}{After-preamble variant added}
+% \changes{v3.1g}{2008/02/28}{Renamed from \cs{caption@SetFloatName} to \cs{caption@SetName}}
+% \changes{v3.1i}{2008/08/02}{Bugfix: Works now without \cs{addto}, too}
+% \changes{v3.2d}{2011/10/29}{Outsourced to \package{newfloat} package}
+% |\caption@SetName|\marg{cmd}\marg{value}
+% \begin{macrocode}
+\newcommand*\caption@SetName{%
+ \RequirePackage{newfloat}%
+ \newfloat@setname}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setname[2]{\@namedef{#1name}{#2}}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@AtBeginDocument{\let\caption@SetName\caption@setname}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.1f}{2007/12/21}{Options \opt{figurewithin} and \opt{tablewithin} added}
+% \changes{v3.1i}{2008/04/13}{Option \opt{within} added}
+% \changes{v3.1l}{2010/01/09}{The \opt{within} options are now available within the document, too}
+% \changes{v3.1l}{2010/01/09}{The global \opt{within} option will now affect user-defined
+% floats declared with \cs{DeclareCaptionType}, too}
+%
+% \begin{macro}{\caption@DeclareWithinOption}
+% \changes{v3.1l}{2010/01/09}{This macro and its usage added}
+% \begin{macrocode}
+\newcommand*\caption@DeclareWithinOption[1]{%
+ \DeclareCaptionOption{#1within}{\caption@Within{#1}{##1}}%
+ \DeclareCaptionOptionNoValue{#1without}{\caption@Within{#1}{none}}}
+\@onlypreamble\caption@DeclareWithinOption
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\caption@DeclareWithinOption{figure}
+\caption@DeclareWithinOption{table}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{within}{%
+ \RequirePackage{newfloat}%
+ \newfloatsetup{within=#1}}
+\DeclareCaptionOptionNoValue{without}{%
+ \RequirePackage{newfloat}%
+ \newfloatsetup{without}}
+% \end{macrocode}
+% \begin{macro}{\caption@Within}
+% \changes{v3.1}{2007/12/21}{This macro added}
+% \changes{v3.2d}{2011/10/29}{Outsourced to \package{newfloat} package}
+% \begin{macrocode}
+\newcommand*\caption@Within{%
+ \RequirePackage{newfloat}%
+ \newfloat@setwithin}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Miscellaneous options}
+%
+% \begin{macrocode}
+\DeclareCaptionOption*{config}[caption]{%
+ \InputIfFileExists{#1.cfg}%
+ {\typeout{*** Local configuration file #1.cfg used ***}}%
+ {\caption@Warning{Configuration file #1.cfg not found}}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setparboxrestore}
+% \changes{v3.2}{2010/11/07}{This macro added}
+% |\caption@setparboxrestore|\marg{\purett{partial} or \purett{full}}
+% \begin{macrocode}
+\newcommand*\caption@setparboxrestore[1]{%
+ \caption@ifinlist{#1}{full}{%
+ \caption@setfullparboxrestore
+ }{\caption@ifinlist{#1}{default,light,partial}{%
+ \let\caption@parboxrestore\@secondoftwo
+ }{%
+ \caption@Error{Undefined parboxrestore `#1'}%
+ }}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setfullparboxrestore}
+% \changes{v3.2}{2010/11/07}{This macro added}
+% |\caption@setfullparboxrestore|\par
+% This is an abbreviation for |\caption@setparboxrestore{full}|.
+% \begin{macrocode}
+\newcommand*\caption@setfullparboxrestore{%
+ \let\caption@parboxrestore\@firstoftwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.2}{2010/11/07}{Option \opt{parboxrestore} added}
+% \begin{macrocode}
+\DeclareCaptionOption{parboxrestore}{\caption@setparboxrestore{#1}}
+\captionsetup{parboxrestore=default}
+% \end{macrocode}
+%
+% \changes{v3.1f}{2007/11/28}{Option \opt{@minipage=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{@minipage}{%
+ \caption@ifinlist{#1}{auto,default}%
+ {\let\caption@if@minipage\@gobbletwo}%
+ {\caption@set@bool\caption@if@minipage{#1}}}
+\captionsetup{@minipage=default}
+% \end{macrocode}
+%
+% \subsubsection{caption v1.x compatibility options}
+% \changes{v3.1}{2007/07/21}{Option `compatibility' added}
+% \changes{v3.1}{2007/09/01}{caption v1.x compatibility options revised}
+% \changes{v3.1d}{2007/10/24}{Bugfix 07-10-24 in caption v1.x$ compatibility options}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{compatibility}[1]{\caption@setbool{compatibility}{#1}}
+\@onlypreamble@key{caption}{compatibility}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{normal}{%
+ \caption@setformat{plain}%
+ \caption@setjustification{justified}}
+\DeclareCaptionOptionNoValue*{isu}{%
+ \caption@setformat{hang}%
+ \caption@setjustification{justified}}
+\DeclareCaptionOptionNoValue*{hang}{%
+ \caption@setformat{hang}%
+ \caption@setjustification{justified}}
+\DeclareCaptionOptionNoValue*{center}{%
+ \caption@setformat{plain}%
+ \caption@setjustification{centering}}
+\DeclareCaptionOptionNoValue*{anne}{%
+ \caption@setformat{plain}%
+ \caption@setjustification{centerlast}}
+\DeclareCaptionOptionNoValue*{centerlast}{%
+ \caption@setformat{plain}%
+ \caption@setjustification{centerlast}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{scriptsize}{\def\captionfont{\scriptsize}}
+\DeclareCaptionOptionNoValue*{footnotesize}{\def\captionfont{\footnotesize}}
+\DeclareCaptionOptionNoValue*{small}{\def\captionfont{\small}}
+\DeclareCaptionOptionNoValue*{normalsize}{\def\captionfont{\normalsize}}
+\DeclareCaptionOptionNoValue*{large}{\def\captionfont{\large}}
+\DeclareCaptionOptionNoValue*{Large}{\def\captionfont{\Large}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{up}{\l@addto@macro\captionlabelfont\upshape}
+\DeclareCaptionOptionNoValue*{it}{\l@addto@macro\captionlabelfont\itshape}
+\DeclareCaptionOptionNoValue*{sl}{\l@addto@macro\captionlabelfont\slshape}
+\DeclareCaptionOptionNoValue*{sc}{\l@addto@macro\captionlabelfont\scshape}
+\DeclareCaptionOptionNoValue*{md}{\l@addto@macro\captionlabelfont\mdseries}
+\DeclareCaptionOptionNoValue*{bf}{\l@addto@macro\captionlabelfont\bfseries}
+\DeclareCaptionOptionNoValue*{rm}{\l@addto@macro\captionlabelfont\rmfamily}
+\DeclareCaptionOptionNoValue*{sf}{\l@addto@macro\captionlabelfont\sffamily}
+\DeclareCaptionOptionNoValue*{tt}{\l@addto@macro\captionlabelfont\ttfamily}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{nooneline}{\caption@setbool{slc}{0}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\caption@setbool{ruled}{0}
+\DeclareCaptionOptionNoValue*{ruled}{\caption@setbool{ruled}{1}}
+% \end{macrocode}
+%
+% \subsubsection{caption2 v2.x compatibility options}
+% \changes{v3.0h}{2005/07/08}{caption2 \version{2.x} compatibility options added}
+% \changes{v3.1}{2007/09/01}{caption2 v2.x compatibility options revised}
+% \changes{v3.1d}{2007/10/24}{Bugfix 07-10-24 in caption v2.x$ compatibility options}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{flushleft}{%
+ \caption@setformat{plain}%
+ \caption@setjustification{raggedright}}
+\DeclareCaptionOptionNoValue*{flushright}{%
+ \caption@setformat{plain}%
+ \caption@setjustification{raggedleft}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{oneline}{\caption@setbool{slc}{1}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{ignoreLTcapwidth}{%
+ \caption@WarningNoLine{Obsolete option `ignoreLTcapwidth' ignored}}
+% \end{macrocode}
+%
+% \subsubsection{Obsolete caption v3.0 options}
+% \changes{v3.1}{2007/05/07}{Package option \opt{caption} marked as obsolete,
+% gives error now}
+%
+% \begin{macrocode}
+\DeclareCaptionOption*{caption}{%
+ \caption@setbool{temp}{#1}%
+ \caption@ifbool{temp}{}{%
+ \caption@Error{%
+ The package option `caption=#1' is obsolete.\MessageBreak
+ Please pass this option to the subfig package instead\MessageBreak
+ and do *not* load the caption package anymore}}}
+% \end{macrocode}
+%
+% \subsubsection{fltpage package support options}
+%
+% \changes{v3.1}{2007/09/01}{Options `FPlist' \& `FPref' added}
+% With these options is controlled where the list-of entry and |\ref| resp.
+% |\pageref| or |\autoref| will link to.
+% Defaults are |FPlist=caption| and |FPref=figure| which is inconsistent,
+% but compatible to the usual behaviour of the \package{fltpage} package.
+% \begin{macrocode}
+\DeclareCaptionOption{FPlist}[1]{\caption@setFPoption{list}{#1}}
+\DeclareCaptionOption{FPref}[1]{\caption@setFPoption{ref}{#1}}
+\@onlypreamble@key{caption}{FPlist}
+\@onlypreamble@key{caption}{FPref}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setFPoption[2]{%
+ \edef\caption@tempa{\@car#2\@nil}%
+ \caption@setbool{FP#1cap}{\if c\caption@tempa 1\else 0\fi}}
+\@onlypreamble\caption@setFPoption
+% \end{macrocode}
+% \begin{macrocode}
+\captionsetup{FPlist=caption,FPref=figure}
+% \end{macrocode}
+%
+% \subsubsection{hyperref package support options}
+%
+% \changes{v3.1}{2007/06/21}{Options `hypcap' \& `hypcapspace' added}
+% With |hypcap=off| one can turn the \package{hypcap} support off
+% (default is |on|).
+% \begin{macrocode}
+\DeclareCaptionOption{hypcap}[1]{\caption@setbool{hypcap}{#1}}
+\DeclareCaptionOption{hypcapspace}{\def\caption@hypcapspace{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\captionsetup{hypcap=1,hypcapspace=.5\baselineskip}
+% \end{macrocode}
+%
+% \subsection{\AmS{} \& \SmF{} document classes support}
+% \changes{v3.1}{2007/07/29}{\AmS\ \& \SmF\ document classes support added}
+%
+% \begin{macrocode}
+\caption@ifamsclass{%
+ \caption@InfoNoLine{AMS or SMF document class}%
+% \end{macrocode}
+% \begin{macrocode}
+ \setlength\belowcaptionskip{0pt}% set to 12pt by AMS class
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsection{\KOMAScript{} document classes support}
+% \changes{v3.0a}{2004/01/18}{Minimum adaptation to \KOMAScript\ added}
+% \changes{v3.0h}{2005/08/22}{\KOMAScript\ compatibility options added}
+% \changes{v3.0i}{2005/11/17}{\KOMAScript\ compatibility commands added}
+% \changes{v3.0l}{2007/02/18}{\KOMAScript\ compatibility revised}
+% \changes{v3.1}{2007/03/17}{\KOMAScript\ compatibility options removed}
+% \changes{v3.1}{2007/04/05}{\KOMAScript\ compatibility revised \& enhanced}
+%
+% \begin{macrocode}
+\caption@ifkomaclass{%
+ \caption@InfoNoLine{KOMA-Script document class}%
+% \end{macrocode}
+%
+% Here we emulate the caption related commands and take over the caption
+% related settings from the \KOMAScript\ classes.
+%
+% \begin{macro}{\@tablecaptionabovetrue}
+% \begin{macro}{\@tablecaptionabovefalse}
+% \changes{v3.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
+% \begin{macrocode}
+ \g@addto@macro\@tablecaptionabovetrue{\captionsetup*[table]{position=t}}
+ \g@addto@macro\@tablecaptionabovefalse{\captionsetup*[table]{position=b}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+ \if@tablecaptionabove
+ \@tablecaptionabovetrue
+ \else
+ \@tablecaptionabovefalse
+ \fi
+% \end{macrocode}
+%
+% \begin{macro}{\onelinecaptionstrue}
+% \begin{macro}{\onelinecaptionsfalse}
+% \changes{v3.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
+% \begin{macrocode}
+ \g@addto@macro\onelinecaptionstrue{\let\caption@ifslc\@firstoftwo}
+ \g@addto@macro\onelinecaptionsfalse{\let\caption@ifslc\@secondoftwo}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+ \ifonelinecaptions
+ \onelinecaptionstrue
+ \else
+ \onelinecaptionsfalse
+ \fi
+% \end{macrocode}
+%
+% \begin{macro}{\@captionabovetrue}
+% \begin{macro}{\@captionabovefalse}
+% \changes{v3.0j}{2006/03/21}{Bugfix 06-03-21:
+% \cs{let}\cs{caption@setposition}\cs{@gobble} added}
+% \changes{v3.0n}{2006/03/09}{Accidentally this got broken in \version{3.0m}, fixed}
+% \changes{v3.1}{2007/03/31}{We redefine \cs{captionabovetrue/false} now
+% instead of \cs{captionabove/below}}
+% \changes{v3.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
+% \changes{v3.1k}{2009/10/09}{\opt{figureposition} and \opt{tableposition} will issue a warning now}
+% Please note that these are stronger than the \opt{position} setting, therefore we
+% override the options \opt{figureposition} and \opt{tableposition} to typeout a warning.
+% \begin{macrocode}
+ \g@addto@macro\@captionabovetrue{\let\caption@position\@firstoftwo}
+ \g@addto@macro\@captionabovefalse{\let\caption@position\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionOption{figureposition}{%
+ \caption@WarningNoLine{Option `figureposition=#1' has no effect\MessageBreak
+ when used with a KOMA script document class}}
+ \DeclareCaptionOption{tableposition}{%
+ \caption@WarningNoLine{Option `tableposition=#1' has no effect\MessageBreak
+ when used with a KOMA script document class}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\setcapindent}
+% \begin{macrocode}
+ \let\caption@KOMA@setcapindent\@setcapindent
+ \renewcommand*\@setcapindent[1]{%
+ \caption@KOMA@setcapindent{#1}\caption@setcapindent}
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@KOMA@@setcapindent\@@setcapindent
+ \renewcommand*\@@setcapindent[1]{%
+ \caption@KOMA@@setcapindent{#1}\caption@setcapindent}
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\caption@setcapindent{%
+ \captionsetup{indent=\ifdim\cap@indent<\z@\z@\else\cap@indent\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \caption@ifundefined\cap@indent{}{\caption@setcapindent}
+% \end{macrocode}
+%
+% \begin{macro}{\setcapwidth}
+% \Note{The optional argument of \cs{setcapwidth} if not supported (yet),
+% so we issue a warning if used.
+% (Since this does not seem to have an negative effect when used
+% by the \texttt{captionbeside} environment, we suppress the warning here.)}
+% \begin{macrocode}
+ \expandafter\let\expandafter\caption@KOMA@setcapwidth
+ \csname\string\setcapwidth\endcsname
+ \@namedef{\string\setcapwidth}[#1]#2{%
+ \caption@KOMA@setcapwidth[#1]{#2}\caption@setcapwidth{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\caption@setcapwidth[1]{%
+ \ifx\\#1\\\else
+ \caption@ifundefined\cap@margin{}{%
+ \def\@tempa{captionbeside}%
+ \ifx\@tempa\@currenvir\else\caption@Warning{%
+ Ignoring optional argument [#1] of \string\setcapwidth\MessageBreak}%
+ \fi}%
+ \fi
+ \captionsetup{width=\cap@width}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \def\caption@tempa{\hsize}%
+ \ifx\caption@tempa\cap@width \else
+ \caption@setcapwidth{?}
+ \fi
+% \end{macrocode}
+%
+% \begin{macro}{\setcapmargin}
+% \begin{macrocode}
+ \expandafter\let\expandafter\caption@KOMA@setcapmargin
+ \csname\string\@setcapmargin\endcsname
+ \@namedef{\string\@setcapmargin}[#1]#2{%
+ \caption@KOMA@setcapmargin[#1]{#2}\caption@setcapmargin}
+% \end{macrocode}
+% \begin{macrocode}
+ \expandafter\let\expandafter\caption@KOMA@@setcapmargin
+ \csname\string\@@setcapmargin\endcsname
+ \@namedef{\string\@@setcapmargin}[#1]#2{%
+ \caption@KOMA@@setcapmargin[#1]{#2}\caption@setcapmargin}
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\caption@setcapmargin{%
+ \begingroup
+ \let\onelinecaptionsfalse\relax
+ \def\@twoside{0}%
+ \def\if@twoside{\def\@twoside{1}\iffalse}%
+ \cap@margin
+ \def\@tempa{\endgroup}%
+ \ifx\cap@left\hfill\else\ifx\cap@right\hfill\else
+ \def\hspace##1##{\@firstofone}%
+ \edef\@tempa{\endgroup
+ \noexpand\captionsetup{%
+ twoside=\@twoside,slc=0,%
+ margin={\cap@left,\cap@right}}}%
+ \fi\fi
+ \@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \ifx\cap@margin\relax \else
+ \caption@setcapmargin
+ \fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsection{Processing of options}
+%
+% \changes{v3.0m}{2007/03/04}{Verbose option added}
+% \changes{v3.1}{2007/07/02}{Verbose option removed from package}
+%
+% \changes{v3.1}{2007/03/17}{We do not process global options anymore}
+% \begin{macrocode}
+\caption@SetupOptions{caption}{\caption@setkeys{#1}{#2}}
+\caption@ProcessOptions*{caption}
+% \end{macrocode}
+%
+% \subsection{\cs{caption}, \cs{@caption}, and \cs{@makecaption}}
+%
+% \begin{macro}{\caption@caption}
+% \changes{v3.0f}{2005/05/22}{Bugfix: \cs{ContinuedFloat} added}
+% \changes{v3.0f}{2005/06/13}{Support of \cs{caption*[]} removed}
+% \changes{v3.0l}{2007/01/19}{Minimal support of \textsf{combine} package added}
+% \changes{v3.1}{2007/02/04}{Re-written, does not save\&use original definition anymore}
+% \changes{v3.2c}{2011/09/04}{Support of \cs{donemaincaptiontrue} from \textsf{memoir} document class added}
+% Here comes our definition of |\caption| and |\caption*|.
+% Beside the support of the starred variant this code was adapted to the
+% various packages we support.
+% We are using |\caption@dblarg| instead of |\@dblarg| so |\caption{}|
+% (with an empty arg.) will produce a list-of entry, but |\caption[]{}|
+% won't.
+% \begin{macrocode}
+\def\caption@caption{%
+ \caption@iftype
+ {\caption@checkgrouplevel\@empty\caption
+ \caption@star
+ {\@nameuse{donemaincaptiontrue}%
+ \caption@refstepcounter\@captype}%
+ {\caption@dblarg{\@caption\@captype}}}%
+ {\caption@Error{\noexpand\caption outside float}%
+ \caption@gobble}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@star}
+% \changes{v3.1}{2007/06/24}{Renamed from \cs{caption@caption} to \cs{caption@star}}
+% \changes{v3.2c}{2011/08/21}{\cs{global} removed}
+% A helper macro which processes the optional |*| after |\caption|.
+% \begin{macrocode}
+\newcommand*\caption@star[2]{%
+ \@ifstar{\caption@startrue#2[]}{#1#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@caption}
+% \changes{v3.1}{2007/02/04}{Re-written, does not save\&use original definition anymore}
+% \changes{v3.1f}{2007/11/28}{Bugfix: Handling of \texttt{@minipage} flag added}
+% \changes{v3.1f}{2007/11/28}{Support of option \opt{@minipage} added}
+% \changes{v3.1g}{2008/03/16}{Internal: Uses \cs{caption@prepareanchor} now}
+% \changes{v3.2d}{2011/10/21}{Adapted to the \textsf{memoir} document class}
+% As above, our version has been adapted to the packages we support.
+% Additionally our code is nested by |\caption@beginex| \&
+% |\caption@end| instead of |\begingroup| \& |\endgroup|.
+% Furthermore we use |\caption@boxrestore| instead of |\@parboxrestore|
+% so this code also works correctly inside list-based environments
+% like |wide| \& |addmargin|. (This, and the fact that we use
+% |\linewidth| instead of |\hsize| inside |\@makecaption|, solves
+% \href{http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=latex/2472}%^^A
+% {\LaTeX\ PR \texttt{latex/2472}}.)
+% \begin{macrocode}
+\long\def\caption@@caption#1[#2]#3{%
+% \end{macrocode}
+% \begin{macrocode}
+ \ifcaption@star \else
+ \caption@prepareanchor{#1}{#2}%
+ \M@gettitle{#2}%
+ \memcaptioninfo{#1}{\csname the#1\endcsname}{#2}{#3}%
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \par
+ \caption@beginex{#1}{#2}{#3}%
+ \caption@setfloatcapt{%
+ \caption@boxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \caption@normalsize
+ \ifcaption@star
+ \let\caption@makeanchor\@firstofone
+ \fi
+ \@makecaption{\csname fnum@#1\endcsname}%
+ {\ignorespaces\caption@makeanchor{#3}}\par
+ \caption@if@minipage\@minipagetrue\@minipagefalse}%
+ \caption@end}
+% \end{macrocode}
+% \textsf{memoir} document class stuff:
+% \begin{macrocode}
+\providecommand\M@gettitle[1]{}
+\providecommand\memcaptioninfo[4]{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@prepareanchor}
+% \changes{v3.1g}{2008/03/16}{This macro added}
+% \begin{macrocode}
+\newcommand*\caption@prepareanchor[2]{%
+ \caption@makecurrent{#1}{#2}%
+ \caption@ifhypcap\caption@@start{}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makecaption}
+% \changes{v3.1i}{2008/05/06}{Usage of \cs{caption@rule} added}
+% |\@makecaption|\marg{label}\marg{text}\par
+% We do basically the same as the original code (from the standard
+% \LaTeX\ document classes), but take care of the |position=| setting
+% and use |\caption@@make| from the \package{caption} kernel to finally
+% typeset the caption.
+% \begin{macrocode}
+\long\def\caption@makecaption#1#2{%
+ \caption@iftop
+ {\vskip\belowcaptionskip}%
+ {\caption@rule\vskip\abovecaptionskip}%
+ \caption@@make{#1}{#2}%
+ \caption@iftop
+ {\vskip\abovecaptionskip\caption@rule}%
+ {\vskip\belowcaptionskip}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@redefine}
+% \changes{v3.1k}{2009/03/30}{This macro added, it contains the patching code now}
+% We only redefine |\caption| and |\@caption| if the current definitions
+% are well known, so documents written in the old (\package{caption}
+% package \version{1.x}) days (where |\caption| \& |\@caption| were not
+% redefined by us) will still compile fine.
+% For example the usage of the \package{captcont} package, which brings
+% it's own definition of |\caption*|, was quite common these days.
+% \begin{macrocode}
+\newcommand*\caption@redefine{}
+\g@addto@macro\caption@redefine{%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@setbool{incompatible}{0}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\caption{%
+ % ltfloat.dtx [2002/10/01 v1.1v LaTeX Kernel (Floats)]
+ \def\caption{%
+ \ifx\@captype\@undefined
+ \@latex@error{\noexpand\caption outside float}\@ehd
+ \expandafter\@gobble
+ \else
+ \refstepcounter\@captype
+ \expandafter\@firstofone
+ \fi
+ {\@dblarg{\@caption\@captype}}%
+ }}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\caption{%
+ % beamerbaselocalstructure.sty,v 1.53 2007/01/28 20:48:21 tantau
+ \def\caption{
+ \ifx\@captype\@undefined
+ \@latex@error{\noexpand\caption outside figure or table}\@ehd
+ \expandafter\@gobble
+ \else
+ \refstepcounter\@captype
+ \expandafter\@firstofone
+ \fi
+ {\@dblarg{\@caption\@captype}}%
+ }}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\caption{%
+ % float.sty [2001/11/08 v1.3d Float enhancements (AL)]
+ \renewcommand\caption{%
+ \ifx\@captype\@undefined
+ \@latex@error{\noexpand\caption outside float}\@ehd
+ \expandafter\@gobble
+ \else
+ \refstepcounter\@captype
+ \let\@tempf\@caption
+ \expandafter\ifx\csname @float@c@\@captype\endcsname\relax\else
+ \expandafter\expandafter\let
+ \expandafter\@tempf\csname @float@c@\@captype\endcsname
+ \fi
+ \fi
+ \@dblarg{\@tempf\@captype}}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\caption{%
+ % hyperref.sty [2007/02/27 v6.75t Hypertext links for LaTeX]
+ % hyperref.sty [2007/04/09 v6.76a Hypertext links for LaTeX]
+ % hyperref.sty [2007/06/12 v6.76h Hypertext links for LaTeX]
+ \def\caption{%
+ \ifx\@captype\@undefined
+ \@latex@error{\noexpand\caption outside float}\@ehd
+ \expandafter\@gobble
+ \else
+ \H@refstepcounter\@captype
+ \@ifundefined{fst@\@captype}{%
+ \let\Hy@tempa\@caption
+ }{%
+ \let\Hy@tempa\Hy@float@caption
+ }%
+ \expandafter\@firstofone
+ \fi
+ {\@dblarg{\Hy@tempa\@captype}}%
+ }}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\caption{%
+ % hyperref.sty [2007/08/05 v6.76j Hypertext links for LaTeX]
+ \def\caption{%
+ \ifx\@captype\@undefined
+ \@latex@error{\noexpand\caption outside float}\@ehd
+ \expandafter\@gobble
+ \else
+ \H@refstepcounter\@captype
+ \let\Hy@tempa\@caption
+ \@ifundefined{float@caption}{%
+ }{%
+ \expandafter\ifx\csname @float@c@\@captype\endcsname\float@caption
+ \let\Hy@tempa\Hy@float@caption
+ \fi
+ }%
+ \expandafter\@firstofone
+ \fi
+ {\@dblarg{\Hy@tempa\@captype}}%
+ }}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\caption{%
+ % memhfixc.sty [2010/08/17 v1.15 nameref/hyperref package fixes for memoir class]
+ % \let\m@moldhypcaption\caption
+ \renewcommand{\caption}{\donemaincaptiontrue\m@moldhypcaption}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@IfCheckCommand{}{%
+ \caption@InfoNoLine{%
+ Incompatible package detected (regarding \string\caption).\MessageBreak
+ \string\caption\space=\space\meaning\caption}%
+ \caption@setbool{incompatible}{1}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % ltfloat.dtx [2002/10/01 v1.1v LaTeX Kernel (Floats)]
+ \long\def\@caption#1[#2]#3{%
+ \par
+ \addcontentsline{\csname ext@#1\endcsname}{#1}%
+ {\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+ \endgroup}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % beamerbaselocalstructure.sty,v 1.53 2007/01/28 20:48:21 tantau
+ \long\def\@caption#1[#2]#3{% second argument ignored
+ \par\nobreak
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \beamer@makecaption{#1}{\ignorespaces #3}\par\nobreak
+ \endgroup}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % magyar.ldf [2005/03/30 v1.4j Magyar support from the babel system]
+ \long\def\@caption#1[#2]#3{%
+ \csname par\endcsname
+ \addcontentsline{\csname ext@#1\endcsname}{#1}%
+ {\protect\numberline{\csname the#1\endcsname.}{\ignorespaces #2}}%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \@makecaption{\csname fnum@#1\endcsname}%
+ {\ignorespaces #3}\csname par\endcsname
+ \endgroup}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+% \caption@CheckCommand\float@caption{%
+% % float.sty [2001/11/08 v1.3d Float enhancements (AL)]
+% \long\def\float@caption#1[#2]#3{%
+% \addcontentsline{\@nameuse{ext@#1}}{#1}%
+% {\protect\numberline{\@nameuse{the#1}}{\ignorespaces #2}}
+% \global\setbox\@floatcapt\vbox\bgroup\@parboxrestore
+% \normalsize\@fs@capt{\@nameuse{fnum@#1}}{\ignorespaces #3}%
+% \@ifnextchar[{\float@ccon}{\egroup}}%
+% \long\def\float@ccon[#1]{#1\par\egroup}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % hyperref.sty [2007/02/27 v6.75t Hypertext links for LaTeX]
+ \long\def\@caption#1[#2]#3{%
+ \hyper@makecurrent{\@captype}%
+ \def\@currentlabelname{#2}%
+ \par\addcontentsline{\csname ext@#1\endcsname}{#1}{%
+ \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}%
+ }%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \@makecaption{\csname fnum@#1\endcsname}{%
+ \ignorespaces
+ \ifHy@nesting
+ \hyper@@anchor{\@currentHref}{#3}%
+ \else
+ \Hy@raisedlink{\hyper@@anchor{\@currentHref}{\relax}}#3%
+ \fi
+ }%
+ \par
+ \endgroup
+ }}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % hyperref.sty [2007/04/09 v6.76a Hypertext links for LaTeX]
+ % hyperref.sty [2007/06/12 v6.76h Hypertext links for LaTeX]
+ % hyperref.sty [2007/08/05 v6.76j Hypertext links for LaTeX]
+ \long\def\@caption#1[#2]#3{%
+ \expandafter\ifx\csname if@capstart\expandafter\endcsname
+ \csname iftrue\endcsname
+ \global\let\@currentHref\hc@currentHref
+ \else
+ \hyper@makecurrent{\@captype}%
+ \fi
+ \def\@currentlabelname{#2}%
+ \par\addcontentsline{\csname ext@#1\endcsname}{#1}{%
+ \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}%
+ }%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \expandafter\ifx\csname if@capstart\expandafter\endcsname
+ \csname iftrue\endcsname
+ \global\@capstartfalse
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces#3}%
+ \else
+ \@makecaption{\csname fnum@#1\endcsname}{%
+ \ignorespaces
+ \ifHy@nesting
+ \hyper@@anchor{\@currentHref}{#3}%
+ \else
+ \Hy@raisedlink{\hyper@@anchor{\@currentHref}{\relax}}#3%
+ \fi
+ }%
+ \fi
+ \par
+ \endgroup
+ }}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % hyperref.sty [2009/11/27 v6.79k Hypertext links for LaTeX]
+ \long\def\@caption#1[#2]#3{%
+ \expandafter\ifx\csname if@capstart\expandafter\endcsname
+ \csname iftrue\endcsname
+ \global\let\@currentHref\hc@currentHref
+ \else
+ \hyper@makecurrent{\@captype}%
+ \fi
+ \def\@currentlabelname{#2}%
+ \par\addcontentsline{\csname ext@#1\endcsname}{#1}{%
+ \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}%
+ }%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \expandafter\ifx\csname if@capstart\expandafter\endcsname
+ \csname iftrue\endcsname
+ \global\@capstartfalse
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces#3}%
+ \else
+ \@makecaption{\csname fnum@#1\endcsname}{%
+ \ignorespaces
+ \ifHy@nesting
+ \expandafter\hyper@@anchor\expandafter{\@currentHref}{#3}%
+ \else
+ \Hy@raisedlink{%
+ \expandafter\hyper@@anchor\expandafter{\@currentHref}{\relax}%
+ }%
+ #3%
+ \fi
+ }%
+ \fi
+ \par
+ \endgroup
+ }}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % hyperref.sty [2009/12/09 v6.79m Hypertext links for LaTeX]
+ % hyperref.sty [2009/12/28 v6.79z Hypertext links for LaTeX]
+ \long\def\@caption#1[#2]#3{%
+ \expandafter\ifx\csname if@capstart\expandafter\endcsname
+ \csname iftrue\endcsname
+ \global\let\@currentHref\hc@currentHref
+ \else
+ \hyper@makecurrent{\@captype}%
+ \fi
+ \@ifundefined{NR@gettitle}{%
+ \def\@currentlabelname{#2}%
+ }{%
+ \NR@gettitle{#2}%
+ }%
+ \par\addcontentsline{\csname ext@#1\endcsname}{#1}{%
+ \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}%
+ }%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \expandafter\ifx\csname if@capstart\expandafter\endcsname
+ \csname iftrue\endcsname
+ \global\@capstartfalse
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces#3}%
+ \else
+ \@makecaption{\csname fnum@#1\endcsname}{%
+ \ignorespaces
+ \ifHy@nesting
+ \expandafter\hyper@@anchor\expandafter{\@currentHref}{#3}%
+ \else
+ \Hy@raisedlink{%
+ \expandafter\hyper@@anchor\expandafter{%
+ \@currentHref
+ }{\relax}%
+ }%
+ #3%
+ \fi
+ }%
+ \fi
+ \par
+ \endgroup
+ }}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % nameref.sty [2006/12/27 v2.28 Cross-referencing by name of section]
+ \long\def\@caption#1[#2]{%
+ \def\@currentlabelname{#2}%
+ \NR@@caption{#1}[{#2}]%
+ }}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % nameref.sty [2009/11/27 v2.32 Cross-referencing by name of section]
+ \long\def\@caption#1[#2]{%
+ \NR@gettitle{#2}%
+ \NR@@caption{#1}[{#2}]%
+ }}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % subfigure.sty [2002/07/30 v2.1.4 subfigure package]
+ \long\def\@caption#1[#2]#3{%
+ \@ifundefined{if#1topcap}%
+ {\subfig@oldcaption{#1}[{#2}]{#3}}%
+ {\@nameuse{if#1topcap}%
+ \@listsubcaptions{#1}%
+ \subfig@oldcaption{#1}[{#2}]{#3}%
+ \else
+ \subfig@oldcaption{#1}[{#2}]{#3}%
+ \@listsubcaptions{#1}%
+ \fi}}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % subfig.sty [2005/06/28 ver: 1.3 subfig package]
+ \def\@caption{\caption@}%
+% \long\def\caption@#1[#2]#3{%
+% \@ifundefined{caption@setfloattype}%
+% \caption@settype
+% \caption@setfloattype
+% \@captype
+% \sf@ifpositiontop{%
+% \@listsubcaptions{#1}%
+% \sf@old@caption{#1}[{#2}]{#3}%
+% }{%
+% \sf@old@caption{#1}[{#2}]{#3}%
+% \@listsubcaptions{#1}%
+% }}%
+ }%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@IfCheckCommand{}{%
+ \caption@InfoNoLine{%
+ Incompatible package detected (regarding \string\@caption).\MessageBreak
+ \string\@caption\space=\space\meaning\@caption}%
+ \caption@setbool{incompatible}{1}}%
+% \end{macrocode}
+%
+% The option |compatibility=| will override the compatibility mode.
+% \begin{macrocode}
+ \caption@ifundefined\caption@ifcompatibility
+ {\let\caption@ifcompatibility\caption@ifincompatible
+ \let\caption@tempa\caption@WarningNoLine}%
+ {\let\caption@tempa\@gobble}% suppress warning
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@ifcompatibility{%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@tempa{%
+ \noexpand\caption will not be redefined since it's already\MessageBreak
+ redefined by a document class or package which is\MessageBreak
+ unknown to the caption package}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \renewcommand*\caption@redefine{}%
+% \end{macrocode}
+%
+% |\ContinuedFloat| is not supported in compatibility mode.
+% \begin{macrocode}
+ \renewcommand*\caption@ContinuedFloat[1]{%
+ \caption@Error{Not available in compatibility mode}}%
+% \end{macrocode}
+%
+% |\caption@start| is not supported in compatibility mode.
+% \begin{macrocode}
+ \caption@AtBeginDocument*{%
+ \let\caption@start\relax
+ \caption@ifundefined\caption@ORI@capstart{}{%
+ \caption@Debug{%
+ Restore hypcap definition of \string\capstart\@gobble}%
+ \let\capstart\caption@ORI@capstart}%
+ \caption@ifundefined\caption@ORI@float@makebox{}{%
+ \caption@Debug{%
+ Restore hyperref redefinition of \string\float@makebox\@gobble}%
+ \let\float@makebox\caption@ORI@float@makebox}%
+ }%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@star}
+% We redefine |\caption@star| here so it does not make any harm.
+% \begin{macrocode}
+ \renewcommand*\caption@star[2]{#1#2}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ }{%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@ifincompatible{%
+ \caption@WarningNoLine{%
+ Forced redefinition of \noexpand\caption since the\MessageBreak
+ unsupported(!) package option `compatibility=false'\MessageBreak
+ was given}%
+ }{}%
+% \end{macrocode}
+%
+% \begin{macro}{\caption}
+% \begin{macro}{\@caption}
+% \begin{macrocode}
+ \renewcommand*\caption@redefine{%
+ \let\caption\caption@caption
+ \let\@caption\caption@@caption}%
+ \caption@redefine
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+ }%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@AtBeginDocument*{%
+ \let\caption@ORI@capstart\@undefined
+ \let\caption@ORI@float@makebox\@undefined}%
+% \end{macrocode}
+%
+% \begin{macro}{\@xfloat}
+% \changes{v3.1}{2007/05/09}{This re-definition added}
+% \changes{v3.1b}{2007/09/22}{Will now be redefined in compatibility mode, too}
+% We redefine |\@xfloat| so inside floating environments our
+% type-specific options will be used, a \package{hyperref}
+% anchor will be set etc.
+% \begin{macrocode}
+ \let\caption@ORI@xfloat\@xfloat
+ \def\@xfloat#1[#2]{%
+ \caption@ORI@xfloat{#1}[#2]%
+ \caption@settype{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% Some packages (like the \package{hyperref} package for example) redefines
+% |\caption| and |\@caption|, too.
+% So we have to use |\AtBeginDocument| here, so we can make sure
+% our definition is the one which will be valid at last.
+% \begin{macrocode}
+\caption@AtBeginDocument{\caption@redefine}
+% \end{macrocode}
+%
+% \begin{macro}{\@makecaption}
+% \begin{macrocode}
+\let\@makecaption\caption@makecaption
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{captionof} and \cs{captionlistentry}}
+%
+% \changes{v3.0d}{2004/08/03}{Option \opt{type=} added}
+% \changes{v3.1}{2007/06/25}{Option \opt{type*=} added}
+% \changes{v3.1f}{2007/11/16}{Option \opt{subtype} \& \opt{subtype*} added}
+% \changes{v3.2}{2010/10/24}{Bugfix 10-10-17: Option \opt{type=} uses \cs{setcaptiontype} instead of \cs{caption@settype} now}
+%
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionOption{type}{\setcaptiontype{#1}}%
+ \DeclareCaptionOption{type*}{\setcaptiontype*{#1}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionOptionNoValue{subtype}{\setcaptionsubtype\relax}%
+ \DeclareCaptionOptionNoValue{subtype*}{\setcaptionsubtype*}%
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \emph{Important Note:}
+% Like |\captionof| the option |type=| should only be used inside a
+% group, box, or environment and does not check if the argument is a valid
+% floating environment or not.
+%
+% \begin{macro}{\setcaptiontype}
+% \changes{v3.2}{2010/10/24}{This macro added}
+% Like |\captionsetup{type=xxx}|, but also works if \cs{captionsetup} was redefined.
+% \begin{macrocode}
+\newcommand\setcaptiontype{%
+ \caption@boxrestore@mini
+ \caption@settype}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\setcaptionsubtype}
+% \changes{v3.2a}{2011/08/15}{This macro added}
+% Same, but sets the sub-type.
+% \begin{macrocode}
+\newcommand\setcaptionsubtype{%
+ \caption@iftype
+ \caption@setsubtype
+ {\caption@Error{\noexpand\setcaptionsubtype outside float}}}%
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@setsubtype{%
+ \@ifstar
+ {\caption@@settype{sub}*{sub\@captype}}%
+ {\caption@@settype{sub}{sub\@captype}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@settype}
+% \changes{v3.1}{2007/05/09}{This macro added}
+% \changes{v3.1b}{2007/09/22}{Usage of \cs{caption@xlabel} added}
+% \changes{v3.1d}{2007/10/23}{Error message for \cs{caption@checkgrouplevel} revised}
+% \changes{v3.1f}{2007/11/16}{\cs{caption@setsubtype} added}
+% \changes{v3.1f}{2007/12/03}{Crappy \cs{caption@iftypewarning} replaced}
+% \changes{v3.1g}{2008/01/12}{Usage of \cs{ifcaptionsetup@star} added}
+% \changes{v3.2}{2010/10/26}{Error message moved from here to \cs{caption@refstepcounter}}
+% |\caption@settype*|\marg{type}\par
+% sets |\@captype| and executes the options associated with it
+% (using |\caption@setoptions|).
+% Furthermore we check |\currentgrouplevel| (if avail),
+% redefine |\@currentlabel| so a |\label| before |\caption| will result
+% in a hint instead of a wrong reference, and
+% use the macro |\caption@|(|sub|)|typehook| (which will be used by our
+% \package{float} package support).\par
+% The non-starred version sets a \package{hyperref} anchor additionally
+% (if |hypcap=true| and the \package{hypcap} package is not loaded).
+% \begin{macrocode}
+\newcommand*\caption@settype{%
+ \caption@@settype{}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@settype[1]{%
+ \caption@teststar{\caption@@@settype{#1}}\@firstoftwo\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@settype[3]{%
+% #1 = "" or "sub"
+% #2 = \@firstoftwo in star form, \@secondoftwo otherwise
+% #3 = <type>, e.g. "figure" or "table"
+ \caption@Debug{#1type=#3}%
+ \caption@checkgrouplevel{#1}{%
+ \captionsetup{#1type#2*\@empty=...}#2{ or
+ \@backslashchar#1captionof}{}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \edef\caption@tempa{#3}%
+ \expandafter\ifx\csname @#1captype\endcsname\caption@tempa \else
+ \ifcaptionsetup@star\else\@nameuse{caption@#1type@warning}\fi
+ \fi
+ \expandafter\let\csname @#1captype\endcsname\caption@tempa
+% \end{macrocode}
+% \begin{macrocode}
+ \@nameuse{caption@#1typehook}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@setoptions{#3}%
+ \ifx\caption@opt\relax
+ \@nameundef{caption@#1type@warning}%
+ \else
+ \@namedef{caption@#1type@warning}{\caption@Warning{%
+ The #1caption type was already set to
+ `\csname @#1captype\endcsname'\MessageBreak}}%
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@ifrefstepcounter\@secondoftwo
+ #2{}{%
+ \let\@currentlabel\caption@undefinedlabel
+% \let\@currentHlabel\@undefined
+ \ifx\caption@x@label\@undefined
+ \let\caption@x@label\label
+ \let\label\caption@xlabel
+ \fi
+ \caption@start}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@typehook}
+% Hook, will be extended later on, e.g.~by our \package{float} package
+% support.
+% \begin{macrocode}
+\newcommand*\caption@typehook{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@iftype}
+% \changes{v3.1}{2007/04/11}{This macro and its usage added}
+% Since we often need to check if |\@captype| is defined (means: we
+% are inside a floating environment) this helper macro was introduced.
+% \begin{macrocode}
+\newcommand*\caption@iftype{%
+ \caption@ifundefined\@captype\@secondoftwo\@firstoftwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@checkgrouplevel}
+% \changes{v3.1}{2007/07/15}{This macro and its usage added}
+% \changes{v3.1f}{2007/11/28}{Error changed to warning (compatibility)}
+% Checks if |\captionsetup{type=|\ldots|}| or |\caption| is done
+% inside a group or not -- in the latter case a warning message will
+% be issued. (needs \eTeX)
+% \begin{macrocode}
+\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}
+ \newcommand*\caption@checkgrouplevel[2]{%
+ \@ifundefined{#1caption@grouplevel}{%
+ \caption@ifundefined\caption@grouplevel{\let\caption@grouplevel\z@}{}%
+ \ifnum\currentgrouplevel>\caption@grouplevel\relax
+ \expandafter\edef\csname #1caption@grouplevel\endcsname{%
+ \the\currentgrouplevel}%
+ \else
+ \caption@Warning{\string#2\MessageBreak outside box or environment}%
+ \fi
+ }{}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@undefinedlabel}
+% \changes{v3.1}{2007/07/03}{This macro and its usage added}
+% \changes{v3.1b}{2007/09/22}{Contents changed to \texttt{??}}
+% \changes{v3.1i}{2008/04/13}{Contents changed to \cs{caption@xref}(\ldots)}
+% \changes{v3.1k}{2009/03/30}{Bugfix 08-12-08: \cs{caption@xref} is robust now}
+% \changes{v3.2c}{2011/09/13}{Text changed from `before' to `without proper'}
+% This label will be used for |\currentlabel| inside (floating) environments
+% as default. (see above)
+% \iffalse\Note{All commands used have to be robust here.}\fi
+% \begin{macrocode}
+\newcommand*\caption@undefinedlabel{%
+ \protect\caption@xref{\caption@labelname}{\on@line}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareRobustCommand*\caption@xref[2]{%
+ \caption@WarningNoLine{\noexpand\label without proper \string\caption#2}%
+ \@setref\relax\@undefined{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@labelname{??}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@xlabel}
+% \changes{v3.1b}{2007/09/22}{This macro and its usage added}
+% \changes{v3.1f}{2007/11/11}{Revised}
+% \changes{v3.1i}{2008/04/13}{Bugfix: \cs{pageref} should always work now}
+% \changes{v3.2c}{2011/08/19}{Works with optional arguments now, too}
+% The new code of |\label| inside floating environments.
+% |\label| will be redefined using |\caption@withoptargs|, so
+% |#1| are the optional arguments (if any), and
+% |#2| is the mandatory argument here.
+% \begin{macrocode}
+\newcommand*\caption@xlabel{%
+ \caption@withoptargs\caption@@xlabel}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@xlabel[2]{%
+ \caption@@@xlabel
+ \def\caption@labelname{#2}%
+ \caption@x@label#1{#2}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@xlabel{%
+ \global\let\caption@@@xlabel\@empty
+ \@bsphack
+ \protected@write\@auxout{}%
+ {\string\providecommand*\string\caption@xref[2]{%
+ \string\@setref\string\relax\string\@undefined{\string##1}}}%
+ \@esphack}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionof}
+% \changes{v3.1}{2007/05/09}{Uses \cs{caption@settype} instead of \cs{def}\cs{@captype}}
+% \changes{v3.1c}{2007/09/22}{Bugfix: Redefinition of \cs{caption@setfloatcapt} removed}
+% \changes{v3.1e}{2007/10/30}{Better compatibility: Will be defined with \cs{AtBeginDocument} now}
+% \changes{v3.2}{2010/10/24}{Bugfix 10-10-17: Uses \cs{setcaptiontype} instead of \cs{caption@settype} now}
+% |\captionof|\marg{type}\oarg{lst\_entry}\marg{heading}\\
+% |\captionof*|\oarg{lst\_entry}\marg{heading}\par
+% \Note{This will be defined with \cs{AtBeginDocument} so
+% \cs{usepackage}\csmarg{caption,capt-of} will still work.
+% (Compatibility to \version{1.x})}
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \def\captionof{\caption@teststar\caption@of{\caption*}\caption}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@of[2]{\setcaptiontype*{#2}#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionlistentry}
+% \changes{v3.1}{2007/07/28}{This macro added}
+% \changes{v3.1f}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% \changes{v3.1g}{2008/01/20}{Starred variant added}
+% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% |\captionlistentry|\oarg{float type}\marg{list entry}\\
+% |\captionlistentry*|\oarg{float type}\marg{list entry}
+% \begin{macrocode}
+\newcommand*\captionlistentry{%
+ \caption@teststar\@captionlistentry\@firstoftwo\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\@captionlistentry[1]{%
+ \@testopt{\caption@listentry{#1}}\@captype}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@listentry#1[#2]#3{%
+ \@bsphack
+ #1{\caption@gettitle{#3}}%
+ {\caption@refstepcounter{#2}%
+ \caption@makecurrent{#2}{#3}}%
+ \caption@addcontentsline{#2}{#3}%
+ \@esphack}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{captionbox}}
+%
+% \begin{macro}{\captionbox}
+% \changes{v3.2}{2010/12/17}{This macro added}
+% \changes{v3.2a}{2011/08/16}{\cs{captionsetup} replaces with \cs{captionbox@settype} and \cs{caption@setposition}}
+% A |\parbox| with contents and caption, separated by an invisible |\hrule|.
+% \begin{macrocode}
+\newcommand*\captionbox{%
+ \let\captionbox@settype\@gobble
+ \caption@withoptargs\caption@box}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@box[2]{%
+ \@testopt{\caption@ibox{#1}{#2}}{\wd\@tempboxa}}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@ibox#1#2[#3]{%
+ \@testopt{\caption@iibox{#1}{#2}{#3}}\captionbox@hj@default}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@iibox#1#2#3[#4]#5{%
+ \setbox\@tempboxa\hbox{#5}%
+ \begingroup
+ \captionbox@settype*% set \caption@position
+ \caption@iftop{%
+ \endgroup
+ \parbox[t]{#3}{%
+ \captionbox@settype\relax
+ \caption@setposition t%
+ \vbox{\caption#1{#2}}%
+ \captionbox@hrule
+ \csname caption@hj@#4\endcsname
+ \unhbox\@tempboxa}%
+ }{%
+ \endgroup
+ \parbox[b]{#3}{%
+ \captionbox@settype\relax
+ \caption@setposition b%
+ \csname caption@hj@#4\endcsname
+ \unhbox\@tempboxa
+ \captionbox@hrule
+ \vtop{\caption#1{#2}}}%
+ }}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\captionbox@hj@default{c}
+\newcommand*\captionbox@hrule{\hrule\@height\z@\relax}
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\caption@hj@c{\centering}
+\providecommand*\caption@hj@l{\raggedright}
+\providecommand*\caption@hj@r{\raggedleft}
+\providecommand*\caption@hj@s{}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{ContinuedFloat}}
+%
+% \begin{macro}{\ContinuedFloat}
+% \changes{v3.0f}{2005/06/11}{%
+% Call of \cs{caption@ContinuedFloat} added}
+% \changes{v3.0i}{2005/11/12}{%
+% Optional argument and call of \cs{caption@@ContinuedFloat} added}
+% \changes{v3.0g}{2005/06/28}{%
+% Bugfix: \cs{newcounter} replaced by \cs{newcount}}
+% \changes{v3.1}{2007/07/02}{Format of \package{hyperref} extension changed}
+% \changes{v3.1}{2007/07/07}{\cs{caption@setoptions} added}
+% \changes{v3.1g}{2008/01/29}{Starred variant and hook \cs{sf@ContinuedFloat} added}
+% |\ContinuedFloat|\\
+% |\ContinuedFloat*|\par
+% This mainly decrements the appropriate counter and increments the
+% continuation counter instead.
+% Furthermore we set |\caption@resetContinuedFloat| to |\@gobble| so the
+% continuation counter will not be reset to zero inside |\caption@refstepcounter|.
+% Please forget about the optional argument, it was never working well, is
+% incompatible to the \package{subfig} package, but is still there for
+% compatibility reasons.
+% \Note{The definition of \cs{ContinuedFloat} itself is compatible
+% to the one inside the \package{subfig} package, except for the
+% starred variant and the optional argument.}
+% When the \package{hyperref} package is used we have the problem
+% that the usage of |\ContinuedFloat| will create duplicate
+% hyper links -- |\@currentHref| will be the same for the main float and
+% the continued ones. So we have to make sure unique labels and references
+% will be created each time. We do this by extending |\theHfigure| and
+% |\theHtable|, so for continued floats the scheme
+% \begin{quote}\meta{type}|.|\meta{type \#}|\alph{|\meta{continued \#}|}|\end{quote}
+% will be used instead of
+% \begin{quote}\meta{type}|.|\meta{type \#}\quad\quad.\end{quote}
+% \par{\small(This implementation follows an idea from Steven Douglas Cochran.)}
+% \Note{This does not help if the \package{hyperref} package option
+% \texttt{naturalnames=true} is set.}
+% \begin{macrocode}
+\def\ContinuedFloat{%
+ \@ifnextchar[\@Continued@Float\@ContinuedFloat}
+% \end{macrocode}
+% \begin{macrocode}
+\def\@Continued@Float[#1]{\addtocounter{#1}\m@ne}
+% \end{macrocode}
+% \begin{macrocode}
+\def\@ContinuedFloat{%
+ \caption@iftype
+ {\addtocounter\@captype\m@ne
+ \caption@ContinuedFloat\@captype}%
+ {\caption@Error{\noexpand\ContinuedFloat outside float}}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@ContinuedFloat#1{%
+ \@ifstar{\caption@Continued@Float@{#1}}{\caption@Continued@Float{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@Continued@Float@{%
+ \addtocounter\@captype\@ne
+ \@stpelt{ContinuedFloat}\stepcounter{ContinuedFloat}%
+ \def\caption@resetContinuedFloat##1{\xdef\caption@CFtype{##1}}%
+ \caption@@ContinuedFloat}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@Continued@Float#1{%
+ \edef\caption@tempa{#1}%
+ \ifx\caption@tempa\caption@CFtype
+ \stepcounter{ContinuedFloat}%
+ \let\caption@resetContinuedFloat\@gobble
+ \caption@@ContinuedFloat{#1}%
+ \sf@ContinuedFloat{#1}%
+ \else
+ \caption@Error{Continued `#1' after `\caption@CFtype'}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@ContinuedFloat#1{%
+ \expandafter\l@addto@macro\csname the#1\endcsname\theContinuedFloat
+ \@ifundefined{theH#1}{}{%
+ \expandafter\l@addto@macro\csname theH#1\endcsname{%
+ \@alph\c@ContinuedFloat}}%
+ \caption@setoptions{ContinuedFloat}%
+ \caption@setoptions{continued#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\sf@ContinuedFloat[1]{}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@CFtype{??}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\theContinuedFloat}
+% Its preset to \cs{@empty}, so usually the continuation counter is not
+% included in the caption label or references.
+% \begin{macrocode}
+\newcounter{ContinuedFloat}
+\let\theContinuedFloat\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@resetContinuedFloat}
+% |\caption@resetContinuedFloat|\marg{type}\par
+% If a continuation counter is defined, we reset it.
+% (This one will be called inside |\@caption|.)
+% \begin{macrocode}
+\newcommand*\caption@resetContinuedFloat[1]{%
+ \@stpelt{ContinuedFloat}\xdef\caption@CFtype{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\phantomcaption}
+% \changes{v3.2}{2010/10/31}{Bugfix 10-09-01b: This macro added}
+% |\phantomcaption|\par
+% Use this one for figures with subcaptions but without main caption.
+% \begin{macrocode}
+\newcommand\phantomcaption{%
+ \caption@iftype
+ {\caption@refstepcounter\@captype}%
+ {\caption@Error{\noexpand\phantomcaption outside float}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Internal helpers}
+%
+% \begin{macro}{\caption@refstepcounter}
+% \changes{v3.1}{2007/07/28}{This macro added}
+% \changes{v3.2}{2010/10/26}{Error message moved from \cs{caption@@@settype} to here}
+% Resets the continuation counter, increments the float (i.e. |figure| or
+% |table|) counter, and sets the |refstepcounter| flag.
+% \begin{macrocode}
+\newcommand*\caption@refstepcounter[1]{%
+ \@ifundefined{c@#1}%
+ {\caption@Error{No float type '#1' defined}}%
+ {\caption@resetContinuedFloat{#1}%
+ \caption@@refstepcounter{#1}%
+ \let\caption@ifrefstepcounter\@firstoftwo}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@refstepcounter{\refstepcounter}
+\let\caption@ifrefstepcounter\@secondoftwo
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@dblarg}
+% \changes{v3.1}{2007/02/05}{This macro added}
+% \changes{v3.1f}{2007/12/06}{Bugfix 07-12-06: Changed so it works without \cs{kernel@ifnextchar}
+% (which was introduced in \LaTeXe\ 2004/01/23), too}
+% A |\relax| was added compared to |\@dblarg| so |\caption{}| will be
+% expanded to |\caption[\relax]{}| (and not to |\caption[]{}|).
+% \begin{macrocode}
+\caption@ifundefined\kernel@ifnextchar
+ {\newcommand\caption@dblarg[1]{\@ifnextchar[{#1}{\caption@xdblarg{#1}}}}%
+ {\newcommand\caption@dblarg[1]{\kernel@ifnextchar[{#1}{\caption@xdblarg{#1}}}}%
+\newcommand\caption@xdblarg[2]{#1[{#2\relax}]{#2}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@begin}
+% \changes{v3.0a}{2004/01/23}{\cs{caption@settype} changed to \cs{caption@setfloattype}}
+% \changes{v3.0e}{2005/04/12}{Check for default label format added}
+% \changes{v3.0f}{2005/06/11}{Usage of \cs{caption@resetContinuedFloat} added}
+% \changes{v3.1}{2007/05/09}{Usage of \cs{caption@setfloattype} \&
+% \cs{caption@resetContinuedFloat} removed}
+% Our handling of |\caption| will always be surrounded by
+% |\caption@begin| (or |\caption@beginex|) and |\caption@end|.\par
+% |\caption@begin|\marg{type} performs these tasks:
+% \begin{enumerate}
+% \item[1.] Start a new group.
+% \item[2.] Define |\fnum@|\meta{type} if the caption label format is set
+% to non-default.
+% \item[3.] Override the |position=| setting, if necessary.
+% (for example if set to |auto| or used inside a |supertabular|)
+% \end{enumerate}
+% \begin{macrocode}
+\newcommand*\caption@begin[1]{%
+ \begingroup
+ \caption@setfnum{#1}%
+ \caption@fixposition
+ \global\let\caption@fixedposition\caption@position}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@beginex}
+% \changes{v3.0b}{2004/05/16}{Support of \opt{listof=} added}
+% \changes{v3.0l}{2007/02/04}{Takes now 3 args instead of 2, check for empty heading added}
+% \changes{v3.1}{2007/07/01}{Makes lst-entry now instead of redefining \cs{addcontentsline}}
+% \changes{v3.2}{2010/10/26}{Bugfix 09-05-15: Setting of \cs{lst@@caption} added}
+% |\caption@beginex|\marg{type}\marg{list entry}\marg{heading}\par
+% performs the same tasks as |\caption@begin| and additionally:
+% \begin{enumerate}
+% \item[4.] Set |\lst@@caption|, so |\fnum@lstlisting| will include a numbering.
+% \item[5.] Make an entry in the list-of-whatever.
+% \item[6.] Set |\caption@ifempty| according argument \meta{heading}.
+% \end{enumerate}
+% \begin{macrocode}
+\newcommand\caption@beginex[3]{%
+ \caption@begin{#1}%
+ \let\lst@@caption\relax
+ \caption@addcontentsline{#1}{#2}%
+ \caption@ifempty{#3}{}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@end}
+% |\caption@end| closes the group.
+% \begin{macrocode}
+\newcommand*\caption@end{%
+ \endgroup
+ \let\caption@position\caption@fixedposition}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0a}{2004/01/23}{%
+% Internal hooks \cs{caption@@begin} \& \cs{caption@@end} added}
+% \changes{v3.0h}{2005/10/06}{%
+% Internal hooks \cs{caption@@begin} \& \cs{caption@@end} removed}
+%
+% \begin{macro}{\caption@setfnum}
+% \changes{v3.1}{2007/03/10}{This macro added}
+% |\caption@setfnum|\marg{type}\\
+% redefines |\fnum@|\meta{type} according the caption label format
+% set with |labelformat=|. But if |labelformat=default| is set,
+% |\fnum@|\meta{type} will not be overwritten by us.
+% \begin{macrocode}
+\newcommand*\caption@setfnum[1]{%
+ \@ifundefined{fnum@#1}{\iftrue}{\ifx\caption@lfmt\caption@lfmt@default\else}%
+ \@namedef{fnum@#1}{\caption@fnum{#1}}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@boxrestore}
+% \changes{v3.1}{2007/03/03}{This macro and its usage added}
+% \changes{v3.1b}{2007/09/17}{Bugfix: Redefinition of CR added}
+% \changes{v3.2}{2010/11/07}{Support of option \opt{parboxrestore} added}
+% The original code (from |latex/base/ltboxes.dtx|):
+% \begin{verbatim}
+% \def\@parboxrestore{\@arrayparboxrestore\let\\\@normalcr}
+% \def\@arrayparboxrestore{%
+% \let\if@nobreak\iffalse
+% \let\if@noskipsec\iffalse
+% \let\par\@@par
+% \let\-\@dischyph
+% \let\'\@acci\let\`\@accii\let\=\@acciii
+% \parindent\z@ \parskip\z@skip
+% \everypar{}%
+% \linewidth\hsize
+% \@totalleftmargin\z@
+% \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
+% \parfillskip\@flushglue \lineskip\normallineskip
+% \baselineskip\normalbaselineskip
+% \sloppy}
+% \end{verbatim}%^^A
+% This one will be used by |\@caption| instead of |\@parboxrestore|.
+% \begin{macrocode}
+\newcommand*\caption@boxrestore{%
+ \caption@parboxrestore{\@parboxrestore}{%
+ \let\if@nobreak\iffalse
+ \let\if@noskipsec\iffalse
+ \let\par\@@par
+% \let\-\@dischyph
+% \let\'\@acci\let\`\@accii\let\=\@acciii
+ \parindent\z@ \parskip\z@skip
+ \everypar{}%
+% \linewidth\hsize
+% \@totalleftmargin\z@
+ \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
+ \parfillskip\@flushglue \lineskip\normallineskip
+ \baselineskip\normalbaselineskip
+ \sloppy
+ \let\\\@normalcr
+ }}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@boxrestore@mini}
+% \changes{v3.2}{2010/10/24}{This macro added}
+% Resets \cs{par} so the very first \cs{par} in \cs{@caption} behaves quite the same as in floating environments.
+% Will be used by \cs{setcaptiontype}.
+% \begin{macrocode}
+\newcommand\caption@boxrestore@mini{%
+ \let\par\@@par
+ \parindent\z@ \parskip\z@skip
+ \sloppy}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@normalsize}
+% \changes{v3.1}{2007/05/05}{This macro and its usage added}
+% This one will be used by |\@caption| instead of |\normalsize|.\par
+% Its code is equivalent to
+% \begin{quote}
+% |\caption@font{normal}%|
+% \end{quote}
+% but executes faster (since the starred form of |\caption@font|
+% does not use |\setkeys| internally).
+% \begin{macrocode}
+\newcommand*\caption@normalsize{%
+ \caption@font*{\KV@caption@fnt@normal\@unused}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setfloatcapt}
+% Needed for support of the \package{float} package, where the caption will
+% not be typeset directly, but catched in a |\vbox| called |\@floatcapt|
+% instead.
+% \begin{macrocode}
+\let\caption@setfloatcapt\@firstofone
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makecurrent}
+% \begin{macro}{\caption@makeanchor}
+% \begin{macro}{\caption@start}
+% \begin{macro}{\caption@@start}
+% \begin{macro}{\caption@freezeHref}
+% \begin{macro}{\caption@defrostHref}
+% All these are needed for support of the \package{hyperref} package.
+% \begin{macrocode}
+\newcommand*\caption@makecurrent[2]{}
+\let\caption@makeanchor\@firstofone
+\let\caption@start\relax
+\let\caption@@start\relax
+\let\caption@freezeHref\relax
+\let\caption@defrostHref\relax
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@gettitle}
+% \changes{v3.1}{2007/05/05}{This macro and its usage added}
+% This one is needed for support of the \package{nameref} package.
+% \begin{macrocode}
+\newcommand\caption@gettitle[1]{%
+ \caption@ifundefined\NR@gettitle
+ {\def\@currentlabelname{#1}}%
+ {\NR@gettitle{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Support for sub-captions}
+% \changes{v3.1f}{2007/11/16}{Support for sub-captions added}
+%
+% \begin{macro}{\caption@DeclareSubType}
+% |\caption@DeclareSub| initializes the usage of \cs{caption}
+% in sub-floats.
+% \begin{macrocode}
+\def\caption@DeclareSubType sub#1\@nil{%
+ \caption@Debug{Initializing subtype for `#1'\@gobble}%
+ \@namedef{caption@c@#1}{0}%
+ \@namedef{caption@beginsub#1}{\caption@beginsubfloat{#1}}}
+\@onlypreamble\caption@DeclareSubType
+% \end{macrocode}
+% \end{macro}
+%
+% Initialize the sub-captions defined with \cs{DeclareCaptionSubType}\ldots
+% \begin{macrocode}
+\caption@For*{subtypelist}{\caption@DeclareSubType sub#1\@nil}
+% \end{macrocode}
+%
+% Initialize the sub-captions defined with \cs{newsubfloat}\cite{subfig}\ldots
+% \begin{macrocode}
+\caption@AtBeginDocument*{%
+ \caption@ifundefined\sf@counterlist{}{%
+ \@for\sf@temp:=\sf@counterlist\do{%
+ \expandafter\caption@DeclareSubType\sf@temp\@nil}}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@subtypehook}
+% \changes{v3.1g}{2008/03/20}{Redefinition of \cs{caption@setlist} added}
+% \changes{v3.1k}{2009/10/09}{Bugfix 09-08-12b: \cs{@makecaption} will now be restored here, too}
+% \changes{v3.2}{2011/06/26}{Uses \cs{caption@@addcontentsline} instead of \cs{addcontentsline} now}
+% \changes{v3.2a}{2011/08/17}{Redefinition of \cs{phantomcaption} added}
+% \changes{v3.2a}{2011/08/17}{Usage of \cs{caption@warmup} added}
+% \changes{v3.2c}{2011/09/30}{Bugfix 11-09-26: Usage of \cs{if@subfloatrow} added}
+% Hook, will be used inside \cs{caption@setsubtype}.\par
+% (Note: If we are inside an |sub|\-|float|\-|row| environment we have to keep
+% the |\@make|\-|caption| code of the \package{floatrow} package intact.)
+% \begin{macrocode}
+\newcommand*\caption@subtypehook{%
+ \ifx\caption\caption@subcaption \else
+ \caption@warmup
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@ifrefstepcounter{}{%
+ % no \caption or \subcaption in this (floating) environment yet
+ \caption@Debug{Increment \@captype\ counter =\the\value\@captype}%
+ \caption@l@stepcounter\@captype
+ \let\caption@@@addcontentsline\caption@addsubcontentsline}%
+% \end{macrocode}
+% \begin{macrocode}
+ \ifnum\csname caption@c@\@captype\endcsname=\value\@captype \else
+ \caption@Debug{Reset sub\@captype\ counter}%
+ \expandafter\xdef\csname caption@c@\@captype\endcsname{%
+ \the\value\@captype}%
+ \@stpelt\@subcaptype
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \c@ContinuedFloat=0\relax
+ \let\caption@resetContinuedFloat\@gobble
+ \let\caption@addcontentsline\caption@kernel@addcontentsline
+ \let\caption@setfloatcapt\@firstofone
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@clearmargin
+ \caption@iflist{}{\let\caption@setlist\@gobble}%
+ \caption@setoptions{sub}%
+ \caption@setoptions{subfloat}% for subfig-package compatibility
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption\caption@subcaption
+ \let\phantomcaption\caption@subphantom
+ \if@subfloatrow
+ \caption@Debug{Keeping \string\@makecaption}%
+ \else
+ \let\@makecaption\caption@makecaption
+ \fi
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@subfloatrow}
+% \changes{v3.2c}{2011/09/30}{This macro added}
+% This macro tests if we are inside an |sub|\-|float|\-|row| or |sub|\-|float|\-|row*| environment.
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \caption@ifundefined\@subfloatrowtrue
+ {\newif\if@subfloatrow
+ \caption@ifundefined\subfloatrow{}%
+ {\caption@Debug{Patching subfloatrow environment}%
+ \g@addto@macro\capsubrowsettings{\@subfloatrowtrue}%
+ \g@addto@macro\killfloatstyle{%
+ \ifx\c@FRobj\c@FRsobj\@subfloatrowtrue\fi}}}%
+ {\caption@Debug{\string\if@subfloatrow is already defined}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@subcaption}
+% Makes a sub-caption.
+% \begin{macrocode}
+\newcommand*\caption@subcaption{%
+ \caption@checkgrouplevel{sub}\subcaption
+ \caption@star
+ {\caption@refstepcounter\@subcaptype}%
+ {\caption@dblarg{\@caption\@subcaptype}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@subphantom}
+% \changes{v3.2a}{2011/08/17}{This macro added}
+% Same as |\phantomcaption|, but for sub-captions.
+% \begin{macrocode}
+\newcommand*\caption@subphantom{%
+ \caption@checkgrouplevel{sub}\phantomsubcaption
+ \caption@refstepcounter\@subcaptype}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@addcontentsline}
+% \changes{v3.1g}{2008/01/12}{Argument of \cs{caption@addsubcontentslines} removed}
+% \changes{v3.1i}{2008/08/02}{Argument of \cs{caption@addsubcontentslines} re-added}
+% We extend |\caption@addcontentsline| so it handles sub-captions, too.
+% \Note{\cs{sf@ifpositiontop} \& \cs{@listsubcaptions} are defined by the
+% \package{subfigure} \& \package{subfig} packages.}
+% \begin{macrocode}
+\let\caption@kernel@addcontentsline\caption@addcontentsline
+\renewcommand\caption@addcontentsline[2]{%
+ \sf@ifpositiontop{\@listsubcaptions{#1}}{}%
+ \caption@kernel@addcontentsline{#1}{#2}%
+ \sf@ifpositiontop{}{\@listsubcaptions{#1}}%
+ \caption@addsubcontentslines{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@addsubcontentslines[1]{%
+ \begingroup
+ \caption@subcontentslines
+ \endgroup
+ \caption@clearsubcontentslines}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@addsubcontentsline}
+% \changes{v3.1i}{2008/08/02}{Bugfix 08-07-28:
+% \cs{label}, \cs{index}, and \cs{glossary} are allowed inside the list entry now}
+% \changes{v3.2}{2011/06/26}{Uses \cs{caption@@addcontentsline} instead of \cs{addcontentsline} now}
+% \changes{v3.2c}{2011/08/19}{Uses \cs{caption@gobble} instead of \cs{@gobble} now}
+% Add a pending sub-caption list entry.
+% \begin{macrocode}
+\newcommand*\caption@addsubcontentsline[4]{%
+ \begingroup
+ \let\label\caption@gobble \let\index\caption@gobble \let\glossary\caption@gobble
+ \protected@edef\@tempa{\endgroup
+ \noexpand\g@addto@macro\noexpand\caption@subcontentslines{%
+ \noexpand\@namedef{the#2}{\csname the#2\endcsname}%
+ \ifx\@currentHref\@undefined \else
+ \noexpand\def\noexpand\@currentHref{\@currentHref}%
+ \fi
+ \protect\caption@@@addcontentsline{#1}{#2}{#3}{#4}}}%
+ \@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@checksubcontentslines}
+% \changes{v3.1g}{2008/01/07}{Bugfix: Uses \cs{caption@Error} instead of \cs{subcaption@Error} now}
+% Checks if the list of pending sub-captions is empty, if not,
+% a warning will be issued.
+% \begin{macrocode}
+\newcommand*\caption@checksubcontentslines{%
+ \ifx\caption@subcontentslines\@empty \else
+ \caption@Error{%
+ Something's wrong--perhaps a missing \protect\caption\MessageBreak
+ in the last figure or table}%
+ \caption@clearsubcontentslines
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@clearsubcontentslines}
+% Clear pending sub-caption list entries.
+% \begin{macrocode}
+\newcommand*\caption@clearsubcontentslines{%
+ \global\let\caption@subcontentslines\@empty}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@AtBeginDocument*{%
+ \caption@ifundefined\sf@ifpositiontop{\let\sf@ifpositiontop\@gobbletwo}{}%
+ \caption@clearsubcontentslines
+ \g@addto@macro\caption@typehook{\caption@checksubcontentslines}%
+ \AtEndDocument{\caption@checksubcontentslines}}%
+% \end{macrocode}
+%
+% \subsection{Document class \& Babel package support}
+%
+% \subsubsection{The \AmS{} \& \SmF{} classes}
+% \changes{v3.1}{2007/07/29}{\AmS\ \& \SmF\ classes support added}
+%
+% \begin{macrocode}
+\caption@ifundefined\smf@makecaption{}{\let\smf@makecaption\@makecaption}
+% \end{macrocode}
+%
+% \subsubsection{The beamer class}
+% \changes{v3.1}{2007/03/10}{beamer class support added}
+%
+% \begin{macrocode}
+\@ifclassloaded{beamer}{%
+ \caption@InfoNoLine{beamer document class}%
+% \end{macrocode}
+%
+% \begin{macro}{\figure}
+% \changes{v3.1f}{2007/12/17}{This re-definition for \class{beamer} document class added}
+% \begin{macro}{\table}
+% \changes{v3.1f}{2007/12/17}{This re-definition for \class{beamer} document class added}
+% We redefine |figure| \& |table| so our type-specific options will be used etc.
+% \begin{macrocode}
+ \expandafter\let\expandafter\caption@ORI@figure
+ \csname\string\figure\endcsname
+ \@namedef{\string\figure}[#1]{%
+ \caption@ORI@figure[#1]%
+ \caption@settype{figure}}
+% \end{macrocode}
+% \begin{macrocode}
+ \expandafter\let\expandafter\caption@ORI@table
+ \csname\string\table\endcsname
+ \@namedef{\string\table}[#1]{%
+ \caption@ORI@table[#1]%
+ \caption@settype{table}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The \KOMAScript{} classes}
+%
+% \KOMAScript\ contains the code
+% |\AtBeginDocument{\let\scr@caption\caption}|
+% so we need to update |\scr@caption| here, too.
+%
+% \begin{macrocode}
+\caption@ifundefined\scr@caption{}{%
+ \caption@AtBeginDocument{\let\scr@caption\caption}}
+% \end{macrocode}
+%
+% \subsubsection{The frenchb Babel option}
+% \changes{v3.1}{2006/05/14}{Adaptation to \package{frenchb} added}
+%
+% Suppress
+% ``Package |frenchb.ldf| Warning: The definition of |\@makecaption| has been
+% changed, frenchb will NOT customize it.''
+% (but only if we emulate this customization)
+% \begin{macrocode}
+\@nameuse{caption@frenchb}\@nameundef{caption@frenchb}
+% \end{macrocode}
+%
+% \subsubsection{The frenchle/pro package}
+% \changes{v3.0h}{2005/10/03}{Adaptation to \package{frenchle/pro} added}
+%
+% \begin{macrocode}
+\caption@AtBeginDocument{\caption@ifundefined\frenchTeXmods{}{%
+ \caption@InfoNoLine{frenchle/pro package is loaded}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \let\captionfont@ORI\captionfont
+ \let\captionlabelfont@ORI\captionlabelfont
+ \let\@makecaption@ORI\@makecaption
+% \end{macrocode}
+
+% If |\GOfrench| is defined as |\relax| all the re-definitions regarding
+% captions have already been done, so we can do our patches immediately.
+% Otherwise we must add our stuff to |\GOfrench|.
+% \begin{macrocode}
+ \caption@ifundefined\GOfrench
+ {\let\caption@tempa\@firstofone}%
+ {\def\caption@tempa{\g@addto@macro\GOfrench}}%
+ \caption@tempa{%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \let\captionfont\captionfont@ORI
+ \let\captionfont@ORI\@undefined
+ \let\captionlabelfont\captionlabelfont@ORI
+ \let\captionlabelfont@ORI\@undefined
+ \let\@makecaption\@makecaption@ORI
+ \let\@makecaption@ORI\@undefined
+% \end{macrocode}
+%
+% \begin{macro}{\@cnORI}
+% We update the definition of |\@cnORI| so it actually reflects
+% our definition of |\caption|.
+% \begin{macrocode}
+ \let\@cnORI\caption
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@tablescaption}
+% The \package{frenchle/pro} package sets |\caption| to |\@tablescaption| at
+% |\begin{table}| for special treatment of footnotes.
+% Therefore we have to patch |\@tablescaption| so |\caption*| will work
+% inside the |table| environment.
+% \begin{macrocode}
+ \let\caption@tcORI\@tablescaption
+ \def\@tablescaption{\caption@star\relax\caption@tcORI}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\f@ffrench}
+% \begin{macro}{\f@tfrench}
+% |\f@ffrench| and |\f@tfrench| reflect |\fnum@figure| and |\fnum@table|
+% when used in French mode. These contain additional code which typesets
+% the caption separator |\captionseparator| instead of the usual colon.
+% Because this breaks with our |\@makecaption| code we have to remove
+% this additional code here.
+% \begin{macrocode}
+ \let\@eatDP\@undefined
+ \let\caption@tempa\@empty
+ \ifx\f@ffrench\fnum@figure
+ \l@addto@macro\caption@tempa{\let\fnum@figure\f@ffrench}%
+ \fi
+ \ifx\f@tfrench\fnum@table
+ \l@addto@macro\caption@tempa{\let\fnum@table\f@tfrench}%
+ \fi
+ \def\f@ffrench{\ifx\listoffigures\relax\else\figurename~\thefigure\fi}%
+ \def\f@tfrench{\ifx\listoftables\relax\else\tablename~\thetable\fi}%
+ \caption@tempa
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+ }%
+}}
+% \end{macrocode}
+%
+% \subsubsection{The hungarian and magyar Babel option}
+% \changes{v3.2}{2009/03/29}{\package{magyar} package support added}
+%
+% \begin{macrocode}
+\def\caption@tempa#1{%
+ \@ifundefined{extras#1}\caption@AtBeginDocument\@firstofone{%
+ \@ifundefined{extras#1}{}{%
+ \caption@InfoNoLine{#1 babel option is loaded}%
+ \expandafter\addto\csname extras#1\endcsname{%
+ % reverse changes made by magyar.ldf
+ \let\@makecaption\caption@makecaption
+ \babel@save\@makecaption
+ \caption@redefine
+ \babel@save\@caption}%
+ }}}
+\caption@tempa{hungarian}%
+\caption@tempa{magyar}%
+% \end{macrocode}
+%
+% \subsection{Package support}
+% \changes{v3.1}{2007/04/11}{Package options `float', `longtable' etc.
+% are not supported anymore, removed}
+%
+% \begin{macro}{\caption@IfPackageLoaded}
+% \changes{v3.0f}{2005/05/29}{3rd argument \meta{code} added,
+% so no extra check is needed}
+% \changes{v3.1}{2007/07/04}{Re-written \& renamed from \cs{caption@ifpackage}
+% to \cs{caption@IfPackageLoaded}}
+% |\caption@IfPackageLoaded|\marg{package}\oarg{version}\marg{true}\marg{false}\par
+% Some kind of combination of |\@ifpackageloaded| and |\@ifpackagelater|.
+% If the \meta{package} is not loaded yet, the check will be (re-)done
+% |\AtBeginDocument|, so the \meta{package} could be loaded later on, too.
+% \begin{macrocode}
+\newcommand\caption@IfPackageLoaded[1]{%
+ \@testopt{\caption@@IfPackageLoaded{#1}}{}}
+\@onlypreamble\caption@IfPackageLoaded
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@IfPackageLoaded#1[#2]#3#4{%
+ \@ifpackageloaded{#1}\@firstofone{%
+ \caption@Debug{#1 package is not loaded (yet)\@gobble}%
+ \caption@AtBeginDocument}{%
+ \caption@@ifpackageloaded{#1}[#2]{#3}{#4}}}
+\@onlypreamble\caption@@IfPackageLoaded
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@ifpackageloaded[1]{%
+ \@testopt{\caption@@ifpackageloaded{#1}}{}}
+\@onlypreamble\caption@ifpackageloaded
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@ifpackageloaded#1[#2]{%
+ \@ifpackageloaded{#1}{%
+ \caption@InfoNoLine{#1 package is loaded}%
+ \@ifpackagelater{#1}{#2}\@firstoftwo{%
+ \caption@Error{%
+ For a successful cooperation we need at least version\MessageBreak
+ `#2' of package #1,\MessageBreak
+ but only version\MessageBreak
+ `\csname ver@#1.\@pkgextension\endcsname'\MessageBreak
+ is available}%
+ \@secondoftwo}%
+ }{\@secondoftwo}}
+\@onlypreamble\caption@@ifpackageloaded
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@clearmargin}
+% \changes{v3.1}{2007/05/05}{This macro and its usage added}
+% This macro will be used by some package support stuff where the usual
+% margin setting is not welcome, e.g. in the \package{sidecap} package.
+% \begin{macrocode}
+\newcommand*\caption@clearmargin{%
+ \setcaptionmargin\z@
+ \let\caption@minmargin\@undefined}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@setbool{needfreeze}{0}
+\caption@AtBeginDocument*{%
+ \caption@ifneedfreeze{%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@freeze}
+% \changes{v3.1}{2007/07/22}{This macro added}
+% \changes{v3.1c}{2007/10/06}{\cs{caption} \& \cs{@caption} revised for enhanced compatibility}
+% \changes{v3.1c}{2007/10/06}{Bugfix: Made \cs{@caption} long}
+% \changes{v3.1f}{2007/11/16}{Uses `space hack' instead of \cs{ignorespaces} now}
+% \changes{v3.1g}{2008/01/29}{Starred variants of \cs{ContinuedFloat} and \cs{captionsetup} added}
+% \changes{v3.2}{2010/10/26}{Bugfix 10-09-01a: Uses \cs{ignorespaces} instead of `space hack' again}
+% \changes{v3.2a}{2011/08/17}{Starred variant of \cs{caption@freeze} removed}
+% \changes{v3.2b}{2011/08/18}{Redefines \cs{caption@setup} instead of \cs{captionsetup} now}
+% \changes{v3.2b}{2011/08/18}{Redefinition of \cs{label} revised}
+% \changes{v3.2c}{2011/08/21}{Revised}
+% |\caption@freeze|\par
+% Used by the \package{fltpage} \& \package{sidecap} package support.
+% \begin{macrocode}
+ \newcommand*\caption@freeze{%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@frozen@ContinuedFloat\ContinuedFloat
+ \def\ContinuedFloat{%
+ \caption@withoptargs\caption@SC@ContinuedFloat}%
+ \def\caption@SC@ContinuedFloat##1{%
+ \caption@@freeze{\ContinuedFloat##1}%
+ \let\caption@frozen@setcounter\setcounter
+ \let\caption@frozen@addtocounter\addtocounter
+ \def\setcounter####1####2{\csname c@####1\endcsname####2\relax}%
+ \def\addtocounter####1####2{\advance\csname c@####1\endcsname ####2\relax}%
+ \caption@frozen@ContinuedFloat##1%
+ \let\setcounter\caption@frozen@setcounter
+ \let\addtocounter\caption@frozen@addtocounter}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@frozen@setup\caption@setup
+ \def\caption@setup##1{%
+ \caption@@freeze{\caption@setup{##1}}%
+ \caption@frozen@setup{##1}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@frozen@caption\caption
+ \def\caption{%
+ \def\caption{%
+ \caption@Error{%
+ Only one \noexpand\caption can be placed in this environment}%
+ \caption@gobble}%
+ \@ifstar
+ {\caption@SC@caption*}%
+ {\let\caption@frozen@refstepcounter\caption@@refstepcounter
+ \let\caption@@refstepcounter\caption@l@stepcounter
+ \caption@refstepcounter\@captype
+ \let\caption@@refstepcounter\caption@frozen@refstepcounter
+ \let\@currentlabel\caption@SClabel
+ \caption@withoptargs\caption@SC@caption}}%
+ \long\def\caption@SC@caption##1##2{%
+ \caption@@freeze{\caption##1{##2}}%
+ \ignorespaces}%
+% \end{macrocode}
+% \begin{macrocode}
+ \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}}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \global\let\caption@frozen@content\@empty
+ \long\def\caption@@freeze{%
+ \g@addto@macro\caption@frozen@content}%
+% \end{macrocode}
+% \begin{macrocode}
+ \def\caption@warmup{%
+ \let\ContinuedFloat\caption@frozen@ContinuedFloat
+ \let\caption@setup\caption@frozen@setup
+ \let\caption\caption@frozen@caption
+ \let\label\caption@frozen@label}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@defrost}
+% \changes{v3.1}{2007/07/22}{This macro added}
+% \changes{v3.1g}{2008/01/30}{\cs{caption@defrost@setup} added}
+% \changes{v3.2c}{2011/08/21}{Adapted to changes of \cs{caption@freeze}}
+% \changes{v3.2c}{2011/08/21}{\cs{caption@defrost@setup} removed}
+% |\caption@defrost|
+% \begin{macrocode}
+ \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}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ }{}%
+ \caption@undefbool{needfreeze}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@warmup}
+% \changes{v3.2a}{2011/08/17}{This macro added}
+% |\caption@warmup|
+% \begin{macrocode}
+\let\caption@warmup\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{The float package}
+% \changes{v3.0f}{2005/05/31}{\package{float} package support rewritten and improved}
+% \iffalse
+% (This is a more straight-ahead implementation, but it only works with v1.3
+% now, so v1.2 is no longer supported. The old code including documentation
+% can be found in caption-30f-050530.zip)
+% \fi
+%
+% The \package{float} package usually do not use the \LaTeX\ kernel command
+% |\@caption| to typeset the caption but |\float@caption| instead.
+% (|\@caption| will only be used if the float is re-styled with
+% |\restylefloat*|.)
+%
+% The main two things |\float@caption| is doing different are:
+% \begin{itemize}
+% \item The caption will be typeset inside a |\savebox| called |\@floatcapt|
+% so it can be placed above or below the float contents afterwards.
+% \item |\@makecaption| will not be used to finally typeset the caption.
+% Instead |\@fs@capt| will be used which definition is part of the float
+% style.
+% (Note that |\@fs@capt| will not typeset any vertical space above or below
+% the caption; instead this space will be typeset by the float style code
+% itself.)
+% \end{itemize}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{float}[2001/11/08 v1.3d]{%
+ \@ifpackageloaded{floatrow}{%
+ \caption@ifpackageloaded{floatrow}[2007/08/24 v0.2a]{}{}%
+ }{%
+% \end{macrocode}
+%
+% \begin{macro}{\@float@setevery}
+% \changes{v3.1k}{2009/10/09}{Bugfix 08-12-05: \cs{color@begin/endgroup} added
+% to redefinition of \cs{caption@setfloatcapt}}
+% |\@float@setevery|\marg{float type} is provided by the \package{float}
+% package; it's called every time a floating environment defined with
+% |\newfloat| or |\restylefloat| begins.
+% We use this hook to do some adaptations and to setup the proper caption
+% style (if defined) and additional settings declared with
+% |\captionsetup|\oarg{float style}.
+% \begin{macrocode}
+ \let\caption@ORI@float@setevery\@float@setevery
+ \def\@float@setevery#1{%
+ \float@ifcaption{#1}{%
+% \end{macrocode}
+%
+% First of all we set the caption position to it's proper value by
+% converting |\@fs@iftopcapt| (which is part of a float style and
+% controls where the caption will be typeset, above or below the float
+% contents) to our |position=| setting.
+% Since the spacing above and below the caption will be done by the float
+% style and \emph{not} by us this sounds quite useless. But in fact it isn't,
+% since some packages based on \thispackage\ (like the \package{subfig}
+% package) could have an interest for this information and therefore use the
+% |\caption@iftop| macro we provide in our kernel. Furthermore we need this
+% information for ourself in |\captionof| which uses |\@makecaption| to
+% finally typeset the caption with skips.
+% \begin{macrocode}
+ \caption@setposition{\@fs@iftopcapt t\else b\fi}%
+% \end{macrocode}
+%
+% Afterward we redefine |\caption@setfloatcapt| (which will be used inside
+% |\@caption|) so the caption will be set inside the box |\@floatcapt|,
+% without extra vertical space.
+% \begin{macrocode}
+ \renewcommand\caption@setfloatcapt[1]{%
+ \let\@makecaption\caption@@make
+ \global\setbox\@floatcapt\vbox{%
+ \color@begingroup ##1\color@endgroup}}%
+% \end{macrocode}
+%
+% To allow different caption styles for different float styles we also
+% determine the current float style (e.g. `ruled') and select
+% a caption style (and additional settings) with the same name, if defined.
+% \begin{macrocode}
+ \float@getstyle\float@style{#1}%
+ \caption@setstyle*\float@style
+ \caption@setoptions\float@style
+% \end{macrocode}
+%
+% \begin{macrocode}
+ }{}%
+ \caption@freezeHref % will be defrosted in \float@makebox
+ \caption@ORI@float@setevery{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@typehook}
+% \changes{v3.1}{2007/07/08}{float package hook added}
+% \LaTeX\ and almost every other packages use
+% |\|\meta{type}|name|
+% to provide a macro for the type resp.~environment name -- for example
+% the command |\figurename| will usually contain the name of the floating
+% environment |figure|:
+% \begin{quote}
+% |\newcommand\figurename{Figure}|
+% \end{quote}
+% But the \package{float} package doesn't follow this common naming
+% convention:
+% For floats defined with |\newfloat| it uses |\fname@|\meta{type} instead,
+% which breaks with our code (and with |\autoref| and some other things as
+% well).
+% So we have to map the \package{float} package name to the common one here.\par
+% \Note{If the float was not defined with \cs{newfloat} but with
+% \cs{restylefloat} instead, \cs{fname@}\meta{type} is not defined.}
+% \begin{macrocode}
+ \g@addto@macro\caption@typehook{%
+ \expandafter\ifx\csname #1name\endcsname\relax
+ \expandafter\let\csname #1name\expandafter\endcsname
+ \csname fname@#1\endcsname
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0f}{2005/06/26}{Skips of \env{plaintop} and \env{boxed} floats corrected}
+% \begin{macro}{\fs@plaintop}
+% \begin{macro}{\fs@boxed}
+% Since the float styles |plaintop| and |boxed| don't use |\abovecaptionskip|
+% which could be set with |skip=| (|plaintop| uses |\belowcaptionskip| instead of
+% |\abovecaptionskip|, and |boxed| uses a fixed space of |2pt|)
+% we patch the according float style macros here to change this.
+% \begin{macrocode}
+ \g@addto@macro\fs@plaintop{\def\@fs@mid{\vspace\abovecaptionskip\relax}}%
+ \g@addto@macro\fs@boxed{\def\@fs@mid{\kern\abovecaptionskip\relax}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\float@getstyle}
+% \changes{v3.1}{2007/06/10}{This macro added}
+% |\float@getstyle|\marg{cmd}\marg{type}\par
+% Determining the float style is not so easy because the only hint
+% provided by the \package{float} package is the macro
+% |\fst@|\meta{float type} which points to the macro which represents the
+% float style. So for example after
+% \begin{quote}
+% |\floatstyle{ruled}|\\
+% |\newfloat{Program}{tbp}{lop}|
+% \end{quote}
+% |\fst@Program| will be defined as
+% \begin{quote}
+% |\def\fst@Program{\fs@ruled}|\quad.
+% \end{quote}\par
+% So here is what we do: We make the first level expansion of
+% |\fst@|\meta{float type} a string so we can gobble the first four tokens
+% (= |\fs@|), so only the the name of the float style is left.\par
+% \emph{TODO:} We need to convert the catcodes here.
+% \begin{macrocode}
+ \providecommand*\float@getstyle[2]{%
+ \edef#1{%
+ \noexpand\expandafter\noexpand\@gobblefour\noexpand\string
+ \expandafter\expandafter\expandafter\noexpand
+ \csname fst@#2\endcsname}%
+ \edef#1{#1}%
+ \caption@Debug{floatstyle{#2} = `#1'}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\float@ifcaption}
+% \changes{v3.1}{2007/06/23}{This macro added}
+% |\float@ifcaption|\marg{type}\marg{if-clause}\marg{else-clause}\par
+% Here we determine if the user has used |\newfloat| resp.~|\restylefloat|,
+% or |\restylefloat*|.
+% This is quite easy: If |\@float@c@|\meta{captype} is the same as
+% |\float@caption|, the user has used |\newfloat| or |\restylefloat|,
+% otherwise we assume he has used |\restylefloat*|.
+% (This test will fail if some package re-defines |\float@caption|,
+% so we have to assume that there is no one.)
+% \begin{macrocode}
+ \providecommand*\float@ifcaption[1]{%
+ \expandafter\ifx\csname @float@c@#1\endcsname\float@caption
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}}{%
+ \providecommand*\float@ifcaption[1]{\@secondoftwo}%
+% \clearcaptionsetup{boxed}% used by the floatrow package?
+}
+% \end{macrocode}
+%
+% The skip between `boxed' floats and their caption defaults to |2pt|.
+%
+% \begin{macrocode}
+\captionsetup[boxed]{skip=2pt} % do not issue a warning when not used
+% \end{macrocode}
+%
+% \changes{v3.0f}{2005/05/26}{\opt{strut=0} added to caption style \opt{ruled}}
+% \changes{v3.0f}{2005/05/27}{Option \opt{ruled} fixed}
+% To emulate the `ruled' definition of |\@fs@capt| we provide a caption style
+% `ruled' with appropriate options. But if the package option |ruled| was
+% specified, we setup some caption parameters to emulate the behavior
+% of \thispackage\ \version{1.x} option |ruled| instead, i.e.,
+% the current caption settings will be used, but without margin and without
+% `single-line-check'.
+% \begin{macrocode}
+\caption@ifbool{ruled}{%
+ \captionsetup[ruled]{margin=0pt,minmargin=0,slc=0}%
+}{%
+ \DeclareCaptionStyle{ruled}{labelfont=bf,labelsep=space,strut=0}%
+}
+\caption@undefbool{ruled}
+% \end{macrocode}
+%
+% \subsubsection{The floatflt package}
+% \changes{v3.1}{2007/06/10}{Support of the \package{floatflt} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{floatflt}[1996/02/27 v1.3]{%
+% \end{macrocode}
+%
+% \begin{macro}{\floatingfigure}
+% We patch |\floatingfigure| so |\caption@floatflt| will be used.
+% \begin{macrocode}
+ \let\caption@ORI@floatingfigure\floatingfigure
+ \def\floatingfigure{%
+ \caption@floatflt{figure}%
+ \caption@ORI@floatingfigure}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\floatingtable}
+% Same with |\floatingtable|\ldots
+% \begin{macrocode}
+ \let\caption@ORI@floatingtable\floatingtable
+ \def\floatingtable{%
+ \caption@floatflt{table}%
+% \caption@setautoposition b%
+ \caption@ORI@floatingtable}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@floatflt}
+% \changes{v3.1c}{2007/10/06}{Bugfix: \cs{caption@clearmargin} added}
+% Here we do two things:
+% \begin{enumerate}
+% \item We use |\caption@set|\-|options{|\-|floating|\meta{type}|}| so
+% |\caption|\-|setup[|\-|floating|\meta{type}|]{|\ldots|}| is supported.
+% \item |\line|\-|width| must be set correctly.
+% Usually this is done by |\@par|\-|box|\-|restore| inside |\@caption|,
+% but since we use |\@caption@box|\-|restore| we have to map this to
+% |\@par|\-|box|\-|restore| instead.
+% \end{enumerate}
+% \begin{macrocode}
+ \newcommand*\caption@floatflt[1]{%
+ \caption@settype{#1}%
+ \caption@clearmargin
+ \caption@setfullparboxrestore
+ \caption@setoptions{floating#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The fltpage package}
+% \changes{v3.1}{2007/07/22}{Support of the \package{fltpage} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{fltpage}[1998/10/29 v.0.3]{%
+ \caption@setbool{needfreeze}{1}%
+% \end{macrocode}
+%
+% \begin{macro}{\FP@positionLabel}
+% \changes{v3.2c}{2011/08/28}{This redefinition added}
+% Original code:
+% \begin{verbatim}
+% \newcommand{\FP@positionLabel}{%
+% FP\@captype-\number\value{FP@\@captype C}-pos}
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \renewcommand\FP@positionLabel{%
+ FP\FP@captype-\number\value{FP@\FP@captype C}-pos}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FP@helpNote}
+% Original code:
+% \begin{verbatim}
+% \newcommand{\FP@helpNote}[2]{%
+% \typeout{FP#1 is inserted on page \pageref{#2}!}}%
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \renewcommand\FP@helpNote[2]{%
+ \begingroup % save \caption@thepage
+ \caption@pageref{#2}%
+ \typeout{FP#1 is inserted on page \caption@thepage!}%
+ \endgroup}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FP@floatBegin}
+% \changes{v3.1f}{2007/11/16}{Uses `space hack' instead of \cs{ignorespaces} now}
+% \changes{v3.1k}{2009/10/09}{Bugfix 09-09-11: Missing \cs{ignorespaces} added}
+% \changes{v3.2c}{2011/08/28}{Adapted to current version of \cs{caption@freeze}}
+% Original code:
+% \begin{verbatim}
+% \newcommand{\FP@floatBegin}[1]{%
+% \gdef\@captype{#1}%
+% \global\let\FP@savedCaptionCommand\caption%
+% \global\let\FP@savedLabelCommand\label%
+% \ifthenelse{\equal{\@captype}{figure}}
+% {\global\let\old@Fnum\fnum@figure}%
+% {\global\let\old@Fnum\fnum@table}%
+% \let\FP@LabelText\@empty%
+% \let\FP@CaptionText\@empty%
+% \let\FP@optionalCaptionText\@empty%
+% \renewcommand\label[1]{\gdef\FP@LabelText{##1}}%
+% \renewcommand\caption[2][]{%
+% \gdef\FP@optionalCaptionText{##1}\gdef\FP@CaptionText{##2}}%
+% \begin{lrbox}{\FP@floatCorpusBOX}%
+% }%
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \renewcommand*\FP@floatBegin[1]{%
+ \def\FP@captype{#1}%
+ \begin{lrbox}{\FP@floatCorpusBOX}%
+ \caption@settype*{#1}%
+ \caption@freeze
+ \global\let\FP@Label\@empty
+ \caption@ifFPrefcap
+ {}%
+ {\def\caption@freeze@label##1##2{%
+ \g@addto@macro\FP@Label{\FP@label##1{##2}}}}%
+ \ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FP@floatEnd}
+% \changes{v3.1g}{2008/01/30}{Some minor bugfixes}
+% \changes{v3.2c}{2011/08/28}{Adapted to current version of \cs{caption@freeze}}
+% Original code:
+% \begin{verbatim}
+% \newcommand{\FP@floatEnd}{%
+% \end{lrbox}%
+% \global\setbox\FP@floatCorpusBOX=\box\FP@floatCorpusBOX
+% \stepcounter{FP@\@captype C}%
+% \FP@savedLabelCommand{\FP@positionLabel}%
+% \FP@helpNote{\@captype}{\FP@positionLabel}%
+% \FP@float
+% {\FP@positionLabel}% location label test
+% {\begin{\@captype}[p!]
+% \usebox{\FP@floatCorpusBOX}%
+% \refstepcounter{\@captype}%
+% \ifthenelse{\equal{\FP@LabelText}{\@empty}}
+% {}{\FP@savedLabelCommand{\expandafter\protect\FP@LabelText}}%
+% \end{\@captype}}
+% {\addtocounter{\@captype}{-1}}
+% {\begin{\@captype}[b!]%
+% \ifthenelse{\equal{\FP@guide}{\@empty}}%
+% {}{\ifthenelse{\equal{\@captype}{figure}}%
+% {\renewcommand{\fnum@figure}{\old@Fnum\ {\FP@guide}}}%
+% {\renewcommand{\fnum@table}{\old@Fnum\ {\FP@guide}}}}%
+% \setlength{\abovecaptionskip}{2pt plus2pt minus 1pt} % length above caption
+% \setlength{\belowcaptionskip}{2pt plus2pt minus 1pt} % length above caption
+% \FP@separatorCaption%
+% \ifthenelse{\equal{\FP@optionalCaptionText}{\@empty}}%
+% {\FP@savedCaptionCommand{\expandafter\protect\FP@CaptionText}}%
+% {\FP@savedCaptionCommand[\expandafter\protect\FP@optionalCaptionText]%
+% {\expandafter\protect\FP@CaptionText}}%
+% \end{\@captype}}%
+% }%
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \renewcommand*\FP@floatEnd{%
+ \end{lrbox}%
+% \end{macrocode}
+% \begin{macrocode}
+ \stepcounter{FP@\FP@captype C}%
+ \caption@label\FP@positionLabel
+ \FP@helpNote\FP@captype\FP@positionLabel
+% \end{macrocode}
+% \begin{macrocode}
+ \edef\FP@RestoreCounter{%
+ \noexpand\setcounter{\FP@captype}{\the\value\FP@captype}%
+ \noexpand\setcounter{ContinuedFloat}{\the\value{ContinuedFloat}}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \FP@float
+ {\FP@positionLabel}% location label test
+ {\begin\FP@captype[p!]%
+ \usebox\FP@floatCorpusBOX
+ \let\caption@SClentry\@empty
+ \def\caption{\caption@dblarg{\@caption\@captype}}%
+ \long\def\@caption##1[##2]##3{\def\caption@SClentry{##2}}%
+ \let\FP@label\label
+ \let\label\caption@gobble
+ \caption@defrost
+ \caption@ifFPlistcap
+ {\caption@refstepcounter\@captype
+ \expandafter\caption@makecurrent\expandafter\@captype
+ \expandafter{\caption@SClentry}}%
+ {\ifx\caption@SClentry\@empty \else
+ \expandafter\captionlistentry\expandafter{\caption@SClentry}%
+ \fi}%
+ \caption@makeanchor\relax
+ \FP@Label
+ \end\FP@captype}%
+ {\FP@RestoreCounter
+ \@ifundefined{theH\FP@captype}{}{%
+ \expandafter\l@addto@macro\csname theH\FP@captype\endcsname{.FP}}}%
+ {\begin\FP@captype[b!]%
+ \let\FP@savedSetfnumCommand\caption@setfnum
+ \def\caption@setfnum##1{%
+ \FP@savedSetfnumCommand{##1}%
+ \ifx\FP@guide\@empty \else
+ \expandafter\l@addto@macro\csname fnum@##1\endcsname{\ {\FP@guide}}%
+ \fi}%
+ \setlength\abovecaptionskip{2pt plus 2pt minus 1pt}% length above caption
+ \setlength\belowcaptionskip{2pt plus 2pt minus 1pt}% length below caption
+ \caption@setoptions{FP\@captype}%
+ \FP@separatorCaption
+ \caption@ifFPlistcap{}{\let\caption@addcontentsline\@gobbletwo}%
+ \caption@defrost
+ \end\FP@captype}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{%
+ \let\caption@ifFPlistcap\@undefined
+ \let\caption@ifFPrefcap\@undefined
+}
+% \end{macrocode}
+%
+% \subsubsection{The hyperref package}
+% \changes{v3.0f}{2005/06/11}{Support of the \package{hyperref} package added}
+% \changes{v3.1}{2007/03/09}{Usage of \cs{hyper@makecurrent} instead of
+% \cs{theHfigure} as indicator for \package{hyperref} package}
+% \changes{v3.2}{2011/07/30}{Test if \package{hyperref} has stopped early revised}
+% \changes{v3.2c}{2011/08/24}{Test if \package{hyperref} has stopped early adapted to current version of \package{hyperref} package: Usage of \cs{IfHyperBoolean} added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{hyperref}[2003/11/30 v6.74m]{%
+ % Test if hyperref has stopped early
+ \caption@ifundefined\IfHyperBoolean{%
+ \caption@set@bool\caption@ifhyp@stoppedearly0%
+ \caption@ifundefined\H@refstepcounter
+ {\caption@set@bool\caption@ifhyp@stoppedearly1}{%
+ \caption@ifundefined\hyper@makecurrent
+ {\caption@set@bool\caption@ifhyp@stoppedearly1}{%
+ \caption@ifundefined\measuring@true
+ {\caption@set@bool\caption@ifhyp@stoppedearly1}{}}}%
+ }{%
+ \def\caption@ifhyp@stoppedearly{\IfHyperBoolean{stoppedearly}}%
+ }%
+ \caption@ifhyp@stoppedearly{% hyperref has stopped early
+ \caption@InfoNoLine{%
+ Hyperref support is turned off\MessageBreak
+ because hyperref has stopped early}%
+ }{%
+ \g@addto@macro\caption@prepareslc{\measuring@true}%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@@refstepcounter}
+% We redefine |\caption@@refstepcounter| so |\H@refstepcounter| will be used
+% instead of |\refstepcounter| inside |\caption| \& |\captionlistentry|.
+% \begin{macrocode}
+ \renewcommand*\caption@@refstepcounter{\H@refstepcounter}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makecurrent}
+% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% We redefine |\caption@makecurrent| so a \package{hyperref} label
+% will be defined inside |\@caption|.
+% \Note{Will be redefined by \cs{caption@start}.}
+% \begin{macrocode}
+ \renewcommand*\caption@makecurrent[2]{%
+ \caption@makecurrentHref{#1}%
+ \caption@Debug{hyperref current=\@currentHref}%
+ \caption@gettitle{#2}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\caption@makecurrentHref{\hyper@makecurrent}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makeanchor}
+% \changes{v3.1l}{2010/01/09}{Adapted to the current hyperref package}
+% We redefine |\caption@makeanchor| so a \package{hyperref} anchor
+% will be set inside |\@caption|.
+% \Note{Will be redefined by \cs{caption@start}.}
+% \begin{macrocode}
+ \renewcommand\caption@makeanchor[1]{%
+ \caption@Debug{hyperref anchor: \@currentHref}%
+ % If we cannot have nesting, the anchor is empty.
+ \ifHy@nesting
+ \expandafter\hyper@@anchor\expandafter{\@currentHref}{#1}%
+ \else
+ \Hy@raisedlink{%
+ \expandafter\hyper@@anchor\expandafter{\@currentHref}{\relax}%
+ }#1%
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+ \g@addto@macro\caption@prepareslc{\let\caption@makeanchor\@firstofone}%
+% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{The hypcap option}
+%
+% \begin{macro}{\if@capstart}
+% Like the \package{hypcap} package we define the switch |\if@capstart|, too.
+% \begin{macrocode}
+ \newif\if@capstart
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@start}
+% \changes{v3.0l}{2007/02/20}{%
+% \cs{caption@currentHref} renamed to \cs{hc@currentHref}}
+% \changes{v3.1}{2007/06/21}{%
+% This macro renamed from \cs{capstart} to \cs{caption@start} and revised}
+% While the \package{hypcap} package defines a macro called |\capstart|
+% our variant is called |\caption@start| and is controlled by the option
+% |hypcap=||false|/|true|.
+% \begin{macrocode}
+ \def\caption@start{\caption@ifhypcap\caption@start@\relax}%
+ \def\caption@start@{%
+% \end{macrocode}
+% Generate the \package{hyperref} label and set the \package{hyperref} anchor,
+% usually (if |hypcap=false|) both is done inside |\@caption|.
+% \begin{macrocode}
+ \caption@makestart\@captype
+ \caption@startanchor\@currentHref
+% \end{macrocode}
+% Prevent |\@caption| from generating a new \package{hyperref} label,
+% use the label we save in |\hc@currentHref| instead.
+% (We also support the |@capstart| flag from the \package{hypcap} package.)
+% \begin{macrocode}
+ \global\@capstarttrue
+ \let\hc@currentHref\@currentHref
+ \def\caption@makecurrentHref##1{%
+ \global\@capstartfalse
+ \global\let\@currentHref\hc@currentHref}%
+% \end{macrocode}
+% Prevent |\@caption| from generating a \package{hyperref} anchor since this
+% has already been done.
+% \begin{macrocode}
+ \let\caption@makeanchor\@firstofone
+% \end{macrocode}
+% \begin{macrocode}
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makestart}
+% \changes{v3.1c}{2007/09/30}{\cs{@currentHref} will be extended by \texttt{caption}
+% instead of \texttt{xxx} now}
+% |\caption@makestart|\marg{type}
+% defines a \package{hyperref} anchor inside |\caption@start|.\par
+% Since we offer |\ContinuedFloat| the float counter can change between
+% `now' and |\caption|, i.e., we simply don't know the figure or table counter
+% yet and therefore we are not able to generate the `right' \package{hyperref}
+% label.
+% Two different solutions of this problem came into my mind:
+% \begin{enumerate}
+% \item I could use the aux file for this purpose.\par
+% -or-
+% \item I set |hypertexnames=false| locally.
+% Furthermore I use |#1.caption.|\meta{counter} (instead of |#1.|\meta{counter})
+% as naming scheme for |\@currentHref| to avoid conflicts with other hyper
+% links which are generated with |hypertexnames=true|.
+% \end{enumerate}
+% The first idea has the advantage that the `right' anchor name will be
+% generated, but one needs an additional \LaTeX\ run if figures or tables
+% will be inserted or removed.\par
+% The second idea has the advantage that it's very easy to implement, but
+% has some side-effects, e.g. the anchor names don't follow the figure or
+% table label names anymore.\par
+% Since I'm lazy I implemented the second idea, maybe I will revise this
+% later on.
+% \begin{macrocode}
+ \newcommand*\caption@makestart[1]{%
+ \begingroup
+ \Hy@hypertexnamesfalse
+% \gdef\@currentHlabel{}%
+ \hyper@makecurrent{#1.caption}%
+ \endgroup
+ \caption@Debug{hypcap start=\@currentHref}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@startanchor}
+% \changes{v3.1b}{2007/09/17}{Bugfix 06-09-17: We use \cs{caption@anchor} instead of \cs{hyper@@anchor}}
+% \changes{v3.1g}{2008/03/16}{Warning about TeX mode replaced with debug info}
+% |\caption@startanchor|\marg{Href}
+% sets a \package{hyperref} anchor inside |\caption@start|.\par
+% This code was taken from the \package{hypcap} package\cite{hypcap} and adapted.
+% \Note{Since \cs{hyper@@anchor}\marg{Href}\csmarg{\string\relax} can cause
+% a change from vertical mode to horizontal mode (design flaw in
+% \package{hyperref} package!?), and since the workaround
+% \cs{let}\cs{leavevmode}\cs{relax} which can be found in the
+% \package{hypcap} package is not always sufficient
+% (for example with ``Direct pdfmark support'' and \texttt{breaklinks=true}),
+% we use \cs{caption@anchor} instead of \cs{hyper@@anchor} here.}
+% \begin{macrocode}
+ \newcommand*\caption@startanchor[1]{%
+ \ifvmode\begingroup
+ \caption@Debug{hypcap anchor: #1 (vertical mode)}%
+ \@tempdima\prevdepth
+ \nointerlineskip
+ \vspace*{-\caption@hypcapspace}%
+ \caption@anchor{#1}%
+ \vspace*{\caption@hypcapspace}%
+ \prevdepth\@tempdima
+ \endgroup\else
+ \caption@Debug{hypcap anchor: #1 (horizontal mode)}%
+ \caption@anchor{#1}%
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@anchor}
+% \changes{v3.1c}{2007/10/17}{Workaround 07-10-17: We use \cs{caption@raisedlink} instead of \cs{Hy@raisedlink} now}
+% |\caption@anchor|\marg{Href} sets a \package{hyperref} anchor.
+% \begin{macrocode}
+ \newcommand*\caption@anchor[1]{%
+ \ifmeasuring@ \else
+ \caption@raisedlink{\hyper@anchorstart{#1}\hyper@anchorend}%
+ \fi}%
+% \end{macrocode}
+% \Note{Since \cs{Hy@raisedlink} change \cs{@tempdima} we surrounded it by \cs{ifvmode},
+% suppressing ``\texttt{LaTeX Warning: Float too large for page by 1.0pt}'' in \texttt{sideways} floats.
+% (This is not necessary since \package{hyperref} \version{6.77}.)}
+% \begin{macrocode}
+ \ifx\HyperRaiseLinkLength\@tempdima
+ \def\caption@raisedlink#1{\ifvmode#1\else\Hy@raisedlink{#1}\fi}%
+ \else
+ \let\caption@raisedlink\Hy@raisedlink
+ \fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@start}
+% Will be used by |\caption@freezeHref|. Apart from that we issue a warning
+% if we expect a saved \package{hyperref} label coming from |\caption@start|,
+% but there isn't any.
+% \begin{macrocode}
+ \def\caption@@start{%
+ \caption@ifundefined\hc@currentHref{%
+ \caption@Warning{%
+ The option `hypcap=true' will be ignored for this\MessageBreak
+ particular \string\caption}}{}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@freezeHref}
+% Suppress |\caption@start| from generating a \package{hyperref} label and
+% setting a \package{hyperref} anchor. Instead if |\@caption| generates a
+% \package{hyperref} label, it will be stored in |\caption@currentHref|.
+% Furthermore we need to redefine |\caption@setfloatcapt| so no
+% \package{hyperref} anchor will be placed in |\@caption|.
+% \iffalse
+% (Since |\caption@setfloatcapt| will be set to |\@firstofone| inside
+% |\subcaption| there is no need to add its restauration to
+% |\caption@subtypehook|.)
+% \fi
+% \begin{macrocode}
+ \def\caption@freezeHref{%
+ \let\caption@ORI@start\caption@start
+ \def\caption@start{\let\caption@start\caption@ORI@start}%
+% \end{macrocode}
+% \begin{macrocode}
+% \let\caption@ORI@@start\caption@@start
+% \l@addto@macro\caption@subtypehook{%
+% \let\caption@@start\caption@ORI@@start}%
+% \end{macrocode}
+% \begin{macrocode}
+ \global\let\caption@currentHref\@undefined
+ \def\caption@@start{\global\let\caption@currentHref\@currentHref}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@ORI@setfloatcapt\caption@setfloatcapt
+ \renewcommand*\caption@setfloatcapt{%
+ \ifx\caption@currentHref\@undefined \else
+ \let\caption@makeanchor\@firstofone
+ \fi
+ \caption@ORI@setfloatcapt}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@defrostHref}
+% If there is a freezed |\@currentHref|, we set the \package{hyperref}
+% anchor here.
+% \begin{macrocode}
+ \def\caption@defrostHref{%
+ \ifx\caption@currentHref\@undefined \else
+ \caption@startanchor\caption@currentHref
+ \global\let\caption@currentHref\@undefined
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\float@makebox}
+% Do our own redefinition of |\float@makebox|, if it was redefined by
+% the \package{hyperref} package.
+% \begin{macrocode}
+ \caption@ifundefined\HyOrg@float@makebox{}{%
+ \caption@Debug{%
+ Redefining \noexpand\float@makebox (again)\@gobble}%
+ \let\caption@ORI@float@makebox\float@makebox % save for compatibility mode
+ \renewcommand\float@makebox[1]{%
+ \HyOrg@float@makebox{#1\relax \caption@defrostHref}}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ }}{}
+% \end{macrocode}
+%
+% \subsubsection{The hypcap package}
+% \changes{v3.0f}{2005/06/22}{Support of the \package{hypcap} package added}
+% \changes{v3.0l}{2007/02/20}{Adapted to \package{hypcap} \version{1.6}}
+% \changes{v3.1e}{2007/11/04}{\package{hypcap} support adapted to \package{hyperref} \version{6.77}}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{hypcap}{% v1.0
+ \ifx\caption@start\relax \else % hyperref hasn't stopped early
+% \end{macrocode}
+%
+% If the \package{hypcap} package was loaded, we give up our own
+% hyperlink placement algorithm and give the control over the placement
+% to the \package{hypcap} package instead.
+%
+% \begin{macro}{\capstart}
+% \changes{v3.1k}{2009/10/09}{Support of \cs{ifcapstart} (\package{hypcap} package \version{1.10}) added}
+% We do this simply by mapping |\capstart| to |\caption@start@|,
+% although our code does not behave exactly like the original one:
+% The original |\capstart| has an effect on the next |\caption|
+% only but our version affects \emph{all} |\caption|s in the same
+% environment, at least unless a new |\capstart| will be placed.
+% \begin{macrocode}
+ \let\caption@ORI@capstart\capstart % save for compatibility mode
+ \caption@ifundefined\capstarttrue % check for v1.10 of hypcap package
+ {\def\capstart{\caption@start@}}%
+ {\def\capstart{\ifcapstart\caption@start@\fi}}%
+ \let\caption@start\relax
+ \let\caption@@start\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@hypcapspace}
+% Furthermore we map our |\caption@hypcapspace| to |\hypcapspace|
+% offered by the \package{hypcap} package.
+% \begin{macrocode}
+ \caption@set@bool\caption@ifhypcap 1%
+ \renewcommand*\caption@hypcapspace{\hypcapspace}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \fi}{}
+% \end{macrocode}
+%
+% \subsubsection{The listings package}
+% \changes{v3.0b}{2004/05/16}{Support of the \package{listings} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{listings}[2004/02/13 v1.2]{%
+% \end{macrocode}
+%
+% \begin{macro}{\lst@MakeCaption}
+% \changes{v3.1g}{2008/01/20}{Bugfix: Skips are handled correctly now}
+% \changes{v3.1k}{2008/03/29}{Bugfix 08-10-16-dctt: \texttt{rule=0} added}
+% \changes{v3.2}{2010/10/26}{Bugfix 10-07-20a: Set \cs{hsize} to \cs{linewidth}, if necessary}
+% To support the \package{listings} package we need to redefine
+% |\lst@MakeCaption| so the original stuff is nested with
+% |\caption@begin| and |\caption@end| etc.
+% \Note{This macro is always called twice (with `t' resp. `b' as
+% parameter), therefore we need an extra group here.}
+% \begin{macrocode}
+ \let\caption@ORI@lst@MakeCaption\lst@MakeCaption
+ \def\lst@MakeCaption#1{% #1 is `t' or `b'
+ \begingroup
+% \end{macrocode}
+% Workaround for bug in \package{listings} package:
+% If |\hsize| seems not to be set correctly, we set it to |\linewidth|.
+% \begin{macrocode}
+ \ifdim\hsize>\linewidth
+ \hsize\linewidth
+ \fi
+% \end{macrocode}
+% First of all, we set |position=#1| and if it was set to `top',
+% we swap the skips so the default behavior of the \package{listings} package
+% will not be changed. (Note that the \package{listings} package has set its
+% own |\abovecaptionskip| \& |\belowcaptionskip| values prior to calling
+% \cs{lst@MakeCaption}.)
+% \begin{macrocode}
+ \caption@setposition{#1}%
+ \caption@iftop{%
+ \@tempdima\belowcaptionskip
+ \belowcaptionskip\abovecaptionskip
+ \abovecaptionskip\@tempdima}{}%
+% \end{macrocode}
+% Workaround for issue with wrong skips (should be examined further)
+% \begin{macrocode}
+ \caption@setup{rule=0}%
+% \end{macrocode}
+% Afterwards we set the local `lstlisting' options.
+% \begin{macrocode}
+ \caption@setoptions{lstlisting}%
+% \end{macrocode}
+% If the |position=| is now set to |auto|, we take over the |captionpos=|
+% setting from the \package{listings} package.
+% \begin{macrocode}
+ \caption@setautoposition{#1}%
+% \end{macrocode}
+% At the end we do similar stuff as in our \cs{@caption} code.
+% \begin{macrocode}
+ \caption@begin{lstlisting}%
+ \caption@ORI@lst@MakeCaption{#1}%
+ \caption@end
+% \end{macrocode}
+% \begin{macrocode}
+ \endgroup}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\lst@makecaption}
+% \begin{macro}{\lst@maketitle}
+% Wrapper macros for typesetting the |caption=| resp. |title=| value.
+% \begin{macrocode}
+ \def\lst@makecaption{\caption@starfalse\@makecaption}%
+ \def\lst@maketitle{\caption@startrue\@makecaption\@empty}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ext@lstlisting}
+% \changes{v3.1}{2007/03/03}{This macro added}
+% Since the \package{listings} package do not define |\ext@lstlisting|
+% but we needed it when |\captionof{lstlisting}| will be done by the end user,
+% we define it here.
+% \begin{macrocode}
+ \providecommand*\ext@lstlisting{lol}%
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.1a}{2007/07/13}{Bugfix 07-09-13: \cs{lst@@caption} will not be re-defined anymore}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The longtable package}
+%
+% \begin{macro}{\LTcaptype}
+% \changes{v3.1}{2007/07/06}{This macro and its support added}
+% |\LTcaptype| is preset to |table|.
+% \begin{macrocode}
+\providecommand*\LTcaptype{table}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{longtable}[1995/05/24 v3.14]{%
+% \end{macrocode}
+% \begin{macrocode}
+ \RequirePackage{ltcaption}[=2007/09/01]%
+ \let\LT@@makecaption\@undefined
+% \end{macrocode}
+%
+% \begin{macro}{\LT@array}
+% \changes{v3.1}{2007/07/22}{This redefinition added}
+% \changes{v3.1a}{2007/09/14}{Bugfix 07-09-14: Redefinition of \cs{@captionabovetrue} \& \cs{@captionabovefalse} added}
+% \changes{v3.1a}{2007/09/16}{Bugfix: This redefinition will always be done \cs{AtBeginDocument}}
+% \changes{v3.1g}{2008/01/20}{Bugfix in \cs{captionlistentry}: Table counter will not be incremented anymore, \cs{nameref} works}
+% We redefine |\LT@array| here to get |\captionsetup|\marg{options}
+% working inside |longtable|s.
+% \Note{Since the \package{hyperref} package patches \cs{LT@array} as well
+% and since this only works with the original definition of \cs{LT@array},
+% we have to do this after the \package{hyperref} package,
+% i.e.~\cs{AtBeginDocument}.}
+% \begin{macrocode}
+ \caption@AtBeginDocument{%
+ \let\caption@ORI@LT@array\LT@array
+ \renewcommand*\LT@array{%
+% \end{macrocode}
+% |\captionsetup| for longtable:
+% \begin{macrocode}
+ \global\let\caption@opt@@longtable\@undefined
+ \def\captionsetup{%
+ \noalign\bgroup
+ \@ifstar\@captionsetup\@captionsetup}% gobble *
+ \def\@captionsetup##1{\LT@captionsetup{##1}\egroup}%
+ \def\LT@captionsetup##1{%
+ \captionsetup@startrue\caption@setup@options[@longtable]{##1}%
+ \global\let\caption@opt@@longtable\caption@opt@@longtable}%
+% \end{macrocode}
+% |\captionabove| \& |\captionbelow| for longtable: (\KOMAScript\ document class)
+% \begin{macrocode}
+ \def\@captionabovetrue{\LT@captionsetup{position=t}}%
+ \def\@captionabovefalse{\LT@captionsetup{position=b}}%
+% \end{macrocode}
+% |\captionlistentry| for longtable:
+% \begin{macrocode}
+ \def\captionlistentry{%
+ \noalign\bgroup
+ \@ifstar{\egroup\LT@captionlistentry}% gobble *
+ {\egroup\LT@captionlistentry}}%
+ \def\LT@captionlistentry##1{%
+ \caption@listentry\@firstoftwo[\LTcaptype]{##1}}%
+% \end{macrocode}
+% |\ContinuedFloat| for longtable:\\
+% {\small(Commented out, since it's not deeply tested and quite useless anyway)}
+% \Note{\package{hyperref} versions $<$ v6.76j uses $2\times$ \cs{hyper@makecurrent}}
+% \begin{macrocode}
+% \caption@ifhypcap{%
+% \let\caption@ORI@hyper@makecurrent\hyper@makecurrent
+% \def\hyper@makecurrent##1{%
+% \let\hyper@makecurrent\caption@ORI@hyper@makecurrent
+% \caption@makestart{##1}%
+%% \let\Hy@LT@currentHlabel\@currentHlabel
+% \let\Hy@LT@currentHref\@currentHref
+% \def\hyper@makecurrent####1{%
+%% \let\@currentHlabel\Hy@LT@currentHlabel
+% \let\@currentHref\Hy@LT@currentHref}}%
+% \let\caption@ORI@ContinuedFloat\ContinuedFloat
+% \def\ContinuedFloat{\noalign{%
+% \gdef\caption@setContinuedFloat{%
+% \let\caption@resetContinuedFloat\@gobble}%
+% \def\caption@setoptions####1{%
+% \g@addto@macro\caption@setContinuedFloat{%
+% \caption@setoptions{####1}}}%
+% \let\@captype\LTcaptype
+% \caption@ORI@ContinuedFloat}}%
+% }{%
+% \def\ContinuedFloat{\noalign{%
+% \caption@Error{%
+% \noexpand\ContinuedFloat inside longtables\MessageBreak
+% is only available with `hypcap=true'}}}%
+% }%
+% \global\let\caption@setContinuedFloat\@empty
+ \def\ContinuedFloat{\noalign{%
+ \caption@Error{\noexpand\ContinuedFloat outside float}}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@ORI@LT@array}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LT@c@ption}
+% \changes{v3.1g}{2008/01/22}{Made it \cs{long}}
+% The original implementation:
+% \begin{verbatim}
+% \def\LT@c@ption#1[#2]#3{%
+% \LT@makecaption#1\fnum@table{#3}%
+% \def\@tempa{#2}%
+% \ifx\@tempa\@empty\else
+% {\let\\\space
+% \addcontentsline{lot}{table}{\protect\numberline{\thetable}{#2}}}%
+% \fi}
+% \end{verbatim}%^^A
+% Our implementation uses |\LTcaptype| instead of |{table}|:
+% \begin{macrocode}
+ \long\def\LT@c@ption#1[#2]#3{%
+ \LT@makecaption#1{\csname fnum@\LTcaptype\endcsname}{#3}%
+ \LT@captionlistentry{#2}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LT@makecaption}
+% \changes{v3.0d}{2004/08/10}{%
+% Bugfix 04-08-04: \cs{abovecaptionskip} \& \cs{belowcaptionskip} will be used now}
+% \changes{v3.0e}{2005/05/05}{%
+% Bugfix: \cs{captionsetup[longtable]} overrides \cs{LTcapwidth} now}
+% \changes{v3.0h}{2005/10/07}{\cs{caption@LT@make} introduced}
+% |\LT@makecaption|\marg{cmd}\marg{label}\marg{text}\par
+% \smallskip
+% The original definition:
+% \begin{verbatim}
+% \def\LT@makecaption#1#2#3{%
+% \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{%
+% % Based on article class "\@makecaption", "#1" is "\@gobble" in star
+% % form, and "\@firstofone" otherwise.
+% \sbox\@tempboxa{#1{#2: }#3}%
+% \ifdim\wd\@tempboxa>\hsize
+% #1{#2: }#3%
+% \else
+% \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
+% \fi
+% \endgraf\vskip\baselineskip}%
+% \hss}}}
+% \end{verbatim}%^^A
+% Our definition:
+% \begin{macrocode}
+ \renewcommand\LT@makecaption[3]{%
+ \caption@LT@make{%
+% \end{macrocode}
+%
+% If |\LTcapwidth| is not set to its default value |4in| we assume
+% that it shall overwrite our own setting.
+% (But |\captionsetup[longtable]{width=|\ldots|}| will overwrite |\LTcapwidth|.)
+% \begin{macrocode}
+ \caption@settype*\LTcaptype
+ \ifdim\LTcapwidth=4in \else
+ \setcaptionwidth\LTcapwidth
+ \fi
+ \caption@setoptions{longtable}%
+% \caption@setContinuedFloat
+ \caption@setoptions{@longtable}%
+% \end{macrocode}
+%
+% \iffalse
+% The default |position=| setting for longtables is |top|.
+% (This emulates the standard behavior of the \package{longtable} package
+% which has no skip above the caption but a skip below it.)
+% \fi
+%
+% |position=auto| is a bad idea for longtables, but we do our very best.
+% This works quite well for captions inside the longtable contents, but
+% not for captions inside the longtable (end)foot.
+% \Note{This should be `top' if unclear!}
+% \begin{macrocode}
+ \caption@setautoposition{\ifcase\LT@rows t\else b\fi}%
+% \end{macrocode}
+%
+% We set |\ifcaption@star| according the 1st argument.
+% \begin{macrocode}
+ \caption@startrue#1\caption@starfalse
+% \end{macrocode}
+%
+% \changes{v3.1}{2007/05/05}{\cs{caption@normalsize} added}
+% \begin{macrocode}
+ \caption@resetContinuedFloat\LTcaptype
+ \caption@begin\LTcaptype
+ \caption@normalsize
+% \end{macrocode}
+%
+% The following skip has the purpose to correct the height of the
+% |\parbox[t]|. Usually it's the height of the very first line, but
+% because of our extra skips (|\abovecaptionskip| and |\belowcaptionskip|)
+% it's always |0pt|.\par
+% (A different idea would be typesetting the first skip outside the longtable
+% column with |\noalign{\vskip|\ldots|}|, but this means we have to move
+% |\caption@begin| to some other place because it does not work in tabular
+% mode. And at the moment I have no idea on how to do this in an elegant
+% way\ldots)
+% \begin{macrocode}
+ \vskip-\ht\strutbox
+% \end{macrocode}
+%
+% The following code should look familiar. We do our skips and use
+% |\caption@@make| to typeset the caption itself.
+% \begin{macrocode}
+ \caption@iftop{\vskip\belowcaptionskip}{\vskip\abovecaptionskip}%
+ \caption@@make{#2}{#3}\endgraf
+ \caption@iftop{\vskip\abovecaptionskip}{\vskip\belowcaptionskip}%
+ \caption@end}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The picinpar package}
+% \changes{v3.1}{2007/06/13}{Support of the \package{picinpar} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{picinpar}{%
+% \end{macrocode}
+%
+% \begin{macro}{\figwindow}
+% \begin{macro}{\tabwindow}
+% The \package{picinpar} package comes with its own caption code
+% (|\wincaption|, |\@wincaption|, |\@makewincaption|, \ldots)
+% so we redefine |\figwindow| \& |\tabwindow| to use |\caption| instead.
+% \begin{macrocode}
+ \long\def\figwindow[#1,#2,#3,#4] {%
+ \caption@window{figure}%
+ \caption@setoptions{figwindow}%
+ \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }%
+% \end{macrocode}
+% \begin{macrocode}
+ \long\def\tabwindow[#1,#2,#3,#4] {%
+ \caption@window{table}%
+ \caption@setoptions{tabwindow}%
+ \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@window}
+% \changes{v3.1c}{2007/10/06}{Bugfix: \cs{caption@clearmargin} added}
+% Beside calling |\caption@settype| we redefine |\caption@boxrestore|
+% (as in \package{floatflt} \& \package{picins} package support)
+% and |\@makecaption| (as in \package{float} package support) here.
+% \begin{macrocode}
+ \newcommand*\caption@window[1]{%
+ \let\@makecaption\caption@@make
+ \caption@setautoposition b%
+ \caption@settype{#1}%
+ \caption@clearmargin
+ \caption@setfullparboxrestore}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@wincaption}
+% \changes{v3.1d}{2007/10/25}{Missing \% added}
+% This one finally typesets the caption using |\caption|.
+% \begin{macrocode}
+ \newcommand\caption@wincaption[1]{%
+% \end{macrocode}
+% This will be done twice for every |figwindow| \& |tabwindow| caption --
+% on the first run |\picwd| is |0pt|, on the second run |\picwd| is |\hsize|.
+% \begin{macrocode}
+ \ifdim\picwd=\z@
+ \let\caption@makecurrent\@gobbletwo
+ \let\caption@@start\relax
+ \caption@prepareslc
+ \fi
+% \end{macrocode}
+% The argument |#1| could contain simply the caption text
+% (e.g.~|A figure caption|), but it could also contain an optional argument,
+% the \meta{lst\_entry}
+% (e.g.~|[An| |entry| |to| |the| |LOF]||{A| |figure| |caption}|).
+% Therefore we have to test if |#1| begins with~|[| or not; furthermore we
+% support a starred variant -- as in |\caption*| -- so we test for~|*|, too.
+% \begin{macrocode}
+ \edef\@tempa{\expandafter\noexpand\@car#1\@nil}%
+ \if\@tempa*%
+ \let\@tempa\@firstofone
+ \else\if\@tempa[%]
+ \let\@tempa\@firstofone
+ \else
+ \let\@tempa\@empty
+ \fi\fi
+ \expandafter\caption\@tempa{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The picins package}
+% \changes{v3.0j}{2006/01/26}{Support of the \package{picins} package added}
+%
+% \begin{macro}{\piccaptiontype}
+% |\piccaptiontype|\marg{type}\par
+% We offer this macro for changing the \meta{type} of the caption, so the user
+% doesn't have to redefine |\@captype|, as proposed in the \package{picins}
+% documentation.
+% \Note{We define this macro here so it can be used in the
+% preamble of the document, even when \thispackage\ was loaded prior to the
+% \package{picins} package.}
+% \begin{macrocode}
+\newcommand*\piccaptiontype[1]{\def\@piccaptype{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{picins}{%
+% \end{macrocode}
+%
+% Initial set |\@piccaptype| and undefine |\@captype| which was set to
+% |figure| by the \package{picins} package.
+% \begin{macrocode}
+ \caption@ifundefined\@piccaptype{%
+ \caption@iftype{%
+ \let\@piccaptype\@captype
+ }{%
+ \def\@piccaptype{figure}%
+ }%
+ }{}%
+ \let\@captype\@undefined
+% \end{macrocode}
+%
+% \begin{macro}{\piccaption}
+% The original code:
+% \begin{verbatim}
+% \def\piccaption{\@ifnextchar [{\@piccaption}{\@piccaption[]}}
+% \end{verbatim}%^^A
+% Our code uses |\caption@star| so |\piccaption*| works,
+% and |\caption@dblarg| so |\piccaption{}| works correctly.
+% \begin{macrocode}
+ \def\piccaption{\caption@star\relax{\caption@dblarg\@piccaption}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\make@piccaption}
+% \changes{v3.1}{2007/12/06}{Bugfix: \cs{caption@clearmargin} will always be used now}
+% The original code:
+% \begin{verbatim}
+% \def\make@piccaption{%
+% [...]
+% \setbox\@TEXT=\vbox{\hsize\hsiz@\caption[\sh@rtf@rm]{\capti@nt@xt}}%
+% }
+% \end{verbatim}%^^A
+% In our code we have to correct several things:
+% \begin{enumerate}
+% \item |\@captype| must be defined, since we have removed the global
+% definition.
+% \item We use |\caption@setoptions{parpic}| so
+% |\captionsetup[parpic]{|\ldots|}| is supported.
+% \item |\linewidth| must be set correctly.
+% Usually this is done by |\@parboxrestore| inside |\@caption|,
+% but since we use |\@caption@boxrestore| we have to map this to
+% |\@parboxrestore| instead.
+% \item The two arguments of |\caption| (|\sh@rtf@rm| \& |\capti@nt@xt|)
+% should be expanded on first level so |\caption[]{|\ldots|}| and
+% |\caption[|\ldots|]{}| work correctly.
+% \end{enumerate}
+% \begin{macrocode}
+ \let\caption@ORI@make@piccaption\make@piccaption
+ \def\make@piccaption{%
+ \let\caption@ORI\caption
+% \end{macrocode}
+% \begin{macrocode}
+ \long\def\caption[##1]##2{%
+ \caption@freezeHref % will be defrosted in \ivparpic
+ \caption@settype\@piccaptype
+% \ifnum\c@piccaptionpos>2\relax
+ \caption@clearmargin
+% \else
+% \captionwidth\z@ % do not use "width=" setting
+% \fi
+ \caption@setfullparboxrestore
+ \caption@setoptions{parpic}%
+ \caption@setautoposition b%
+% \end{macrocode}
+% \begin{macrocode}
+ \expandafter\expandafter\expandafter\caption@ORI
+ \expandafter\expandafter\expandafter[%
+ \expandafter\expandafter\expandafter{%
+ \expandafter##1\expandafter}\expandafter]\expandafter{##2}}%
+% \end{macrocode}
+% {\footnotesize\begin{quote}
+% \leavevmode\llap{-or-\quad}%^^A
+% |\begingroup|\\
+% | \toks0\expandafter{##1}| |\toks2\expandafter{##2}|\\
+% | \edef\x{\endgroup|\\
+% | \noexpand\caption@ORI[{\the\toks0}]{\the\toks2}}|\\
+% | \x|
+% \end{quote}
+% \begin{quote}
+% \leavevmode\llap{-or-\quad}%^^A
+% |\edef\x{%|\\
+% | \noexpand\caption@ORI[{\unexpanded\expandafter{##1}}]%|\\
+% | {\unexpanded\expandafter{##2}}}|\\
+% |\x|
+% \end{quote}}
+% \begin{macrocode}
+ \caption@ORI@make@piccaption
+ \let\caption\caption@ORI}%
+% \end{macrocode}
+% \end{macro}
+%
+
+% \begin{macro}{\ivparpic}
+% We need to set our \package{hyperref} anchor here.
+% Not bullet-proof since we have to redefine |\noindent| here!
+% \begin{macrocode}
+ \let\caption@ORI@ivparpic\ivparpic
+ \def\ivparpic(#1,#2)(#3,#4)[#5][#6]#7{%
+ \let\caption@ORI@noindent\noindent
+ \def\noindent{%
+ \caption@defrostHref
+ \let\noindent\caption@ORI@noindent
+ \noindent}%
+ \caption@ORI@ivparpic(#1,#2)(#3,#4)[#5][#6]{#7}%
+ \let\noindent\caption@ORI@noindent}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{%
+ \let\piccaptiontype\@undefined
+}
+% \end{macrocode}
+%
+% \subsubsection{The rotating package}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{rotating}[1995/08/22 v2.10]{%
+% \end{macrocode}
+%
+% \begin{macro}{\rotcaption}
+% \changes{v3.0c}{2004/07/16}{Bugfix: Check for \cs{caption@star} removed}
+% \changes{v3.0i}{2005/12/07}{Rewritten, works with \package{hyperref} now}
+% Make |\rotcaption*| work.
+% \begin{macrocode}
+ \def\rotcaption{\let\@makecaption\@makerotcaption\caption}%
+% \let\@rotcaption\@undefined
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\rotcaptionof}
+% \changes{v3.0i}{2005/12/07}{New}
+% Make |\rotcaptionof(*)| work.
+% \begin{macrocode}
+ \def\rotcaptionof{%
+ \caption@teststar\caption@of{\rotcaption*}\rotcaption}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makerotcaption}
+% \changes{v3.0i}{2005/12/06}{Rewritten, should finally work proper now}
+% \changes{v3.0m}{2007/03/04}{Uses \cs{caption@parbox} instead of \cs{caption@start/endbox} now}
+% Original (bugfixed) code:
+% \begin{verbatim}
+% \long\def\@makerotcaption#1#2{%
+% \setbox\@tempboxa\hbox{#1: #2}%
+% \ifdim \wd\@tempboxa > .8\vsize
+% \rotatebox{90}{%
+% \begin{minipage}{.8\textheight}#1: #2\end{minipage}%
+% }%\par % <== \par removed (AR)
+% \else%
+% \rotatebox{90}{\box\@tempboxa}%
+% \fi
+% \nobreak\hspace{12pt}% <== \nobreak added (AR)
+% }
+% \end{verbatim}%^^A
+% Our version emulates this behavior, but if |width=| is set,
+% the rotated caption is always typeset as |minipage|.
+% (Note that |margin=| is not supported here.)
+% \begin{macrocode}
+ \long\def\@makerotcaption#1#2{%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \ifdim\captionwidth=\z@
+ \setcaptionwidth{.8\textheight}%
+ \caption@slc{#1}{#2}{.8\vsize}{%
+ \let\caption@makerot\caption@@make
+ \caption@clearmargin
+% \long\def\caption@parbox##1##2{\hbox{\hsize=.8\textheight\relax##2}}%
+% (not needed because \rotatebox uses an \hbox anyway)
+ \let\caption@parbox\@secondoftwo}%
+ \caption@set@bool\caption@ifslc0% been there, done that
+ \fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \rotatebox{90}{\caption@makerot{#1}{#2}}%
+ \nobreak\hspace{12pt}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \newcommand\caption@makerot[2]{%
+ \begin{minipage}\captionwidth\caption@@make{#1}{#2}\end{minipage}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The sidecap package}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{sidecap}[2003/06/06 v1.6f]{%
+ \caption@setbool{needfreeze}{1}%
+% \end{macrocode}
+%
+% \begin{macro}{\SC@zfloat}
+% \changes{v3.0b}{2004/05/16}{Local definition of \cs{captionsetup} added}
+% \changes{v3.0c}{2004/07/16}{Bugfix 04-07-15: Check for \cs{caption@star} removed}
+% \changes{v3.1c}{2007/10/06}{\cs{caption} will be saved \& restored now}
+% \changes{v3.2a}{2011/08/17}{Bugfix: Uses \cs{caption@freeze} instead of \cs{caption@freeze*} now}
+% This macro will be called at the start of the environment, here is a good
+% opportunity to do some adaptations to |\caption| and |\captionsetup|.
+% \begin{macrocode}
+ \let\caption@ORI@SC@zfloat\SC@zfloat
+ \def\SC@zfloat#1#2#3[#4]{%
+% \end{macrocode}
+% First we use the original definition, but restore \cs{caption} and \cs{label}
+% so \cs{caption@freeze} and \cs{caption@warmup} will work correctly.
+% \begin{macrocode}
+ \caption@ORI@SC@zfloat{#1}{#2}{#3}[#4]%
+ \SC@RestoreCommands
+% \end{macrocode}
+% Since the sidecap package uses our |\caption| code outside the
+% environment the regular |\captionsetup| will not work.
+% So we need a special version here which saves the given argument list
+% which will be executed later on.
+% Furthermore we need to make |\caption*| work.
+% \begin{macrocode}
+ \caption@settype*{#2}%
+ \caption@freeze
+% \end{macrocode}
+% The sidecap package uses |\ifx\label\SC@label| to test if it is just inside a
+% |SC|\-|figure| or not. So we redefine |\SC@label| here so this test will still work.
+% \begin{macrocode}
+ \let\SC@label\label}%
+% \end{macrocode}
+% \begin{macrocode}
+ \providecommand*\SC@RestoreCommands{%
+ \let\caption=\SC@orig@caption \let\label=\SC@orig@label}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\endSC@FLOAT}
+% \changes{v3.0i}{2006/01/12}{\cs{@listdepth}\cs{z@} added}
+% \changes{v3.1}{2007/05/05}{Call of \cs{caption@setoptions}\arg{SCfloat} added}
+% This macro will be called at the end of the environment, here we need to
+% setup our stuff before the \package{sidecap} package actually typesets
+% its caption.
+% \begin{macrocode}
+ \let\caption@ORI@endSC@FLOAT\endSC@FLOAT
+ \def\endSC@FLOAT{%
+% \end{macrocode}
+% \Note{\cs{@captype} isn't defined here, this will be done inside
+% the original definition of \cs{endSC@FLOAT}. But \cs{SC@captype} is
+% defined and can be used here, if needed.}
+% \begin{macrocode}
+ \let\caption@ORI@settype\caption@settype
+ \def\caption@settype##1{% will be done in \@xfloat
+ \caption@ORI@settype*{##1}% do not change \@currentlabel
+ \caption@setSC@justify
+%%% \caption@setoptions{SCfloat}%
+ \caption@setoptions{SC\@captype}%
+ \caption@start}%
+% \end{macrocode}
+% Before we can typeset the caption we need to set the margin to zero
+% because any extra margin would only be disturbing here.\par
+% (We don't need to take care about the caption position because
+% the sidecap package set both |\abovecaptionskip| and |\belowcaptionskip|
+% to a skip of zero anyway.)\par
+% Furthermore |\SC@justify| will override the caption justification, if set.
+% The usage of |\SC@justify| differs from version to version of the
+% \package{sidecap} package:\par
+% \begin{tabular}{ll}
+% Version 1.4: & |\SC@justify| is not defined\\
+% Version 1.5: & |\SC@justify| is |\relax| when not set\\
+% Version 1.6: & |\SC@justify| is |\@empty| when not set\\
+% \end{tabular}
+% \begin{macrocode}
+ \def\caption@setSC@justify{%
+ \caption@clearmargin
+ \ifx\SC@justify\@empty \else
+ \let\caption@hj\SC@justify
+ \let\SC@justify\@empty
+ \fi}%
+% \end{macrocode}
+% Make the original definition of |\endSC@FLOAT| to use our caption
+% stuff instead of its own.
+% \Note{At this point the \package{sidecap} definition of \cs{caption} is valid,
+% not the regular one!}
+% \begin{macrocode}
+ \let\caption\SC@orig@caption
+ \def\SC@orig@caption[##1]##2{\caption@defrost}%
+% \end{macrocode}
+% Finally we call the original definition of |\endSC@FLOAT|.
+% \begin{macrocode}
+ \caption@setSC@justify % for compatibility mode
+ \caption@ORI@endSC@FLOAT}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The subfigure package}
+% \changes{v3.1}{2007/04/06}{subfigure package support added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{subfigure}[2002/01/23 v2.1]{%
+% \end{macrocode}
+%
+% \begin{macro}{\sf@ifpositiontop}
+% \changes{v3.1a}{2007/09/15}{Bugfix 07-09-15: Check for \cs{@captype} added}
+% If the \package{subfigure} package is loaded, we map |\sf@ifpositiontop|
+% to |\iffiguretopcap| resp. |\iftabletopcap|, so the \package{subfigure}
+% \version{2.1} options \opt{figbotcap} etc. will still work.
+% \begin{macrocode}
+ \def\sf@ifpositiontop{%
+ \ifx\@captype\@undefined
+ \expandafter\@gobbletwo
+ \else\ifx\@captype\relax
+ \expandafter\expandafter\expandafter\@gobbletwo
+ \else
+ \expandafter\expandafter\expandafter\sf@if@position@top
+ \fi\fi}
+% \end{macrocode}
+% \begin{macrocode}
+ \def\sf@if@position@top{%
+ \@ifundefined{if\@captype topcap}%
+ {\@gobbletwo}%
+ {\@nameuse{if\@captype topcap}%
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The supertabular and xtab packages}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{supertabular}[2002/07/19 v4.1e]{%
+% \end{macrocode}
+%
+% \begin{macro}{\tablecaption}
+% \changes{v3.0e}{2005/05/05}{Made \cs{topcaption*} and \cs{bottomcaption*} work}
+% \changes{v3.1h}{2008/04/01}{Bugfix: Star variant does not increment table counter anymore}
+% Make |\topcaption*| and |\bottomcaption*| work.
+% \begin{macrocode}
+ \renewcommand*\tablecaption{%
+ \caption@star
+ {\refstepcounter{table}}%
+ {\caption@dblarg{\@xtablecaption}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@xtablecaption}
+% \changes{v3.1h}{2008/04/01}{Made \cs{nameref} \& \cs{autoref} work}
+% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% Make |\nameref| and |\autoref| work.
+% \begin{macrocode}
+ \let\caption@ORI@xtablecaption\@xtablecaption
+ \long\def\@xtablecaption[#1]#2{%
+ \caption@gettitle{#2}%
+ \caption@ORI@xtablecaption[#1]{#2}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@caption}
+% \changes{v3.0a}{2004/01/23}{Bugfix: Missing \cs{par} added}
+% \changes{v3.1h}{2008/04/01}{Bugfix: \cs{@currentlabelname} will be set now}
+% The original code:
+% \begin{verbatim}
+% \long\def\ST@caption#1[#2]#3{\par%
+% \addcontentsline{\csname ext@#1\endcsname}{#1}%
+% {\protect\numberline{%
+% \csname the#1\endcsname}{\ignorespaces #2}}
+% \begingroup
+% \@parboxrestore
+% \normalsize
+% \if@topcaption \vskip -10\p@ \fi
+% \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+% \if@topcaption \vskip 10\p@ \fi
+% \endgroup}
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \long\def\ST@caption#1[#2]#3{\par%
+ \caption@settype*{#1}%
+ \caption@setoptions{supertabular}%
+% \end{macrocode}
+% The |position=| setting will be overwritten by the
+% \package{supertabular} package: If |\topcaption| was used,
+% the position will be |top| automatically, |bottom| otherwise.
+% \begin{macrocode}
+ \def\caption@fixposition{%
+ \caption@setposition{\if@topcaption t\else b\fi}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@beginex{#1}{#2}{#3}%
+ \caption@boxrestore
+ \caption@normalsize
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+ \caption@end}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \changes{v3.1h}{2008/04/01}{Support of the xtab package added}
+% \begin{macrocode}
+\caption@IfPackageLoaded{xtab}[2000/04/09 v2.3]{%
+% \end{macrocode}
+%
+% \begin{macro}{\tablecaption}
+% Make |\topcaption*| and |\bottomcaption*| work.
+% \begin{macrocode}
+ \renewcommand*\tablecaption{%
+ \caption@star
+ {\refstepcounter{table}}%
+ {\caption@dblarg{\@xtablecaption}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@xtablecaption}
+% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% Make |\nameref| and |\autoref| work.
+% \begin{macrocode}
+ \let\caption@ORI@xtablecaption\@xtablecaption
+ \long\def\@xtablecaption[#1]#2{%
+ \caption@gettitle{#2}%
+ \caption@ORI@xtablecaption[#1]{#2}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@caption}
+% The original code:
+% \begin{verbatim}
+% \long\def\ST@caption#1[#2]#3{\par%
+% \@initisotab
+% \addcontentsline{\csname ext@#1\endcsname}{#1}%
+% {\protect\numberline{%
+% \csname the#1\endcsname}{\ignorespaces #2}}%
+% \begingroup
+% \@parboxrestore
+% \normalsize
+% %% \if@topcaption \vskip -10\p@ \fi
+% \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+% %% \if@topcaption \vskip 10\p@ \fi
+% \endgroup
+% \global\advance\ST@pageleft -\PWSTcapht
+% \ST@trace\tw@{Added caption. Space left for xtabular: \the\ST@pageleft}}
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \long\def\ST@caption#1[#2]#3{\par%
+ \caption@settype*{#1}%
+ \caption@setoptions{xtabular}%
+% \end{macrocode}
+% \begin{macrocode}
+ \def\caption@fixposition{%
+ \caption@setposition{\if@topcaption t\else b\fi}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \@initisotab
+ \caption@beginex{#1}{#2}{#3}%
+ \caption@boxrestore
+ \caption@normalsize
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+ \caption@end
+ \global\advance\ST@pageleft -\PWSTcapht
+ \ST@trace\tw@{Added caption. Space left for xtabular: \the\ST@pageleft}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The threeparttable package}
+% \changes{v3.1}{2007/05/08}{Support of the \package{threeparttable} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{threeparttable}[2003/06/13 v3.0]{%
+% \end{macrocode}
+%
+% \begin{macro}{\threeparttable}
+% Unfortunately |\@captype| is not set when |\TPT@common| will be used,
+% so we have to redefine |\threeparttable| and |\measuredfigure| instead.
+% \begin{macrocode}
+ \let\caption@ORI@threeparttable\threeparttable
+ \renewcommand*\threeparttable{%
+ \caption@settype{table}%
+ \caption@setposition a% ?
+ \caption@clearmargin
+ \caption@setoptions{threeparttable}%
+ \caption@ORI@threeparttable}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\measuredfigure}
+% Same here\ldots
+% \begin{macrocode}
+ \let\caption@ORI@measuredfigure\measuredfigure
+ \renewcommand*\measuredfigure{%
+ \caption@settype{figure}%
+ \caption@setposition a% ?
+ \caption@clearmargin
+ \caption@setoptions{measuredfigure}%
+ \caption@ORI@measuredfigure}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TPT@caption}
+% The original code:
+% \begin{verbatim}
+% \def\TPT@caption#1[#2]#3{\gdef\TPT@docapt
+% {\par\global\let\TPT@docapt\@undefined \TPT@LA@caption{#1}[{#2}]%
+% {\strut\ignorespaces#3\ifhmode\unskip\@finalstrut\strutbox\fi}}%
+% \ifx\TPT@hsize\@empty \let\label\TPT@gatherlabel \abovecaptionskip\z@skip
+% \else \TPT@docapt \fi \ignorespaces}
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \def\TPT@caption#1[#2]#3{%
+ \gdef\TPT@docapt{%
+ \global\let\TPT@docapt\@undefined
+ \caption@setautoposition\caption@TPT@position
+ \TPT@LA@caption{#1}[{#2}]{#3}}%
+ \ifx\TPT@hsize\@empty
+ \let\label\TPT@gatherlabel % Bug: does not work for measuredfigures
+ \gdef\caption@TPT@position{t}%
+ \g@addto@macro\TPT@docapt\caption@TPT@eatvskip
+ \else
+ \def\caption@TPT@position{b}%
+ \TPT@docapt
+ \fi
+ \ignorespaces}%
+% \end{macrocode}
+% \begin{macrocode}
+ %\newcommand*\caption@TPT@eatvskip{\vskip-.2\baselineskip}%
+ \def\caption@TPT@eatvskip#1\vskip{#1\@tempdima=}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The wrapfig package}
+% \changes{v3.1}{2007/05/05}{Support of the \package{wrapfig} package added}
+% \changes{v3.2d}{2011/11/02}{Support of the \package{wrapfig} package rewritten}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{wrapfig}[2003/01/31 v3.6]{%
+% \end{macrocode}
+%
+% \begin{macro}{\wrapfloat}
+% \changes{v3.2d}{2011/11/02}{Redefinition of this macro added}
+% First of all we make the \package{wrapfig} package independent from the package
+% load order regarding the \package{float} package.
+% Since the usage of |\@float@set|\x|every| is missing in the code of the \package{wrapfig}
+% package (it should be in the redefinition of |\float@re|\x|style|, right after
+% |\@nameuse{fst@#1}|), we don't use it here, too,
+% especially since |\wrap|\x|float| will usually not be used when used with re-styled floats.
+% \begin{macrocode}
+ \renewcommand*\wrapfloat[1]{%
+ \def\@captype{#1}%
+ \@ifundefined{fst@#1}{}{%
+ \@nameuse{fst@#1}%
+% \@float@setevery{#1}%
+ \def\WF@floatstyhook{\let\@currbox\WF@box
+ \global\setbox\WF@box\float@makebox{\wd\WF@box}}}%
+ \@ifnextchar[\WF@wr{\WF@wr[]}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\WF@rapt}
+% \changes{v3.2d}{2011/11/02}{Usage of \cs{WF@captionstyhook} added}
+% Original code:
+% \begin{verbatim}
+% \def\WF@rapt[#1]#2{% final two args: #1 = overhang, #2 = width,
+% \gdef\WF@ovh{#1}% hold overhang for later, when \width is known
+% \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}%
+% \ifdim\hsize>\z@ \@parboxrestore \else
+% \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption
+% \ignorespaces \fi}
+% \end{verbatim}%^^A
+% Our code has |\WF@captionstyhook| in addition:
+% \begin{macrocode}
+ \def\WF@rapt[#1]#2{% final two args: #1 = overhang, #2 = width,
+ \gdef\WF@ovh{#1}% hold overhang for later, when \width is known
+ \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}%
+ \expandafter\WF@captionstyhook\expandafter{\@captype}% <= new
+ \ifdim\hsize>\z@ \@parboxrestore \else
+ \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption
+ \ignorespaces \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\WF@captionstyhook}
+% \changes{v3.2d}{2011/11/02}{This macro added}
+% \changes{v3.2e}{2011/11/10}{Bugfix 11-11-09: float package support fixed}
+% We place our \package{hyperref} anchor here, apply the `wrap' options etc.
+% Since the usage of |\@float@set|\x|every| is missing in the \package{wrapfig}
+% package we will catch it up here for making the necessary adaptions to the
+% \package{float} package.
+% \begin{macrocode}
+ \def\WF@captionstyhook#1{%
+ \let\@captype\@undefined
+ \@ifundefined{fst@#1}{}{\@float@setevery{#1}}%
+ \caption@settype{#1}%
+ \caption@clearmargin
+%%% \caption@setoptions{wrapfloat}%
+ \caption@setoptions{wrap#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \begin{thebibliography}{99}
+% \bibitem{TLC2}
+% Frank Mittelbach and Michel Goossens:\\
+% \newblock {\em The {\LaTeX} Companion (2nd.~Ed.)},\\
+% \newblock Addison-Wesley, 2004.
+%
+% \bibitem{beamer}
+% Till Tantau:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/beamer/}%
+% {\emph{User Guide to the Beamer Class, Version 3.07}},\\
+% March 11, 2007
+%
+% \bibitem{KOMAScript}
+% Markus Kohm \& Jens-Uwe-Morawski:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/koma-script/}%
+% {\emph{KOMA-Script -- a versatile \LaTeXe\ bundle}},\\
+% 2007-01-09
+%
+% \bibitem{NTG}
+% Victor Eijkhout:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/ntgclass/}%
+% {\emph{An introduction to the Dutch \LaTeX\ document classes}},\\
+% 3 September 1989
+%
+% \bibitem{float}
+% Anselm Lingnau:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/float/}%
+% {\emph{An Improved Environment for Floats}},\\
+% 2001/11/08
+%
+% \bibitem{floatflt}
+% Mats Dahlgren:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/floatflt/}%
+% {\emph{Welcome to the floatflt package}},\\
+% 1998/06/05
+%
+% \bibitem{floatrow}
+% Olga Lapko:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/floatrow/}%
+% {\emph{The floatrow package documentation}},\\
+% 2007/08/24
+%
+% \bibitem{fltpage}
+% Sebastian Gross:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/fltpage/}%
+% {\emph{Welcome to the beta test of fltpage package!}},\\
+% 1998/11/13
+%
+% \bibitem{hyperref}
+% Sebastian Rahtz \& Heiko Oberdiek:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/hyperref/}%
+% {\emph{Hypertext marks in \LaTeX}},\\
+% November 12, 2007
+%
+% \bibitem{hypcap}
+% Heiko Oberdiek:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/oberdiek/}%
+% {\emph{The hypcap package -- Adjusting anchors of captions}},\\
+% 2007/04/09
+%
+% \bibitem{listings}
+% Carsten Heinz \& Brooks Moses:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/listings/}%
+% {\emph{The Listings Package}},\\
+% 2007/02/22
+%
+% \bibitem{longtable}
+% David Carlisle:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/required/tools/}%
+% {\emph{The longtable package}},\\
+% 2004/02/01
+%
+% \bibitem{picinpar}
+% Friedhelm Sowa:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex209/contrib/picinpar/}%
+% {\emph{Pictures in Paragraphs}},\\
+% July 13, 1993
+%
+% \bibitem{picins}
+% Joachim Bleser and Edmund Lang:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex209/contrib/picins/}%
+% {\emph{PicIns-Benutzerhandbuch Version 3.0}},\\
+% September~1992
+%
+% \bibitem{rotating}
+% Sebastian Rahtz and Leonor Barroca:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/rotating/}%
+% {\emph{A style option for rotated objects in \LaTeX}},\\
+% 1997/09/26
+%
+% \bibitem{sidecap}
+% Rolf Niepraschk \& Hubert G\"a\ss lein:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/sidecap/}%
+% {\emph{The sidecap package}},\\
+% 2003/06/06
+%
+% \bibitem{subfigure}
+% Steven D. Cochran:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/subfigure/}%
+% {\emph{The subfigure package}},\\
+% 2002/07/02
+%
+% \bibitem{subfig}
+% Steven D. Cochran:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/subfig/}%
+% {\emph{The subfig package}},\\
+% 2005/07/05
+%
+% \bibitem{supertabular}
+% Johannes Braams and Theo Jurriens:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/supertabular/}%
+% {\emph{The supertabular environment}},\\
+% 2002/07/19
+%
+% \bibitem{threeparttable}
+% Donald Arseneau:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/misc/}%
+% {\emph{Three part tables: title, tabular environment, notes}},\\
+% 2003/06/13
+%
+% \bibitem{wrapfig}
+% Donald Arseneau:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/wrapfig/}%
+% {\emph{WRAPFIG.STY ver 3.6}},\\
+% 2003/01/31
+%
+% \bibitem{xtab}
+% Peter Wilson:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/xtab/}%
+% {\emph{The xtab package}},\\
+% 2004/05/24
+% \end{thebibliography}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/caption/fallback/v3.2/caption3.dtx b/Master/texmf-dist/source/latex/caption/fallback/v3.2/caption3.dtx
new file mode 100644
index 00000000000..f61d0be0047
--- /dev/null
+++ b/Master/texmf-dist/source/latex/caption/fallback/v3.2/caption3.dtx
@@ -0,0 +1,3668 @@
+% \iffalse meta-comment
+%
+% This is file `caption3.dtx'.
+%
+% Copyright (C) 1994-2011 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%
+% --------------------------------------------------------------------------
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Axel Sommerfeldt.
+%
+% This work consists of the files caption.ins, caption.dtx, caption2.dtx,
+% caption3.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx, and newfloat.dtx,
+% the derived files caption.sty, caption2.sty, caption3.sty,
+% bicaption.sty, ltcaption.sty, subcaption.sty, and newfloat.sty,
+% and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex.
+%
+% \fi
+% \CheckSum{3390}
+%
+% \iffalse
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption3.drv}[2011/10/09 v1.4 Implementation of the caption kernel]
+\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
+%\errorcontextlines=3
+%
+\documentclass{ltxdoc}
+\setlength\parindent{0pt}
+\setlength\parskip{\smallskipamount}
+%
+%\let\ORIsubsection\subsection
+%\def\subsection{\clearpage\ORIsubsection}
+%
+\makeatletter % make room for subsections like 2.16.14 in the TOC
+%\newcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
+\renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.7em}}
+\makeatother
+%
+\usepackage{ifpdf}
+\ifpdf
+ \usepackage{mathptmx,courier}
+ \usepackage[scaled=0.90]{helvet}
+ \addtolength\marginparwidth{15pt}
+\fi
+%
+\usepackage{hypdoc}
+\ifpdf\usepackage{hypdestopt}\fi
+\hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}}
+%
+\usepackage[debug]{caption3}[2011/07/01]
+%
+\DeclareRobustCommand*\eTeX{\texorpdfstring
+ {\leavevmode\hbox{$\varepsilon$}-\TeX}%
+ {e-TeX}}
+\DeclareRobustCommand*\AmS{\texorpdfstring
+ {{\protect\usefont{OMS}{cmsy}{m}{n}A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}%
+ {AMS}}
+\DeclareRobustCommand*\KOMAScript{\texorpdfstring
+ {\textsf{K\kern.05em O\kern.05em M\kern.05em A\kern.1em-\kern.1em Script}}%
+ {KOMA-Script}}
+\DeclareRobustCommand*\NTG{NTG}
+\DeclareRobustCommand*\SmF{SMF}
+%
+\begin{document}
+ \DocInput{caption3.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \newcommand*\purerm[1]{{\upshape\mdseries\rmfamily #1}}
+% \newcommand*\puresf[1]{{\upshape\mdseries\sffamily #1}}
+% \newcommand*\purett[1]{{\upshape\mdseries\ttfamily #1}}
+% \let\class\puresf \let\package\puresf
+% \let\env\purett \let\opt\purett
+%
+% \def\thispackage{the \package{caption} kernel}
+% \def\Thispackage{The \package{caption} kernel}
+%
+% \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
+% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
+% \newcommand*\version[2][]{\textit{v#2}}
+% \newcommand*\x{\discretionary{-}{}{}}
+% \newcommand*\xx{\discretionary{}{}{}}
+%
+% \GetFileInfo{caption3.drv}
+% \let\docdate\filedate
+% \GetFileInfo{caption3.sty}
+%
+% \title{The Implementation of
+% \texorpdfstring{\thispackage\thanks{%^^A
+% This package has version number \fileversion, last revised \filedate.}}%^^A
+% {the caption kernel}}
+% \author{Axel Sommerfeldt\\
+% \href{mailto:axel.sommerfeldt@f-m.fm}{\texttt{axel.sommerfeldt@f-m.fm}}}
+% \date{\docdate}
+% \maketitle
+%
+% \begin{abstract}
+% \Thispackage\ consists of two parts -- the kernel
+% (|caption3.sty|) and the main package (|caption.sty|).
+%
+% The kernel provides all the user commands and internal macros which are
+% necessary for typesetting captions and setting parameters regarding these.
+% While the standard \LaTeX\ document classes provide an internal command
+% called |\@makecaption| and no options to control its behavior (except the
+% vertical skips above and below the caption itself), we provide similar
+% commands called |\caption@make| and |\caption@@make|, but with a lot of
+% options which can be selected with |\captionsetup|.
+% Loading the kernel part do not change the output of a \LaTeX\ document
+% -- it just provides functionality which can be used by \LaTeXe\ packages
+% which typesets captions, for example the \package{caption} and
+% \package{subfig} packages.
+% \end{abstract}
+%
+% \StopEventually{}
+% \clearpage
+% \tableofcontents
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \DoNotIndex{\\,\_,\ ,\@@par}
+% \DoNotIndex{\@bsphack}
+% \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
+% \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
+% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
+% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
+% \DoNotIndex{\if@minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@minipagefalse,\@minipagetrue}
+% \DoNotIndex{\@namedef,\@nameuse}
+% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
+% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setminipage,\@setpar}
+% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
+% \DoNotIndex{\@testopt}
+% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
+% \DoNotIndex{\p@,\z@}
+% \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
+% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
+% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
+% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
+% \DoNotIndex{\fi,\footnotesize,\global}
+% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
+% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
+% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
+% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
+% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
+% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
+% \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
+% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
+% \DoNotIndex{\providecommand,\quad}
+% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
+% \DoNotIndex{\rightskip,\rmfamily}
+% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
+% \DoNotIndex{\small,\string,\space,\strut}
+% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
+% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
+% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
+% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
+% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
+% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
+% \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \setlength{\parskip}{0pt plus 1pt}
+% \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
+%
+% \changes{v1.0}{2003/12/20}{Rewritten; many new commands and features}
+% \changes{v1.0c}{2004/11/28}{Split into two packages:
+% \package{caption} \& \package{caption3}}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \let\subsubsection\subsection
+% \let\subsection\section
+%
+% \iffalse
+%<*package>
+% \fi
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesPackage{caption3}[2011/11/01 v1.4a caption3 kernel (AR)]
+% \end{macrocode}
+%
+% \subsection{Generic helpers}
+%
+% \begin{macro}{\@nameundef}
+% This is the opposite to |\@namedef| which is offered by the \LaTeX\ kernel.
+% We use it to remove the definition of some commands and keyval options after
+% |\begin{document}| (to save \TeX\ memory) and to remove caption options defined
+% with |\captionsetup|\oarg{type}.
+% \begin{macrocode}
+\providecommand*\@nameundef[1]{%
+ \expandafter\let\csname #1\endcsname\@undefined}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@addto@macro}
+% The \LaTeXe\ kernel offers the internal helper macro |\g@addto@macro| which
+% globally adds tokens to existing macros, like in |\AtBeginDocument|.
+% This is the same but it works local, not global
+% (using \cs{edef} instead of \cs{xdef}).
+% \begin{macrocode}
+\providecommand\l@addto@macro[2]{%
+ \begingroup
+ \toks@\expandafter{#1#2}%
+ \edef\@tempa{\endgroup\def\noexpand#1{\the\toks@}}%
+ \@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bothIfFirst}
+% \begin{macro}{\bothIfSecond}
+% |\bothIfFirst| tests if the first argument is not empty, |\bothIfSecond|
+% tests if the second argument is not empty. If yes both arguments get
+% typeset, otherwise none of them.
+% \begin{macrocode}
+\def\bothIfFirst#1#2{%
+ \protected@edef\caption@tempa{#1}%
+ \ifx\caption@tempa\@empty \else
+ #1#2%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\def\bothIfSecond#1#2{%
+ \protected@edef\caption@tempa{#2}%
+ \ifx\caption@tempa\@empty \else
+ #1#2%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifundefined}
+% \changes{v1.3a}{2011/08/12}{This macro added}
+% \changes{v1.3b}{2011/08/18}{Made expandable}
+% Similar to \cs{@ifundefined} offered by the \LaTeX kernel, but does
+% not define the undefined macro as \cs{relax}.
+% \begin{macrocode}
+\newcommand*\caption@ifundefined[1]{%
+ \ifx#1\@undefined
+ \expandafter\@firstoftwo
+ \else\ifx#1\relax
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \fi\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifinlist}
+% \changes{v1.1}{2007/07/29}{Rewritten}
+% This helper macro checks if the first argument is in the comma separated
+% list which is offered as second argument. So for example
+% \begin{quote}
+% |\caption@ifinlist{frank}{axel,frank,olga,steven}{yes}{no}|
+% \end{quote}
+% would expand to |yes|.
+% \begin{macrocode}
+\newcommand*\caption@ifinlist{%
+ \@expandtwoargs\caption@@ifinlist}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@ifinlist[2]{%
+ \begingroup
+ \def\@tempa##1,#1,##2\@nil{%
+ \endgroup
+ \ifx\relax##2\relax
+ \expandafter\@secondoftwo
+ \else
+ \expandafter\@firstoftwo
+ \fi}%
+ \@tempa,#2,#1,\@nil}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifin@list}
+% \changes{v1.1}{2007/08/12}{This macro added}
+% |\caption@ifin@list|\marg{cmd}\marg{list entry}\marg{yes}\marg{no}
+% \begin{macrocode}
+\newcommand*\caption@ifin@list[2]{%
+ \caption@ifempty@list#1%
+ {\@secondoftwo}%
+ {\@expandtwoargs\caption@@ifinlist{#2}{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@g@addto@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@g@addto@list|\marg{cmd}\marg{list entry}
+% \begin{macrocode}
+\newcommand*\caption@g@addto@list[2]{%
+ \caption@ifempty@list#1{\gdef#1{#2}}{\g@addto@macro#1{,#2}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@l@addto@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@l@addto@list|\marg{cmd}\marg{list entry}
+% \begin{macrocode}
+\newcommand*\caption@l@addto@list[2]{%
+ \caption@ifempty@list#1{\def#1{#2}}{\l@addto@macro#1{,#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@g@removefrom@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@g@removefrom@list|\marg{cmd}\marg{list entry}
+% \begin{macrocode}
+\newcommand*\caption@g@removefrom@list[2]{%
+ \caption@l@removefrom@list#1{#2}%
+ \global\let#1#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@l@removefrom@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@l@removefrom@list|\marg{cmd}\marg{list entry}\par
+% \Note[Caveat]{\meta{cmd} will be expanded during this process since
+% \cs{@removeelement} is using \cs{edef} to build the new list!}
+% \begin{macrocode}
+\newcommand*\caption@l@removefrom@list[2]{%
+ \caption@ifempty@list#1{}{\@expandtwoargs\@removeelement{#2}#1#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@for@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@for@list|\marg{cmd}\marg{code with \#1}
+% \begin{macrocode}
+\newcommand*\caption@for@list[2]{%
+ \caption@ifempty@list#1{}{%
+ \def\caption@tempb##1{#2}%
+ \@for\caption@tempa:=#1\do{%
+ \expandafter\caption@tempb\expandafter{\caption@tempa}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifempty@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@ifempty@list|\marg{cmd}\marg{true}\marg{false}
+% \begin{macrocode}
+\newcommand*\caption@ifempty@list[1]{%
+ \ifx#1\@undefined
+ \expandafter\@firstoftwo
+ \else\ifx#1\relax
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else\ifx#1\@empty
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \fi\fi\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \pagebreak[3]
+% \begin{macro}{\caption@setbool}
+% \begin{macro}{\caption@set@bool}
+% \changes{v1.1}{2007/04/05}{\cs{caption@set@bool}\marg{cmd}\marg{value} added}
+% \begin{macro}{\caption@ifbool}
+% \begin{macro}{\caption@undefbool}
+% For setting and testing boolean options we offer these three helper macros:
+% \begin{quote}
+% |\caption@setbool|\marg{name}\marg{value}\\
+% | |(with |value = false/true/no/yes/off/on/0/1|)\\
+% |\caption@ifbool|\marg{name}\marg{if-clause}\marg{else-clause}\\
+% |\caption@undefbool|\marg{name}
+% \end{quote}
+% \begin{macrocode}
+\newcommand*\caption@setbool[1]{%
+ \expandafter\caption@set@bool\csname caption@if#1\endcsname}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@set@bool[2]{%
+ \caption@ifinlist{#2}{1,true,yes,on}{%
+ \let#1\@firstoftwo
+ }{\caption@ifinlist{#2}{0,false,no,off}{%
+ \let#1\@secondoftwo
+ }{%
+ \caption@Error{Undefined boolean value `#2'}%
+ }}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@ifbool[1]{\@nameuse{caption@if#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@undefbool[1]{\@nameundef{caption@if#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@teststar}
+% \changes{v1.1}{2007/05/08}{This macro and its usage added}
+% \changes{v1.1e}{2007/10/28}{\cs{caption@teststar@} added}
+% |\caption@teststar|\marg{cmd}\marg{star arg}\marg{non-star arg}\\
+% |\caption@teststar@|\marg{cmd}\marg{star arg}\marg{non-star arg}
+% \begin{macrocode}
+\newcommand*\caption@teststar[3]{\@ifstar{#1{#2}}{#1{#3}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@teststar@[3]{%
+ \@ifstar{#1{#2}}{\caption@ifatletter{#1{#2}}{#1{#3}}}}
+\AtBeginDocument{\let\caption@teststar@\caption@teststar}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@ifatletter{%
+ \ifnum\the\catcode`\@=11
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+\AtBeginDocument{\let\caption@ifatletter\@secondoftwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@withoptargs}
+% \changes{v1.1}{2007/08/12}{This macro added}
+% |\caption@withoptargs|\marg{cmd}
+% \begin{macrocode}
+\newcommand*\caption@withoptargs[1]{%
+ \@ifstar
+ {\def\caption@tempa{*}\caption@@withoptargs#1}%
+ {\def\caption@tempa{}\caption@@withoptargs#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@withoptargs#1{%
+ \@ifnextchar[%]
+ {\caption@@@withoptargs#1}%
+ {\caption@@@@withoptargs#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@@withoptargs#1[#2]{%
+ \l@addto@macro\caption@tempa{[{#2}]}%
+ \caption@@withoptargs#1}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@@@withoptargs#1{%
+ \expandafter#1\expandafter{\caption@tempa}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@gobble}
+% \changes{v1.4}{2011/08/19}{This macro added}
+% |\caption@gobble*|\oarg{arg}\oarg{\ldots}\marg{arg}\par
+% Same as |\@gobble|, but gobbles optional arguments as well.
+% \begin{macrocode}
+\DeclareRobustCommand*\caption@gobble{%
+ \caption@withoptargs\@gobbletwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@CheckCommand}
+% \changes{v1.1}{2007/04/10}{This macro added}
+% \begin{macro}{\caption@IfCheckCommand}
+% \changes{v1.1}{2007/04/10}{This macro added}
+% \changes{v1.2b}{2008/08/02}{Revised so \cs{next} is no longer used}
+% |\caption@CheckCommand|\marg{macro}\marg{definition of macro}\par
+% checks if a command already exists, with the same definition.
+% It can be used more-than-once to check if one of multiple definitions will
+% finally match.
+% (It redefines itself later on to |\@gobbletwo| if the two commands match
+% fine, making further checks harmless.)\par
+% |\caption@IfCheckCommand|\marg{true}\marg{false}\par
+% will execute the \meta{true} code if one match was finally given,
+% the \meta{false} code otherwise.
+% (It simply checks if |\caption@CheckCommand| is |\@gobbletwo| and
+% restores the starting definition of |\caption@CheckCommand|.)
+% \begin{macrocode}
+\newcommand\caption@DoCheckCommand[2]{%
+ \begingroup
+ \let\@tempa#1%
+ #2%
+ \ifx\@tempa#1%
+ \endgroup
+ \let\caption@CheckCommand\@gobbletwo
+ \else
+ \endgroup
+ \fi}
+\@onlypreamble\caption@DoCheckCommand
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@CheckCommand\caption@DoCheckCommand
+\@onlypreamble\caption@CheckCommand
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@IfCheckCommand{%
+ \ifx\caption@CheckCommand\@gobbletwo
+ \let\caption@CheckCommand\caption@DoCheckCommand
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+\@onlypreamble\caption@IfCheckCommand
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@AtBeginDocument}
+% \changes{v1.1}{2007/04/13}{This macro and its usage added}
+% \changes{v1.2e}{2010/01/09}{Adapted to the combine document class}
+% |\caption@AtBeginDocument*|\marg{code}\\
+% Same as |\AtBeginDocument| but the execution of code
+% will be surrounded by two |\PackageInfo|s.
+% The starred variant causes the code to be executed after all code
+% specified using the non-starred variant.
+% \begin{macrocode}
+\let\caption@begindocumenthook\@empty
+\let\caption@@begindocumenthook\@empty
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@AtBeginDocument{%
+ \caption@teststar\g@addto@macro
+ \caption@@begindocumenthook\caption@begindocumenthook}
+%\@onlypreamble\caption@AtBeginDocument
+% \end{macrocode}
+% \begin{macrocode}
+\AtBeginDocument{%
+ \caption@InfoNoLine{Begin \noexpand\AtBeginDocument code}%
+% \end{macrocode}
+% \begin{macrocode}
+ \def\caption@AtBeginDocument{%
+ \@ifstar{\g@addto@macro\caption@@begindocumenthook}\@firstofone}%
+ \caption@begindocumenthook
+ \let\caption@begindocumenthook\relax
+% \end{macrocode}
+% \begin{macrocode}
+ \def\caption@AtBeginDocument{%
+ \@ifstar\@firstofone\@firstofone}%
+ \caption@@begindocumenthook
+ \let\caption@@begindocumenthook\relax
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@InfoNoLine{End \noexpand\AtBeginDocument code}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Information, Warnings, and Errors}
+%
+% \begin{macro}{\caption@Info}
+% \changes{v1.3}{2010/10/25}{Moved from package to kernel}
+% |\caption@Info|\marg{message}
+% \begin{macrocode}
+\newcommand*\caption@Info[1]{%
+ \PackageInfo{caption}{#1}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@InfoNoLine}
+% \changes{v1.3}{2010/10/25}{Moved from package to kernel}
+% |\caption@InfoNoLine|\marg{message}\\
+% \Note{The \cs{@gobble} at the end of the 2nd argument of
+% \cs{PackageInfo} suppresses the line number info.
+% See TLC2\cite{TLC2}, A.4.7, p885 for details.}
+% \begin{macrocode}
+\newcommand*\caption@InfoNoLine[1]{%
+ \PackageInfo{caption}{#1\@gobble}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@Warning}
+% \changes{v1.1c}{2007/10/14}{This macro added, will now be used for warnings}
+% |\caption@Warning|\marg{message}
+% \begin{macrocode}
+\newcommand*\caption@Warning[1]{%
+ \caption@WarningNoLine{#1\on@line}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@WarningNoLine}
+% \changes{v1.1c}{2007/10/14}{This macro added, will now be used for warnings}
+% |\caption@WarningNoLine|\marg{message}
+% \begin{macrocode}
+\newcommand*\caption@WarningNoLine[1]{%
+ \PackageWarning{caption}{#1.^^J\caption@wh\@gobbletwo}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@wh{%
+ See the caption package documentation for explanation.}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@Error}
+% \changes{v1.0j}{2007/01/20}{This macro added, will now be used for errors}
+% \changes{v1.0o}{2007/04/11}{Renamed from \cs{caption@error} to \cs{caption@Error}}
+% \changes{v1.1b}{2007/09/18}{Usage of \cs{caption@Package} removed}
+% |\caption@Error|\marg{message}
+% \begin{macrocode}
+\newcommand*\caption@Error[1]{%
+ \PackageError{caption}{#1}\caption@eh}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@eh{%
+ If you do not understand this error, please take a closer look\MessageBreak
+ at the documentation of the `caption' package, especially the\MessageBreak
+ section about errors.\MessageBreak\@ehc}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@KV@err}
+% \changes{v1.1b}{2007/09/18}{This macro added}
+% \begin{macrocode}
+\let\caption@KV@err\caption@Error
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Using the keyval package}
+%
+% We need the \package{keyval} package for option handling, so we load it here.
+% \begin{macrocode}
+\RequirePackage{keyval}[1997/11/10]
+% \end{macrocode}
+%
+% \begin{macro}{\undefine@key}
+% |\undefine@key|\marg{family}\marg{key}\par
+% This helper macro is the opposite of |\define@key|, it removes a keyval
+% definition.
+% \begin{macrocode}
+\providecommand*\undefine@key[2]{%
+ \@nameundef{KV@#1@#2}\@nameundef{KV@#1@#2@default}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@onlypreamble@key}
+% \changes{v1.1}{2007/07/22}{This macro added}
+% \changes{v1.1e}{2007/11/01}{\cs{KV@err} will be used now instead of \cs{@notprerr}}
+% |\onlypreamble@key|\marg{family}\marg{key}\par
+% Analogous to |\@onlypreamble| from \LaTeXe.
+% \begin{macrocode}
+\providecommand*\@preamble@keys{}
+\providecommand*\@onlypreamble@key[2]{\@cons\@preamble@keys{{#1}{#2}}}
+\@onlypreamble\@onlypreamble@key
+\@onlypreamble\@preamble@keys
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\@notprerr@key[1]{\KV@err{Can be used only in preamble}}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@AtBeginDocument*{%
+ \def\@elt#1#2{\expandafter\let\csname KV@#1@#2\endcsname\@notprerr@key}%
+ \@preamble@keys
+ \let\@elt\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionOption}
+% |\DeclareCaptionOption|\marg{option}\oarg{default value}\marg{code}\\
+% |\DeclareCaptionOption*|\marg{option}\oarg{default value}\marg{code}\par
+% We declare our options using these commands (instead of using
+% |\DeclareOption| offered by \LaTeXe), so the keyval package is used.
+% The starred form makes the option available during the lifetime of the
+% current package only, so they can be used with |\usepackage|, but
+% \emph{not} with |\captionsetup| later on.
+% \begin{macrocode}
+\newcommand*\DeclareCaptionOption{%
+ \caption@teststar\caption@declareoption\AtEndOfPackage\@gobble}
+\@onlypreamble\DeclareCaptionOption
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declareoption[2]{%
+ #1{\undefine@key{caption}{#2}}\define@key{caption}{#2}}
+\@onlypreamble\caption@declareoption
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionOptionNoValue}
+% \changes{v1.1c}{2007/10/06}{This macro added}
+% |\DeclareCaptionOptionNoValue|\marg{option}\marg{code}\\
+% |\DeclareCaptionOptionNoValue*|\marg{option}\marg{code}\par
+% Same as \cs{DeclareCaptionOption} but issues an error if a value is given.
+% \begin{macrocode}
+\newcommand*\DeclareCaptionOptionNoValue{%
+ \caption@teststar\caption@declareoption@novalue\AtEndOfPackage\@gobble}
+\@onlypreamble\DeclareCaptionOptionNoValue
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@declareoption@novalue[3]{%
+ \caption@declareoption{#1}{#2}[\KV@err]{%
+ \caption@option@novalue{#2}{##1}{#3}}}
+\@onlypreamble\caption@declareoption@novalue
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@option@novalue[2]{%
+ \ifx\KV@err#2%
+ \expandafter\@firstofone
+ \else
+ \KV@err{No value allowed for #1}%
+ \expandafter\@gobble
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifcaptionsetup@star}
+% \changes{v1.2a}{2008/01/12}{This macro added}
+% If the starred form of |\captionsetup| is used, this will be set to |true|.
+% (It will be reset to |false| at the end of |\caption@setkeys|.)
+% \begin{macrocode}
+\newif\ifcaptionsetup@star
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionsetup}
+% \changes{v1.0a}{2004/01/17}{Bugfix: Missing \% added}
+% \changes{v1.1}{2007/07/22}{Starred-variant added}
+% \changes{v1.1e}{2007/07/27}{Inside packages the starred variant will be used automatically}
+% \changes{v1.2}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% \changes{v1.2a}{2008/01/12}{\cs{ifcaptionsetup@star} will be set now}
+% |\captionsetup|\oarg{type}\marg{keyval-list of options}\\
+% |\captionsetup*|\oarg{type}\marg{keyval-list of options}\par
+% If the optional argument `type' is specified, we simply save or append
+% the option list, otherwise we `execute' it with |\setkeys|.
+% (The non-starred variant issues a warning if \meta{keyval-list of options}
+% is not used later on.)
+% \Note{The starred variant will be used inside packages automatically.}
+% \begin{macrocode}
+\newcommand*\captionsetup{%
+ \caption@teststar@\@captionsetup\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\@captionsetup[1]{%
+ \captionsetup@startrue#1\captionsetup@starfalse
+ \@ifnextchar[\caption@setup@options\caption@setup}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setup{\caption@setkeys{caption}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@setup@options[#1]#2{%
+ \@bsphack
+ \ifcaptionsetup@star\captionsetup@starfalse\else\caption@addtooptlist{#1}\fi
+ \expandafter\caption@l@addto@list\csname caption@opt@#1\endcsname{#2}%
+ \@esphack}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clearcaptionsetup}
+% \changes{v1.1}{2007/07/29}{Optional argument added}
+% \changes{v1.1}{2007/08/17}{Starred variant added}
+% \changes{v1.1e}{2007/07/27}{Inside packages the starred variant will be used automatically}
+% \changes{v1.2}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% |\clearcaptionsetup|\oarg{option}\marg{type}\\
+% |\clearcaptionsetup*|\oarg{option}\marg{type}\par
+% This removes the saved option list associated with \meta{type}.
+% If \meta{option} is given, only this option will be removed from the list.
+% (The starred variant does not issue warnings.)
+% \Note{The starred variant will be used inside packages automatically.}
+% \begin{macrocode}
+\newcommand*\clearcaptionsetup{%
+ \caption@teststar@\@clearcaptionsetup\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\@clearcaptionsetup[1]{%
+ \let\caption@tempa#1%
+ \@testopt\@@clearcaptionsetup{}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\@@clearcaptionsetup[#1]#2{%
+ \@bsphack
+ \expandafter\caption@ifempty@list\csname caption@opt@#2\endcsname
+ {\caption@tempa{\caption@Warning{Option list `#2' undefined}}}%
+ {\ifx,#1,%
+ \caption@clearsetup{#2}%
+ \else
+ \caption@@removefromsetup{#1}{#2}%
+ \fi}%
+ \@esphack}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@clearsetup[1]{%
+ \caption@removefromoptlist{#1}%
+ \@nameundef{caption@opt@#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@removefromsetup{%
+ \let\caption@tempa\@gobble
+ \caption@@removefromsetup}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@removefromsetup[2]{%
+ \expandafter\let\expandafter\@tempa\csname caption@opt@#2\endcsname
+ \expandafter\let\csname caption@opt@#2\endcsname\@undefined
+ \def\@tempb##1=##2\@nil{##1}%
+ \edef\@tempc{#1}%
+ \@for\@tempa:=\@tempa\do{%
+ \edef\@tempd{\expandafter\@tempb\@tempa=\@nil}%
+ \ifx\@tempd\@tempc
+ \let\caption@tempa\@gobble
+ \else
+ \expandafter\expandafter\expandafter\caption@l@addto@list
+ \expandafter\csname caption@opt@#2\expandafter\endcsname
+ \expandafter{\@tempa}%
+ \fi}%
+ \expandafter\caption@ifempty@list\csname caption@opt@#2\endcsname
+ {\caption@removefromoptlist{#2}}{}%
+ \caption@tempa{\caption@Warning{%
+ Option `#1' was not in list `#2'\MessageBreak}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\showcaptionsetup}
+% \changes{v1.0d}{2005/05/03}{Optimized for memory usage}
+% \changes{v1.1}{2007/07/29}{Bugfix: Does not expand option list anymore}
+% \changes{v1.2}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% |\showcaptionsetup|\oarg{package}\marg{type}\par
+% This comes for debugging issues: It shows the saved option list which
+% is associated with \meta{type}.
+% \begin{macrocode}
+\newcommand*\showcaptionsetup[2][\@firstofone]{%
+ \@bsphack
+ \GenericWarning{}{%
+ #1 Caption Info: Option list on `#2'\MessageBreak
+ #1 Caption Data: \@ifundefined{caption@opt@#2}{%
+ -none-%
+ }{%
+ {\expandafter\expandafter\expandafter\strip@prefix
+ \expandafter\meaning\csname caption@opt@#2\endcsname}%
+ }}%
+ \@esphack}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.1}{2007/07/02}{Option \opt{options=} added}
+% \changes{v1.3}{2010/09/05}{Option \opt{options*=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{options}{\caption@setoptions{#1}}
+\DeclareCaptionOption{options*}{\caption@setoptions*{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setoptions}
+% \changes{v1.0g}{2006/01/03}{Optional argument added}
+% \changes{v1.0h}{2006/01/26}{Revised}
+% \changes{v1.0j}{2007/01/30}{Optional argument removed}
+% \changes{v1.1}{2007/04/11}{Usage of \cs{clearcaptionsetup} added}
+% \changes{v1.1}{2007/05/09}{Renamed from \cs{caption@settype} to \cs{caption@setoptions}}
+% \changes{v1.2}{2007/12/03}{Definition of \cs{caption@iftypewarning} removed}
+% \changes{v1.3}{2010/09/05}{Starred variant added}
+% |\caption@setoptions*|\marg{type or environment or\ldots}\par
+% Caption options which have been saved with |\captionsetup|\oarg{type} can
+% be executed by using this command.
+% It simply executes the saved option list (and clears it afterwards),
+% if there is any. (The starred variant do not clear the option list.)
+% \begin{macrocode}
+\newcommand*\caption@setoptions{%
+ \caption@teststar\caption@set@options\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@set@options[2]{%
+ \caption@Debug{options=#2}%
+ \expandafter\let\expandafter\caption@opt\csname caption@opt@#2\endcsname
+ \ifx\caption@opt\relax \else
+ \caption@xsetup\caption@opt
+ #1{\caption@clearsetup{#2}}% #1 = \@firstofone -or- \@gobble
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@xsetup[1]{\expandafter\caption@setup\expandafter{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@addtooptlist}
+% \changes{v1.1}{2007/07/22}{This macro added}
+% \begin{macro}{\caption@removefromoptlist}
+% \changes{v1.1}{2007/07/22}{This macro added}
+% \changes{v1.2c}{2008/08/24}{Fatal typo corrected}
+% |\caption@addtooptlist|\marg{type}\\
+% |\caption@removefromoptlist|\marg{type}\par
+% Adds or removes an \meta{type} to the list of unused caption options.
+% Note that the catcodes of \meta{type} are sanitized here so removing
+% \meta{type} from the list do not fail when the \package{float} package
+% is used (since |\float@getstyle| gives a result which tokens have catcode
+% 12 $=$ ``other'').
+% \begin{macrocode}
+\newcommand*\caption@addtooptlist[1]{%
+ \@ifundefined{caption@opt@#1@lineno}{%
+ \caption@dooptlist\caption@g@addto@list{#1}%
+ \expandafter\xdef\csname caption@opt@#1@lineno\endcsname{\the\inputlineno}%
+ }{}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@removefromoptlist[1]{%
+ \caption@dooptlist\caption@g@removefrom@list{#1}%
+ \global\expandafter\let\csname caption@opt@#1@lineno\endcsname\@undefined}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@dooptlist[2]{%
+ \begingroup
+ \edef\@tempa{#2}\@onelevel@sanitize\@tempa
+ \expandafter#1\expandafter\caption@optlist\expandafter{\@tempa}%
+ \endgroup}
+% \end{macrocode}
+% \begin{macrocode}
+\AtEndDocument{%
+ \caption@for@list\caption@optlist{%
+ \caption@WarningNoLine{%
+ Unused \string\captionsetup[#1]
+ on input line \csname caption@opt@#1@lineno\endcsname}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@setkeys}
+% \changes{v1.0g}{2006/01/03}{This macro added}
+% \changes{v1.0j}{2007/01/20}{Bugfix: Usage of \cs{caption@keydepth} added}
+% \changes{v1.0j}{2007/01/30}{Optional argument added}
+% \changes{v1.0n}{2007/04/08}{\cs{caption@keydepth} is now a command instead of a counter}
+% \changes{v1.1b}{2007/09/18}{Usage of \cs{caption@Package} removed, we use \cs{caption@KV@err} instead}
+% \changes{v1.2}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% \changes{v1.2a}{2008/01/12}{\cs{captionsetup@starfalse} added}
+% \changes{v1.2d}{2009/09/30}{Bugfix 09-09-29: Missing error handler will be defined automatically}
+% \changes{v1.4}{2011/08/24}{Redefinition of \cs{XKV@err} added}
+% |\caption@setkeys|\oarg{package}\marg{family}\marg{key-values}\par
+% This one simply calls |\setkeys|\marg{family}\marg{key-values}
+% but lets the error messages not refer to the \package{keyval} package,
+% but to the \meta{package} package instead.
+% \begin{macrocode}
+\newcommand*\caption@setkeys{\@dblarg\caption@@setkeys}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@setkeys[#1]#2#3{%
+ \@bsphack
+% \end{macrocode}
+% \begin{macrocode}
+ \expandafter\let\csname ORI@KV@err\caption@keydepth\endcsname\KV@err
+ \expandafter\let\csname ORI@KV@errx\caption@keydepth\endcsname\KV@errx
+ \expandafter\let\csname ORI@XKV@err\caption@keydepth\endcsname\XKV@err
+ \edef\caption@keydepth{\caption@keydepth i}%
+% \end{macrocode}
+% \begin{macrocode}
+ \expandafter\let\expandafter\KV@err\csname #1@KV@err\endcsname
+ \ifx\KV@err\relax
+ \def\KV@err##1{\PackageError{#1}{##1}{%
+ See the #1 package documentation for explanation.}}%
+ \fi
+ \def\KV@errx{\KV@err}%
+ \def\XKV@err{\let\@tempa\XKV@tkey\KV@err}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@Debug{\protect\setkeys{#2}{#3}}%
+ \setkeys{#2}{#3}%
+% \end{macrocode}
+% \begin{macrocode}
+ \edef\caption@keydepth{\expandafter\@gobble\caption@keydepth}%
+ \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
+% \end{macrocode}
+% \begin{macrocode}
+ \ifx\caption@keydepth\@empty \captionsetup@starfalse \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \@esphack}
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@keydepth\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ExecuteOptions}
+% \changes{v1.1}{2007/07/15}{This macro added}
+% \changes{v1.3}{2010/09/04}{Depends on package now}
+% |\caption@ExecuteOptions|\marg{package}\marg{key-values}\par
+% We execute our options using the keyval interface, so we use this one
+% instead of |\ExecuteOptions| offered by \LaTeXe.
+% \begin{macrocode}
+\newcommand*\caption@ExecuteOptions[2]{%
+ \expandafter\@expandtwoargs\csname caption@setkeys@#1\endcsname{#1}{#2}}%
+\@onlypreamble\caption@ExecuteOptions
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ProcessOptions}
+% \changes{v1.0a}{2004/01/23}{Bugfix, see
+% \purett{news:400D360C.9678329F@gmx.net} for details}
+% \changes{v1.0g}{2006/01/03}{Improvement, uses \cs{caption@setkeys}
+% instead of \cs{setkeys}}
+% \changes{v1.0h}{2006/02/23}{Bugfix, now processes only those global
+% options which have a default value}
+% \changes{v1.0j}{2007/01/30}{\cs{ProcessOptionsWithKV} renamed to
+% \cs{caption@ProcessOptions} and moved from the package to the kernel}
+% \changes{v1.1}{2007/04/17}{Star variant added}
+% |\caption@ProcessOptions*|\marg{package}\par
+% We process our options using the keyval package, so we use this one
+% instead of |\ProcessOptions| offered by \LaTeXe.
+% The starred variant do not process the global options.
+% (This code was taken from the \package{hyperref} package\cite{hyperref}
+% \version{6.74} and improved.)
+% \begin{macrocode}
+\newcommand*\caption@ProcessOptions{%
+ \caption@teststar\caption@@ProcessOptions\@gobble\@firstofone}
+\@onlypreamble\caption@ProcessOptions
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@@ProcessOptions[2]{%
+ \let\@tempc\relax
+ \let\caption@tempa\@empty
+ #1{% \@firstofone -or- \@gobble
+ \@for\CurrentOption:=\@classoptionslist\do{%
+ \@ifundefined{KV@#2@\CurrentOption}{}{%
+ \@ifundefined{KV@#2@\CurrentOption @default}{%
+ \PackageInfo{#2}{Global option `\CurrentOption' ignored}%
+ }{%
+ \PackageInfo{#2}{Global option `\CurrentOption' processed}%
+ \edef\caption@tempa{\caption@tempa\CurrentOption,}%
+ \@expandtwoargs\@removeelement\CurrentOption
+ \@unusedoptionlist\@unusedoptionlist
+ }%
+ }%
+ }%
+ \let\CurrentOption\@empty
+ }%
+ \caption@ExecuteOptions{#2}{\caption@tempa\@ptionlist{\@currname.\@currext}}%
+ \AtEndOfPackage{\let\@unprocessedoptions\relax}}
+\@onlypreamble\caption@@ProcessOptions
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@SetupOptions}
+% \changes{v1.3}{2010/09/04}{This macro added}
+% |\caption@SetupOptions|\marg{package}\marg{code}\par
+% After calling this macro |\caption@ExecuteOptions| and
+% |\usepackage|\oarg{options}\marg{package}
+% will both be mapped to \meta{code} with \meta{package} and \meta{options}
+% as arguments |#1| and |#2|. (This helps avoiding ``Option clash'' errors.)
+% \begin{macrocode}
+\newcommand*\caption@packagelist{}
+\@onlypreamble\caption@packagelist
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@SetupOptions[2]{%
+ \@namedef{caption@setkeys@#1}##1##2{#2}%
+ \expandafter\@onlypreamble\csname caption@setkeys@#1\endcsname
+ \@cons\caption@packagelist{{#1}}}
+\@onlypreamble\caption@SetupOptions
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@onefilewithoptions\@onefilewithoptions
+\def\@onefilewithoptions#1[#2]{%
+ \begingroup
+ \def\@tempa{%
+ \endgroup
+ \caption@onefilewithoptions{#1}[{#2}]}%
+ \def\@tempb{#1}%
+ \def\@elt##1{%
+ \def\@tempc{##1}%
+ \ifx\@tempb\@tempc
+ \def\@tempa{%
+ \endgroup
+ \caption@ExecuteOptions{#1}{#2}%
+ \caption@onefilewithoptions{#1}[]}%
+ \fi}
+ \caption@packagelist
+ \@tempa}
+\@onlypreamble\caption@onefilewithoptions
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Margin resp. width}
+% \changes{v1.0n}{2007/04/01}{\cs{captionmarginx} renamed to \cs{captionmargin@}}
+% \changes{v1.0n}{2007/04/03}{Option `twoside' added}
+% \changes{v1.1}{2007/08/11}{Options `margin*', `minmargin', and `maxmargin' added}
+% \changes{v1.2}{2007/11/10}{Option `oneside' added}
+%
+% \begin{macro}{\captionmargin}
+% \begin{macro}{\captionwidth}
+% |\captionmargin| and |\captionwidth| contain the extra margin
+% resp. the total width used for captions. Please never set these values in
+% a direct way, they are just accessible in user documents to provide
+% compatibility to \version{1.x}.\par
+% Note that we can only set one value at a time, `margin' \emph{or} `width'.
+% If |\captionwidth| is not zero we will take this value afterwards,
+% otherwise |\captionmargin| and |\captionmargin@|.
+% \begin{macrocode}
+\newdimen\captionmargin
+\newdimen\captionmargin@
+\newdimen\captionwidth
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{margin}{\setcaptionmargin{#1}}
+\DeclareCaptionOption{margin*}{\setcaptionmargin*{#1}}
+\DeclareCaptionOption{width}{\setcaptionwidth{#1}}
+\DeclareCaptionOption{width*}{\setcaptionwidth*{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{calcmargin}{\caption@setcalcmargin{#1}}
+\DeclareCaptionOption{calcmargin*}{\caption@setcalcmargin*{#1}}
+\DeclareCaptionOption{calcwidth}{\caption@setcalcwidth{#1}}
+\DeclareCaptionOption{calcwidth*}{\caption@setcalcwidth*{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{twoside}[1]{\caption@set@bool\caption@iftwoside{#1}}
+\DeclareCaptionOptionNoValue{oneside}{\caption@set@bool\caption@iftwoside0}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{minmargin}{\caption@setoptcmd\caption@minmargin{#1}}
+\DeclareCaptionOption{maxmargin}{\caption@setoptcmd\caption@maxmargin{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\setcaptionmargin}
+% \changes{v1.0f}{2005/10/24}{Renamed from \cs{caption@setmargin} to \cs{setcaptionmargin}}
+% \changes{v1.0f}{2005/10/24}{\cs{setcaptionmargin} enhanced so it can take
+% left+right margin}
+% \changes{v1.1}{2007/08/11}{Starred variant added}
+% \changes{v1.1}{2007/08/12}{\cs{setlength}\cs{captionmargin} \&
+% \cs{setlength}\cs{captionmargin@} swapped so
+% `\texttt{margin*=}\cs{captionmargin}' works in singleline options}
+% \changes{v1.3}{2010/11/07}{Support for option \opt{calcmargin} added}
+% |\setcaptionmargin|\marg{amount}\\
+% |\setcaptionmargin*|\marg{amount}\par
+% Please never use this in user documents, it's just there to
+% provide compatibility to the \package{caption2} package.
+% \begin{macrocode}
+\newcommand*\setcaptionmargin{%
+ \caption@resetcalcmargin
+ \caption@setmargin}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setmargin{%
+ \caption@teststar\caption@@setmargin\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setmargin[2]{%
+ #1{\captionwidth\z@}%
+ \caption@@@setmargin#2,#2,\@nil}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@@setmargin#1,#2,#3\@nil{%
+ \setlength\captionmargin@{#2}%
+ \setlength\captionmargin{#1}%
+ \addtolength\captionmargin@{-\captionmargin}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\setcaptionwidth}
+% \changes{v1.0f}{2005/10/24}{Renamed from \cs{caption@setwidth} to \cs{setcaptionwidth}}
+% \changes{v1.3}{2010/11/07}{Starred variant added}
+% \changes{v1.3}{2010/11/07}{Support for option \opt{calcwidth} added}
+% |\setcaptionwidth|\marg{amount}\\
+% |\setcaptionwidth*|\marg{amount}\par
+% Please never use this in user documents, it's just there to
+% provide compatibility to the \package{caption2} package.
+% \begin{macrocode}
+\newcommand*\setcaptionwidth{%
+ \caption@resetcalcmargin
+ \caption@setwidth}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setwidth{%
+ \caption@teststar\caption@@setwidth\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setwidth[2]{%
+ #1{\captionmargin\z@\captionmargin@\z@}%
+ \setlength\captionwidth{#2}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@resetcalcmargin}
+% \changes{v1.3}{2010/11/07}{This macro added}
+% \begin{macrocode}
+\newcommand*\caption@resetcalcmargin{%
+ \let\caption@calcmargin@hook\@empty}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setcalcmargin}
+% \changes{v1.3}{2010/11/07}{This macro added}
+% \begin{macrocode}
+\newcommand*\caption@setcalcmargin{%
+ \caption@teststar{\caption@@setcalcmargin\caption@setmargin}%
+ \@secondoftwo\@firstoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setcalcmargin[3]{%
+ #2{\caption@resetcalcmargin
+ \l@addto@macro\caption@calcmargin@hook{#1{#3}}}%
+ {\l@addto@macro\caption@calcmargin@hook{#1*{#3}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setcalcwidth}
+% \changes{v1.3}{2010/11/07}{This macro added}
+% \begin{macrocode}
+\newcommand*\caption@setcalcwidth{%
+ \caption@teststar{\caption@@setcalcmargin\caption@setwidth}%
+ \@secondoftwo\@firstoftwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@counter}
+% \changes{v1.0n}{2007/04/03}{This counter added}
+% \changes{v1.1e}{2007/10/28}{Renamed to \cs{caption@thecounter}; \cs{caption@stepcounter} added}
+% This counter numbers the captions. At the moment it will be used inside
+% |\caption@ifoddpage| only.
+% \begin{macrocode}
+\newcommand*\caption@thecounter{0}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@stepcounter{%
+ \@tempcnta\caption@thecounter
+ \advance\@tempcnta\@ne
+ \xdef\caption@thecounter{\the\@tempcnta}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@newlabel}
+% \changes{v1.0n}{2007/04/03}{This macro added}
+% This command is a modified version of |\newlabel| from \LaTeX2e.
+% It will be written to the \texttt{.aux} file to
+% pass label information from one run to another.
+% (We use it inside |\caption@ifoddpage| and |\caption@ragged|.)
+% \begin{macrocode}
+\newcommand*\caption@newlabel{\@newl@bel{caption@r}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@thepage}
+% \changes{v1.0n}{2007/04/03}{This macro added}
+% This command is a modified version of |\thepage| from \LaTeX2e.
+% It will be used inside |\caption@ifoddpage| only.
+% \begin{macrocode}
+\newcommand*\caption@thepage{\the\c@page}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@label}
+% \changes{v1.1}{2007/09/01}{This macro added}
+% \changes{v1.2}{2007/12/03}{Definition of \cs{caption@newlabel} in AUX file added}
+% This command is a modified version of |\label| from \LaTeX2e.
+% It will be used inside |\caption@ifoddpage| and |\FP@helpNote|.
+% \begin{macrocode}
+\newcommand*\caption@label[1]{%
+ \caption@@label
+ \protected@write\@auxout{\let\caption@thepage\relax}%
+ {\string\caption@newlabel{#1}{\caption@thepage}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@label{%
+ \global\let\caption@@label\relax
+ \protected@write\@auxout{}%
+ {\string\providecommand*\string\caption@newlabel[2]{}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@pageref}
+% \changes{v1.1}{2007/09/01}{This macro added}
+% \changes{v1.2d}{2009/10/09}{Uses \cs{@latex@warning} instead of \cs{caption@Warning} now}
+% This command is a modified version of |\pageref| from \LaTeX2e.
+% It will be used inside |\caption@ifoddpage| and |\FP@helpNote|.
+% \begin{macrocode}
+\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}%
+ \else
+ \expandafter\let\expandafter\caption@thepage\csname caption@r@#1\endcsname
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifoddpage}
+% \changes{v1.0n}{2007/04/03}{This macro added}
+% \changes{v1.1e}{2007/10/28}{Incrementation of counter moved to \cs{caption@@make}}
+% At the moment this macro uses an own label\ldots ref mechanism,
+% but an alternative implementation method would be using the
+% \package{refcount} package\cite{refcount} and |\ifodd\getpagerefnumber{|\ldots|}|.
+% \Note{This macro re-defines itself so the \texttt{.aux} file will
+% only be used once per group.}
+% \begin{macrocode}
+\newcommand*\caption@ifoddpage{%
+ \caption@iftwoside{%
+ \caption@label\caption@thecounter
+ \caption@pageref\caption@thecounter
+ \ifodd\caption@thepage
+ \let\caption@ifoddpage\@firstoftwo
+ \else
+ \let\caption@ifoddpage\@secondoftwo
+ \fi
+ }{\let\caption@ifoddpage\@firstoftwo}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@ifoddpage}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setoptcmd}
+% \changes{v1.1}{2007/08/11}{This macro added}
+% |\caption@setoptcmd|\marg{cmd}\marg{off -or- value}
+% \begin{macrocode}
+\newcommand*\caption@setoptcmd[2]{%
+ \caption@ifinlist{#2}{0,false,no,off}{\let#1\@undefined}{\def#1{#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Indentions}
+%
+% \begin{macro}{\caption@indent}
+% \changes{v1.1}{2007/07/29}{Renamed from \cs{captionindent} to \cs{caption@indent}}
+% \begin{macro}{\caption@parindent}
+% \begin{macro}{\caption@hangindent}
+% These are the indentions we support.
+% \begin{macrocode}
+\newdimen\caption@indent
+\newdimen\caption@parindent
+\newdimen\caption@hangindent
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \changes{v1.0b}{2004/05/16}{Defaults added for options \opt{parindent=}
+% and \opt{hangindent=}}
+% \changes{v1.0f}{2005/08/22}{Option \opt{parskip=}: \cs{AtBeginCaption}
+% replaced by \cs{caption@@par}}
+% \changes{v1.0f}{2005/08/22}{Undocumented defaults for \opt{parindent=},
+% \opt{hangindent=}, and \opt{parskip=} removed}
+% \begin{macrocode}
+\DeclareCaptionOption{indent}[\leftmargini]{% obsolete!
+ \setlength\caption@indent{#1}}
+\DeclareCaptionOption{indention}[\leftmargini]{%
+ \setlength\caption@indent{#1}}
+\DeclareCaptionOption{parindent}{%
+ \setlength\caption@parindent{#1}}
+\DeclareCaptionOption{hangindent}{%
+ \setlength\caption@hangindent{#1}}
+\DeclareCaptionOption{parskip}{%
+ \l@addto@macro\caption@@par{\setlength\parskip{#1}}}
+% \end{macrocode}
+%
+% \changes{v1.0f}{2005/08/22}{Increased compatibility to KOMA-Script:
+% A special version of options `parindent' and `parskip' added}
+% \changes{v1.0g}{2006/01/03}{Bugfix 06-01-03: KOMA-Script variants of
+% `parskip' and `parindent' options revised and moved into caption kernel}
+% \changes{v1.0h}{2006/02/23}{KOMA-Script variants of `parskip' and
+% `parindent' are obsolete now, removed}
+% \changes{v1.0m}{2007/03/30}{KOMA-Script variants of `parskip' and
+% `parindent' re-added, since they still collide with the current
+% version of the subfig package (Sigh!)}
+%
+% There is an option clash between the \KOMAScript\ document classes
+% and the \package{caption} kernel, both define the options |parindent| and
+% |parskip| but with different meaning.
+% Furthermore the ones defined by the \package{caption} kernel take a
+% value as parameter but the \KOMAScript\ ones do not.
+% So we need special versions of the options |parindent| and |parskip| here
+% which determine if a value is given (and therefore should be treated as
+% our option) or not (and therefore should be ignored by us).\footnote{%^^A
+% This problem was completely solved due a change of \cs{caption@ProcessOptions}
+% in \thispackage\ \version{1.0h}, but we still need this workaround since
+% these options would otherwise still collide with the current version $1.3$
+% of the \package{subfig} package (Sigh!)}
+% \begin{macrocode}
+\providecommand*\caption@ifkomaclass{%
+ \caption@ifundefined\scr@caption\@gobble\@firstofone}
+\@onlypreamble\caption@ifkomaclass
+% \end{macrocode}
+% \begin{macrocode}
+\caption@ifkomaclass{%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@KV@parindent\KV@caption@parindent
+ \DeclareCaptionOption{parindent}[]{%
+ \ifx,#1,%
+ \caption@Debug{Option `parindent' ignored}%
+ \else
+ \caption@KV@parindent{#1}%
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@KV@parskip\KV@caption@parskip
+ \DeclareCaptionOption{parskip}[]{%
+ \ifx,#1,%
+ \caption@Debug{Option `parskip' ignored}%
+ \else
+ \caption@KV@parskip{#1}%
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsection{Styles}
+%
+% \begin{macro}{\DeclareCaptionStyle}
+% \changes{v1.0a}{2004/01/17}{Pass through argument \#3 so extra spaces
+% between arguments do make any harm}
+% |\DeclareCaptionStyle|\marg{name}\oarg{single-line-list-of-KV}\marg{list-of-KV}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionStyle[1]{%
+ \@testopt{\caption@declarestyle{#1}}{}}
+\@onlypreamble\DeclareCaptionStyle
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@declarestyle#1[#2]#3{%
+ \global\@namedef{caption@sls@#1}{#2}%
+ \global\@namedef{caption@sty@#1}{#3}}
+\@onlypreamble\caption@declarestyle
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.2a}{2008/01/20}{Option \opt{style*=} added}
+% \changes{v1.2b}{2008/05/06}{Option \opt{slc=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{style}{\caption@setstyle{#1}}
+\DeclareCaptionOption{style*}{\caption@setstyle*{#1}}
+\DeclareCaptionOption{singlelinecheck}[1]{\caption@set@bool\caption@ifslc{#1}}
+\DeclareCaptionOption{slc}[1]{\KV@caption@singlelinecheck{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setstyle}
+% \changes{v1.0e}{2005/06/01}{Starred variant added}
+% \changes{v1.1}{2007/07/29}{Recursive style definitions should work now}
+% \changes{v1.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency}
+% \changes{v1.2}{2007/12/03}{Definition of \cs{caption@iftypewarning} removed}
+% |\caption@setstyle|\marg{name}\\
+% |\caption@setstyle*|\marg{name}\par
+% Selecting a caption style means saving the additional
+% \meta{single-line-list-of-KV} (this will be done by |\caption@sls|),
+% resetting the caption options to the base ones (this will be done using
+% |\caption@resetstyle|) and executing the \meta{list-of-KV} options
+% (this will be done using |\caption@setup|).\par
+% The starred version will give no error message if the given style is not
+% defined.
+% \begin{macrocode}
+\newcommand*\caption@setstyle{%
+ \caption@teststar\caption@@setstyle\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setstyle[2]{%
+ \@ifundefined{caption@sty@#2}%
+ {#1{\caption@Error{Undefined style `#2'}}}%
+ {\expandafter\let\expandafter\caption@sty\csname caption@sty@#2\endcsname
+ \ifx\caption@setstyle@flag\@undefined
+ \let\caption@setstyle@flag\relax
+ \caption@resetstyle
+ \caption@xsetup\caption@sty
+ \let\caption@setstyle@flag\@undefined
+ \else
+ \caption@xsetup\caption@sty
+ \fi
+ \expandafter\let\expandafter\caption@sls\csname caption@sls@#2\endcsname
+ \expandafter\caption@l@addto@list\expandafter\caption@opt@singleline
+ \expandafter{\caption@sls}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@resetstyle}
+% \changes{v1.1}{2007/02/04}{%
+% This macro renamed from \cs{caption@setdefault} to \cs{caption@resetstyle}}
+% \changes{v1.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency}
+% \changes{v1.2}{2007/11/17}{Usage of \texttt{size=} added}
+% \changes{v1.2b}{2008/05/06}{Usage of \texttt{rule} added}
+% This resets (nearly) all caption options to the base ones.
+% \emph{Note that this does not touch the skips and the positioning!}
+% \begin{macrocode}
+\newcommand*\caption@resetstyle{%
+ \caption@setup{%
+ format=plain,labelformat=default,labelsep=colon,textformat=simple,%
+ justification=justified,font=,size=,labelfont=,textfont=,%
+ margin=0pt,minmargin=0,maxmargin=0,%
+ indent=0pt,parindent=0pt,hangindent=0pt,%
+ slc,rule,strut}%
+ \caption@clearsetup{singleline}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.0c}{2005/02/12}{\opt{indent=0pt} added to caption style \opt{default}}
+% \changes{v1.1}{2007/02/04}{Caption style `default' renamed to `base', and a new `default' added}
+% \changes{v1.1}{2007/03/31}{\opt{format=plain} added to caption style \opt{default}}
+% \changes{v1.1c}{2007/10/14}{\opt{format=plain} removed from caption style \opt{default}}
+% Currently there are two pre-defined styles, called `base' \& `default'.
+% The first one is a perfect match to the behavior of |\@makecaption| offered
+% by the standard \LaTeX\ document classes (and was called `default' in
+% \thispackage\ \version{1.0}), the second one matches the document
+% class actually used.
+% \begin{macrocode}
+\DeclareCaptionStyle{base}[indent=0pt,justification=centering]{}
+\DeclareCaptionStyle{default}[indent=0pt,justification=centering]{%
+ format=default,labelsep=default,textformat=default,%
+ justification=default,font=default,labelfont=default,textfont=default}
+% \end{macrocode}
+%
+% \subsection{Formats}
+%
+% \begin{macro}{\DeclareCaptionFormat}
+% \changes{v1.0a}{2004/01/17}{Pass through argument \#3 so extra spaces
+% between arguments do make any harm}
+% \changes{v1.0c}{2005/02/09}{Starred variant added}
+% \changes{v1.1c}{2007/10/15}{Optional argument added}
+% |\DeclareCaptionFormat|\marg{name}\marg{code with \#1, \#2, and \#3}\\
+% |\DeclareCaptionFormat*|\marg{name}\marg{code with \#1, \#2, and \#3}\par
+% The starred form causes the code being typeset in vertical (instead of
+% horizontal) mode, but does not support the |indention=| option.
+% \begin{macrocode}
+\newcommand*\DeclareCaptionFormat{%
+ \caption@teststar\caption@declareformat\@gobble\@firstofone}
+\@onlypreamble\DeclareCaptionFormat
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declareformat[2]{%
+ \@dblarg{\caption@@declareformat#1{#2}}}
+\@onlypreamble\caption@declareformat
+% \end{macrocode}
+% \begin{macrocode}
+\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
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{format}{\caption@setformat{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setformat}
+% |\caption@setformat|\marg{name}\par
+% Selecting a caption format simply means saving the code (in |\caption@fmt|)
+% and if the code should be used in horizontal or vertical mode (|\caption@ifh|).
+% \begin{macrocode}
+\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}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionDefaultFormat}
+% \changes{v1.2a}{2008/01/31}{This macro added}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionDefaultFormat[1]{%
+ \expandafter\def\expandafter\caption@fmt@default\expandafter
+ {\csname caption@fmt@#1\endcsname}%
+ \expandafter\def\expandafter\caption@slfmt@default\expandafter
+ {\csname caption@slfmt@#1\endcsname}%
+ \expandafter\def\expandafter\caption@ifh@default\expandafter
+ {\csname caption@ifh@#1\endcsname}}
+\@onlypreamble\DeclareCaptionDefaultFormat
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.0a}{2004/01/23}{%
+% Caption format \opt{default} renamed to \opt{normal}}
+% \changes{v1.0e}{2005/05/12}{%
+% Caption format \opt{normal} renamed to \opt{@normal}}
+% \changes{v1.0f}{2005/08/25}{%
+% Caption format \opt{@normal} renamed to \opt{plain} and documented}
+% \changes{v1.1c}{2007/10/14}{%
+% Single-line variant of caption format \opt{hang} added}
+% There are two pre-defined formats, called `plain' and `hang'.
+% \begin{macrocode}
+\DeclareCaptionFormat{plain}{#1#2#3\par}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionFormat{hang}[#1#2#3\par]{%
+ \caption@ifin@list\caption@lsepcrlist\caption@lsepname
+ {\caption@Error{%
+ The option `labelsep=\caption@lsepname' does not work\MessageBreak
+ with `format=hang'}}%
+ {\@hangfrom{#1#2}%
+ \advance\caption@parindent\hangindent
+ \advance\caption@hangindent\hangindent
+ \caption@@par#3\par}}
+% \end{macrocode}
+%
+% \changes{v1.0a}{2004/01/23}{Caption format \opt{default} linked to \opt{plain}}
+% \changes{v1.0d}{2005/04/28}{Bugfix 05-04-28: Missing \cs{caption@ifh@default} added}
+% `default' usually maps to `plain'.
+% \begin{macrocode}
+\DeclareCaptionDefaultFormat{plain}
+% \end{macrocode}
+%
+% \subsection{Label formats}
+%
+% \begin{macro}{\DeclareCaptionLabelFormat}
+% \changes{v1.0a}{2004/01/17}{%
+% Pass through argument \#2 so extra spaces between arguments do make any harm}
+% |\DeclareCaptionLabelFormat|\marg{name}\marg{code with \#1 and \#2}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionLabelFormat[2]{%
+ \global\@namedef{caption@lfmt@#1}##1##2{#2}}
+\@onlypreamble\DeclareCaptionLabelFormat
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{labelformat}{\caption@setlabelformat{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlabelformat}
+% |\caption@setlabelformat|\marg{name}\par
+% Selecting a caption label format simply means saving the code (in |\caption@lfmt|).
+% \begin{macrocode}
+\newcommand*\caption@setlabelformat[1]{%
+ \@ifundefined{caption@lfmt@#1}%
+ {\caption@Error{Undefined label format `#1'}}%
+ {\expandafter\let\expandafter\caption@lfmt\csname caption@lfmt@#1\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.2}{2007/12/16}{Caption label format \opt{brace} added}
+% There are four pre-defined label formats, called `empty', `simple',
+% `parens', and `brace'.
+% \begin{macrocode}
+\DeclareCaptionLabelFormat{empty}{}
+\DeclareCaptionLabelFormat{simple}{\bothIfFirst{#1}{\nobreakspace}#2}
+\DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{\nobreakspace}(#2)}
+\DeclareCaptionLabelFormat{brace}{\bothIfFirst{#1}{\nobreakspace}#2)}
+% \end{macrocode}
+%
+% `default' usually maps to `simple'.
+% \begin{macrocode}
+\def\caption@lfmt@default{\caption@lfmt@simple}
+% \end{macrocode}
+%
+% \subsection{Label separators}
+%
+% \begin{macro}{\DeclareCaptionLabelSeparator}
+% \changes{v1.0a}{2004/01/17}{Pass through argument \#2 so extra spaces
+% between arguments do make any harm}
+% \changes{v1.0f}{2005/08/25}{Starred variant added}
+% \changes{v1.1}{2007/07/13}{Test for CR added}
+% \changes{v1.3}{2011/08/06}{Test for CR revised}
+% |\DeclareCaptionLabelSeparator|\marg{name}\marg{code}\\
+% |\DeclareCaptionLabelSeparator*|\marg{name}\marg{code}\par
+% The starred form causes the label separator to be typeset \emph{without} using |\captionlabelfont|.
+% \begin{macrocode}
+\newcommand\DeclareCaptionLabelSeparator{%
+ \caption@teststar\caption@declarelabelseparator\@gobble\@firstofone}
+\@onlypreamble\DeclareCaptionLabelSeparator
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@declarelabelseparator[3]{%
+ \global\@namedef{caption@iflf@#2}{#1}%
+ \global\long\@namedef{caption@lsep@#2}{#3}%
+ \caption@@declarelabelseparator{#2}#3\\\@nil}
+\@onlypreamble\caption@declarelabelseparator
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@declarelabelseparator#1#2\\#3\@nil{%
+ \def\@tempa{#3}\ifx\@tempa\@empty \else
+ \caption@g@addto@list\caption@lsepcrlist{#1}%
+ \fi}
+\@onlypreamble\caption@@declarelabelseparator
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{labelsep}{\caption@setlabelseparator{#1}}
+\DeclareCaptionOption{labelseparator}{\caption@setlabelseparator{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlabelseparator}
+% |\caption@setlabelseparator|\marg{name}\par
+% Selecting a caption label separator simply means saving the code (in |\caption@lsep|).
+% \begin{macrocode}
+\newcommand*\caption@setlabelseparator[1]{%
+ \@ifundefined{caption@lsep@#1}%
+ {\caption@Error{Undefined label separator `#1'}}%
+ {\edef\caption@lsepname{#1}%
+ \expandafter\let\expandafter\caption@iflf\csname caption@iflf@#1\endcsname
+ \expandafter\let\expandafter\caption@lsep\csname caption@lsep@#1\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.0e}{2005/06/11}{Bugfix 05-03-23: Caption label separator
+% \opt{newline} implementation changed from \cs{newline} to \cs{\textbackslash}}
+% \changes{v1.0f}{2005/08/24}{Caption label separator \opt{endash} added}
+% There are seven pre-defined label separators, called `none', `colon', `period', `space',
+% `quad', `newline', and `endash'.
+% \begin{macrocode}
+\DeclareCaptionLabelSeparator{none}{}
+\DeclareCaptionLabelSeparator{colon}{: }
+\DeclareCaptionLabelSeparator{period}{. }
+\DeclareCaptionLabelSeparator{space}{ }
+\DeclareCaptionLabelSeparator*{quad}{\quad}
+\DeclareCaptionLabelSeparator*{newline}{\\}
+\DeclareCaptionLabelSeparator*{endash}{\space\textendash\space}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setdefaultlabelsep}
+% \changes{v1.2d}{2009/03/29}{This macro added}
+% \begin{macrocode}
+\newcommand*\caption@setdefaultlabelsep[1]{%
+ \ifx\caption@lsep\caption@lsep@default
+ \caption@set@default@labelsep{#1}%
+ \caption@setlabelseparator{default}%
+ \else
+ \caption@set@default@labelsep{#1}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@set@default@labelsep[1]{%
+ \def\caption@lsep@default{\@nameuse{caption@lsep@#1}}%
+ \def\caption@iflf@default{\@nameuse{caption@iflf@#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% `default' usually maps to `colon'.
+% \begin{macrocode}
+\caption@set@default@labelsep{colon}
+% \end{macrocode}
+%
+% \subsection{Text formats}
+%
+% \begin{macro}{\DeclareCaptionTextFormat}
+% \changes{v1.0j}{2007/02/18}{This macro added}
+% |\DeclareCaptionTextFormat|\marg{name}\marg{code with \#1}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionTextFormat[2]{%
+ \global\long\@namedef{caption@tfmt@#1}##1{#2}}
+\@onlypreamble\DeclareCaptionTextFormat
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.0c}{2005/02/12}{Option \opt{strut=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{textformat}{\caption@settextformat{#1}}
+\DeclareCaptionOption{strut}[1]{\caption@set@bool\caption@ifstrut{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@settextformat}
+% \changes{v1.0j}{2007/02/18}{This macro added}
+% |\caption@settextformat|\marg{name}\par
+% Selecting a caption text format simply means saving the code (in |\caption@tfmt|).
+% \begin{macrocode}
+\newcommand*\caption@settextformat[1]{%
+ \@ifundefined{caption@tfmt@#1}%
+ {\caption@Error{Undefined text format `#1'}}%
+ {\expandafter\let\expandafter\caption@tfmt\csname caption@tfmt@#1\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% There are three pre-defined text formats, called `empty', `simple' and `period'.
+% \changes{v1.4}{2011/10/05}{Pre-defined text format `empty' added}
+% \begin{macrocode}
+\DeclareCaptionTextFormat{empty}{}
+\DeclareCaptionTextFormat{simple}{#1}
+\DeclareCaptionTextFormat{period}{#1.}
+% \end{macrocode}
+%
+% `default' usually maps to `simple'.
+% \begin{macrocode}
+\def\caption@tfmt@default{\caption@tfmt@simple}
+% \end{macrocode}
+%
+% \subsection{Fonts}
+%
+% \begin{macro}{\DeclareCaptionFont}
+% \changes{v1.0a}{2004/01/22}{%
+% Bugfix: Multi token arguments are allowed now}
+% \changes{v1.1}{2007/05/07}{%
+% Internal: Uses \cs{caption@fnt} instead of \cs{caption@temp} now}
+% |\DeclareCaptionFont|\marg{name}\marg{code}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionFont[2]{%
+ \define@key{caption@fnt}{#1}[]{\l@addto@macro\caption@fnt{#2}}}
+\@onlypreamble\DeclareCaptionFont
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionDefaultFont}
+% \changes{v1.1}{2006/05/14}{This macro added}
+% \changes{v1.2a}{2008/01/31}{Renamed from \cs{DeclareDefaultCaptionFont} to \cs{DeclareCaptionDefaultFont}}
+% |\DeclareCaptionDefaultFont|\marg{name}\marg{code}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionDefaultFont[2]{%
+ \global\@namedef{caption#1@default}{#2}}
+\@onlypreamble\DeclareCaptionDefaultFont
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{font}{\caption@setfont{font}{#1}}
+\DeclareCaptionOption{font+}{\caption@addtofont{font}{#1}}
+\DeclareCaptionDefaultFont{font}{}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{labelfont}{\caption@setfont{labelfont}{#1}}
+\DeclareCaptionOption{labelfont+}{\caption@addtofont{labelfont}{#1}}
+\DeclareCaptionDefaultFont{labelfont}{}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{textfont}{\caption@setfont{textfont}{#1}}
+\DeclareCaptionOption{textfont+}{\caption@addtofont{textfont}{#1}}
+\DeclareCaptionDefaultFont{textfont}{}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setfont}
+% \changes{v1.0j}{2007/01/30}{Usage of \cs{caption@setkeys} with optional argument}
+% \changes{v1.1}{2006/05/14}{Support of \cs{DeclareDefaultCaptionFont} added}
+% |\caption@setfont|\marg{name}\marg{keyval-list of names}\par
+% Selecting a caption font means saving all the code snippets
+% in |\caption|\meta{name}.
+% \begin{macrocode}
+\newcommand*\caption@setfont[1]{%
+ \expandafter\let\csname caption#1\endcsname\@empty
+ \caption@addtofont{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@addtofont}
+% \changes{v1.2}{2007/11/17}{This macro added}
+% |\caption@addtofont|\marg{name}\marg{keyval-list of names}\par
+% Like |\caption@setfont|, but adds the code snippets to |\caption|\meta{name}.\par
+% Because we use |\setkeys| recursive here we need to do this inside an
+% extra group.
+% \begin{macrocode}
+\newcommand*\caption@addtofont[2]{%
+ \begingroup
+ \expandafter\let\expandafter\caption@fnt\csname caption#1\endcsname
+ \define@key{caption@fnt}{default}[]{%
+ \l@addto@macro\caption@fnt{\csname caption#1@default\endcsname}}%
+ \caption@setkeys[caption]{caption@fnt}{#2}%
+ \global\let\caption@tempa\caption@fnt
+ \endgroup
+ \expandafter\let\csname caption#1\endcsname\caption@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@font}
+% \changes{v1.1}{2007/05/07}{This macro added}
+% |\caption@font|\marg{keyval-list of names}\\
+% |\caption@font*|\marg{keyval-code}\par
+% Sets the given font, e.g.~|\caption@font{small,it}|
+% is equivalent to |\small\itshape|.
+% \begin{macrocode}
+\newcommand*\caption@font{%
+ \caption@teststar\caption@@font\@firstofone
+ {\caption@setkeys[caption]{caption@fnt}}}
+\newcommand*\caption@@font[2]{%
+ \begingroup
+ \def\caption@fnt{\endgroup}%
+ #1{#2}%
+ \caption@fnt}
+% \end{macrocode}
+% \end{macro}
+%
+% These are the pre-defined font code snippets.
+%
+% \changes{v1.1}{2007/05/07}{Color font support added}
+% \begin{macrocode}
+\DeclareCaptionFont{normalcolor}{\normalcolor}
+\DeclareCaptionFont{color}{\color{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionFont{normalfont}{\normalfont}
+\DeclareCaptionFont{up}{\upshape}
+\DeclareCaptionFont{it}{\itshape}
+\DeclareCaptionFont{sl}{\slshape}
+\DeclareCaptionFont{sc}{\scshape}
+\DeclareCaptionFont{md}{\mdseries}
+\DeclareCaptionFont{bf}{\bfseries}
+\DeclareCaptionFont{rm}{\rmfamily}
+\DeclareCaptionFont{sf}{\sffamily}
+\DeclareCaptionFont{tt}{\ttfamily}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionFont{scriptsize}{\scriptsize}
+\DeclareCaptionFont{footnotesize}{\footnotesize}
+\DeclareCaptionFont{small}{\small}
+\DeclareCaptionFont{normalsize}{\normalsize}
+\DeclareCaptionFont{large}{\large}
+\DeclareCaptionFont{Large}{\Large}
+% \end{macrocode}
+%
+% \changes{v1.3}{2011/01/01}{\package{sansmath} package support added}
+% \begin{macrocode}
+\DeclareCaptionFont{sansmath}{\sansmath}
+% \end{macrocode}
+%
+% \changes{v1.0n}{2007/04/02}{\package{setspace} package support added}
+% \changes{v1.2d}{2009/10/09}{Bugfix 09-05-18: \package{setspace} package support revised}
+% \begin{macrocode}
+\DeclareCaptionFont{singlespacing}{%
+ \caption@ifundefined\setspace@singlespace{}{%
+ \setstretch\setspace@singlespace}}% normally 1
+\DeclareCaptionFont{onehalfspacing}{\onehalfspacing}
+\DeclareCaptionFont{doublespacing}{\doublespacing}
+\DeclareCaptionFont{stretch}{\setstretch{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%\DeclareCaptionFont{normal}{%
+% \caption@font{normalcolor,normalfont,normalsize,singlespacing}
+\DeclareCaptionFont{normal}{%
+ \caption@font*{%
+ \KV@caption@fnt@normalcolor\@unused
+ \KV@caption@fnt@normalfont\@unused
+ \KV@caption@fnt@normalsize\@unused
+ \KV@caption@fnt@singlespacing\@unused}}
+% \end{macrocode}
+%
+% \changes{v1.0a}{2004/01/23}{Option \opt{size=} now sets \cs{captionsize} instead of \cs{captionfont}}
+% The old versions \version{1.x} of \thispackage\ offered this
+% command to setup the font size used for captions. We still do
+% so old documents will work fine.
+% \begin{macrocode}
+\DeclareCaptionOption{size}{\caption@setfont{size}{#1}}
+\DeclareCaptionDefaultFont{size}{}
+% \end{macrocode}
+%
+% \subsection{Justifications}
+%
+% \begin{macro}{\DeclareCaptionJustification}
+% \changes{v1.0a}{2004/01/17}{Pass through argument \#2 so extra spaces
+% between arguments do make any harm}
+% \changes{v1.1}{2007/07/03}{Mapped to \cs{DeclareCaptionFont}}
+% |\DeclareCaptionJustification|\marg{name}\marg{code}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionJustification[2]{%
+ \global\@namedef{caption@hj@#1}{#2}% for compatibility to v1.0
+ \DeclareCaptionFont{#1}{#2}}
+\@onlypreamble\DeclareCaptionJustification
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionDefaultJustification}
+% \changes{v1.1}{2007/07/03}{This macro added}
+% \changes{v1.2a}{2008/01/31}{Renamed from \cs{DeclareDefaultCaptionJustification} to \cs{DeclareCaptionDefaultJustification}}
+% |\DeclareCaptionDefaultJustification|\marg{code}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionDefaultJustification[1]{%
+ \global\@namedef{caption@hj@default}{#1}% for compatibility to v1.0
+ \DeclareCaptionDefaultFont{@hj}{#1}}
+\@onlypreamble\DeclareCaptionDefaultJustification
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{justification}{\caption@setjustification{#1}}
+\DeclareCaptionDefaultJustification{}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setjustification}
+% \changes{v1.1}{2007/07/03}{Mapped to \cs{caption@setfont}}
+% |\caption@setjustification|\marg{name}\par
+% Selecting a caption justification simply means saving the code (in |\caption@hj|).
+% \begin{macrocode}
+\newcommand*\caption@setjustification{\caption@setfont{@hj}}
+% \end{macrocode}
+% \end{macro}
+%
+% These are the pre-defined justification code snippets.
+% \begin{macrocode}
+\DeclareCaptionJustification{justified}{}
+\DeclareCaptionJustification{centering}{\centering}
+\DeclareCaptionJustification{centerfirst}{\centerfirst}
+\DeclareCaptionJustification{centerlast}{\centerlast}
+\DeclareCaptionJustification{raggedleft}{\raggedleft}
+\DeclareCaptionJustification{raggedright}{\raggedright}
+% \end{macrocode}
+%
+% \begin{macro}{\centerfirst}
+% \changes{v1.0j}{2007/01/21}{Bugfix: Usage of \cs{@centercr} added (Thanks to Olga!)}
+% \changes{v1.0j}{2007/01/21}{This macro renamed from \cs{caption@centerfirst} to \cs{centerfirst}}
+% Please blame Frank Mittelbach for the code of |\centerfirst| |:-)|
+% \begin{macrocode}
+\providecommand\centerfirst{%
+ \let\\\@centercr
+ \edef\caption@normaladjust{%
+ \leftskip\the\leftskip
+ \rightskip\the\rightskip
+ \parfillskip\the\parfillskip\relax}%
+ \leftskip\z@\@plus -1fil%
+ \rightskip\z@\@plus 1fil%
+ \parfillskip\z@skip
+ \noindent\hskip\z@\@plus 2fil%
+ \@setpar{\@@par\@restorepar\caption@normaladjust}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\centerlast}
+% \changes{v1.0j}{2007/01/21}{Bugfix: Usage of \cs{@centercr} added (Thanks to Olga!)}
+% \changes{v1.0j}{2007/01/21}{This macro renamed from \cs{caption@centerlast} to \cs{centerlast}}
+% This is based on code from Anne Br\"uggemann-Klein\cite{Anne}
+% \begin{macrocode}
+\providecommand\centerlast{%
+ \let\\\@centercr
+ \leftskip\z@\@plus 1fil%
+ \rightskip\z@\@plus -1fil%
+ \parfillskip\z@\@plus 2fil\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{The ragged2e package}
+% \changes{v1.0b}{2004/05/16}{Improved \package{ragged2e} package support}
+%
+% We also support the upper-case commands offered by the \package{ragged2e}
+% package.
+% Note that these just map to their lower-case variants if the
+% \package{ragged2e} package is not available.
+% \begin{macrocode}
+\DeclareCaptionJustification{Centering}{%
+ \caption@ragged\Centering\centering}
+\DeclareCaptionJustification{RaggedLeft}{%
+ \caption@ragged\RaggedLeft\raggedleft}
+\DeclareCaptionJustification{RaggedRight}{%
+ \caption@ragged\RaggedRight\raggedright}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@ragged}
+% \changes{v1.0n}{2007/04/07}{The `ragged2e' package will now only been
+% loaded when needed}
+% \changes{v1.0o}{2007/04/11}{Bugfix: Usage of \cs{caption@Info} replaced
+% by \cs{caption@Debug}}
+% \changes{v1.1}{2007/04/16}{A different warning will be given on first \LaTeX\ run}
+% |\caption@ragged| will be basically defined as
+% \begin{quote}
+% |\AtBeginDocument{\IfFileExists{ragged2e.sty}%|\\
+% | {\RequirePackage{ragged2e}\let\caption@ragged\@firstoftwo}%|\\
+% | {\let\caption@ragged\@secondoftwo}}|
+% \end{quote}
+% but with an additional warning if the ragged2e package is not loaded (yet).
+% (This warning will be type out only one time per option, that's why
+% we need the |caption\string#1| stuff.)
+% Furthermore we load the \package{ragged2e} package, if needed and available.
+% \begin{macrocode}
+\newcommand*\caption@ragged{%
+ \caption@Debug{We need ragged2e}%
+ \protected@write\@auxout{}{\string\caption@newlabel{ragged2e}{}}%
+ \global\let\caption@ragged\caption@@ragged
+ \caption@ragged}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \@ifundefined{caption@r@ragged2e}{%
+ \newcommand*\caption@@ragged{%
+ \caption@Warning{%
+ `ragged2e' support has been changed.\MessageBreak
+ Rerun to get captions right}%
+ \global\let\caption@ragged\@secondoftwo % suppress further warnings
+ \caption@ragged}%
+ }{%
+ \caption@Debug{We load ragged2e}%
+ \IfFileExists{ragged2e.sty}{%
+ \RequirePackage{ragged2e}%
+ \let\caption@@ragged\@firstoftwo
+ }{%
+ \newcommand*\caption@@ragged[2]{%
+ \@ifundefined{caption\string#1}{%
+ \caption@Warning{%
+ `ragged2e' package not loaded, therefore\MessageBreak
+ substituting \string#2 for \string#1\MessageBreak}%
+ \global\@namedef{caption\string#1}}{}%
+ #2}%
+ }%
+ }}
+% \end{macrocode}
+% \begin{macrocode}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Vertical spaces before and after captions}
+%
+% \begin{macro}{\abovecaptionskip}
+% \begin{macro}{\belowcaptionskip}
+% Usually these skips are defined within the document class, but some
+% document classes don't do so.
+% \begin{macrocode}
+\caption@ifundefined\abovecaptionskip{%
+ \newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@}}{}
+\caption@ifundefined\belowcaptionskip{%
+ \newlength\belowcaptionskip\setlength\belowcaptionskip{0\p@}}{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \changes{v1.0c}{2005/02/12}{Option \opt{skip=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{aboveskip}{\setlength\abovecaptionskip{#1}}
+\DeclareCaptionOption{belowskip}{\setlength\belowcaptionskip{#1}}
+\DeclareCaptionOption{skip}{\setlength\abovecaptionskip{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@rule}
+% \changes{v1.2b}{2008/05/06}{This macro added}
+% |\caption@rule|\par
+% Draws an invisible rule to adjust the ``skip'' setting.
+% \begin{macrocode}
+\newcommand*\caption@rule{\caption@ifrule\caption@hrule\relax}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@hrule{\hrule\@height\z@}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.2b}{2008/05/06}{Option \opt{rule=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{rule}[1]{\caption@set@bool\caption@ifrule{#1}}
+% \end{macrocode}
+%
+% \subsection{Positioning}
+%
+% These macros handle the right position of the caption.
+% Note that the position is actually \emph{not} controlled by the
+% \package{caption3} kernel options, but by the user (or a specific package
+% like the \package{float} package) instead.
+% The user can put the |\caption| command wherever he likes! So this stuff
+% is only to give us a \emph{hint} where to put the right skips, the user
+% usually has to take care for himself that this hint actually matches the
+% right position.
+%
+% \begin{macrocode}
+\DeclareCaptionOption{position}{\caption@setposition{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setposition}
+% \changes{v1.0a}{2004/01/22}{Now the positions \opt{t}, \opt{above}, \opt{b},
+% \opt{below}, and \opt{a} are allowed, too}
+% \changes{v1.0c}{2004/08/10}{Usage of \cs{caption@defaultpos} added}
+% |\caption@setposition|\marg{position}\par
+% Selecting the caption position means that we put |\caption@position| to
+% the right value. \emph{Please do \textbf{not} use the internal macro
+% \cs{caption@position} in your own package or document, but use the wrapper
+% macro \cs{caption@iftop} instead.}
+% \begin{macrocode}
+\newcommand*\caption@setposition[1]{%
+ \caption@ifinlist{#1}{d,default}{%
+ \let\caption@position\caption@defaultpos
+ }{\caption@ifinlist{#1}{t,top,above}{%
+ \let\caption@position\@firstoftwo
+ }{\caption@ifinlist{#1}{b,bottom,below}{%
+ \let\caption@position\@secondoftwo
+ }{\caption@ifinlist{#1}{a,auto}{%
+ \let\caption@position\@undefined
+ }{%
+ \caption@Error{Undefined position `#1'}%
+ }}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@defaultpos}
+% \changes{v1.1}{2007/05/08}{Default position changed from `bottom' to `auto'}
+% The default `position' is `auto', this means that \thispackage\ will try
+% to guess the current position of the caption.
+% (But in many cases, for example in |longtable|s, this is doomed to fail!)\par
+% The setting `bottom' correspondents to the |\@makecaption| implementation
+% in the standard \LaTeX\ document classes, but `auto' should give better
+% results in most cases.
+% \begin{macrocode}
+%\caption@setdefaultpos{a}% default = auto
+\let\caption@defaultpos\@undefined
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@iftop}
+% \changes{v1.0a}{2004/01/23}{Split into \cs{caption@iftop} \& \cs{caption@fixposition}}
+% \changes{v1.0c}{2005/02/12}{Adapted to \cs{caption@defaultpos}}
+% \changes{v1.1}{2007/05/08}{Position will be fixed to `bottom' if `auto'}
+% |\caption@iftop|\marg{true-code}\marg{false-code}\par
+% (If the |position=| is set to |auto| we assume a |bottom| position here.)
+% \begin{macrocode}
+\newcommand*\caption@iftop{%
+ \ifx\caption@position\@undefined
+ \let\caption@position\@secondoftwo
+% = \caption@setposition b%
+ \fi
+ \caption@position}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@fixposition}
+% \changes{v1.0b}{2004/05/16}{%
+% Split into \cs{caption@fixposition} & \cs{caption@autoposition}}
+% |\caption@fixposition|\par
+% This macro checks if the `position' is set to `auto'.
+% If yes, |\caption@autoposition| will be called to
+% set |\caption@position| to a proper value we can actually use.
+% \begin{macrocode}
+\newcommand*\caption@fixposition{%
+ \ifx\caption@position\@undefined
+ \caption@autoposition
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@autoposition}
+% \changes{v1.0a}{2004/01/23}{\cs{ifvmode} added}
+% |\caption@autoposition|\par
+% We guess the current position of the caption by checking |\prevdepth|.\par
+% A different solution would be setting the |\spacefactor| to something
+% not much less than 1000 (for example 994) in |\caption@start| and
+% checking this value here by |\ifnum\spacefactor=994|.
+% (It's implemented in the \package{threeparttable}
+% package\cite{threeparttable} this way.)\par
+% Another idea would be checking |\@ifminipage|, but since some packages
+% typeset the caption within a simple |\vbox| this does not seem to be a
+% good one.
+% \begin{macrocode}
+\newcommand*\caption@autoposition{%
+ \ifvmode
+ \edef\caption@tempa{\the\prevdepth}%
+ \caption@Debug{\protect\prevdepth=\caption@tempa}%
+ \ifdim\prevdepth>-\p@
+ \let\caption@position\@secondoftwo
+ \else
+ \let\caption@position\@firstoftwo
+ \fi
+% = \caption@setposition{\ifdim\prevdepth>-\p@ b\else t\fi}%
+ \else
+ \caption@Debug{no \protect\prevdepth}%
+ \let\caption@position\@secondoftwo
+% = \caption@setposition b%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@setautoposition}
+% \changes{v1.1}{2007/06/10}{This macro added}
+% |\caption@setautoposition|\marg{position}\par
+% replaces the above algorithm by a different one (or a fixed position setting).
+% \begin{macrocode}
+\newcommand*\caption@setautoposition[1]{%
+ \def\caption@autoposition{\caption@setposition{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Hooks}
+%
+% \begin{macro}{\AtBeginCaption}
+% \begin{macro}{\AtEndCaption}
+% |\AtBeginCaption| \marg{code}\\
+% |\AtEndCaption| \marg{code}\par
+% These hooks can be used analogous to |\AtBeginDocument| and |\AtEndDocument|.
+% \begin{macrocode}
+\newcommand*\caption@beginhook{}
+\newcommand*\caption@endhook{}
+\newcommand*\AtBeginCaption{\l@addto@macro\caption@beginhook}
+\newcommand*\AtEndCaption{\l@addto@macro\caption@endhook}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Lists}
+%
+% \changes{v1.0b}{2004/05/16}{Option \opt{listof=} added}
+% \changes{v1.2}{2007/11/17}{Option \opt{list=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{list}[1]{\caption@setlist{#1}}
+\DeclareCaptionOption{listof}[1]{\caption@setlist{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlist}
+% \changes{v1.2a}{2008/03/20}{This macro added}
+% |\caption@setlist|\marg{boolean}
+% \begin{macrocode}
+\newcommand*\caption@setlist{\caption@set@bool\caption@iflist}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.4}{2011/08/30}{Option \opt{listtype=} added}
+% \changes{v1.4}{2011/08/30}{Option \opt{listtype+=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{listtype}{\caption@setlisttype{#1}}
+\DeclareCaptionOption{listtype+}{\caption@setlisttype@ext{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlisttype}
+% \changes{v1.4}{2011/08/30}{This macro added}
+% |\caption@setlisttype|\marg{type}
+% \begin{macrocode}
+\newcommand*\caption@setlisttype{%
+ \caption@setlisttype@ext{}%
+ \caption@@setlisttype\caption@listtype}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setlisttype[2]{%
+ \edef#1{#2}%
+ \ifx#1\@empty \let#1\@undefined \fi}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@setlisttype@ext}
+% \changes{v1.4}{2011/08/30}{This macro added}
+% |\caption@setlisttype@ext|\marg{type extension}
+% \begin{macrocode}
+\newcommand*\caption@setlisttype@ext{%
+ \caption@@setlisttype\caption@listtype@ext}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionListFormat}
+% \changes{v1.1}{2004/07/15}{This macro added}
+% \changes{v1.2}{2007/11/17}{Renamed from \cs{DeclareCaptionListOfFormat} to \cs{DeclareCaptionListFormat}}
+% |\DeclareCaptionListFormat|\marg{name}\marg{code with \#1 and \#2}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionListFormat[2]{%
+ \global\@namedef{caption@lstfmt@#1}##1##2{#2}}
+\@onlypreamble\DeclareCaptionListFormat
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.1}{2007/07/15}{Option \opt{listofformat=} added}
+% \changes{v1.2}{2007/11/17}{Option \opt{listofformat=} renamed to \opt{listformat=}}
+% \begin{macrocode}
+\DeclareCaptionOption{listformat}{\caption@setlistformat{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlistformat}
+% \changes{v1.1}{2004/07/15}{This macro added}
+% \changes{v1.2}{2007/11/17}{Renamed from \cs{caption@setlistofformat} to \cs{caption@setlistformat}}
+% |\caption@setlistformat|\marg{name}\par
+% Selecting a caption list format simply means saving the code (in |\caption@lstfmt|).
+% \begin{macrocode}
+\newcommand*\caption@setlistformat[1]{%
+ \@ifundefined{caption@lstfmt@#1}%
+ {\caption@Error{Undefined list format `#1'}}%
+ {\expandafter\let\expandafter\caption@lstfmt
+ \csname caption@lstfmt@#1\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% There are five pre-defined list formats, taken from the \package{subfig} package.
+% \begin{macrocode}
+\DeclareCaptionListFormat{empty}{}
+\DeclareCaptionListFormat{simple}{#1#2}
+\DeclareCaptionListFormat{parens}{#1(#2)}
+\DeclareCaptionListFormat{subsimple}{#2}
+\DeclareCaptionListFormat{subparens}{(#2)}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setdefaultlistformat}
+% \changes{v1.2d}{2009/03/29}{This macro added}
+% \begin{macrocode}
+\newcommand*\caption@setdefaultlistformat[1]{%
+ \ifx\caption@lstfmt\caption@lstfmt@default
+ \caption@set@default@listformat{#1}%
+ \caption@setlistformat{default}%
+ \else
+ \caption@set@default@listformat{#1}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@set@default@listformat[1]{%
+ \def\caption@lstfmt@default{\@nameuse{caption@lstfmt@#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% `default' usually maps to `subsimple'.
+% \begin{macrocode}
+\caption@set@default@listformat{subsimple}
+% \end{macrocode}
+%
+% \subsection{Debug option}
+% \changes{v1.0k}{2007/03/04}{Debug option added}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{debug}[1]{%
+ \caption@set@bool\caption@ifdebug{#1}%
+ \caption@ifdebug
+ {\let\caption@Debug\caption@Info}%
+ {\let\caption@Debug\@gobble}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareOption{debug}{\setkeys{caption}{debug}}
+% \end{macrocode}
+% \begin{macrocode}
+\setkeys{caption}{debug=0}
+% \end{macrocode}
+%
+% \subsection{Document classes \& Babel support}
+%
+% \subsubsection{The standard \texorpdfstring{\LaTeX{}}{LaTeX} classes}
+%
+% \begin{macrocode}
+\caption@CheckCommand\@makecaption{%
+ % article|report|book [2005/09/16 v1.4f Standard LaTeX document class]
+ \long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1: #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ #1: #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}}
+% \end{macrocode}
+%
+% \subsubsection{The \AmS{} \& \SmF{} classes}
+% \changes{v1.1}{2007/07/29}{\AmS\ \& \SmF\ classes support added}
+%
+% \begin{macro}{\caption@ifamsclass}
+% \begin{macrocode}
+\providecommand*\caption@ifamsclass{%
+ \caption@ifundefined\@captionheadfont\@gobble\@firstofone}
+\@onlypreamble\caption@ifamsclass
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@ifamsclass{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % amsart|amsproc|amsbook [2004/08/06 v2.20]
+ \long\def\@makecaption#1#2{%
+ \setbox\@tempboxa\vbox{\color@setgroup
+ \advance\hsize-2\captionindent\noindent
+ \@captionfont\@captionheadfont#1\@xp\@ifnotempty\@xp
+ {\@cdr#2\@nil}{.\@captionfont\upshape\enspace#2}%
+ \unskip\kern-2\captionindent\par
+ \global\setbox\@ne\lastbox\color@endgroup}%
+ \ifhbox\@ne % the normal case
+ \setbox\@ne\hbox{\unhbox\@ne\unskip\unskip\unpenalty\unkern}%
+ \fi
+ \ifdim\wd\@tempboxa=\z@ % this means caption will fit on one line
+ \setbox\@ne\hbox to\columnwidth{\hss\kern-2\captionindent\box\@ne\hss}%
+ \else % tempboxa contained more than one line
+ \setbox\@ne\vbox{\unvbox\@tempboxa\parskip\z@skip
+ \noindent\unhbox\@ne\advance\hsize-2\captionindent\par}%
+ \fi
+ \ifnum\@tempcnta<64 % if the float IS a figure...
+ \addvspace\abovecaptionskip
+ \hbox to\hsize{\kern\captionindent\box\@ne\hss}%
+ \else % if the float IS NOT a figure...
+ \hbox to\hsize{\kern\captionindent\box\@ne\hss}%
+ \nobreak
+ \vskip\belowcaptionskip
+ \fi
+ \relax
+ }}
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % smfart|smfbook [1999/11/15 v1.2f Classe LaTeX pour les articles publies par la SMF]
+ \long\def\@makecaption#1#2{%
+ \ifdim\captionindent>.1\hsize \captionindent.1\hsize \fi
+ \setbox\@tempboxa\vbox{\color@setgroup
+ \advance\hsize-2\captionindent\noindent
+ \@captionfont\@captionheadfont#1\@xp\@ifnotempty\@xp
+ {\@cdr#2\@nil}{\@addpunct{.}\@captionfont\upshape\enspace#2}%
+ \unskip\kern-2\captionindent\par
+ \global\setbox\@ne\lastbox\color@endgroup}%
+ \ifhbox\@ne % the normal case
+ \setbox\@ne\hbox{\unhbox\@ne\unskip\unskip\unpenalty\unkern}%
+ \fi
+ \ifdim\wd\@tempboxa=\z@ % this means caption will fit on one line
+ \setbox\@ne\hbox to\columnwidth{\hss\kern-2\captionindent\box\@ne\hss}%
+ \@tempdima\wd\@ne\advance\@tempdima-\captionindent
+ \wd\@ne\@tempdima
+ \else % tempboxa contained more than one line
+ \setbox\@ne\vbox{\rightskip=0pt plus\captionindent\relax
+ \unvbox\@tempboxa\parskip\z@skip
+ \noindent\unhbox\@ne\advance\hsize-2\captionindent\par}%
+ \fi
+ \ifnum\@tempcnta<64 % if the float IS a figure...
+ \addvspace\abovecaptionskip
+ \noindent\kern\captionindent\box\@ne
+ \else % if the float IS NOT a figure...
+ \noindent\kern\captionindent\box\@ne
+ \nobreak
+ \vskip\belowcaptionskip
+ \fi
+ \relax
+ }}
+% \end{macrocode}
+% \begin{macrocode}
+ \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
+ \caption@ifundefined\smf@makecaption{}{,maxmargin=.1\linewidth}}}
+ \@tempa
+ \caption@g@addto@list\caption@sls@default{margin*=.5\captionmargin}
+ \DeclareCaptionLabelSeparator{default}{.\enspace}
+ \DeclareCaptionDefaultFont{font}{\@captionfont}
+ \DeclareCaptionDefaultFont{labelfont}{\@captionheadfont}
+ \DeclareCaptionDefaultFont{textfont}{\@captionfont\upshape}
+ \captionsetup[figure]{position=b}
+ \captionsetup[table]{position=t}
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection{The beamer class (Part one)}
+% \changes{v1.1}{2007/03/10}{beamer class support added}
+% \changes{v1.3}{2011/08/06}{beamer class support revised}
+%
+% \begin{macro}{\caption@ifbeamerclass}
+% \begin{macrocode}
+\providecommand*\caption@ifbeamerclass{%
+ \@ifclassloaded{beamer}\@firstofone\@gobble}
+\@onlypreamble\caption@ifbeamerclass
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@ifbeamerclass{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\beamer@makecaption{%
+ % beamerbaselocalstructure.sty,v 1.53 2007/01/28 20:48:21 tantau
+ \long\def\beamer@makecaption#1#2{%
+ \def\insertcaptionname{\csname#1name\endcsname}%
+ \def\insertcaptionnumber{\csname the#1\endcsname}%
+ \def\insertcaption{#2}%
+ \nobreak\vskip\abovecaptionskip\nobreak
+ \sbox\@tempboxa{\usebeamertemplate**{caption}}%
+ \ifdim \wd\@tempboxa >\hsize
+ \usebeamertemplate**{caption}\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \nobreak\vskip\belowcaptionskip\nobreak}}
+% \end{macrocode}
+% \begin{macro}{\caption@ifbeamertemplate}
+% \begin{macrocode}
+\newcommand*\caption@ifbeamertemplate[1]{%
+ \begingroup
+ \let\beamer@@tmpl@caption@ORI\beamer@@tmpl@caption
+ \@nameuse{beamer@@tmpop@caption@#1}%
+ \ifx\beamer@@tmpl@caption@ORI\beamer@@tmpl@caption
+ \endgroup\expandafter\@firstoftwo
+ \else
+ \endgroup\expandafter\@secondoftwo
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ \DeclareCaptionLabelFormat{default}{%
+ #1\caption@ifbeamertemplate{numbered}{~#2}{}}
+ \caption@declarelabelseparator
+ {\caption@ifbeamertemplate{caption name own line}\@gobble\@firstofone}
+ {default}
+ {\caption@ifbeamertemplate{caption name own line}{\\}{: }}
+ \DeclareCaptionDefaultFont{font}{%
+ \usebeamerfont*{caption}%
+ \usebeamercolor[fg]{caption}}
+ \DeclareCaptionDefaultFont{labelfont}{%
+ \usebeamercolor[fg]{caption name}%
+ \usebeamerfont*{caption name}}
+ \DeclareCaptionDefaultJustification{\raggedright}
+ \DeclareOption{beamerclass}{%
+ \renewcommand\caption@ifslc{%
+ \caption@ifbeamertemplate{caption name own line}\@secondoftwo\@firstoftwo}
+ % Since the beamer class do not offer a `list of figures' we switch this support off.
+ \captionsetup{list=0}}
+ \PassOptionsToPackage{beamerclass}{caption3}
+% \end{macrocode}
+%
+% If the \package{beamer} document class is used, we offer a beamer
+% template called `caption3' which can be used with option `beamer' or
+% |\setbeamertemplate{caption}[caption3]|.\par
+% (Note that this is of no use when the \package{caption} package is used, too.)
+% \begin{macrocode}
+ \defbeamertemplate{caption}{caption3}{%
+ \caption@make\insertcaptionname\insertcaptionnumber\insertcaption}
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareOption{beamer}{%
+ % \usebeamertemplate**{caption} will set font
+ \DeclareCaptionDefaultFont{font}{}%
+ \setbeamertemplate{caption}[caption3]}
+% \end{macrocode}
+% \begin{macrocode}
+%
+% \begin{macrocode]
+}
+% \end{macrocode}
+%
+% \subsubsection{The KOMA-Script classes}
+% \changes{v1.1}{2007/03/31}{\KOMAScript\ classes support added}
+%
+% \begin{macro}{\caption@ifkomaclass}
+% \begin{macrocode}
+\providecommand*\caption@ifkomaclass{%
+ \caption@ifundefined\scr@caption\@gobble\@firstofone}
+\@onlypreamble\caption@ifkomaclass
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@ifkomaclass{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % scrartcl|scrreprt|scrbook [2007/03/07 v2.97a KOMA-Script document class]
+ \long\def\@makecaption#1#2{%
+ \if@captionabove
+ \vskip\belowcaptionskip
+ \else
+ \vskip\abovecaptionskip
+ \fi
+ \@@makecaption\@firstofone{#1}{#2}%
+ \if@captionabove
+ \vskip\abovecaptionskip
+ \else
+ \vskip\belowcaptionskip
+ \fi}}
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionFormat{default}[#1#2#3\par]{%
+ \ifdofullc@p
+ \caption@ifin@list\caption@lsepcrlist\caption@lsepname
+ {\caption@Error{%
+ The option `labelsep=\caption@lsepname' does not work\MessageBreak
+ with \noexpand\setcaphanging (which is set by default)}}%
+ {\caption@fmt@hang{#1}{#2}{#3}}%
+ \else
+ #1#2%
+ \ifdim\cap@indent<\z@
+ \par
+ \noindent\hspace*{-\cap@indent}%
+ \else\if@capbreak
+ \par
+ \fi\fi
+ #3\par
+ \fi}
+ \DeclareCaptionLabelSeparator{default}{\captionformat}
+ \DeclareCaptionDefaultFont{font}{\scr@fnt@caption}
+ \DeclareCaptionDefaultFont{labelfont}{\scr@fnt@captionlabel}
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection{The \NTG{} Dutch classes}
+% \changes{v1.1}{2007/04/06}{NTG classes support added}
+%
+% \begin{macro}{\caption@ifntgclass}
+% \begin{macrocode}
+\providecommand*\caption@ifntgclass{%
+ \caption@ifundefined\CaptionFonts\@gobble\@firstofone}
+\@onlypreamble\caption@ifntgclass
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@ifntgclass{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % artikel|rapport|boek [2004/06/07 v2.1a NTG LaTeX document class]
+ \long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{{\CaptionLabelFont#1:} \CaptionTextFont#2}%
+ \ifdim \wd\@tempboxa >\hsize
+ {\CaptionLabelFont#1:} \CaptionTextFont#2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}}
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionDefaultFont{labelfont}{\CaptionLabelFont}
+ \DeclareCaptionDefaultFont{textfont}{\CaptionTextFont}
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection{The thesis class}
+% \changes{v1.2a}{2008/01/31}{thesis class support added}
+% \changes{v1.2e}{2009/11/15}{Bugfix 09-11-14: thesis class support revised}
+%
+% \begin{macro}{\caption@ifthesisclass}
+% \begin{macrocode}
+\providecommand*\caption@ifthesisclass{%
+ \caption@ifundefined\cph@font
+ {\@gobble}%
+ {\caption@ifundefined\cpb@font\@gobble\@firstofone}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@ifthesisclass{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % thesis.cls 1996/25/01 1.0g LaTeX document class (wm).
+ \long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \setbox\@tempboxa\hbox{{\cph@font #1:} {\cpb@font #2}}%
+ \ifdim \wd\@tempboxa >\hsize
+ \@hangfrom{\cph@font #1: }{\cpb@font #2\par}%
+ \else
+ \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}}
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionDefaultFormat{hang}
+ \DeclareCaptionDefaultFont{labelfont}{\cph@font}
+ \DeclareCaptionDefaultFont{textfont}{\cpb@font}
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection{The frenchb Babel option}
+% \changes{v1.1}{2006/05/14}{\package{frenchb} package support added}
+%
+% \begin{macrocode}
+\caption@ifundefined\FB@makecaption{}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % frenchb.ldf [2005/02/06 v1.6g French support from the babel system]
+ % frenchb.ldf [2007/10/05 v2.0e French support from the babel system]
+ \long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1\CaptionSeparator #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ #1\CaptionSeparator #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}}
+% \end{macrocode}
+% \begin{macrocode}
+ \ifx\@makecaption\STD@makecaption
+ \DeclareCaptionLabelSeparator{default}{\CaptionSeparator}
+ \def\caption@frenchb{% supress frenchb warning
+ \let\STD@makecaption\@makecaption
+ \let\FB@makecaption\@makecaption}
+ \else
+ \ifx\@makecaption\@undefined\else
+ \caption@InfoNoLine{%
+ The definition of \protect\@makecaption\space
+ has been changed,\MessageBreak
+ frenchb will NOT customize it}%
+ \fi
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection{The frenchle/pro package}
+% \changes{v1.1}{2006/05/14}{\package{frenchle/pro} package support added}
+%
+% \begin{macrocode}
+\caption@ifundefined\frenchTeXmods{}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % french(le).sty [2006/10/03 The french(le) package /V5,9991/]
+ % french(le).sty [2007/06/28 The french(le) package /V5,9994/]
+ \def\@makecaption#1#2{%
+ \ifFTY%
+ \def\@secondofmany##1##2\void{##2}%
+ \def\@tempa{\@secondofmany#2\void}%
+ \ifx\@tempa\empty%
+ \let\captionseparator\empty%
+ \fi%
+ \@mcORI{#1}{\relax\captionfont{#2}}%
+ \else
+ \@mcORI{#1}{#2}%
+ \fi}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % french(le).sty [2007/02/11 The french(le) package /V5,9993/]
+ \def\@makecaption#1#2{%
+ \ifFTY%
+ \def\@secondofmany##1##2\void{##2}%
+ \protected@edef\@tempa{\@secondofmany#2\void}%
+ \ifx\@tempa\empty%
+ \let\captionseparator\empty%
+ \fi%
+ \@mcORI{#1}{\relax\captionfont{#2}}%
+ \else
+ \@mcORI{#1}{#2}%
+ \fi}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionDefaultFont{textfont}{\itshape}%
+ \DeclareCaptionLabelSeparator{default}{\captionseparator\space}%
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection{The hungarian and magyar Babel option}
+% \changes{v1.3}{2009/03/29}{\package{magyar} package support added}
+% \changes{v1.3a}{2011/08/12}{\package{magyar} package support revised}
+%
+% \begin{macrocode}
+\DeclareCaptionListFormat{subperiod}{#2.}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\caption@ifundefined\hunnewlabel{}{%
+ \caption@CheckCommand\@makecaption{%
+ % magyar.ldf [2005/03/30 v1.4j Magyar support from the babel system]
+ \def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1. #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ {#1. #2\csname par\endcsname}
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\caption@tempa#1{\@ifundefined{extras#1}{}{%
+ \expandafter\addto\csname extras#1\endcsname{%
+ % change default labelsep and listformat
+ \caption@setdefaultlabelsep{period}%
+ \caption@setdefaultlistformat{subperiod}}%
+ \expandafter\addto\csname noextras#1\endcsname{%
+ % change default labelsep and listformat
+ \caption@setdefaultlabelsep{colon}%
+ \caption@setdefaultlistformat{subsimple}}%
+% \end{macrocode}
+% \begin{macrocode}
+}}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@tempa{hungarian}
+\caption@tempa{magyar}
+% \end{macrocode}
+%
+% \subsubsection{Unknown document class (or package)}
+% \changes{v1.1}{2007/04/10}{Check of document class added}
+%
+% \begin{macrocode}
+\caption@IfCheckCommand{%
+ \caption@setbool{documentclass}{1}%
+}{%
+ \caption@setbool{documentclass}{0}%
+ \caption@InfoNoLine{%
+ Unknown document class (or package),\MessageBreak
+ standard defaults will be used}%
+ \caption@Debug{\string\@makecaption\space=\space\meaning\@makecaption\@gobble}%
+}
+% \end{macrocode}
+%
+% \subsection{Execution of options}
+%
+% \begin{macrocode}
+\captionsetup{style=default,position=default,%
+ list,listformat=default,twoside=\if@twoside 1\else 0\fi}
+% \end{macrocode}
+% \begin{macrocode}
+\ProcessOptions*
+% \end{macrocode}
+%
+% \subsection{Making an `List of' entry}
+%
+% \begin{macro}{\caption@addcontentsline}
+% \changes{v1.1}{2007/07/01}{This macro added}
+% \changes{v1.3}{2010/10/26}{Error check added}
+% \changes{v1.3}{2011/06/24}{Split into two macros}
+% \changes{v1.4}{2011/08/19}{Split into three macros}
+% \changes{v1.4}{2011/08/30}{Support for option \opt{listtype=} added}
+% |\caption@addcontentsline|\marg{type}\marg{list entry}\par
+% Makes an entry in the list-of-whatever, if requested,
+% i.e.~the argument \meta{list entry} is not empty and
+% |listof=| was set to |true|.
+% \begin{macrocode}
+\newcommand\caption@addcontentsline[2]{%
+ \caption@ifcontentsline{#2}{%
+ \begingroup
+ \let\@tempa\@gobble
+ \caption@ifundefined\caption@listtype
+ {\edef\caption@listtype{#1}}%
+ {\let\@tempa\@firstofone}%
+ \caption@ifundefined\caption@listtype@ext
+ {}%
+ {\edef\caption@listtype{\caption@listtype\caption@listtype@ext}%
+ \let\@tempa\@firstofone}%
+ \@tempa
+ {\caption@Debug{addcontentsline: #1 => \caption@listtype}%
+% \caption@setoptions*\caption@listtype
+ \@namedef{the\caption@listtype}{\@nameuse{the#1}}}%
+ \expandafter\caption@@addcontentsline\expandafter{\caption@listtype}{#2}%
+ \endgroup}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@@addcontentsline[2]{%
+ {\let\\\space
+ \@ifundefined{ext@#1}%
+ {\caption@Error{No float type '#1' defined}}%
+ {\caption@@@addcontentsline
+ {\csname ext@#1\endcsname}%
+ {#1}%
+ {\caption@lstfmt{\@nameuse{p@#1}}{\@nameuse{the#1}}}%
+ {\ignorespaces #2}}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@addcontentsline[4]{%
+ \addcontentsline{#1}{#2}{\protect\numberline{#3}{#4}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@ifcontentsline[1]{%
+ \caption@iflist
+ {\def\@tempa{#1}}%
+ {\let\@tempa\@empty}%
+ \ifx\@tempa\@empty
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Typesetting the caption}
+%
+% \begin{macro}{\ifcaption@star}
+% If the starred form of |\caption| is used, this will be set to |true|.
+% (It will be reset to |false| at the end of |\caption@@make|.)
+% \begin{macrocode}
+\newif\ifcaption@star
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@fnum}
+% \changes{v1.1}{2007/08/21}{This macro added}
+% |\caption@fnum|\marg{float type}\par
+% Typesets the caption label; as replacement for |\fnum@|\meta{float type}.
+% \begin{macrocode}
+\newcommand*\caption@fnum[1]{\caption@lfmt{\@nameuse{#1name}}{\@nameuse{the#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@make}
+% |\caption@make|\marg{float name}\marg{ref.\ number}\marg{text}\par
+% Typesets the caption.
+% \begin{macrocode}
+\newcommand\caption@make[2]{\caption@@make{\caption@lfmt{#1}{#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@make}
+% \changes{v1.0b}{2004/05/16}{Bugfix 04-05-05: \cs{ifdim}\cs{captionindent=}\cs{z@} added}
+% \changes{v1.0c}{2005/02/12}{Bugfix 04-10-26: Use \cs{@tempdima} instead of
+% \cs{captionmargin} resp. \cs{captionwidth}; check for \cs{z@} added}
+% \changes{v1.0c}{2005/02/12}{Bugfix: \cs{hskip}\cs{captionmargin} to the end
+% of caption added}
+% \changes{v1.0c}{2005/02/12}{Bugfix: \cs{strut} moved from here to \cs{caption@@@make}}
+% \changes{v1.0c}{2005/02/12}{Single-line-check moved up so it can affect margins now}
+% \changes{v1.0c}{2005/02/09}{Improvement: \cs{caption@ifh} added}
+% \changes{v1.0c}{2005/02/09}{Bugfix: \cs{leavevmode} added}
+% \changes{v1.0f}{2005/08/24}{Uses \cs{sbox} instead of \cs{setbox} in single-line-check}
+% \changes{v1.0g}{2005/12/04}{Uses \cs{caption@slc} now}
+% \changes{v1.0g}{2006/01/11}{Bugfix: \cs{caption@calcmargin} inside
+% single-line-check replaced by \cs{relax}}
+% \changes{v1.0g}{2006/01/11}{Bugfix: \cs{caption@startbox} will always be
+% typeset in horizontal mode}
+% \changes{v1.0i}{2006/05/13}{Uses \cs{caption@parbox} instead of \cs{caption@start/endbox}}
+% \changes{v1.0j}{2007/01/04}{Oops, bugfix 04-05-05 got lost in v1.0h, re-added}
+% \changes{v1.0n}{2007/04/03}{Usage of \cs{caption@ifoddpage} added}
+% \changes{v1.1}{2007/07/29}{\cs{caption@calcmargin} moved below single-line-check}
+% \changes{v1.1e}{2007/10/28}{\cs{caption@stepcounter} added}
+% |\caption@@make|\marg{caption label}\marg{caption text}
+% \begin{macrocode}
+\newcommand\caption@@make[2]{%
+ \begingroup
+ \caption@stepcounter
+ \caption@beginhook
+% \end{macrocode}
+%
+% Check margin, if |\caption@minmargin| or |\caption@maxmargin| is set
+% \begin{macrocode}
+% TODO: Move this to \caption@calcmargin!?
+ \ifx\caption@maxmargin\@undefined \else
+ \ifdim\captionmargin>\caption@maxmargin\relax
+ \captionmargin\caption@maxmargin\relax
+ \fi
+ \fi
+ \ifx\caption@minmargin\@undefined \else
+ \ifdim\captionmargin<\caption@minmargin\relax
+ \captionmargin\caption@minmargin\relax
+ \fi
+ \fi
+% \end{macrocode}
+%
+% Special single-line treatment (option |singlelinecheck=|)
+% \begin{macrocode}
+ \caption@ifslc{\caption@slc{#1}{#2}\captionwidth\relax}{}%
+% \end{macrocode}
+%
+% Typeset the left margin (option |margin=|)
+% \begin{macrocode}
+ \caption@calcmargin
+ \@tempdima\captionmargin
+ \ifdim\captionmargin@=\z@ \else
+ \caption@ifoddpage{}{\advance\@tempdima\captionmargin@}%
+ \fi
+ \caption@ifh{\advance\@tempdima\caption@indent}%
+ \hspace\@tempdima
+% \end{macrocode}
+%
+% We actually use a |\vbox| of width |\captionwidth - \caption@indent|
+% to typeset the caption.
+% \Note{\cs{captionindent} is \emph{not} supported if the caption format
+% was defined with \cs{DeclareCaptionFormat*}.}
+% \begin{macrocode}
+ \@tempdima\captionwidth
+ \caption@ifh{\advance\@tempdima-\caption@indent}%
+ \caption@parbox\@tempdima{%
+% \end{macrocode}
+%
+% Typeset the indention (option |indention=|)\\
+% {\small Bugfix 04-05-05:
+% |\hskip-\caption@indent| replaced by |\ifdim\caption@indent=\z@|\ldots}
+% \begin{macrocode}
+ \caption@ifh{%
+ \ifdim\caption@indent=\z@
+ \leavevmode
+ \else
+ \hskip-\caption@indent
+ \fi}%
+% \end{macrocode}
+%
+% Typeset the caption itself and close the |\caption@parbox|
+% \begin{macrocode}
+ \caption@@@make{#1}{#2}}%
+% \end{macrocode}
+%
+% Typeset the right margin (option |margin=|)
+% \begin{macrocode}
+ \@tempdima\captionmargin
+ \ifdim\captionmargin@=\z@ \else
+ \caption@ifoddpage{\advance\@tempdima\captionmargin@}{}%
+ \fi
+ \hspace\@tempdima
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@endhook
+ \endgroup
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \global\caption@starfalse}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@calcmargin}
+% \changes{v1.0f}{2005/10/24}{Internal: \cs{ifcaption@width} replaced by
+% \cs{ifdim}\cs{captionwidth=}\cs{z@}}
+% \changes{v1.0g}{2006/01/12}{Improvement: Takes care of list environment now}
+% \changes{v1.1}{2006/05/13}{Check of \cs{@listdepth} removed (not necessary anymore),
+% use \cs{linewidth} instead of \cs{hsize}}
+% |\caption@calcmargin|\par
+% Calculate |\captionmargin| \& |\captionwidth|, so both contain valid
+% values.
+% \begin{macrocode}
+\newcommand*\caption@calcmargin{%
+ \caption@calcmargin@hook
+ \ifdim\captionwidth=\z@
+ \captionwidth\linewidth
+ \advance\captionwidth by -2\captionmargin
+ \advance\captionwidth by -\captionmargin@
+ \else
+ \captionmargin\linewidth
+ \advance\captionmargin by -\captionwidth
+ \divide\captionmargin by 2
+ \captionmargin@\z@
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@Debug{%
+ \string\hsize=\the\hsize,
+ \string\linewidth=\the\linewidth,\MessageBreak
+ \string\leftmargin=\the\leftmargin,
+ \string\rightmargin=\the\rightmargin,\MessageBreak
+ \string\margin=\the\captionmargin,
+ \string\margin@=\the\captionmargin@,
+ \string\width=\the\captionwidth}%
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@slc}
+% \changes{v1.1}{2007/06/13}{\cs{let}\cs{caption@hj}\cs{relax} added}
+% \changes{v1.1}{2007/07/29}{\cs{caption@setup}\cs{caption@sls} added after \cs{begingroup}}
+% \changes{v1.1}{2007/07/29}{\cs{caption@calcmargin} added}
+% \changes{v1.1c}{2007/10/14}{Support of \cs{caption@slfmt} added}
+% \changes{v1.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency}
+% \changes{v1.3}{2010/09/04}{Split into \cs{caption@slc} and \cs{caption@@slc}}
+% |\caption@slc|\marg{label}\marg{text}\marg{width}\marg{extra code}\par
+% This one does the single-line-check.
+% \begin{macrocode}
+\newcommand\caption@slc[4]{%
+ \caption@@slc{#1}{#2}{#3}{\caption@singleline#4}{}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@@slc[5]{%
+ \caption@Debug{Begin SLC}%
+ \begingroup
+ \caption@singleline
+ \let\caption@hj\@empty
+ \caption@calcmargin % calculate #3 if necessary
+ \caption@prepareslc
+ \sbox\@tempboxa{\caption@@@make{#1}{#2}}%
+ \ifdim\wd\@tempboxa>#3%
+ \endgroup
+ #5%
+ \else
+ \endgroup
+ #4%
+ \fi
+ \caption@Debug{End SLC}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@singleline{%
+ \caption@xsetup\caption@opt@singleline
+ \let\caption@fmt\caption@slfmt}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@prepareslc}
+% \changes{v1.0b}{2004/05/16}{Bugfix: Redefinition of \cs{label} \& \cs{@footnotetext} added}
+% \changes{v1.0b}{2004/05/16}{Redefine \cs{stepcounter} instead of \cs{footnote(mark)}}
+% \changes{v1.0c}{2005/02/12}{\cs{let}\cs{caption@hj}\cs{relax} added}
+% \changes{v1.0f}{2005/07/09}{Support of \package{endnotes} package added}
+% \changes{v1.1}{2007/06/13}{\cs{let}\cs{caption@hj}\cs{relax} moved to \cs{caption@slc}}
+% \changes{v1.1}{2007/06/13}{Redefinition of \cs{(H@)refstepcounter} added}
+% \changes{v1.1}{2007/08/12}{Redefinition of \cs{label} improved}
+% \changes{v1.1c}{2007/10/06}{Definition of \cs{caption@l@stepcounter} added}
+% |\caption@prepareslc|\par
+% \changes{v1.3}{2011/07/07}{Bugfix 11-07-06: Redefinition of \cs{footnote} and \cs{footnotemark} added, redefinition of \cs{stepcounter} and \cs{refstepcounter} dropped}
+% \changes{v1.4a}{2011/10/21}{Redefinition of \cs{pagenote} from \textsf{memoir} document class added}
+% \changes{v1.4a}{2011/10/22}{Redefinition of \cs{footnote} revised}
+% Re-define anything which would disturb the single-line-check.
+% \begin{macrocode}
+\newcommand*\caption@prepareslc{%
+ \let\label\caption@gobble
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@footnotemark@ORI\footnotemark
+ \def\footnote{\caption@withoptargs\caption@footnote}%
+ \def\footnotemark{\caption@withoptargs\caption@footnotemark}%
+ \let\@footnotetext\caption@gobble
+% \end{macrocode}
+% \begin{macrocode}
+ \let\@endnotetext\caption@gobble
+% \end{macrocode}
+% \begin{macrocode}
+ \let\pagenote\caption@gobble
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@footnote[2]{%
+ \caption@footnotemark{#1}}
+\newcommand\caption@footnotemark[1]{%
+ \begingroup
+ \let\stepcounter\caption@l@stepcounter
+ \caption@footnotemark@ORI#1%
+ \endgroup}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@l@stepcounter[1]{%
+ \advance\csname c@#1\endcsname\@ne\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@parbox}
+% \changes{v1.0i}{2006/05/13}{We define \cs{caption@parbox} instead of
+% \cs{caption@start/endbox}}
+% \changes{v1.0l}{2006/03/09}{Bugfix 07-03-09: \cs{caption@parbox} changed from
+% \cs{parbox-t} to \cs{parbox-b}}
+% \changes{v1.2}{2007/11/11}{Renamed from \cs{captionbox} to \cs{caption@parbox}}
+% |\caption@parbox|\marg{width}\marg{contents}\par
+% This macro defines the box which surrounds the caption paragraph.
+% \begin{macrocode}
+\newcommand*\caption@parbox{\parbox[b]}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@applyfont}
+% \changes{v1.3}{2010/09/04}{This macro added}
+% |\caption@applyfont|\par
+% This macro executes the font relevant macros, i.e. by default
+% the options set by |justification=|, |font=|, and |size=|.
+% \begin{macrocode}
+\newcommand*\caption@applyfont{%
+ \caption@hj\captionfont\captionsize}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@@make}
+% \changes{v1.0b}{2004/05/16}{Bugfix 04-05-06: \cs{allowhyphens} added}
+% \changes{v1.0c}{2005/02/12}{Bugfix 04-12-16: Use some kind of
+% \cs{@startstrut}\cs{strutbox} instead of \cs{strut}}
+% \changes{v1.0c}{2005/02/12}{Bugfix 05-01-23: \cs{@finalstrut}\cs{strutbox} added}
+% \changes{v1.0d}{2005/05/05}{Use \cs{caption@ifempty};
+% \cs{let}\cs{caption@ifstrut}\cs{@secondoftwo} added}
+% \changes{v1.0d}{2005/05/05}{Bugfix: Handling of \cs{ifcaption@star} changed}
+% \changes{v1.0f}{2005/08/24}{Check for empty label added}
+% \changes{v1.0f}{2005/08/25}{\cs{caption@iflf} added}
+% \changes{v1.0j}{2007/02/18}{Usage of \cs{caption@tfmt} added}
+% \changes{v1.1}{2007/05/07}{Bugfix: \cs{ifhmode} added to \cs{@finalstrut}}
+% \changes{v1.2}{2007/11/17}{Made option \opt{size=} stronger than \opt{font=}}
+% \changes{v1.3}{2010/09/04}{Uses \cs{caption@applyfont} now}
+% \changes{v1.3}{2010/11/01}{Bugfix: If the caption text is empty, the text format will be set to \opt{simple} now}
+% |\caption@@@make|\marg{caption label}\marg{caption text}\par
+% This one finally typesets the caption paragraph, without margin and indention.
+% \begin{macrocode}
+\newcommand\caption@@@make[2]{%
+% \end{macrocode}
+%
+% If the label is empty, we use no caption label separator.
+% \begin{macrocode}
+ \sbox\@tempboxa{#1}%
+ \ifdim\wd\@tempboxa=\z@
+ \let\caption@lsep\relax
+% \@capbreakfalse
+ \fi
+% \end{macrocode}
+%
+% If the text is empty, we use no caption label separator, too.
+% (And no text format either.)
+% \begin{macrocode}
+ \caption@ifempty{#2}{%
+ \let\caption@lsep\@empty
+ \let\caption@tfmt\@firstofone
+% \@capbreakfalse
+% \let\caption@ifstrut\@secondoftwo
+ }%
+% \end{macrocode}
+%
+% Take care that |\caption@parindent| and |\caption@hangindent| will be used
+% to typeset the paragraph.
+% \begin{macrocode}
+ \@setpar{\@@par\caption@@par}\caption@@par
+% \end{macrocode}
+%
+% Finally typeset the caption.
+% \begin{macrocode}
+ \caption@applyfont
+ \caption@fmt
+ {\ifcaption@star\else{\captionlabelfont#1}\fi}%
+ {\ifcaption@star\else{\caption@iflf\captionlabelfont\caption@lsep}\fi}%
+ {{\captiontextfont
+ \caption@ifstrut{\vrule\@height\ht\strutbox\@width\z@}{}%
+ \nobreak\hskip\z@skip % enable hyphenation
+ \caption@tfmt{#2}%
+% \caption@ifstrut{\vrule\@height\z@\@depth\dp\strutbox\@width\z@}{}%
+ \caption@ifstrut{\ifhmode\@finalstrut\strutbox\fi}{}%
+ \par}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifempty}
+% \changes{v1.0d}{2005/05/05}{This macro added}
+% \changes{v1.1}{2007/07/04}{Re-defines itself now}
+% \changes{v1.2a}{2007/01/22}{Revised so \cs{label} will be detected, too}
+% \changes{v1.2b}{2008/08/02}{Revised so \cs{index} and \cs{glossary} will be detected, too}
+% |\caption@ifempty|\marg{text}\marg{true} (\emph{no} \meta{false})\par
+% This one tests if the \meta{text} is actually empty.
+% \Note{This will be done without expanding the text,
+% therefore this is far away from being bullet-proof.}
+% \Note{This macro is re-defining itself so only
+% the first test (in a group) will actually be done.}
+% \begin{macrocode}
+\newcommand\caption@ifempty[1]{%
+ \caption@if@empty{#1}%
+ \caption@ifempty\@unused}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@if@empty[1]{%
+ \def\caption@tempa{#1}%
+ \ifx\caption@tempa\@empty
+ \let\caption@ifempty\@secondoftwo
+ \else
+ \expandafter\def\expandafter\caption@tempa\expandafter{%
+ \caption@car#1\caption@if@empty\caption@nil}%
+ \def\caption@tempb{\caption@if@empty}%
+ \ifx\caption@tempa\caption@tempb
+ \let\caption@ifempty\@secondoftwo
+ \else
+ \def\caption@tempb{\ignorespaces}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\caption@if@empty\expandafter{\@gobble#1}%
+ \else
+ \def\caption@tempb{\label}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
+ \else
+ \def\caption@tempb{\index}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
+ \else
+ \def\caption@tempb{\glossary}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
+ \else
+ \let\caption@ifempty\@gobbletwo
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@car#1#2\caption@nil{#1}% same as \@car, but \long
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@par}
+% \changes{v1.0f}{2005/08/22}{Made this definition global}
+% |\caption@@par|\par
+% This command will be executed with every |\par| inside the caption.
+% \begin{macrocode}
+\newcommand*\caption@@par{%
+ \parindent\caption@parindent\hangindent\caption@hangindent}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Types \& sub-types}
+%
+% \begin{macro}{\DeclareCaptionType}
+% \changes{v1.1}{2007/08/12}{This macro added}
+% \changes{v1.1a}{2007/09/07}{Three optional arguments added}
+% \changes{v1.2}{2007/12/06}{Renamed from \cs{DeclareFloatingEnvironment} to \cs{DeclareCaptionType}}
+% \changes{v1.2}{2007/12/21}{Optional argument revised, uses key-value syntax now}
+% \changes{v1.2b}{2008/04/13}{Uses \cs{caption@within@default} now}
+% \changes{v1.2b}{2008/08/02}{Support of \cs{float@exts} and \cs{float@addtolists} added}
+% \changes{v1.2e}{2010/01/09}{Usage of \cs{caption@DeclareWithinOption} added}
+% \changes{v1.3}{2011/08/06}{Definition of \cs{listofXXXes} added}
+% \changes{v1.4a}{2011/10/29}{Outsourced as \package{newfloat} package}
+% |\DeclareCaptionType|\oarg{options}\marg{environment}\oarg{name}\oarg{list name}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionType{%
+ \RequirePackage{newfloat}%
+ \DeclareFloatingEnvironment}
+\@onlypreamble\DeclareCaptionType
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ForEachType}
+% \changes{v1.4a}{2011/10/29}{This macro added}
+% |\caption@ForEachType|\marg{code}
+% will execute the given code for all (known) floating environments.
+% \begin{macrocode}
+\newcommand\caption@ForEachType[1]{%
+ \caption@ifundefined\ForEachFloatingEnvironment
+ {\def\@elt##1{#1}%
+ \caption@ifundefined\c@figure\@gobble\@elt{figure}%
+ \caption@ifundefined\c@table\@gobble\@elt{table}%
+ \let\@elt\relax
+ \newfloat@addtohook{#1}}%
+ {\ForEachFloatingEnvironment{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand\newfloat@addtohook[1]{%
+ \toks@=\expandafter{\newfloat@hook{##1}#1}%
+ \edef\@tempa{\def\noexpand\newfloat@hook####1{\the\toks@}}%
+ \@tempa}
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\newfloat@hook[1]{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@stpelt}
+% We patch \cs{@stpelt} so a list of `connected' counters will be reset, too.
+% (Like \cs{stepcounter} does in |ltcounts.dtx|.)
+% \begin{macrocode}
+\newcommand*\caption@patch@stpelt{%
+ \let\caption@stpelt\@stpelt
+ \def\@stpelt##1{%
+ \caption@stpelt{##1}%
+ \begingroup
+ \let\@elt\caption@stpelt
+ \csname caption@cl@##1\endcsname
+ \endgroup}%
+ \let\caption@patch@stpelt\relax}
+\@onlypreamble\caption@patch@stpelt
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@addtoreset}
+% \changes{v1.2d}{2009/10/09}{This macro added}
+% Like \cs{@addtoreset} from |ltcounts.dtx|
+% \begin{macrocode}
+\newcommand*\caption@addtoreset[2]{%
+ \caption@patch@stpelt
+ \@ifundefined{caption@cl@#2}{\@namedef{caption@cl@#2}{}}{}%
+ \expandafter\@cons\csname caption@cl@#2\endcsname{{#1}}}
+\@onlypreamble\caption@addtoreset
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@removefromreset}
+% \changes{v1.2d}{2009/10/09}{This macro added}
+% Like \cs{@removefromreset} from |remreset.sty|
+% \begin{macrocode}
+\newcommand*\caption@removefromreset[2]{%
+ \begingroup
+ \expandafter\let\csname c@#1\endcsname\caption@removefromreset
+ \def\@elt##1{%
+ \expandafter\ifx\csname c@##1\endcsname\caption@removefromreset
+ \else
+ \noexpand\@elt{##1}%
+ \fi}%
+ \expandafter\xdef\csname caption@cl@#2\endcsname{%
+ \csname caption@cl@#2\endcsname}%
+ \endgroup}
+\@onlypreamble\caption@removefromreset
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionSubType}
+% \changes{v1.2}{2007/11/16}{This macro added}
+% \changes{v1.2a}{2008/03/11}{Bugfix: \cs{subfigurename} will be defined now}
+% \changes{v1.2d}{2009/10/09}{Bugfix 08-10-01: Usage of \cs{caption@addtoreset} added}
+% \changes{v1.3}{2011/01/01}{\cs{@dottedlofline} will be defined \& used now}
+% \changes{v1.4}{2011/10/09}{Support of the titletoc package added}
+% |\DeclareCaptionSubType|\oarg{numbering scheme}\marg{type}\\
+% |\DeclareCaptionSubType*|\oarg{numbering scheme}\marg{type}\par
+% The starred variant provides the numbering format
+% \meta{type}|.|\meta{subtype} while the non-starred variant simply
+% uses \meta{subtype}.
+% \begin{macrocode}
+\newcommand*\DeclareCaptionSubType{%
+ \caption@teststar\caption@declaresubtype\@firstoftwo\@secondoftwo}
+\@onlypreamble\DeclareCaptionSubType
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declaresubtype[1]{%
+ \@testopt{\caption@@declaresubtype{#1}}{alph}}
+\@onlypreamble\caption@declaresubtype
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@declaresubtype#1[#2]#3{%
+ \@ifundefined{c@#3}%
+ {\caption@Error{No float type '#3' defined}}%
+% \end{macrocode}
+% \begin{macrocode}
+ {\@ifundefined{c@sub#3}%
+ {\caption@Debug{New subtype `sub#3'}%
+ \newcounter{sub#3}%
+ \caption@addtoreset{sub#3}{#3}%
+ \@namedef{ext@sub#3}{\csname ext@#3\endcsname}%
+ \caption@declaresublistentry{#3}%
+ \@cons\caption@subtypelist{{#3}}}%
+ {\caption@Debug{Modify caption `sub#3'}}%
+% \end{macrocode}
+% Support of \package{titletoc} package
+% \begin{macrocode}
+ \caption@ifundefined\contentsuse{}{%
+ \contentsuse{sub#3}{\csname ext@sub#3\endcsname}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \@namedef{sub#3name}{}%
+ \@namedef{sub#3autorefname}{\csname #3name\endcsname}%
+ #1% is \@firstoftwo in star form, and \@secondoftwo otherwise
+ {\@namedef{p@sub#3}{}%
+ \@namedef{thesub#3}{\csname the#3\endcsname.\@nameuse{#2}{sub#3}}}%
+ {\@namedef{p@sub#3}{\csname the#3\endcsname}%
+ \@namedef{thesub#3}{\@nameuse{#2}{sub#3}}}%
+ \@namedef{theHsub#3}{\csname theH#3\endcsname.\arabic{sub#3}}%
+ }}
+% \end{macrocode}
+% \begin{macrocode}
+\@onlypreamble\caption@@declaresubtype
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declaresublistentry{%
+ \caption@ifundefined\l@chapter
+ {\caption@@declaresublistentry\l@subsubsection}%
+ {\caption@@declaresublistentry\l@subsection}}
+\@onlypreamble\caption@declaresublistentry
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@declaresublistentry[2]{%
+ \ifx#1\@undefined
+ \caption@@@declaresublistentry\relax\@dottedtocline\caption@nil{#2}%
+ \else
+ \expandafter\caption@@@declaresublistentry#1{}{}\@dottedtocline\caption@nil{#2}%
+ \fi}
+\@onlypreamble\caption@@declaresublistentry
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@@declaresublistentry#1\@dottedtocline#2\caption@nil#3{%
+ \def\@tempa{#1}%
+% Does \l@(sub)subsection start with \@dottedtocline?
+ \ifx\@tempa\@empty
+% Yes
+ \caption@@@@declaresublistentry{#3}#2\caption@nil
+ \else
+% No
+ \caption@@@@declaresublistentry{#3}@{3.8em}{3.2em}\caption@nil
+ \fi}
+\@onlypreamble\caption@@@declaresublistentry
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@@@declaresublistentry#1#2#3#4#5\caption@nil{%
+ \expandafter\caption@@@@@declaresublistentry\expandafter
+ {\csname @dotted\csname ext@#1\endcsname line\endcsname}{#1}{#3}{#4}}
+\@onlypreamble\caption@@@@declaresublistentry
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@@@declaresublistentry[4]{%
+ \@namedef{l@sub#2}{#1{2}{#3}{#4}}%
+ \caption@@@@@@declaresublistentry#1{c@\csname ext@#2\endcsname depth}}
+\@onlypreamble\caption@@@@@declaresublistentry
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@@@@declaresublistentry[2]{
+ \ifx#1\relax
+ \def#1##1{%
+ \def\next{\@dottedtocline{##1}}%
+ \@ifundefined{#2}{}{%
+ \ifnum ##1>\@nameuse{#2}\relax
+ \let\next\@gobblefour
+ \fi}%
+ \next}%
+ \fi}
+\@onlypreamble\caption@@@@@@declaresublistentry
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@subtypelist}
+% An \cs{@elt}-list containing the subtypes defined
+% with |\Declare|\x|Caption|\x|Sub|\x|Type|.
+% \begin{macrocode}
+\newcommand*\caption@subtypelist{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@For}
+% \changes{v1.1a}{2007/09/07}{This macro added}
+% \changes{v1.2}{2007/11/16}{Renamed from \cs{ForFloatingEnvironments} to \cs{caption@For}}
+% |\caption@For|\marg{elt-list}\marg{code with \#1}\\
+% |\caption@For*|\marg{elt-list}\marg{code with \#1}
+% \begin{macrocode}
+\newcommand*\caption@For{\caption@withoptargs\caption@@For}
+%\@onlypreamble\caption@For
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@@For[3]{%
+ \caption@AtBeginDocument#1{%
+ \def\@elt##1{#3}%
+ \@nameuse{caption@#2}%
+ \let\@elt\relax}}%
+%\@onlypreamble\caption@@For
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{subfig package adaptions}
+% \changes{v1.1}{2007/07/07}{Several adaptions to the \package{subfig} package added}
+% \changes{v1.4a}{2011/11/01}{Bugfix 11-11-01: Test for the subfig package revised}
+%
+% Since the \package{subfig} package is not maintained anymore,
+% we have to make several adaptions to \thispackage~\version{1.1} here.
+% Please note that we only support the version $1.3$ of the \package{subfig} package here.
+% So older versions do not work with this version of \thispackage, and newer
+% versions are expected to be adapted.
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \def\@tempa{2005/06/28 ver: 1.3 subfig package}%
+ \expandafter\ifx\csname ver@subfig.sty\endcsname\@tempa
+ \caption@InfoNoLine{subfig package v1.3 is loaded}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@setfloattype\@gobble
+ \let\@dottedxxxline\sf@NEW@dottedxxxline
+ \let\sf@subfloat\sf@NEW@subfloat
+% \end{macrocode}
+% \begin{macrocode}
+ \fi
+ \let\sf@NEW@dottedxxxline\@undefined
+ \let\sf@NEW@subfloat\@undefined}
+% \end{macrocode}
+% \begin{macrocode}
+\def\sf@NEW@dottedxxxline#1#2#3#4#5#6#7{%
+ \begingroup
+ \caption@setfloattype{#1}%
+ \caption@setoptions{subfloat}%
+ \caption@setoptions{sub#1}%
+ \ifnum #3>\@nameuse{c@#2depth}\else
+ \@dottedtocline{\z@}{#4}{#5}{#6}{#7}%
+ \fi
+ \endgroup}
+% \end{macrocode}
+% \begin{macrocode}
+\def\sf@NEW@subfloat{%
+ \begingroup
+ \caption@setfloattype\@captype
+ \sf@ifpositiontop{%
+ \maincaptiontoptrue
+ }{%
+ \maincaptiontopfalse
+ }%
+ \caption@setoptions{subfloat}%
+ \caption@setoptions{sub\@captype}%
+ \let\sf@oldlabel=\label
+ \let\label=\subfloat@label
+ \ifmaincaptiontop\else
+ \advance\@nameuse{c@\@captype}\@ne
+ \fi
+ \refstepcounter{sub\@captype}%
+ \setcounter{sub\@captype @save}{\value{sub\@captype}}%
+ \@ifnextchar [% %] match left bracket
+ {\sf@@subfloat}%
+ {\sf@@subfloat[\@empty]}}
+% \end{macrocode}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \clearpage
+% \begin{thebibliography}{99}
+% \bibitem{Anne}
+% Anne Br\"uggemann-Klein:\\
+% \emph{Einf\"uhrung in die Dokumentverarbeitung},\\
+% B.G. Teubner, Stuttgart, 1989
+%
+% \bibitem{hyperref}
+% Sebastian Rahtz \& Heiko Oberdiek:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/hyperref/}%
+% {\emph{Hypertext marks in \LaTeX}},\\
+% November 12, 2007
+%
+% \bibitem{refcount}
+% Heiko Oberdiek:\\
+% \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/oberdiek/refcount.pdf}%
+% {\emph{The refcount package}},\\
+% 2006/02/20
+%
+% \bibitem{threeparttable}
+% Donald Arseneau:\\
+% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/misc/}%
+% {\emph{Three part tables: title, tabular environment, notes}},\\
+% 2003/06/13
+% \end{thebibliography}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/caption/fallback/v3.3/caption.dtx b/Master/texmf-dist/source/latex/caption/fallback/v3.3/caption.dtx
new file mode 100644
index 00000000000..721ca9c3719
--- /dev/null
+++ b/Master/texmf-dist/source/latex/caption/fallback/v3.3/caption.dtx
@@ -0,0 +1,4968 @@
+% \iffalse meta-comment
+%
+% This is file `caption.dtx'.
+%
+% Copyright (C) 1994-2019 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%
+% --------------------------------------------------------------------------
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Axel Sommerfeldt.
+%
+% This work consists of the files caption.ins, caption.dtx, caption2.dtx,
+% caption3.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx, and newfloat.dtx,
+% the derived files caption.sty, caption2.sty, caption3.sty,
+% bicaption.sty, ltcaption.sty, subcaption.sty, and newfloat.sty,
+% and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex.
+%
+% \fi
+% \CheckSum{3694}
+%
+% \iffalse
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption.drv}[2011/08/06 v3.3 Implementation of the caption package]
+\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
+%\errorcontextlines=3
+%
+\documentclass{ltxdoc}
+\setlength\parindent{0pt}
+\setlength\parskip{\smallskipamount}
+%
+\makeatletter % make room for subsections like 2.16.14 in the TOC
+%\newcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
+\renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.7em}}
+\makeatother
+%
+\usepackage{ifpdf}
+\ifpdf
+ \usepackage{mathptmx,courier}
+ \usepackage[scaled=0.90]{helvet}
+ \addtolength\marginparwidth{15pt}
+\fi
+%
+\usepackage{hypdoc}
+\ifpdf\usepackage{hypdestopt}\fi
+\hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}}
+%
+\usepackage[debug]{caption}[2013/01/01]
+%
+\DeclareRobustCommand*\eTeX{\texorpdfstring
+ {\leavevmode\hbox{$\varepsilon$}-\TeX}%
+ {e-TeX}}
+\DeclareRobustCommand*\AmS{\texorpdfstring
+ {{\protect\usefont{OMS}{cmsy}{m}{n}A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}%
+ {AMS}}
+\DeclareRobustCommand*\KOMAScript{\texorpdfstring
+ {\textsf{K\kern.05em O\kern.05em M\kern.05em A\kern.1em-\kern.1em Script}}%
+ {KOMA-Script}}
+\DeclareRobustCommand*\NTG{NTG}
+\DeclareRobustCommand*\SmF{SMF}
+%
+\begin{document}
+ \DocInput{caption.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \newcommand*\purerm[1]{\texorpdfstring{{\upshape\mdseries\rmfamily #1}}{#1}}
+% \newcommand*\puresf[1]{\texorpdfstring{{\upshape\mdseries\sffamily #1}}{#1}}
+% \newcommand*\purett[1]{\texorpdfstring{{\upshape\mdseries\ttfamily #1}}{#1}}
+% \let\class\puresf \let\package\puresf
+% \let\env\purett \let\opt\purett
+%
+% \def\thispackage{the \package{caption} package}
+% \def\Thispackage{The \package{caption} package}
+%
+% \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
+% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
+% \newcommand*\version[2][]{\textit{v#2}}
+%
+% \newcommand*\issue[1]{GitLab~\##1}
+%
+% \GetFileInfo{caption.drv}
+% \let\docdate\filedate
+% \GetFileInfo{caption.sty}
+%
+% \title{The Implementation of
+% \texorpdfstring{\thispackage\thanks{%^^A
+% This package has version number \fileversion, last revised \filedate.}}%^^A
+% {the caption package}}
+% \author{Axel Sommerfeldt\\
+% \url{https://gitlab.com/axelsommerfeldt/caption}}
+% \date{\docdate}
+% \maketitle
+%
+% \begin{abstract}
+% \Thispackage\ consists of two parts -- the kernel
+% (|caption3.sty|) and the main package (|caption.sty|).
+%
+% \Thispackage\ redefines the \LaTeX\ commands
+% |\caption|, |\@caption|, and |\@makecaption| and maps the latter one to
+% |\caption@@make|, giving the user the possibility to control the look \& feel
+% of the captions from floating environments like |figure| and |table|.
+% Furthermore it does similar to the caption stuff coming from other packages
+% (like the \package{longtable} or \package{supertabular} package):
+% Mapping the appropriate internal commands (like |\LT@makecaption| or
+% |\ST@caption|) to the ones offered by the \package{caption3} kernel.
+% So you can think of \thispackage\ as a layer package, it
+% simply provides adaptation layers between the caption stuff coming from
+% \LaTeXe\ or packages, and the caption stuff offered by the
+% \package{caption3} kernel.
+% \end{abstract}
+%
+% \section*{User manuals}
+%
+% This document is describing the code implementation only. The user
+% documentation can be found in
+% \nopagebreak\begin{quote}
+% \begin{tabular}{ll}
+% \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-eng.pdf}%
+% {\texttt{caption-eng.pdf}} & The English documentation \\
+% \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-rus.pdf}%
+% {\texttt{caption-rus.pdf}} & The Russian documentation\footnotemark \\
+% \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-deu.pdf}%
+% {\texttt{caption-deu.pdf}} & The German documentation \\
+% \end{tabular}
+% \footnotetext{Thanks a lot to Olga Lapko for this translation}
+% \end{quote}
+%
+% \StopEventually{}
+% \clearpage
+% \tableofcontents
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \DoNotIndex{\\,\_,\ ,\@@par}
+% \DoNotIndex{\@bsphack}
+% \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
+% \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
+% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
+% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
+% \DoNotIndex{\if@minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@minipagefalse,\@minipagetrue}
+% \DoNotIndex{\@namedef,\@nameuse}
+% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
+% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setminipage,\@setpar}
+% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
+% \DoNotIndex{\@testopt}
+% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
+% \DoNotIndex{\p@,\z@}
+% \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
+% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
+% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
+% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
+% \DoNotIndex{\fi,\footnotesize,\global}
+% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
+% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
+% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
+% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
+% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
+% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
+% \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
+% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
+% \DoNotIndex{\providecommand,\quad}
+% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
+% \DoNotIndex{\rightskip,\rmfamily}
+% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
+% \DoNotIndex{\small,\string,\space,\strut}
+% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
+% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
+% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
+% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
+% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
+% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
+% \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \setlength{\parskip}{0pt plus 1pt}
+% \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
+%
+% \changes{v1.0}{1994/10/27}{First release}
+% \changes{v1.1}{1994/11/03}{New option \texttt{centerlast}}
+% \changes{v1.2}{1994/11/28}{Support of the \package{float} package}
+% \changes{v1.3}{1995/01/09}{Support of \cs{captionlabelfont} in subcaptions}
+% \changes{v1.4}{1995/01/30}{New option \texttt{nooneline}}
+% \changes{v1.4b}{1995/04/05}{Bugfix release}
+% \changes{v3.0}{2003/12/20}{Rewritten; many new commands and features}
+% \changes{v3.0d}{2004/11/28}{Split into two packages:
+% \package{caption} \& \package{caption3}}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \let\subsubsection\subsection
+% \let\subsection\section
+%
+% \iffalse
+%<*package>
+% \fi
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesPackage{caption}[2019/09/01 v3.3d Customizing captions (AR)]
+% \end{macrocode}
+%
+% \subsection{Loading the kernel}
+%
+% \begin{macrocode}
+\RequirePackage{caption3}[=2019/09/01] % needs v1.8d or newer
+% \end{macrocode}
+%
+% \subsection{Check against incompatible document classes}
+%
+% \begin{macrocode}
+\caption@ifbool{documentclass}{}{%
+ \caption@WarningNoLine{%
+ Unsupported document class (or package) detected,\MessageBreak
+ usage of the caption package is not recommended}%
+ \caption@InfoNoLine{\string\@makecaption\space=\space\meaning\@makecaption}%
+}
+% \end{macrocode}
+%
+% \subsection{Check against incompatible packages}
+%
+% \changes{v3.0p}{2007/04/06}{Check against obsolete \package{caption2} package added}
+% \begin{macrocode}
+\@ifpackageloaded{caption2}{%
+ \caption@Error{%
+ You can't use both, the (obsolete) caption2 *and*\MessageBreak
+ the (current) caption package}%
+ \endinput
+}{}
+% \end{macrocode}
+%
+% \changes{v3.1}{2007/06/15}{Check against incompatible \package{ftcap} package added}
+% \changes{v3.1}{2007/06/15}{Check against incompatible \package{nonfloat} package added}
+% \changes{v3.1}{2007/06/18}{Check against incompatible \package{topcapt} package added}
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \@ifpackageloaded{ftcap}{\caption@DisablePositionOption{ftcap}}{}%
+ \@ifpackageloaded{nonfloat}{\caption@DisablePositionOption{nonfloat}}{}%
+ \@ifpackageloaded{topcapt}{\caption@DisablePositionOption{topcapt}}{}}
+% \end{macrocode}
+% \begin{macro}{\caption@DisablePositionOption}
+% \changes{v3.1g}{2008/03/20}{\texttt{position=b} added}
+% \changes{v3.1h}{2008/03/29}{%
+% Name changed from \cs{caption@IncompatiblePackage} to \cs{caption@DisablePositionOption};
+% moved from package to kernel; disables the `position' option now instead of issuing a warning}
+% |\caption@DisablePositionOption|\marg{package}\par
+% disables the `position' option.
+% \begin{macrocode}
+\newcommand*\caption@DisablePositionOption[1]{%
+ \caption@InfoNoLine{%
+ `#1' package detected; setting `position=b' for compatibility reasons}%
+ \caption@setposition b%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionOption{position}{%
+ \caption@Error{Usage of the `position' option is incompatible\MessageBreak
+ to the `#1' package}}}
+% \end{macrocode}
+% \begin{macrocode}
+\@onlypreamble\caption@DisablePositionOption
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Declaration of options}
+%
+% \subsubsection{Options for figure and table}
+%
+% \changes{v3.0a}{2004/01/09}{Options \opt{figureposition} and \opt{tableposition} added}
+% \begin{macrocode}
+\DeclareCaptionOption{figureposition}{%
+ \captionsetup*[figure]{position=#1}}
+\@onlypreamble@key{caption}{figureposition}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{tableposition}{%
+ \captionsetup*[table]{position=#1}}
+\@onlypreamble@key{caption}{tableposition}
+% \end{macrocode}
+%
+% \changes{v3.0d}{2004/08/03}{Options \opt{figurename} and \opt{tablename} added}
+% \changes{v3.1}{2007/07/04}{Options \opt{figurename} and \opt{tablename} re-written}
+% \changes{v3.1f}{2007/11/18}{Option \opt{name} added}
+% \begin{macrocode}
+\DeclareCaptionOption{figurename}{\caption@SetName{figure}{#1}}
+\@onlypreamble@key{caption}{figurename}
+\DeclareCaptionOption{tablename}{\caption@SetName{table}{#1}}
+\@onlypreamble@key{caption}{tablename}
+% \end{macrocode}
+%
+% \changes{v3.1g}{2008/02/28}{Options \opt{listfigurename} and \opt{listtablename} added}
+% \begin{macrocode}
+\DeclareCaptionOption{listfigurename}{\caption@SetName{listfigure}{#1}}
+\@onlypreamble@key{caption}{listfigurename}
+\DeclareCaptionOption{listtablename}{\caption@SetName{listtable}{#1}}
+\@onlypreamble@key{caption}{listtablename}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@SetName}
+% \changes{v3.1}{2007/07/04}{This macro added}
+% \changes{v3.1f}{2007/11/18}{After-preamble variant added}
+% \changes{v3.1g}{2008/02/28}{Renamed from \cs{caption@SetFloatName} to \cs{caption@SetName}}
+% \changes{v3.1i}{2008/08/02}{Bugfix: Works now without \cs{addto}, too}
+% \changes{v3.2d}{2011/10/29}{Outsourced to \package{newfloat} package}
+% \changes{v3.2f}{2012/01/12}{Bugfix: Uses \cs{caption@NewFloat} now}
+% |\caption@SetName|\marg{float}\marg{name}
+% \begin{macrocode}
+\newcommand*\caption@SetName[2]{%
+ \caption@NewFloat{\newfloat@setname{#1}{#2}}}
+\@onlypreamble\caption@SetName
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{name}{\caption@setname\@captype{#1}}
+% \end{macrocode}
+% \begin{macro}{\caption@setname}
+% |\caption@setname|\marg{float}\marg{name}
+% \begin{macrocode}
+\newcommand*\caption@setname[2]{%
+ \@namedef{#1name}{#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.1f}{2007/12/21}{Options \opt{figurewithin} and \opt{tablewithin} added}
+% \changes{v3.1i}{2008/04/13}{Option \opt{within} added}
+% \changes{v3.1l}{2010/01/09}{The \opt{within} options are now available within the document, too}
+% \changes{v3.1l}{2010/01/09}{The global \opt{within} option will now affect user-defined
+% floats declared with \cs{DeclareCaptionType}, too}
+%
+% \begin{macro}{\caption@DeclareWithinOption}
+% \changes{v3.1l}{2010/01/09}{This macro and its usage added}
+% |\caption@DeclareWithinOption|\marg{float}
+% declares the options \meta{float}\texttt{within} and \meta{float}\texttt{without},
+% e.g. \texttt{figurewithin} and \texttt{figurewithout}.
+% \begin{macrocode}
+\newcommand*\caption@DeclareWithinOption[1]{%
+ \DeclareCaptionOption{#1within}{\caption@Within{#1}{##1}}%
+ \DeclareCaptionOptionNoValue{#1without}{\caption@Within{#1}{none}}}
+\@onlypreamble\caption@DeclareWithinOption
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\caption@DeclareWithinOption{figure}
+\caption@DeclareWithinOption{table}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{within}{%
+ \caption@NewFloat{\newfloatsetup{within=#1}}}
+\DeclareCaptionOptionNoValue{without}{%
+ \caption@NewFloat{\newfloatsetup{without}}}
+% \end{macrocode}
+% \begin{macro}{\caption@Within}
+% \changes{v3.1}{2007/12/21}{This macro added}
+% \changes{v3.2d}{2011/10/29}{Outsourced to \package{newfloat} package}
+% \changes{v3.2f}{2012/01/12}{Bugfix: Uses \cs{caption@NewFloat} now}
+% |\caption@Within|\marg{float}\marg{value}
+% \begin{macrocode}
+\newcommand*\caption@Within[2]{%
+ \caption@NewFloat{\newfloat@setwithin{#1}{#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@NewFloat}
+% \changes{v3.2f}{2012/01/12}{This macro added}
+% |\caption@NewFloat|\marg{code}
+% loads the \package{newfloat} package and executes the given code afterwards.
+% Note: Since the \package{newfloat} package uses the crappy \package{keyval}
+% package, too, we need to save \& restore some macros here, otherwise this
+% recursion won't work properly.
+% {\itshape (TODO: Re-write \package{newfloat} so it uses \package{kvoptions} instead.)}
+% \begin{macrocode}
+\newcommand*\caption@NewFloat[1]{%
+ \let\KV@prefix@ORI\KV@prefix
+ \let\@tempc@ORI\@tempc
+ \caption@ifpackageloaded{newfloat}{#1}{}%
+ \let\@tempc\@tempc@ORI
+ \let\KV@prefix\KV@prefix@ORI}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Miscellaneous options}
+%
+% \begin{macrocode}
+\DeclareCaptionOption*{config}[caption]{%
+ \InputIfFileExists{#1.cfg}%
+ {\typeout{*** Local configuration file #1.cfg used ***}}%
+ {\caption@Warning{Configuration file #1.cfg not found}}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@selectlistentry}
+% \changes{v3.2}{2010/11/07}{This macro added}
+% |\caption@selectlistentry|\marg{\purett{heading} or \purett{entry}}
+% \begin{macrocode}
+\newcommand*\caption@selectlistentry[1]{%
+ \caption@ifinlist{#1}{heading}{%
+ \let\caption@iflistheading\@firstoftwo
+ }{\caption@ifinlist{#1}{default,list-entry,entry}{%
+ \let\caption@iflistheading\@secondoftwo
+ }{%
+ \caption@Error{Undefined list-entry selection `#1'}%
+ }}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.3}{2012-03-25}{Option \opt{list-entry} added}
+% \begin{macrocode}
+\DeclareCaptionOption{list-entry}{\caption@selectlistentry{#1}}
+\captionsetup{list-entry=default}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setparboxrestore}
+% \changes{v3.2}{2010/11/07}{This macro added}
+% |\caption@setparboxrestore|\marg{\purett{partial} or \purett{full}}
+% \begin{macrocode}
+\newcommand*\caption@setparboxrestore[1]{%
+ \caption@ifinlist{#1}{full}{%
+ \caption@setfullparboxrestore
+ }{\caption@ifinlist{#1}{default,light,partial}{%
+ \let\caption@parboxrestore\@secondoftwo
+ }{%
+ \caption@Error{Undefined parboxrestore `#1'}%
+ }}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setfullparboxrestore}
+% \changes{v3.2}{2010/11/07}{This macro added}
+% |\caption@setfullparboxrestore|\par
+% This is an abbreviation for |\caption@setparboxrestore{full}|.
+% \begin{macrocode}
+\newcommand*\caption@setfullparboxrestore{%
+ \let\caption@parboxrestore\@firstoftwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.2}{2010/11/07}{Option \opt{parboxrestore} added}
+% \begin{macrocode}
+\DeclareCaptionOption{parboxrestore}{\caption@setparboxrestore{#1}}
+\captionsetup{parboxrestore=default}
+% \end{macrocode}
+%
+% \changes{v3.1f}{2007/11/28}{Option \opt{@minipage=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{@minipage}{%
+ \caption@ifinlist{#1}{auto,default}%
+ {\let\caption@if@minipage\@gobbletwo}%
+ {\caption@set@bool\caption@if@minipage{#1}}}
+\captionsetup{@minipage=default}
+% \end{macrocode}
+%
+% \subsubsection{caption v1.x compatibility options}
+% \changes{v3.1}{2007/07/21}{Option `compatibility' added}
+% \changes{v3.1}{2007/09/01}{caption v1.x compatibility options revised}
+% \changes{v3.1d}{2007/10/24}{Bugfix 07-10-24 in caption v1.x$ compatibility options}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{compatibility}[1]{\caption@setbool{compatibility}{#1}}
+\@onlypreamble@key{caption}{compatibility}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{normal}{%
+ \caption@setformat{plain}%
+ \caption@setjustification{justified}}
+\DeclareCaptionOptionNoValue*{isu}{%
+ \caption@setformat{hang}%
+ \caption@setjustification{justified}}
+\DeclareCaptionOptionNoValue*{hang}{%
+ \caption@setformat{hang}%
+ \caption@setjustification{justified}}
+\DeclareCaptionOptionNoValue*{center}{%
+ \caption@setformat{plain}%
+ \caption@setjustification{centering}}
+\DeclareCaptionOptionNoValue*{centerlast}{%
+ \caption@setformat{plain}%
+ \caption@setjustification{centerlast}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{scriptsize}{\def\captionfont{\scriptsize}}
+\DeclareCaptionOptionNoValue*{footnotesize}{\def\captionfont{\footnotesize}}
+\DeclareCaptionOptionNoValue*{small}{\def\captionfont{\small}}
+\DeclareCaptionOptionNoValue*{normalsize}{\def\captionfont{\normalsize}}
+\DeclareCaptionOptionNoValue*{large}{\def\captionfont{\large}}
+\DeclareCaptionOptionNoValue*{Large}{\def\captionfont{\Large}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{up}{\l@addto@macro\captionlabelfont\upshape}
+\DeclareCaptionOptionNoValue*{it}{\l@addto@macro\captionlabelfont\itshape}
+\DeclareCaptionOptionNoValue*{sl}{\l@addto@macro\captionlabelfont\slshape}
+\DeclareCaptionOptionNoValue*{sc}{\l@addto@macro\captionlabelfont\scshape}
+\DeclareCaptionOptionNoValue*{md}{\l@addto@macro\captionlabelfont\mdseries}
+\DeclareCaptionOptionNoValue*{bf}{\l@addto@macro\captionlabelfont\bfseries}
+\DeclareCaptionOptionNoValue*{rm}{\l@addto@macro\captionlabelfont\rmfamily}
+\DeclareCaptionOptionNoValue*{sf}{\l@addto@macro\captionlabelfont\sffamily}
+\DeclareCaptionOptionNoValue*{tt}{\l@addto@macro\captionlabelfont\ttfamily}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{nooneline}{\caption@setbool{slc}{0}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\caption@setbool{ruled}{0}
+\DeclareCaptionOptionNoValue*{ruled}{\caption@setbool{ruled}{1}}
+% \end{macrocode}
+%
+% \subsubsection{caption2 v2.x compatibility options}
+% \changes{v3.0h}{2005/07/08}{caption2 \version{2.x} compatibility options added}
+% \changes{v3.1}{2007/09/01}{caption2 v2.x compatibility options revised}
+% \changes{v3.1d}{2007/10/24}{Bugfix 07-10-24 in caption v2.x$ compatibility options}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{flushleft}{%
+ \caption@setformat{plain}%
+ \caption@setjustification{raggedright}}
+\DeclareCaptionOptionNoValue*{flushright}{%
+ \caption@setformat{plain}%
+ \caption@setjustification{raggedleft}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{oneline}{\caption@setbool{slc}{1}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{ignoreLTcapwidth}{%
+ \caption@WarningNoLine{Obsolete option `ignoreLTcapwidth' ignored}}
+% \end{macrocode}
+%
+% \subsubsection{Obsolete caption v3.0 options}
+% \changes{v3.1}{2007/05/07}{Package option \opt{caption} marked as obsolete,
+% gives error now}
+%
+% \begin{macrocode}
+\DeclareCaptionOption*{caption}{%
+ \caption@setbool{temp}{#1}%
+ \caption@ifbool{temp}{}{%
+ \caption@Error{%
+ The package option `caption=#1' is obsolete.\MessageBreak
+ Please pass this option to the subfig package instead\MessageBreak
+ and do *not* load the caption package anymore}}}
+% \end{macrocode}
+%
+% \subsubsection{fltpage package support options}
+%
+% \changes{v3.1}{2007/09/01}{Options `FPlist' \& `FPref' added}
+% With these options is controlled where the list-of entry and |\ref| resp.
+% |\pageref| or |\autoref| will link to.
+% Defaults are |FPlist=caption| and |FPref=figure| which is inconsistent,
+% but compatible to the usual behaviour of the \package{fltpage} package.
+% \begin{macrocode}
+\DeclareCaptionOption{FPlist}[1]{\caption@setFPoption{list}{#1}}
+\DeclareCaptionOption{FPref}[1]{\caption@setFPoption{ref}{#1}}
+\@onlypreamble@key{caption}{FPlist}
+\@onlypreamble@key{caption}{FPref}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setFPoption[2]{%
+ \edef\caption@tempa{\@car#2\@nil}%
+ \caption@setbool{FP#1cap}{\if c\caption@tempa 1\else 0\fi}}
+\@onlypreamble\caption@setFPoption
+% \end{macrocode}
+% \begin{macrocode}
+\captionsetup{FPlist=caption,FPref=figure}
+% \end{macrocode}
+%
+% \subsubsection{hyperref package support options}
+%
+% \changes{v3.1}{2007/06/21}{Options `hypcap' \& `hypcapspace' added}
+% With |hypcap=off| one can turn the \package{hypcap} support off
+% (default is |on|).
+% \begin{macrocode}
+\DeclareCaptionOption{hypcap}[1]{\caption@setbool{hypcap}{#1}}
+\DeclareCaptionOption{hypcapspace}{\def\caption@hypcapspace{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\captionsetup{hypcap=1,hypcapspace=.5\baselineskip}
+% \end{macrocode}
+%
+% \subsection{\AmS{} \& \SmF{} document classes support}
+% \changes{v3.1}{2007/07/29}{\AmS\ \& \SmF\ document classes support added}
+%
+% \begin{macrocode}
+\caption@ifamsclass{%
+ \caption@InfoNoLine{AMS or SMF document class}%
+% \end{macrocode}
+% \begin{macrocode}
+ \setlength\belowcaptionskip{0pt}% set to 12pt by AMS class
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsection{\KOMAScript{} document classes support}
+% \changes{v3.0a}{2004/01/18}{Minimum adaptation to \KOMAScript\ added}
+% \changes{v3.0h}{2005/08/22}{\KOMAScript\ compatibility options added}
+% \changes{v3.0i}{2005/11/17}{\KOMAScript\ compatibility commands added}
+% \changes{v3.0l}{2007/02/18}{\KOMAScript\ compatibility revised}
+% \changes{v3.1}{2007/03/17}{\KOMAScript\ compatibility options removed}
+% \changes{v3.1}{2007/04/05}{\KOMAScript\ compatibility revised \& enhanced}
+%
+% \begin{macrocode}
+\caption@ifkomaclass{%
+ \caption@InfoNoLine{KOMA-Script document class}%
+% \end{macrocode}
+%
+% Here we emulate the caption related commands and take over the caption
+% related settings from the \KOMAScript\ classes.
+%
+% \begin{macro}{\@tablecaptionabovetrue}
+% \begin{macro}{\@tablecaptionabovefalse}
+% \changes{v3.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
+% \begin{macrocode}
+ \g@addto@macro\@tablecaptionabovetrue{\captionsetup*[table]{position=t}}
+ \g@addto@macro\@tablecaptionabovefalse{\captionsetup*[table]{position=b}}
+% \end{macrocode}
+% \begin{macrocode}
+ \if@tablecaptionabove
+ \@tablecaptionabovetrue
+ \else
+ \@tablecaptionabovefalse
+ \fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@figurecaptionabovetrue}
+% \begin{macro}{\@figurecaptionabovefalse}
+% \changes{v3.3}{2013/02/15}{Support of \cs{@figurecaptionabovetrue} added}
+% \begin{macrocode}
+ \caption@ifundefined\@figurecaptionabovetrue{}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \g@addto@macro\@figurecaptionabovetrue{\captionsetup*[figure]{position=t}}
+ \g@addto@macro\@figurecaptionabovefalse{\captionsetup*[figure]{position=b}}
+% \end{macrocode}
+% \begin{macrocode}
+ \if@figurecaptionabove
+ \@figurecaptionabovetrue
+ \else
+ \@figurecaptionabovefalse
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ }%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\onelinecaptionstrue}
+% \begin{macro}{\onelinecaptionsfalse}
+% \changes{v3.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
+% \begin{macrocode}
+ \g@addto@macro\onelinecaptionstrue{\let\caption@ifslc\@firstoftwo}
+ \g@addto@macro\onelinecaptionsfalse{\let\caption@ifslc\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+ \ifonelinecaptions
+ \onelinecaptionstrue
+ \else
+ \onelinecaptionsfalse
+ \fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@captionabovetrue}
+% \begin{macro}{\@captionabovefalse}
+% \changes{v3.0j}{2006/03/21}{Bugfix 06-03-21:
+% \cs{let}\cs{caption@setposition}\cs{@gobble} added}
+% \changes{v3.0n}{2006/03/09}{Accidentally this got broken in \version{3.0m}, fixed}
+% \changes{v3.1}{2007/03/31}{We redefine \cs{captionabovetrue/false} now
+% instead of \cs{captionabove/below}}
+% \changes{v3.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
+% \changes{v3.1k}{2009/10/09}{\opt{figureposition} and \opt{tableposition} will issue a warning now}
+% Please note that these are stronger than the \opt{position} setting, therefore we
+% override the options \opt{figureposition} and \opt{tableposition} to typeout a warning.
+% \begin{macrocode}
+ \g@addto@macro\@captionabovetrue{\let\caption@position\@firstoftwo}
+ \g@addto@macro\@captionabovefalse{\let\caption@position\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionOption{figureposition}{%
+ \caption@WarningNoLine{Option `figureposition=#1' has no effect\MessageBreak
+ when used with a KOMA script document class}}
+ \DeclareCaptionOption{tableposition}{%
+ \caption@WarningNoLine{Option `tableposition=#1' has no effect\MessageBreak
+ when used with a KOMA script document class}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\setcapindent}
+% \begin{macrocode}
+ \let\caption@KOMA@setcapindent\@setcapindent
+ \renewcommand*\@setcapindent[1]{%
+ \caption@KOMA@setcapindent{#1}\caption@setcapindent}
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@KOMA@@setcapindent\@@setcapindent
+ \renewcommand*\@@setcapindent[1]{%
+ \caption@KOMA@@setcapindent{#1}\caption@setcapindent}
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\caption@setcapindent{%
+ \captionsetup{indent=\ifdim\cap@indent<\z@\z@\else\cap@indent\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \caption@ifundefined\cap@indent{}{\caption@setcapindent}
+% \end{macrocode}
+%
+% \begin{macro}{\setcapwidth}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
+% \Note{The optional argument of \cs{setcapwidth} if not supported (yet),
+% so we issue a warning if used.
+% (Since this does not seem to have an negative effect when used
+% by the \texttt{captionbeside} environment, we suppress the warning here.)}
+% \begin{macrocode}
+ \expandafter\let\expandafter\caption@KOMA@setcapwidth
+ \csname\string\setcapwidth\endcsname
+ \@namedef{\string\setcapwidth}[#1]#2{%
+ \caption@KOMA@setcapwidth[{#1}]{#2}\caption@setcapwidth{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\caption@setcapwidth[1]{%
+ \ifx\\#1\\\else
+ \caption@ifundefined\cap@margin{}{%
+ \def\@tempa{captionbeside}%
+ \ifx\@tempa\@currenvir\else\caption@Warning{%
+ Ignoring optional argument [#1] of \string\setcapwidth\MessageBreak}%
+ \fi}%
+ \fi
+ \captionsetup{width=\cap@width}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \def\caption@tempa{\hsize}%
+ \ifx\caption@tempa\cap@width \else
+ \caption@setcapwidth{?}
+ \fi
+% \end{macrocode}
+%
+% \begin{macro}{\setcapmargin}
+% \begin{macrocode}
+ \expandafter\let\expandafter\caption@KOMA@setcapmargin
+ \csname\string\@setcapmargin\endcsname
+ \@namedef{\string\@setcapmargin}[#1]#2{%
+ \caption@KOMA@setcapmargin[{#1}]{#2}\caption@setcapmargin}
+% \end{macrocode}
+% \begin{macrocode}
+ \expandafter\let\expandafter\caption@KOMA@@setcapmargin
+ \csname\string\@@setcapmargin\endcsname
+ \@namedef{\string\@@setcapmargin}[#1]#2{%
+ \caption@KOMA@@setcapmargin[{#1}]{#2}\caption@setcapmargin}
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\caption@setcapmargin{%
+ \begingroup
+ \let\onelinecaptionsfalse\relax
+ \def\@twoside{0}%
+ \def\if@twoside{\def\@twoside{1}\iffalse}%
+ \cap@margin
+ \def\@tempa{\endgroup}%
+ \ifx\cap@left\hfill\else\ifx\cap@right\hfill\else
+ \def\hspace##1##{\@firstofone}%
+ \edef\@tempa{\endgroup
+ \noexpand\captionsetup{%
+ twoside=\@twoside,slc=0,%
+ margin={\cap@left,\cap@right}}}%
+ \fi\fi
+ \@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \ifx\cap@margin\relax \else
+ \caption@setcapmargin
+ \fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsection{Processing of options}
+%
+% \changes{v3.0m}{2007/03/04}{Verbose option added}
+% \changes{v3.1}{2007/07/02}{Verbose option removed from package}
+%
+% \changes{v3.1}{2007/03/17}{We do not process global options anymore}
+% \begin{macrocode}
+\caption@SetupOptions{caption}{\caption@setkeys{#1}{#2}}
+\caption@ProcessOptions*{caption}
+% \end{macrocode}
+%
+% \subsection{\cs{caption}, \cs{@caption}, and \cs{@makecaption}}
+%
+% \begin{macro}{\caption@ifflag}
+% \changes{v3.3}{2011/12/28}{This switch added}
+% \changes{v3.3}{2018/08/08}{Rewritten (and renamed) so a counter is used instead of a switch}
+% Since we support continued floats and sub-figures it's not an easy task
+% to manage the figure (and table) counter. (Especially since previous versions
+% of the caption package has proven that correcting a counter locally is not a good idea.)
+%
+% These three switches hold the
+% current status: |\caption@if|\-|flag{2}| is set if the caption was already
+% typeset (so the counter doesn't need to be incremented for sub-figures),
+% |\caption@if|\-|flag{4}| is set if there is already content which have
+% incremented the counter (so the counter doesn't need to be incremented
+% for the main caption, further sub-figures, and other stuff), and
+% |\caption@if|\-|flag{1}| is set if |\Continued|\-|Float| was given.
+%
+% In the past three boolean switches were used to store the flags, but since some
+% packages (like the \package{floatrow} and \package{tabu} package) try hard to keep
+% counter changes locally under certain circumstances, it seems a good idea to make
+% these flags a counter value, too.
+% \begin{macrocode}
+\newcounter{caption@flags}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@ifflag[1]{%
+ \@tempcnta\c@caption@flags
+ \divide\@tempcnta #1\relax
+ \ifodd\@tempcnta
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@clrflags}
+% \changes{v3.3}{2018/08/08}{This macro added}
+% \begin{macro}{\caption@clrflag}
+% \changes{v3.3}{2013/04/14}{This macro added}
+% \changes{v3.3}{2018/08/08}{Rewritten so a counter is used instead of a switch}
+% \begin{macro}{\caption@setflag}
+% \changes{v3.3}{2013/04/14}{This macro added}
+% \changes{v3.3}{2018/08/08}{Rewritten so a counter is used instead of a switch}
+% Furthermore we introduce the macros \cs{caption@clrflag} and \cs{caption@setflag}
+% for clearing resp.~setting these flags.
+% \begin{macrocode}
+\newcommand*\caption@clrflags{%
+ \setcounter{caption@flags}\z@}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@clrflag[1]{%
+ \caption@ifflag{#1}{\caption@addtoflags{-#1}}{}}
+\newcommand*\caption@setflag[1]{%
+ \caption@ifflag{#1}{}{\caption@addtoflags{#1}}}
+\newcommand*\caption@addtoflags{%
+ \addtocounter{caption@flags}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@caption}
+% \changes{v3.0f}{2005/05/22}{Bugfix: \cs{ContinuedFloat} added}
+% \changes{v3.0f}{2005/06/13}{Support of \cs{caption*[]} removed}
+% \changes{v3.0l}{2007/01/19}{Minimal support of \textsf{combine} package added}
+% \changes{v3.1}{2007/02/04}{Re-written, does not save\&use original definition anymore}
+% Here comes our definition of |\caption| and |\caption*|.
+% Beside the support of the starred variant this code was adapted to the
+% various packages we support.
+% We are using |\caption@dblarg| instead of |\@dblarg| so |\caption{}|
+% (with an empty arg.) will produce a list-of entry, but |\caption[]{}|
+% won't.
+% \begin{macrocode}
+\def\caption@caption{%
+ \caption@iftype
+ {\caption@checkgrouplevel\@empty\caption
+ \caption@star
+ {\caption@refstepcounter\@captype}%
+ {\caption@dblarg{\@caption\@captype}}}%
+ {\caption@Error{\noexpand\caption outside float}%
+ \caption@gobble}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@star}
+% \changes{v3.1}{2007/06/24}{Renamed from \cs{caption@caption} to \cs{caption@star}}
+% \changes{v3.2c}{2011/08/21}{\cs{global} removed}
+% A helper macro which processes the optional |*| after |\caption|.
+% \begin{macrocode}
+\newcommand*\caption@star[2]{%
+ \@ifstar{\caption@startrue#2[]}{#1#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@caption}
+% \changes{v3.1}{2007/02/04}{Re-written, does not save\&use original definition anymore}
+% \changes{v3.1f}{2007/11/28}{Bugfix: Handling of \texttt{@minipage} flag added}
+% \changes{v3.1f}{2007/11/28}{Support of option \opt{@minipage} added}
+% \changes{v3.1g}{2008/03/16}{Internal: Uses \cs{caption@prepareanchor} now}
+% \changes{v3.2d}{2011/10/21}{Adapted to the \textsf{memoir} document class}
+% \changes{v3.2f}{2012/01/14}{Usage of \cs{M@gettitle} moved to \cs{caption@prepareanchor}}
+% \changes{v3.3}{2013/01/06}{Adapted to the \textsf{nag} package}
+% As above, our version has been adapted to the packages we support.
+% Additionally our code is nested by |\caption@beginex| \&
+% |\caption@end| instead of |\begingroup| \& |\endgroup|.
+% Furthermore we use |\caption@boxrestore| instead of |\@parboxrestore|
+% so this code also works correctly inside list-based environments
+% like |wide| \& |addmargin|. (This, and the fact that we use
+% |\linewidth| instead of |\hsize| inside |\@makecaption|, solves
+% \href{http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=latex/2472}%^^A
+% {\LaTeX\ PR \texttt{latex/2472}}.)
+% \begin{macrocode}
+\long\def\caption@@caption#1[#2]#3{%
+% \end{macrocode}
+% \begin{macrocode}
+ \ifcaption@star \else
+ \caption@prepareanchor{#1}{#2}%
+ \memcaptioninfo{#1}{\csname the#1\endcsname}{#2}{#3}%
+ \@nameuse{nag@hascaptiontrue}%
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \par
+ \caption@beginex{#1}{#2}{#3}%
+ \caption@setfloatcapt{%
+ \caption@boxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \caption@normalsize
+ \ifcaption@star
+ \let\caption@makeanchor\@firstofone
+ \fi
+ \@makecaption{\csname fnum@#1\endcsname}%
+ {\ignorespaces\caption@makeanchor{#3}}\par
+ \caption@if@minipage\@minipagetrue\@minipagefalse}%
+ \caption@end}
+% \end{macrocode}
+% \textsf{memoir} document class stuff:
+% \begin{macrocode}
+\providecommand\M@gettitle[1]{}
+\providecommand\memcaptioninfo[4]{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@prepareanchor}
+% \changes{v3.1g}{2008/03/16}{This macro added}
+% \changes{v3.2f}{2012/01/14}{Usage of \cs{M@gettitle} moved from \cs{caption@@caption}}
+% \begin{macrocode}
+\newcommand*\caption@prepareanchor[2]{%
+ \caption@makecurrent{#1}{#2}%
+ \caption@ifhypcap\caption@@start\relax
+ \M@gettitle{#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makecaption}
+% \changes{v3.1i}{2008/05/06}{Usage of \cs{caption@rule} added}
+% |\@makecaption|\marg{label}\marg{text}\par
+% We do basically the same as the original code (from the standard
+% \LaTeX\ document classes), but take care of the |position=| setting
+% and use |\caption@@make| from the \package{caption} kernel to finally
+% typeset the caption.
+% \begin{macrocode}
+\long\def\caption@makecaption#1#2{%
+ \caption@make@above
+ \caption@@make{#1}{#2}%
+ \caption@make@below}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@make@above}
+% \begin{macro}{\caption@make@below}
+% \changes{v3.3a}{2019/04/02}{This macro added}
+% |\caption@make@above|\\
+% |\caption@make@below|\par
+% Typesets the stuff above resp.~below the caption, depending on |\caption@iftop|.
+% \begin{macrocode}
+\newcommand*\caption@make@above{%
+ \caption@iftop
+ \caption@belowskip
+ {\caption@rule\caption@aboveskip}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@make@below{%
+ \caption@iftop
+ {\caption@aboveskip\caption@rule}%
+ \caption@belowskip}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@aboveskip}
+% \begin{macro}{\caption@belowskip}
+% \changes{v3.3a}{2019/04/02}{This macro added}
+% |\caption@aboveskip|\\
+% |\caption@belowskip|\par
+% Typesets the skip above resp.~below the caption.
+% \begin{macrocode}
+\newcommand*\caption@aboveskip{%
+ \vskip\abovecaptionskip}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@belowskip{%
+ \vskip\belowcaptionskip}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@redefine}
+% \changes{v3.1k}{2009/03/30}{This macro added, it contains the patching code now}
+% We only redefine |\caption| and |\@caption| if the current definitions
+% are well known, so documents written in the old (\package{caption}
+% package \version{1.x}) days (where |\caption| \& |\@caption| were not
+% redefined by us) will still compile fine.
+% For example the usage of the (now obsolete) \package{captcont} package,
+% which brings its own definition of |\caption*|, was quite common these days.
+% \begin{macrocode}
+\newcommand*\caption@redefine{}
+\g@addto@macro\caption@redefine{%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@setbool{incompatible}{0}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\caption{%
+ % ltfloat.dtx [2002/10/01 v1.1v LaTeX Kernel (Floats)]
+ \def\caption{%
+ \ifx\@captype\@undefined
+ \@latex@error{\noexpand\caption outside float}\@ehd
+ \expandafter\@gobble
+ \else
+ \refstepcounter\@captype
+ \expandafter\@firstofone
+ \fi
+ {\@dblarg{\@caption\@captype}}%
+ }}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\caption{%
+ % beamerbaselocalstructure.sty,v 1.53 2007/01/28 20:48:21 tantau
+ \def\caption{
+ \ifx\@captype\@undefined
+ \@latex@error{\noexpand\caption outside figure or table}\@ehd
+ \expandafter\@gobble
+ \else
+ \refstepcounter\@captype
+ \expandafter\@firstofone
+ \fi
+ {\@dblarg{\@caption\@captype}}%
+ }}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\caption{%
+ % beamerbaselocalstructure.sty, Joseph Wright committed 4ac715c 2013-09-04
+ \def\caption{%
+ \ifx\@captype\@undefined
+ \@latex@error{\noexpand\caption outside figure or table}\@ehd
+ \expandafter\@gobble
+ \else
+ \refstepcounter\@captype
+ \expandafter\@firstofone
+ \fi
+ {\@dblarg{\@caption\@captype}}%
+ }}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\caption{%
+ % float.sty [2001/11/08 v1.3d Float enhancements (AL)]
+ \long\def\caption{%
+ \ifx\@captype\@undefined
+ \@latex@error{\noexpand\caption outside float}\@ehd
+ \expandafter\@gobble
+ \else
+ \refstepcounter\@captype
+ \let\@tempf\@caption
+ \expandafter\ifx\csname @float@c@\@captype\endcsname\relax\else
+ \expandafter\expandafter\let
+ \expandafter\@tempf\csname @float@c@\@captype\endcsname
+ \fi
+ \fi
+ \@dblarg{\@tempf\@captype}}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\caption{%
+ % hyperref.sty [2007/02/27 v6.75t Hypertext links for LaTeX]
+ % hyperref.sty [2007/04/09 v6.76a Hypertext links for LaTeX]
+ % hyperref.sty [2007/06/12 v6.76h Hypertext links for LaTeX]
+ \def\caption{%
+ \ifx\@captype\@undefined
+ \@latex@error{\noexpand\caption outside float}\@ehd
+ \expandafter\@gobble
+ \else
+ \H@refstepcounter\@captype
+ \@ifundefined{fst@\@captype}{%
+ \let\Hy@tempa\@caption
+ }{%
+ \let\Hy@tempa\Hy@float@caption
+ }%
+ \expandafter\@firstofone
+ \fi
+ {\@dblarg{\Hy@tempa\@captype}}%
+ }}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\caption{%
+ % hyperref.sty [2007/08/05 v6.76j Hypertext links for LaTeX]
+ \def\caption{%
+ \ifx\@captype\@undefined
+ \@latex@error{\noexpand\caption outside float}\@ehd
+ \expandafter\@gobble
+ \else
+ \H@refstepcounter\@captype
+ \let\Hy@tempa\@caption
+ \@ifundefined{float@caption}{%
+ }{%
+ \expandafter\ifx\csname @float@c@\@captype\endcsname\float@caption
+ \let\Hy@tempa\Hy@float@caption
+ \fi
+ }%
+ \expandafter\@firstofone
+ \fi
+ {\@dblarg{\Hy@tempa\@captype}}%
+ }}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\caption{%
+ % memhfixc.sty [2010/08/17 v1.15 nameref/hyperref package fixes for memoir class]
+ % \let\m@moldhypcaption\caption
+ \long\def\caption{\donemaincaptiontrue\m@moldhypcaption}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@IfCheckCommand{}{%
+ \caption@InfoNoLine{%
+ Incompatible package detected (regarding \string\caption).\MessageBreak
+ \string\caption\space=\space\meaning\caption}%
+ \caption@setbool{incompatible}{1}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % ltfloat.dtx [2002/10/01 v1.1v LaTeX Kernel (Floats)]
+ \long\def\@caption#1[#2]#3{%
+ \par
+ \addcontentsline{\csname ext@#1\endcsname}{#1}%
+ {\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+ \endgroup}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % beamerbaselocalstructure.sty,v 1.53 2007/01/28 20:48:21 tantau
+ \long\def\@caption#1[#2]#3{% second argument ignored
+ \par\nobreak
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \beamer@makecaption{#1}{\ignorespaces #3}\par\nobreak
+ \endgroup}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % memhfixc.sty [2010/08/17 v1.15 nameref/hyperref package fixes for memoir class]
+ \long\def\@caption#1[#2]#3{%
+ \MNR@old@caption{#1}[{#2}]{#3}%
+ \def\@currentlabelname{#2}%
+ \M@gettitle{#2}%
+ }}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % arabicore.sty [2006/01/01 v1.0 Arabi Core switching commands (may still change)]
+ \long\def\@caption#1[#2]#3{%
+ \par
+ \addtocontents{\csname ext@#1\endcsname}{\xstring\select@language{\main@Arabi@language}}%
+ \addcontentsline{\csname ext@#1\endcsname}{#1}%
+ {\protect\numberline{\csname the#1\endcsname}{\ignorespaces \if@rl{\textRL{#2}}\else\textLR{#2}\fi}}%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces \if@rl{\textRL{#3}}\else\textLR{#3}\fi}\par
+ \endgroup}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % rlbabel.def [2005/03/30 v2.3h Right-to-Left support from the babel system Hebrew language support from the babel system]
+ \long\def\@caption#1[#2]#3{%
+ \par
+ \addcontentsline{\csname ext@#1\endcsname}{#1}%
+ {\protect\numberline{\csname the#1\endcsname}%
+ {\ignorespaces #2}}%
+ \def\@fignm{figure}
+ \ifx#1\@fignm\addcontentsline{fol}{#1}%
+ {\protect\numberline{\csname the#1\endcsname}%
+ {\ignorespaces #2}}\fi%
+ \def\@tblnm{table}
+ \ifx#1\@tblnm\addcontentsline{tol}{#1}%
+ {\protect\numberline{\csname the#1\endcsname}%
+ {\ignorespaces #2}}\fi%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+ \endgroup}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % magyar.ldf [2005/03/30 v1.4j Magyar support from the babel system]
+ \long\def\@caption#1[#2]#3{%
+ \csname par\endcsname
+ \addcontentsline{\csname ext@#1\endcsname}{#1}%
+ {\protect\numberline{\csname the#1\endcsname.}{\ignorespaces #2}}%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \@makecaption{\csname fnum@#1\endcsname}%
+ {\ignorespaces #3}\csname par\endcsname
+ \endgroup}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+% \caption@CheckCommand\float@caption{%
+% % float.sty [2001/11/08 v1.3d Float enhancements (AL)]
+% \long\def\float@caption#1[#2]#3{%
+% \addcontentsline{\@nameuse{ext@#1}}{#1}%
+% {\protect\numberline{\@nameuse{the#1}}{\ignorespaces #2}}
+% \global\setbox\@floatcapt\vbox\bgroup\@parboxrestore
+% \normalsize\@fs@capt{\@nameuse{fnum@#1}}{\ignorespaces #3}%
+% \@ifnextchar[{\float@ccon}{\egroup}}%
+% \long\def\float@ccon[#1]{#1\par\egroup}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % hyperref.sty [2007/02/27 v6.75t Hypertext links for LaTeX]
+ \long\def\@caption#1[#2]#3{%
+ \hyper@makecurrent{\@captype}%
+ \def\@currentlabelname{#2}%
+ \par\addcontentsline{\csname ext@#1\endcsname}{#1}{%
+ \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}%
+ }%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \@makecaption{\csname fnum@#1\endcsname}{%
+ \ignorespaces
+ \ifHy@nesting
+ \hyper@@anchor{\@currentHref}{#3}%
+ \else
+ \Hy@raisedlink{\hyper@@anchor{\@currentHref}{\relax}}#3%
+ \fi
+ }%
+ \par
+ \endgroup
+ }}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % hyperref.sty [2007/04/09 v6.76a Hypertext links for LaTeX]
+ % hyperref.sty [2007/06/12 v6.76h Hypertext links for LaTeX]
+ % hyperref.sty [2007/08/05 v6.76j Hypertext links for LaTeX]
+ \long\def\@caption#1[#2]#3{%
+ \expandafter\ifx\csname if@capstart\expandafter\endcsname
+ \csname iftrue\endcsname
+ \global\let\@currentHref\hc@currentHref
+ \else
+ \hyper@makecurrent{\@captype}%
+ \fi
+ \def\@currentlabelname{#2}%
+ \par\addcontentsline{\csname ext@#1\endcsname}{#1}{%
+ \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}%
+ }%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \expandafter\ifx\csname if@capstart\expandafter\endcsname
+ \csname iftrue\endcsname
+ \global\@capstartfalse
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces#3}%
+ \else
+ \@makecaption{\csname fnum@#1\endcsname}{%
+ \ignorespaces
+ \ifHy@nesting
+ \hyper@@anchor{\@currentHref}{#3}%
+ \else
+ \Hy@raisedlink{\hyper@@anchor{\@currentHref}{\relax}}#3%
+ \fi
+ }%
+ \fi
+ \par
+ \endgroup
+ }}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % hyperref.sty [2009/11/27 v6.79k Hypertext links for LaTeX]
+ \long\def\@caption#1[#2]#3{%
+ \expandafter\ifx\csname if@capstart\expandafter\endcsname
+ \csname iftrue\endcsname
+ \global\let\@currentHref\hc@currentHref
+ \else
+ \hyper@makecurrent{\@captype}%
+ \fi
+ \def\@currentlabelname{#2}%
+ \par\addcontentsline{\csname ext@#1\endcsname}{#1}{%
+ \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}%
+ }%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \expandafter\ifx\csname if@capstart\expandafter\endcsname
+ \csname iftrue\endcsname
+ \global\@capstartfalse
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces#3}%
+ \else
+ \@makecaption{\csname fnum@#1\endcsname}{%
+ \ignorespaces
+ \ifHy@nesting
+ \expandafter\hyper@@anchor\expandafter{\@currentHref}{#3}%
+ \else
+ \Hy@raisedlink{%
+ \expandafter\hyper@@anchor\expandafter{\@currentHref}{\relax}%
+ }%
+ #3%
+ \fi
+ }%
+ \fi
+ \par
+ \endgroup
+ }}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % hyperref.sty [2009/12/09 v6.79m Hypertext links for LaTeX]
+ % hyperref.sty [2009/12/28 v6.79z Hypertext links for LaTeX]
+ \long\def\@caption#1[#2]#3{%
+ \expandafter\ifx\csname if@capstart\expandafter\endcsname
+ \csname iftrue\endcsname
+ \global\let\@currentHref\hc@currentHref
+ \else
+ \hyper@makecurrent{\@captype}%
+ \fi
+ \@ifundefined{NR@gettitle}{%
+ \def\@currentlabelname{#2}%
+ }{%
+ \NR@gettitle{#2}%
+ }%
+ \par\addcontentsline{\csname ext@#1\endcsname}{#1}{%
+ \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}%
+ }%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \expandafter\ifx\csname if@capstart\expandafter\endcsname
+ \csname iftrue\endcsname
+ \global\@capstartfalse
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces#3}%
+ \else
+ \@makecaption{\csname fnum@#1\endcsname}{%
+ \ignorespaces
+ \ifHy@nesting
+ \expandafter\hyper@@anchor\expandafter{\@currentHref}{#3}%
+ \else
+ \Hy@raisedlink{%
+ \expandafter\hyper@@anchor\expandafter{%
+ \@currentHref
+ }{\relax}%
+ }%
+ #3%
+ \fi
+ }%
+ \fi
+ \par
+ \endgroup
+ }}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % nameref.sty [2006/12/27 v2.28 Cross-referencing by name of section]
+ \long\def\@caption#1[#2]{%
+ \def\@currentlabelname{#2}%
+ \NR@@caption{#1}[{#2}]%
+ }}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % nameref.sty [2009/11/27 v2.32 Cross-referencing by name of section]
+ \long\def\@caption#1[#2]{%
+ \NR@gettitle{#2}%
+ \NR@@caption{#1}[{#2}]%
+ }}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % subfigure.sty [2002/07/30 v2.1.4 subfigure package]
+ \long\def\@caption#1[#2]#3{%
+ \@ifundefined{if#1topcap}%
+ {\subfig@oldcaption{#1}[{#2}]{#3}}%
+ {\@nameuse{if#1topcap}%
+ \@listsubcaptions{#1}%
+ \subfig@oldcaption{#1}[{#2}]{#3}%
+ \else
+ \subfig@oldcaption{#1}[{#2}]{#3}%
+ \@listsubcaptions{#1}%
+ \fi}}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % subfig.sty [2005/06/28 ver: 1.3 subfig package]
+ \def\@caption{\caption@}%
+% \long\def\caption@#1[#2]#3{%
+% \@ifundefined{caption@setfloattype}%
+% \caption@settype
+% \caption@setfloattype
+% \@captype
+% \sf@ifpositiontop{%
+% \@listsubcaptions{#1}%
+% \sf@old@caption{#1}[{#2}]{#3}%
+% }{%
+% \sf@old@caption{#1}[{#2}]{#3}%
+% \@listsubcaptions{#1}%
+% }}%
+ }%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % chkfloat.sty [2012/08/19 v0.1 chkfloat: check for moved floats]
+ \def\@caption#1[#2]#3{\chkfloat@caption{#1}[#2]{#3}%
+ \addtocontents{fof}{\protect\chkfloat@{\thepage}{\chkfloat@page}{\csname fnum@#1\endcsname: #2}}%
+ }}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@caption{%
+ % chkfloat.sty [20??/??/?? v0.? chkfloat: check for moved floats]
+ \def\@caption#1[#2]#3{\chkfloat@caption{#1}[{#2}]{#3}%
+ \chkfloat@addcontentsline{#1}{#2}%
+ }}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@IfCheckCommand{}{%
+ \caption@InfoNoLine{%
+ Incompatible package detected (regarding \string\@caption).\MessageBreak
+ \string\@caption\space=\space\meaning\@caption}%
+ \caption@setbool{incompatible}{1}}%
+% \end{macrocode}
+%
+% The option |compatibility=| will override the compatibility mode.
+% \begin{macrocode}
+ \caption@ifundefined\caption@ifcompatibility
+ {\let\caption@ifcompatibility\caption@ifincompatible
+ \let\caption@tempa\caption@WarningNoLine}%
+ {\let\caption@tempa\@gobble}% suppress warning
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@ifcompatibility{%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@tempa{%
+ \noexpand\caption will not be redefined since it's already\MessageBreak
+ redefined by a document class or package which is\MessageBreak
+ unknown to the caption package}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \renewcommand*\caption@redefine{}%
+% \end{macrocode}
+%
+% |\ContinuedFloat| is not supported in compatibility mode.
+% \begin{macrocode}
+ \renewcommand*\caption@ContinuedFloatX[1]{%
+ \caption@Error{Not available in compatibility mode}}%
+% \end{macrocode}
+%
+% |\caption@start| is not supported in compatibility mode.
+% \begin{macrocode}
+ \caption@AtBeginDocument*{%
+ \let\caption@start\relax
+ \caption@ifundefined\caption@ORI@capstart{}{%
+ \caption@Debug{%
+ Restore hypcap definition of \string\capstart\@gobble}%
+ \let\capstart\caption@ORI@capstart}%
+ }%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@star}
+% We redefine |\caption@star| here so it does not make any harm.
+% \begin{macrocode}
+ \renewcommand*\caption@star[2]{#1#2}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ }{%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@ifincompatible{%
+ \caption@WarningNoLine{%
+ Forced redefinition of \noexpand\caption since the\MessageBreak
+ unsupported(!) package option `compatibility=false'\MessageBreak
+ was given}%
+ }{}%
+% \end{macrocode}
+%
+% \begin{macro}{\caption}
+% \begin{macro}{\@caption}
+% \begin{macrocode}
+ \renewcommand*\caption@redefine{%
+ \let\caption\caption@caption
+ \let\@caption\caption@@caption}%
+ \caption@redefine
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+ }%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@AtBeginDocument*{%
+ \let\caption@ORI@capstart\@undefined}%
+% \end{macrocode}
+%
+% \begin{macro}{\@xfloat}
+% \changes{v3.1}{2007/05/09}{This re-definition added}
+% \changes{v3.1b}{2007/09/22}{Will now be redefined in compatibility mode, too}
+% We redefine |\@xfloat| so inside floating environments our
+% type-specific options will be used, a \package{hyperref}
+% anchor will be set etc.
+% \begin{macrocode}
+ \let\caption@ORI@xfloat\@xfloat
+ \def\@xfloat#1[#2]{%
+ \caption@ORI@xfloat{#1}[#2]%
+ \caption@settype{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% Some packages (like the \package{hyperref} package for example) redefines
+% |\caption| and |\@caption|, too.
+% So we have to use |\AtBeginDocument| here, so we can make sure
+% our definition is the one which will be valid at last.
+% \begin{macrocode}
+\caption@AtBeginDocument{\caption@redefine}
+% \end{macrocode}
+%
+% \begin{macro}{\@makecaption}
+% \begin{macrocode}
+\let\@makecaption\caption@makecaption
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\phantomcaption}
+% \changes{v3.2}{2010/10/31}{Bugfix 10-09-01b: This macro added}
+% |\phantomcaption|\par
+% Use this one for figures with subcaptions but without main caption.
+% \begin{macrocode}
+\newcommand\phantomcaption{%
+ \caption@iftype
+ {\caption@refstepcounter\@captype}%
+ {\caption@Error{\noexpand\phantomcaption outside float}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{captionof}}
+%
+% \changes{v3.0d}{2004/08/03}{Option \opt{type=} added}
+% \changes{v3.1}{2007/06/25}{Option \opt{type*=} added}
+% \changes{v3.1f}{2007/11/16}{Option \opt{subtype} \& \opt{subtype*} added}
+% \changes{v3.2}{2010/10/24}{Bugfix 10-10-17: Option \opt{type=} uses \cs{setcaptiontype} instead of \cs{caption@settype} now}
+%
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionOption{type}{\setcaptiontype{#1}}%
+ \DeclareCaptionOption{type*}{\setcaptiontype*{#1}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionOptionNoValue{subtype}{\setcaptionsubtype\relax}%
+ \DeclareCaptionOptionNoValue{subtype*}{\setcaptionsubtype*}%
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \emph{Important Note:}
+% Like |\captionof| the option |type=| should only be used inside a
+% group, box, or environment and does not check if the argument is a valid
+% floating environment or not.
+%
+% \begin{macro}{\setcaptiontype}
+% \changes{v3.2}{2010/10/24}{This macro added}
+% Like |\captionsetup{type=xxx}|, but also works if \cs{captionsetup} was redefined.
+% \begin{macrocode}
+\newcommand\setcaptiontype{%
+ \caption@boxrestore@mini
+ \caption@settype}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\setcaptionsubtype}
+% \changes{v3.2a}{2011/08/15}{This macro added}
+% Same, but sets the sub-type.
+% \begin{macrocode}
+\newcommand\setcaptionsubtype{%
+ \caption@iftype
+ \caption@setsubtype
+ {\caption@Error{\noexpand\setcaptionsubtype outside float}}}%
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@setsubtype{%
+ \@ifstar
+ {\caption@@settype{sub}*{sub\@captype}}%
+ {\caption@@settype{sub}{sub\@captype}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@settype}
+% \changes{v3.1}{2007/05/09}{This macro added}
+% \changes{v3.1b}{2007/09/22}{Usage of \cs{caption@xlabel} added}
+% \changes{v3.1d}{2007/10/23}{Error message for \cs{caption@checkgrouplevel} revised}
+% \changes{v3.1f}{2007/11/16}{\cs{caption@setsubtype} added}
+% \changes{v3.1f}{2007/12/03}{Crappy \cs{caption@iftypewarning} replaced}
+% \changes{v3.1g}{2008/01/12}{Usage of \cs{ifcaptionsetup@star} added}
+% \changes{v3.2}{2010/10/26}{Error message moved from here to \cs{caption@refstepcounter}}
+% \changes{v3.3}{2011/12/28}{Resetting of \cs{ifcaption@caption} and \cs{ifcaption@subcaption} added}
+% |\caption@settype*|\marg{type}\par
+% sets |\@captype| and executes the options associated with it
+% (using |\caption@set|\-|options|).
+% Furthermore we check |\current|\-|group|\-|level| (if avail),
+% redefine |\@currentlabel| so a |\label| before |\caption| will result
+% in a hint instead of a wrong reference, and
+% use the macro |\caption@|(|sub|)|type|\-|hook| (which will be used by our
+% \package{float} package support).\par
+% The non-starred version sets a \package{hyperref} anchor additionally
+% (if |hypcap=|\-|true| and the \package{hypcap} package is not loaded).
+% \begin{macrocode}
+\newcommand*\caption@settype{%
+ \caption@clrflags
+ \caption@set@type}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@set@type{%
+ \caption@@settype{}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@settype[1]{%
+ \caption@teststar{\caption@@@settype{#1}}\@firstoftwo\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@settype[3]{%
+% #1 = "" or "sub"
+% #2 = \@firstoftwo in star form, \@secondoftwo otherwise
+% #3 = <type>, e.g. "figure" or "table"
+ \caption@Debug{#1type=#3}%
+ \caption@checkgrouplevel{#1}{%
+ \captionsetup{#1type#2*\@empty=...}#2{ or
+ \@backslashchar#1captionof}{}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \edef\caption@tempa{#3}%
+ \expandafter\ifx\csname @#1captype\endcsname\caption@tempa \else
+ \ifcaptionsetup@star\else\@nameuse{caption@#1type@warning}\fi
+ \fi
+ \expandafter\let\csname @#1captype\endcsname\caption@tempa
+% \end{macrocode}
+% \begin{macrocode}
+ \@nameuse{caption@#1typehook}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@setoptions{#3}%
+ \ifx\caption@opt\relax
+ \@nameundef{caption@#1type@warning}%
+ \else
+ \@namedef{caption@#1type@warning}{\caption@Warning{%
+ The #1caption type was already set to
+ `\csname @#1captype\endcsname'\MessageBreak}}%
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ #2{}{%
+ \let\@currentlabel\caption@undefinedlabel
+% \let\@currentHlabel\@undefined
+ \ifx\caption@x@label\@undefined
+ \let\caption@x@label\label
+ \let\label\caption@xlabel
+ \fi
+ \caption@start}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@typehook}
+% Hook which will be used inside |\caption@set|\-|type|.
+% It will be extended later on, e.g.~by our \package{float} package
+% support.
+% \begin{macrocode}
+\newcommand*\caption@typehook{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@iftype}
+% \changes{v3.1}{2007/04/11}{This macro and its usage added}
+% Since we often need to check if |\@captype| is defined (means: we
+% are inside a floating environment) this helper macro was introduced.
+% \begin{macrocode}
+\newcommand*\caption@iftype{%
+ \caption@ifundefined\@captype\@secondoftwo\@firstoftwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@checkgrouplevel}
+% \changes{v3.1}{2007/07/15}{This macro and its usage added}
+% \changes{v3.1f}{2007/11/28}{Error changed to warning (compatibility)}
+% \changes{v3.3}{2013/04/21}{Uses \cs{caption@ifeTeX} now}
+% Checks if |\captionsetup{type=|\ldots|}| or |\caption| is done
+% inside a group or not -- in the latter case a warning message will
+% be issued. (needs \eTeX)
+% \begin{macrocode}
+\caption@ifeTeX{%
+ \newcommand*\caption@checkgrouplevel[2]{%
+ \@ifundefined{#1caption@grouplevel}{%
+ \caption@ifundefined\caption@grouplevel{\let\caption@grouplevel\z@}{}%
+ \ifnum\currentgrouplevel>\caption@grouplevel\relax
+ \expandafter\edef\csname #1caption@grouplevel\endcsname{%
+ \the\currentgrouplevel}%
+ \else
+ \caption@Warning{\string#2\MessageBreak outside box or environment}%
+ \fi
+ }{}}%
+}{%
+ \let\caption@checkgrouplevel\@gobbletwo
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@undefinedlabel}
+% \changes{v3.1}{2007/07/03}{This macro and its usage added}
+% \changes{v3.1b}{2007/09/22}{Contents changed to \texttt{??}}
+% \changes{v3.1i}{2008/04/13}{Contents changed to \cs{caption@xref}(\ldots)}
+% \changes{v3.1k}{2009/03/30}{Bugfix 08-12-08: \cs{caption@xref} is robust now}
+% \changes{v3.2c}{2011/09/13}{Text changed from `before' to `without proper'}
+% \changes{v3.3}{2016/02/21}{Text changed from `without proper \cs{caption}' to `without proper reference'}
+% This label will be used for |\currentlabel| inside (floating) environments
+% as default. (see above)
+% \iffalse\Note{All commands used have to be robust here.}\fi
+% \begin{macrocode}
+\newcommand*\caption@undefinedlabel{%
+ \protect\caption@xref{\caption@labelname}{\on@line}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareRobustCommand*\caption@xref[2]{%
+ \caption@WarningNoLine{\noexpand\label without proper reference#2}%
+ \@setref\relax\@undefined{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@labelname{??}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@xlabel}
+% \changes{v3.1b}{2007/09/22}{This macro and its usage added}
+% \changes{v3.1f}{2007/11/11}{Revised}
+% \changes{v3.1i}{2008/04/13}{Bugfix: \cs{pageref} should always work now}
+% \changes{v3.2c}{2011/08/19}{Works with optional arguments now, too}
+% The new code of |\label| inside floating environments.
+% |\label| will be redefined using |\caption@withoptargs|, so
+% |#1| are the optional arguments (if any), and
+% |#2| is the mandatory argument here.
+% \begin{macrocode}
+\newcommand*\caption@xlabel{%
+ \caption@withoptargs\caption@@xlabel}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@xlabel[2]{%
+ \caption@@@xlabel
+ \def\caption@labelname{#2}%
+ \caption@x@label#1{#2}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@xlabel{%
+ \global\let\caption@@@xlabel\@empty
+ \@bsphack
+ \protected@write\@auxout{}%
+ {\string\providecommand*\string\caption@xref[2]{%
+ \string\@setref\string\relax\string\@undefined{\string##1}}}%
+ \@esphack}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionof}
+% \changes{v3.1}{2007/05/09}{Uses \cs{caption@settype} instead of \cs{def}\cs{@captype}}
+% \changes{v3.1c}{2007/09/22}{Bugfix: Redefinition of \cs{caption@setfloatcapt} removed}
+% \changes{v3.1e}{2007/10/30}{Better compatibility: Will be defined with \cs{AtBeginDocument} now}
+% \changes{v3.2}{2010/10/24}{Bugfix 10-10-17: Uses \cs{setcaptiontype} instead of \cs{caption@settype} now}
+% |\captionof|\marg{type}\oarg{lst\_entry}\marg{heading}\\
+% |\captionof*|\oarg{lst\_entry}\marg{heading}\par
+% \Note{This will be defined with \cs{AtBeginDocument} so
+% \cs{usepackage}\csmarg{caption,capt-of} will still work.
+% (Compatibility to \version{1.x})}
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \def\captionof{\caption@teststar\caption@of{\caption*}\caption}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@of[2]{\setcaptiontype*{#2}#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{captionlistentry}}
+%
+% \begin{macro}{\captionlistentry}
+% \changes{v3.1}{2007/07/28}{This macro added}
+% \changes{v3.1f}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% \changes{v3.1g}{2008/01/20}{Starred variant added}
+% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% |\captionlistentry|\oarg{float type}\marg{list entry}\\
+% |\captionlistentry*|\oarg{float type}\marg{list entry}
+% \begin{macrocode}
+\newcommand*\captionlistentry{%
+ \caption@teststar\@captionlistentry\@firstoftwo\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\@captionlistentry[1]{%
+ \@testopt{\caption@listentry{#1}}\@captype}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@listentry#1[#2]#3{%
+ \@bsphack
+ #1{\caption@gettitle{#3}}%
+ {\caption@refstepcounter{#2}%
+ \caption@makecurrent{#2}{#3}}%
+ \caption@addcontentsline{#2}{#3}%
+ \@esphack}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{captionbox}}
+%
+% \begin{macro}{\captionbox}
+% \changes{v3.2}{2010/12/17}{This macro added}
+% \changes{v3.2a}{2011/08/16}{\cs{captionsetup} replaces with \cs{captionbox@settype} and \cs{caption@setposition}}
+% \changes{v3.3}{2012/04/09}{Adapted to revised version of \cs{caption@withoptargs}}
+% \changes{v3.3}{2017/03/19}{When used with fixed witdh the content will not be hboxed anymore}
+% \changes{v3.3c}{2019/09/01}{Adapted so it could be used by \cs{subfloat} offered by \package{subcaption}}
+% A |\parbox| with contents and caption, separated by an invisible |\hrule|.
+% \begin{macrocode}
+\newcommand*\captionbox{%
+ \caption@withoptargs{\caption@ibox\@gobble}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@ibox[3]{%
+ \kernel@ifnextchar[%]
+ {\caption@iibox{#1}{#2}{#3}}%
+ {\caption@iibox@{#1}{#2}{#3}}}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@iibox#1#2#3[#4]{%
+ \@testopt{\caption@iiibox{#1}{#2}{#3}[{#4}]}\captionbox@hj@default}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@iibox@#1#2#3#4{%
+ \setbox\@tempboxa\hbox{#4}%
+ \caption@iiibox{#1}{#2}{#3}[\wd\@tempboxa][\captionbox@hj@default]{\unhbox\@tempboxa}}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@iiibox#1{%
+ \caption@iiiibox{#1}\vbox\vtop}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@iiiibox#1#2#3#4#5[#6][#7]#8{%
+ \begingroup
+ #1*% set \caption@position
+ \caption@iftop{%
+ \endgroup
+ \parbox[t]{#6}{%
+ #1\relax
+ \caption@setposition t%
+ #2{\caption#4{#5}}%
+ \captionbox@hrule
+ \csname caption@hj@#7\endcsname
+ #8}%
+ }{%
+ \endgroup
+ \parbox[b]{#6}{%
+ #1\relax
+ \caption@setposition b%
+ \csname caption@hj@#7\endcsname
+ #8%
+ \captionbox@hrule
+ #3{\caption#4{#5}}}%
+ }}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\captionbox@hj@default{c}
+\newcommand*\captionbox@hrule{\hrule\@height\z@\relax}
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\caption@hj@c{\centering}
+\providecommand*\caption@hj@l{\raggedright}
+\providecommand*\caption@hj@r{\raggedleft}
+\providecommand*\caption@hj@s{}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{ContinuedFloat}}
+%
+% \begin{macro}{\ContinuedFloat}
+% \changes{v3.0i}{2005/11/12}{Optional argument added}
+% \changes{v3.0g}{2005/06/28}{Bugfix: \cs{newcounter} replaced by \cs{newcount}}
+% \changes{v3.1}{2007/07/02}{Format of \package{hyperref} extension changed}
+% \changes{v3.1}{2007/07/07}{\cs{caption@setoptions} added}
+% \changes{v3.1g}{2008/01/29}{Starred variant added}
+% \changes{v3.2f}{2011/12/17}{Undocumented optional argument removed}
+% \changes{v3.3}{2011/12/28}{Uses \cs{ifcaption@ContinuedFloat} now}
+% \changes{v3.3}{2013/05/01}{Usage of \cs{caption@restorecounters} added}
+% \changes{v3.3}{2013/12/16}{Bugfix: Does not use \cs{caption@ContinuedFloat} anymore since this breaks \cs{ContinuedFloat} offered by the \package{subfig} package}
+% |\ContinuedFloat|\\
+% |\ContinuedFloat*|\par
+% This mainly sets the appropriate flag, increments the
+% continuation counter, and executes the given options.
+% Furthermore we set |\caption@reset|\-|Continued|\-|Float| to |\@gobble| so the
+% continuation counter will not be reset to zero inside |\caption@ref|\-|step|\-|counter|.\par
+% When the \package{hyperref} package is used we have the problem
+% that the usage of |\Continued|\-|Float| will create duplicate
+% hyper links -- |\@current|\-|Href| will be the same for the main float and
+% the continued ones. So we have to make sure unique labels and references
+% will be created each time. We do this by extending |\the|\-|H|\-|figure| and
+% |\the|\-|H|\-|table|, so for continued floats the scheme
+% \begin{quote}\meta{type}|.|\meta{type \#}|\alph{|\meta{continued \#}|}|\end{quote}
+% will be used instead of
+% \begin{quote}\meta{type}|.|\meta{type \#}\quad\quad.\end{quote}
+% \par{\small(This implementation follows an idea from Steven Douglas Cochran.)}
+% \Note{This does not help if the \package{hyperref} package option
+% \texttt{naturalnames=true} is set.}
+% \begin{macrocode}
+\def\ContinuedFloat{%
+ \caption@iftype
+ {\caption@ContinuedFloatX\@captype}%
+ {\caption@Error{\noexpand\ContinuedFloat outside float}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@ContinuedFloatX[1]{%
+ \@ifstar
+ {\caption@@refstepcounter\@captype
+ \caption@@ContinuedFloat{#1}}%
+ {\caption@Continued@Float{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\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'}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@ContinuedFloat{%
+ \caption@setflag1% ContinuedFloat
+ \caption@@@ContinuedFloat}
+\newcommand*\caption@@@ContinuedFloat{%
+ \stepcounter{ContinuedFloat}%
+ \caption@@@@ContinuedFloat}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@@ContinuedFloat[1]{%
+ \caption@setoptions{ContinuedFloat}%
+ \caption@setoptions{continued#1}%
+ \expandafter\l@addto@macro\csname the#1\endcsname\theContinuedFloat
+ \@ifundefined{theH#1}{}{%
+ \expandafter\l@addto@macro\csname theH#1\endcsname{%
+ \@alph\c@ContinuedFloat}}%
+ \let\caption@@@@ContinuedFloat\@gobble}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@CFtype{??}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\theContinuedFloat}
+% This one is preset to \cs{@empty}, so usually the continuation counter is not
+% included in the caption label or references.
+% \begin{macrocode}
+\newcounter{ContinuedFloat}
+\let\theContinuedFloat\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ContinuedFloat}
+% \changes{v3.0f}{2005/06/11}{This macro added}
+% \changes{v3.3}{2013/12/16}{Bugfix: Revised and defined with \cs{def} instead of \cs{newcommand}}
+% |\caption@ContinuedFloat|\marg{type}\par
+% This one is used by \cs{ContinuedFloat} offered by the \package{subfig} package.
+% \begin{macrocode}
+\def\caption@ContinuedFloat{%
+ \let\caption@resetContinuedFloat\@gobble
+ \caption@@@ContinuedFloat}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@resetContinuedFloat}
+% \changes{v3.2f}{2011/12/17}{Redefinition of \cs{ContinuedFloat} added}
+% |\caption@resetContinuedFloat|\marg{type}\par
+% If a continuation counter is defined, we reset it.
+% (This one will be called inside |\@caption|.)
+% \begin{macrocode}
+\newcommand*\caption@resetContinuedFloat[1]{%
+ \xdef\caption@CFtype{#1}%
+ \@stpelt{ContinuedFloat}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\donemaincaptionfalse}
+% Since the \class{memoir} document class resets the sub-caption
+% counter at |\@float|, right after |\done|\-|main|\-|caption|\-|false|,
+% we save all sub-caption counters at |\done|\-|main|\-|caption|\-|false|
+% so we can restore them using |\caption@restore|\-|counters|
+% inside |\Continued|\-|Float|.
+% \begin{macrocode}
+\caption@ifundefined\donemaincaptionfalse{}{%
+ \g@addto@macro\donemaincaptionfalse\caption@savesubcounters}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Internal helpers}
+%
+% \begin{macro}{\caption@refstepcounter}
+% \changes{v3.1}{2007/07/28}{This macro added}
+% \changes{v3.2}{2010/10/26}{Error message moved from \cs{caption@@@settype} to here}
+% \changes{v3.2c}{2011/09/04}{Support of \cs{donemaincaptiontrue} from \textsf{memoir} document class added}
+% \changes{v3.3}{2011/12/28}{Usage of \cs{ifcaption@caption}, \cs{ifcaption@subcaption}, and \cs{ifcaption@ContinuedFloat} added}
+% Increments the float (i.e. |figure| or |table|) counter,
+% resets the continuation counter, and redefines itself to |\@gobble|.
+% \begin{macrocode}
+\newcommand*\caption@refstepcounter[1]{%
+ \@ifundefined{c@#1}%
+ {\caption@Error{No float type '#1' defined}}%
+ {\caption@ref@stepcounter{#1}%
+% \end{macrocode}
+% Set flag if this part of the figure (or table) contains a caption now.
+% (If |\caption@if|\-|top| is not set, |\caption| is at the bottom of this part,
+% therefore ending this part, so we set the flag to |false| in this case.)
+% \begin{macrocode}
+ \caption@fixposition
+ \caption@iftop\caption@setflag\caption@clrflag2% caption
+% \end{macrocode}
+% This part does not contain content (like sub-figures) yet,
+% so we set |\if|\-|caption@sub|\-|caption| to |false|.
+% \begin{macrocode}
+ \caption@clrflag4% subcaption
+% \end{macrocode}
+% Support of the \textsf{memoir} document class.
+% \begin{macrocode}
+ \@nameuse{donemaincaptiontrue}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@ref@stepcounter{%
+ \caption@ifflag1{% ContinuedFloat
+ \let\caption@tempa\caption@@refcounter
+ \caption@clrflag1% ContinuedFloat
+ }{%
+ \let\caption@tempa\caption@@refstepcounter
+ \caption@ifflag2{}{% caption
+ \caption@ifflag4{% subcaption
+% Counter was already incremented by content, so we suppress \stepcounter{#1} here
+ \let\caption@tempa\caption@@refcounter
+ }{}%
+ }%
+ }%
+ \caption@tempa}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@refcounter[1]{%
+ \let\caption@stepcounter@ORI\stepcounter
+ \def\stepcounter##1{%
+ \def\caption@tempa{#1}%
+ \def\caption@tempb{##1}%
+ \ifx\caption@tempa\caption@tempb \else
+ \caption@stepcounter@ORI{##1}%
+ \fi}%
+ \caption@@@refstepcounter{#1}%
+ \let\stepcounter\caption@stepcounter@ORI}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@refstepcounter[1]{%
+ \caption@prepare@stepcounter{#1}{ref}%
+ \caption@@@refstepcounter{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@stepcounter[1]{%
+ \caption@prepare@stepcounter{#1}{}%
+ \caption@@@stepcounter{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@prepare@stepcounter[2]{%
+ \caption@addsubcontentslines{#2stepcounter}%
+ \caption@resetContinuedFloat{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@refstepcounter{\refstepcounter}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@stepcounter{\stepcounter}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@dblarg}
+% \changes{v3.1}{2007/02/05}{This macro added}
+% \changes{v3.1f}{2007/12/06}{Bugfix 07-12-06: Changed so it works without \cs{kernel@ifnextchar}
+% (which was introduced in \LaTeXe\ 2004/01/23), too}
+% \changes{v3.3}{2012/03/25}{Support of option \opt{list-entry} added}
+% A |\relax| was added compared to |\@dblarg| so |\caption{}| will be
+% expanded to |\caption[\relax]{}| (and not to |\caption[]{}|).
+% Furthermore support for option \opt{list-entry} was added.
+% \begin{macrocode}
+\@ifundefined{kernel@ifnextchar}{\let\kernel@ifnextchar\@ifnextchar}{}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@dblarg[1]{%
+ \kernel@ifnextchar[{\caption@ydblarg{#1}}{\caption@xdblarg{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@xdblarg[2]{%
+ #1[{#2\relax}]{#2}}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@ydblarg#1[#2]#3{%
+ \caption@iflistheading{#1[{#3}]{#3}}{#1[{#2}]{#3}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@begin}
+% \changes{v3.0a}{2004/01/23}{\cs{caption@settype} changed to \cs{caption@setfloattype}}
+% \changes{v3.0e}{2005/04/12}{Check for default label format added}
+% \changes{v3.0f}{2005/06/11}{Usage of \cs{caption@resetContinuedFloat} added}
+% \changes{v3.1}{2007/05/09}{Usage of \cs{caption@setfloattype} \&
+% \cs{caption@resetContinuedFloat} removed}
+% \changes{v3.3}{2011/12/29}{Usage of \cs{caption@fixedposition} removed}
+% Our handling of |\caption| will always be surrounded by
+% |\caption@begin| (or |\caption@beginex|) and |\caption@end|.\par
+% |\caption@begin|\marg{type} performs these tasks:
+% \begin{enumerate}
+% \item[1.] Override the |position=| setting, if necessary.
+% (for example if set to |auto| or used inside a |supertabular|)
+% \item[2.] Start a new group.
+% \item[3.] Define |\fnum@|\meta{type} if the caption label format is set
+% to non-default.
+% \end{enumerate}
+% \begin{macrocode}
+\newcommand*\caption@begin[1]{%
+ \caption@fixposition
+ \begingroup
+ \caption@setfnum{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@beginex}
+% \changes{v3.0b}{2004/05/16}{Support of \opt{listof=} added}
+% \changes{v3.0l}{2007/02/04}{Takes now 3 args instead of 2, check for empty heading added}
+% \changes{v3.1}{2007/07/01}{Makes lst-entry now instead of redefining \cs{addcontentsline}}
+% \changes{v3.2}{2010/10/26}{Bugfix 09-05-15: Setting of \cs{lst@@caption} added}
+% |\caption@beginex|\marg{type}\marg{list entry}\marg{heading}\par
+% performs the same tasks as |\caption@begin| and additionally:
+% \begin{enumerate}
+% \item[4.] Set |\lst@@caption|, so |\fnum@lstlisting| will include a numbering.
+% \item[5.] Make an entry in the list-of-whatever.
+% \item[6.] Set |\caption@ifempty| according argument \meta{heading}.
+% \end{enumerate}
+% \begin{macrocode}
+\newcommand\caption@beginex[3]{%
+ \caption@begin{#1}%
+ \let\lst@@caption\relax
+ \caption@addcontentsline{#1}{#2}%
+ \caption@ifempty{#3}{}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@end}
+% \changes{v3.3}{2011/12/29}{Usage of \cs{caption@fixedposition} removed}
+% |\caption@end| closes the group.
+% \begin{macrocode}
+\newcommand*\caption@end{%
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0a}{2004/01/23}{%
+% Internal hooks \cs{caption@@begin} \& \cs{caption@@end} added}
+% \changes{v3.0h}{2005/10/06}{%
+% Internal hooks \cs{caption@@begin} \& \cs{caption@@end} removed}
+%
+% \begin{macro}{\caption@setfnum}
+% \changes{v3.1}{2007/03/10}{This macro added}
+% |\caption@setfnum|\marg{type}\\
+% redefines |\fnum@|\meta{type} according the caption label format
+% set with |labelformat=|. But if |labelformat=default| is set,
+% |\fnum@|\meta{type} will not be overwritten by us.
+% \begin{macrocode}
+\newcommand*\caption@setfnum[1]{%
+ \@ifundefined{fnum@#1}{\iftrue}{\ifx\caption@lfmt\caption@lfmt@default\else}%
+ \@namedef{fnum@#1}{\caption@fnum{#1}}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@boxrestore}
+% \changes{v3.1}{2007/03/03}{This macro and its usage added}
+% \changes{v3.1b}{2007/09/17}{Bugfix: Redefinition of CR added}
+% \changes{v3.2}{2010/11/07}{Support of option \opt{parboxrestore} added}
+% The original code (from |latex/base/ltboxes.dtx|):
+% \begin{verbatim}
+% \def\@parboxrestore{\@arrayparboxrestore\let\\\@normalcr}
+% \def\@arrayparboxrestore{%
+% \let\if@nobreak\iffalse
+% \let\if@noskipsec\iffalse
+% \let\par\@@par
+% \let\-\@dischyph
+% \let\'\@acci\let\`\@accii\let\=\@acciii
+% \parindent\z@ \parskip\z@skip
+% \everypar{}%
+% \linewidth\hsize
+% \@totalleftmargin\z@
+% \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
+% \parfillskip\@flushglue \lineskip\normallineskip
+% \baselineskip\normalbaselineskip
+% \sloppy}
+% \end{verbatim}%^^A
+% This one will be used by |\@caption| instead of |\@parboxrestore|.
+% \begin{macrocode}
+\newcommand*\caption@boxrestore{%
+ \caption@parboxrestore{\@parboxrestore}{%
+ \let\if@nobreak\iffalse
+ \let\if@noskipsec\iffalse
+ \let\par\@@par
+% \let\-\@dischyph
+% \let\'\@acci\let\`\@accii\let\=\@acciii
+ \parindent\z@ \parskip\z@skip
+ \everypar{}%
+% \linewidth\hsize
+% \@totalleftmargin\z@
+ \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
+ \parfillskip\@flushglue \lineskip\normallineskip
+ \baselineskip\normalbaselineskip
+ \sloppy
+ \let\\\@normalcr
+ }}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@boxrestore@mini}
+% \changes{v3.2}{2010/10/24}{This macro added}
+% Resets \cs{par} so the very first \cs{par} in \cs{@caption} behaves quite the same as in floating environments.
+% Will be used by \cs{setcaptiontype}.
+% \begin{macrocode}
+\newcommand\caption@boxrestore@mini{%
+ \let\par\@@par
+ \parindent\z@ \parskip\z@skip
+ \sloppy}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@normalsize}
+% \changes{v3.1}{2007/05/05}{This macro and its usage added}
+% This one will be used by |\@caption| instead of |\normalsize|.\par
+% Its code is equivalent to
+% \begin{quote}
+% |\caption@font{normal}%|
+% \end{quote}
+% but executes faster (since the starred form of |\caption@font|
+% does not use |\setkeys| internally).
+% \begin{macrocode}
+\newcommand*\caption@normalsize{%
+ \caption@font*{\KV@caption@fnt@normal\@unused}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setfloatcapt}
+% Needed for support of the \package{float} package, where the caption will
+% not be typeset directly, but catched in a |\vbox| called |\@floatcapt|
+% instead.
+% \begin{macrocode}
+\let\caption@setfloatcapt\@firstofone
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makecurrent}
+% This one is needed for support of the \package{nameref} and \package{hyperref} package.
+% \changes{v3.2f}{2012/01/14}{Bugfix: Usage of \cs{caption@gettitle} added}
+% \begin{macrocode}
+\newcommand*\caption@makecurrent[1]{\caption@gettitle}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makeanchor}
+% \begin{macro}{\caption@start}
+% \begin{macro}{\caption@@start}
+% \begin{macro}{\caption@freezeHref}
+% \begin{macro}{\caption@defrostHref}
+% All these are needed for support of the \package{hyperref} package.
+% \begin{macrocode}
+\let\caption@makeanchor\@firstofone
+\let\caption@start\relax
+\let\caption@@start\relax
+\let\caption@freezeHref\relax
+\let\caption@defrostHref\relax
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@gettitle}
+% \changes{v3.1}{2007/05/05}{This macro and its usage added}
+% This one is needed for support of the \package{nameref} package.
+% \begin{macrocode}
+\newcommand\caption@gettitle[1]{%
+ \caption@ifundefined\NR@gettitle
+ {\def\@currentlabelname{#1}}%
+ {\NR@gettitle{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Support for sub-captions}
+% \changes{v3.1f}{2007/11/16}{Support for sub-captions added}
+%
+% \begin{macro}{\caption@DeclareSubType}
+% |\caption@DeclareSub| initializes the usage of \cs{caption}
+% in sub-floats.
+% \begin{macrocode}
+\def\caption@DeclareSubType sub#1\@nil{%
+ \caption@Debug{Initializing subtype for `#1'\@gobble}%
+ \@namedef{caption@beginsub#1}{\caption@beginsubfloat{#1}}}
+\@onlypreamble\caption@DeclareSubType
+% \end{macrocode}
+% \end{macro}
+%
+% Initialize the sub-captions defined with \cs{DeclareCaptionSubType}\ldots
+% \begin{macrocode}
+\caption@For*{subtypelist}{\caption@DeclareSubType sub#1\@nil}
+% \end{macrocode}
+%
+% Initialize the sub-captions defined with \cs{newsubfloat}\cite{subfig}\ldots
+% \begin{macrocode}
+\caption@AtBeginDocument*{%
+ \caption@ifundefined\sf@counterlist{}{%
+ \@for\sf@temp:=\sf@counterlist\do{%
+ \expandafter\caption@DeclareSubType\sf@temp\@nil}}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@subtypehook}
+% \changes{v3.1g}{2008/03/20}{Redefinition of \cs{caption@setlist} added}
+% \changes{v3.1k}{2009/10/09}{Bugfix 09-08-12b: \cs{@makecaption} will now be restored here, too}
+% \changes{v3.2}{2011/06/26}{Uses \cs{caption@@addcontentsline} instead of \cs{addcontentsline} now}
+% \changes{v3.2a}{2011/08/17}{Redefinition of \cs{phantomcaption} added}
+% \changes{v3.2a}{2011/08/17}{Usage of \cs{caption@warmup} added}
+% \changes{v3.2c}{2011/09/30}{Bugfix 11-09-26: Usage of \cs{if@subfloatrow} added}
+% \changes{v3.3}{2011/12/28}{Bugfix 11-12-16: \cs{caption@l@stepcounter} replaced by \cs{stepcounter}}
+% \changes{v3.3}{2012/03/15}{Usage of \cs{caption@setbox} added}
+% \changes{v3.3}{2013/05/01}{Redefinition of \cs{caption@settype} added}
+% \changes{v3.3}{2013/06/17}{Missing redefinition of \cs{captionlistentry} added}
+% \changes{v3.3}{2018/09/06}{Adapted to the \package{chkfloat} package}
+% Hook, will be used inside \cs{caption@setsubtype}.\par
+% (Note: If we are inside an |sub|\-|float|\-|row| environment we have to keep
+% the |\@make|\-|caption| code of the \package{floatrow} package intact.)
+% \begin{macrocode}
+\newcommand*\caption@subtypehook{%
+ \ifx\caption\caption@subcaption \else
+ \caption@warmup
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@ifflag2{}{% caption
+% no \caption in this part of the (floating) environment yet
+ \let\caption@add@contentsline\caption@addsubcontentsline
+ \let\caption@addsubcontentslines\@gobble
+ \caption@ifflag4{}{% subcaption
+% no \subcaption in this part of the (floating) environment yet
+ \caption@ifflag1{% ContinuedFloat
+ \caption@clrflag1%
+ }{%
+ \caption@@stepcounter\@captype
+ }%
+ \caption@setflag4% subcaption
+ }%
+ }%
+% \end{macrocode}
+% \begin{macrocode}
+ \c@ContinuedFloat=0\relax
+ \let\caption@setfloatcapt\@firstofone
+ \let\caption@chkfloat\@gobbletwo
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@setbox{none}%
+ \caption@clearmargin
+ \caption@iflist{}{\let\caption@setlist\@gobble}%
+ \caption@setoptions{sub}%
+ \caption@setoptions{subfloat}% for subfig-package compatibility
+% \end{macrocode}
+% \begin{macrocode}
+% redefine \setcaptiontype
+ \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}%
+% \end{macrocode}
+% \begin{macrocode}
+% redefine \caption
+ \let\caption\caption@subcaption
+ \let\phantomcaption\caption@subphantom
+ \let\captionlistentry\caption@sublistentry
+% \let\@captype\@subcaptype
+ \let\caption@refstepcounter\caption@@@refstepcounter
+% \end{macrocode}
+% \begin{macrocode}
+% restore \@makecaption
+ \if@subfloatrow
+ \caption@Debug{Keeping \string\@makecaption}%
+ \else
+ \let\@makecaption\caption@makecaption
+ \fi
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@subfloatrow}
+% \changes{v3.2c}{2011/09/30}{This macro added}
+% This macro tests if we are inside an |sub|\-|float|\-|row| or |sub|\-|float|\-|row*| environment.
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \caption@ifundefined\@subfloatrowtrue
+ {\newif\if@subfloatrow
+ \caption@ifundefined\subfloatrow{}%
+ {\caption@Debug{Patching subfloatrow environment}%
+ \g@addto@macro\capsubrowsettings{\@subfloatrowtrue}%
+ \g@addto@macro\killfloatstyle{%
+ \ifx\c@FRobj\c@FRsobj\@subfloatrowtrue\fi}}}%
+ {\caption@Debug{\string\if@subfloatrow is already defined}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@subcaption}
+% Makes a sub-caption.
+% \begin{macrocode}
+\newcommand*\caption@subcaption{%
+ \caption@checkgrouplevel{sub}\subcaption
+ \caption@star
+ {\caption@refstepcounter\@subcaptype}%
+ {\caption@dblarg{\@caption\@subcaptype}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@subphantom}
+% \changes{v3.2a}{2011/08/17}{This macro added}
+% Same as |\phantomcaption|, but for sub-captions.
+% \begin{macrocode}
+\newcommand*\caption@subphantom{%
+ \caption@checkgrouplevel{sub}\phantomsubcaption
+ \caption@refstepcounter\@subcaptype}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@sublistentry}
+% \changes{v3.3}{2013/06/17}{This macro added}
+% Same as |\captionlistentry|, but for sub-captions.
+% \begin{macrocode}
+\newcommand*\caption@sublistentry{%
+ \caption@teststar\@subcaptionlistentry\@firstoftwo\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\@subcaptionlistentry[1]{%
+ \@testopt{\caption@listentry{#1}}\@subcaptype}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{caption@clearsubcontentslines}
+% Clear pending sub-caption list entries.
+% \begin{macrocode}
+\newcommand*\caption@clearsubcontentslines{%
+ \global\let\caption@subcontentslines\@empty}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@clearsubcontentslines
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@addsubcontentsline}
+% \changes{v3.1i}{2008/08/02}{Bugfix 08-07-28:
+% \cs{label}, \cs{index}, and \cs{glossary} are allowed inside the list entry now}
+% \changes{v3.2}{2011/06/26}{Uses \cs{caption@@addcontentsline} instead of \cs{addcontentsline} now}
+% \changes{v3.2c}{2011/08/19}{Uses \cs{caption@gobble} instead of \cs{@gobble} now}
+% \changes{v3.3}{2012/01/15}{Debug message added}
+% \changes{v3.3}{2013/03/10}{A single \cs{protect} replaced by \cs{noexpand}}
+% Add a pending sub-caption list entry.
+% \begin{macrocode}
+\newcommand*\caption@addsubcontentsline[4]{%
+ \caption@Debug{\string\caption@addsubcontentsline{#1}{#2}}%
+ \begingroup
+ \let\label\caption@gobble
+ \let\index\caption@gobble
+ \let\glossary\caption@gobble
+ \protected@edef\@tempa{\endgroup
+ \noexpand\g@addto@macro\noexpand\caption@subcontentslines{%
+ \noexpand\@namedef{the#2}{\csname the#2\endcsname}%
+ \ifx\@currentHref\@undefined \else
+ \noexpand\def\noexpand\@currentHref{\@currentHref}%
+ \fi
+ \noexpand\caption@@@addcontentsline{#1}{#2}{#3}{#4}}}%
+ \@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\flushsubcaptionlistentries}
+% \changes{v3.3}{2012/01/15}{Renamed from \cs{caption@addsubcontentslines} to \cs{flushsubcaptionlistentries}}
+% \changes{v3.3}{2013/03/10}{Bugfix: Missing redefinition of \cs{caption@addsubcontentslines} added}
+% Writes pending sub-caption list entries.
+% \begin{macrocode}
+\newcommand*\flushsubcaptionlistentries{%
+ \caption@addsubcontentslines{user}}
+% \end{macrocode}
+% \begin{macrocode}
+\renewcommand*\caption@addsubcontentslines[1]{%
+ \caption@Debug{\string\flushsubcaptionlistentries (#1)}%
+ \begingroup
+ \caption@subcontentslines
+ \endgroup
+ \caption@clearsubcontentslines}
+% \end{macrocode}
+% We need to patch \cs{chapter} otherwise a vertical gap will be inserted into
+% the list prior pending sub-caption list entries.
+% We do this |\At|\-|Begin|\-|Document| so packages like \package{newfloat}
+% will not complain about an unknown document class.
+% \begin{macrocode}
+\AtBeginDocument{\caption@ifundefined\chapter{}{%
+ \let\caption@chapter@ORI\chapter
+ \def\chapter{%
+ \caption@addsubcontentslines{chapter}\caption@chapter@ORI}}}
+% \end{macrocode}
+% Same for \cs{appendix}.
+% \begin{macrocode}
+\AtBeginDocument{\caption@ifundefined\appendix{}{%
+ \let\caption@appendix@ORI\appendix
+ \def\appendix{%
+ \caption@addsubcontentslines{appendix}\caption@appendix@ORI}}}
+% \end{macrocode}
+% Flush the list of pending sub-caption list entries at the end of the document.
+% \begin{macrocode}
+\AtEndDocument{%
+ \caption@addsubcontentslines{AtEndDocument}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Document class \& Babel package support}
+%
+% \subsubsection{The \AmS{} \& \SmF{} classes}
+% \changes{v3.1}{2007/07/29}{\AmS\ \& \SmF\ classes support added}
+%
+% \begin{macrocode}
+\caption@ifundefined\smf@makecaption{}{\let\smf@makecaption\@makecaption}
+% \end{macrocode}
+%
+% \subsubsection{The beamer class}
+% \changes{v3.1}{2007/03/10}{beamer class support added}
+%
+% \begin{macrocode}
+\@ifclassloaded{beamer}{%
+ \caption@InfoNoLine{beamer document class}%
+% \end{macrocode}
+%
+% \begin{macro}{\figure}
+% \changes{v3.1f}{2007/12/17}{This re-definition for \class{beamer} document class added}
+% \changes{v3.3d}{2019/09/01}{This re-definition for \class{beamer} document class revised}
+% We redefine |figure| so our type-specific options will be used etc.
+% \begin{macrocode}
+ \let\caption@ORI@figure\figure
+ \def\figure{\caption@settype{figure}\caption@ORI@figure}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\table}
+% \changes{v3.1f}{2007/12/17}{This re-definition for \class{beamer} document class added}
+% \changes{v3.3d}{2019/09/01}{This re-definition for \class{beamer} document class revised}
+% We redefine |table| so our type-specific options will be used etc.
+% \begin{macrocode}
+ \let\caption@ORI@table\figure
+ \def\table{\caption@settype{table}\caption@ORI@table}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The \KOMAScript{} classes}
+%
+% \KOMAScript\ contains the code
+% |\AtBeginDocument{\let\scr@caption\caption}|
+% so we need to update |\scr@caption| here, too.
+%
+% \begin{macrocode}
+\caption@ifundefined\scr@caption{}{%
+ \caption@AtBeginDocument{\let\scr@caption\caption}}
+% \end{macrocode}
+%
+% \subsubsection{The frenchb Babel option}
+% \changes{v3.1}{2006/05/14}{Adaptation to \package{frenchb} added}
+%
+% Suppress
+% ``Package |frenchb.ldf| Warning: The definition of |\@makecaption| has been
+% changed, frenchb will NOT customize it.''
+% (but only if we emulate this customization)
+% \begin{macrocode}
+\@nameuse{caption@frenchb}\@nameundef{caption@frenchb}
+% \end{macrocode}
+%
+% \subsubsection{The frenchle/pro package}
+% \changes{v3.0h}{2005/10/03}{Adaptation to \package{frenchle/pro} added}
+%
+% \begin{macrocode}
+\caption@AtBeginDocument{\caption@ifundefined\frenchTeXmods{}{%
+ \caption@InfoNoLine{frenchle/pro package is loaded}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \let\captionfont@ORI\captionfont
+ \let\captionlabelfont@ORI\captionlabelfont
+ \let\@makecaption@ORI\@makecaption
+% \end{macrocode}
+
+% If |\GOfrench| is defined as |\relax| all the re-definitions regarding
+% captions have already been done, so we can do our patches immediately.
+% Otherwise we must add our stuff to |\GOfrench|.
+% \begin{macrocode}
+ \caption@ifundefined\GOfrench
+ {\let\caption@tempa\@firstofone}%
+ {\def\caption@tempa{\g@addto@macro\GOfrench}}%
+ \caption@tempa{%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \let\captionfont\captionfont@ORI
+ \let\captionfont@ORI\@undefined
+ \let\captionlabelfont\captionlabelfont@ORI
+ \let\captionlabelfont@ORI\@undefined
+ \let\@makecaption\@makecaption@ORI
+ \let\@makecaption@ORI\@undefined
+% \end{macrocode}
+%
+% \begin{macro}{\@cnORI}
+% We update the definition of |\@cnORI| so it actually reflects
+% our definition of |\caption|.
+% \begin{macrocode}
+ \let\@cnORI\caption
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@tablescaption}
+% The \package{frenchle/pro} package sets |\caption| to |\@tablescaption| at
+% |\begin{table}| for special treatment of footnotes.
+% Therefore we have to patch |\@tablescaption| so |\caption*| will work
+% inside the |table| environment.
+% \begin{macrocode}
+ \let\caption@tcORI\@tablescaption
+ \def\@tablescaption{\caption@star\relax\caption@tcORI}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\f@ffrench}
+% \begin{macro}{\f@tfrench}
+% |\f@ffrench| and |\f@tfrench| reflect |\fnum@figure| and |\fnum@table|
+% when used in French mode. These contain additional code which typesets
+% the caption separator |\captionseparator| instead of the usual colon.
+% Because this breaks with our |\@makecaption| code we have to remove
+% this additional code here.
+% \begin{macrocode}
+ \let\@eatDP\@undefined
+ \let\caption@tempa\@empty
+ \ifx\f@ffrench\fnum@figure
+ \l@addto@macro\caption@tempa{\let\fnum@figure\f@ffrench}%
+ \fi
+ \ifx\f@tfrench\fnum@table
+ \l@addto@macro\caption@tempa{\let\fnum@table\f@tfrench}%
+ \fi
+ \def\f@ffrench{\ifx\listoffigures\relax\else\figurename~\thefigure\fi}%
+ \def\f@tfrench{\ifx\listoftables\relax\else\tablename~\thetable\fi}%
+ \caption@tempa
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+ }%
+}}
+% \end{macrocode}
+%
+% \subsubsection{The hungarian and magyar Babel option}
+% \changes{v3.2}{2009/03/29}{\package{magyar} package support added}
+% \changes{v3.3}{2018/08/26}{\package{magyar} package support revised}
+%
+% \begin{macrocode}
+\def\caption@tempa#1{%
+ \@ifpackagewith{babel}{#1}{%
+ \caption@InfoNoLine{#1 babel option is loaded}%
+ \expandafter\addto\csname extras#1\endcsname{%
+ % reverse changes made by magyar.ldf
+ \let\@makecaption\caption@makecaption
+ \babel@save\@makecaption
+ \caption@redefine
+ \babel@save\@caption}%
+ }{}}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@tempa{hungarian}%
+\caption@tempa{magyar}%
+% \end{macrocode}
+%
+% \subsection{Package support}
+% \changes{v3.1}{2007/04/11}{Package options `float', `longtable' etc.
+% are not supported anymore, removed}
+%
+% \begin{macro}{\caption@IfPackageLoaded}
+% \changes{v3.0f}{2005/05/29}{3rd argument \meta{code} added,
+% so no extra check is needed}
+% \changes{v3.1}{2007/07/04}{Re-written \& renamed from \cs{caption@ifpackage}
+% to \cs{caption@IfPackageLoaded}}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
+% |\caption@IfPackageLoaded|\marg{package}\oarg{version}\marg{true}\marg{false}\par
+% Some kind of combination of |\@ifpackageloaded| and |\@ifpackagelater|.
+% If the \meta{package} is not loaded yet, the check will be (re-)done
+% |\AtBeginDocument|, so the \meta{package} could be loaded later on, too.
+% \begin{macrocode}
+\newcommand\caption@IfPackageLoaded[1]{%
+ \@testopt{\caption@@IfPackageLoaded{#1}}{}}
+\@onlypreamble\caption@IfPackageLoaded
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@IfPackageLoaded#1[#2]#3#4{%
+ \@ifpackageloaded{#1}\@firstofone{%
+ \caption@Debug{#1 package is not loaded (yet)\@gobble}%
+ \caption@AtBeginDocument}{%
+ \caption@If@Package@Loaded{#1}[{#2}]{#3}{#4}}}
+\@onlypreamble\caption@@IfPackageLoaded
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@If@Package@Loaded#1[#2]{%
+ \@ifpackageloaded{#1}{%
+ \caption@InfoNoLine{#1 package is loaded}%
+ \@ifpackagelater{#1}{#2}\@firstoftwo{%
+ \caption@Error{%
+ For a successful cooperation we need at least version\MessageBreak
+ `#2' of package #1,\MessageBreak
+ but only version\MessageBreak
+ `\csname ver@#1.\@pkgextension\endcsname'\MessageBreak
+ is available}%
+ \@secondoftwo}%
+ }{\@secondoftwo}}
+\@onlypreamble\caption@If@Package@Loaded
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@clearmargin}
+% \changes{v3.1}{2007/05/05}{This macro and its usage added}
+% This macro will be used by some package support stuff where the usual
+% margin setting is not welcome, e.g. in the \package{sidecap} package.
+% \begin{macrocode}
+\newcommand*\caption@clearmargin{%
+ \setcaptionmargin\z@
+ \let\caption@minmargin\@undefined}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@setbool{needfreeze}{0}
+\caption@AtBeginDocument*{%
+ \caption@ifneedfreeze{%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@freezetype}
+% \changes{v3.3}{2013/05/01}{This macro added}
+% |\caption@freezetype|\marg{type}\par
+% Used by the \package{fltpage} \& \package{sidecap} package support.
+% \begin{macrocode}
+ \newcommand*\caption@freezetype[1]{%
+ \caption@settype*{#1}%
+ \captionsetup*[sub]{hypcap=true}% Note: This is just a (q&d) workaround!
+ \caption@freeze}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@freeze}
+% \changes{v3.1}{2007/07/22}{This macro added}
+% \changes{v3.1c}{2007/10/06}{\cs{caption} \& \cs{@caption} revised for enhanced compatibility}
+% \changes{v3.1c}{2007/10/06}{Bugfix: Made \cs{@caption} long}
+% \changes{v3.1f}{2007/11/16}{Uses `space hack' instead of \cs{ignorespaces} now}
+% \changes{v3.1g}{2008/01/29}{Starred variants of \cs{ContinuedFloat} and \cs{captionsetup} added}
+% \changes{v3.2}{2010/10/26}{Bugfix 10-09-01a: Uses \cs{ignorespaces} instead of `space hack' again}
+% \changes{v3.2a}{2011/08/17}{Starred variant of \cs{caption@freeze} removed}
+% \changes{v3.2b}{2011/08/18}{Redefines \cs{caption@setup} instead of \cs{captionsetup} now}
+% \changes{v3.2b}{2011/08/18}{Redefinition of \cs{label} revised}
+% \changes{v3.2c}{2011/08/21}{Revised}
+% \changes{v3.3}{2013/01/06}{Adapted to new switch \cs{caption@caption} etc.}
+% |\caption@freeze|\par
+% Used by the \package{bicaption} package.
+% \begin{macrocode}
+ \newcommand*\caption@freeze{%
+ \let\caption@frozen@ContinuedFloat\ContinuedFloat
+ \def\ContinuedFloat{%
+ \caption@@freeze{\caption@@@@ContinuedFloat\@captype}%
+ \caption@frozen@ContinuedFloat}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@frozen@setup\caption@setup
+ \def\caption@setup##1{%
+ \caption@@freeze{\caption@setup{##1}}%
+ \caption@frozen@setup{##1}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@frozen@caption\caption
+ \def\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}%
+% \end{macrocode}
+% \begin{macrocode}
+ \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}}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \global\let\caption@frozen@content\@empty
+ \long\def\caption@@freeze{%
+ \g@addto@macro\caption@frozen@content}%
+% \end{macrocode}
+% \begin{macrocode}
+ \def\caption@warmup{%
+ \let\ContinuedFloat\caption@frozen@ContinuedFloat
+ \let\caption@setup\caption@frozen@setup
+ \let\caption\caption@frozen@caption
+ \let\label\caption@frozen@label}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@prepare@defrost}
+% \changes{v3.3}{2013/01/06}{This macro added}
+% Prevent resetting the caption flags
+% \begin{macrocode}
+ \newcommand*\caption@prepare@defrost{%
+ \let\caption@settype\caption@set@type}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@defrost}
+% \changes{v3.1}{2007/07/22}{This macro added}
+% \changes{v3.1g}{2008/01/30}{\cs{caption@defrost@setup} added}
+% \changes{v3.2c}{2011/08/21}{Adapted to changes of \cs{caption@freeze}}
+% \changes{v3.2c}{2011/08/21}{\cs{caption@defrost@setup} removed}
+% |\caption@defrost|
+% \begin{macrocode}
+ \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}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ }{}%
+ \caption@undefbool{needfreeze}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@warmup}
+% \changes{v3.2a}{2011/08/17}{This macro added}
+% |\caption@warmup|
+% \begin{macrocode}
+\let\caption@warmup\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{The chkfloat package}
+% \changes{v3.3}{2018/09/06}{Support of the \package{chkfloat} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{chkfloat}[2012/08/19 v0.1]{%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@chkfloat}
+% \changes{v3.3}{2018/09/06}{This macro added}
+% \begin{macrocode}
+ \caption@ifundefined\chkfloat@addcontentsline{%
+ \renewcommand\caption@chkfloat[2]{%
+ \caption@ifundefined\chkfloat@page{}{%
+ \addtocontents{fof}{\protect\chkfloat@{\thepage}{\chkfloat@page}{\csname fnum@#1\endcsname: #2}}}}%
+ }{%
+ \renewcommand\caption@chkfloat{\chkfloat@addcontentsline}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ }{}%
+% \end{macrocode}
+%
+% \subsubsection{The float package}
+% \changes{v3.0f}{2005/05/31}{\package{float} package support rewritten and improved}
+% \iffalse
+% (This is a more straight-ahead implementation, but it only works with v1.3
+% now, so v1.2 is no longer supported. The old code including documentation
+% can be found in caption-30f-050530.zip)
+% \fi
+%
+% The \package{float} package usually do not use the \LaTeX\ kernel command
+% |\@caption| to typeset the caption but |\float@caption| instead.
+% (|\@caption| will only be used if the float is re-styled with
+% |\restylefloat*|.)
+%
+% The main two things |\float@caption| is doing different are:
+% \begin{itemize}
+% \item The caption will be typeset inside a |\savebox| called |\@floatcapt|
+% so it can be placed above or below the float contents afterwards.
+% \item |\@makecaption| will not be used to finally typeset the caption.
+% Instead |\@fs@capt| will be used which definition is part of the float
+% style.
+% (Note that |\@fs@capt| will not typeset any vertical space above or below
+% the caption; instead this space will be typeset by the float style code
+% itself.)
+% \end{itemize}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{float}[2001/11/08 v1.3d]{%
+ \@ifpackageloaded{floatrow}{%
+ \caption@If@Package@Loaded{floatrow}[2007/08/24 v0.2a]{}{}%
+ }{%
+% \end{macrocode}
+%
+% \begin{macro}{\@float@setevery}
+% \changes{v3.1k}{2009/10/09}{Bugfix 08-12-05: \cs{color@begin/endgroup} added
+% to redefinition of \cs{caption@setfloatcapt}}
+% |\@float@setevery|\marg{float type} is provided by the \package{float}
+% package; it's called every time a floating environment defined with
+% |\newfloat| or |\restylefloat| begins.
+% We use this hook to do some adaptations and to setup the proper caption
+% style (if defined) and additional settings declared with
+% |\captionsetup|\oarg{float style}.
+% \begin{macrocode}
+ \let\caption@ORI@float@setevery\@float@setevery
+ \def\@float@setevery#1{%
+ \float@ifcaption{#1}{%
+% \end{macrocode}
+%
+% First of all we set the caption position to it's proper value by
+% converting |\@fs@iftopcapt| (which is part of a float style and
+% controls where the caption will be typeset, above or below the float
+% contents) to our |position=| setting.
+% Since the spacing above and below the caption will be done by the float
+% style and \emph{not} by us this sounds quite useless. But in fact it isn't,
+% since some packages based on \thispackage\ (like the \package{subfig}
+% package) could have an interest for this information and therefore use the
+% |\caption@iftop| macro we provide in our kernel. Furthermore we need this
+% information for ourself in |\captionof| which uses |\@makecaption| to
+% finally typeset the caption with skips.
+% \begin{macrocode}
+ \caption@setposition{\@fs@iftopcapt t\else b\fi}%
+% \end{macrocode}
+%
+% Afterward we redefine |\caption@setfloatcapt| (which will be used inside
+% |\@caption|) so the caption will be set inside the box |\@floatcapt|,
+% without extra vertical space.
+% \begin{macrocode}
+ \renewcommand\caption@setfloatcapt[1]{%
+ \let\@makecaption\caption@@make
+ \global\setbox\@floatcapt\vbox{%
+ \color@begingroup ##1\color@endgroup}}%
+% \end{macrocode}
+%
+% To allow different caption styles for different float styles we also
+% determine the current float style (e.g. `ruled') and select
+% a caption style (and additional settings) with the same name, if defined.
+% \begin{macrocode}
+ \float@getstyle\float@style{#1}%
+ \caption@setstyle*\float@style
+ \caption@setoptions\float@style
+% \end{macrocode}
+%
+% \begin{macrocode}
+ }{}%
+ \caption@freezeHref % will be defrosted in \float@makebox
+ \caption@ORI@float@setevery{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\float@makebox}
+% \changes{v3.3}{2013/01/06}{Corrects wrong load order hyperref-float now}
+% \changes{v3.3}{2013/02/03}{Correction of wrong load order hyperref-float revised}
+% Redefine |\float@makebox| (only if we are not operating in compatibility mode).
+% \begin{macrocode}
+ \caption@AtBeginDocument{\caption@ifcompatibility{}{%
+% \end{macrocode}
+% If it was redefined by the \package{hyperref} package,
+% we need to build on the original definition (and not on the redefined one).
+% \begin{macrocode}
+ \caption@ifundefined\HyOrg@float@makebox
+ {\let\caption@ORI@float@makebox\float@makebox}%
+ {\let\caption@ORI@float@makebox\HyOrg@float@makebox}%
+ \renewcommand\float@makebox[1]{%
+ \caption@ORI@float@makebox{#1\relax \caption@defrostHref}}%
+% \end{macrocode}
+% \begin{macrocode}
+ }}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@typehook}
+% \changes{v3.1}{2007/07/08}{float package hook added}
+% \LaTeX\ and almost every other packages use
+% |\|\meta{type}|name|
+% to provide a macro for the type resp.~environment name -- for example
+% the command |\figurename| will usually contain the name of the floating
+% environment |figure|:
+% \begin{quote}
+% |\newcommand\figurename{Figure}|
+% \end{quote}
+% But the \package{float} package doesn't follow this common naming
+% convention:
+% For floats defined with |\newfloat| it uses |\fname@|\meta{type} instead,
+% which breaks with our code (and with |\autoref| and some other things as
+% well).
+% So we have to map the \package{float} package name to the common one here.\par
+% \Note{If the float was not defined with \cs{newfloat} but with
+% \cs{restylefloat} instead, \cs{fname@}\meta{type} is not defined.}
+% \begin{macrocode}
+ \g@addto@macro\caption@typehook{%
+ \expandafter\ifx\csname #1name\endcsname\relax
+ \expandafter\let\csname #1name\expandafter\endcsname
+ \csname fname@#1\endcsname
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0f}{2005/06/26}{Skips of \env{plaintop} and \env{boxed} floats corrected}
+% \begin{macro}{\fs@plaintop}
+% \begin{macro}{\fs@boxed}
+% Since the float styles |plaintop| and |boxed| don't use |\abovecaptionskip|
+% which could be set with |skip=| (|plaintop| uses |\belowcaptionskip| instead of
+% |\abovecaptionskip|, and |boxed| uses a fixed space of |2pt|)
+% we patch the according float style macros here to change this.
+% \begin{macrocode}
+ \g@addto@macro\fs@plaintop{\def\@fs@mid{\vspace\abovecaptionskip\relax}}%
+ \g@addto@macro\fs@boxed{\def\@fs@mid{\kern\abovecaptionskip\relax}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\float@getstyle}
+% \changes{v3.1}{2007/06/10}{This macro added}
+% |\float@getstyle|\marg{cmd}\marg{type}\par
+% Determining the float style is not so easy because the only hint
+% provided by the \package{float} package is the macro
+% |\fst@|\meta{float type} which points to the macro which represents the
+% float style. So for example after
+% \begin{quote}
+% |\floatstyle{ruled}|\\
+% |\newfloat{Program}{tbp}{lop}|
+% \end{quote}
+% |\fst@Program| will be defined as
+% \begin{quote}
+% |\def\fst@Program{\fs@ruled}|\quad.
+% \end{quote}\par
+% So here is what we do: We make the first level expansion of
+% |\fst@|\meta{float type} a string so we can gobble the first four tokens
+% (= |\fs@|), so only the the name of the float style is left.\par
+% \emph{TODO:} We need to convert the catcodes here.
+% \begin{macrocode}
+ \providecommand*\float@getstyle[2]{%
+ \edef#1{%
+ \noexpand\expandafter\noexpand\@gobblefour\noexpand\string
+ \expandafter\expandafter\expandafter\noexpand
+ \csname fst@#2\endcsname}%
+ \edef#1{#1}%
+ \caption@Debug{floatstyle{#2} = `#1'}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\float@ifcaption}
+% \changes{v3.1}{2007/06/23}{This macro added}
+% |\float@ifcaption|\marg{type}\marg{if-clause}\marg{else-clause}\par
+% Here we determine if the user has used |\newfloat| resp.~|\restylefloat|,
+% or |\restylefloat*|.
+% This is quite easy: If |\@float@c@|\meta{captype} is the same as
+% |\float@caption|, the user has used |\newfloat| or |\restylefloat|,
+% otherwise we assume he has used |\restylefloat*|.
+% (This test will fail if some package re-defines |\float@caption|,
+% so we have to assume that there is no one.)
+% \begin{macrocode}
+ \providecommand*\float@ifcaption[1]{%
+ \expandafter\ifx\csname @float@c@#1\endcsname\float@caption
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}}{%
+ \providecommand*\float@ifcaption[1]{\@secondoftwo}%
+% \clearcaptionsetup{boxed}% used by the floatrow package?
+}
+% \end{macrocode}
+%
+% The skip between `boxed' floats and their caption defaults to |2pt|.
+%
+% \begin{macrocode}
+\captionsetup[boxed]{skip=2pt} % do not issue a warning when not used
+% \end{macrocode}
+%
+% \changes{v3.0f}{2005/05/26}{\opt{strut=0} added to caption style \opt{ruled}}
+% \changes{v3.0f}{2005/05/27}{Option \opt{ruled} fixed}
+% To emulate the `ruled' definition of |\@fs@capt| we provide a caption style
+% `ruled' with appropriate options. But if the package option |ruled| was
+% specified, we setup some caption parameters to emulate the behavior
+% of \thispackage\ \version{1.x} option |ruled| instead, i.e.,
+% the current caption settings will be used, but without margin and without
+% `single-line-check'.
+% \begin{macrocode}
+\caption@ifbool{ruled}{%
+ \captionsetup[ruled]{margin=0pt,minmargin=0,slc=0}%
+}{%
+ \DeclareCaptionStyle{ruled}{labelfont=bf,labelsep=space,strut=0}%
+}
+\caption@undefbool{ruled}
+% \end{macrocode}
+%
+% \subsubsection{The floatflt package}
+% \changes{v3.1}{2007/06/10}{Support of the \package{floatflt} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{floatflt}[1996/02/27 v1.3]{%
+% \end{macrocode}
+%
+% \begin{macro}{\floatingfigure}
+% We patch |\floatingfigure| so |\caption@floatflt| will be used.
+% \begin{macrocode}
+ \let\caption@ORI@floatingfigure\floatingfigure
+ \def\floatingfigure{%
+ \caption@floatflt{figure}%
+ \caption@ORI@floatingfigure}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\floatingtable}
+% Same with |\floatingtable|\ldots
+% \begin{macrocode}
+ \let\caption@ORI@floatingtable\floatingtable
+ \def\floatingtable{%
+ \caption@floatflt{table}%
+% \caption@setautoposition b%
+ \caption@ORI@floatingtable}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@floatflt}
+% \changes{v3.1c}{2007/10/06}{Bugfix: \cs{caption@clearmargin} added}
+% Here we do two things:
+% \begin{enumerate}
+% \item We use |\caption@set|\-|options{|\-|floating|\meta{type}|}| so
+% |\caption|\-|setup[|\-|floating|\meta{type}|]{|\ldots|}| is supported.
+% \item |\line|\-|width| must be set correctly.
+% Usually this is done by |\@par|\-|box|\-|restore| inside |\@caption|,
+% but since we use |\@caption@box|\-|restore| we have to map this to
+% |\@par|\-|box|\-|restore| instead.
+% \end{enumerate}
+% \begin{macrocode}
+ \newcommand*\caption@floatflt[1]{%
+ \caption@settype{#1}%
+ \caption@clearmargin
+ \caption@setfullparboxrestore
+ \caption@setoptions{floating#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The fltpage package}
+% \changes{v3.1}{2007/07/22}{Support of the \package{fltpage} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{fltpage}[1998/10/29 v.0.3]{%
+ \caption@setbool{needfreeze}{1}%
+% \end{macrocode}
+%
+% \begin{macro}{\FP@positionLabel}
+% \changes{v3.2c}{2011/08/28}{This redefinition added}
+% Original code:
+% \begin{verbatim}
+% \newcommand{\FP@positionLabel}{%
+% FP\@captype-\number\value{FP@\@captype C}-pos}
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \renewcommand\FP@positionLabel{%
+ FP\FP@captype-\number\value{FP@\FP@captype C}-pos}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FP@helpNote}
+% Original code:
+% \begin{verbatim}
+% \newcommand{\FP@helpNote}[2]{%
+% \typeout{FP#1 is inserted on page \pageref{#2}!}}%
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \renewcommand\FP@helpNote[2]{%
+ \begingroup % save \caption@thepage
+ \caption@pageref{#2}%
+ \typeout{FP#1 is inserted on page \caption@thepage!}%
+ \endgroup}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FP@floatBegin}
+% \changes{v3.1f}{2007/11/16}{Uses `space hack' instead of \cs{ignorespaces} now}
+% \changes{v3.1k}{2009/10/09}{Bugfix 09-09-11: Missing \cs{ignorespaces} added}
+% \changes{v3.2c}{2011/08/28}{Adapted to current version of \cs{caption@freeze}}
+% \changes{v3.2f}{2012/02/19}{Bugfix 12-02-16: \texttt{minipage} environment added}
+% \changes{v3.3}{2013/05/01}{Usage of \cs{caption@freeze} replaced by \cs{caption@freezetype}}
+% Original code:
+% \begin{verbatim}
+% \newcommand{\FP@floatBegin}[1]{%
+% \gdef\@captype{#1}%
+% \global\let\FP@savedCaptionCommand\caption%
+% \global\let\FP@savedLabelCommand\label%
+% \ifthenelse{\equal{\@captype}{figure}}
+% {\global\let\old@Fnum\fnum@figure}%
+% {\global\let\old@Fnum\fnum@table}%
+% \let\FP@LabelText\@empty%
+% \let\FP@CaptionText\@empty%
+% \let\FP@optionalCaptionText\@empty%
+% \renewcommand\label[1]{\gdef\FP@LabelText{##1}}%
+% \renewcommand\caption[2][]{%
+% \gdef\FP@optionalCaptionText{##1}\gdef\FP@CaptionText{##2}}%
+% \begin{lrbox}{\FP@floatCorpusBOX}%
+% }%
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \renewcommand*\FP@floatBegin[1]{%
+ \def\FP@captype{#1}%
+ \begin{lrbox}{\FP@floatCorpusBOX}%
+ \minipage\hsize % changes from LR mode to vertical mode
+ \caption@freezetype{#1}%
+ \ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FP@floatEnd}
+% \changes{v3.1g}{2008/01/30}{Some minor bugfixes}
+% \changes{v3.2c}{2011/08/28}{Adapted to current version of \cs{caption@freeze}}
+% \changes{v3.2f}{2012/02/19}{Bugfix 12-02-16: \texttt{minipage} environment added}
+% Original code:
+% \begin{verbatim}
+% \newcommand{\FP@floatEnd}{%
+% \end{lrbox}%
+% \global\setbox\FP@floatCorpusBOX=\box\FP@floatCorpusBOX
+% \stepcounter{FP@\@captype C}%
+% \FP@savedLabelCommand{\FP@positionLabel}%
+% \FP@helpNote{\@captype}{\FP@positionLabel}%
+% \FP@float
+% {\FP@positionLabel}% location label test
+% {\begin{\@captype}[p!]
+% \usebox{\FP@floatCorpusBOX}%
+% \refstepcounter{\@captype}%
+% \ifthenelse{\equal{\FP@LabelText}{\@empty}}
+% {}{\FP@savedLabelCommand{\expandafter\protect\FP@LabelText}}%
+% \end{\@captype}}
+% {\addtocounter{\@captype}{-1}}
+% {\begin{\@captype}[b!]%
+% \ifthenelse{\equal{\FP@guide}{\@empty}}%
+% {}{\ifthenelse{\equal{\@captype}{figure}}%
+% {\renewcommand{\fnum@figure}{\old@Fnum\ {\FP@guide}}}%
+% {\renewcommand{\fnum@table}{\old@Fnum\ {\FP@guide}}}}%
+% \setlength{\abovecaptionskip}{2pt plus2pt minus 1pt} % length above caption
+% \setlength{\belowcaptionskip}{2pt plus2pt minus 1pt} % length above caption
+% \FP@separatorCaption%
+% \ifthenelse{\equal{\FP@optionalCaptionText}{\@empty}}%
+% {\FP@savedCaptionCommand{\expandafter\protect\FP@CaptionText}}%
+% {\FP@savedCaptionCommand[\expandafter\protect\FP@optionalCaptionText]%
+% {\expandafter\protect\FP@CaptionText}}%
+% \end{\@captype}}%
+% }%
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \renewcommand*\FP@floatEnd{%
+ \endminipage
+ \end{lrbox}%
+% \end{macrocode}
+% \begin{macrocode}
+ \stepcounter{FP@\FP@captype C}%
+ \caption@label\FP@positionLabel
+ \FP@helpNote\FP@captype\FP@positionLabel
+% \end{macrocode}
+% \begin{macrocode}
+ \FP@float
+ {\FP@positionLabel}% location label test
+ {\caption@prepare@defrost
+ \begin\FP@captype[p!]%
+ \usebox\FP@floatCorpusBOX
+ \end\FP@captype}%
+ {\@ifundefined{theH\FP@captype}{}{%
+ \expandafter\l@addto@macro\csname theH\FP@captype\endcsname{.FP}}}%
+ {\caption@prepare@defrost
+ \begin\FP@captype[b!]%
+ \let\FP@savedSetfnumCommand\caption@setfnum
+ \def\caption@setfnum##1{%
+ \FP@savedSetfnumCommand{##1}%
+ \ifx\FP@guide\@empty \else
+ \expandafter\l@addto@macro\csname fnum@##1\endcsname{\ {\FP@guide}}%
+ \fi}%
+ \setlength\abovecaptionskip{2pt plus 2pt minus 1pt}% length above caption
+ \setlength\belowcaptionskip{2pt plus 2pt minus 1pt}% length below caption
+ \caption@setoptions{FP\@captype}%
+ \FP@separatorCaption
+ \caption@defrost
+ \end\FP@captype}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{%
+ \let\caption@ifFPlistcap\@undefined
+ \let\caption@ifFPrefcap\@undefined
+}
+% \end{macrocode}
+%
+% \subsubsection{The hyperref package}
+% \changes{v3.0f}{2005/06/11}{Support of the \package{hyperref} package added}
+% \changes{v3.1}{2007/03/09}{Usage of \cs{hyper@makecurrent} instead of
+% \cs{theHfigure} as indicator for \package{hyperref} package}
+% \changes{v3.2}{2011/07/30}{Test if \package{hyperref} has stopped early revised}
+% \changes{v3.2c}{2011/08/24}{Test if \package{hyperref} has stopped early adapted to current version of \package{hyperref} package: Usage of \cs{IfHyperBoolean} added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{hyperref}[2003/11/30 v6.74m]{%
+ % Test if hyperref has stopped early
+ \caption@ifundefined\IfHyperBoolean{%
+ \caption@set@bool\caption@ifhyp@stoppedearly0%
+ \caption@ifundefined\H@refstepcounter
+ {\caption@set@bool\caption@ifhyp@stoppedearly1}{%
+ \caption@ifundefined\hyper@makecurrent
+ {\caption@set@bool\caption@ifhyp@stoppedearly1}{%
+ \caption@ifundefined\measuring@true
+ {\caption@set@bool\caption@ifhyp@stoppedearly1}{}}}%
+ }{%
+ \def\caption@ifhyp@stoppedearly{\IfHyperBoolean{stoppedearly}}%
+ }%
+ \caption@ifhyp@stoppedearly{% hyperref has stopped early
+ \caption@InfoNoLine{%
+ Hyperref support is turned off\MessageBreak
+ because hyperref has stopped early}%
+ }{%
+ \g@addto@macro\caption@prepareslc{\measuring@true}%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@@@refstepcounter}
+% We redefine |\caption@@refstepcounter| so |\H@refstepcounter| will be used
+% instead of |\refstepcounter| inside |\caption| \& |\captionlistentry|.
+% \begin{macrocode}
+ \renewcommand*\caption@@@refstepcounter{\H@refstepcounter}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makecurrent}
+% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% We redefine |\caption@makecurrent| so a \package{hyperref} label
+% will be defined inside |\@caption|.
+% \Note{Will be redefined by \cs{caption@start}.}
+% \begin{macrocode}
+ \renewcommand*\caption@makecurrent[2]{%
+ \caption@makecurrentHref{#1}%
+ \caption@Debug{hyperref current=\@currentHref}%
+ \caption@gettitle{#2}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\caption@makecurrentHref{\hyper@makecurrent}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makeanchor}
+% \changes{v3.1l}{2010/01/09}{Adapted to the current hyperref package}
+% We redefine |\caption@makeanchor| so a \package{hyperref} anchor
+% will be set inside |\@caption|.
+% \Note{Will be redefined by \cs{caption@start}.}
+% \begin{macrocode}
+ \renewcommand\caption@makeanchor[1]{%
+ \caption@Debug{hyperref anchor: \@currentHref}%
+ % If we cannot have nesting, the anchor is empty.
+ \ifHy@nesting
+ \expandafter\hyper@@anchor\expandafter{\@currentHref}{#1}%
+ \else
+ \Hy@raisedlink{%
+ \expandafter\hyper@@anchor\expandafter{\@currentHref}{\relax}%
+ }#1%
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+ \g@addto@macro\caption@prepareslc{\let\caption@makeanchor\@firstofone}%
+% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{The hypcap option}
+%
+% \begin{macro}{\if@capstart}
+% Like the \package{hypcap} package we define the switch |\if@capstart|, too.
+% \begin{macrocode}
+ \newif\if@capstart
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@start}
+% \changes{v3.0l}{2007/02/20}{%
+% \cs{caption@currentHref} renamed to \cs{hc@currentHref}}
+% \changes{v3.1}{2007/06/21}{%
+% This macro renamed from \cs{capstart} to \cs{caption@start} and revised}
+% While the \package{hypcap} package defines a macro called |\capstart|
+% our variant is called |\caption@start| and is controlled by the option
+% |hypcap=||false|/|true|.
+% \begin{macrocode}
+ \def\caption@start{\caption@ifhypcap\caption@start@\relax}%
+ \def\caption@start@{%
+% \end{macrocode}
+% Generate the \package{hyperref} label and set the \package{hyperref} anchor,
+% usually (if |hypcap=false|) both is done inside |\@caption|.
+% \begin{macrocode}
+ \caption@makestart\@captype
+ \caption@startanchor\@currentHref
+% \end{macrocode}
+% Prevent |\@caption| from generating a new \package{hyperref} label,
+% use the label we save in |\hc@currentHref| instead.
+% (We also support the |@capstart| flag from the \package{hypcap} package.)
+% \begin{macrocode}
+ \global\@capstarttrue
+ \let\hc@currentHref\@currentHref
+ \def\caption@makecurrentHref##1{%
+ \global\@capstartfalse
+ \global\let\@currentHref\hc@currentHref}%
+% \end{macrocode}
+% Prevent |\@caption| from generating a \package{hyperref} anchor since this
+% has already been done.
+% \begin{macrocode}
+ \let\caption@makeanchor\@firstofone
+% \end{macrocode}
+% \begin{macrocode}
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makestart}
+% \changes{v3.1c}{2007/09/30}{\cs{@currentHref} will be extended by \texttt{caption}
+% instead of \texttt{xxx} now}
+% |\caption@makestart|\marg{type}
+% defines a \package{hyperref} anchor inside |\caption@start|.\par
+% Since we offer |\ContinuedFloat| the float counter can change between
+% `now' and |\caption|, i.e., we simply don't know the figure or table counter
+% yet and therefore we are not able to generate the `right' \package{hyperref}
+% label.
+% Two different solutions of this problem came into my mind:
+% \begin{enumerate}
+% \item I could use the aux file for this purpose.\par
+% -or-
+% \item I set |hypertexnames=false| locally.
+% Furthermore I use |#1.caption.|\meta{counter} (instead of |#1.|\meta{counter})
+% as naming scheme for |\@currentHref| to avoid conflicts with other hyper
+% links which are generated with |hypertexnames=true|.
+% \end{enumerate}
+% The first idea has the advantage that the `right' anchor name will be
+% generated, but one needs an additional \LaTeX\ run if figures or tables
+% will be inserted or removed.\par
+% The second idea has the advantage that it's very easy to implement, but
+% has some side-effects, e.g. the anchor names don't follow the figure or
+% table label names anymore.\par
+% Since I'm lazy I implemented the second idea, maybe I will revise this
+% later on.
+% \begin{macrocode}
+ \newcommand*\caption@makestart[1]{%
+ \begingroup
+ \Hy@hypertexnamesfalse
+% \gdef\@currentHlabel{}%
+ \hyper@makecurrent{#1.caption}%
+ \endgroup
+ \caption@Debug{hypcap start=\@currentHref}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@startanchor}
+% \changes{v3.1b}{2007/09/17}{Bugfix 06-09-17: We use \cs{caption@anchor} instead of \cs{hyper@@anchor}}
+% \changes{v3.1g}{2008/03/16}{Warning about TeX mode replaced with debug info}
+% |\caption@startanchor|\marg{Href}
+% sets a \package{hyperref} anchor inside |\caption@start|.\par
+% This code was taken from the \package{hypcap} package\cite{hypcap} and adapted.
+% \Note{Since \cs{hyper@@anchor}\marg{Href}\csmarg{\string\relax} can cause
+% a change from vertical mode to horizontal mode (design flaw in
+% \package{hyperref} package!?), and since the workaround
+% \cs{let}\cs{leavevmode}\cs{relax} which can be found in the
+% \package{hypcap} package is not always sufficient
+% (for example with ``Direct pdfmark support'' and \texttt{breaklinks=true}),
+% we use \cs{caption@anchor} instead of \cs{hyper@@anchor} here.}
+% \begin{macrocode}
+ \newcommand*\caption@startanchor[1]{%
+ \ifvmode\begingroup
+ \caption@Debug{hypcap anchor: #1 (vertical mode)}%
+ \@tempdima\prevdepth
+ \nointerlineskip
+ \vspace*{-\caption@hypcapspace}%
+ \caption@anchor{#1}%
+ \vspace*{\caption@hypcapspace}%
+ \prevdepth\@tempdima
+ \endgroup\else
+ \caption@Debug{hypcap anchor: #1 (horizontal mode)}%
+ \caption@anchor{#1}%
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@anchor}
+% \changes{v3.1c}{2007/10/17}{Workaround 07-10-17: We use \cs{caption@raisedlink} instead of \cs{Hy@raisedlink} now}
+% |\caption@anchor|\marg{Href} sets a \package{hyperref} anchor.
+% \begin{macrocode}
+ \newcommand*\caption@anchor[1]{%
+ \ifmeasuring@ \else
+ \caption@raisedlink{\hyper@anchorstart{#1}\hyper@anchorend}%
+ \fi}%
+% \end{macrocode}
+% \Note{Since \cs{Hy@raisedlink} change \cs{@tempdima} we surrounded it by \cs{ifvmode},
+% suppressing ``\texttt{LaTeX Warning: Float too large for page by 1.0pt}'' in \texttt{sideways} floats.
+% (This is not necessary since \package{hyperref} \version{6.77}.)}
+% \begin{macrocode}
+ \ifx\HyperRaiseLinkLength\@tempdima
+ \def\caption@raisedlink#1{\ifvmode#1\else\Hy@raisedlink{#1}\fi}%
+ \else
+ \let\caption@raisedlink\Hy@raisedlink
+ \fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@start}
+% Will be used by |\caption@freezeHref|. Apart from that we issue a warning
+% if we expect a saved \package{hyperref} label coming from |\caption@start|,
+% but there isn't any.
+% \begin{macrocode}
+ \def\caption@@start{%
+ \caption@ifundefined\hc@currentHref{%
+ \caption@Warning{%
+ The option `hypcap=true' will be ignored for this\MessageBreak
+ particular \string\caption}}{}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@freezeHref}
+% Suppress |\caption@start| from generating a \package{hyperref} label and
+% setting a \package{hyperref} anchor. Instead if |\@caption| generates a
+% \package{hyperref} label, it will be stored in |\caption@currentHref|.
+% Furthermore we need to redefine |\caption@setfloatcapt| so no
+% \package{hyperref} anchor will be placed in |\@caption|.
+% \iffalse
+% (Since |\caption@setfloatcapt| will be set to |\@firstofone| inside
+% |\subcaption| there is no need to add its restauration to
+% |\caption@subtypehook|.)
+% \fi
+% \begin{macrocode}
+ \def\caption@freezeHref{%
+ \let\caption@ORI@start\caption@start
+ \def\caption@start{\let\caption@start\caption@ORI@start}%
+% \end{macrocode}
+% \begin{macrocode}
+% \let\caption@ORI@@start\caption@@start
+% \l@addto@macro\caption@subtypehook{%
+% \let\caption@@start\caption@ORI@@start}%
+% \end{macrocode}
+% \begin{macrocode}
+ \global\let\caption@currentHref\@undefined
+ \def\caption@@start{\global\let\caption@currentHref\@currentHref}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@ORI@setfloatcapt\caption@setfloatcapt
+ \renewcommand*\caption@setfloatcapt{%
+ \ifx\caption@currentHref\@undefined \else
+ \let\caption@makeanchor\@firstofone
+ \fi
+ \caption@ORI@setfloatcapt}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@defrostHref}
+% If there is a freezed |\@currentHref|, we set the \package{hyperref}
+% anchor here.
+% \begin{macrocode}
+ \def\caption@defrostHref{%
+ \ifx\caption@currentHref\@undefined \else
+ \caption@startanchor\caption@currentHref
+ \global\let\caption@currentHref\@undefined
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ }}{}
+% \end{macrocode}
+%
+% \subsubsection{The hypcap package}
+% \changes{v3.0f}{2005/06/22}{Support of the \package{hypcap} package added}
+% \changes{v3.0l}{2007/02/20}{Adapted to \package{hypcap} \version{1.6}}
+% \changes{v3.1e}{2007/11/04}{\package{hypcap} support adapted to \package{hyperref} \version{6.77}}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{hypcap}{% v1.0
+ \ifx\caption@start\relax \else % hyperref hasn't stopped early
+% \end{macrocode}
+%
+% If the \package{hypcap} package was loaded, we give up our own
+% hyperlink placement algorithm and give the control over the placement
+% to the \package{hypcap} package instead.
+%
+% \begin{macro}{\capstart}
+% \changes{v3.1k}{2009/10/09}{Support of \cs{ifcapstart} (\package{hypcap} package \version{1.10}) added}
+% We do this simply by mapping |\capstart| to |\caption@start@|,
+% although our code does not behave exactly like the original one:
+% The original |\capstart| has an effect on the next |\caption|
+% only but our version affects \emph{all} |\caption|s in the same
+% environment, at least unless a new |\capstart| will be placed.
+% \begin{macrocode}
+ \let\caption@ORI@capstart\capstart % save for compatibility mode
+ \caption@ifundefined\capstarttrue % check for v1.10 of hypcap package
+ {\def\capstart{\caption@start@}}%
+ {\def\capstart{\ifcapstart\caption@start@\fi}}%
+ \let\caption@start\relax
+ \let\caption@@start\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@hypcapspace}
+% Furthermore we map our |\caption@hypcapspace| to |\hypcapspace|
+% offered by the \package{hypcap} package.
+% \begin{macrocode}
+ \caption@set@bool\caption@ifhypcap 1%
+ \renewcommand*\caption@hypcapspace{\hypcapspace}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \fi}{}
+% \end{macrocode}
+%
+% \subsubsection{The listings package}
+% \changes{v3.0b}{2004/05/16}{Support of the \package{listings} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{listings}[2004/02/13 v1.2]{%
+% \end{macrocode}
+%
+% \begin{macro}{\lst@MakeCaption}
+% \changes{v3.1g}{2008/01/20}{Bugfix: Skips are handled correctly now}
+% \changes{v3.1k}{2008/03/29}{Bugfix 08-10-16-dctt: \texttt{rule=0} added}
+% \changes{v3.2}{2010/10/26}{Bugfix 10-07-20a: Set \cs{hsize} to \cs{linewidth}, if necessary}
+% To support the \package{listings} package we need to redefine
+% |\lst@MakeCaption| so the original stuff is nested with
+% |\caption@begin| and |\caption@end| etc.
+% \Note{This macro is always called twice (with `t' resp. `b' as
+% parameter), therefore we need an extra group here.}
+% \begin{macrocode}
+ \let\caption@ORI@lst@MakeCaption\lst@MakeCaption
+ \def\lst@MakeCaption#1{% #1 is `t' or `b'
+ \begingroup
+% \end{macrocode}
+% Workaround for bug in \package{listings} package:
+% If |\hsize| seems not to be set correctly, we set it to |\linewidth|.
+% \changes{v3.3}{2018/04/30}{Bugfix from Ulrike Fischer applied, see also \url{https://github.com/axelsommerfeldt/caption/issues/1}}
+% \begin{macrocode}
+ \@tempdima\linewidth
+ \advance\@tempdima\lst@xleftmargin
+ \advance\@tempdima\lst@xrightmargin
+ \ifdim\hsize>\@tempdima
+ \hsize\@tempdima
+ \fi
+% \end{macrocode}
+% First of all, we set |position=#1| and if it was set to `top',
+% we swap the skips so the default behavior of the \package{listings} package
+% will not be changed. (Note that the \package{listings} package has set its
+% own |\abovecaptionskip| \& |\belowcaptionskip| values prior to calling
+% \cs{lst@MakeCaption}.)
+% \begin{macrocode}
+ \caption@setposition{#1}%
+ \caption@iftop{%
+ \@tempdima\belowcaptionskip
+ \belowcaptionskip\abovecaptionskip
+ \abovecaptionskip\@tempdima}{}%
+% \end{macrocode}
+% Workaround for issue with wrong skips (FIXME: should be examined further)
+% \begin{macrocode}
+ \caption@setup{rule=0}%
+% \end{macrocode}
+% Afterwards we set the local `lstlisting' options.
+% \begin{macrocode}
+ \caption@setoptions{lstlisting}%
+% \end{macrocode}
+% If the |position=| is now set to |auto|, we take over the |captionpos=|
+% setting from the \package{listings} package.
+% \begin{macrocode}
+ \caption@setautoposition{#1}%
+% \end{macrocode}
+% At the end we do similar stuff as in our \cs{@caption} code.
+% \begin{macrocode}
+ \caption@begin{lstlisting}%
+ \caption@ORI@lst@MakeCaption{#1}%
+ \caption@end
+% \end{macrocode}
+% \begin{macrocode}
+ \endgroup}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\lst@makecaption}
+% \begin{macro}{\lst@maketitle}
+% Wrapper macros for typesetting the |caption=| resp. |title=| value.
+% \begin{macrocode}
+ \def\lst@makecaption{\caption@starfalse\@makecaption}%
+ \def\lst@maketitle{\caption@startrue\@makecaption\@empty}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ext@lstlisting}
+% \changes{v3.1}{2007/03/03}{This macro added}
+% Since the \package{listings} package do not define |\ext@lstlisting|
+% but we needed it when |\captionof{lstlisting}| will be done by the end user,
+% we define it here.
+% \begin{macrocode}
+ \providecommand*\ext@lstlisting{lol}%
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.1a}{2007/07/13}{Bugfix 07-09-13: \cs{lst@@caption} will not be re-defined anymore}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The longtable package}
+%
+% \begin{macro}{\LTcaptype}
+% \changes{v3.1}{2007/07/06}{This macro and its support added}
+% |\LTcaptype| is preset to |table|.
+% \begin{macrocode}
+\providecommand*\LTcaptype{table}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{longtable}[1995/05/24 v3.14]{%
+% \end{macrocode}
+% \begin{macrocode}
+ \RequirePackage{ltcaption}[=2018/08/26]%
+ \let\LT@@makecaption\@undefined
+% \end{macrocode}
+%
+% \begin{macro}{\LT@array}
+% \changes{v3.1}{2007/07/22}{This redefinition added}
+% \changes{v3.1a}{2007/09/14}{Bugfix 07-09-14: Redefinition of \cs{@captionabovetrue} \& \cs{@captionabovefalse} added}
+% \changes{v3.1a}{2007/09/16}{Bugfix: This redefinition will always be done \cs{AtBeginDocument}}
+% \changes{v3.1g}{2008/01/20}{Bugfix in \cs{captionlistentry}: Table counter will not be incremented anymore, \cs{nameref} works}
+% \changes{v3.3}{2016/01/31}{Support for \cs{bicaption} added}
+% \changes{v3.3}{2018/10/05}{Definition of \cs{captionlistentry} fixed}
+% We redefine |\LT@array| here to get |\captionsetup|\marg{options}
+% working inside |longtable|s.
+% \Note{Since the \package{hyperref} package patches \cs{LT@array} as well
+% and since this only works with the original definition of \cs{LT@array},
+% we have to do this after the \package{hyperref} package,
+% i.e.~\cs{AtBeginDocument}.}
+% \begin{macrocode}
+ \caption@AtBeginDocument{%
+ \let\caption@ORI@LT@array\LT@array
+ \renewcommand*\LT@array{%
+% \end{macrocode}
+% |\captionsetup| for longtable:
+% \begin{macrocode}
+ \global\let\caption@opt@@longtable\@undefined
+ \def\captionsetup{%
+ \noalign\bgroup
+ \@ifstar\@captionsetup\@captionsetup}% gobble *
+ \def\@captionsetup##1{\LT@captionsetup{##1}\egroup}%
+ \def\LT@captionsetup##1{%
+ \captionsetup@startrue\caption@setup@options[@longtable]{##1}%
+ \global\let\caption@opt@@longtable\caption@opt@@longtable}%
+% \end{macrocode}
+% |\captionabove| \& |\captionbelow| for longtable: (\KOMAScript\ document class)
+% \begin{macrocode}
+ \def\@captionabovetrue{\LT@captionsetup{position=t}}%
+ \def\@captionabovefalse{\LT@captionsetup{position=b}}%
+% \end{macrocode}
+% |\captionlistentry| for longtable:
+% \begin{macrocode}
+ \def\captionlistentry{%
+ \noalign\bgroup
+ \@ifstar{\egroup\LT@listentry\LTcaptype}% gobble *
+ {\egroup\LT@listentry\LTcaptype}}%
+% \end{macrocode}
+% |\ContinuedFloat| for longtable:\\
+% {\small(Commented out, since it's not deeply tested and quite useless anyway)}
+% \Note{\package{hyperref} versions $<$ v6.76j uses $2\times$ \cs{hyper@makecurrent}}
+% \begin{macrocode}
+% \caption@ifhypcap{%
+% \let\caption@ORI@hyper@makecurrent\hyper@makecurrent
+% \def\hyper@makecurrent##1{%
+% \let\hyper@makecurrent\caption@ORI@hyper@makecurrent
+% \caption@makestart{##1}%
+%% \let\Hy@LT@currentHlabel\@currentHlabel
+% \let\Hy@LT@currentHref\@currentHref
+% \def\hyper@makecurrent####1{%
+%% \let\@currentHlabel\Hy@LT@currentHlabel
+% \let\@currentHref\Hy@LT@currentHref}}%
+% \let\caption@ORI@ContinuedFloat\ContinuedFloat
+% \def\ContinuedFloat{\noalign{%
+% \gdef\caption@setContinuedFloat{%
+% \let\caption@resetContinuedFloat\@gobble}%
+% \def\caption@setoptions####1{%
+% \g@addto@macro\caption@setContinuedFloat{%
+% \caption@setoptions{####1}}}%
+% \let\@captype\LTcaptype
+% \caption@ORI@ContinuedFloat}}%
+% }{%
+% \def\ContinuedFloat{\noalign{%
+% \caption@Error{%
+% \noexpand\ContinuedFloat inside longtables\MessageBreak
+% is only available with `hypcap=true'}}}%
+% }%
+% \global\let\caption@setContinuedFloat\@empty
+ \def\ContinuedFloat{\noalign{%
+ \caption@Error{\noexpand\ContinuedFloat outside float}}}%
+% \end{macrocode}
+% |\bicaption| for longtable:
+% \begin{macrocode}
+ \let\bicaption\LT@bicaption
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@ORI@LT@array}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LT@capti@n}
+% \changes{v3.3}{2016/02/01}{This re-definition added}
+% The original implementation:
+% \begin{verbatim}
+% \def\LT@capti@n{%
+% \@ifstar
+% {\egroup\LT@c@ption\@gobble[]}%
+% {\egroup\@xdblarg{\LT@c@ption\@firstofone}}}
+% \end{verbatim}%^^A
+% Our implementation uses |\caption@xdblarg| instead of |\@xdblarg|:
+% \begin{macrocode}
+ \def\LT@capti@n{%
+ \@ifstar
+ {\egroup\LT@c@ption\@gobble[]}%
+ {\egroup\caption@xdblarg{\LT@c@ption\@firstofone}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LT@makecaption}
+% \changes{v3.0d}{2004/08/10}{%
+% Bugfix 04-08-04: \cs{abovecaptionskip} \& \cs{belowcaptionskip} will be used now}
+% \changes{v3.0e}{2005/05/05}{%
+% Bugfix: \cs{captionsetup[longtable]} overrides \cs{LTcapwidth} now}
+% \changes{v3.0h}{2005/10/07}{\cs{caption@LT@make} introduced}
+% \changes{v3.3}{2016/02/01}{Support for \cs{bicaption} via \cs{caption@LT@setup} added}
+% \changes{v3.3a}{2019/04/02}{Work-around for problem with \package{floatrow} added}
+% |\LT@makecaption|\marg{cmd}\marg{label}\marg{text}\par
+% \smallskip
+% The original definition:
+% \begin{verbatim}
+% \def\LT@makecaption#1#2#3{%
+% \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{%
+% % Based on article class "\@makecaption", "#1" is "\@gobble" in star
+% % form, and "\@firstofone" otherwise.
+% \sbox\@tempboxa{#1{#2: }#3}%
+% \ifdim\wd\@tempboxa>\hsize
+% #1{#2: }#3%
+% \else
+% \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
+% \fi
+% \endgraf\vskip\baselineskip}%
+% \hss}}}
+% \end{verbatim}%^^A
+% Our definition:
+% \begin{macrocode}
+ \renewcommand\LT@makecaption[3]{%
+ \caption@LT@make{%
+ \caption@LT@settype\LTcaptype
+% \end{macrocode}
+%
+% |\caption@LT@setup| is re-defined inside the \package{bicaption} package
+% and contains the preparation of typesetting of the bilingual caption.
+% \begin{macrocode}
+ \caption@LT@setup
+% \end{macrocode}
+%
+% \iffalse
+% The default |position=| setting for longtables is |top|.
+% (This emulates the standard behavior of the \package{longtable} package
+% which has no skip above the caption but a skip below it.)
+% \fi
+%
+% |position=auto| is a bad idea for longtables, but we do our very best.
+% This works quite well for captions inside the longtable contents, but
+% not for captions inside the longtable (end)foot.
+% \Note{This should be `top' if unclear!}
+% \begin{macrocode}
+ \caption@setautoposition{\ifcase\LT@rows t\else b\fi}%
+% \end{macrocode}
+%
+% We set |\ifcaption@star| according the 1st argument.
+% \begin{macrocode}
+ \caption@startrue#1\caption@starfalse
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@prepare@stepcounter\LTcaptype{LT}%
+% \end{macrocode}
+%
+% \changes{v3.1}{2007/05/05}{\cs{caption@normalsize} added}
+% \begin{macrocode}
+ \caption@begin\LTcaptype
+ \caption@normalsize
+% \end{macrocode}
+%
+% The following skip has the purpose to correct the height of the
+% |\parbox[t]|. Usually it's the height of the very first line, but
+% because of our extra skips (|\abovecaptionskip| and |\belowcaptionskip|)
+% it's always |0pt|.\par
+% (A different idea would be typesetting the first skip outside the longtable
+% column with |\noalign{\vskip|\ldots|}|, but this means we have to move
+% |\caption@begin| to some other place because it does not work in tabular
+% mode. And at the moment I have no idea on how to do this in an elegant
+% way\ldots)
+% \begin{macrocode}
+ \vskip-\ht\strutbox
+% \end{macrocode}
+%
+% Work-around for problem with \package{floatrow}:
+% The |\belowcaptionskip| disturbs the environment in which the caption is actually typeset (by creating extra, unwanted space),
+% so we supress this skip if the \package{floatrow} package is loaded.
+% (This fixes \issue{50})
+% \begin{macrocode}
+ \caption@ifundefined\FBifcaptop{}{%
+ \let\caption@belowskip\@empty}%
+% \end{macrocode}
+%
+% The following code should look familiar. We do our skips and use
+% |\caption@@make| to typeset the caption itself.
+% \begin{macrocode}
+ \caption@make@above
+ \caption@@make{#2}{#3}\endgraf
+ \caption@make@below
+ \caption@end}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LT@listentry}
+% \changes{v3.3}{2018/08/26}{This macro added}
+% \changes{v3.3}{2018/10/05}{Bugfix: \cs{ignorespaces} added}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
+% \begin{macrocode}
+ \renewcommand*\LT@listentry[2]{%
+ \begingroup
+ \caption@LT@settype{#1}%
+ \caption@listentry\@firstoftwo[{#1}]{#2}%
+ \endgroup\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@LT@settype}
+% \changes{v3.3}{2018/08/26}{This macro added}
+% \changes{v3.3}{2018/10/05}{Uses argument no. 1 instead of \cs{LTcaptype}}
+% \begin{macrocode}
+ \newcommand*\caption@LT@settype[1]{%
+ \caption@settype*{#1}%
+% \end{macrocode}
+% If |\LTcapwidth| is not set to its default value |4in| we assume
+% that it shall overwrite our own setting.
+% (But |\captionsetup[longtable]{width=|\ldots|}| will overwrite |\LTcapwidth|.)
+% \begin{macrocode}
+ \ifdim\LTcapwidth=4in \else
+ \setcaptionwidth\LTcapwidth
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@setoptions{longtable}%
+% \caption@setContinuedFloat
+% \end{macrocode}
+% Finally set options applied by |\captionsetup| inside the longtable.
+% \begin{macrocode}
+ \caption@setoptions{@longtable}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@LT@setup}
+% \changes{v3.3}{2016/02/01}{This macro added}
+% Hook for stuff which prepares the typesetting of the \package{longtable} caption.
+% \begin{macrocode}
+\providecommand*\caption@LT@setup{}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{The picinpar package}
+% \changes{v3.1}{2007/06/13}{Support of the \package{picinpar} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{picinpar}{%
+% \end{macrocode}
+%
+% \begin{macro}{\figwindow}
+% \begin{macro}{\tabwindow}
+% The \package{picinpar} package comes with its own caption code
+% (|\wincaption|, |\@wincaption|, |\@makewincaption|, \ldots)
+% so we redefine |\figwindow| \& |\tabwindow| to use |\caption| instead.
+% \begin{macrocode}
+ \long\def\figwindow[#1,#2,#3,#4] {%
+ \caption@window{figure}%
+ \caption@setoptions{figwindow}%
+ \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }%
+% \end{macrocode}
+% \begin{macrocode}
+ \long\def\tabwindow[#1,#2,#3,#4] {%
+ \caption@window{table}%
+ \caption@setoptions{tabwindow}%
+ \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@window}
+% \changes{v3.1c}{2007/10/06}{Bugfix: \cs{caption@clearmargin} added}
+% Beside calling |\caption@settype| we redefine |\caption@boxrestore|
+% (as in \package{floatflt} \& \package{picins} package support)
+% and |\@makecaption| (as in \package{float} package support) here.
+% \begin{macrocode}
+ \newcommand*\caption@window[1]{%
+ \let\@makecaption\caption@@make
+ \caption@setautoposition b%
+ \caption@settype{#1}%
+ \caption@clearmargin
+ \caption@setfullparboxrestore}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@wincaption}
+% \changes{v3.1d}{2007/10/25}{Missing \% added}
+% \changes{v3.3}{2013/04/14}{\cs{caption@ContinuedFloattrue} added}
+% \changes{v3.3}{2018/10/06}{\cs{caption@ContinuedFloattrue} replaced by \cs{caption@setflag1}}
+% This one finally typesets the caption using |\caption|.
+% \begin{macrocode}
+ \newcommand\caption@wincaption[1]{%
+% \end{macrocode}
+% This will be done twice for every |figwindow| \& |tabwindow| caption --
+% on the first run |\picwd| is |0pt|, on the second run |\picwd| is |\hsize|.
+% \begin{macrocode}
+ \ifdim\picwd=\z@
+ \let\caption@makecurrent\@gobbletwo
+ \let\caption@@start\relax
+ \caption@prepareslc
+ \else
+ \caption@setflag1%
+ \fi
+% \end{macrocode}
+% The argument |#1| could contain simply the caption text
+% (e.g.~|A figure caption|), but it could also contain an optional argument,
+% the \meta{lst\_entry}
+% (e.g.~|[An| |entry| |to| |the| |LOF]||{A| |figure| |caption}|).
+% Therefore we have to test if |#1| begins with~|[| or not; furthermore we
+% support a starred variant -- as in |\caption*| -- so we test for~|*|, too.
+% \begin{macrocode}
+ \edef\@tempa{\expandafter\noexpand\@car#1\@nil}%
+ \if\@tempa*%
+ \let\@tempa\@firstofone
+ \else\if\@tempa[%]
+ \let\@tempa\@firstofone
+ \else
+ \let\@tempa\@empty
+ \fi\fi
+ \expandafter\caption\@tempa{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The picins package}
+% \changes{v3.0j}{2006/01/26}{Support of the \package{picins} package added}
+%
+% \begin{macro}{\piccaptiontype}
+% |\piccaptiontype|\marg{type}\par
+% We offer this macro for changing the \meta{type} of the caption, so the user
+% doesn't have to redefine |\@captype|, as proposed in the \package{picins}
+% documentation.
+% \Note{We define this macro here so it can be used in the
+% preamble of the document, even when \thispackage\ was loaded prior to the
+% \package{picins} package.}
+% \begin{macrocode}
+\newcommand*\piccaptiontype[1]{\def\@piccaptype{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{picins}{%
+% \end{macrocode}
+%
+% Initial set |\@piccaptype| and undefine |\@captype| which was set to
+% |figure| by the \package{picins} package.
+% \begin{macrocode}
+ \caption@ifundefined\@piccaptype{%
+ \caption@iftype{%
+ \let\@piccaptype\@captype
+ }{%
+ \def\@piccaptype{figure}%
+ }%
+ }{}%
+ \let\@captype\@undefined
+% \end{macrocode}
+%
+% \begin{macro}{\piccaption}
+% The original code:
+% \begin{verbatim}
+% \def\piccaption{\@ifnextchar [{\@piccaption}{\@piccaption[]}}
+% \end{verbatim}%^^A
+% Our code uses |\caption@star| so |\piccaption*| works,
+% and |\caption@dblarg| so |\piccaption{}| works correctly.
+% \begin{macrocode}
+ \def\piccaption{\caption@star\relax{\caption@dblarg\@piccaption}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\make@piccaption}
+% \changes{v3.1}{2007/12/06}{Bugfix: \cs{caption@clearmargin} will always be used now}
+% The original code:
+% \begin{verbatim}
+% \def\make@piccaption{%
+% [...]
+% \setbox\@TEXT=\vbox{\hsize\hsiz@\caption[\sh@rtf@rm]{\capti@nt@xt}}%
+% }
+% \end{verbatim}%^^A
+% In our code we have to correct several things:
+% \begin{enumerate}
+% \item |\@captype| must be defined, since we have removed the global
+% definition.
+% \item We use |\caption@setoptions{parpic}| so
+% |\captionsetup[parpic]{|\ldots|}| is supported.
+% \item |\linewidth| must be set correctly.
+% Usually this is done by |\@parboxrestore| inside |\@caption|,
+% but since we use |\@caption@boxrestore| we have to map this to
+% |\@parboxrestore| instead.
+% \item The two arguments of |\caption| (|\sh@rtf@rm| \& |\capti@nt@xt|)
+% should be expanded on first level so |\caption[]{|\ldots|}| and
+% |\caption[|\ldots|]{}| work correctly.
+% \end{enumerate}
+% \begin{macrocode}
+ \let\caption@ORI@make@piccaption\make@piccaption
+ \def\make@piccaption{%
+ \let\caption@ORI\caption
+% \end{macrocode}
+% \begin{macrocode}
+ \long\def\caption[##1]##2{%
+ \caption@freezeHref % will be defrosted in \ivparpic
+ \caption@settype\@piccaptype
+% \ifnum\c@piccaptionpos>2\relax
+ \caption@clearmargin
+% \else
+% \captionwidth\z@ % do not use "width=" setting
+% \fi
+ \caption@setfullparboxrestore
+ \caption@setoptions{parpic}%
+ \caption@setautoposition b%
+% \end{macrocode}
+% \begin{macrocode}
+ \expandafter\expandafter\expandafter\caption@ORI
+ \expandafter\expandafter\expandafter[%
+ \expandafter\expandafter\expandafter{%
+ \expandafter##1\expandafter}\expandafter]\expandafter{##2}}%
+% \end{macrocode}
+% {\footnotesize\begin{quote}
+% \leavevmode\llap{-or-\quad}%^^A
+% |\begingroup|\\
+% | \toks0\expandafter{##1}| |\toks2\expandafter{##2}|\\
+% | \edef\x{\endgroup|\\
+% | \noexpand\caption@ORI[{\the\toks0}]{\the\toks2}}|\\
+% | \x|
+% \end{quote}
+% \begin{quote}
+% \leavevmode\llap{-or-\quad}%^^A
+% |\edef\x{%|\\
+% | \noexpand\caption@ORI[{\unexpanded\expandafter{##1}}]%|\\
+% | {\unexpanded\expandafter{##2}}}|\\
+% |\-|
+% \end{quote}}
+% \begin{macrocode}
+ \caption@ORI@make@piccaption
+ \let\caption\caption@ORI}%
+% \end{macrocode}
+% \end{macro}
+%
+
+% \begin{macro}{\ivparpic}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
+% We need to set our \package{hyperref} anchor here.
+% Not bullet-proof since we have to redefine |\noindent| here!
+% \begin{macrocode}
+ \let\caption@ORI@ivparpic\ivparpic
+ \def\ivparpic(#1,#2)(#3,#4)[#5][#6]#7{%
+ \let\caption@ORI@noindent\noindent
+ \def\noindent{%
+ \caption@defrostHref
+ \let\noindent\caption@ORI@noindent
+ \noindent}%
+ \caption@ORI@ivparpic(#1,#2)(#3,#4)[{#5}][{#6}]{#7}%
+ \let\noindent\caption@ORI@noindent}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{%
+ \let\piccaptiontype\@undefined
+}
+% \end{macrocode}
+%
+% \subsubsection{The rotating package}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{rotating}[1995/08/22 v2.10]{%
+% \end{macrocode}
+%
+% \begin{macro}{\rotcaption}
+% \changes{v3.0c}{2004/07/16}{Bugfix: Check for \cs{caption@star} removed}
+% \changes{v3.0i}{2005/12/07}{Rewritten, works with \package{hyperref} now}
+% Make |\rotcaption*| work.
+% \begin{macrocode}
+ \def\rotcaption{\let\@makecaption\@makerotcaption\caption}%
+% \let\@rotcaption\@undefined
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\rotcaptionof}
+% \changes{v3.0i}{2005/12/07}{New}
+% Make |\rotcaptionof(*)| work.
+% \begin{macrocode}
+ \def\rotcaptionof{%
+ \caption@teststar\caption@of{\rotcaption*}\rotcaption}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makerotcaption}
+% \changes{v3.0i}{2005/12/06}{Rewritten, should finally work proper now}
+% \changes{v3.0m}{2007/03/04}{Uses \cs{caption@parbox} instead of \cs{caption@start/endbox} now}
+% \changes{v3.3}{2012/12/26}{Rewritten (again)}
+% Original (bugfixed) code:
+% \begin{verbatim}
+% \long\def\@makerotcaption#1#2{%
+% \setbox\@tempboxa\hbox{#1: #2}%
+% \ifdim \wd\@tempboxa > .8\vsize
+% \rotatebox{90}{%
+% \begin{minipage}{.8\textheight}#1: #2\end{minipage}%
+% }%\par % <== \par removed (AR)
+% \else%
+% \rotatebox{90}{\box\@tempboxa}%
+% \fi
+% \nobreak\hspace{12pt}% <== \nobreak added (AR)
+% }
+% \end{verbatim}%^^A
+% Our version emulates this behavior, but if |width=| is set,
+% the rotated caption is always typeset as |\parbox|.
+% (Note that |margin=| is not supported here.)
+% \begin{macrocode}
+ \long\def\@makerotcaption#1#2{%
+ \rotatebox{90}{%
+ \ifdim\captionwidth=\z@
+ \setcaptionwidth{.8\vsize}%
+ \l@addto@macro\caption@singleline{%
+ \caption@setup{parbox=none}}%
+ \fi
+ \let\caption@calcmargin\relax
+ \caption@@make{#1}{#2}}%
+ \nobreak\hspace{12pt}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The sidecap package}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{sidecap}[2003/06/06 v1.6f]{%
+ \caption@setbool{needfreeze}{1}%
+% \end{macrocode}
+%
+% \begin{macro}{\SC@zfloat}
+% \changes{v3.0b}{2004/05/16}{Local definition of \cs{captionsetup} added}
+% \changes{v3.0c}{2004/07/16}{Bugfix 04-07-15: Check for \cs{caption@star} removed}
+% \changes{v3.1c}{2007/10/06}{\cs{caption} will be saved \& restored now}
+% \changes{v3.2a}{2011/08/17}{Bugfix: Uses \cs{caption@freeze} instead of \cs{caption@freeze*} now}
+% \changes{v3.3}{2013/05/01}{Usage of \cs{caption@freeze} replaced by \cs{caption@freezetype}}
+% This macro will be called at the start of the environment, here is a good
+% opportunity to do some adaptations to |\caption| and |\captionsetup|.
+% \begin{macrocode}
+ \let\caption@ORI@SC@zfloat\SC@zfloat
+ \def\SC@zfloat#1#2#3[#4]{%
+% \end{macrocode}
+% First we use the original definition, but restore \cs{caption} and \cs{label}
+% so \cs{caption@freeze} and \cs{caption@warmup} will work correctly.
+% \begin{macrocode}
+ \caption@ORI@SC@zfloat{#1}{#2}{#3}[#4]%
+ \SC@RestoreCommands
+% \end{macrocode}
+% Since the sidecap package uses our |\caption| code outside the
+% environment the regular |\captionsetup| will not work.
+% So we need a special version here which saves the given argument list
+% which will be executed later on.
+% Furthermore we need to make |\caption*| work.
+% \begin{macrocode}
+ \caption@freezetype{#2}%
+% \end{macrocode}
+% The sidecap package uses |\ifx\label\SC@label| to test if it is just inside a
+% |SC|\-|figure| or not. So we redefine |\SC@label| here so this test will still work.
+% \begin{macrocode}
+ \let\SC@label\label}%
+% \end{macrocode}
+% \begin{macrocode}
+ \providecommand*\SC@RestoreCommands{%
+ \let\caption=\SC@orig@caption \let\label=\SC@orig@label}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\endSC@FLOAT}
+% \changes{v3.0i}{2006/01/12}{\cs{@listdepth}\cs{z@} added}
+% \changes{v3.1}{2007/05/05}{Call of \cs{caption@setoptions}\arg{SCfloat} added}
+% This macro will be called at the end of the environment, here we need to
+% setup our stuff before the \package{sidecap} package actually typesets
+% its caption.
+% \begin{macrocode}
+ \let\caption@ORI@endSC@FLOAT\endSC@FLOAT
+ \def\endSC@FLOAT{%
+% \end{macrocode}
+% Before we can typeset the caption we need to set the margin to zero
+% because any extra margin would only be disturbing here.\par
+% (We don't need to take care about the caption position because
+% the sidecap package set both |\abovecaptionskip| and |\belowcaptionskip|
+% to a skip of zero anyway.)\par
+% Furthermore |\SC@justify| will override the caption justification, if set.
+% The usage of |\SC@justify| differs from version to version of the
+% \package{sidecap} package:\par
+% \begin{tabular}{ll}
+% Version 1.4: & |\SC@justify| is not defined\\
+% Version 1.5: & |\SC@justify| is |\relax| when not set\\
+% Version 1.6: & |\SC@justify| is |\@empty| when not set\\
+% \end{tabular}
+% \begin{macrocode}
+ \def\caption@setSC@justify{%
+ \caption@clearmargin
+ \ifx\SC@justify\@empty \else
+ \let\caption@hj\SC@justify
+ \let\SC@justify\@empty
+ \fi}%
+% \end{macrocode}
+% Make the original definition of |\endSC@FLOAT| to use our caption
+% stuff instead of its own.
+% \Note{At this point the \package{sidecap} definition of \cs{caption} is valid,
+% not the regular one!}
+% \begin{macrocode}
+ \let\caption\SC@orig@caption
+ \def\SC@orig@caption[##1]##2{%
+ \caption@setSC@justify
+%%% \caption@setoptions{SC}%
+ \caption@setoptions{SC\@captype}%
+ \caption@defrost}%
+% \end{macrocode}
+% Finally we call the original definition of |\endSC@FLOAT|.
+% \begin{macrocode}
+ \caption@setSC@justify % for compatibility mode
+ \caption@prepare@defrost
+ \caption@ORI@endSC@FLOAT}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The subfigure package}
+% \changes{v3.1}{2007/04/06}{subfigure package support added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{subfigure}[2002/01/23 v2.1]{%
+% \end{macrocode}
+%
+% \begin{macro}{\sf@ifpositiontop}
+% \changes{v3.1a}{2007/09/15}{Bugfix 07-09-15: Check for \cs{@captype} added}
+% If the \package{subfigure} package is loaded, we map |\sf@ifpositiontop|
+% to |\iffiguretopcap| resp. |\iftabletopcap|, so the \package{subfigure}
+% \version{2.1} options \opt{figbotcap} etc. will still work.
+% \begin{macrocode}
+ \def\sf@ifpositiontop{%
+ \ifx\@captype\@undefined
+ \expandafter\@gobbletwo
+ \else\ifx\@captype\relax
+ \expandafter\expandafter\expandafter\@gobbletwo
+ \else
+ \expandafter\expandafter\expandafter\sf@if@position@top
+ \fi\fi}
+% \end{macrocode}
+% \begin{macrocode}
+ \def\sf@if@position@top{%
+ \@ifundefined{if\@captype topcap}%
+ {\@gobbletwo}%
+ {\@nameuse{if\@captype topcap}%
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The supertabular and xtab packages}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{supertabular}[2002/07/19 v4.1e]{%
+% \end{macrocode}
+%
+% \begin{macro}{\tablecaption}
+% \changes{v3.0e}{2005/05/05}{Made \cs{topcaption*} and \cs{bottomcaption*} work}
+% \changes{v3.1h}{2008/04/01}{Bugfix: Star variant does not increment table counter anymore}
+% Make |\topcaption*| and |\bottomcaption*| work.
+% \begin{macrocode}
+ \renewcommand*\tablecaption{%
+ \caption@star
+ {\refstepcounter{table}}%
+ {\caption@dblarg{\@xtablecaption}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@xtablecaption}
+% \changes{v3.1h}{2008/04/01}{Made \cs{nameref} \& \cs{autoref} work}
+% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
+% Make |\nameref| and |\autoref| work.
+% \begin{macrocode}
+ \let\caption@ORI@xtablecaption\@xtablecaption
+ \long\def\@xtablecaption[#1]#2{%
+ \caption@gettitle{#2}%
+ \caption@ORI@xtablecaption[{#1}]{#2}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@caption}
+% \changes{v3.0a}{2004/01/23}{Bugfix: Missing \cs{par} added}
+% \changes{v3.1h}{2008/04/01}{Bugfix: \cs{@currentlabelname} will be set now}
+% The original code:
+% \begin{verbatim}
+% \long\def\ST@caption#1[#2]#3{\par%
+% \addcontentsline{\csname ext@#1\endcsname}{#1}%
+% {\protect\numberline{%
+% \csname the#1\endcsname}{\ignorespaces #2}}
+% \begingroup
+% \@parboxrestore
+% \normalsize
+% \if@topcaption \vskip -10\p@ \fi
+% \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+% \if@topcaption \vskip 10\p@ \fi
+% \endgroup}
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \long\def\ST@caption#1[#2]#3{\par%
+ \caption@settype*{#1}%
+ \caption@setoptions{supertabular}%
+% \end{macrocode}
+% The |position=| setting will be overwritten by the
+% \package{supertabular} package: If |\topcaption| was used,
+% the position will be |top| automatically, |bottom| otherwise.
+% \begin{macrocode}
+ \def\caption@fixposition{%
+ \caption@setposition{\if@topcaption t\else b\fi}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@beginex{#1}{#2}{#3}%
+ \caption@boxrestore
+ \caption@normalsize
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+ \caption@end}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \changes{v3.1h}{2008/04/01}{Support of the xtab package added}
+% \begin{macrocode}
+\caption@IfPackageLoaded{xtab}[2000/04/09 v2.3]{%
+% \end{macrocode}
+%
+% \begin{macro}{\tablecaption}
+% Make |\topcaption*| and |\bottomcaption*| work.
+% \begin{macrocode}
+ \renewcommand*\tablecaption{%
+ \caption@star
+ {\refstepcounter{table}}%
+ {\caption@dblarg{\@xtablecaption}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@xtablecaption}
+% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
+% Make |\nameref| and |\autoref| work.
+% \begin{macrocode}
+ \let\caption@ORI@xtablecaption\@xtablecaption
+ \long\def\@xtablecaption[#1]#2{%
+ \caption@gettitle{#2}%
+ \caption@ORI@xtablecaption[{#1}]{#2}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@caption}
+% The original code:
+% \begin{verbatim}
+% \long\def\ST@caption#1[#2]#3{\par%
+% \@initisotab
+% \addcontentsline{\csname ext@#1\endcsname}{#1}%
+% {\protect\numberline{%
+% \csname the#1\endcsname}{\ignorespaces #2}}%
+% \begingroup
+% \@parboxrestore
+% \normalsize
+% %% \if@topcaption \vskip -10\p@ \fi
+% \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+% %% \if@topcaption \vskip 10\p@ \fi
+% \endgroup
+% \global\advance\ST@pageleft -\PWSTcapht
+% \ST@trace\tw@{Added caption. Space left for xtabular: \the\ST@pageleft}}
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \long\def\ST@caption#1[#2]#3{\par%
+ \caption@settype*{#1}%
+ \caption@setoptions{xtabular}%
+% \end{macrocode}
+% \begin{macrocode}
+ \def\caption@fixposition{%
+ \caption@setposition{\if@topcaption t\else b\fi}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \@initisotab
+ \caption@beginex{#1}{#2}{#3}%
+ \caption@boxrestore
+ \caption@normalsize
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+ \caption@end
+ \global\advance\ST@pageleft -\PWSTcapht
+ \ST@trace\tw@{Added caption. Space left for xtabular: \the\ST@pageleft}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The threeparttable package}
+% \changes{v3.1}{2007/05/08}{Support of the \package{threeparttable} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{threeparttable}[2003/06/13 v3.0]{%
+% \end{macrocode}
+%
+% \begin{macro}{\threeparttable}
+% \changes{v3.3}{2016/01/31}{Bugfix: \cs{@captype} will be used if already defined}
+% Unfortunately |\@captype| is not set when |\TPT@common| will be used,
+% so we have to redefine |\threeparttable| and |\measuredfigure| instead.
+% \begin{macrocode}
+ \let\caption@ORI@threeparttable\threeparttable
+ \renewcommand*\threeparttable{%
+ \caption@settype{\@ifundefined{@captype}{table}{\@captype}}%
+%%% \caption@setposition a% ?
+ \caption@clearmargin
+ \caption@setoptions{threeparttable}%
+ \caption@ORI@threeparttable}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\measuredfigure}
+% \changes{v3.3}{2016/01/31}{Bugfix: \cs{@captype} will be used if already defined}
+% Same here\ldots
+% \begin{macrocode}
+ \let\caption@ORI@measuredfigure\measuredfigure
+ \renewcommand*\measuredfigure{%
+ \caption@settype{\@ifundefined{@captype}{figure}{\@captype}}%
+%%% \caption@setposition a% ?
+ \caption@clearmargin
+ \caption@setoptions{measuredfigure}%
+ \caption@ORI@measuredfigure}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TPT@caption}
+% The original code:
+% \begin{verbatim}
+% \def\TPT@caption#1[#2]#3{\gdef\TPT@docapt
+% {\par\global\let\TPT@docapt\@undefined \TPT@LA@caption{#1}[{#2}]%
+% {\strut\ignorespaces#3\ifhmode\unskip\@finalstrut\strutbox\fi}}%
+% \ifx\TPT@hsize\@empty \let\label\TPT@gatherlabel \abovecaptionskip\z@skip
+% \else \TPT@docapt \fi \ignorespaces}
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \def\TPT@caption#1[#2]#3{%
+ \gdef\TPT@docapt{%
+ \global\let\TPT@docapt\@undefined
+ \caption@setautoposition\caption@TPT@position
+ \TPT@LA@caption{#1}[{#2}]{#3}}%
+ \ifx\TPT@hsize\@empty
+ \let\label\TPT@gatherlabel % Bug: does not work for measuredfigures
+ \gdef\caption@TPT@position{t}%
+ \g@addto@macro\TPT@docapt\caption@TPT@eatvskip
+ \else
+ \def\caption@TPT@position{b}%
+ \TPT@docapt
+ \fi
+ \ignorespaces}%
+% \end{macrocode}
+% \begin{macrocode}
+ %\newcommand*\caption@TPT@eatvskip{\vskip-.2\baselineskip}%
+ \def\caption@TPT@eatvskip#1\vskip{#1\@tempdima=}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsubsection{The wrapfig package}
+% \changes{v3.1}{2007/05/05}{Support of the \package{wrapfig} package added}
+% \changes{v3.2d}{2011/11/02}{Support of the \package{wrapfig} package rewritten}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{wrapfig}[2003/01/31 v3.6]{%
+% \end{macrocode}
+%
+% \begin{macro}{\wrapfloat}
+% \changes{v3.2d}{2011/11/02}{Redefinition of this macro added}
+% First of all we make the \package{wrapfig} package independent from the package
+% load order regarding the \package{float} package.
+% Since the usage of |\@float@set|\-|every| is missing in the code of the \package{wrapfig}
+% package (it should be in the redefinition of |\float@re|\-|style|, right after
+% |\@nameuse{fst@#1}|), we don't use it here, too,
+% especially since |\wrap|\-|float| will usually not be used when used with re-styled floats.
+% \begin{macrocode}
+ \renewcommand*\wrapfloat[1]{%
+ \def\@captype{#1}%
+ \@ifundefined{fst@#1}{}{%
+ \@nameuse{fst@#1}%
+% \@float@setevery{#1}%
+ \def\WF@floatstyhook{\let\@currbox\WF@box
+ \global\setbox\WF@box\float@makebox{\wd\WF@box}}}%
+ \@ifnextchar[\WF@wr{\WF@wr[]}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\WF@rapt}
+% \changes{v3.2d}{2011/11/02}{Usage of \cs{WF@captionstyhook} added}
+% Original code:
+% \begin{verbatim}
+% \def\WF@rapt[#1]#2{% final two args: #1 = overhang, #2 = width,
+% \gdef\WF@ovh{#1}% hold overhang for later, when \width is known
+% \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}%
+% \ifdim\hsize>\z@ \@parboxrestore \else
+% \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption
+% \ignorespaces \fi}
+% \end{verbatim}%^^A
+% Our code has |\WF@captionstyhook| in addition:
+% \begin{macrocode}
+ \def\WF@rapt[#1]#2{% final two args: #1 = overhang, #2 = width,
+ \gdef\WF@ovh{#1}% hold overhang for later, when \width is known
+ \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}%
+ \expandafter\WF@captionstyhook\expandafter{\@captype}% <= new
+ \ifdim\hsize>\z@ \@parboxrestore \else
+ \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption
+ \ignorespaces \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\WF@captionstyhook}
+% \changes{v3.2d}{2011/11/02}{This macro added}
+% \changes{v3.2e}{2011/11/10}{Bugfix 11-11-09: float package support fixed}
+% We place our \package{hyperref} anchor here, apply the `wrap' options etc.
+% Since the usage of |\@float@set|\-|every| is missing in the \package{wrapfig}
+% package we will catch it up here for making the necessary adaptions to the
+% \package{float} package.
+% \begin{macrocode}
+ \def\WF@captionstyhook#1{%
+ \let\@captype\@undefined
+ \@ifundefined{fst@#1}{}{\@float@setevery{#1}}%
+ \caption@settype{#1}%
+ \caption@clearmargin
+%%% \caption@setoptions{wrap}%
+ \caption@setoptions{wrap#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \begin{thebibliography}{99}
+% \bibitem{beamer}
+% Till Tantau:\\
+% \href{http://www.ctan.org/pkg/beamer}%
+% {\emph{The beamer class, User Guide for version 3.25}},\\
+% December 26, 2012
+%
+% \bibitem{KOMAScript}
+% Markus Kohm \& Jens-Uwe-Morawski:\\
+% \href{http://www.ctan.org/pkg/koma-script}%
+% {\emph{KOMA-Script -- a versatile \LaTeXe\ bundle}},\\
+% 2012-07-22
+%
+% \bibitem{NTG}
+% Victor Eijkhout:\\
+% \href{http://www.ctan.org/pkg/ntgclass}%
+% {\emph{An introduction to the Dutch \LaTeX\ document classes}},\\
+% 3 September 1989
+%
+% \bibitem{float}
+% Anselm Lingnau:\\
+% \href{http://www.ctan.org/pkg/float}%
+% {\emph{An Improved Environment for Floats}},\\
+% 2001/11/08
+%
+% \bibitem{floatflt}
+% Mats Dahlgren:\\
+% \href{http://www.ctan.org/pkg/floatflt}%
+% {\emph{Welcome to the floatflt package}},\\
+% 1998/06/05
+%
+% \bibitem{floatrow}
+% Olga Lapko:\\
+% \href{http://www.ctan.org/pkg/floatrow}%
+% {\emph{The floatrow package documentation}},\\
+% 2009/08/02
+%
+% \bibitem{fltpage}
+% Sebastian Gross:\\
+% \href{http://www.ctan.org/pkg/fltpage}%
+% {\emph{Welcome to the beta test of fltpage package!}},\\
+% 1998/11/13
+%
+% \bibitem{hyperref}
+% Sebastian Rahtz \& Heiko Oberdiek:\\
+% \href{http://www.ctan.org/pkg/hyperref}%
+% {\emph{Hypertext marks in \LaTeX: a manual for hyperref}},\\
+% November 2012
+%
+% \bibitem{hypcap}
+% Heiko Oberdiek:\\
+% \href{http://www.ctan.org/pkg/oberdiek}%
+% {\emph{The hypcap package -- Adjusting anchors of captions}},\\
+% 2011/02/16
+%
+% \bibitem{listings}
+% Carsten Heinz \& Brooks Moses:\\
+% \href{http://www.ctan.org/pkg/listings}%
+% {\emph{The Listings Package}},\\
+% 2007/02/22
+%
+% \bibitem{longtable}
+% David Carlisle:\\
+% \href{http://www.ctan.org/pkg/longtable}%
+% {\emph{The longtable package}},\\
+% 2004/02/01
+%
+% \bibitem{picinpar}
+% Friedhelm Sowa:\\
+% \href{http://www.ctan.org/pkg/picinpar}%
+% {\emph{Pictures in Paragraphs}},\\
+% July 13, 1993
+%
+% \bibitem{picins}
+% Joachim Bleser and Edmund Lang:\\
+% \href{http://www.ctan.org/pkg/picins}%
+% {\emph{PicIns-Benutzerhandbuch Version 3.0}},\\
+% September~1992
+%
+% \bibitem{rotating}
+% Sebastian Rahtz and Leonor Barroca:\\
+% \href{http://www.ctan.org/pkg/rotating}%
+% {\emph{A style option for rotated objects in \LaTeX}},\\
+% 1997/09/26
+%
+% \bibitem{sidecap}
+% Rolf Niepraschk \& Hubert G\"a\ss lein:\\
+% \href{http://www.ctan.org/pkg/sidecap}%
+% {\emph{The sidecap package}},\\
+% 2003/06/06
+%
+% \bibitem{subfigure}
+% Steven D. Cochran:\\
+% \href{http://www.ctan.org/pkg/subfigure}%
+% {\emph{The subfigure package}},\\
+% 2005/03/15
+%
+% \bibitem{subfig}
+% Steven D. Cochran:\\
+% \href{http://www.ctan.org/pkg/subfig}%
+% {\emph{The subfig package}},\\
+% 2005/07/05
+%
+% \bibitem{supertabular}
+% Johannes Braams and Theo Jurriens:\\
+% \href{http://www.ctan.org/pkg/supertabular}%
+% {\emph{The supertabular environment}},\\
+% 2004/02/20
+%
+% \bibitem{threeparttable}
+% Donald Arseneau:\\
+% \href{http://www.ctan.org/pkg/threeparttable}%
+% {\emph{Three part tables: title, tabular environment, notes}},\\
+% March 5, 2010
+%
+% \bibitem{wrapfig}
+% Donald Arseneau:\\
+% \href{http://www.ctan.org/pkg/wrapfig}%
+% {\emph{WRAPFIG.STY ver 3.6}},\\
+% Jan 31, 2003
+%
+% \bibitem{xtab}
+% Peter Wilson:\\
+% \href{http://www.ctan.org/pkg/xtab}%
+% {\emph{The xtab package}},\\
+% 2011/07/31
+% \end{thebibliography}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/caption/fallback/v3.3/caption3.dtx b/Master/texmf-dist/source/latex/caption/fallback/v3.3/caption3.dtx
new file mode 100644
index 00000000000..bdffdcc66a1
--- /dev/null
+++ b/Master/texmf-dist/source/latex/caption/fallback/v3.3/caption3.dtx
@@ -0,0 +1,4176 @@
+% \iffalse meta-comment
+%
+% This is file `caption3.dtx'.
+%
+% Copyright (C) 1994-2019 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%
+% --------------------------------------------------------------------------
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Axel Sommerfeldt.
+%
+% This work consists of the files caption.ins, caption.dtx, caption2.dtx,
+% caption3.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx, and newfloat.dtx,
+% the derived files caption.sty, caption2.sty, caption3.sty,
+% bicaption.sty, ltcaption.sty, subcaption.sty, and newfloat.sty,
+% and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex.
+%
+% \fi
+% \CheckSum{3961}
+%
+% \iffalse
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption3.drv}[2015/09/15 v1.8 Implementation of the caption kernel]
+\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
+%\errorcontextlines=3
+%
+\documentclass{ltxdoc}
+\setlength\parindent{0pt}
+\setlength\parskip{\smallskipamount}
+%
+%\let\ORIsubsection\subsection
+%\def\subsection{\clearpage\ORIsubsection}
+%
+\makeatletter % make room for subsections like 2.16.14 in the TOC
+%\newcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
+\renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.7em}}
+\makeatother
+%
+\usepackage{ifpdf}
+\ifpdf
+ \usepackage{mathptmx,courier}
+ \usepackage[scaled=0.90]{helvet}
+ \addtolength\marginparwidth{15pt}
+\fi
+%
+\usepackage{hypdoc}
+\ifpdf\usepackage{hypdestopt}\fi
+\hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}}
+%
+\usepackage[debug]{caption3}[2018/05/01]
+%
+\DeclareRobustCommand*\eTeX{\texorpdfstring
+ {\leavevmode\hbox{$\varepsilon$}-\TeX}%
+ {e-TeX}}
+\DeclareRobustCommand*\AmS{\texorpdfstring
+ {{\protect\usefont{OMS}{cmsy}{m}{n}A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}%
+ {AMS}}
+\DeclareRobustCommand*\KOMAScript{\texorpdfstring
+ {\textsf{K\kern.05em O\kern.05em M\kern.05em A\kern.1em-\kern.1em Script}}%
+ {KOMA-Script}}
+\DeclareRobustCommand*\NTG{NTG}
+\DeclareRobustCommand*\SmF{SMF}
+%
+\begin{document}
+ \DocInput{caption3.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \newcommand*\purerm[1]{{\upshape\mdseries\rmfamily #1}}
+% \newcommand*\puresf[1]{{\upshape\mdseries\sffamily #1}}
+% \newcommand*\purett[1]{{\upshape\mdseries\ttfamily #1}}
+% \let\class\puresf \let\package\puresf
+% \let\env\purett \let\opt\purett
+%
+% \def\thispackage{the \package{caption} kernel}
+% \def\Thispackage{The \package{caption} kernel}
+%
+% \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
+% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
+% \newcommand*\version[2][]{\textit{v#2}}
+%
+% \GetFileInfo{caption3.drv}
+% \let\docdate\filedate
+% \GetFileInfo{caption3.sty}
+%
+% \title{The Implementation of
+% \texorpdfstring{\thispackage\thanks{%^^A
+% This package has version number \fileversion, last revised \filedate.}}%^^A
+% {the caption kernel}}
+% \author{Axel Sommerfeldt\\
+% \url{https://gitlab.com/axelsommerfeldt/caption}}
+% \date{\docdate}
+% \maketitle
+%
+% \begin{abstract}
+% \Thispackage\ consists of two parts -- the kernel
+% (|caption3.sty|) and the main package (|caption.sty|).
+%
+% The kernel provides all the user commands and internal macros which are
+% necessary for typesetting captions and setting parameters regarding these.
+% While the standard \LaTeX\ document classes provide an internal command
+% called |\@makecaption| and no options to control its behavior (except the
+% vertical skips above and below the caption itself), we provide similar
+% commands called |\caption@make| and |\caption@@make|, but with a lot of
+% options which can be selected with |\captionsetup|.
+% Loading the kernel part do not change the output of a \LaTeX\ document
+% -- it just provides functionality which can be used by \LaTeXe\ packages
+% which typesets captions, for example the \package{caption} and
+% \package{subfig} packages.
+% \end{abstract}
+%
+% \StopEventually{}
+% \clearpage
+% \tableofcontents
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \DoNotIndex{\\,\_,\ ,\@@par}
+% \DoNotIndex{\@bsphack}
+% \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
+% \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
+% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
+% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
+% \DoNotIndex{\if@minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@minipagefalse,\@minipagetrue}
+% \DoNotIndex{\@namedef,\@nameuse}
+% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
+% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setminipage,\@setpar}
+% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
+% \DoNotIndex{\@testopt}
+% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
+% \DoNotIndex{\p@,\z@}
+% \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
+% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
+% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
+% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
+% \DoNotIndex{\fi,\footnotesize,\global}
+% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
+% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
+% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
+% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
+% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
+% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
+% \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
+% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
+% \DoNotIndex{\providecommand,\quad}
+% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
+% \DoNotIndex{\rightskip,\rmfamily}
+% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
+% \DoNotIndex{\small,\string,\space,\strut}
+% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
+% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
+% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
+% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
+% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
+% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
+% \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \setlength{\parskip}{0pt plus 1pt}
+% \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
+%
+% \changes{v1.0}{2003/12/20}{Rewritten; many new commands and features}
+% \changes{v1.0c}{2004/11/28}{Split into two packages:
+% \package{caption} \& \package{caption3}}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \let\subsubsection\subsection
+% \let\subsection\section
+%
+% \iffalse
+%<*package>
+% \fi
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesPackage{caption3}[2019/09/01 v1.8d caption3 kernel (AR)]
+% \end{macrocode}
+%
+% \subsection{Workaround for bug in package \package{arabtex}}
+% \package{arabtex} re-defines \cs{@gobble} as not-long so the packages of the
+% \package{caption} package bundle are doomed to fail.
+% Since this fatal bug won't be fixed in \package{arabtex} but we are dependent on a
+% proper definition of \cs{@gobble}, \cs{@firstofone}, \cs{@firstoftwo}, \cs{@secondoftwo}
+% and so on we fix this here. (Sigh!)
+% \begin{macrocode}
+\providecommand\caption@FixArabTeX{%
+ \def\caption@tempa##1{}%
+ \ifx\caption@tempa\@gobble
+ \PackageInfo{caption3}{Fixing ArabTeX}%
+ \long\def\@gobble##1{}%
+ \fi}
+% \end{macrocode}
+% Do the fix now and at |\begin{document}|, in case \package{arabtex} will be loaded after \package{caption}.
+% \begin{macrocode}
+\caption@FixArabTeX
+\AtBeginDocument{%
+ \caption@FixArabTeX
+ \let\caption@FixArabTeX\@undefined}
+% \end{macrocode}
+%
+% \subsection{Generic helpers}
+%
+% \begin{macro}{\@nameundef}
+% This is the opposite to |\@namedef| which is offered by the \LaTeX\ kernel.
+% We use it to remove the definition of some commands and keyval options after
+% |\begin{document}| (to save \TeX\ memory) and to remove caption options defined
+% with |\captionsetup|\oarg{type}.
+% \begin{macrocode}
+\providecommand*\@nameundef[1]{%
+ \expandafter\let\csname #1\endcsname\@undefined}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@addto@macro}
+% \changes{v1.5}{2013/04/26}{Revised}
+% The \LaTeXe\ kernel offers the internal helper macro |\g@addto@macro| which
+% globally adds tokens to existing macros, like in |\AtBeginDocument|.
+% This is the same but it works local, not global.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname currentgrouplevel\endcsname\relax
+ \PackageInfo{caption3}{TeX engine: TeX}
+ \let\caption@ifeTeX\@secondoftwo
+ \providecommand\l@addto@macro[2]{%
+ \begingroup
+ \toks@\expandafter{#1#2}%
+ \xdef\caption@addto@temp{\the\toks@}%
+ \endgroup
+ \let#1\caption@addto@temp}
+\else
+ \PackageInfo{caption3}{TeX engine: e-TeX}
+ \let\caption@ifeTeX\@firstoftwo
+ \providecommand\l@addto@macro[2]{%
+ \edef#1{\unexpanded\expandafter{#1#2}}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bothIfFirst}
+% \begin{macro}{\bothIfSecond}
+% |\bothIfFirst| tests if the first argument is not empty, |\bothIfSecond|
+% tests if the second argument is not empty. If yes both arguments get
+% typeset, otherwise none of them.
+% \begin{macrocode}
+\def\bothIfFirst#1#2{%
+ \protected@edef\caption@tempa{#1}%
+ \ifx\caption@tempa\@empty \else
+ #1#2%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\def\bothIfSecond#1#2{%
+ \protected@edef\caption@tempa{#2}%
+ \ifx\caption@tempa\@empty \else
+ #1#2%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifundefined}
+% \changes{v1.3a}{2011/08/12}{This macro added}
+% \changes{v1.3b}{2011/08/18}{Made expandable}
+% Similar to \cs{@ifundefined} offered by the \LaTeX kernel, but does
+% not define the undefined macro as \cs{relax}.
+% \begin{macrocode}
+\newcommand*\caption@ifundefined[1]{%
+ \ifx#1\@undefined
+ \expandafter\@firstoftwo
+ \else\ifx#1\relax
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \fi\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifinlist}
+% \changes{v1.1}{2007/07/29}{Rewritten}
+% This helper macro checks if the first argument is in the comma separated
+% list which is offered as second argument. So for example
+% \begin{quote}
+% |\caption@ifinlist{frank}{axel,frank,olga,steven}{yes}{no}|
+% \end{quote}
+% would expand to |yes|.
+% \begin{macrocode}
+\newcommand*\caption@ifinlist{%
+ \@expandtwoargs\caption@@ifinlist}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@ifinlist[2]{%
+ \begingroup
+ \def\@tempa##1,#1,##2\@nil{%
+ \endgroup
+ \ifx\relax##2\relax
+ \expandafter\@secondoftwo
+ \else
+ \expandafter\@firstoftwo
+ \fi}%
+ \@tempa,#2,#1,\@nil}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifin@list}
+% \changes{v1.1}{2007/08/12}{This macro added}
+% |\caption@ifin@list|\marg{cmd}\marg{list entry}\marg{yes}\marg{no}
+% \begin{macrocode}
+\newcommand*\caption@ifin@list[2]{%
+ \caption@ifempty@list#1%
+ {\@secondoftwo}%
+ {\@expandtwoargs\caption@@ifinlist{#2}{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@g@addto@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@g@addto@list|\marg{cmd}\marg{list entry}
+% \begin{macrocode}
+\newcommand*\caption@g@addto@list[2]{%
+ \caption@ifempty@list#1{\gdef#1{#2}}{\g@addto@macro#1{,#2}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@l@addto@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@l@addto@list|\marg{cmd}\marg{list entry}
+% \begin{macrocode}
+\newcommand*\caption@l@addto@list[2]{%
+ \caption@ifempty@list#1{\def#1{#2}}{\l@addto@macro#1{,#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@g@removefrom@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@g@removefrom@list|\marg{cmd}\marg{list entry}
+% \begin{macrocode}
+\newcommand*\caption@g@removefrom@list[2]{%
+ \caption@l@removefrom@list#1{#2}%
+ \global\let#1#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@l@removefrom@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@l@removefrom@list|\marg{cmd}\marg{list entry}\par
+% \Note[Caveat]{\meta{cmd} will be expanded during this process since
+% \cs{@removeelement} is using \cs{edef} to build the new list!}
+% \begin{macrocode}
+\newcommand*\caption@l@removefrom@list[2]{%
+ \caption@ifempty@list#1{}{\@expandtwoargs\@removeelement{#2}#1#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@for@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@for@list|\marg{cmd}\marg{code with \#1}
+% \begin{macrocode}
+\newcommand*\caption@for@list[2]{%
+ \caption@ifempty@list#1{}{%
+ \def\caption@tempb##1{#2}%
+ \@for\caption@tempa:=#1\do{%
+ \expandafter\caption@tempb\expandafter{\caption@tempa}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifempty@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@ifempty@list|\marg{cmd}\marg{true}\marg{false}
+% \begin{macrocode}
+\newcommand*\caption@ifempty@list[1]{%
+ \ifx#1\@undefined
+ \expandafter\@firstoftwo
+ \else\ifx#1\relax
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else\ifx#1\@empty
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \fi\fi\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \pagebreak[3]
+% \begin{macro}{\caption@setbool}
+% \begin{macro}{\caption@set@bool}
+% \changes{v1.1}{2007/04/05}{\cs{caption@set@bool}\marg{cmd}\marg{value} added}
+% \begin{macro}{\caption@ifbool}
+% \begin{macro}{\caption@undefbool}
+% For setting and testing boolean options we offer these three helper macros:
+% \begin{quote}
+% |\caption@setbool|\marg{name}\marg{value}\\
+% | |(with |value = false/true/no/yes/off/on/0/1|)\\
+% |\caption@ifbool|\marg{name}\marg{if-clause}\marg{else-clause}\\
+% |\caption@undefbool|\marg{name}
+% \end{quote}
+% \begin{macrocode}
+\newcommand*\caption@setbool[1]{%
+ \expandafter\caption@set@bool\csname caption@if#1\endcsname}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@set@bool[2]{%
+ \caption@ifinlist{#2}{1,true,yes,on}{%
+ \let#1\@firstoftwo
+ }{\caption@ifinlist{#2}{0,false,no,off}{%
+ \let#1\@secondoftwo
+ }{%
+ \caption@Error{Undefined boolean value `#2'}%
+ }}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@ifbool[1]{\@nameuse{caption@if#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@undefbool[1]{\@nameundef{caption@if#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@teststar}
+% \changes{v1.1}{2007/05/08}{This macro and its usage added}
+% \changes{v1.1e}{2007/10/28}{\cs{caption@teststar@} added}
+% |\caption@teststar|\marg{cmd}\marg{star arg}\marg{non-star arg}\\
+% |\caption@teststar@|\marg{cmd}\marg{star arg}\marg{non-star arg}
+% \begin{macrocode}
+\newcommand*\caption@teststar[3]{\@ifstar{#1{#2}}{#1{#3}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@teststar@[3]{%
+ \@ifstar{#1{#2}}{\caption@ifatletter{#1{#2}}{#1{#3}}}}
+\AtBeginDocument{\let\caption@teststar@\caption@teststar}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@ifatletter{%
+ \ifnum\the\catcode`\@=11
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+\AtBeginDocument{\let\caption@ifatletter\@secondoftwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@withoptargs}
+% \changes{v1.1}{2007/08/12}{This macro added}
+% \changes{v1.5}{2012/04/09}{This macro revised}
+% |\caption@withoptargs|\marg{cmd}
+% \begin{macrocode}
+\newcommand*\caption@withoptargs[1]{%
+ \@ifstar
+ {\def\caption@tempa{*}\caption@@withoptargs{#1}}%
+ {\def\caption@tempa{}\caption@@withoptargs{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@withoptargs#1{%
+ \@ifnextchar[%]
+ {\caption@@@withoptargs{#1}}%
+ {\caption@@@@withoptargs{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@@withoptargs#1[#2]{%
+ \l@addto@macro\caption@tempa{[{#2}]}%
+ \caption@@withoptargs{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@@@withoptargs#1{%
+ \def\caption@tempb{#1}%
+ \expandafter\caption@tempb\expandafter{\caption@tempa}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@gobble}
+% \changes{v1.4}{2011/08/19}{This macro added}
+% |\caption@gobble*|\oarg{arg}\oarg{\ldots}\marg{arg}\par
+% Same as |\@gobble|, but gobbles optional arguments as well.
+% \begin{macrocode}
+\DeclareRobustCommand*\caption@gobble{%
+ \caption@withoptargs\@gobbletwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@CheckCommand}
+% \changes{v1.1}{2007/04/10}{This macro added}
+% \begin{macro}{\caption@IfCheckCommand}
+% \changes{v1.1}{2007/04/10}{This macro added}
+% \changes{v1.2b}{2008/08/02}{Revised so \cs{next} is no longer used}
+% \changes{v1.5}{2012/08/25}{Bugfix: Uses \cs{caption@tempa} instead of \cs{@tempa}}
+% |\caption@CheckCommand|\marg{macro}\marg{definition of macro}\par
+% checks if a command already exists, with the same definition.
+% It can be used more-than-once to check if one of multiple definitions will
+% finally match.
+% (It redefines itself later on to |\@gobbletwo| if the two commands match
+% fine, making further checks harmless.)\par
+% |\caption@IfCheckCommand|\marg{true}\marg{false}\par
+% will execute the \meta{true} code if one match was finally given,
+% the \meta{false} code otherwise.
+% (It simply checks if |\caption@CheckCommand| is |\@gobbletwo| and
+% restores the starting definition of |\caption@CheckCommand|.)
+% \begin{macrocode}
+\newcommand\caption@DoCheckCommand[2]{%
+ \begingroup
+ \let\caption@tempa#1%
+ #2%
+ \ifx\caption@tempa#1%
+ \endgroup
+ \let\caption@CheckCommand\@gobbletwo
+ \else
+ \endgroup
+ \fi}
+\@onlypreamble\caption@DoCheckCommand
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@CheckCommand\caption@DoCheckCommand
+\@onlypreamble\caption@CheckCommand
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@IfCheckCommand{%
+ \ifx\caption@CheckCommand\@gobbletwo
+ \let\caption@CheckCommand\caption@DoCheckCommand
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+\@onlypreamble\caption@IfCheckCommand
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@AtBeginDocument}
+% \changes{v1.1}{2007/04/13}{This macro and its usage added}
+% \changes{v1.2e}{2010/01/09}{Adapted to the combine document class}
+% |\caption@AtBeginDocument*|\marg{code}\\
+% Same as |\AtBeginDocument| but the execution of code
+% will be surrounded by two |\PackageInfo|s.
+% The starred variant causes the code to be executed after all code
+% specified using the non-starred variant.
+% \begin{macrocode}
+\let\caption@begindocumenthook\@empty
+\let\caption@@begindocumenthook\@empty
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@AtBeginDocument{%
+ \caption@teststar\g@addto@macro
+ \caption@@begindocumenthook\caption@begindocumenthook}
+%\@onlypreamble\caption@AtBeginDocument
+% \end{macrocode}
+% \begin{macrocode}
+\AtBeginDocument{%
+ \caption@InfoNoLine{Begin \noexpand\AtBeginDocument code}%
+% \end{macrocode}
+% \begin{macrocode}
+ \def\caption@AtBeginDocument{%
+ \@ifstar{\g@addto@macro\caption@@begindocumenthook}\@firstofone}%
+ \caption@begindocumenthook
+ \let\caption@begindocumenthook\relax
+% \end{macrocode}
+% \begin{macrocode}
+ \def\caption@AtBeginDocument{%
+ \@ifstar\@firstofone\@firstofone}%
+ \caption@@begindocumenthook
+ \let\caption@@begindocumenthook\relax
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@InfoNoLine{End \noexpand\AtBeginDocument code}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Information, Warnings, and Errors}
+%
+% \begin{macro}{\caption@Info}
+% \changes{v1.3}{2010/10/25}{Moved from package to kernel}
+% |\caption@Info|\marg{message}
+% \begin{macrocode}
+\newcommand*\caption@Info[1]{%
+ \PackageInfo{caption}{#1}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@InfoNoLine}
+% \changes{v1.3}{2010/10/25}{Moved from package to kernel}
+% |\caption@InfoNoLine|\marg{message}\\
+% \Note{The \cs{@gobble} at the end of the 2nd argument of
+% \cs{PackageInfo} suppresses the line number info.
+% See TLC2\cite{TLC2}, A.4.7, p885 for details.}
+% \begin{macrocode}
+\newcommand*\caption@InfoNoLine[1]{%
+ \caption@Info{#1\@gobble}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@Warning}
+% \changes{v1.1c}{2007/10/14}{This macro added, will now be used for warnings}
+% |\caption@Warning|\marg{message}
+% \begin{macrocode}
+\newcommand*\caption@Warning[1]{%
+ \caption@WarningNoLine{#1\on@line}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@WarningNoLine}
+% \changes{v1.1c}{2007/10/14}{This macro added, will now be used for warnings}
+% |\caption@WarningNoLine|\marg{message}
+% \begin{macrocode}
+\newcommand*\caption@WarningNoLine[1]{%
+ \PackageWarning{caption}{#1.^^J\caption@wh\@gobbletwo}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@wh{%
+ See the caption package documentation for explanation.}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@Error}
+% \changes{v1.0j}{2007/01/20}{This macro added, will now be used for errors}
+% \changes{v1.0o}{2007/04/11}{Renamed from \cs{caption@error} to \cs{caption@Error}}
+% \changes{v1.1b}{2007/09/18}{Usage of \cs{caption@Package} removed}
+% |\caption@Error|\marg{message}
+% \begin{macrocode}
+\newcommand*\caption@Error[1]{%
+ \PackageError{caption}{#1}\caption@eh}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@eh{%
+ If you do not understand this error, please take a closer look\MessageBreak
+ at the documentation of the `caption' package, especially the\MessageBreak
+ section about errors.\MessageBreak\@ehc}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@KV@err}
+% \changes{v1.1b}{2007/09/18}{This macro added}
+% \begin{macrocode}
+\let\caption@KV@err\caption@Error
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Using the keyval package}
+%
+% We need the \package{keyval} package for option handling, so we load it here.
+% \begin{macrocode}
+\RequirePackage{keyval}[1997/11/10]
+% \end{macrocode}
+%
+% \begin{macro}{\undefine@key}
+% |\undefine@key|\marg{family}\marg{key}\par
+% This helper macro is the opposite of |\define@key|, it removes a keyval
+% definition.
+% \begin{macrocode}
+\providecommand*\undefine@key[2]{%
+ \@nameundef{KV@#1@#2}\@nameundef{KV@#1@#2@default}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@onlypreamble@key}
+% \changes{v1.1}{2007/07/22}{This macro added}
+% \changes{v1.1e}{2007/11/01}{\cs{KV@err} will be used now instead of \cs{@notprerr}}
+% |\onlypreamble@key|\marg{family}\marg{key}\par
+% Analogous to |\@onlypreamble| from \LaTeXe.
+% \begin{macrocode}
+\providecommand*\@preamble@keys{}
+\providecommand*\@onlypreamble@key[2]{\@cons\@preamble@keys{{#1}{#2}}}
+\@onlypreamble\@onlypreamble@key
+\@onlypreamble\@preamble@keys
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\@notprerr@key[1]{\KV@err{Can be used only in preamble}}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@AtBeginDocument*{%
+ \def\@elt#1#2{\expandafter\let\csname KV@#1@#2\endcsname\@notprerr@key}%
+ \@preamble@keys
+ \let\@elt\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionOption}
+% |\DeclareCaptionOption|\marg{option}\oarg{default value}\marg{code}\\
+% |\DeclareCaptionOption*|\marg{option}\oarg{default value}\marg{code}\par
+% We declare our options using these commands (instead of using
+% |\DeclareOption| offered by \LaTeXe), so the keyval package is used.
+% The starred form makes the option available during the lifetime of the
+% current package only, so they can be used with |\usepackage|, but
+% \emph{not} with |\captionsetup| later on.
+% \begin{macrocode}
+\newcommand*\DeclareCaptionOption{%
+ \caption@teststar\caption@declareoption\AtEndOfPackage\@gobble}
+\@onlypreamble\DeclareCaptionOption
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declareoption[2]{%
+ #1{\undefine@key{caption}{#2}}\caption@declare@option{#2}}
+\@onlypreamble\caption@declareoption
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declare@option{%
+ \define@key{caption}}
+%% no \@onlypreamble\caption@declare@option, will be used by \captionsetup
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionOptionNoValue}
+% \changes{v1.1c}{2007/10/06}{This macro added}
+% |\DeclareCaptionOptionNoValue|\marg{option}\marg{code}\\
+% |\DeclareCaptionOptionNoValue*|\marg{option}\marg{code}\par
+% Same as \cs{DeclareCaptionOption} but issues an error if a value is given.
+% \begin{macrocode}
+\newcommand*\DeclareCaptionOptionNoValue{%
+ \caption@teststar\caption@declareoption@novalue\AtEndOfPackage\@gobble}
+\@onlypreamble\DeclareCaptionOptionNoValue
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@declareoption@novalue[3]{%
+ \caption@declareoption{#1}{#2}[\KV@err]{%
+ \caption@option@novalue{#2}{##1}{#3}}}
+\@onlypreamble\caption@declareoption@novalue
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@option@novalue[2]{%
+ \ifx\KV@err#2%
+ \expandafter\@firstofone
+ \else
+ \KV@err{No value allowed for #1}%
+ \expandafter\@gobble
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifcaptionsetup@star}
+% \changes{v1.2a}{2008/01/12}{This macro added}
+% If the starred form of |\captionsetup| is used, this will be set to |true|.
+% (It will be reset to |false| at the end of |\caption@setkeys|.)
+% \begin{macrocode}
+\newif\ifcaptionsetup@star
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionsetup}
+% \changes{v1.0a}{2004/01/17}{Bugfix: Missing \% added}
+% \changes{v1.1}{2007/07/22}{Starred-variant added}
+% \changes{v1.1e}{2007/07/27}{Inside packages the starred variant will be used automatically}
+% \changes{v1.2}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% \changes{v1.2a}{2008/01/12}{\cs{ifcaptionsetup@star} will be set now}
+% \changes{v1.5}{2012/04/09}{Support of multiple optional arguments added}
+% |\captionsetup|\oarg{type}\ldots\marg{keyval-list of options}\\
+% |\captionsetup*|\oarg{type}\ldots\marg{keyval-list of options}\par
+% If the optional argument `type' is specified, we simply save or append
+% the option list, otherwise we `execute' it with |\setkeys|.
+% (The non-starred variant issues a warning if \meta{keyval-list of options}
+% is not used later on.)
+% \Note{The starred variant will be used inside packages automatically.}
+% \begin{macrocode}
+\newcommand*\captionsetup{%
+ \caption@teststar@\@captionsetup\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\@captionsetup[1]{%
+ \captionsetup@startrue#1\captionsetup@starfalse
+ \@ifnextchar[\caption@setup@options\caption@setup}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setup{\caption@setkeys{caption}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@setup@options[#1]{%
+ \@ifnextchar[%
+ {\caption@stepthecounter
+ \caption@withoptargs{\@expandtwoargs
+ \caption@setup@options@i{#1}{@\caption@thecounter}}}%
+ {\caption@setup@options@{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setup@options@i[4]{%
+ \caption@setup@options@{#1}{#2}%
+ \caption@declare@option{#2}[]{\captionsetup#3{#4}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setup@options@[2]{%
+ \@bsphack
+ \ifcaptionsetup@star\captionsetup@starfalse\else\caption@addtooptlist{#1}\fi
+ \expandafter\caption@l@addto@list\csname caption@opt@#1\endcsname{#2}%
+ \@esphack}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clearcaptionsetup}
+% \changes{v1.1}{2007/07/29}{Optional argument added}
+% \changes{v1.1}{2007/08/17}{Starred variant added}
+% \changes{v1.1e}{2007/07/27}{Inside packages the starred variant will be used automatically}
+% \changes{v1.2}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% |\clearcaptionsetup|\oarg{option}\marg{type}\\
+% |\clearcaptionsetup*|\oarg{option}\marg{type}\par
+% This removes the saved option list associated with \meta{type}.
+% If \meta{option} is given, only this option will be removed from the list.
+% (The starred variant does not issue warnings.)
+% \Note{The starred variant will be used inside packages automatically.}
+% \begin{macrocode}
+\newcommand*\clearcaptionsetup{%
+ \caption@teststar@\@clearcaptionsetup\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\@clearcaptionsetup[1]{%
+ \let\caption@tempa#1%
+ \@testopt\@@clearcaptionsetup{}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\@@clearcaptionsetup[#1]#2{%
+ \@bsphack
+ \expandafter\caption@ifempty@list\csname caption@opt@#2\endcsname
+ {\caption@tempa{\caption@Warning{Option list `#2' undefined}}}%
+ {\ifx,#1,%
+ \caption@clearsetup{#2}%
+ \else
+ \caption@@removefromsetup{#1}{#2}%
+ \fi}%
+ \@esphack}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@clearsetup[1]{%
+ \caption@removefromoptlist{#1}%
+ \@nameundef{caption@opt@#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@removefromsetup{%
+ \let\caption@tempa\@gobble
+ \caption@@removefromsetup}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@removefromsetup[2]{%
+ \expandafter\let\expandafter\@tempa\csname caption@opt@#2\endcsname
+ \expandafter\let\csname caption@opt@#2\endcsname\@undefined
+ \def\@tempb##1=##2\@nil{##1}%
+ \edef\@tempc{#1}%
+ \@for\@tempa:=\@tempa\do{%
+ \edef\@tempd{\expandafter\@tempb\@tempa=\@nil}%
+ \ifx\@tempd\@tempc
+ \let\caption@tempa\@gobble
+ \else
+ \expandafter\expandafter\expandafter\caption@l@addto@list
+ \expandafter\csname caption@opt@#2\expandafter\endcsname
+ \expandafter{\@tempa}%
+ \fi}%
+ \expandafter\caption@ifempty@list\csname caption@opt@#2\endcsname
+ {\caption@removefromoptlist{#2}}{}%
+ \caption@tempa{\caption@Warning{%
+ Option `#1' was not in list `#2'}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\showcaptionsetup}
+% \changes{v1.0d}{2005/05/03}{Optimized for memory usage}
+% \changes{v1.1}{2007/07/29}{Bugfix: Does not expand option list anymore}
+% \changes{v1.2}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% |\showcaptionsetup|\oarg{package}\marg{type}\par
+% This comes for debugging issues: It shows the saved option list which
+% is associated with \meta{type}.
+% \begin{macrocode}
+\newcommand*\showcaptionsetup[2][\@firstofone]{%
+ \@bsphack
+ \GenericWarning{}{%
+ #1 Caption Info: Option list on `#2'\MessageBreak
+ #1 Caption Data: \@ifundefined{caption@opt@#2}{%
+ -none-%
+ }{%
+ {\expandafter\expandafter\expandafter\strip@prefix
+ \expandafter\meaning\csname caption@opt@#2\endcsname}%
+ }}%
+ \@esphack}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.1}{2007/07/02}{Option \opt{options=} added}
+% \changes{v1.3}{2010/09/05}{Option \opt{options*=} added}
+% \changes{v1.4b}{2012/01/12}{Option \opt{options*=} removed}
+% \begin{macrocode}
+\DeclareCaptionOption{options}{\caption@setoptions{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setoptions}
+% \changes{v1.0g}{2006/01/03}{Optional argument added}
+% \changes{v1.0h}{2006/01/26}{Revised}
+% \changes{v1.0j}{2007/01/30}{Optional argument removed}
+% \changes{v1.1}{2007/04/11}{Usage of \cs{clearcaptionsetup} added}
+% \changes{v1.1}{2007/05/09}{Renamed from \cs{caption@settype} to \cs{caption@setoptions}}
+% \changes{v1.2}{2007/12/03}{Definition of \cs{caption@iftypewarning} removed}
+% \changes{v1.3}{2010/09/05}{Starred variant added}
+% \changes{v1.4b}{2012/01/12}{Starred variant removed}
+% |\caption@setoptions|\marg{type or environment or\ldots}\par
+% Caption options which have been saved with |\captionsetup|\oarg{type} can
+% be executed by using this command.
+% It simply executes the saved option list (and clears it afterwards),
+% if there is any.
+% \iffalse
+% (The starred variant do not clear the option list.)
+% \fi
+% \begin{macrocode}
+\newcommand*\caption@setoptions[1]{%
+ \caption@Debug{options=#1}%
+ \expandafter\let\expandafter\caption@opt\csname caption@opt@#1\endcsname
+ \ifx\caption@opt\relax \else
+ \caption@xsetup\caption@opt
+ \caption@clearsetup{#1}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@xsetup[1]{\expandafter\caption@setup\expandafter{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@addtooptlist}
+% \changes{v1.1}{2007/07/22}{This macro added}
+% \begin{macro}{\caption@removefromoptlist}
+% \changes{v1.1}{2007/07/22}{This macro added}
+% \changes{v1.2c}{2008/08/24}{Fatal typo corrected}
+% |\caption@addtooptlist|\marg{type}\\
+% |\caption@removefromoptlist|\marg{type}\par
+% Adds or removes an \meta{type} to the list of unused caption options.
+% Note that the catcodes of \meta{type} are sanitized here so removing
+% \meta{type} from the list do not fail when the \package{float} package
+% is used (since |\float@getstyle| gives a result which tokens have catcode
+% 12 $=$ ``other'').
+% \begin{macrocode}
+\newcommand*\caption@addtooptlist[1]{%
+ \@ifundefined{caption@opt@#1@lineno}{%
+ \caption@dooptlist\caption@g@addto@list{#1}%
+ \expandafter\xdef\csname caption@opt@#1@lineno\endcsname{\the\inputlineno}%
+ }{}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@removefromoptlist[1]{%
+ \caption@dooptlist\caption@g@removefrom@list{#1}%
+ \global\expandafter\let\csname caption@opt@#1@lineno\endcsname\@undefined}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@dooptlist[2]{%
+ \begingroup
+ \edef\@tempa{#2}\@onelevel@sanitize\@tempa
+ \expandafter#1\expandafter\caption@optlist\expandafter{\@tempa}%
+ \endgroup}
+% \end{macrocode}
+% \begin{macrocode}
+\AtEndDocument{%
+ \caption@for@list\caption@optlist{%
+ \caption@WarningNoLine{%
+ Unused \string\captionsetup[#1]
+ on input line \csname caption@opt@#1@lineno\endcsname}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@setkeys}
+% \changes{v1.0g}{2006/01/03}{This macro added}
+% \changes{v1.0j}{2007/01/20}{Bugfix: Usage of \cs{caption@keydepth} added}
+% \changes{v1.0j}{2007/01/30}{Optional argument added}
+% \changes{v1.0n}{2007/04/08}{\cs{caption@keydepth} is now a command instead of a counter}
+% \changes{v1.1b}{2007/09/18}{Usage of \cs{caption@Package} removed, we use \cs{caption@KV@err} instead}
+% \changes{v1.2}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% \changes{v1.2a}{2008/01/12}{\cs{captionsetup@starfalse} added}
+% \changes{v1.2d}{2009/09/30}{Bugfix 09-09-29: Missing error handler will be defined automatically}
+% \changes{v1.4}{2011/08/24}{Redefinition of \cs{XKV@err} added}
+% |\caption@setkeys|\oarg{package}\marg{family}\marg{key-values}\par
+% This one simply calls |\setkeys|\marg{family}\marg{key-values}
+% but lets the error messages not refer to the \package{keyval} package,
+% but to the \meta{package} package instead.
+% \begin{macrocode}
+\newcommand*\caption@setkeys{\@dblarg\caption@@setkeys}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@setkeys[#1]#2#3{%
+ \@bsphack
+% \end{macrocode}
+% \begin{macrocode}
+ \expandafter\let\csname ORI@KV@err\caption@keydepth\endcsname\KV@err
+ \expandafter\let\csname ORI@KV@errx\caption@keydepth\endcsname\KV@errx
+ \expandafter\let\csname ORI@XKV@err\caption@keydepth\endcsname\XKV@err
+ \edef\caption@keydepth{\caption@keydepth i}%
+% \end{macrocode}
+% \begin{macrocode}
+ \expandafter\let\expandafter\KV@err\csname #1@KV@err\endcsname
+ \ifx\KV@err\relax
+ \def\KV@err##1{\PackageError{#1}{##1}{%
+ See the #1 package documentation for explanation.}}%
+ \fi
+ \def\KV@errx{\KV@err}%
+ \def\XKV@err{\let\@tempa\XKV@tkey\KV@err}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@Debug{\protect\setkeys{#2}{#3}}%
+ \setkeys{#2}{#3}%
+% \end{macrocode}
+% \begin{macrocode}
+ \edef\caption@keydepth{\expandafter\@gobble\caption@keydepth}%
+ \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
+% \end{macrocode}
+% \begin{macrocode}
+ \ifx\caption@keydepth\@empty \captionsetup@starfalse \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \@esphack}
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@keydepth\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ExecuteOptions}
+% \changes{v1.1}{2007/07/15}{This macro added}
+% \changes{v1.3}{2010/09/04}{Depends on package now}
+% |\caption@ExecuteOptions|\marg{package}\marg{key-values}\par
+% We execute our options using the keyval interface, so we use this one
+% instead of |\ExecuteOptions| offered by \LaTeXe.
+% \begin{macrocode}
+\newcommand*\caption@ExecuteOptions[2]{%
+ \expandafter\@expandtwoargs\csname caption@setkeys@#1\endcsname{#1}{#2}}%
+\@onlypreamble\caption@ExecuteOptions
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ProcessOptions}
+% \changes{v1.0a}{2004/01/23}{Bugfix, see
+% \purett{news:400D360C.9678329F@gmx.net} for details}
+% \changes{v1.0g}{2006/01/03}{Improvement, uses \cs{caption@setkeys}
+% instead of \cs{setkeys}}
+% \changes{v1.0h}{2006/02/23}{Bugfix, now processes only those global
+% options which have a default value}
+% \changes{v1.0j}{2007/01/30}{\cs{ProcessOptionsWithKV} renamed to
+% \cs{caption@ProcessOptions} and moved from the package to the kernel}
+% \changes{v1.1}{2007/04/17}{Star variant added}
+% |\caption@ProcessOptions*|\marg{package}\par
+% We process our options using the keyval package, so we use this one
+% instead of |\ProcessOptions| offered by \LaTeXe.
+% The starred variant do not process the global options.
+% (This code was taken from the \package{hyperref} package\cite{hyperref}
+% \version{6.74} and improved.)
+% \begin{macrocode}
+\newcommand*\caption@ProcessOptions{%
+ \caption@teststar\caption@@ProcessOptions\@gobble\@firstofone}
+\@onlypreamble\caption@ProcessOptions
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@@ProcessOptions[2]{%
+ \let\@tempc\relax
+ \let\caption@tempa\@empty
+ #1{% \@firstofone -or- \@gobble
+ \@for\CurrentOption:=\@classoptionslist\do{%
+ \@ifundefined{KV@#2@\CurrentOption}{}{%
+ \@ifundefined{KV@#2@\CurrentOption @default}{%
+ \PackageInfo{#2}{Global option `\CurrentOption' ignored}%
+ }{%
+ \PackageInfo{#2}{Global option `\CurrentOption' processed}%
+ \edef\caption@tempa{\caption@tempa\CurrentOption,}%
+ \@expandtwoargs\@removeelement\CurrentOption
+ \@unusedoptionlist\@unusedoptionlist
+ }%
+ }%
+ }%
+ \let\CurrentOption\@empty
+ }%
+ \caption@ExecuteOptions{#2}{\caption@tempa\@ptionlist{\@currname.\@currext}}%
+ \AtEndOfPackage{\let\@unprocessedoptions\relax}}
+\@onlypreamble\caption@@ProcessOptions
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@SetupOptions}
+% \changes{v1.3}{2010/09/04}{This macro added}
+% |\caption@SetupOptions|\marg{package}\marg{code}\par
+% After calling this macro |\caption@ExecuteOptions| and
+% |\usepackage|\oarg{options}\marg{package}
+% will both be mapped to \meta{code} with \meta{package} and \meta{options}
+% as arguments |#1| and |#2|. (This helps avoiding ``Option clash'' errors.)
+% \begin{macrocode}
+\newcommand*\caption@packagelist{}
+\@onlypreamble\caption@packagelist
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@SetupOptions[2]{%
+ \@namedef{caption@setkeys@#1}##1##2{#2}%
+ \expandafter\@onlypreamble\csname caption@setkeys@#1\endcsname
+ \@cons\caption@packagelist{{#1}}}
+\@onlypreamble\caption@SetupOptions
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@onefilewithoptions\@onefilewithoptions
+\def\@onefilewithoptions#1[#2]{%
+ \begingroup
+ \def\@tempa{%
+ \endgroup
+ \caption@onefilewithoptions{#1}[{#2}]}%
+ \def\@tempb{#1}%
+ \def\@elt##1{%
+ \def\@tempc{##1}%
+ \ifx\@tempb\@tempc
+ \def\@tempa{%
+ \endgroup
+ \caption@ExecuteOptions{#1}{#2}%
+ \caption@onefilewithoptions{#1}[]}%
+ \fi}
+ \caption@packagelist
+ \@tempa}
+\@onlypreamble\caption@onefilewithoptions
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Margin resp. width}
+% \changes{v1.0n}{2007/04/01}{\cs{captionmarginx} renamed to \cs{captionmargin@}}
+% \changes{v1.0n}{2007/04/03}{Option `twoside' added}
+% \changes{v1.1}{2007/08/11}{Options `margin*', `minmargin', and `maxmargin' added}
+% \changes{v1.2}{2007/11/10}{Option `oneside' added}
+%
+% \begin{macro}{\captionmargin}
+% \begin{macro}{\captionwidth}
+% |\captionmargin| and |\captionwidth| contain the extra margin
+% resp. the total width used for captions. Please never set these values in
+% a direct way, they are just accessible in user documents to provide
+% compatibility to \version{1.x}.\par
+% Note that we can only set one value at a time, `margin' \emph{or} `width'.
+% If |\captionwidth| is not zero we will take this value afterwards,
+% otherwise |\captionmargin| and |\captionmargin@|.
+% \begin{macrocode}
+\newdimen\captionmargin
+\newdimen\captionmargin@
+\newdimen\captionwidth
+\newdimen\caption@tempdima
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{margin}{\setcaptionmargin{#1}}
+\DeclareCaptionOption{margin*}{\setcaptionmargin*{#1}}
+\DeclareCaptionOption{width}{\setcaptionwidth{#1}}
+\DeclareCaptionOption{width*}{\setcaptionwidth*{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{calcmargin}{\caption@setcalcmargin{#1}}
+\DeclareCaptionOption{calcmargin*}{\caption@setcalcmargin*{#1}}
+\DeclareCaptionOption{calcwidth}{\caption@setcalcwidth{#1}}
+\DeclareCaptionOption{calcwidth*}{\caption@setcalcwidth*{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{twoside}[1]{\caption@set@bool\caption@iftwoside{#1}}
+\DeclareCaptionOptionNoValue{oneside}{\caption@set@bool\caption@iftwoside0}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{minmargin}{\caption@setoptcmd\caption@minmargin{#1}}
+\DeclareCaptionOption{maxmargin}{\caption@setoptcmd\caption@maxmargin{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\setcaptionmargin}
+% \changes{v1.0f}{2005/10/24}{Renamed from \cs{caption@setmargin} to \cs{setcaptionmargin}}
+% \changes{v1.0f}{2005/10/24}{\cs{setcaptionmargin} enhanced so it can take
+% left+right margin}
+% \changes{v1.1}{2007/08/11}{Starred variant added}
+% \changes{v1.1}{2007/08/12}{\cs{setlength}\cs{captionmargin} \&
+% \cs{setlength}\cs{captionmargin@} swapped so
+% `\texttt{margin*=}\cs{captionmargin}' works in singleline options}
+% \changes{v1.3}{2010/11/07}{Support for option \opt{calcmargin} added}
+% |\setcaptionmargin|\marg{amount}\\
+% |\setcaptionmargin*|\marg{amount}\par
+% Please never use this in user documents, it's just there to
+% provide compatibility to the \package{caption2} package.
+% \begin{macrocode}
+\newcommand*\setcaptionmargin{%
+ \caption@resetcalcmargin
+ \caption@setmargin}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setmargin{%
+ \caption@teststar\caption@@setmargin\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setmargin[2]{%
+ #1{\captionwidth\z@}%
+ \caption@@@setmargin#2,#2,\@nil}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@@setmargin#1,#2,#3\@nil{%
+ \setlength\captionmargin@{#2}%
+ \setlength\captionmargin{#1}%
+ \addtolength\captionmargin@{-\captionmargin}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\setcaptionwidth}
+% \changes{v1.0f}{2005/10/24}{Renamed from \cs{caption@setwidth} to \cs{setcaptionwidth}}
+% \changes{v1.3}{2010/11/07}{Starred variant added}
+% \changes{v1.3}{2010/11/07}{Support for option \opt{calcwidth} added}
+% |\setcaptionwidth|\marg{amount}\\
+% |\setcaptionwidth*|\marg{amount}\par
+% Please never use this in user documents, it's just there to
+% provide compatibility to the \package{caption2} package.
+% \begin{macrocode}
+\newcommand*\setcaptionwidth{%
+ \caption@resetcalcmargin
+ \caption@setwidth}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setwidth{%
+ \caption@teststar\caption@@setwidth\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setwidth[2]{%
+ #1{\captionmargin\z@\captionmargin@\z@}%
+ \setlength\captionwidth{#2}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@resetcalcmargin}
+% \changes{v1.3}{2010/11/07}{This macro added}
+% \begin{macrocode}
+\newcommand*\caption@resetcalcmargin{%
+ \let\caption@calcmargin@hook\@empty}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setcalcmargin}
+% \changes{v1.3}{2010/11/07}{This macro added}
+% \begin{macrocode}
+\newcommand*\caption@setcalcmargin{%
+ \caption@teststar{\caption@@setcalcmargin\caption@setmargin}%
+ \@secondoftwo\@firstoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setcalcmargin[3]{%
+ #2{\caption@resetcalcmargin
+ \l@addto@macro\caption@calcmargin@hook{#1{#3}}}%
+ {\l@addto@macro\caption@calcmargin@hook{#1*{#3}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setcalcwidth}
+% \changes{v1.3}{2010/11/07}{This macro added}
+% \begin{macrocode}
+\newcommand*\caption@setcalcwidth{%
+ \caption@teststar{\caption@@setcalcmargin\caption@setwidth}%
+ \@secondoftwo\@firstoftwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@counter}
+% \changes{v1.0n}{2007/04/03}{This counter added}
+% \changes{v1.1e}{2007/10/28}{Renamed to \cs{caption@thecounter}; \cs{caption@stepcounter} added}
+% \changes{v1.5}{2012/04/09}{\cs{caption@stepcounter} renamed to \cs{caption@stepthecounter}}
+% Internal counter. At the moment it will be used inside
+% |\caption@ifoddpage| only.
+% \begin{macrocode}
+\newcommand*\caption@thecounter{0}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@stepthecounter{%
+ \@tempcnta\caption@thecounter
+ \advance\@tempcnta\@ne
+ \xdef\caption@thecounter{\the\@tempcnta}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@newlabel}
+% \changes{v1.0n}{2007/04/03}{This macro added}
+% This command is a modified version of |\newlabel| from \LaTeX2e.
+% It will be written to the \texttt{.aux} file to
+% pass label information from one run to another.
+% (We use it inside |\caption@ifoddpage| and |\caption@ragged|.)
+% \begin{macrocode}
+\newcommand*\caption@newlabel{\@newl@bel{caption@r}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@thepage}
+% \changes{v1.0n}{2007/04/03}{This macro added}
+% This command is a modified version of |\thepage| from \LaTeX2e.
+% It will be used inside |\caption@ifoddpage| only.
+% \begin{macrocode}
+\newcommand*\caption@thepage{\the\c@page}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@label}
+% \changes{v1.1}{2007/09/01}{This macro added}
+% \changes{v1.2}{2007/12/03}{Definition of \cs{caption@newlabel} in AUX file added}
+% This command is a modified version of |\label| from \LaTeX2e.
+% It will be used inside |\caption@ifoddpage| and |\FP@helpNote|.
+% \begin{macrocode}
+\newcommand*\caption@label[1]{%
+ \caption@@label
+ \protected@write\@auxout{\let\caption@thepage\relax}%
+ {\string\caption@newlabel{#1}{\caption@thepage}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@label{%
+ \global\let\caption@@label\relax
+ \protected@write\@auxout{}%
+ {\string\providecommand*\string\caption@newlabel[2]{}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@pageref}
+% \changes{v1.1}{2007/09/01}{This macro added}
+% \changes{v1.2d}{2009/10/09}{Uses \cs{@latex@warning} instead of \cs{caption@Warning} now}
+% This command is a modified version of |\pageref| from \LaTeX2e.
+% It will be used inside |\caption@ifoddpage| and |\FP@helpNote|.
+% \begin{macrocode}
+\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}%
+ \else
+ \expandafter\let\expandafter\caption@thepage\csname caption@r@#1\endcsname
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifoddpage}
+% \changes{v1.0n}{2007/04/03}{This macro added}
+% \changes{v1.1e}{2007/10/28}{Incrementation of counter moved to \cs{caption@@make}}
+% At the moment this macro uses an own label\ldots ref mechanism,
+% but an alternative implementation method would be using the
+% \package{refcount} package\cite{refcount} and |\ifodd\getpagerefnumber{|\ldots|}|.
+% \Note{This macro re-defines itself so the \texttt{.aux} file will
+% only be used once per group.}
+% \begin{macrocode}
+\newcommand*\caption@ifoddpage{%
+ \caption@iftwoside{%
+ \caption@label\caption@thecounter
+ \caption@pageref\caption@thecounter
+ \ifodd\caption@thepage
+ \let\caption@ifoddpage\@firstoftwo
+ \else
+ \let\caption@ifoddpage\@secondoftwo
+ \fi
+ }{\let\caption@ifoddpage\@firstoftwo}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@ifoddpage}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setoptcmd}
+% \changes{v1.1}{2007/08/11}{This macro added}
+% |\caption@setoptcmd|\marg{cmd}\marg{off -or- value}
+% \begin{macrocode}
+\newcommand*\caption@setoptcmd[2]{%
+ \caption@ifinlist{#2}{0,false,no,off}{\let#1\@undefined}{\def#1{#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Indentions}
+%
+% \begin{macro}{\caption@indent}
+% \changes{v1.1}{2007/07/29}{Renamed from \cs{captionindent} to \cs{caption@indent}}
+% \begin{macro}{\caption@parindent}
+% \begin{macro}{\caption@hangindent}
+% These are the indentions we support.
+% \begin{macrocode}
+\newdimen\caption@indent
+\newdimen\caption@parindent
+\newdimen\caption@hangindent
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \changes{v1.0b}{2004/05/16}{Defaults added for options \opt{parindent=}
+% and \opt{hangindent=}}
+% \changes{v1.0f}{2005/08/22}{Option \opt{parskip=}: \cs{AtBeginCaption}
+% replaced by \cs{caption@@par}}
+% \changes{v1.0f}{2005/08/22}{Undocumented defaults for \opt{parindent=},
+% \opt{hangindent=}, and \opt{parskip=} removed}
+% \begin{macrocode}
+\DeclareCaptionOption{indent}[\leftmargini]{% obsolete!
+ \setlength\caption@indent{#1}}
+\DeclareCaptionOption{indention}[\leftmargini]{%
+ \setlength\caption@indent{#1}}
+\DeclareCaptionOption{parindent}{%
+ \setlength\caption@parindent{#1}}
+\DeclareCaptionOption{hangindent}{%
+ \setlength\caption@hangindent{#1}}
+\DeclareCaptionOption{parskip}{%
+ \l@addto@macro\caption@@par{\setlength\parskip{#1}}}
+% \end{macrocode}
+%
+% \changes{v1.0f}{2005/08/22}{Increased compatibility to KOMA-Script:
+% A special version of options `parindent' and `parskip' added}
+% \changes{v1.0g}{2006/01/03}{Bugfix 06-01-03: KOMA-Script variants of
+% `parskip' and `parindent' options revised and moved into caption kernel}
+% \changes{v1.0h}{2006/02/23}{KOMA-Script variants of `parskip' and
+% `parindent' are obsolete now, removed}
+% \changes{v1.0m}{2007/03/30}{KOMA-Script variants of `parskip' and
+% `parindent' re-added, since they still collide with the current
+% version of the subfig package (Sigh!)}
+%
+% There is an option clash between the \KOMAScript\ document classes
+% and the \package{caption} kernel, both define the options |parindent| and
+% |parskip| but with different meaning.
+% Furthermore the ones defined by the \package{caption} kernel take a
+% value as parameter but the \KOMAScript\ ones do not.
+% So we need special versions of the options |parindent| and |parskip| here
+% which determine if a value is given (and therefore should be treated as
+% our option) or not (and therefore should be ignored by us).\footnote{%^^A
+% This problem was completely solved due a change of \cs{caption@ProcessOptions}
+% in \thispackage\ \version{1.0h}, but we still need this workaround since
+% these options would otherwise still collide with the current version $1.3$
+% of the \package{subfig} package (Sigh!)}
+% \begin{macrocode}
+\providecommand*\caption@ifkomaclass{%
+ \caption@ifundefined\scr@caption\@gobble\@firstofone}
+\@onlypreamble\caption@ifkomaclass
+% \end{macrocode}
+% \begin{macrocode}
+\caption@ifkomaclass{%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@KV@parindent\KV@caption@parindent
+ \DeclareCaptionOption{parindent}[]{%
+ \ifx,#1,%
+ \caption@Debug{Option `parindent' ignored}%
+ \else
+ \caption@KV@parindent{#1}%
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@KV@parskip\KV@caption@parskip
+ \DeclareCaptionOption{parskip}[]{%
+ \ifx,#1,%
+ \caption@Debug{Option `parskip' ignored}%
+ \else
+ \caption@KV@parskip{#1}%
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsection{Styles}
+%
+% \begin{macro}{\DeclareCaptionStyle}
+% \changes{v1.0a}{2004/01/17}{Pass through argument \#3 so extra spaces
+% between arguments do make any harm}
+% |\DeclareCaptionStyle|\marg{name}\oarg{single-line-list-of-KV}\marg{list-of-KV}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionStyle[1]{%
+ \@testopt{\caption@declarestyle{#1}}{}}
+\@onlypreamble\DeclareCaptionStyle
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@declarestyle#1[#2]#3{%
+ \global\@namedef{caption@sls@#1}{#2}%
+ \global\@namedef{caption@sty@#1}{#3}}
+\@onlypreamble\caption@declarestyle
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.2a}{2008/01/20}{Option \opt{style*=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{style}{\caption@setstyle{#1}}
+\DeclareCaptionOption{style*}{\caption@setstyle*{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setstyle}
+% \changes{v1.0e}{2005/06/01}{Starred variant added}
+% \changes{v1.1}{2007/07/29}{Recursive style definitions should work now}
+% \changes{v1.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency}
+% \changes{v1.2}{2007/12/03}{Definition of \cs{caption@iftypewarning} removed}
+% |\caption@setstyle|\marg{name}\\
+% |\caption@setstyle*|\marg{name}\par
+% Selecting a caption style means saving the additional
+% \meta{single-line-list-of-KV} (this will be done by |\caption@sls|),
+% resetting the caption options to the base ones (this will be done using
+% |\caption@resetstyle|) and executing the \meta{list-of-KV} options
+% (this will be done using |\caption@setup|).\par
+% The starred version will give no error message if the given style is not
+% defined.
+% \begin{macrocode}
+\newcommand*\caption@setstyle{%
+ \caption@teststar\caption@@setstyle\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setstyle[2]{%
+ \@ifundefined{caption@sty@#2}%
+ {#1{\caption@Error{Undefined style `#2'}}}%
+ {\expandafter\let\expandafter\caption@sty\csname caption@sty@#2\endcsname
+ \ifx\caption@setstyle@flag\@undefined
+ \let\caption@setstyle@flag\relax
+ \caption@resetstyle
+ \caption@xsetup\caption@sty
+ \let\caption@setstyle@flag\@undefined
+ \else
+ \caption@xsetup\caption@sty
+ \fi
+ \expandafter\let\expandafter\caption@sls\csname caption@sls@#2\endcsname
+ \expandafter\caption@l@addto@list\expandafter\caption@opt@singleline
+ \expandafter{\caption@sls}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@resetstyle}
+% \changes{v1.1}{2007/02/04}{%
+% This macro renamed from \cs{caption@setdefault} to \cs{caption@resetstyle}}
+% \changes{v1.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency}
+% \changes{v1.2}{2007/11/17}{Usage of \opt{size=} added}
+% \changes{v1.2b}{2008/05/06}{Usage of \opt{rule} added}
+% \changes{v1.5}{2012/03/15}{\opt{box=parbox} added}
+% \changes{v1.6}{2013/05/01}{\opt{box=none} added, \opt{box=parbox} changed to \opt{parbox=parbox}}
+% This resets (nearly) all caption options to the base ones.
+% \emph{Note that this does not touch the skips and the positioning!}
+% \begin{macrocode}
+\newcommand*\caption@resetstyle{%
+ \caption@setup{%
+ box=none,boxcolor=white,parbox=parbox,%
+ format=plain,labelformat=default,labelsep=colon,textformat=simple,%
+ justification=justified,font=,size=,labelfont=,textfont=,%
+ margin=0pt,minmargin=0,maxmargin=0,%
+ indent=0pt,parindent=0pt,hangindent=0pt,%
+ slc,rule,strut}%
+ \caption@clearsetup{singleline}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.0c}{2005/02/12}{\opt{indent=0pt} added to caption style \opt{default}}
+% \changes{v1.1}{2007/02/04}{Caption style `default' renamed to `base', and a new `default' added}
+% \changes{v1.1}{2007/03/31}{\opt{format=plain} added to caption style \opt{default}}
+% \changes{v1.1c}{2007/10/14}{\opt{format=plain} removed from caption style \opt{default}}
+% \changes{v1.5}{2012/03/15}{\opt{box=default} added to caption style \opt{default}}
+% Currently there are two pre-defined styles, called `base' \& `default'.
+% The first one is a perfect match to the behavior of |\@makecaption| offered
+% by the standard \LaTeX\ document classes (and was called `default' in
+% \thispackage\ \version{1.0}), the second one matches the document
+% class actually used.
+% \begin{macrocode}
+\DeclareCaptionStyle{base}[indent=0pt,justification=centering]{}
+\DeclareCaptionStyle{default}[indent=0pt,justification=centering]{%
+ box=default,format=default,labelsep=default,textformat=default,%
+ justification=default,font=default,labelfont=default,textfont=default}
+% \end{macrocode}
+%
+% \changes{v1.2b}{2008/05/06}{Option \opt{slc=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{singlelinecheck}[1]{\caption@set@bool\caption@ifslc{#1}}
+\DeclareCaptionOption{slc}[1]{\KV@caption@singlelinecheck{#1}}
+% \end{macrocode}
+%
+% \subsection{Boxes}
+%
+% \begin{macro}{\DeclareCaptionBox}
+% \changes{v1.5}{2012/03/15}{This macro added}
+% |\DeclareCaptionBox|\marg{name}\marg{code with \#1 and \#2}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionBox[2]{%
+ \global\long\@namedef{caption@box@#1}##1##2{#2}}
+\@onlypreamble\DeclareCaptionBox
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.5}{2012/03/15}{Option \opt{box=} added}
+% \changes{v1.6}{2013/05/01}{Option \opt{parbox=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{box}{\caption@setbox{#1}}
+\DeclareCaptionOption{parbox}{\caption@set@box\caption@parbox{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setbox}
+% |\caption@setbox|\marg{name}\par
+% Selecting a caption box simply means saving the code (in |\caption@box|).
+% \begin{macrocode}
+\newcommand*\caption@setbox{%
+ \caption@set@box\caption@box}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@set@box[2]{%
+ \@ifundefined{caption@box@#2}%
+ {\caption@Error{Undefined box `#2'}}%
+ {\expandafter\let\expandafter#1\csname caption@box@#2\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% There are four pre-defined boxes, called `empty', `none',
+% `parbox', and `colorbox'.
+% \changes{v1.0i}{2006/05/13}{We define \cs{captionbox} instead of
+% \cs{caption@start/endbox}}
+% \changes{v1.0l}{2006/03/09}{Bugfix 07-03-09: \cs{captionbox} changed from
+% \cs{parbox-t} to \cs{parbox-b}}
+% \changes{v1.2}{2007/11/11}{\cs{captionbox} renamed to \cs{caption@parbox}}
+% \changes{v1.5}{2012/03/15}{\cs{caption@parbox} adapted to \cs{DeclareCaptionBox}}
+% \changes{v1.6}{2013/05/02}{Option \opt{boxsep=} added}
+% \begin{macrocode}
+\DeclareCaptionBox{empty}{}
+\DeclareCaptionBox{none}{#2}
+\DeclareCaptionBox{parbox}{\parbox[b]{#1}{#2}}
+%\DeclareCaptionBox{colorbox}{%
+% \colorbox{\caption@boxcolor}{\caption@box@parbox{\dimexpr #1-2\fboxsep}{#2}}}
+\DeclareCaptionBox{colorbox}{\colorbox{\caption@boxcolor}{%
+ \setlength\caption@tempdima{#1}%
+ \addtolength\caption@tempdima{-2\fboxsep}%
+ \linewidth=\caption@tempdima\hsize=\caption@tempdima
+ #2}}
+\DeclareCaptionOption{boxcolor}{\def\caption@boxcolor{#1}}
+\DeclareCaptionOption{boxsep}{\setlength\fboxsep{#1}}
+% \end{macrocode}
+%
+% `default' usually maps to `none`.
+% \begin{macrocode}
+\def\caption@box@default{\caption@box@none}
+% \end{macrocode}
+%
+% \subsection{Formats}
+%
+% \begin{macro}{\DeclareCaptionFormat}
+% \changes{v1.0a}{2004/01/17}{Pass through argument \#3 so extra spaces
+% between arguments do make any harm}
+% \changes{v1.0c}{2005/02/09}{Starred variant added}
+% \changes{v1.1c}{2007/10/15}{Optional argument added}
+% |\DeclareCaptionFormat|\marg{name}\marg{code with \#1, \#2, and \#3}\\
+% |\DeclareCaptionFormat*|\marg{name}\marg{code with \#1, \#2, and \#3}\par
+% The starred form causes the code being typeset in vertical (instead of
+% horizontal) mode, but does not support the |indention=| option.
+% \begin{macrocode}
+\newcommand*\DeclareCaptionFormat{%
+ \caption@teststar\caption@declareformat\@gobble\@firstofone}
+\@onlypreamble\DeclareCaptionFormat
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declareformat[2]{%
+ \@dblarg{\caption@@declareformat#1{#2}}}
+\@onlypreamble\caption@declareformat
+% \end{macrocode}
+% \begin{macrocode}
+\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
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{format}{\caption@setformat{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setformat}
+% |\caption@setformat|\marg{name}\par
+% Selecting a caption format simply means saving the code (in |\caption@fmt|)
+% and if the code should be used in horizontal or vertical mode (|\caption@ifh|).
+% \begin{macrocode}
+\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}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionDefaultFormat}
+% \changes{v1.2a}{2008/01/31}{This macro added}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionDefaultFormat[1]{%
+ \expandafter\def\expandafter\caption@fmt@default\expandafter
+ {\csname caption@fmt@#1\endcsname}%
+ \expandafter\def\expandafter\caption@slfmt@default\expandafter
+ {\csname caption@slfmt@#1\endcsname}%
+ \expandafter\def\expandafter\caption@ifh@default\expandafter
+ {\csname caption@ifh@#1\endcsname}}
+\@onlypreamble\DeclareCaptionDefaultFormat
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.0a}{2004/01/23}{%
+% Caption format \opt{default} renamed to \opt{normal}}
+% \changes{v1.0e}{2005/05/12}{%
+% Caption format \opt{normal} renamed to \opt{@normal}}
+% \changes{v1.0f}{2005/08/25}{%
+% Caption format \opt{@normal} renamed to \opt{plain} and documented}
+% \changes{v1.1c}{2007/10/14}{%
+% Single-line variant of caption format \opt{hang} added}
+% There are two pre-defined formats, called `plain' and `hang'.
+% \begin{macrocode}
+\DeclareCaptionFormat{plain}{#1#2#3\par}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionFormat{hang}[#1#2#3\par]{%
+ \caption@ifin@list\caption@lsepcrlist\caption@lsepname
+ {\caption@Error{%
+ The option `labelsep=\caption@lsepname' does not work\MessageBreak
+ with `format=hang'}}%
+ {\@hangfrom{#1#2}%
+ \advance\caption@parindent\hangindent
+ \advance\caption@hangindent\hangindent
+ \caption@@par#3\par}}
+% \end{macrocode}
+%
+% \changes{v1.0a}{2004/01/23}{Caption format \opt{default} linked to \opt{plain}}
+% \changes{v1.0d}{2005/04/28}{Bugfix 05-04-28: Missing \cs{caption@ifh@default} added}
+% `default' usually maps to `plain'.
+% \begin{macrocode}
+\DeclareCaptionDefaultFormat{plain}
+% \end{macrocode}
+%
+% \subsection{Label formats}
+%
+% \begin{macro}{\DeclareCaptionLabelFormat}
+% \changes{v1.0a}{2004/01/17}{%
+% Pass through argument \#2 so extra spaces between arguments do make any harm}
+% |\DeclareCaptionLabelFormat|\marg{name}\marg{code with \#1 and \#2}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionLabelFormat[2]{%
+ \global\@namedef{caption@lfmt@#1}##1##2{#2}}
+\@onlypreamble\DeclareCaptionLabelFormat
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{labelformat}{\caption@setlabelformat{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlabelformat}
+% |\caption@setlabelformat|\marg{name}\par
+% Selecting a caption label format simply means saving the code (in |\caption@lfmt|).
+% \begin{macrocode}
+\newcommand*\caption@setlabelformat[1]{%
+ \@ifundefined{caption@lfmt@#1}%
+ {\caption@Error{Undefined label format `#1'}}%
+ {\expandafter\let\expandafter\caption@lfmt\csname caption@lfmt@#1\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.2}{2007/12/16}{Caption label format \opt{brace} added}
+% \changes{v1.7}{2015/09/16}{Caption label format \opt{autodot} added}
+% \changes{v1.7}{2016/05/22}{Caption label format \opt{autodot} fixed}
+% \changes{v1.8}{2016/05/22}{Caption label format \opt{unnumbered} added}
+% There are six pre-defined label formats, called `empty', `simple',
+% `parens', `brace', `autodot', and `unnumbered'.
+% \begin{macrocode}
+\DeclareCaptionLabelFormat{empty}{}
+\DeclareCaptionLabelFormat{simple}{\bothIfFirst{#1}{\nobreakspace}#2}
+\DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{\nobreakspace}(#2)}
+\DeclareCaptionLabelFormat{brace}{\bothIfFirst{#1}{\nobreakspace}#2)}
+\DeclareCaptionLabelFormat{autodot}{\bothIfFirst{#1}{\nobreakspace}#2\autodot}
+\DeclareCaptionLabelFormat{unnumbered}{#1}
+% \end{macrocode}
+%
+% `default' usually maps to `simple'.
+% \begin{macrocode}
+\def\caption@lfmt@default{\caption@lfmt@simple}
+% \end{macrocode}
+%
+% \subsection{Label separators}
+%
+% \begin{macro}{\DeclareCaptionLabelSeparator}
+% \changes{v1.0a}{2004/01/17}{Pass through argument \#2 so extra spaces
+% between arguments do make any harm}
+% \changes{v1.0f}{2005/08/25}{Starred variant added}
+% \changes{v1.1}{2007/07/13}{Test for CR added}
+% \changes{v1.3}{2011/08/06}{Test for CR revised}
+% |\DeclareCaptionLabelSeparator|\marg{name}\marg{code}\\
+% |\DeclareCaptionLabelSeparator*|\marg{name}\marg{code}\par
+% The starred form causes the label separator to be typeset \emph{without} using |\captionlabelfont|.
+% \begin{macrocode}
+\newcommand\DeclareCaptionLabelSeparator{%
+ \caption@teststar\caption@declarelabelseparator\@gobble\@firstofone}
+\@onlypreamble\DeclareCaptionLabelSeparator
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@declarelabelseparator[3]{%
+ \global\@namedef{caption@iflf@#2}{#1}%
+ \global\long\@namedef{caption@lsep@#2}{#3}%
+ \caption@@declarelabelseparator{#2}#3\\\@nil}
+\@onlypreamble\caption@declarelabelseparator
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@declarelabelseparator#1#2\\#3\@nil{%
+ \def\@tempa{#3}\ifx\@tempa\@empty \else
+ \caption@g@addto@list\caption@lsepcrlist{#1}%
+ \fi}
+\@onlypreamble\caption@@declarelabelseparator
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{labelsep}{\caption@setlabelseparator{#1}}
+\DeclareCaptionOption{labelseparator}{\caption@setlabelseparator{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlabelseparator}
+% |\caption@setlabelseparator|\marg{name}\par
+% Selecting a caption label separator simply means saving the code (in |\caption@lsep|).
+% \begin{macrocode}
+\newcommand*\caption@setlabelseparator[1]{%
+ \@ifundefined{caption@lsep@#1}%
+ {\caption@Error{Undefined label separator `#1'}}%
+ {\edef\caption@lsepname{#1}%
+ \expandafter\let\expandafter\caption@iflf\csname caption@iflf@#1\endcsname
+ \expandafter\let\expandafter\caption@lsep\csname caption@lsep@#1\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.0e}{2005/06/11}{Bugfix 05-03-23: Caption label separator
+% \opt{newline} implementation changed from \cs{newline} to \cs{\textbackslash}}
+% \changes{v1.0f}{2005/08/24}{Caption label separator \opt{endash} added}
+% There are seven pre-defined label separators, called `none', `colon', `period', `space',
+% `quad', `newline', and `endash'.
+% \begin{macrocode}
+\DeclareCaptionLabelSeparator{none}{}
+\DeclareCaptionLabelSeparator{colon}{: }
+\DeclareCaptionLabelSeparator{period}{. }
+\DeclareCaptionLabelSeparator{space}{ }
+\DeclareCaptionLabelSeparator*{quad}{\quad}
+\DeclareCaptionLabelSeparator*{newline}{\\}
+\DeclareCaptionLabelSeparator*{endash}{\space\textendash\space}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setdefaultlabelsep}
+% \changes{v1.2d}{2009/03/29}{This macro added}
+% \begin{macrocode}
+\newcommand*\caption@setdefaultlabelsep[1]{%
+ \ifx\caption@lsep\caption@lsep@default
+ \caption@set@default@labelsep{#1}%
+ \caption@setlabelseparator{default}%
+ \else
+ \caption@set@default@labelsep{#1}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@set@default@labelsep[1]{%
+ \def\caption@lsep@default{\@nameuse{caption@lsep@#1}}%
+ \def\caption@iflf@default{\@nameuse{caption@iflf@#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% `default' usually maps to `colon'.
+% \begin{macrocode}
+\caption@set@default@labelsep{colon}
+% \end{macrocode}
+%
+% \subsection{Text formats}
+%
+% \begin{macro}{\DeclareCaptionTextFormat}
+% \changes{v1.0j}{2007/02/18}{This macro added}
+% |\DeclareCaptionTextFormat|\marg{name}\marg{code with \#1}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionTextFormat[2]{%
+ \global\long\@namedef{caption@tfmt@#1}##1{#2}}
+\@onlypreamble\DeclareCaptionTextFormat
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.0c}{2005/02/12}{Option \opt{strut=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{textformat}{\caption@settextformat{#1}}
+\DeclareCaptionOption{strut}[1]{\caption@set@bool\caption@ifstrut{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@settextformat}
+% \changes{v1.0j}{2007/02/18}{This macro added}
+% |\caption@settextformat|\marg{name}\par
+% Selecting a caption text format simply means saving the code (in |\caption@tfmt|).
+% \begin{macrocode}
+\newcommand*\caption@settextformat[1]{%
+ \@ifundefined{caption@tfmt@#1}%
+ {\caption@Error{Undefined text format `#1'}}%
+ {\expandafter\let\expandafter\caption@tfmt\csname caption@tfmt@#1\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% There are three pre-defined text formats, called `empty', `simple' and `period'.
+% \changes{v1.4}{2011/10/05}{Pre-defined text format `empty' added}
+% \changes{v1.7}{2015/09/16}{The text format `empty' now takes care of the \cs{label}}
+% \begin{macrocode}
+\DeclareCaptionTextFormat{empty}{%
+ \caption@get@label#1\caption@makeanchor{}\@nil
+ \caption@thelabel
+ \global\let\caption@thelabel\relax}
+\long\def\caption@get@label#1\caption@makeanchor#2#3\@nil{%
+ \def\caption@tempa{#2}%
+ \ifx\caption@tempa\@empty
+ \caption@getlabel#1\label{}\@nil
+ \else
+ \caption@getlabel#2\label{}\@nil
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionTextFormat{simple}{#1}
+\DeclareCaptionTextFormat{period}{#1.}
+% \end{macrocode}
+%
+% `default' usually maps to `simple'.
+% \begin{macrocode}
+\def\caption@tfmt@default{\caption@tfmt@simple}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@getlabel}
+% \changes{v1.0}{2011/09/03}{\cs{label} can have optional arguments now}
+% \changes{v1.7}{2015/09/16}{Moved from \package{bicaption} package to \package{caption3}}
+% \changes{v1.8d}{2019/09/01}{Bugfix: Global definition of \cs{caption@thelabel} added}
+% Gets the label command out of the (first) caption text and stores it to |\caption@thelabel|.
+% \begin{macrocode}
+\long\def\caption@getlabel#1\label#2#3\@nil{%
+ \def\@tempa{#2}%
+ \ifx\@tempa\@empty
+ \let\caption@thelabel\relax
+ \else
+ \def\@tempb{*}%
+ \ifx\@tempa\@tempb
+ \def\caption@thelabel{\label*}%
+ \caption@@getlabel#3\@nil
+ \else
+ \def\caption@thelabel{\label}%
+ \caption@@getlabel{#2}#3\@nil
+ \fi
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@getlabel#1#2\@nil{%
+ \def\@tempa{#1}%
+ \def\@tempb{[}%
+ \ifx\@tempa\@tempb
+ \caption@@@getlabel#1#2\@nil
+ \else
+ \l@addto@macro\caption@thelabel{{#1}}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@@getlabel[#1]#2\@nil{%
+ \l@addto@macro\caption@thelabel{[{#1}]}%
+ \caption@@getlabel#2\@nil}
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@thelabel\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Fonts}
+%
+% \begin{macro}{\DeclareCaptionFont}
+% \changes{v1.0a}{2004/01/22}{%
+% Bugfix: Multi token arguments are allowed now}
+% \changes{v1.1}{2007/05/07}{%
+% Internal: Uses \cs{caption@fnt} instead of \cs{caption@temp} now}
+% |\DeclareCaptionFont|\marg{name}\marg{code}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionFont[2]{%
+ \define@key{caption@fnt}{#1}[]{\l@addto@macro\caption@fnt{#2}}}
+\@onlypreamble\DeclareCaptionFont
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionDefaultFont}
+% \changes{v1.1}{2006/05/14}{This macro added}
+% \changes{v1.2a}{2008/01/31}{Renamed from \cs{DeclareDefaultCaptionFont} to \cs{DeclareCaptionDefaultFont}}
+% |\DeclareCaptionDefaultFont|\marg{name}\marg{code}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionDefaultFont[2]{%
+ \global\@namedef{caption#1@default}{#2}}
+\@onlypreamble\DeclareCaptionDefaultFont
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{font}{\caption@setfont{font}{#1}}
+\DeclareCaptionOption{font+}{\caption@addtofont{font}{#1}}
+\DeclareCaptionDefaultFont{font}{}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{labelfont}{\caption@setfont{labelfont}{#1}}
+\DeclareCaptionOption{labelfont+}{\caption@addtofont{labelfont}{#1}}
+\DeclareCaptionDefaultFont{labelfont}{}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{textfont}{\caption@setfont{textfont}{#1}}
+\DeclareCaptionOption{textfont+}{\caption@addtofont{textfont}{#1}}
+\DeclareCaptionDefaultFont{textfont}{}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setfont}
+% \changes{v1.0j}{2007/01/30}{Usage of \cs{caption@setkeys} with optional argument}
+% \changes{v1.1}{2006/05/14}{Support of \cs{DeclareDefaultCaptionFont} added}
+% |\caption@setfont|\marg{name}\marg{keyval-list of names}\par
+% Selecting a caption font means saving all the code snippets
+% in |\caption|\meta{name}.
+% \begin{macrocode}
+\newcommand*\caption@setfont[1]{%
+ \expandafter\let\csname caption#1\endcsname\@empty
+ \caption@addtofont{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@addtofont}
+% \changes{v1.2}{2007/11/17}{This macro added}
+% |\caption@addtofont|\marg{name}\marg{keyval-list of names}\par
+% Like |\caption@setfont|, but adds the code snippets to |\caption|\meta{name}.\par
+% Because we use |\setkeys| recursive here we need to do this inside an
+% extra group.
+% \begin{macrocode}
+\newcommand*\caption@addtofont[2]{%
+ \begingroup
+ \expandafter\let\expandafter\caption@fnt\csname caption#1\endcsname
+ \define@key{caption@fnt}{default}[]{%
+ \l@addto@macro\caption@fnt{\csname caption#1@default\endcsname}}%
+ \caption@setkeys[caption]{caption@fnt}{#2}%
+ \global\let\caption@tempa\caption@fnt
+ \endgroup
+ \expandafter\let\csname caption#1\endcsname\caption@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@font}
+% \changes{v1.1}{2007/05/07}{This macro added}
+% |\caption@font|\marg{keyval-list of names}\\
+% |\caption@font*|\marg{keyval-code}\par
+% Sets the given font, e.g.~|\caption@font{small,it}|
+% is equivalent to |\small\itshape|.
+% \begin{macrocode}
+\newcommand*\caption@font{%
+ \caption@teststar\caption@@font\@firstofone
+ {\caption@setkeys[caption]{caption@fnt}}}
+\newcommand*\caption@@font[2]{%
+ \begingroup
+ \def\caption@fnt{\endgroup}%
+ #1{#2}%
+ \caption@fnt}
+% \end{macrocode}
+% \end{macro}
+%
+% These are the pre-defined font code snippets.
+%
+% \changes{v1.1}{2007/05/07}{Color font support added}
+% \begin{macrocode}
+\DeclareCaptionFont{normalcolor}{\normalcolor}
+\DeclareCaptionFont{color}{\color{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionFont{normalfont}{\normalfont}
+\DeclareCaptionFont{up}{\upshape}
+\DeclareCaptionFont{it}{\itshape}
+\DeclareCaptionFont{sl}{\slshape}
+\DeclareCaptionFont{sc}{\scshape}
+\DeclareCaptionFont{md}{\mdseries}
+\DeclareCaptionFont{bf}{\bfseries}
+\DeclareCaptionFont{rm}{\rmfamily}
+\DeclareCaptionFont{sf}{\sffamily}
+\DeclareCaptionFont{tt}{\ttfamily}
+% \end{macrocode}
+%
+% \changes{v1.7}{2018/05/01}{Missing font sizes \texttt{tiny}, \texttt{LARGE}, \texttt{huge}, and \texttt{Huge} added}
+% \begin{macrocode}
+\DeclareCaptionFont{tiny}{\tiny}
+\DeclareCaptionFont{scriptsize}{\scriptsize}
+\DeclareCaptionFont{footnotesize}{\footnotesize}
+\DeclareCaptionFont{small}{\small}
+\DeclareCaptionFont{normalsize}{\normalsize}
+\DeclareCaptionFont{large}{\large}
+\DeclareCaptionFont{Large}{\Large}
+\DeclareCaptionFont{LARGE}{\LARGE}
+\DeclareCaptionFont{huge}{\huge}
+\DeclareCaptionFont{Huge}{\Huge}
+% \end{macrocode}
+%
+% \changes{v1.8}{2018/05/01}{Font size \texttt{smaller} added}
+% \begin{macrocode}
+\newcommand\caption@smaller{%
+ \ifx\@currsize\tiny
+ \relax
+ \else\ifx\@currsize\scriptsize
+ \tiny
+ \else\ifx\@currsize\footnotesize
+ \scriptsize
+ \else\ifx\@currsize\small
+ \footnotesize
+ \else\ifx\@currsize\normalsize
+ \small
+ \else\ifx\@currsize\large
+ \normalsize
+ \else\ifx\@currsize\Large
+ \large
+ \else\ifx\@currsize\LARGE
+ \Large
+ \else\ifx\@currsize\huge
+ \LARGE
+ \else\ifx\@currsize\Huge
+ \huge
+ \else
+ \caption@Warning{%
+ Cannot determine current font size.\MessageBreak
+ Try setting it with `size=' explicitly}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+\DeclareCaptionFont{smaller}{\caption@smaller}
+% \end{macrocode}
+%
+% \changes{v1.8}{2018/05/02}{Font size \texttt{larger} added}
+% \begin{macrocode}
+\newcommand\caption@larger{%
+ \ifx\@currsize\tiny
+ \scriptsize
+ \else\ifx\@currsize\scriptsize
+ \footnotesize
+ \else\ifx\@currsize\footnotesize
+ \small
+ \else\ifx\@currsize\small
+ \normalsize
+ \else\ifx\@currsize\normalsize
+ \large
+ \else\ifx\@currsize\large
+ \Large
+ \else\ifx\@currsize\Large
+ \LARGE
+ \else\ifx\@currsize\LARGE
+ \huge
+ \else\ifx\@currsize\huge
+ \Huge
+ \else\ifx\@currsize\Huge
+ \relax
+ \else
+ \caption@Warning{%
+ Cannot determine current font size.\MessageBreak
+ Try setting it with `size=' explicitly}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+\DeclareCaptionFont{larger}{\caption@larger}
+% \end{macrocode}
+%
+% \changes{v1.3}{2011/01/01}{\package{sansmath} package support added}
+% \begin{macrocode}
+\DeclareCaptionFont{sansmath}{\sansmath}
+% \end{macrocode}
+%
+% \changes{v1.0n}{2007/04/02}{\package{setspace} package support added}
+% \changes{v1.2d}{2009/10/09}{Bugfix 09-05-18: \package{setspace} package support revised}
+% \begin{macrocode}
+\DeclareCaptionFont{singlespacing}{%
+ \caption@ifundefined\setspace@singlespace{}{%
+ \setstretch\setspace@singlespace}}% normally 1
+\DeclareCaptionFont{onehalfspacing}{\onehalfspacing}
+\DeclareCaptionFont{doublespacing}{\doublespacing}
+\DeclareCaptionFont{stretch}{\setstretch{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%\DeclareCaptionFont{normal}{%
+% \caption@font{normalcolor,normalfont,normalsize,singlespacing}
+\DeclareCaptionFont{normal}{%
+ \caption@font*{%
+ \KV@caption@fnt@normalcolor\@unused
+ \KV@caption@fnt@normalfont\@unused
+ \KV@caption@fnt@normalsize\@unused
+ \KV@caption@fnt@singlespacing\@unused}}
+% \end{macrocode}
+%
+% \changes{v1.0a}{2004/01/23}{Option \opt{size=} now sets \cs{captionsize} instead of \cs{captionfont}}
+% The old versions \version{1.x} of \thispackage\ offered this
+% command to setup the font size used for captions. We still do
+% so old documents will work fine.
+% \begin{macrocode}
+\DeclareCaptionOption{size}{\caption@setfont{size}{#1}}
+\DeclareCaptionDefaultFont{size}{}
+% \end{macrocode}
+%
+% \subsection{Justifications}
+%
+% \begin{macro}{\DeclareCaptionJustification}
+% \changes{v1.0a}{2004/01/17}{Pass through argument \#2 so extra spaces
+% between arguments do make any harm}
+% \changes{v1.1}{2007/07/03}{Mapped to \cs{DeclareCaptionFont}}
+% |\DeclareCaptionJustification|\marg{name}\marg{code}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionJustification[2]{%
+ \global\@namedef{caption@hj@#1}{#2}% for compatibility to v1.0
+ \DeclareCaptionFont{#1}{#2}}
+\@onlypreamble\DeclareCaptionJustification
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionDefaultJustification}
+% \changes{v1.1}{2007/07/03}{This macro added}
+% \changes{v1.2a}{2008/01/31}{Renamed from \cs{DeclareDefaultCaptionJustification} to \cs{DeclareCaptionDefaultJustification}}
+% |\DeclareCaptionDefaultJustification|\marg{code}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionDefaultJustification[1]{%
+ \global\@namedef{caption@hj@default}{#1}% for compatibility to v1.0
+ \DeclareCaptionDefaultFont{@hj}{#1}}
+\@onlypreamble\DeclareCaptionDefaultJustification
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{justification}{\caption@setjustification{#1}}
+\DeclareCaptionDefaultJustification{}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setjustification}
+% \changes{v1.1}{2007/07/03}{Mapped to \cs{caption@setfont}}
+% |\caption@setjustification|\marg{name}\par
+% Selecting a caption justification simply means saving the code (in |\caption@hj|).
+% \begin{macrocode}
+\newcommand*\caption@setjustification{\caption@setfont{@hj}}
+% \end{macrocode}
+% \end{macro}
+%
+% These are the pre-defined justification code snippets.
+% \begin{macrocode}
+\DeclareCaptionJustification{justified}{}
+\DeclareCaptionJustification{centering}{\centering}
+\DeclareCaptionJustification{centerfirst}{\centerfirst}
+\DeclareCaptionJustification{centerlast}{\centerlast}
+\DeclareCaptionJustification{raggedleft}{\raggedleft}
+\DeclareCaptionJustification{raggedright}{\raggedright}
+% \end{macrocode}
+%
+% \begin{macro}{\centerfirst}
+% \changes{v1.0j}{2007/01/21}{Bugfix: Usage of \cs{@centercr} added (Thanks to Olga!)}
+% \changes{v1.0j}{2007/01/21}{This macro renamed from \cs{caption@centerfirst} to \cs{centerfirst}}
+% Please blame Frank Mittelbach for the code of |\centerfirst| |:-)|
+% \begin{macrocode}
+\providecommand\centerfirst{%
+ \let\\\@centercr
+ \edef\caption@normaladjust{%
+ \leftskip\the\leftskip
+ \rightskip\the\rightskip
+ \parfillskip\the\parfillskip\relax}%
+ \leftskip\z@\@plus -1fil%
+ \rightskip\z@\@plus 1fil%
+ \parfillskip\z@skip
+ \noindent\hskip\z@\@plus 2fil%
+ \@setpar{\@@par\@restorepar\caption@normaladjust}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\centerlast}
+% \changes{v1.0j}{2007/01/21}{Bugfix: Usage of \cs{@centercr} added (Thanks to Olga!)}
+% \changes{v1.0j}{2007/01/21}{This macro renamed from \cs{caption@centerlast} to \cs{centerlast}}
+% This is based on code from Anne Br\"uggemann-Klein\cite{Anne}
+% \begin{macrocode}
+\providecommand\centerlast{%
+ \let\\\@centercr
+ \leftskip\z@\@plus 1fil%
+ \rightskip\z@\@plus -1fil%
+ \parfillskip\z@\@plus 2fil\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{The ragged2e package}
+% \changes{v1.0b}{2004/05/16}{Improved \package{ragged2e} package support}
+%
+% We also support the upper-case commands offered by the \package{ragged2e}
+% package.
+% Note that these just map to their lower-case variants if the
+% \package{ragged2e} package is not available.
+% \begin{macrocode}
+\DeclareCaptionJustification{Centering}{%
+ \caption@ragged\Centering\centering}
+\DeclareCaptionJustification{RaggedLeft}{%
+ \caption@ragged\RaggedLeft\raggedleft}
+\DeclareCaptionJustification{RaggedRight}{%
+ \caption@ragged\RaggedRight\raggedright}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@ragged}
+% \changes{v1.0n}{2007/04/07}{The `ragged2e' package will now only been
+% loaded when needed}
+% \changes{v1.0o}{2007/04/11}{Bugfix: Usage of \cs{caption@Info} replaced
+% by \cs{caption@Debug}}
+% \changes{v1.1}{2007/04/16}{A different warning will be given on first \LaTeX\ run}
+% \changes{v1.4f}{2012/01/12}{Uses \cs{caption@IfPackageLoaded} now}
+% |\caption@ragged|\marg{yes-code}\marg{no-code}
+% executes the \meta{yes-code} if the \package{ragged2e} package is loaded
+% and \meta{no-code} if not. Additionally it tries to load the \package{ragged2e}
+% package.
+% \begin{macrocode}
+\newcommand*\caption@ragged{\caption@ifpackageloaded{ragged2e}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifpackageloaded}
+% \changes{v1.4f}{2012/01/12}{This macro added}
+% |\caption@ifpackageloaded|\marg{package}\marg{yes-code}\marg{no-code}
+% executes the \meta{yes-code} if the given package is loaded
+% and \meta{no-code} if not. Additionally it tries to load the package.
+% \begin{macrocode}
+\newcommand*\caption@ifpackageloaded[1]{%
+ \@ifundefined{caption@ifpkg@#1}%
+ {\caption@RequirePackage{#1}%
+ \caption@pkg@true{#1}}%
+ {}%
+ \caption@ifpkg{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\AtBeginDocument{\renewcommand*\caption@ifpackageloaded[1]{%
+ \@ifundefined{caption@ifpkg@#1}%
+ {\caption@addto@pkg@list{#1}%
+ \caption@pkg@false{#1}%
+ \caption@Warning{%
+ `#1' support has been changed.\MessageBreak
+ Rerun to get captions right}}%
+ {}%
+ \caption@ifpkg{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@ifpkg[1]{%
+ \csname caption@ifpkg@#1\endcsname}
+\newcommand*\caption@pkg@true[1]{%
+ \global\expandafter\let\csname caption@ifpkg@#1\endcsname\@firstoftwo}
+\newcommand*\caption@pkg@false[1]{%
+ \global\expandafter\let\csname caption@ifpkg@#1\endcsname\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@pkg@list{}
+\newcommand*\caption@addto@pkg@list[1]{%
+ \protected@write\@auxout{}{%
+ \string\@cons\string\caption@pkg@list{{#1}}}}
+% \end{macrocode}
+% \begin{macrocode}
+\AtBeginDocument{%
+ \def\caption@tempa{\endgroup}%
+ \begingroup
+ \def\@elt#1{%
+ \g@addto@macro\caption@tempa{%
+ \caption@RequirePackage{#1}%
+ \@namedef{caption@ifpkg@#1}{%
+ \caption@addto@pkg@list{#1}%
+ \caption@pkg@true{#1}%
+ \caption@ifpkg{#1}}}}%
+ \caption@pkg@list
+ \caption@tempa}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@RequirePackage[1]{%
+ \caption@Info{We need package `#1'}%
+ \RequirePackage{#1}}
+\@onlypreamble\caption@RequirePackage
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Vertical spaces before and after captions}
+%
+% \begin{macro}{\abovecaptionskip}
+% \begin{macro}{\belowcaptionskip}
+% Usually these skips are defined within the document class, but some
+% document classes don't do so.
+% \begin{macrocode}
+\caption@ifundefined\abovecaptionskip{%
+ \newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@}}{}
+\caption@ifundefined\belowcaptionskip{%
+ \newlength\belowcaptionskip\setlength\belowcaptionskip{0\p@}}{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \changes{v1.0c}{2005/02/12}{Option \opt{skip=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{aboveskip}{\setlength\abovecaptionskip{#1}}
+\DeclareCaptionOption{belowskip}{\setlength\belowcaptionskip{#1}}
+\DeclareCaptionOption{skip}{\setlength\abovecaptionskip{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@rule}
+% \changes{v1.2b}{2008/05/06}{This macro added}
+% |\caption@rule|\par
+% Draws an invisible rule to adjust the ``skip'' setting.
+% \begin{macrocode}
+\newcommand*\caption@rule{\caption@ifrule\caption@hrule\relax}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@hrule{\hrule\@height\z@}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.2b}{2008/05/06}{Option \opt{rule=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{rule}[1]{\caption@set@bool\caption@ifrule{#1}}
+% \end{macrocode}
+%
+% \subsection{Positioning}
+%
+% These macros handle the right position of the caption.
+% Note that the position is actually \emph{not} controlled by the
+% \package{caption3} kernel options, but by the user (or a specific package
+% like the \package{float} package) instead.
+% The user can put the |\caption| command wherever he likes! So this stuff
+% is only to give us a \emph{hint} where to put the right skips, the user
+% usually has to take care for himself that this hint actually matches the
+% right position.
+%
+% \begin{macrocode}
+\DeclareCaptionOption{position}{\caption@setposition{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setposition}
+% \changes{v1.0a}{2004/01/22}{Now the positions \opt{t}, \opt{above}, \opt{b},
+% \opt{below}, and \opt{a} are allowed, too}
+% \changes{v1.0c}{2004/08/10}{Usage of \cs{caption@defaultpos} added}
+% |\caption@setposition|\marg{position}\par
+% Selecting the caption position means that we put |\caption@position| to
+% the right value. \emph{Please do \textbf{not} use the internal macro
+% \cs{caption@position} in your own package or document, but use the wrapper
+% macro \cs{caption@iftop} instead.}
+% \begin{macrocode}
+\newcommand*\caption@setposition[1]{%
+ \caption@ifinlist{#1}{d,default}{%
+ \let\caption@position\caption@defaultpos
+ }{\caption@ifinlist{#1}{t,top,above}{%
+ \let\caption@position\@firstoftwo
+ }{\caption@ifinlist{#1}{b,bottom,below}{%
+ \let\caption@position\@secondoftwo
+ }{\caption@ifinlist{#1}{a,auto}{%
+ \let\caption@position\@undefined
+ }{%
+ \caption@Error{Undefined position `#1'}%
+ }}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@defaultpos}
+% \changes{v1.1}{2007/05/08}{Default position changed from `bottom' to `auto'}
+% The default `position' is `auto', this means that \thispackage\ will try
+% to guess the current position of the caption.
+% (But in many cases, for example in |longtable|s, this is doomed to fail!)\par
+% The setting `bottom' correspondents to the |\@makecaption| implementation
+% in the standard \LaTeX\ document classes, but `auto' should give better
+% results in most cases.
+% \begin{macrocode}
+%\caption@setdefaultpos{a}% default = auto
+\let\caption@defaultpos\@undefined
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@iftop}
+% \changes{v1.0a}{2004/01/23}{Split into \cs{caption@iftop} \& \cs{caption@fixposition}}
+% \changes{v1.0c}{2005/02/12}{Adapted to \cs{caption@defaultpos}}
+% \changes{v1.1}{2007/05/08}{Position will be fixed to `bottom' if `auto'}
+% |\caption@iftop|\marg{true-code}\marg{false-code}\par
+% (If the |position=| is set to |auto| we assume a |bottom| position here.)
+% \begin{macrocode}
+\newcommand*\caption@iftop{%
+ \ifx\caption@position\@undefined
+ \let\caption@position\@secondoftwo
+% = \caption@setposition b%
+ \fi
+ \caption@position}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@fixposition}
+% \changes{v1.0b}{2004/05/16}{%
+% Split into \cs{caption@fixposition} & \cs{caption@autoposition}}
+% |\caption@fixposition|\par
+% This macro checks if the `position' is set to `auto'.
+% If yes, |\caption@autoposition| will be called to
+% set |\caption@position| to a proper value we can actually use.
+% \begin{macrocode}
+\newcommand*\caption@fixposition{%
+ \ifx\caption@position\@undefined
+ \caption@autoposition
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@autoposition}
+% \changes{v1.0a}{2004/01/23}{\cs{ifvmode} added}
+% |\caption@autoposition|\par
+% We guess the current position of the caption by checking |\prevdepth|.\par
+% A different solution would be setting the |\spacefactor| to something
+% not much less than 1000 (for example 994) in |\caption@start| and
+% checking this value here by |\ifnum\spacefactor=994|.
+% (It's implemented in the \package{threeparttable}
+% package\cite{threeparttable} this way.)\par
+% Another idea would be checking |\@ifminipage|, but since some packages
+% typeset the caption within a simple |\vbox| this does not seem to be a
+% good one.
+% \begin{macrocode}
+\newcommand*\caption@autoposition{%
+ \ifvmode
+ \edef\caption@tempa{\the\prevdepth}%
+ \caption@Debug{\protect\prevdepth=\caption@tempa}%
+ \ifdim\prevdepth>-\p@
+ \let\caption@position\@secondoftwo
+ \else
+ \let\caption@position\@firstoftwo
+ \fi
+% = \caption@setposition{\ifdim\prevdepth>-\p@ b\else t\fi}%
+ \else
+ \caption@Debug{no \protect\prevdepth}%
+ \let\caption@position\@secondoftwo
+% = \caption@setposition b%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@setautoposition}
+% \changes{v1.1}{2007/06/10}{This macro added}
+% |\caption@setautoposition|\marg{position}\par
+% replaces the above algorithm by a different one (or a fixed position setting).
+% \begin{macrocode}
+\newcommand*\caption@setautoposition[1]{%
+ \def\caption@autoposition{\caption@setposition{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Hooks}
+%
+% \begin{macro}{\AtBeginCaption}
+% \begin{macro}{\AtEndCaption}
+% |\AtBeginCaption| \marg{code}\\
+% |\AtEndCaption| \marg{code}\par
+% These hooks can be used analogous to |\AtBeginDocument| and |\AtEndDocument|.
+% \begin{macrocode}
+\newcommand*\caption@beginhook{}
+\newcommand*\caption@endhook{}
+\newcommand*\AtBeginCaption{\l@addto@macro\caption@beginhook}
+\newcommand*\AtEndCaption{\l@addto@macro\caption@endhook}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Lists}
+%
+% \changes{v1.0b}{2004/05/16}{Option \opt{listof=} added}
+% \changes{v1.2}{2007/11/17}{Option \opt{list=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{list}[1]{\caption@setlist{#1}}
+\DeclareCaptionOption{listof}[1]{\caption@setlist{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlist}
+% \changes{v1.2a}{2008/03/20}{This macro added}
+% |\caption@setlist|\marg{boolean}
+% \begin{macrocode}
+\newcommand*\caption@setlist{\caption@set@bool\caption@iflist}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.4}{2011/08/30}{Option \opt{listtype=} added}
+% \changes{v1.4}{2011/08/30}{Option \opt{listtype+=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{listtype}{\caption@setlisttype{#1}}
+\DeclareCaptionOption{listtype+}{\caption@setlisttype@ext{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlisttype}
+% \changes{v1.4}{2011/08/30}{This macro added}
+% |\caption@setlisttype|\marg{type}
+% \begin{macrocode}
+\newcommand*\caption@setlisttype{%
+ \caption@setlisttype@ext{}%
+ \caption@@setlisttype\caption@listtype}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setlisttype[2]{%
+ \edef#1{#2}%
+ \ifx#1\@empty \let#1\@undefined \fi}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@setlisttype@ext}
+% \changes{v1.4}{2011/08/30}{This macro added}
+% |\caption@setlisttype@ext|\marg{type extension}
+% \begin{macrocode}
+\newcommand*\caption@setlisttype@ext{%
+ \caption@@setlisttype\caption@listtype@ext}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionListFormat}
+% \changes{v1.1}{2004/07/15}{This macro added}
+% \changes{v1.2}{2007/11/17}{Renamed from \cs{DeclareCaptionListOfFormat} to \cs{DeclareCaptionListFormat}}
+% |\DeclareCaptionListFormat|\marg{name}\marg{code with \#1 and \#2}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionListFormat[2]{%
+ \global\@namedef{caption@lstfmt@#1}##1##2{#2}}
+\@onlypreamble\DeclareCaptionListFormat
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.1}{2007/07/15}{Option \opt{listofformat=} added}
+% \changes{v1.2}{2007/11/17}{Option \opt{listofformat=} renamed to \opt{listformat=}}
+% \begin{macrocode}
+\DeclareCaptionOption{listformat}{\caption@setlistformat{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlistformat}
+% \changes{v1.1}{2004/07/15}{This macro added}
+% \changes{v1.2}{2007/11/17}{Renamed from \cs{caption@setlistofformat} to \cs{caption@setlistformat}}
+% |\caption@setlistformat|\marg{name}\par
+% Selecting a caption list format simply means saving the code (in |\caption@lstfmt|).
+% \begin{macrocode}
+\newcommand*\caption@setlistformat[1]{%
+ \@ifundefined{caption@lstfmt@#1}%
+ {\caption@Error{Undefined list format `#1'}}%
+ {\expandafter\let\expandafter\caption@lstfmt
+ \csname caption@lstfmt@#1\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% There are five pre-defined list formats, taken from the \package{subfig} package.
+% \begin{macrocode}
+\DeclareCaptionListFormat{empty}{}
+\DeclareCaptionListFormat{simple}{#1#2}
+\DeclareCaptionListFormat{parens}{#1(#2)}
+\DeclareCaptionListFormat{subsimple}{#2}
+\DeclareCaptionListFormat{subparens}{(#2)}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setdefaultlistformat}
+% \changes{v1.2d}{2009/03/29}{This macro added}
+% \begin{macrocode}
+\newcommand*\caption@setdefaultlistformat[1]{%
+ \ifx\caption@lstfmt\caption@lstfmt@default
+ \caption@set@default@listformat{#1}%
+ \caption@setlistformat{default}%
+ \else
+ \caption@set@default@listformat{#1}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@set@default@listformat[1]{%
+ \def\caption@lstfmt@default{\@nameuse{caption@lstfmt@#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% `default' usually maps to `subsimple'.
+% \begin{macrocode}
+\caption@set@default@listformat{subsimple}
+% \end{macrocode}
+%
+% \subsection{Debug option}
+% \changes{v1.0k}{2007/03/04}{Debug option added}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{debug}[1]{%
+ \caption@set@bool\caption@ifdebug{#1}%
+ \caption@ifdebug
+ {\let\caption@Debug\caption@Info}%
+ {\let\caption@Debug\@gobble}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareOption{debug}{\setkeys{caption}{debug}}
+% \end{macrocode}
+% \begin{macrocode}
+\setkeys{caption}{debug=0}
+% \end{macrocode}
+%
+% \subsection{Document classes \& Babel support}
+%
+% \subsubsection{The standard \texorpdfstring{\LaTeX{}}{LaTeX} classes}
+%
+% \begin{macrocode}
+\caption@CheckCommand\@makecaption{%
+ % article|report|book [2005/09/16 v1.4f Standard LaTeX document class]
+ \long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1: #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ #1: #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}}
+% \end{macrocode}
+%
+% \subsubsection{The elsarticle classes}
+% \changes{v1.5}{2013/01/06}{elsarticle class support added}
+%
+% \begin{macro}{\caption@ifelsarticleclass}
+% \begin{macrocode}
+\providecommand*\caption@ifelsarticleclass{%
+ \@ifclassloaded{elsarticle}\@firstofone\@gobble}
+\@onlypreamble\caption@ifelsarticleclass
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@ifelsarticleclass{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % elsarticle.cls,v 1.20 2008-10-13 04:24:12 cvr Exp
+ \long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip\footnotesize
+ \sbox\@tempboxa{#1: #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ #1: #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}}
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionDefaultFont{font}{\footnotesize}
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection{The \AmS{} \& \SmF{} classes}
+% \changes{v1.1}{2007/07/29}{\AmS\ \& \SmF\ classes support added}
+%
+% \begin{macro}{\caption@ifamsclass}
+% \begin{macrocode}
+\providecommand*\caption@ifamsclass{%
+ \caption@ifundefined\@captionheadfont\@gobble\@firstofone}
+\@onlypreamble\caption@ifamsclass
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@ifamsclass{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % amsart|amsproc|amsbook [2004/08/06 v2.20]
+ \long\def\@makecaption#1#2{%
+ \setbox\@tempboxa\vbox{\color@setgroup
+ \advance\hsize-2\captionindent\noindent
+ \@captionfont\@captionheadfont#1\@xp\@ifnotempty\@xp
+ {\@cdr#2\@nil}{.\@captionfont\upshape\enspace#2}%
+ \unskip\kern-2\captionindent\par
+ \global\setbox\@ne\lastbox\color@endgroup}%
+ \ifhbox\@ne % the normal case
+ \setbox\@ne\hbox{\unhbox\@ne\unskip\unskip\unpenalty\unkern}%
+ \fi
+ \ifdim\wd\@tempboxa=\z@ % this means caption will fit on one line
+ \setbox\@ne\hbox to\columnwidth{\hss\kern-2\captionindent\box\@ne\hss}%
+ \else % tempboxa contained more than one line
+ \setbox\@ne\vbox{\unvbox\@tempboxa\parskip\z@skip
+ \noindent\unhbox\@ne\advance\hsize-2\captionindent\par}%
+ \fi
+ \ifnum\@tempcnta<64 % if the float IS a figure...
+ \addvspace\abovecaptionskip
+ \hbox to\hsize{\kern\captionindent\box\@ne\hss}%
+ \else % if the float IS NOT a figure...
+ \hbox to\hsize{\kern\captionindent\box\@ne\hss}%
+ \nobreak
+ \vskip\belowcaptionskip
+ \fi
+ \relax
+ }}
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % smfart|smfbook [1999/11/15 v1.2f Classe LaTeX pour les articles publies par la SMF]
+ \long\def\@makecaption#1#2{%
+ \ifdim\captionindent>.1\hsize \captionindent.1\hsize \fi
+ \setbox\@tempboxa\vbox{\color@setgroup
+ \advance\hsize-2\captionindent\noindent
+ \@captionfont\@captionheadfont#1\@xp\@ifnotempty\@xp
+ {\@cdr#2\@nil}{\@addpunct{.}\@captionfont\upshape\enspace#2}%
+ \unskip\kern-2\captionindent\par
+ \global\setbox\@ne\lastbox\color@endgroup}%
+ \ifhbox\@ne % the normal case
+ \setbox\@ne\hbox{\unhbox\@ne\unskip\unskip\unpenalty\unkern}%
+ \fi
+ \ifdim\wd\@tempboxa=\z@ % this means caption will fit on one line
+ \setbox\@ne\hbox to\columnwidth{\hss\kern-2\captionindent\box\@ne\hss}%
+ \@tempdima\wd\@ne\advance\@tempdima-\captionindent
+ \wd\@ne\@tempdima
+ \else % tempboxa contained more than one line
+ \setbox\@ne\vbox{\rightskip=0pt plus\captionindent\relax
+ \unvbox\@tempboxa\parskip\z@skip
+ \noindent\unhbox\@ne\advance\hsize-2\captionindent\par}%
+ \fi
+ \ifnum\@tempcnta<64 % if the float IS a figure...
+ \addvspace\abovecaptionskip
+ \noindent\kern\captionindent\box\@ne
+ \else % if the float IS NOT a figure...
+ \noindent\kern\captionindent\box\@ne
+ \nobreak
+ \vskip\belowcaptionskip
+ \fi
+ \relax
+ }}
+% \end{macrocode}
+% \begin{macrocode}
+ \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
+ \caption@ifundefined\smf@makecaption{}{,maxmargin=.1\linewidth}}}
+ \@tempa
+ \caption@g@addto@list\caption@sls@default{margin*=.5\captionmargin}
+ \DeclareCaptionLabelSeparator{default}{.\enspace}
+ \DeclareCaptionDefaultFont{font}{\@captionfont}
+ \DeclareCaptionDefaultFont{labelfont}{\@captionheadfont}
+ \DeclareCaptionDefaultFont{textfont}{\@captionfont\upshape}
+ \captionsetup[figure]{position=b}
+ \captionsetup[table]{position=t}
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection{The beamer class (Part one)}
+% \changes{v1.1}{2007/03/10}{\package{beamer} class support added}
+% \changes{v1.3}{2011/08/06}{\package{beamer} class support revised}
+% \changes{v1.5}{2013/04/27}{The \package{beamer} template \texttt{caption label separator} will be used now}
+% \changes{v1.7}{2016/05/22}{Re-definition of label format \texttt{simpleMagyar} added to \package{beamer} class support}
+% \changes{v1.7}{2018/04/15}{Re-definition of label format \texttt{simpleMagyar} revised}
+% \changes{v1.7}{2018/05/01}{Definition of \package{beamer} default label font revised}
+%
+% \begin{macro}{\caption@ifbeamerclass}
+% \begin{macrocode}
+\providecommand*\caption@ifbeamerclass{%
+ \@ifclassloaded{beamer}\@firstofone\@gobble}
+\@onlypreamble\caption@ifbeamerclass
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@ifbeamerclass{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\beamer@makecaption{%
+ % beamerbaselocalstructure.sty,v 1.53 2007/01/28 20:48:21 tantau
+ \long\def\beamer@makecaption#1#2{%
+ \def\insertcaptionname{\csname#1name\endcsname}%
+ \def\insertcaptionnumber{\csname the#1\endcsname}%
+ \def\insertcaption{#2}%
+ \nobreak\vskip\abovecaptionskip\nobreak
+ \sbox\@tempboxa{\usebeamertemplate**{caption}}%
+ \ifdim \wd\@tempboxa >\hsize
+ \usebeamertemplate**{caption}\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \nobreak\vskip\belowcaptionskip\nobreak}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@ifbeamertemplate}
+% |\caption@ifbeamertemplate|\marg{caption template name}\marg{yes-code}\marg{no-code}\\
+% tests if the given beamer caption template was selected by the user (or not).
+% \begin{macrocode}
+ \newcommand*\caption@ifbeamertemplate[1]{%
+ \begingroup
+ \let\beamer@@tmpl@caption@ORI\beamer@@tmpl@caption
+ \@nameuse{beamer@@tmpop@caption@#1}%
+ \ifx\beamer@@tmpl@caption@ORI\beamer@@tmpl@caption
+ \endgroup\expandafter\@firstoftwo
+ \else
+ \endgroup\expandafter\@secondoftwo
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \DeclareCaptionLabelFormat{default}{%
+ \caption@ifbeamertemplate{numbered}%
+ \caption@lfmt@simple
+ \caption@lfmt@unnumbered
+ {#1}{#2}}
+% \end{macrocode}
+% The \package{magyar} babel package redefines the current label format to a one called |simple|\-|Magyar|,
+% defined within |\@@magyar@caption|\-|fix| which will be executed |\At|\-|Begin|\-|Document|.
+% \begin{macrocode}
+ \DeclareCaptionLabelFormat{default@magyar}{%
+ \caption@ifbeamertemplate{numbered}%
+ \caption@lfmt@simple@magyar
+ \caption@lfmt@unnumbered
+ {#1}{#2}}
+ \@ifundefined{@@magyar@captionfix}\AtBeginDocument\@firstofone{%
+ \@ifundefined{@@magyar@captionfix}{}{%
+ \g@addto@macro\@@magyar@captionfix{%
+ \let\caption@lfmt@simple@magyar\caption@lfmt@simpleMagyar
+ \let\caption@lfmt@simpleMagyar\caption@lfmt@default@magyar}}}
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@declarelabelseparator
+ {\caption@ifbeamertemplate{caption name own line}\@gobble\@firstofone}
+ {default}
+ {\caption@ifbeamertemplate{caption name own line}{\\}%
+ {\usebeamertemplate{caption label separator}}}
+ \DeclareCaptionDefaultFont{font}{%
+ \usebeamerfont*{caption}%
+ \usebeamercolor[fg]{caption}}
+ \DeclareCaptionDefaultFont{labelfont}{%
+ \setbeamercolor*{caption}{}% avoid setting "caption" color additionally
+ \usebeamercolor[fg]{caption name}%
+ \setbeamerfont*{caption}{}% avoid setting "caption" font additionally
+ \usebeamerfont{caption name}}
+ \DeclareCaptionDefaultJustification{\raggedright}
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareOption{beamerclass}{%
+ \renewcommand\caption@ifslc{%
+ \caption@ifbeamertemplate{caption name own line}\@secondoftwo\@firstoftwo}
+ % Since the beamer class do not offer a `list of figures' we switch this support off.
+ \captionsetup{list=0}}
+ \PassOptionsToPackage{beamerclass}{caption3}
+% \end{macrocode}
+%
+% If the \package{beamer} document class is used, we offer a beamer
+% template called `caption3' which can be used with option `beamer' or
+% |\setbeamertemplate{caption}[caption3]|.\par
+% (Note that this is of no use when the \package{caption} package is used, too.)
+% \begin{macrocode}
+ \defbeamertemplate{caption}{caption3}{%
+ \caption@make\insertcaptionname\insertcaptionnumber\insertcaption}
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareOption{beamer}{%
+ % \usebeamertemplate**{caption} will set font
+ \DeclareCaptionDefaultFont{font}{}%
+ \setbeamertemplate{caption}[caption3]}
+% \end{macrocode}
+% \begin{macrocode}
+%
+% \begin{macrocode]
+}
+% \end{macrocode}
+%
+% \subsubsection{The KOMA-Script classes}
+% \changes{v1.1}{2007/03/31}{\KOMAScript\ classes support added}
+%
+% \begin{macro}{\caption@ifkomaclass}
+% \begin{macrocode}
+\providecommand*\caption@ifkomaclass{%
+ \caption@ifundefined\scr@caption\@gobble\@firstofone}
+\@onlypreamble\caption@ifkomaclass
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@ifkomaclass{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % scrartcl|scrreprt|scrbook [2007/03/07 v2.97a KOMA-Script document class]
+ \long\def\@makecaption#1#2{%
+ \if@captionabove
+ \vskip\belowcaptionskip
+ \else
+ \vskip\abovecaptionskip
+ \fi
+ \@@makecaption\@firstofone{#1}{#2}%
+ \if@captionabove
+ \vskip\abovecaptionskip
+ \else
+ \vskip\belowcaptionskip
+ \fi}}
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionFormat{default}[#1#2#3\par]{%
+ \ifdofullc@p
+ \caption@ifin@list\caption@lsepcrlist\caption@lsepname
+ {\caption@Error{%
+ The option `labelsep=\caption@lsepname' does not work\MessageBreak
+ with \noexpand\setcaphanging (which is set by default)}}%
+ {\caption@fmt@hang{#1}{#2}{#3}}%
+ \else
+ #1#2%
+ \ifdim\cap@indent<\z@
+ \par
+ \noindent\hspace*{-\cap@indent}%
+ \else\if@capbreak
+ \par
+ \fi\fi
+ #3\par
+ \fi}
+ \DeclareCaptionLabelSeparator{default}{\captionformat}
+ \DeclareCaptionDefaultFont{font}{\scr@fnt@caption}
+ \DeclareCaptionDefaultFont{labelfont}{\scr@fnt@captionlabel}
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection{The \NTG{} Dutch classes}
+% \changes{v1.1}{2007/04/06}{NTG classes support added}
+%
+% \begin{macro}{\caption@ifntgclass}
+% \begin{macrocode}
+\providecommand*\caption@ifntgclass{%
+ \caption@ifundefined\CaptionFonts\@gobble\@firstofone}
+\@onlypreamble\caption@ifntgclass
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@ifntgclass{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % artikel|rapport|boek [2004/06/07 v2.1a NTG LaTeX document class]
+ \long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{{\CaptionLabelFont#1:} \CaptionTextFont#2}%
+ \ifdim \wd\@tempboxa >\hsize
+ {\CaptionLabelFont#1:} \CaptionTextFont#2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}}
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionDefaultFont{labelfont}{\CaptionLabelFont}
+ \DeclareCaptionDefaultFont{textfont}{\CaptionTextFont}
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection{The thesis class}
+% \changes{v1.2a}{2008/01/31}{thesis class support added}
+% \changes{v1.2e}{2009/11/15}{Bugfix 09-11-14: thesis class support revised}
+%
+% \begin{macro}{\caption@ifthesisclass}
+% \begin{macrocode}
+\providecommand*\caption@ifthesisclass{%
+ \caption@ifundefined\cph@font
+ {\@gobble}%
+ {\caption@ifundefined\cpb@font\@gobble\@firstofone}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@ifthesisclass{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % thesis.cls 1996/25/01 1.0g LaTeX document class (wm).
+ \long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \setbox\@tempboxa\hbox{{\cph@font #1:} {\cpb@font #2}}%
+ \ifdim \wd\@tempboxa >\hsize
+ \@hangfrom{\cph@font #1: }{\cpb@font #2\par}%
+ \else
+ \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}}
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionDefaultFormat{hang}
+ \DeclareCaptionDefaultFont{labelfont}{\cph@font}
+ \DeclareCaptionDefaultFont{textfont}{\cpb@font}
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection{The arabic Babel option}
+% \changes{v1.8}{2018/05/20}{\package{arabic} babel package support added}
+%
+% \begin{macrocode}
+\caption@ifundefined\ArabiCoreLoaded{%
+% \end{macrocode}
+% \begin{macro}{\caption@rl}
+% \changes{v1.8}{2018/05/20}{This macro added}
+% \begin{macrocode}
+ \let\caption@rl\@firstofone
+}{%
+ \newcommand\caption@rl[1]{\if@rl\textRL{#1}\else\textLR{#1}\fi}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ \def\fnum@figure{\figurename\nobreakspace\thefigure}%
+ \def\fnum@table{\tablename\nobreakspace\thetable}%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionLabelSeparator{arabi}{ : }
+ \DeclareCaptionLabelSeparator{default}{%
+ \if@rl\caption@lsep@arabi\else\caption@lsep@colon\fi}
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % arabicore.sty [2006/01/01 v1.0 Arabi Core switching commands (may still change)]
+ \long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1: #2}%
+ \sbox\@Arabitempboxa{\textRL{#2} : #1}%
+ \if@rl{
+ \ifdim \wd\@Arabitempboxa >\hsize
+ \textRL{#2} : #1\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@Arabitempboxa\hfil}%
+ \fi}\else{
+ \ifdim \wd\@tempboxa >\hsize
+ #1: #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi}\fi
+ \vskip\belowcaptionskip}}
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection{The frenchb Babel option}
+% \changes{v1.1}{2006/05/14}{\package{frenchb} babel package support added}
+%
+% \begin{macrocode}
+\caption@ifundefined\FB@makecaption{}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % frenchb.ldf [2005/02/06 v1.6g French support from the babel system]
+ % frenchb.ldf [2007/10/05 v2.0e French support from the babel system]
+ \long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1\CaptionSeparator #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ #1\CaptionSeparator #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}}
+% \end{macrocode}
+% \begin{macrocode}
+ \ifx\@makecaption\STD@makecaption
+ \DeclareCaptionLabelSeparator{default}{\CaptionSeparator}
+ \def\caption@frenchb{% supress frenchb warning
+ \let\STD@makecaption\@makecaption
+ \let\FB@makecaption\@makecaption}
+ \else
+ \ifx\@makecaption\@undefined\else
+ \caption@InfoNoLine{%
+ The definition of \protect\@makecaption\space
+ has been changed,\MessageBreak
+ frenchb will NOT customize it}%
+ \fi
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection{The frenchle/pro package}
+% \changes{v1.1}{2006/05/14}{\package{frenchle/pro} package support added}
+%
+% \begin{macrocode}
+\caption@ifundefined\frenchTeXmods{}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % french(le).sty [2006/10/03 The french(le) package /V5,9991/]
+ % french(le).sty [2007/06/28 The french(le) package /V5,9994/]
+ \def\@makecaption#1#2{%
+ \ifFTY%
+ \def\@secondofmany##1##2\void{##2}%
+ \def\@tempa{\@secondofmany#2\void}%
+ \ifx\@tempa\empty%
+ \let\captionseparator\empty%
+ \fi%
+ \@mcORI{#1}{\relax\captionfont{#2}}%
+ \else
+ \@mcORI{#1}{#2}%
+ \fi}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % french(le).sty [2007/02/11 The french(le) package /V5,9993/]
+ \def\@makecaption#1#2{%
+ \ifFTY%
+ \def\@secondofmany##1##2\void{##2}%
+ \protected@edef\@tempa{\@secondofmany#2\void}%
+ \ifx\@tempa\empty%
+ \let\captionseparator\empty%
+ \fi%
+ \@mcORI{#1}{\relax\captionfont{#2}}%
+ \else
+ \@mcORI{#1}{#2}%
+ \fi}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionDefaultFont{textfont}{\itshape}%
+ \DeclareCaptionLabelSeparator{default}{\captionseparator\space}%
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection{The hebrew Babel option}
+% \changes{v1.8}{2018/08/26}{\package{hebrew} package support added}
+%
+% \begin{macrocode}
+ \caption@CheckCommand\@makecaption{%
+ % rlbabel.def [2005/03/30 v2.3h Right-to-Left support from the babel system Hebrew language support from the babel system]
+ \long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip%
+ \begin{center}%
+ #1: #2%
+ \end{center} \par%
+ \vskip\belowcaptionskip}}%
+% \end{macrocode}
+%
+% \subsubsection{The hungarian and magyar Babel option}
+% \changes{v1.3}{2009/03/29}{\package{magyar} package support added}
+% \changes{v1.3a}{2011/08/12}{\package{magyar} package support revised}
+% \changes{v1.8b}{2018/08/26}{\package{magyar} package support revised}
+%
+% \begin{macrocode}
+\DeclareCaptionListFormat{subperiod}{#2.}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\caption@ifundefined\hunnewlabel{}{%
+ \caption@CheckCommand\@makecaption{%
+ % magyar.ldf [2005/03/30 v1.4j Magyar support from the babel system]
+ \def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1. #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ {#1. #2\csname par\endcsname}
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\caption@tempa#1{%
+ \@ifpackagewith{babel}{#1}{%
+ \caption@InfoNoLine{#1 babel option is loaded}%
+ \expandafter\addto\csname extras#1\endcsname{%
+ % change default labelsep and listformat
+ \caption@setdefaultlabelsep{period}%
+ \caption@setdefaultlistformat{subperiod}}%
+ \expandafter\addto\csname noextras#1\endcsname{%
+ % change default labelsep and listformat
+ \caption@setdefaultlabelsep{colon}%
+ \caption@setdefaultlistformat{subsimple}}%
+ }{}}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@tempa{hungarian}
+\caption@tempa{magyar}
+% \end{macrocode}
+%
+% TODO: babel-latvian/latvian.ldf
+%
+% \subsubsection{Unknown document class (or package)}
+% \changes{v1.1}{2007/04/10}{Check of document class added}
+%
+% \begin{macrocode}
+\caption@IfCheckCommand{%
+ \caption@setbool{documentclass}{1}%
+}{%
+ \caption@setbool{documentclass}{0}%
+ \caption@InfoNoLine{%
+ Unknown document class (or package),\MessageBreak
+ standard defaults will be used}%
+ \caption@Debug{\string\@makecaption\space=\space\meaning\@makecaption\@gobble}%
+}
+% \end{macrocode}
+%
+% \subsection{Execution of options}
+%
+% \begin{macrocode}
+\captionsetup{style=default,position=default,%
+ list,listformat=default,twoside=\if@twoside 1\else 0\fi}
+% \end{macrocode}
+% \begin{macrocode}
+\ProcessOptions*
+% \end{macrocode}
+%
+% \subsection{Making an `List of' entry}
+%
+% \begin{macro}{\caption@addcontentsline}
+% \changes{v1.1}{2007/07/01}{This macro added}
+% \changes{v1.3}{2010/10/26}{Error check added}
+% \changes{v1.3}{2011/06/24}{Split into two macros}
+% \changes{v1.4}{2011/08/19}{Split into three macros}
+% \changes{v1.4}{2011/08/30}{Support for option \opt{listtype=} added}
+% \changes{v1.5}{2012/01/15}{Usage of \cs{caption@addsubcontentslines} added}
+% \changes{v1.7}{2015/09/15}{Argument \#3 which holds the environment name added to \cs{caption@lstfmt}}
+% \changes{v1.7}{2015/09/20}{Unfortunately \package{subfig} defines and uses \cs{caption@lstfmt} as well, so I replaced the third argument with \cs{captionlisttype}}
+% \changes{v1.8}{2018/09/06}{Adapted to the \package{chkfloat} package}
+% |\caption@addcontentsline|\marg{type}\marg{list entry}\par
+% Makes an entry in the list-of-whatever, if requested,
+% i.e.~the argument \meta{list entry} is not empty and
+% |listof=| was set to |true|.
+% \begin{macrocode}
+\newcommand\caption@addcontentsline[2]{%
+ \caption@ifcontentsline{#2}{%
+ \begingroup
+ \let\@tempa\@gobble
+ \caption@ifundefined\caption@listtype
+ {\edef\caption@listtype{#1}}%
+ {\let\@tempa\@firstofone}%
+ \caption@ifundefined\caption@listtype@ext
+ {}%
+ {\edef\caption@listtype{\caption@listtype\caption@listtype@ext}%
+ \let\@tempa\@firstofone}%
+ \@tempa
+ {\caption@Debug{addcontentsline: #1 => \caption@listtype}%
+% \caption@setoptions\caption@listtype
+ \@namedef{the\caption@listtype}{\@nameuse{the#1}}}%
+ \expandafter\caption@@addcontentsline\expandafter{\caption@listtype}{#2}%
+ \endgroup}%
+ \caption@addsubcontentslines{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@@addcontentsline[2]{%
+ {\let\\\space
+ \@ifundefined{ext@#1}%
+ {\caption@Error{No float type '#1' defined}}%
+ {\def\captionlisttype{#1}%
+ \caption@add@contentsline
+ {\csname ext@#1\endcsname}%
+ {#1}%
+ {\caption@lstfmt{\@nameuse{p@#1}}{\@nameuse{the#1}}}%
+ {\ignorespaces #2}%
+ \caption@chkfloat{#1}{#2}}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@add@contentsline{%
+ \caption@@@addcontentsline}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@addcontentsline[4]{%
+% \caption@ifundefined\main@Arabi@language{}%
+% {\addtocontents{#1}{\xstring\select@language{\main@Arabi@language}}}%
+ \addcontentsline{#1}{#2}{\protect\numberline{#3}{#4}}}
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@chkfloat\@gobbletwo
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@ifcontentsline[1]{%
+ \caption@iflist
+ {\def\@tempa{#1}}%
+ {\let\@tempa\@empty}%
+ \ifx\@tempa\@empty
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@addsubcontentslines[1]{}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Typesetting the caption}
+%
+% \begin{macro}{\ifcaption@star}
+% If the starred form of |\caption| is used, this will be set to |true|.
+% (It will be reset to |false| at the end of |\caption@@make|.)
+% \begin{macrocode}
+\newif\ifcaption@star
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@fnum}
+% \changes{v1.1}{2007/08/21}{This macro added}
+% |\caption@fnum|\marg{float type}\par
+% Typesets the caption label; as replacement for |\fnum@|\meta{float type}.
+% \begin{macrocode}
+\newcommand*\caption@fnum[1]{\caption@lfmt{\@nameuse{#1name}}{\@nameuse{the#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@make}
+% |\caption@make|\marg{float name}\marg{ref.\ number}\marg{text}\par
+% Typesets the caption.
+% \begin{macrocode}
+\newcommand\caption@make[2]{\caption@@make{\caption@lfmt{#1}{#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@make}
+% \changes{v1.0b}{2004/05/16}{Bugfix 04-05-05: \cs{ifdim}\cs{captionindent=}\cs{z@} added}
+% \changes{v1.0c}{2005/02/12}{Bugfix 04-10-26: Use \cs{@tempdima} instead of
+% \cs{captionmargin} resp. \cs{captionwidth}; check for \cs{z@} added}
+% \changes{v1.0c}{2005/02/12}{Bugfix: \cs{hskip}\cs{captionmargin} to the end
+% of caption added}
+% \changes{v1.0c}{2005/02/12}{Bugfix: \cs{strut} moved from here to \cs{caption@@@make}}
+% \changes{v1.0c}{2005/02/12}{Single-line-check moved up so it can affect margins now}
+% \changes{v1.0c}{2005/02/09}{Improvement: \cs{caption@ifh} added}
+% \changes{v1.0c}{2005/02/09}{Bugfix: \cs{leavevmode} added}
+% \changes{v1.0f}{2005/08/24}{Uses \cs{sbox} instead of \cs{setbox} in single-line-check}
+% \changes{v1.0g}{2005/12/04}{Uses \cs{caption@slc} now}
+% \changes{v1.0g}{2006/01/11}{Bugfix: \cs{caption@calcmargin} inside
+% single-line-check replaced by \cs{relax}}
+% \changes{v1.0g}{2006/01/11}{Bugfix: \cs{caption@startbox} will always be
+% typeset in horizontal mode}
+% \changes{v1.0i}{2006/05/13}{Uses \cs{caption@parbox} instead of \cs{caption@start/endbox}}
+% \changes{v1.0j}{2007/01/04}{Oops, bugfix 04-05-05 got lost in v1.0h, re-added}
+% \changes{v1.0n}{2007/04/03}{Usage of \cs{caption@ifoddpage} added}
+% \changes{v1.1}{2007/07/29}{\cs{caption@calcmargin} moved below single-line-check}
+% \changes{v1.1e}{2007/10/28}{\cs{caption@stepcounter} added}
+% \changes{v1.5}{2012/03/15}{Uses \cs{caption@tempdima} instead of \cs{@tempdima}}
+% \changes{v1.5}{2012/12/26}{max-margin stuff moved to \cs{caption@calcmargin}}
+% \changes{v1.6}{2013/05/01}{Usage of \cs{caption@box} added}
+% \changes{v1.7}{2016/01/31}{Adapted to the \package{bicaption} package}
+% |\caption@@make|\marg{caption label}\marg{caption text}
+% \begin{macrocode}
+\newcommand\caption@@make[2]{%
+ \begingroup
+ \caption@@make@{#1}{#2}%
+ \endgroup
+ \caption@@make@epilogue}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@@make@[2]{%
+ \caption@stepthecounter
+ \caption@beginhook
+% \end{macrocode}
+%
+% Typeset the outer box |\caption@box|
+% \begin{macrocode}
+ \caption@box\linewidth{%
+% \end{macrocode}
+%
+% Special single-line treatment (option |singlelinecheck=|)
+% \begin{macrocode}
+ \caption@ifslc{\caption@slc{#1}{#2}\caption@singleline\relax}{}%
+% \end{macrocode}
+%
+% Typeset the left margin (option |margin=|)
+% \begin{macrocode}
+ \caption@calcmargin
+ \caption@tempdima\captionmargin
+ \ifdim\captionmargin@=\z@ \else
+ \caption@ifoddpage{}{\advance\caption@tempdima\captionmargin@}%
+ \fi
+ \caption@ifh{\advance\caption@tempdima\caption@indent}%
+ \hspace\caption@tempdima
+% \end{macrocode}
+%
+% We actually use a |\vbox| of width |\captionwidth - \caption@indent|
+% to typeset the caption.
+% \Note{\cs{captionindent} is \emph{not} supported if the caption format
+% was defined with \cs{DeclareCaptionFormat*}.}
+% \begin{macrocode}
+ \caption@tempdima\captionwidth
+ \caption@ifh{\advance\caption@tempdima-\caption@indent}%
+ \caption@parbox\caption@tempdima{%
+% \end{macrocode}
+%
+% Typeset the indention (option |indention=|)\\
+% {\small Bugfix 04-05-05:
+% |\hskip-\caption@indent| replaced by |\ifdim\caption@indent=\z@|\ldots}
+% \begin{macrocode}
+ \caption@ifh{%
+ \ifdim\caption@indent=\z@
+ \leavevmode
+ \else
+ \hskip-\caption@indent
+ \fi}%
+% \end{macrocode}
+%
+% Typeset the caption itself and close the |\caption@parbox|
+% \begin{macrocode}
+ \caption@@@make{#1}{#2}}%
+% \end{macrocode}
+%
+% Typeset the right margin (option |margin=|)
+% \begin{macrocode}
+ \caption@tempdima\captionmargin
+ \ifdim\captionmargin@=\z@ \else
+ \caption@ifoddpage{\advance\caption@tempdima\captionmargin@}{}%
+ \fi
+ \hspace\caption@tempdima
+% \end{macrocode}
+%
+% Close the outer box |\caption@box|
+% \begin{macrocode}
+ }%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@endhook}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@@make@epilogue{%
+ \global\caption@starfalse}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@calcmargin}
+% \changes{v1.0f}{2005/10/24}{Internal: \cs{ifcaption@width} replaced by
+% \cs{ifdim}\cs{captionwidth=}\cs{z@}}
+% \changes{v1.0g}{2006/01/12}{Improvement: Takes care of list environment now}
+% \changes{v1.1}{2006/05/13}{Check of \cs{@listdepth} removed (not necessary anymore),
+% use \cs{linewidth} instead of \cs{hsize}}
+% \changes{v1.5}{2012/12/26}{max-margin stuff moved from \cs{caption@@make} to here}
+% |\caption@calcmargin|\par
+% Calculate |\captionmargin| \& |\captionwidth|, so both contain valid
+% values.
+% \begin{macrocode}
+\newcommand*\caption@calcmargin{%
+ \caption@calcmargin@hook
+% \end{macrocode}
+% Check margin, if |\caption@minmargin| or |\caption@maxmargin| is set
+% \begin{macrocode}
+ \ifx\caption@maxmargin\@undefined \else
+ \ifdim\captionmargin>\caption@maxmargin\relax
+ \captionmargin\caption@maxmargin\relax
+ \fi
+ \fi
+ \ifx\caption@minmargin\@undefined \else
+ \ifdim\captionmargin<\caption@minmargin\relax
+ \captionmargin\caption@minmargin\relax
+ \fi
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \ifdim\captionwidth=\z@
+ \captionwidth\linewidth
+ \advance\captionwidth by -2\captionmargin
+ \advance\captionwidth by -\captionmargin@
+ \else
+ \captionmargin\linewidth
+ \advance\captionmargin by -\captionwidth
+ \divide\captionmargin by 2
+ \captionmargin@\z@
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@Debug{%
+ \string\hsize=\the\hsize,
+ \string\linewidth=\the\linewidth,\MessageBreak
+ \string\leftmargin=\the\leftmargin,
+ \string\rightmargin=\the\rightmargin,\MessageBreak
+ \string\margin=\the\captionmargin,
+ \string\margin@=\the\captionmargin@,
+ \string\width=\the\captionwidth}%
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@slc}
+% \changes{v1.1}{2007/06/13}{\cs{let}\cs{caption@hj}\cs{relax} added}
+% \changes{v1.1}{2007/07/29}{\cs{caption@setup}\cs{caption@sls} added after \cs{begingroup}}
+% \changes{v1.1}{2007/07/29}{\cs{caption@calcmargin} added}
+% \changes{v1.1c}{2007/10/14}{Support of \cs{caption@slfmt} added}
+% \changes{v1.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency}
+% \changes{v1.3}{2010/09/04}{Split into \cs{caption@slc} and \cs{caption@@slc}}
+% \changes{v1.5}{2012/12/26}{Merged into a single macro again}
+% \changes{v1.5}{2013/04/14}{Definition and usage of \cs{ifsinglelinecaption} added}
+% |\caption@slc|\marg{label}\marg{text}\marg{single-line-code}\marg{multi-line-code}\par
+% This one does the single-line-check.
+% \begin{macrocode}
+\newcommand\caption@slc[4]{%
+ \caption@Debug{Begin SLC}%
+ \singlelinecaptiontrue
+ \begingroup
+ \caption@singleline
+ \let\caption@hj\@empty
+ \caption@calcmargin % calculate \captionwidth
+ \caption@prepareslc
+ \sbox\@tempboxa{\caption@@@make{#1}{#2}}%
+ \ifdim\wd\@tempboxa>\captionwidth
+ \endgroup
+ \singlelinecaptionfalse
+ #4%
+ \else
+ \endgroup
+ #3%
+ \fi
+ \caption@Debug{End SLC}}
+% \end{macrocode}
+% \begin{macrocode}
+\newif\ifsinglelinecaption
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@singleline{%
+ \caption@xsetup\caption@opt@singleline
+ \let\caption@fmt\caption@slfmt}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@prepareslc}
+% \changes{v1.0b}{2004/05/16}{Bugfix: Redefinition of \cs{label} \& \cs{@footnotetext} added}
+% \changes{v1.0b}{2004/05/16}{Redefine \cs{stepcounter} instead of \cs{footnote(mark)}}
+% \changes{v1.0c}{2005/02/12}{\cs{let}\cs{caption@hj}\cs{relax} added}
+% \changes{v1.0f}{2005/07/09}{Support of \package{endnotes} package added}
+% \changes{v1.1}{2007/06/13}{\cs{let}\cs{caption@hj}\cs{relax} moved to \cs{caption@slc}}
+% \changes{v1.1}{2007/06/13}{Redefinition of \cs{(H@)refstepcounter} added}
+% \changes{v1.1}{2007/08/12}{Redefinition of \cs{label} improved}
+% \changes{v1.1c}{2007/10/06}{Definition of \cs{caption@l@stepcounter} added}
+% \changes{v1.3}{2011/07/07}{Bugfix 11-07-06: Redefinition of \cs{footnote} and \cs{footnotemark} added, redefinition of \cs{stepcounter} and \cs{refstepcounter} dropped}
+% \changes{v1.4a}{2011/10/21}{Redefinition of \cs{pagenote} from \textsf{memoir} document class added}
+% \changes{v1.4a}{2011/10/22}{Redefinition of \cs{footnote} revised}
+% \changes{v1.5}{2013/04/13}{Redefinition os \cs{glsunset} added}
+% \changes{v1.8}{2018/01/21}{Redefinition of \cs{endnote} added (thanks to Markus Kohm)}
+% \changes{v1.8}{2018/05/16}{Redefinition of \cs{acused} added}
+% \changes{v1.8}{2018/05/26}{Definition method changed so it can be pre-defined by other packages}
+% \changes{v1.8}{2018/05/27}{Redefinition of \cs{hypertarget} added}
+% |\caption@prepareslc|\par
+% Re-define anything which would disturb the single-line-check.
+% \begin{macrocode}
+\@ifundefined{caption@prepareslc}\def\g@addto@macro\caption@prepareslc{%
+ \let\label\caption@gobble
+ \let\hypertarget\@gobbletwo
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@footnotemark@ORI\footnotemark
+ \def\footnote{\caption@withoptargs\caption@footnote}%
+ \def\footnotemark{\caption@withoptargs\caption@footnotemark}%
+ \let\@footnotetext\caption@gobble
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@endnotemark@ORI\endnotemark
+ \def\endnote{\caption@withoptargs\caption@endnote}%
+ \def\endnotemark{\caption@withoptargs\caption@endnotemark}%
+ \let\@endnotetext\caption@gobble
+% \end{macrocode}
+% \begin{macrocode}
+ \let\pagenote\caption@gobble
+% \end{macrocode}
+% Adaption to the \package{acronym} package.\par
+% See also \url{https://tex.stackexchange.com/questions/428788}
+% \begin{macrocode}
+ \let\acused\@gobble
+ \let\AC@placelabel\@gobble
+% \end{macrocode}
+% Adaption to the \package{glossaries} package.\par
+% Please note that while this adaption is usually sufficient
+% it could give incorrect measuring results if \cs{gls} is both used
+% for the very first time and more than once (for a particular acronym).
+% The alternative would be using internal macros of the
+% \package{glossaries} package which I would like to avoid.\par
+% See also \url{https://tex.stackexchange.com/questions/108368}
+% \begin{macrocode}
+ \let\glsunset\@gobble
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@footnote[2]{%
+ \caption@footnotemark{#1}}
+\newcommand\caption@footnotemark[1]{%
+ \begingroup
+ \let\stepcounter\caption@l@stepcounter
+ \caption@footnotemark@ORI#1%
+ \endgroup}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@endnote[2]{%
+ \caption@endnotemark{#1}}
+\newcommand\caption@endnotemark[1]{%
+ \begingroup
+ \let\stepcounter\caption@l@stepcounter
+ \caption@endnotemark@ORI#1
+ \endgroup}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@l@stepcounter[1]{%
+ \advance\csname c@#1\endcsname\@ne\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@applyfont}
+% \changes{v1.3}{2010/09/04}{This macro added}
+% |\caption@applyfont|\par
+% This macro executes the font relevant macros, i.e. by default
+% the options set by |justification=|, |font=|, and |size=|.
+% \begin{macrocode}
+\newcommand*\caption@applyfont{%
+ \caption@hj\captionfont\captionsize}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@@make}
+% \changes{v1.0b}{2004/05/16}{Bugfix 04-05-06: \cs{allowhyphens} added}
+% \changes{v1.0c}{2005/02/12}{Bugfix 04-12-16: Use some kind of
+% \cs{@startstrut}\cs{strutbox} instead of \cs{strut}}
+% \changes{v1.0c}{2005/02/12}{Bugfix 05-01-23: \cs{@finalstrut}\cs{strutbox} added}
+% \changes{v1.0d}{2005/05/05}{Use \cs{caption@ifempty};
+% \cs{let}\cs{caption@ifstrut}\cs{@secondoftwo} added}
+% \changes{v1.0d}{2005/05/05}{Bugfix: Handling of \cs{ifcaption@star} changed}
+% \changes{v1.0f}{2005/08/24}{Check for empty label added}
+% \changes{v1.0f}{2005/08/25}{\cs{caption@iflf} added}
+% \changes{v1.0j}{2007/02/18}{Usage of \cs{caption@tfmt} added}
+% \changes{v1.1}{2007/05/07}{Bugfix: \cs{ifhmode} added to \cs{@finalstrut}}
+% \changes{v1.2}{2007/11/17}{Made option \opt{size=} stronger than \opt{font=}}
+% \changes{v1.3}{2010/09/04}{Uses \cs{caption@applyfont} now}
+% \changes{v1.3}{2010/11/01}{Bugfix: If the caption text is empty, the text format will be set to \opt{simple} now}
+% \changes{v1.7}{2016/02/01}{Bugfix: \cs{relax} added before \cs{caption@lsep} so the label separator
+% will not be gobbled if the label font command ignores spaces, e.g. by usage of \cs{color}}
+% \changes{v1.8}{2018/09/12}{\cs{par} replaced by \cs{captiontextend}}
+% |\caption@@@make|\marg{caption label}\marg{caption text}\par
+% This one finally typesets the caption paragraph, without margin and indention.
+% \begin{macrocode}
+\newcommand\caption@@@make[2]{%
+% \end{macrocode}
+%
+% If the label is empty, we use no caption label separator.
+% \begin{macrocode}
+ \sbox\@tempboxa{#1}%
+ \ifdim\wd\@tempboxa=\z@
+ \let\caption@lsep\relax
+% \@capbreakfalse
+ \fi
+% \end{macrocode}
+%
+% If the text is empty, we use no caption label separator, too.
+% (And no text format either.)
+% \begin{macrocode}
+ \caption@ifempty{#2}{%
+ \let\caption@lsep\@empty
+ \let\caption@tfmt\@firstofone
+% \@capbreakfalse
+% \let\caption@ifstrut\@secondoftwo
+ }%
+% \end{macrocode}
+%
+% Take care that |\caption@parindent| and |\caption@hangindent| will be used
+% to typeset the paragraph.
+% \begin{macrocode}
+ \@setpar{\@@par\caption@@par}\caption@@par
+% \end{macrocode}
+%
+% Finally typeset the caption.
+% \begin{macrocode}
+ \caption@applyfont
+ \caption@fmt
+ {\ifcaption@star\else
+ \begingroup
+ \captionlabelfont
+ #1%
+ \endgroup
+ \fi}%
+ {\ifcaption@star\else
+ \begingroup
+ \caption@iflf\captionlabelfont
+ \relax\caption@lsep
+ \endgroup
+ \fi}%
+ {{\captiontextfont
+ \captiontextstart
+ \caption@ifstrut
+ {\vrule\@height\ht\strutbox\@width\z@}%
+ {}%
+ \nobreak\hskip\z@skip % enable hyphenation
+ \caption@tfmt{#2}%
+% \caption@ifstrut{\vrule\@height\z@\@depth\dp\strutbox\@width\z@}{}%
+ \caption@ifstrut
+ {\ifhmode\@finalstrut\strutbox\fi}%
+ {}%
+ \captiontextend}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\captiontextstart{}
+\newcommand*\captiontextend{\par}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifempty}
+% \changes{v1.0d}{2005/05/05}{This macro added}
+% \changes{v1.1}{2007/07/04}{Re-defines itself now}
+% \changes{v1.2a}{2007/01/22}{Revised so \cs{label} will be detected, too}
+% \changes{v1.2b}{2008/08/02}{Revised so \cs{index} and \cs{glossary} will be detected, too}
+% |\caption@ifempty|\marg{text}\marg{true} (\emph{no} \meta{false})\par
+% This one tests if the \meta{text} is actually empty.
+% \Note{This will be done without expanding the text,
+% therefore this is far away from being bullet-proof.}
+% \Note{This macro is re-defining itself so only
+% the first test (in a group) will actually be done.}
+% \begin{macrocode}
+\newcommand\caption@ifempty[1]{%
+ \caption@if@empty{#1}%
+ \caption@ifempty\@unused}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@if@empty[1]{%
+ \def\caption@tempa{#1}%
+ \ifx\caption@tempa\@empty
+ \let\caption@ifempty\@secondoftwo
+ \else
+ \expandafter\def\expandafter\caption@tempa\expandafter{%
+ \caption@car#1\caption@if@empty\caption@nil}%
+ \def\caption@tempb{\caption@if@empty}%
+ \ifx\caption@tempa\caption@tempb
+ \let\caption@ifempty\@secondoftwo
+ \else
+ \def\caption@tempb{\ignorespaces}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\caption@if@empty\expandafter{\@gobble#1}%
+ \else
+ \def\caption@tempb{\label}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
+ \else
+ \def\caption@tempb{\index}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
+ \else
+ \def\caption@tempb{\glossary}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
+ \else
+ \let\caption@ifempty\@gobbletwo
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@car#1#2\caption@nil{#1}% same as \@car, but \long
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@par}
+% \changes{v1.0f}{2005/08/22}{Made this definition global}
+% |\caption@@par|\par
+% This command will be executed with every |\par| inside the caption.
+% \begin{macrocode}
+\newcommand*\caption@@par{%
+ \parindent\caption@parindent\hangindent\caption@hangindent}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Types \& sub-types}
+%
+% \begin{macro}{\DeclareCaptionType}
+% \changes{v1.1}{2007/08/12}{This macro added}
+% \changes{v1.1a}{2007/09/07}{Three optional arguments added}
+% \changes{v1.2}{2007/12/06}{Renamed from \cs{DeclareFloatingEnvironment} to \cs{DeclareCaptionType}}
+% \changes{v1.2}{2007/12/21}{Optional argument revised, uses key-value syntax now}
+% \changes{v1.2b}{2008/04/13}{Uses \cs{caption@within@default} now}
+% \changes{v1.2b}{2008/08/02}{Support of \cs{float@exts} and \cs{float@addtolists} added}
+% \changes{v1.2e}{2010/01/09}{Usage of \cs{caption@DeclareWithinOption} added}
+% \changes{v1.3}{2011/08/06}{Definition of \cs{listofXXXes} added}
+% \changes{v1.4a}{2011/10/29}{Outsourced as \package{newfloat} package}
+% |\DeclareCaptionType|\oarg{options}\marg{environment}\oarg{name}\oarg{list name}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionType{%
+ \RequirePackage{newfloat}%
+ \DeclareFloatingEnvironment}
+\@onlypreamble\DeclareCaptionType
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ForEachType}
+% \changes{v1.4a}{2011/10/29}{This macro added}
+% |\caption@ForEachType|\marg{code}
+% will execute the given code for all (known) floating environments.
+% \begin{macrocode}
+\newcommand\caption@ForEachType[1]{%
+ \caption@ifundefined\ForEachFloatingEnvironment
+ {\def\@elt##1{#1}%
+ \caption@ifundefined\c@figure\@gobble\@elt{figure}%
+ \caption@ifundefined\c@table\@gobble\@elt{table}%
+ \let\@elt\relax
+ \newfloat@addtohook{#1}}%
+ {\ForEachFloatingEnvironment{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand\newfloat@addtohook[1]{%
+ \toks@=\expandafter{\newfloat@hook{##1}#1}%
+ \edef\@tempa{\def\noexpand\newfloat@hook####1{\the\toks@}}%
+ \@tempa}
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\newfloat@hook[1]{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionSubType}
+% \changes{v1.2}{2007/11/16}{This macro added}
+% \changes{v1.2a}{2008/03/11}{Bugfix: \cs{subfigurename} will be defined now}
+% \changes{v1.2d}{2009/10/09}{Bugfix 08-10-01: Usage of \cs{caption@addtoreset} added}
+% \changes{v1.3}{2011/01/01}{\cs{@dottedlofline} will be defined \& used now}
+% \changes{v1.4}{2011/10/09}{Support of the titletoc package added}
+% \changes{v1.5}{2011/12/29}{Usage of \cs{caption@addtoreset} replaced by \cs{@addtoreset}}
+% \changes{v1.5}{2013/01/10}{Bugfix: Definition of autoref string corrected}
+% \changes{v1.6}{2013/06/17}{Bugfix: \cs{c@tocdepth} will be set (locally) now}
+% |\DeclareCaptionSubType|\oarg{numbering scheme}\marg{type}\\
+% |\DeclareCaptionSubType*|\oarg{numbering scheme}\marg{type}\par
+% The starred variant provides the numbering format
+% \meta{type}|.|\meta{subtype} while the non-starred variant simply
+% uses \meta{subtype}.
+% \begin{macrocode}
+\newcommand*\DeclareCaptionSubType{%
+ \caption@teststar\caption@declaresubtype\@firstoftwo\@secondoftwo}
+\@onlypreamble\DeclareCaptionSubType
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declaresubtype[1]{%
+ \@testopt{\caption@@declaresubtype{#1}}{alph}}
+\@onlypreamble\caption@declaresubtype
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@declaresubtype#1[#2]#3{%
+ \@ifundefined{c@#3}%
+ {\caption@Error{No float type '#3' defined}}%
+% \end{macrocode}
+% \begin{macrocode}
+ {\@ifundefined{c@sub#3}%
+ {\caption@Debug{New subtype `sub#3'}%
+ \newcounter{sub#3}%
+ \@addtoreset{sub#3}{#3}%
+ \@namedef{ext@sub#3}{\csname ext@#3\endcsname}%
+ \caption@declaresublistentry{#3}%
+ \@cons\caption@subtypelist{{#3}}}%
+ {\caption@Debug{Modify caption `sub#3'}}%
+% \end{macrocode}
+% Support of \package{titletoc} package
+% \begin{macrocode}
+ \caption@ifundefined\contentsuse{}{%
+ \contentsuse{sub#3}{\csname ext@sub#3\endcsname}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \@namedef{sub#3name}{}%
+ \@namedef{sub#3autorefname}{\csname #3autorefname\endcsname}%
+ #1% is \@firstoftwo in star form, and \@secondoftwo otherwise
+ {\@namedef{p@sub#3}{}%
+ \@namedef{thesub#3}{\csname the#3\endcsname.\@nameuse{#2}{sub#3}}}%
+ {\@namedef{p@sub#3}{\csname the#3\endcsname}%
+ \@namedef{thesub#3}{\@nameuse{#2}{sub#3}}}%
+ \@namedef{theHsub#3}{\csname theH#3\endcsname.\arabic{sub#3}}%
+ }}
+% \end{macrocode}
+% \begin{macrocode}
+\@onlypreamble\caption@@declaresubtype
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declaresublistentry{%
+ \caption@ifundefined\l@chapter
+ {\caption@@declaresublistentry\l@subsubsection}%
+ {\caption@@declaresublistentry\l@subsection}}
+\@onlypreamble\caption@declaresublistentry
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@declaresublistentry[2]{%
+ \ifx#1\@undefined
+ \caption@@@declaresublistentry\relax\@dottedtocline\caption@nil{#2}%
+ \else
+ \expandafter\caption@@@declaresublistentry#1{}{}\@dottedtocline\caption@nil{#2}%
+ \fi}
+\@onlypreamble\caption@@declaresublistentry
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@@declaresublistentry#1\@dottedtocline#2\caption@nil#3{%
+ \def\@tempa{#1}%
+% Does \l@(sub)subsection start with \@dottedtocline?
+ \ifx\@tempa\@empty
+% Yes
+ \caption@@@@declaresublistentry{#3}#2\caption@nil
+ \else
+% No
+ \caption@@@@declaresublistentry{#3}@{3.8em}{3.2em}\caption@nil
+ \fi}
+\@onlypreamble\caption@@@declaresublistentry
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@@@declaresublistentry#1#2#3#4#5\caption@nil{%
+ \expandafter\caption@@@@@declaresublistentry\expandafter
+ {\csname @dotted\csname ext@#1\endcsname line\endcsname}{#1}{#3}{#4}}
+\@onlypreamble\caption@@@@declaresublistentry
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@@@declaresublistentry[4]{%
+ \@namedef{l@sub#2}{#1{2}{#3}{#4}}%
+ \expandafter\caption@@@@@@declaresublistentry
+ \expandafter#1\expandafter{\csname ext@#2\endcsname depth}}
+\@onlypreamble\caption@@@@@declaresublistentry
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@@@@declaresublistentry[2]{
+ \ifx#1\relax
+ \def#1##1{%
+ \def\next{\@dottedtocline{##1}}%
+ \@ifundefined{c@#2}{}{%
+ \ifnum ##1>\@nameuse{c@#2}\relax
+ \let\next\@gobblefour
+ \else
+ \c@tocdepth=\@nameuse{c@#2}\relax
+ \fi}%
+ \next}%
+ \fi}
+\@onlypreamble\caption@@@@@@declaresublistentry
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@subtypelist}
+% An \cs{@elt}-list containing the subtypes defined
+% with |\Declare|\-|Caption|\-|Sub|\-|Type|.
+% \begin{macrocode}
+\newcommand*\caption@subtypelist{}
+% \end{macrocode}
+% \end{macro}
+%
+% Unfortunately the \class{memoir} document class resets the
+% \texttt{subfigure} resp.~\texttt{subtable} counter at the begin
+% of floating environments, i.e.~at |\@float|.
+% As a side-effect |\Continued|\-|Float| does not work correctly.
+% For that reason we need to introduce macros to save and restore
+% all sub-caption counters here.
+%
+% \begin{macro}{\caption@restorecounters}
+% \changes{v1.5}{2013/05/01}{This macro added}
+% |\caption@restore|\-|counters| restores all counters saved with
+% |\caption@save|\-|counter|.
+% \begin{macrocode}
+\newcommand*\caption@restorecounters{%
+ \caption@restore@counters
+ \global\let\caption@restore@counters\@empty}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@restore@counters{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@savesubcounters}
+% \changes{v1.5}{2013/05/01}{This macro added}
+% |\caption@save|\-|sub|\-|counters| saves all sub-caption counters,
+% so they can be restored with |\caption@restore|\-|counters| later on.
+% \begin{macrocode}
+\newcommand*\caption@savesubcounters{%
+ \def\@elt##1{\caption@savecounter{sub##1}}%
+ \caption@subtypelist
+ \let\@elt\relax}%
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@savecounter[1]{%
+ \edef\caption@tempa{%
+ \noexpand\l@addto@macro\noexpand\caption@restore@counters
+ {\noexpand\setcounter{#1}{\number\value{#1}}}}%
+ \caption@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@For}
+% \changes{v1.1a}{2007/09/07}{This macro added}
+% \changes{v1.2}{2007/11/16}{Renamed from \cs{ForFloatingEnvironments} to \cs{caption@For}}
+% |\caption@For|\marg{elt-list}\marg{code with \#1}\\
+% |\caption@For*|\marg{elt-list}\marg{code with \#1}
+% \begin{macrocode}
+\newcommand*\caption@For{\caption@withoptargs\caption@@For}
+%\@onlypreamble\caption@For
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@@For[3]{%
+ \caption@AtBeginDocument#1{%
+ \def\@elt##1{#3}%
+ \@nameuse{caption@#2}%
+ \let\@elt\relax}}%
+%\@onlypreamble\caption@@For
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{subfig package adaptions}
+% \changes{v1.1}{2007/07/07}{Several adaptions to the \package{subfig} package added}
+% \changes{v1.4a}{2011/11/01}{Bugfix 11-11-01: Test for the \package{subfig} package revised}
+%
+% Since the \package{subfig} package is not maintained anymore,
+% we have to make several adaptions to \thispackage~\version{1.1} here.
+% Please note that we only support the version $1.3$ of the \package{subfig} package here.
+% So older versions do not work with this version of \thispackage, and newer
+% versions are expected to be adapted.
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \def\@tempa{2005/06/28 ver: 1.3 subfig package}%
+ \expandafter\ifx\csname ver@subfig.sty\endcsname\@tempa
+ \caption@InfoNoLine{subfig package v1.3 is loaded}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@setfloattype\@gobble
+ \let\@dottedxxxline\sf@NEW@dottedxxxline
+ \let\sf@subfloat\sf@NEW@subfloat
+% \end{macrocode}
+% \begin{macrocode}
+ \fi
+ \let\sf@NEW@dottedxxxline\@undefined
+ \let\sf@NEW@subfloat\@undefined}
+% \end{macrocode}
+%
+% \begin{macro}{\@dottedxxxline}
+% New version of |\@dottedxxxline|
+% \begin{macrocode}
+\def\sf@NEW@dottedxxxline#1#2#3#4#5#6#7{%
+ \begingroup
+ \caption@setfloattype{#1}%
+ \caption@setoptions{subfloat}%
+ \caption@setoptions{sub#1}%
+ \ifnum #3>\@nameuse{c@#2depth}\else
+ \@dottedtocline{\z@}{#4}{#5}{#6}{#7}%
+ \fi
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\sf@subfloat}
+% \changes{v1.4b}{2011/12/29}{Bugfix 11-12-23: Usage of \cs{caption@warmup} added}
+% New version of |\sf@subfloat|
+% \begin{macrocode}
+\def\sf@NEW@subfloat{%
+ \begingroup
+ \@nameuse{caption@warmup}%
+ \caption@setfloattype\@captype
+ \sf@ifpositiontop{%
+ \maincaptiontoptrue
+ }{%
+ \maincaptiontopfalse
+ }%
+ \caption@setoptions{subfloat}%
+ \caption@setoptions{sub\@captype}%
+ \let\sf@oldlabel=\label
+ \let\label=\subfloat@label
+ \ifmaincaptiontop\else
+ \advance\@nameuse{c@\@captype}\@ne
+ \fi
+ \refstepcounter{sub\@captype}%
+ \setcounter{sub\@captype @save}{\value{sub\@captype}}%
+ \@ifnextchar [% %] match left bracket
+ {\sf@@subfloat}%
+ {\sf@@subfloat[\@empty]}}
+% \end{macrocode}
+% \end{macro}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \clearpage
+% \begin{thebibliography}{99}
+% \bibitem{TLC2}
+% Frank Mittelbach and Michel Goossens:\\
+% \newblock {\em The {\LaTeX} Companion (2nd.~Ed.)},\\
+% \newblock Addison-Wesley, 2004.
+%
+% \bibitem{Anne}
+% Anne Br\"uggemann-Klein:\\
+% \emph{Einf\"uhrung in die Dokumentverarbeitung},\\
+% B.G. Teubner, Stuttgart, 1989
+%
+% \bibitem{hyperref}
+% Sebastian Rahtz \& Heiko Oberdiek:\\
+% \href{http://www.ctan.org/pkg/hyperref}%
+% {\emph{Hypertext marks in \LaTeX}},\\
+% November 12, 2007
+%
+% \bibitem{refcount}
+% Heiko Oberdiek:\\
+% \href{http://www.ctan.org/pkg/refcount}%
+% {\emph{The refcount package}},\\
+% 2006/02/20
+%
+% \bibitem{threeparttable}
+% Donald Arseneau:\\
+% \href{http://www.ctan.org/pkg/threeparttable}%
+% {\emph{Three part tables: title, tabular environment, notes}},\\
+% 2003/06/13
+% \end{thebibliography}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/caption/fallback/v3.4/caption.dtx b/Master/texmf-dist/source/latex/caption/fallback/v3.4/caption.dtx
new file mode 100644
index 00000000000..2c9dc62be3b
--- /dev/null
+++ b/Master/texmf-dist/source/latex/caption/fallback/v3.4/caption.dtx
@@ -0,0 +1,4538 @@
+% \iffalse meta-comment
+%
+% This is file `caption.dtx'.
+%
+% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%
+% --------------------------------------------------------------------------
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Axel Sommerfeldt.
+%
+% This work consists of the files
+% caption.ins, caption.dtx, caption2.dtx, caption3.dtx,
+% bicaption.dtx, ltcaption.dtx, subcaption.dtx,
+% the derived files
+% caption.sty, caption2.sty, caption3.sty,
+% bicaption.sty, ltcaption.sty, subcaption.sty,
+% and the user manuals
+% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+%
+% \fi
+% \CheckSum{2986}
+%
+% \iffalse
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption.drv}[2015/09/16 v3.4 Implementation of the caption package]
+\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
+%\errorcontextlines=3
+%
+\documentclass{ltxdoc}
+\setlength\parindent{0pt}
+\setlength\parskip{\smallskipamount}
+%
+\makeatletter % make room for subsections like 2.16.14 in the TOC
+%\newcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
+\renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.7em}}
+\makeatother
+%
+\usepackage{ifpdf}
+\ifpdf
+ \usepackage{mathptmx,courier}
+ \usepackage[scaled=0.90]{helvet}
+ \addtolength\marginparwidth{15pt}
+\fi
+%
+\usepackage{hypdoc}
+\ifpdf\usepackage{hypdestopt}\fi
+\hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}}
+%
+\usepackage[debug]{caption}[2013/01/01]
+%
+\DeclareRobustCommand*\eTeX{\texorpdfstring
+ {\leavevmode\hbox{$\varepsilon$}-\TeX}%
+ {e-TeX}}
+\DeclareRobustCommand*\AmS{\texorpdfstring
+ {{\protect\usefont{OMS}{cmsy}{m}{n}A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}%
+ {AMS}}
+\DeclareRobustCommand*\KOMAScript{\texorpdfstring
+ {\textsf{K\kern.05em O\kern.05em M\kern.05em A\kern.1em-\kern.1em Script}}%
+ {KOMA-Script}}
+\DeclareRobustCommand*\NTG{NTG}
+\DeclareRobustCommand*\SmF{SMF}
+%
+\begin{document}
+ \DocInput{caption.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \newcommand*\purerm[1]{\texorpdfstring{{\upshape\mdseries\rmfamily #1}}{#1}}
+% \newcommand*\puresf[1]{\texorpdfstring{{\upshape\mdseries\sffamily #1}}{#1}}
+% \newcommand*\purett[1]{\texorpdfstring{{\upshape\mdseries\ttfamily #1}}{#1}}
+% \let\class\puresf \let\package\puresf
+% \let\env\purett \let\opt\purett
+%
+% \def\thispackage{the \package{caption} package}
+% \def\Thispackage{The \package{caption} package}
+%
+% \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
+% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
+% \newcommand*\version[2][]{\textit{v#2}}
+%
+% \newcommand*\issue[1]{GitLab~\##1}
+%
+% \GetFileInfo{caption.sty}
+%
+% \title{The Implementation of
+% \texorpdfstring{\thispackage\thanks{%^^A
+% This package has version number \fileversion, last revised \filedate.}}%^^A
+% {the caption package}}
+% \author{Axel Sommerfeldt\\
+% \url{https://gitlab.com/axelsommerfeldt/caption}}
+% \date{\filedate}
+% \maketitle
+%
+% \begin{abstract}
+% \Thispackage\ consists of two parts -- the kernel
+% (|caption3.sty|) and the main package (|caption.sty|).
+%
+% \Thispackage\ redefines the \LaTeX\ commands
+% |\caption|, |\@caption|, and |\@makecaption| and maps the latter one to
+% |\caption@@make|, giving the user the possibility to control the look \& feel
+% of the captions from floating environments like |figure| and |table|.
+% Furthermore it does similar to the caption stuff coming from other packages
+% (like the \package{longtable} or \package{supertabular} package):
+% Mapping the appropriate internal commands (like |\LT@makecaption| or
+% |\ST@caption|) to the ones offered by the \package{caption3} kernel.
+% So you can think of \thispackage\ as a layer package, it
+% simply provides adaptation layers between the caption stuff coming from
+% \LaTeXe\ or packages, and the caption stuff offered by the
+% \package{caption3} kernel.
+% \end{abstract}
+%
+% \section*{User manual}
+%
+% This document is describing the code implementation only.
+% The user documentation can be found in
+% \nopagebreak\begin{quote}
+% \begin{tabular}{ll}
+% \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-eng.pdf}%
+% {\texttt{caption-eng.pdf}} & The English documentation \\
+% \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-rus.pdf}%
+% {\texttt{caption-rus.pdf}} & The Russian documentation\footnotemark \\
+% \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-deu.pdf}%
+% {\texttt{caption-deu.pdf}} & The German documentation \\
+% \end{tabular}
+% \footnotetext{Thanks a lot to Olga Lapko for this translation}
+% \end{quote}
+%
+% \StopEventually{}
+% \clearpage
+% \tableofcontents
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \DoNotIndex{\\,\_,\ ,\@@par}
+% \DoNotIndex{\@bsphack}
+% \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
+% \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
+% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
+% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
+% \DoNotIndex{\if@minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@minipagefalse,\@minipagetrue}
+% \DoNotIndex{\@namedef,\@nameuse}
+% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
+% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setminipage,\@setpar}
+% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
+% \DoNotIndex{\@testopt}
+% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
+% \DoNotIndex{\p@,\z@}
+% \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
+% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
+% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
+% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
+% \DoNotIndex{\fi,\footnotesize,\global}
+% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
+% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
+% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
+% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
+% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
+% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
+% \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
+% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
+% \DoNotIndex{\providecommand,\quad}
+% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
+% \DoNotIndex{\rightskip,\rmfamily}
+% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
+% \DoNotIndex{\small,\string,\space,\strut}
+% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
+% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
+% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
+% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
+% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
+% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
+% \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \setlength{\parskip}{0pt plus 1pt}
+% \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
+%
+% \changes{v1.0}{1994/10/27}{First release}
+% \changes{v1.1}{1994/11/03}{New option \texttt{centerlast}}
+% \changes{v1.2}{1994/11/28}{Support of the \package{float} package}
+% \changes{v1.3}{1995/01/09}{Support of \cs{captionlabelfont} in subcaptions}
+% \changes{v1.4}{1995/01/30}{New option \texttt{nooneline}}
+% \changes{v1.4b}{1995/04/05}{Bugfix release}
+% \changes{v3.0}{2003/12/20}{Rewritten; many new commands and features}
+% \changes{v3.0d}{2004/11/28}{Split into two packages: \package{caption} \& \package{caption3}}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+%
+% \iffalse
+%<*package>
+% \fi
+%
+% \section{Identification}
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+%\ProvidesPackage{caption}[2020/07/29 v3.4m Customizing captions (AR)]
+\ProvidesPackage{caption}[2020/09/28 v3.4n Customizing captions (AR)] % Backport of commit 43567491e5b075d661c080bca298f5428f289758 from 2020/09/28
+% \end{macrocode}
+%
+% \section{Loading the kernel}
+%
+% \begin{macrocode}
+\RequirePackage{caption3}[=2020/07/29] % needs v1.13 or newer
+% \end{macrocode}
+%
+% \section{Check against unknown document classes}
+%
+% \begin{macrocode}
+\caption@ifbool{documentclass}{}{%
+ \caption@WarningNoLine{%
+ Unknown document class (or package),\MessageBreak
+ standard defaults will be used}}
+% \end{macrocode}
+%
+% \section{Check against incompatible packages}
+%
+% \changes{v3.0p}{2007/04/06}{Check against obsolete \package{caption2} package added}
+% \begin{macrocode}
+\@ifpackageloaded{caption2}{%
+ \caption@Error{%
+ You can't use both, the (obsolete) caption2 *and*\MessageBreak
+ the (current) caption package}%
+ \endinput
+}{}
+% \end{macrocode}
+%
+% \changes{v3.1}{2007/06/15}{Check against incompatible \package{ftcap} package added}
+% \changes{v3.1}{2007/06/15}{Check against incompatible \package{nonfloat} package added}
+% \changes{v3.1}{2007/06/18}{Check against incompatible \package{topcapt} package added}
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \@ifpackageloaded{ftcap}{\caption@DisablePositionOption{ftcap}}{}%
+ \@ifpackageloaded{nonfloat}{\caption@DisablePositionOption{nonfloat}}{}%
+ \@ifpackageloaded{topcapt}{\caption@DisablePositionOption{topcapt}}{}}
+% \end{macrocode}
+% \begin{macro}{\caption@DisablePositionOption}
+% \changes{v3.1g}{2008/03/20}{\texttt{position=b} added}
+% \changes{v3.1h}{2008/03/29}{%
+% Name changed from \cs{caption@IncompatiblePackage} to \cs{caption@DisablePositionOption};
+% disables the `position' option now instead of issuing a warning}
+% |\caption@DisablePositionOption|\marg{package}\par
+% disables the `position' option.
+% \begin{macrocode}
+\newcommand*\caption@DisablePositionOption[1]{%
+ \caption@InfoNoLine{%
+ `#1' package detected; setting `position=b' for compatibility reasons}%
+ \caption@setposition b%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionOption{position}{%
+ \caption@Error{Usage of the `position' option is incompatible\MessageBreak
+ to the `#1' package}}}
+% \end{macrocode}
+% \begin{macrocode}
+\@onlypreamble\caption@DisablePositionOption
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Declaration of options}
+%
+% \subsection{Miscellaneous options}
+%
+% \begin{macrocode}
+\DeclareCaptionOption*{config}[caption]{%
+ \InputIfFileExists{#1.cfg}%
+ {\typeout{*** Local configuration file #1.cfg used ***}}%
+ {\caption@Warning{Configuration file #1.cfg not found}}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@selectlistentry}
+% \changes{v3.2}{2010/11/07}{This macro added}
+% |\caption@selectlistentry|\marg{\purett{heading} or \purett{entry}}
+% \begin{macrocode}
+\newcommand*\caption@selectlistentry[1]{%
+ \caption@ifinlist{#1}{heading}{%
+ \let\caption@iflistheading\@firstoftwo
+ }{\caption@ifinlist{#1}{default,list-entry,entry}{%
+ \let\caption@iflistheading\@secondoftwo
+ }{%
+ \caption@Error{Undefined list-entry selection `#1'}%
+ }}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.3}{2012-03-25}{Option \opt{list-entry} added}
+% \begin{macrocode}
+\DeclareCaptionOption{list-entry}{\caption@selectlistentry{#1}}
+\captionsetup{list-entry=default}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setparboxrestore}
+% \changes{v3.2}{2010/11/07}{This macro added}
+% |\caption@setparboxrestore|\marg{\purett{partial} or \purett{full}}
+% \begin{macrocode}
+\newcommand*\caption@setparboxrestore[1]{%
+ \caption@ifinlist{#1}{full}{%
+ \caption@setfullparboxrestore
+ }{\caption@ifinlist{#1}{default,light,partial}{%
+ \let\caption@parboxrestore\@secondoftwo
+ }{%
+ \caption@Error{Undefined parboxrestore `#1'}%
+ }}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setfullparboxrestore}
+% \changes{v3.2}{2010/11/07}{This macro added}
+% |\caption@setfullparboxrestore|\par
+% This is an abbreviation for |\caption@setparboxrestore{full}|.
+% \begin{macrocode}
+\newcommand*\caption@setfullparboxrestore{%
+ \let\caption@parboxrestore\@firstoftwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.2}{2010/11/07}{Option \opt{parboxrestore} added}
+% \begin{macrocode}
+\DeclareCaptionOption{parboxrestore}{\caption@setparboxrestore{#1}}
+\captionsetup{parboxrestore=default}
+% \end{macrocode}
+%
+% \changes{v3.1f}{2007/11/28}{Option \opt{@minipage=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{@minipage}{%
+ \caption@ifinlist{#1}{auto,default}%
+ {\let\caption@if@minipage\@gobbletwo}%
+ {\caption@set@bool\caption@if@minipage{#1}}}
+\captionsetup{@minipage=default}
+% \end{macrocode}
+%
+% \subsection{caption v1.x compatibility options}
+% \changes{v3.1}{2007/07/21}{Option `compatibility' added}
+% \changes{v3.1}{2007/09/01}{caption v1.x compatibility options revised}
+% \changes{v3.1d}{2007/10/24}{Bugfix 07-10-24 in caption v1.x$ compatibility options}
+%
+% Currently we support |v1| and |v3| as values for the |compatibility=| option.
+% But since this used to be a boolean option is the past we still support any boolean value
+% for compatibility reasons.
+%
+% \begin{macrocode}
+\DeclareCaptionOption{compatibility}[v1]{%
+ \caption@ifinlist{#1}{v1,1,true,yes,on}{%
+ \let\caption@ifcompatibility\@firstoftwo
+ }{\caption@ifinlist{#1}{v3,3,0,false,no,off}{%
+ \let\caption@ifcompatibility\@secondoftwo
+ }{%
+ \caption@Error{Undefined compatibility value `#1'}%
+ }}}
+\@onlypreamble@key{caption}{compatibility}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@setbool{compatibility}{0} % default: Try not to be compatible to v1.x
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setincompatible}
+% \changes{v3.4}{2019/09/09}{This macro added}
+% |\caption@setincompatible|\marg{condition}\marg{message text}
+% \begin{macrocode}
+\newcommand*\caption@setincompatible[2]{%
+ #1{%
+ \caption@WarningNoLine{%
+ #2;\MessageBreak
+ Setting compatibility to v1}%
+ \caption@setbool{compatibility}{1}%
+ }{}}
+% \end{macrocode}
+% \end{macro}
+%
+% Check against incompatible packages which used to work fine with v1 of the `caption' package.
+% \begin{macrocode}
+\caption@AtBeginDocument{\caption@ifcompatibility{}{%
+% \end{macrocode}
+% The usage of the (now obsolete) \package{captcont} package,
+% which brings its own definition of |\caption*|, was quite common in the old days.
+% \begin{macrocode}
+ \caption@setincompatible{\@ifpackageloaded{captcont}}{captcont package is loaded}%
+% \end{macrocode}
+% To be continued\ldots
+% \begin{macrocode}
+}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{normal}{%
+ \caption@setformat{plain}%
+ \caption@setjustification{justified}}
+\DeclareCaptionOptionNoValue*{isu}{%
+ \caption@setformat{hang}%
+ \caption@setjustification{justified}}
+\DeclareCaptionOptionNoValue*{hang}{%
+ \caption@setformat{hang}%
+ \caption@setjustification{justified}}
+\DeclareCaptionOptionNoValue*{center}{%
+ \caption@setformat{plain}%
+ \caption@setjustification{centering}}
+\DeclareCaptionOptionNoValue*{centerlast}{%
+ \caption@setformat{plain}%
+ \caption@setjustification{centerlast}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{scriptsize}{\def\captionfont{\scriptsize}}
+\DeclareCaptionOptionNoValue*{footnotesize}{\def\captionfont{\footnotesize}}
+\DeclareCaptionOptionNoValue*{small}{\def\captionfont{\small}}
+\DeclareCaptionOptionNoValue*{normalsize}{\def\captionfont{\normalsize}}
+\DeclareCaptionOptionNoValue*{large}{\def\captionfont{\large}}
+\DeclareCaptionOptionNoValue*{Large}{\def\captionfont{\Large}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{up}{\l@addto@macro\captionlabelfont\upshape}
+\DeclareCaptionOptionNoValue*{it}{\l@addto@macro\captionlabelfont\itshape}
+\DeclareCaptionOptionNoValue*{sl}{\l@addto@macro\captionlabelfont\slshape}
+\DeclareCaptionOptionNoValue*{sc}{\l@addto@macro\captionlabelfont\scshape}
+\DeclareCaptionOptionNoValue*{md}{\l@addto@macro\captionlabelfont\mdseries}
+\DeclareCaptionOptionNoValue*{bf}{\l@addto@macro\captionlabelfont\bfseries}
+\DeclareCaptionOptionNoValue*{rm}{\l@addto@macro\captionlabelfont\rmfamily}
+\DeclareCaptionOptionNoValue*{sf}{\l@addto@macro\captionlabelfont\sffamily}
+\DeclareCaptionOptionNoValue*{tt}{\l@addto@macro\captionlabelfont\ttfamily}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{nooneline}{\caption@setbool{slc}{0}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\caption@setbool{ruled}{0}
+\DeclareCaptionOptionNoValue*{ruled}{\caption@setbool{ruled}{1}}
+% \end{macrocode}
+%
+% \subsection{caption2 v2.x compatibility options}
+% \changes{v3.0h}{2005/07/08}{caption2 \version{2.x} compatibility options added}
+% \changes{v3.1}{2007/09/01}{caption2 v2.x compatibility options revised}
+% \changes{v3.1d}{2007/10/24}{Bugfix 07-10-24 in caption v2.x$ compatibility options}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{flushleft}{%
+ \caption@setformat{plain}%
+ \caption@setjustification{raggedright}}
+\DeclareCaptionOptionNoValue*{flushright}{%
+ \caption@setformat{plain}%
+ \caption@setjustification{raggedleft}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{oneline}{\caption@setbool{slc}{1}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{ignoreLTcapwidth}{%
+ \caption@WarningNoLine{Obsolete option `ignoreLTcapwidth' ignored}}
+% \end{macrocode}
+%
+% \subsection{Obsolete caption v3.0 options}
+% \changes{v3.1}{2007/05/07}{Package option \opt{caption} marked as obsolete,
+% gives error now}
+%
+% \begin{macrocode}
+\DeclareCaptionOption*{caption}{%
+ \caption@setbool{temp}{#1}%
+ \caption@ifbool{temp}{}{%
+ \caption@Error{%
+ The package option `caption=#1' is obsolete.\MessageBreak
+ Please pass this option to the subfig package instead\MessageBreak
+ and do *not* load the caption package anymore}}}
+% \end{macrocode}
+%
+% \subsection{fltpage package support options}
+%
+% \changes{v3.1}{2007/09/01}{Options `FPlist' \& `FPref' added}
+% With these options is controlled where the list-of entry and |\ref| resp.
+% |\pageref| or |\autoref| will link to.
+% Defaults are |FPlist=caption| and |FPref=figure| which is inconsistent,
+% but compatible to the usual behaviour of the \package{fltpage} package.
+% \begin{macrocode}
+\DeclareCaptionOption{FPlist}[1]{\caption@setFPoption{list}{#1}}
+\DeclareCaptionOption{FPref}[1]{\caption@setFPoption{ref}{#1}}
+\@onlypreamble@key{caption}{FPlist}
+\@onlypreamble@key{caption}{FPref}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setFPoption[2]{%
+ \edef\caption@tempa{\@car#2\@nil}%
+ \caption@setbool{FP#1cap}{\if c\caption@tempa 1\else 0\fi}}
+\@onlypreamble\caption@setFPoption
+% \end{macrocode}
+% \begin{macrocode}
+\captionsetup{FPlist=caption,FPref=figure}
+% \end{macrocode}
+%
+% \subsection{hyperref package support options}
+%
+% \changes{v3.1}{2007/06/21}{Options `hypcap' \& `hypcapspace' added}
+% With |hypcap=off| one can turn the \package{hypcap} support off
+% (default is |on|).
+% \begin{macrocode}
+\DeclareCaptionOption{hypcap}[1]{\caption@setbool{hypcap}{#1}}
+\DeclareCaptionOption{hypcapspace}{\def\caption@hypcapspace{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\captionsetup{hypcap=1,hypcapspace=.5\baselineskip}
+% \end{macrocode}
+%
+% \section{\AmS{} \& \SmF{} document classes support}
+% \changes{v3.1}{2007/07/29}{\AmS\ \& \SmF\ document classes support added}
+%
+% \begin{macrocode}
+\caption@ifclassloaded{ams}{%
+ \caption@InfoNoLine{AMS or SMF document class}%
+% \end{macrocode}
+% \begin{macrocode}
+ \setlength\belowcaptionskip{0pt}% set to 12pt by AMS class
+% \end{macrocode}
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \section{\KOMAScript{} document classes support}
+% \changes{v3.0a}{2004/01/18}{Minimum adaptation to \KOMAScript\ added}
+% \changes{v3.0h}{2005/08/22}{\KOMAScript\ compatibility options added}
+% \changes{v3.0i}{2005/11/17}{\KOMAScript\ compatibility commands added}
+% \changes{v3.0l}{2007/02/18}{\KOMAScript\ compatibility revised}
+% \changes{v3.1}{2007/03/17}{\KOMAScript\ compatibility options removed}
+% \changes{v3.1}{2007/04/05}{\KOMAScript\ compatibility revised \& enhanced}
+%
+% \begin{macrocode}
+\caption@ifclassloaded{koma}{%
+ \caption@InfoNoLine{KOMA-Script document class}%
+% \end{macrocode}
+%
+% Here we emulate the caption related commands and take over the caption
+% related settings from the \KOMAScript\ classes.
+%
+% \begin{macro}{\@tablecaptionabovetrue}
+% \begin{macro}{\@tablecaptionabovefalse}
+% \changes{v3.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
+% \begin{macrocode}
+ \g@addto@macro\@tablecaptionabovetrue{\captionsetup*[table]{position=t}}
+ \g@addto@macro\@tablecaptionabovefalse{\captionsetup*[table]{position=b}}
+% \end{macrocode}
+% \begin{macrocode}
+ \if@tablecaptionabove
+ \@tablecaptionabovetrue
+ \else
+ \@tablecaptionabovefalse
+ \fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@figurecaptionabovetrue}
+% \begin{macro}{\@figurecaptionabovefalse}
+% \changes{v3.3}{2013/02/15}{Support of \cs{@figurecaptionabovetrue} added}
+% \begin{macrocode}
+ \caption@ifdefined\@figurecaptionabovetrue{%
+% \end{macrocode}
+% \begin{macrocode}
+ \g@addto@macro\@figurecaptionabovetrue{\captionsetup*[figure]{position=t}}
+ \g@addto@macro\@figurecaptionabovefalse{\captionsetup*[figure]{position=b}}
+% \end{macrocode}
+% \begin{macrocode}
+ \if@figurecaptionabove
+ \@figurecaptionabovetrue
+ \else
+ \@figurecaptionabovefalse
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ }{}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\onelinecaptionstrue}
+% \begin{macro}{\onelinecaptionsfalse}
+% \changes{v3.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
+% \begin{macrocode}
+ \g@addto@macro\onelinecaptionstrue{\let\caption@ifslc\@firstoftwo}
+ \g@addto@macro\onelinecaptionsfalse{\let\caption@ifslc\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+ \ifonelinecaptions
+ \onelinecaptionstrue
+ \else
+ \onelinecaptionsfalse
+ \fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@captionabovetrue}
+% \begin{macro}{\@captionabovefalse}
+% \changes{v3.0j}{2006/03/21}{Bugfix 06-03-21:
+% \cs{let}\cs{caption@setposition}\cs{@gobble} added}
+% \changes{v3.0n}{2006/03/09}{Accidentally this got broken in \version{3.0m}, fixed}
+% \changes{v3.1}{2007/03/31}{We redefine \cs{captionabovetrue/false} now
+% instead of \cs{captionabove/below}}
+% \changes{v3.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
+% \changes{v3.1k}{2009/10/09}{\opt{figureposition} and \opt{tableposition} will issue a warning now}
+% \changes{v3.4}{2019/09/11}{\opt{figureposition} and \opt{tableposition} will now set the position anyway since it could be used by other packages}
+% Please note that these are stronger than the \opt{position} setting, therefore we
+% override the options \opt{figureposition} and \opt{tableposition} to typeout a warning.
+% \begin{macrocode}
+ \g@addto@macro\@captionabovetrue{\let\caption@position\@firstoftwo}
+ \g@addto@macro\@captionabovefalse{\let\caption@position\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionOption{figureposition}{%
+ \caption@WarningNoLine{Option `figureposition=#1' has no effect\MessageBreak
+ when used with a KOMA script document class}%
+ \captionsetup*[figure]{position=#1}}
+ \DeclareCaptionOption{tableposition}{%
+ \caption@WarningNoLine{Option `tableposition=#1' has no effect\MessageBreak
+ when used with a KOMA script document class}%
+ \captionsetup*[table]{position=#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\setcapindent}
+% \begin{macrocode}
+ \let\caption@KOMA@setcapindent\@setcapindent
+ \renewcommand*\@setcapindent[1]{%
+ \caption@KOMA@setcapindent{#1}\caption@setcapindent}
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@KOMA@@setcapindent\@@setcapindent
+ \renewcommand*\@@setcapindent[1]{%
+ \caption@KOMA@@setcapindent{#1}\caption@setcapindent}
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\caption@setcapindent{%
+ \captionsetup{indent=\ifdim\cap@indent<\z@\z@\else\cap@indent\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \caption@ifdefined\cap@indent{\caption@setcapindent}{}
+% \end{macrocode}
+%
+% \begin{macro}{\setcapwidth}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
+% \Note{The optional argument of \cs{setcapwidth} if not supported (yet),
+% so we issue a warning if used.
+% (Since this does not seem to have an negative effect when used
+% by the \texttt{captionbeside} environment, we suppress the warning here.)}
+% \begin{macrocode}
+ \expandafter\let\expandafter\caption@KOMA@setcapwidth
+ \csname\string\setcapwidth\endcsname
+ \@namedef{\string\setcapwidth}[#1]#2{%
+ \caption@KOMA@setcapwidth[{#1}]{#2}\caption@setcapwidth{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\caption@setcapwidth[1]{%
+ \ifx\\#1\\\else
+ \caption@ifdefined\cap@margin{%
+ \def\@tempa{captionbeside}%
+ \ifx\@tempa\@currenvir\else\caption@Warning{%
+ Ignoring optional argument [#1] of \string\setcapwidth\MessageBreak}%
+ \fi}{}%
+ \fi
+ \captionsetup{width=\cap@width}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \def\caption@tempa{\hsize}%
+ \ifx\caption@tempa\cap@width \else
+ \caption@setcapwidth{?}
+ \fi
+% \end{macrocode}
+%
+% \begin{macro}{\setcapmargin}
+% \begin{macrocode}
+ \expandafter\let\expandafter\caption@KOMA@setcapmargin
+ \csname\string\@setcapmargin\endcsname
+ \@namedef{\string\@setcapmargin}[#1]#2{%
+ \caption@KOMA@setcapmargin[{#1}]{#2}\caption@setcapmargin}
+% \end{macrocode}
+% \begin{macrocode}
+ \expandafter\let\expandafter\caption@KOMA@@setcapmargin
+ \csname\string\@@setcapmargin\endcsname
+ \@namedef{\string\@@setcapmargin}[#1]#2{%
+ \caption@KOMA@@setcapmargin[{#1}]{#2}\caption@setcapmargin}
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\caption@setcapmargin{%
+ \begingroup
+ \let\onelinecaptionsfalse\relax
+ \def\@twoside{0}%
+ \def\if@twoside{\def\@twoside{1}\iffalse}%
+ \cap@margin
+ \def\@tempa{\endgroup}%
+ \ifx\cap@left\hfill\else\ifx\cap@right\hfill\else
+ \def\hspace##1##{\@firstofone}%
+ \edef\@tempa{\endgroup
+ \noexpand\captionsetup{%
+ twoside=\@twoside,slc=0,%
+ margin={\cap@left,\cap@right}}}%
+ \fi\fi
+ \@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \ifx\cap@margin\relax \else
+ \caption@setcapmargin
+ \fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \section{Processing of options}
+%
+% \changes{v3.0m}{2007/03/04}{Verbose option added}
+% \changes{v3.1}{2007/07/02}{Verbose option removed from package}
+%
+% \changes{v3.1}{2007/03/17}{We do not process global options anymore}
+% \begin{macrocode}
+\caption@SetupOptions{caption}{\caption@setkeys{#1}{#2}}
+\caption@ProcessOptions*{caption}
+% \end{macrocode}
+%
+% \section{\cs{caption}, \cs{@caption}, and \cs{@makecaption}}
+%
+% \begin{macro}{\caption@ifflag}
+% \changes{v3.3}{2011/12/28}{This switch added}
+% \changes{v3.3}{2018/08/08}{Rewritten (and renamed) so a counter is used instead of a switch}
+% Since we support continued floats and sub-figures it's not an easy task
+% to manage the figure (and table) counter. (Especially since previous versions
+% of the caption package has proven that correcting a counter locally is not a good idea.)
+%
+% These three switches hold the
+% current status: |\caption@if|\-|flag{2}| is set if the caption was already
+% typeset (so the counter doesn't need to be incremented for sub-figures),
+% |\caption@if|\-|flag{4}| is set if there is already content which have
+% incremented the counter (so the counter doesn't need to be incremented
+% for the main caption, further sub-figures, and other stuff), and
+% |\caption@if|\-|flag{1}| is set if |\continued|\-|float| was given.
+%
+% In the past three boolean switches were used to store the flags, but since some
+% packages (like the \package{floatrow} and \package{tabu} package) try hard to keep
+% counter changes locally under certain circumstances, it seems a good idea to make
+% these flags a counter value, too.
+% \begin{macrocode}
+\newcounter{caption@flags}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@ifflag[1]{%
+ \@tempcnta\c@caption@flags
+ \divide\@tempcnta #1\relax
+ \ifodd\@tempcnta
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@clrflags}
+% \changes{v3.3}{2018/08/08}{This macro added}
+% \begin{macro}{\caption@clrflag}
+% \changes{v3.3}{2013/04/14}{This macro added}
+% \changes{v3.3}{2018/08/08}{Rewritten so a counter is used instead of a switch}
+% \begin{macro}{\caption@setflag}
+% \changes{v3.3}{2013/04/14}{This macro added}
+% \changes{v3.3}{2018/08/08}{Rewritten so a counter is used instead of a switch}
+% Furthermore we introduce the macros \cs{caption@clrflag} and \cs{caption@setflag}
+% for clearing resp.~setting these flags.
+% \begin{macrocode}
+\newcommand*\caption@clrflags{%
+ \setcounter{caption@flags}\z@}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@clrflag[1]{%
+ \caption@ifflag{#1}{\caption@addtoflags{-#1}}{}}
+\newcommand*\caption@setflag[1]{%
+ \caption@ifflag{#1}{}{\caption@addtoflags{#1}}}
+\newcommand*\caption@addtoflags{%
+ \addtocounter{caption@flags}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@caption}
+% \changes{v3.0f}{2005/05/22}{Bugfix: \cs{ContinuedFloat} added}
+% \changes{v3.0f}{2005/06/13}{Support of \cs{caption*[]} removed}
+% \changes{v3.0l}{2007/01/19}{Minimal support of \textsf{combine} package added}
+% \changes{v3.1}{2007/02/04}{Re-written, does not save\&use original definition anymore}
+% Here comes our definition of |\caption| and |\caption*|.
+% Beside the support of the starred variant this code was adapted to the
+% various packages we support.
+% We are using |\caption@dblarg| instead of |\@dblarg| so |\caption{}|
+% (with an empty arg.) will produce a list-of entry, but |\caption[]{}|
+% won't.
+% \begin{macrocode}
+\def\caption@caption{%
+ \caption@iftype
+ {\caption@checkgrouplevel\@empty\caption
+ \caption@star
+ {\caption@refstepcounter\@captype}%
+ {\caption@dblarg{\@caption\@captype}}}%
+ {\caption@Error{\noexpand\caption outside float}%
+ \caption@gobble}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@star}
+% \changes{v3.1}{2007/06/24}{Renamed from \cs{caption@caption} to \cs{caption@star}}
+% \changes{v3.2c}{2011/08/21}{\cs{global} removed}
+% A helper macro which processes the optional |*| after |\caption|.
+% \begin{macrocode}
+\newcommand*\caption@star[2]{%
+ \@ifstar{\caption@startrue#2[]}{#1#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@caption}
+% \changes{v3.1}{2007/02/04}{Re-written, does not save\&use original definition anymore}
+% \changes{v3.1f}{2007/11/28}{Bugfix: Handling of \texttt{@minipage} flag added}
+% \changes{v3.1f}{2007/11/28}{Support of option \opt{@minipage} added}
+% \changes{v3.1g}{2008/03/16}{Internal: Uses \cs{caption@prepareanchor} now}
+% \changes{v3.2d}{2011/10/21}{Adapted to the \textsf{memoir} document class}
+% \changes{v3.2f}{2012/01/14}{Usage of \cs{M@gettitle} moved to \cs{caption@prepareanchor}}
+% \changes{v3.3}{2013/01/06}{Adapted to the \textsf{nag} package}
+% As above, our version has been adapted to the packages we support.
+% Additionally our code is nested by |\caption@beginex| \&
+% |\caption@end| instead of |\begingroup| \& |\endgroup|.
+% Furthermore we use |\caption@boxrestore| instead of |\@parboxrestore|
+% so this code also works correctly inside list-based environments
+% like |wide| \& |addmargin|. (This, and the fact that we use
+% |\linewidth| instead of |\hsize| inside |\@makecaption|, solves
+% \href{http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=latex/2472}%^^A
+% {\LaTeX\ PR \texttt{latex/2472}}.)
+% \begin{macrocode}
+\long\def\caption@@caption#1[#2]#3{%
+% \end{macrocode}
+% \begin{macrocode}
+ \ifcaption@star \else
+ \caption@prepareanchor{#1}{#2}%
+ \memcaptioninfo{#1}{\csname the#1\endcsname}{#2}{#3}%
+ \@nameuse{nag@hascaptiontrue}%
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \par
+ \caption@beginex{#1}{#2}{#3}%
+ \caption@setfloatcapt{%
+ \caption@boxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \caption@normalsize
+ \ifcaption@star
+ \let\caption@makeanchor\@firstofone
+ \fi
+ \@makecaption{\csname fnum@#1\endcsname}%
+ {\ignorespaces\caption@makeanchor{#3}}\par
+ \caption@if@minipage\@minipagetrue\@minipagefalse}%
+ \caption@end}
+% \end{macrocode}
+% \textsf{memoir} document class stuff:
+% \begin{macrocode}
+\providecommand\M@gettitle[1]{}
+\providecommand\memcaptioninfo[4]{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@prepareanchor}
+% \changes{v3.1g}{2008/03/16}{This macro added}
+% \changes{v3.2f}{2012/01/14}{Usage of \cs{M@gettitle} moved from \cs{caption@@caption}}
+% \begin{macrocode}
+\newcommand*\caption@prepareanchor[2]{%
+ \caption@makecurrent{#1}{#2}%
+ \caption@ifhypcap\caption@@start\relax
+ \M@gettitle{#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makecaption}
+% \changes{v3.1i}{2008/05/06}{Usage of \cs{caption@rule} added}
+% |\@makecaption|\marg{label}\marg{text}\par
+% We do basically the same as the original code (from the standard
+% \LaTeX\ document classes), but take care of the |position=| setting
+% and use |\caption@@make| from the \package{caption} kernel to finally
+% typeset the caption.
+% \begin{macrocode}
+\long\def\caption@makecaption#1#2{%
+ \caption@make@above
+ \caption@@make{#1}{#2}%
+ \caption@make@below}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@make@above}
+% \begin{macro}{\caption@make@below}
+% \changes{v3.3a}{2019/04/02}{This macro added}
+% |\caption@make@above|\\
+% |\caption@make@below|\par
+% Typesets the stuff above resp.~below the caption, depending on |\caption@iftop|.
+% \begin{macrocode}
+\newcommand*\caption@make@above{%
+ \caption@iftop
+ \caption@belowskip
+ {\caption@rule\caption@aboveskip}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@make@below{%
+ \caption@iftop
+ {\caption@aboveskip\caption@rule}%
+ \caption@belowskip}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@aboveskip}
+% \begin{macro}{\caption@belowskip}
+% \changes{v3.3a}{2019/04/02}{This macro added}
+% |\caption@aboveskip|\\
+% |\caption@belowskip|\par
+% Typesets the skip above resp.~below the caption.
+% \begin{macrocode}
+\newcommand*\caption@aboveskip{%
+ \vskip\abovecaptionskip}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@belowskip{%
+ \vskip\belowcaptionskip}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@redefine}
+% \changes{v3.1k}{2009/03/30}{This macro added, it contains the patching code now}
+% Prior to \version{3.4} we only redefined |\caption| and |\@caption| if the current definitions
+% were well known, so documents written in the old (\package{caption} package \version{1.x}) days
+% (where |\caption| \& |\@caption| were not redefined by us) still compiled fine.
+% This used to make sense when introducing \version{3.0} in the year 2003
+% but is simply overcautious and especially unwanted by the user nowadays.
+% So starting with \version{3.4} we only do not redefine |\caption| and |\@caption| if the
+% `compatibility' option is set to `v1'.
+% \begin{macrocode}
+\newcommand*\caption@redefine{}
+\g@addto@macro\caption@redefine{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@ifcompatibility{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@InfoNoLine{
+ \noexpand\caption will not be redefined since `compatibility' is set to v1}%
+% \end{macrocode}
+% \begin{macrocode}
+ \renewcommand*\caption@redefine{}%
+% \end{macrocode}
+%
+% |\continuedfloat| is not supported in compatibility mode.
+% \begin{macrocode}
+ \renewcommand*\caption@continuedfloat[1]{%
+ \caption@Error{Not available in compatibility mode}}%
+% \end{macrocode}
+%
+% |\caption@start| is not supported in compatibility mode.
+% \begin{macrocode}
+ \caption@AtBeginDocument*{%
+ \let\caption@start\relax
+ \caption@ifdefined\caption@ORI@capstart{%
+ \caption@Debug{%
+ Restore hypcap definition of \string\capstart\@gobble}%
+ \let\capstart\caption@ORI@capstart}{}%
+ }%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@star}
+% We redefine |\caption@star| here so it does not make any harm.
+% \begin{macrocode}
+ \renewcommand*\caption@star[2]{#1#2}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ }{%
+% \end{macrocode}
+%
+% \begin{macro}{\caption}
+% \begin{macro}{\@caption}
+% \begin{macrocode}
+ \renewcommand*\caption@redefine{%
+ \let\caption\caption@caption
+ \let\@caption\caption@@caption}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+ }%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@redefine
+ \caption@AtBeginDocument*{%
+ \let\caption@ORI@capstart\@undefined}%
+% \end{macrocode}
+%
+% \begin{macro}{\@xfloat}
+% \changes{v3.1}{2007/05/09}{This re-definition added}
+% \changes{v3.1b}{2007/09/22}{Will now be redefined in compatibility mode, too}
+% We redefine |\@xfloat| so inside floating environments our
+% type-specific options will be used, a \package{hyperref}
+% anchor will be set etc.
+% \begin{macrocode}
+ \let\caption@ORI@xfloat\@xfloat
+ \def\@xfloat#1[#2]{%
+ \caption@ORI@xfloat{#1}[#2]%
+ \caption@settype{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% Some packages (like the \package{hyperref} package for example) redefines
+% |\caption| and |\@caption|, too.
+% So we have to use |\AtBeginDocument| here, so we can make sure
+% our definition is the one which will be valid at last.
+% \begin{macrocode}
+\caption@AtBeginDocument{\caption@redefine}
+% \end{macrocode}
+%
+% \begin{macro}{\@makecaption}
+% \begin{macrocode}
+\let\@makecaption\caption@makecaption
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\phantomcaption}
+% \changes{v3.2}{2010/10/31}{Bugfix 10-09-01b: This macro added}
+% |\phantomcaption|\par
+% Use this one for figures with subcaptions but without main caption.
+% \begin{macrocode}
+\newcommand\phantomcaption{%
+ \caption@iftype
+ {\caption@refstepcounter\@captype}%
+ {\caption@Error{\noexpand\phantomcaption outside float}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \section{\cs{captionof}}
+%
+% \changes{v3.0d}{2004/08/03}{Option \opt{type=} added}
+% \changes{v3.1}{2007/06/25}{Option \opt{type*=} added}
+% \changes{v3.1f}{2007/11/16}{Option \opt{subtype} \& \opt{subtype*} added}
+% \changes{v3.2}{2010/10/24}{Bugfix 10-10-17: Option \opt{type=} uses \cs{setcaptiontype} instead of \cs{caption@settype} now}
+%
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionOption{type}{\setcaptiontype{#1}}%
+ \DeclareCaptionOption{type*}{\setcaptiontype*{#1}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionOptionNoValue{subtype}{\setcaptionsubtype\relax}%
+ \DeclareCaptionOptionNoValue{subtype*}{\setcaptionsubtype*}%
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \emph{Important Note:}
+% Like |\captionof| the option |type=| should only be used inside a
+% group, box, or environment and does not check if the argument is a valid
+% floating environment or not.
+%
+% \begin{macro}{\setcaptiontype}
+% \changes{v3.2}{2010/10/24}{This macro added}
+% \changes{v3.4e}{2020/01/02}{Check added if the subtype is defined}
+% Like |\captionsetup{type=xxx}|, but also works if \cs{captionsetup} was redefined.
+% \begin{macrocode}
+\newcommand\setcaptiontype{%
+ \caption@boxrestore@mini
+ \caption@settype}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\setcaptionsubtype}
+% \changes{v3.2a}{2011/08/15}{This macro added}
+% Same, but sets the sub-type.
+% \begin{macrocode}
+\newcommand\setcaptionsubtype{%
+ \caption@iftype
+ \caption@setsubtype
+ {\caption@Error{\noexpand\setcaptionsubtype outside float}}}%
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@setsubtype{%
+ \@ifstar
+ {\caption@@settype{sub}*{sub\@captype}}%
+ {\caption@@settype{sub}{sub\@captype}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@settype}
+% \changes{v3.1}{2007/05/09}{This macro added}
+% \changes{v3.1b}{2007/09/22}{Usage of \cs{caption@xlabel} added}
+% \changes{v3.1d}{2007/10/23}{Error message for \cs{caption@checkgrouplevel} revised}
+% \changes{v3.1f}{2007/11/16}{\cs{caption@setsubtype} added}
+% \changes{v3.1f}{2007/12/03}{Crappy \cs{caption@iftypewarning} replaced}
+% \changes{v3.1g}{2008/01/12}{Usage of \cs{ifcaptionsetup@star} added}
+% \changes{v3.2}{2010/10/26}{Error message moved from here to \cs{caption@refstepcounter}}
+% \changes{v3.3}{2011/12/28}{Resetting of \cs{ifcaption@caption} and \cs{ifcaption@subcaption} added}
+% \changes{v3.4e}{2020/01/02}{Checks added to prevent misuse regading subtypes}
+% |\caption@settype*|\marg{type}\par
+% sets |\@captype| and executes the options associated with it
+% (using |\caption@set|\-|options|).
+% Furthermore we check |\current|\-|group|\-|level| (if avail),
+% redefine |\@currentlabel| so a |\label| before |\caption| will result
+% in a hint instead of a wrong reference, and
+% use the macro |\caption@|(|sub|)|type|\-|hook| (which will be used by our
+% \package{float} package support).\par
+% The non-starred version sets a \package{hyperref} anchor additionally
+% (if |hypcap=|\-|true| and the \package{hypcap} package is not loaded).
+% \begin{macrocode}
+\newcommand*\caption@settype{%
+ \caption@clrflags
+ \caption@set@type}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@set@type{%
+ \caption@@settype{}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@settype[1]{%
+ \caption@teststar{\caption@@@settype{#1}}\@firstoftwo\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@settype[3]{%
+% #1 = "" or "sub"
+% #2 = \@firstoftwo in star form, \@secondoftwo otherwise
+% #3 = <type>, e.g. "figure" or "subfigure"
+ \caption@Debug{#1type=#3}%
+ \@nameuse{caption@check#1type}{#3}%
+ {\caption@checkgrouplevel{#1}{%
+ \captionsetup{#1type#2*\@empty=...}#2{ or
+ \@backslashchar#1captionof}{}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \edef\caption@tempa{#3}%
+ \expandafter\ifx\csname @#1captype\endcsname\caption@tempa \else
+ \ifcaptionsetup@star\else\@nameuse{caption@#1type@warning}\fi
+ \fi
+ \expandafter\let\csname @#1captype\endcsname\caption@tempa
+% \end{macrocode}
+% \begin{macrocode}
+ \@nameuse{caption@#1typehook}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@setoptions{#3}%
+ \ifx\caption@opt\relax
+ \@nameundef{caption@#1type@warning}%
+ \else
+ \@namedef{caption@#1type@warning}{\caption@Warning{%
+ The #1type was already set to
+ `\csname @#1captype\endcsname'\MessageBreak}}%
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ #2{}{%
+ \let\@currentlabel\caption@undefinedlabel
+% \let\@currentHlabel\@undefined
+ \ifx\caption@x@label\@undefined
+ \let\caption@x@label\label
+ \let\label\caption@xlabel
+ \fi
+ \caption@start}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@iftype}
+% \changes{v3.1}{2007/04/11}{This macro and its usage added}
+% Since we often need to check if |\@captype| is defined (means: we
+% are inside a floating environment) this helper macro was introduced.
+% \begin{macrocode}
+\newcommand*\caption@iftype{\caption@ifdefined\@captype}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@checktype}
+% \changes{v3.4g}{2020/01/02}{This macro and its usage added}
+% \changes{v3.4m}{2020/07/29}{Check of \cs{sf@counterlist} from \package{subfig} package added}
+% |\caption@checktype|\marg{type}\marg{code}\par
+% is used by |\caption@settype| and should either expand the code or issue an error
+% if the given type is not a proper type, i.e. it is a sub-type instead (either defined by
+% |\DeclareCaptionSubType| or |\newsubfloat|\cite{subfig}).
+% \begin{macrocode}
+\newcommand*\caption@checktype[1]{%
+ \caption@ifsubtype{#1}\@firstoftwo{\caption@ifin@list\sf@counterlist{#1}}%
+ {\caption@Error{Should not be used with subtype `#1'}%
+ \@gobble}%
+ \@firstofone}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@checksubtype}
+% \changes{v3.4g}{2020/01/02}{This macro and its usage added}
+% \changes{v3.4m}{2020/07/29}{Check of \cs{sf@counterlist} from \package{subfig} package added}
+% |\caption@checksubtype|\marg{type}\marg{code}\par
+% is used by |\caption@settype| and should either expand the code or issue an error
+% if the given type is not a proper sub-type, i.e. not defined by |\Declare|\-|Caption|\-|Sub|\-|Type|.
+% Since the |sub|\-|float|\-|row| environment offered by the \package{floatrow} package\cite{floatrow}
+% is using |\caption|\-|setup{sub|\-|type}| even if the sub-type was defined by |\new|\-|sub|\-|float|
+% offered by \package{subfig}\cite{subfig}, we take a more relaxed view of things here and allow
+% those sub-types as well (but not without warning since we do not support this).
+% \begin{macrocode}
+\newcommand*\caption@checksubtype[1]{%
+ \caption@ifsubtype{#1}%
+ \@firstofone
+ {\caption@ifin@list\sf@counterlist{#1}%
+ {\caption@Warning{%
+ \noexpand\setcaptionsubtype without \string\DeclareCaptionSubType.\MessageBreak
+ This is not designed to work; you could try replacing\MessageBreak
+ the `subfig' package with `subcaption' to resolve\MessageBreak
+ this problem which occurred}%
+ \@firstofone}%
+ {\caption@Error{Undefined subtype `#1'}%
+ \@gobble}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@checkgrouplevel}
+% \changes{v3.1}{2007/07/15}{This macro and its usage added}
+% \changes{v3.1f}{2007/11/28}{Error changed to warning (compatibility)}
+% \changes{v3.3}{2013/04/21}{Uses \cs{caption@ifeTeX} now}
+% Checks if |\captionsetup{type=|\ldots|}| or |\caption| is done
+% inside a group or not -- in the latter case a warning message will
+% be issued. (needs \eTeX)
+% \begin{macrocode}
+\caption@ifeTeX{%
+ \newcommand*\caption@checkgrouplevel[2]{%
+ \@ifundefined{#1caption@grouplevel}{%
+ \caption@ifundefined\caption@grouplevel{\let\caption@grouplevel\z@}{}%
+ \ifnum\currentgrouplevel>\caption@grouplevel\relax
+ \expandafter\edef\csname #1caption@grouplevel\endcsname{%
+ \the\currentgrouplevel}%
+ \else
+ \caption@Warning{\string#2\MessageBreak outside box or environment}%
+ \fi
+ }{}}%
+}{%
+ \let\caption@checkgrouplevel\@gobbletwo
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@undefinedlabel}
+% \changes{v3.1}{2007/07/03}{This macro and its usage added}
+% \changes{v3.1b}{2007/09/22}{Contents changed to \texttt{??}}
+% \changes{v3.1i}{2008/04/13}{Contents changed to \cs{caption@xref}(\ldots)}
+% \changes{v3.1k}{2009/03/30}{Bugfix 08-12-08: \cs{caption@xref} is robust now}
+% \changes{v3.2c}{2011/09/13}{Text changed from `before' to `without proper'}
+% \changes{v3.3}{2016/02/21}{Text changed from `without proper \cs{caption}' to `without proper reference'}
+% This label will be used for |\currentlabel| inside (floating) environments
+% as default. (see above)
+% \iffalse\Note{All commands used have to be robust here.}\fi
+% \begin{macrocode}
+\newcommand*\caption@undefinedlabel{%
+ \protect\caption@xref{\caption@labelname}{\on@line}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareRobustCommand*\caption@xref[2]{%
+ \caption@WarningNoLine{\noexpand\label without proper reference#2}%
+ \@setref\relax\@undefined{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@labelname{??}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@xlabel}
+% \changes{v3.1b}{2007/09/22}{This macro and its usage added}
+% \changes{v3.1f}{2007/11/11}{Revised}
+% \changes{v3.1i}{2008/04/13}{Bugfix: \cs{pageref} should always work now}
+% \changes{v3.2c}{2011/08/19}{Works with optional arguments now, too}
+% The new code of |\label| inside floating environments.
+% |\label| will be redefined using |\caption@withoptargs|, so
+% |#1| are the optional arguments (if any), and
+% |#2| is the mandatory argument here.
+% \begin{macrocode}
+\newcommand*\caption@xlabel{%
+ \caption@withoptargs\caption@@xlabel}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@xlabel[2]{%
+ \caption@@@xlabel
+ \def\caption@labelname{#2}%
+ \caption@x@label#1{#2}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@xlabel{%
+ \global\let\caption@@@xlabel\@empty
+ \@bsphack
+ \protected@write\@auxout{}%
+ {\string\providecommand*\string\caption@xref[2]{%
+ \string\@setref\string\relax\string\@undefined{\string##1}}}%
+ \@esphack}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionof}
+% \changes{v3.1}{2007/05/09}{Uses \cs{caption@settype} instead of \cs{def}\cs{@captype}}
+% \changes{v3.1c}{2007/09/22}{Bugfix: Redefinition of \cs{caption@setfloatcapt} removed}
+% \changes{v3.1e}{2007/10/30}{Better compatibility: Will be defined with \cs{AtBeginDocument} now}
+% \changes{v3.2}{2010/10/24}{Bugfix 10-10-17: Uses \cs{setcaptiontype} instead of \cs{caption@settype} now}
+% |\captionof|\marg{type}\oarg{lst\_entry}\marg{heading}\\
+% |\captionof*|\oarg{lst\_entry}\marg{heading}\par
+% \Note{This will be defined with \cs{AtBeginDocument} so
+% \cs{usepackage}\csmarg{caption,capt-of} will still work.
+% (Compatibility to \version{1.x})}
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \def\captionof{\caption@teststar\caption@of{\caption*}\caption}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@of[2]{\setcaptiontype*{#2}#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{\cs{captionlistentry}}
+%
+% \begin{macro}{\captionlistentry}
+% \changes{v3.1}{2007/07/28}{This macro added}
+% \changes{v3.1f}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% \changes{v3.1g}{2008/01/20}{Starred variant added}
+% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% |\captionlistentry|\oarg{float type}\marg{list entry}\\
+% |\captionlistentry*|\oarg{float type}\marg{list entry}
+% \begin{macrocode}
+\newcommand*\captionlistentry{%
+ \caption@teststar\@captionlistentry\@firstoftwo\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\@captionlistentry[1]{%
+ \@testopt{\caption@listentry{#1}}\@captype}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@listentry#1[#2]#3{%
+ \@bsphack
+ #1{\caption@gettitle{#3}}%
+ {\caption@refstepcounter{#2}%
+ \caption@makecurrent{#2}{#3}}%
+ \caption@addcontentsline{#2}{#3}%
+ \@esphack}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{\cs{captionbox}}
+%
+% \begin{macro}{\captionbox}
+% \changes{v3.2}{2010/12/17}{This macro added}
+% \changes{v3.2a}{2011/08/16}{\cs{captionsetup} replaces with \cs{captionbox@settype} and \cs{caption@setposition}}
+% \changes{v3.3}{2012/04/09}{Adapted to revised version of \cs{caption@withoptargs}}
+% \changes{v3.3}{2017/03/19}{When used with fixed witdh the content will not be hboxed anymore}
+% \changes{v3.3c}{2019/09/01}{Adapted so it could be used by \cs{subfloat} offered by \package{subcaption}}
+% \changes{v3.4l}{2020/07/29}{\cs{captionbox@hj@default} renamed to \cs{captionbox@innerpos@default}}
+% A |\parbox| with contents and caption, separated by an invisible |\hrule|.
+% \begin{macrocode}
+\newcommand*\captionbox{%
+ \caption@withoptargs{\caption@ibox\@gobble}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@ibox[3]{%
+ \kernel@ifnextchar[%]
+ {\caption@iibox{#1}{#2}{#3}}%
+ {\caption@iibox@{#1}{#2}{#3}}}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@iibox#1#2#3[#4]{%
+ \@testopt{\caption@iiibox{#1}{#2}{#3}[{#4}]}\captionbox@innerpos@default}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@iibox@#1#2#3#4{%
+ \setbox\@tempboxa\hbox{#4}%
+ \caption@iiibox{#1}{#2}{#3}[\wd\@tempboxa][\captionbox@innerpos@default]{\unhbox\@tempboxa}}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@iiibox#1{%
+ \caption@iiiibox{#1}\vbox\vtop}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@iiiibox#1#2#3#4#5[#6][#7]#8{%
+ \begingroup
+ #1*% set \caption@position
+ \caption@iftop{%
+ \endgroup
+ \parbox[t]{#6}{%
+ #1\relax
+ \caption@setposition t%
+ #2{\caption#4{#5}}%
+ \captionbox@hrule
+ \csname caption@hj@#7\endcsname
+ #8}%
+ }{%
+ \endgroup
+ \parbox[b]{#6}{%
+ #1\relax
+ \caption@setposition b%
+ \csname caption@hj@#7\endcsname
+ #8%
+ \captionbox@hrule
+ #3{\caption#4{#5}}}%
+ }}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\captionbox@innerpos@default{c}
+\newcommand*\captionbox@hrule{\hrule\@height\z@\relax}
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\caption@hj@c{\centering}
+\providecommand*\caption@hj@l{\raggedright}
+\providecommand*\caption@hj@r{\raggedleft}
+\providecommand*\caption@hj@s{}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{\cs{continuedfloat}}
+%
+% \begin{macro}{\continuedfloat}
+% \changes{v3.0i}{2005/11/12}{Optional argument added}
+% \changes{v3.0g}{2005/06/28}{Bugfix: \cs{newcounter} replaced by \cs{newcount}}
+% \changes{v3.1}{2007/07/02}{Format of \package{hyperref} extension changed}
+% \changes{v3.1}{2007/07/07}{\cs{caption@setoptions} added}
+% \changes{v3.1g}{2008/01/29}{Starred variant added}
+% \changes{v3.2f}{2011/12/17}{Undocumented optional argument removed}
+% \changes{v3.3}{2011/12/28}{Uses \cs{ifcaption@ContinuedFloat} now}
+% \changes{v3.3}{2013/05/01}{Usage of \cs{caption@restorecounters} added}
+% \changes{v3.3}{2013/12/16}{Bugfix: Does not use \cs{caption@ContinuedFloat} anymore since this breaks \cs{ContinuedFloat} offered by the \package{subfig} package}
+% \changes{v3.4}{2015/09/16}{Renamed from \cs{ContinuedFloat} to \cs{continuedfloat}}
+% |\continuedfloat|\\
+% |\continuedfloat*|\par
+% This mainly sets the appropriate flag, increments the
+% continuation counter, and executes the given options.
+% Furthermore we set |\caption@reset|\-|continued|\-|float| to |\@gobble| so the
+% continuation counter will not be reset to zero inside |\caption@ref|\-|step|\-|counter|.\par
+% When the \package{hyperref} package is used we have the problem
+% that the usage of |\continued|\-|float| will create duplicate
+% hyper links -- |\@current|\-|Href| will be the same for the main float and
+% the continued ones. So we have to make sure unique labels and references
+% will be created each time. We do this by extending |\the|\-|H|\-|figure| and
+% |\the|\-|H|\-|table|, so for continued floats the scheme
+% \begin{quote}\meta{type}|.|\meta{type \#}|\alph{|\meta{continued \#}|}|\end{quote}
+% will be used instead of
+% \begin{quote}\meta{type}|.|\meta{type \#}\quad\quad.\end{quote}
+% \par{\small(This implementation follows an idea from Steven Douglas Cochran.)}
+% \Note{This does not help if the \package{hyperref} package option
+% \texttt{naturalnames=true} is set.}
+% \begin{macrocode}
+\def\continuedfloat{%
+ \caption@iftype
+ {\caption@continuedfloat\@captype}%
+ {\caption@Error{\noexpand\continuedfloat outside float}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@continuedfloat[1]{%
+ \@ifstar
+ {\caption@@refstepcounter\@captype
+ \caption@@continuedfloat{#1}}%
+ {\caption@continued@float{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\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'}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@continuedfloat{%
+ \caption@setflag1% continued float
+ \caption@@@continuedfloat}
+\newcommand*\caption@@@continuedfloat{%
+ \stepcounter{continuedfloat}%
+ \caption@@@@continuedfloat}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@@continuedfloat[1]{%
+ \caption@setoptions{ContinuedFloat}% for compatibility reasons
+ \caption@setoptions{continuedfloat}%
+ \caption@setoptions{continued#1}%
+ \expandafter\l@addto@macro\csname the#1\endcsname\thecontinuedfloat
+ \@ifundefined{theH#1}{}{%
+ \expandafter\l@addto@macro\csname theH#1\endcsname{%
+ \@alph\c@continuedfloat}}%
+ \let\caption@@@@continuedfloat\@gobble}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@CFtype{??}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\thecontinuedfloat}
+% \changes{v3.4}{2015/09/16}{Renamed from \cs{theContinuedFloat} to \cs{thecontinuedfloat}}
+% This one is preset to \cs{@empty}, so usually the continuation counter is not
+% included in the caption label or references.
+% \begin{macrocode}
+\newcounter{continuedfloat}
+\let\c@ContinuedFloat\c@continuedfloat % defined for compatibility reasons
+\def\thecontinuedfloat{\theContinuedFloat}
+\let\theContinuedFloat\@empty % defined for compatibility reasons
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@reset@continuedfloat}
+% \changes{v3.2f}{2011/12/17}{Redefinition of \cs{continuedfloat} added}
+% |\caption@reset@continuedfloat|\marg{type}\par
+% If a continuation counter is defined, we reset it.
+% (This one will be called inside |\@caption|.)
+% \begin{macrocode}
+\newcommand*\caption@reset@continuedfloat[1]{%
+ \xdef\caption@CFtype{#1}%
+ \@stpelt{continuedfloat}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ContinuedFloat}
+% For compatibility reasons we still support |\Continued|\-|Float|.
+% \begin{macrocode}
+\def\ContinuedFloat{\continuedfloat} % defined for compatibility reasons
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ContinuedFloat}
+% \changes{v3.0f}{2005/06/11}{This macro added}
+% \changes{v3.3}{2013/12/16}{Bugfix: Revised and defined with \cs{def} instead of \cs{newcommand}}
+% |\caption@ContinuedFloat|\marg{type}\par
+% This one is used by \cs{ContinuedFloat} offered by the \package{subfig} package.
+% \begin{macrocode}
+\def\caption@ContinuedFloat{%
+ \let\caption@reset@continuedfloat\@gobble
+ \caption@@@continuedfloat}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\donemaincaptionfalse}
+% Since the \class{memoir} document class resets the sub-caption
+% counter at |\@float|, right after |\done|\-|main|\-|caption|\-|false|,
+% we save all sub-caption counters at |\done|\-|main|\-|caption|\-|false|
+% so we can restore them using |\caption@restore|\-|counters|
+% inside |\continued|\-|float|.
+% \begin{macrocode}
+\caption@ifdefined\donemaincaptionfalse{%
+ \g@addto@macro\donemaincaptionfalse\caption@savesubcounters}{}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Internal helpers}
+%
+% \begin{macro}{\caption@refstepcounter}
+% \changes{v3.1}{2007/07/28}{This macro added}
+% \changes{v3.2}{2010/10/26}{Error message moved from \cs{caption@@@settype} to here}
+% \changes{v3.2c}{2011/09/04}{Support of \cs{donemaincaptiontrue} from \textsf{memoir} document class added}
+% \changes{v3.3}{2011/12/28}{Usage of \cs{ifcaption@caption}, \cs{ifcaption@subcaption}, and \cs{ifcaption@ContinuedFloat} added}
+% Increments the float (i.e. |figure| or |table|) counter,
+% resets the continuation counter, and redefines itself to |\@gobble|.
+% \begin{macrocode}
+\newcommand*\caption@refstepcounter[1]{%
+ \@ifundefined{c@#1}%
+ {\caption@Error{No float type '#1' defined}}%
+ {\caption@ref@stepcounter{#1}%
+% \end{macrocode}
+% Set flag if this part of the figure (or table) contains a caption now.
+% (If |\caption@if|\-|top| is not set, |\caption| is at the bottom of this part,
+% therefore ending this part, so we set the flag to |false| in this case.)
+% \begin{macrocode}
+ \caption@fixposition
+ \caption@iftop\caption@setflag\caption@clrflag2% caption
+% \end{macrocode}
+% This part does not contain content (like sub-figures) yet,
+% so we set |\if|\-|caption@sub|\-|caption| to |false|.
+% \begin{macrocode}
+ \caption@clrflag4% subcaption
+% \end{macrocode}
+% Support of the \textsf{memoir} document class.
+% \begin{macrocode}
+ \@nameuse{donemaincaptiontrue}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@ref@stepcounter{%
+ \caption@ifflag1{% continued float
+ \let\caption@tempa\caption@@refcounter
+ \caption@clrflag1% continued float
+ }{%
+ \let\caption@tempa\caption@@refstepcounter
+ \caption@ifflag2{}{% caption
+ \caption@ifflag4{% subcaption
+% Counter was already incremented by content, so we suppress \stepcounter{#1} here
+ \let\caption@tempa\caption@@refcounter
+ }{}%
+ }%
+ }%
+ \caption@tempa}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@refcounter[1]{%
+ \let\caption@stepcounter@ORI\stepcounter
+ \def\stepcounter##1{%
+ \edef\caption@tempa{#1}% Backport of commit 43567491e5b075d661c080bca298f5428f289758 from 2020/09/28: \def -> \edef
+ \edef\caption@tempb{##1}% Backport of commit 43567491e5b075d661c080bca298f5428f289758 from 2020/09/28: \def -> \edef
+ \ifx\caption@tempa\caption@tempb \else
+ \caption@stepcounter@ORI{##1}%
+ \fi}%
+ \caption@@@refstepcounter{#1}%
+ \let\stepcounter\caption@stepcounter@ORI}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@refstepcounter[1]{%
+ \caption@prepare@stepcounter{#1}{ref}%
+ \caption@@@refstepcounter{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@stepcounter[1]{%
+ \caption@prepare@stepcounter{#1}{}%
+ \caption@@@stepcounter{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@prepare@stepcounter[2]{%
+ \caption@addsubcontentslines{#2stepcounter}%
+ \caption@reset@continuedfloat{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@refstepcounter{\refstepcounter}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@stepcounter{\stepcounter}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@dblarg}
+% \changes{v3.1}{2007/02/05}{This macro added}
+% \changes{v3.1f}{2007/12/06}{Bugfix 07-12-06: Changed so it works without \cs{kernel@ifnextchar}
+% (which was introduced in \LaTeXe\ 2004/01/23), too}
+% \changes{v3.3}{2012/03/25}{Support of option \opt{list-entry} added}
+% A |\relax| was added compared to |\@dblarg| so |\caption{}| will be
+% expanded to |\caption[\relax]{}| (and not to |\caption[]{}|).
+% Furthermore support for option \opt{list-entry} was added.
+% \begin{macrocode}
+\@ifundefined{kernel@ifnextchar}{\let\kernel@ifnextchar\@ifnextchar}{}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@dblarg[1]{%
+ \kernel@ifnextchar[{\caption@ydblarg{#1}}{\caption@xdblarg{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@xdblarg[2]{%
+ #1[{#2\relax}]{#2}}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@ydblarg#1[#2]#3{%
+ \caption@iflistheading{#1[{#3}]{#3}}{#1[{#2}]{#3}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@begin}
+% \changes{v3.0a}{2004/01/23}{\cs{caption@settype} changed to \cs{caption@setfloattype}}
+% \changes{v3.0e}{2005/04/12}{Check for default label format added}
+% \changes{v3.0f}{2005/06/11}{Usage of \cs{caption@resetContinuedFloat} added}
+% \changes{v3.1}{2007/05/09}{Usage of \cs{caption@setfloattype} \& \cs{caption@resetContinuedFloat} removed}
+% \changes{v3.3}{2011/12/29}{Usage of \cs{caption@fixedposition} removed}
+% Our handling of |\caption| will always be surrounded by
+% |\caption@begin| (or |\caption@beginex|) and |\caption@end|.\par
+% |\caption@begin|\marg{type} performs these tasks:
+% \begin{enumerate}
+% \item[1.] Override the |position=| setting, if necessary.
+% (for example if set to |auto| or used inside a |supertabular|)
+% \item[2.] Start a new group.
+% \item[3.] Define |\fnum@|\meta{type} if the caption label format is set
+% to non-default.
+% \end{enumerate}
+% \begin{macrocode}
+\newcommand*\caption@begin[1]{%
+ \caption@fixposition
+ \begingroup
+ \caption@setfnum{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@beginex}
+% \changes{v3.0b}{2004/05/16}{Support of \opt{listof=} added}
+% \changes{v3.0l}{2007/02/04}{Takes now 3 args instead of 2, check for empty heading added}
+% \changes{v3.1}{2007/07/01}{Makes lst-entry now instead of redefining \cs{addcontentsline}}
+% \changes{v3.2}{2010/10/26}{Bugfix 09-05-15: Setting of \cs{lst@@caption} added}
+% |\caption@beginex|\marg{type}\marg{list entry}\marg{heading}\par
+% performs the same tasks as |\caption@begin| and additionally:
+% \begin{enumerate}
+% \item[4.] Set |\lst@@caption|, so |\fnum@lstlisting| will include a numbering.
+% \item[5.] Make an entry in the list-of-whatever.
+% \item[6.] Set |\caption@ifempty| according argument \meta{heading}.
+% \end{enumerate}
+% \begin{macrocode}
+\newcommand\caption@beginex[3]{%
+ \caption@begin{#1}%
+ \let\lst@@caption\relax
+ \caption@addcontentsline{#1}{#2}%
+ \caption@ifempty{#3}{}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@end}
+% \changes{v3.3}{2011/12/29}{Usage of \cs{caption@fixedposition} removed}
+% |\caption@end| closes the group.
+% \begin{macrocode}
+\newcommand*\caption@end{%
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0a}{2004/01/23}{%
+% Internal hooks \cs{caption@@begin} \& \cs{caption@@end} added}
+% \changes{v3.0h}{2005/10/06}{%
+% Internal hooks \cs{caption@@begin} \& \cs{caption@@end} removed}
+%
+% \begin{macro}{\caption@setfnum}
+% \changes{v3.1}{2007/03/10}{This macro added}
+% |\caption@setfnum|\marg{type}\\
+% redefines |\fnum@|\meta{type} according the caption label format
+% set with |labelformat=|. But if |labelformat=default| is set,
+% |\fnum@|\meta{type} will not be overwritten by us.
+% \begin{macrocode}
+\newcommand*\caption@setfnum[1]{%
+ \@ifundefined{fnum@#1}{\iftrue}{\ifx\caption@lfmt\caption@lfmt@default\else}%
+ \@namedef{fnum@#1}{\caption@fnum{#1}}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@boxrestore}
+% \changes{v3.1}{2007/03/03}{This macro and its usage added}
+% \changes{v3.1b}{2007/09/17}{Bugfix: Redefinition of CR added}
+% \changes{v3.2}{2010/11/07}{Support of option \opt{parboxrestore} added}
+% The original code (from |latex/base/ltboxes.dtx|):
+% \begin{verbatim}
+% \def\@parboxrestore{\@arrayparboxrestore\let\\\@normalcr}
+% \def\@arrayparboxrestore{%
+% \let\if@nobreak\iffalse
+% \let\if@noskipsec\iffalse
+% \let\par\@@par
+% \let\-\@dischyph
+% \let\'\@acci\let\`\@accii\let\=\@acciii
+% \parindent\z@ \parskip\z@skip
+% \everypar{}%
+% \linewidth\hsize
+% \@totalleftmargin\z@
+% \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
+% \parfillskip\@flushglue \lineskip\normallineskip
+% \baselineskip\normalbaselineskip
+% \sloppy}
+% \end{verbatim}%^^A
+% This one will be used by |\@caption| instead of |\@parboxrestore|.
+% \begin{macrocode}
+\newcommand*\caption@boxrestore{%
+ \caption@parboxrestore{\@parboxrestore}{%
+ \let\if@nobreak\iffalse
+ \let\if@noskipsec\iffalse
+ \let\par\@@par
+% \let\-\@dischyph
+% \let\'\@acci\let\`\@accii\let\=\@acciii
+ \parindent\z@ \parskip\z@skip
+ \everypar{}%
+% \linewidth\hsize
+% \@totalleftmargin\z@
+ \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
+ \parfillskip\@flushglue \lineskip\normallineskip
+ \baselineskip\normalbaselineskip
+ \sloppy
+ \let\\\@normalcr
+ }}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@boxrestore@mini}
+% \changes{v3.2}{2010/10/24}{This macro added}
+% Resets \cs{par} so the very first \cs{par} in \cs{@caption} behaves quite the same as in floating environments.
+% Will be used by \cs{setcaptiontype}.
+% \begin{macrocode}
+\newcommand\caption@boxrestore@mini{%
+ \let\par\@@par
+ \parindent\z@ \parskip\z@skip
+ \sloppy}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@normalsize}
+% \changes{v3.1}{2007/05/05}{This macro and its usage added}
+% This one will be used by |\@caption| instead of |\normalsize|.\par
+% Its code is equivalent to
+% \begin{quote}
+% |\caption@font{normal}%|
+% \end{quote}
+% but executes faster (since the starred form of |\caption@font|
+% does not use |\setkeys| internally).
+% \begin{macrocode}
+\newcommand*\caption@normalsize{%
+ \caption@font*{\KV@caption@fnt@normal\@unused}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setfloatcapt}
+% Needed for support of the \package{float} package, where the caption will
+% not be typeset directly, but catched in a |\vbox| called |\@floatcapt|
+% instead.
+% \begin{macrocode}
+\let\caption@setfloatcapt\@firstofone
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makecurrent}
+% This one is needed for support of the \package{nameref} and \package{hyperref} package.
+% \changes{v3.2f}{2012/01/14}{Bugfix: Usage of \cs{caption@gettitle} added}
+% \begin{macrocode}
+\newcommand*\caption@makecurrent[1]{\caption@gettitle}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makeanchor}
+% \begin{macro}{\caption@start}
+% \begin{macro}{\caption@@start}
+% \begin{macro}{\caption@freezeHref}
+% \begin{macro}{\caption@defrostHref}
+% All these are needed for support of the \package{hyperref} package.
+% \begin{macrocode}
+\let\caption@makeanchor\@firstofone
+\let\caption@start\relax
+\let\caption@@start\relax
+\let\caption@freezeHref\relax
+\let\caption@defrostHref\relax
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@gettitle}
+% \changes{v3.1}{2007/05/05}{This macro and its usage added}
+% This one is needed for support of the \package{nameref} package.
+% \begin{macrocode}
+\newcommand\caption@gettitle[1]{%
+ \caption@ifdefined\NR@gettitle
+ {\NR@gettitle{#1}}%
+ {\def\@currentlabelname{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Support for sub-captions}
+% \changes{v3.1f}{2007/11/16}{Support for sub-captions added}
+%
+% \begin{macro}{\caption@subtypehook}
+% \changes{v3.1g}{2008/03/20}{Redefinition of \cs{caption@setlist} added}
+% \changes{v3.1k}{2009/10/09}{Bugfix 09-08-12b: \cs{@makecaption} will now be restored here, too}
+% \changes{v3.2}{2011/06/26}{Uses \cs{caption@@addcontentsline} instead of \cs{addcontentsline} now}
+% \changes{v3.2a}{2011/08/17}{Redefinition of \cs{phantomcaption} added}
+% \changes{v3.2a}{2011/08/17}{Usage of \cs{caption@warmup} added}
+% \changes{v3.2c}{2011/09/30}{Bugfix 11-09-26: Usage of \cs{if@subfloatrow} added}
+% \changes{v3.3}{2011/12/28}{Bugfix 11-12-16: \cs{caption@l@stepcounter} replaced by \cs{stepcounter}}
+% \changes{v3.3}{2012/03/15}{Usage of \cs{caption@setbox} added}
+% \changes{v3.3}{2013/05/01}{Redefinition of \cs{caption@settype} added}
+% \changes{v3.3}{2013/06/17}{Missing redefinition of \cs{captionlistentry} added}
+% \changes{v3.3}{2018/09/06}{Adapted to the \package{chkfloat} package}
+% \changes{v3.4f}{2020/01/03}{Redefinition of \cs{@caption} added since it was redefined by the \env{threeparttable} environment}
+% Hook, will be used inside \cs{caption@setsubtype}.\par
+% (Note: If we are inside an |sub|\-|float|\-|row| environment we have to keep
+% the |\@make|\-|caption| code of the \package{floatrow} package intact.)
+% \begin{macrocode}
+\newcommand*\caption@subtypehook{%
+ \ifx\caption\caption@subcaption \else
+ \caption@warmup
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@ifflag2{}{% caption
+% no \caption in this part of the (floating) environment yet
+ \let\caption@add@contentsline\caption@addsubcontentsline
+ \let\caption@addsubcontentslines\@gobble
+ \caption@ifflag4{}{% subcaption
+% no \subcaption in this part of the (floating) environment yet
+ \caption@ifflag1{% continued float
+ \caption@clrflag1%
+ }{%
+ \caption@@stepcounter\@captype
+ }%
+ \caption@setflag4% subcaption
+ }%
+ }%
+% \end{macrocode}
+% \begin{macrocode}
+ \c@continuedfloat=0\relax
+ \let\caption@setfloatcapt\@firstofone
+ \let\caption@chkfloat\@gobbletwo
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@setbox{none}%
+ \caption@clearmargin
+ \caption@iflist{}{\let\caption@setlist\@gobble}%
+ \caption@setoptions{sub}%
+ \caption@setoptions{subfloat}% for subfig-package compatibility
+% \end{macrocode}
+% \begin{macrocode}
+% redefine \setcaptiontype
+ \def\caption@settype{\caption@withoptargs\caption@sub@settype}%
+ \def\caption@sub@settype##1##2{%
+ \edef\caption@tempa{##2}%
+ \ifx\caption@tempa\@captype
+%%% \caption@setsubtype##1\relax
+ \else
+ \caption@Error{##2 inside \@subcaptype}%
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+% redefine \caption
+ \let\caption\caption@subcaption
+ \let\@caption\caption@@caption
+ \let\phantomcaption\caption@subphantom
+ \let\captionlistentry\caption@sublistentry
+% \let\@captype\@subcaptype
+ \let\caption@refstepcounter\caption@@@refstepcounter
+% \end{macrocode}
+% \begin{macrocode}
+% restore \@makecaption
+ \if@subfloatrow
+ \caption@Debug{Keeping \string\@makecaption}%
+ \else
+ \let\@makecaption\caption@makecaption
+ \fi
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@subfloatrow}
+% \changes{v3.2c}{2011/09/30}{This macro added}
+% This macro tests if we are inside an |sub|\-|float|\-|row| or |sub|\-|float|\-|row*| environment.
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \caption@ifundefined\@subfloatrowtrue
+ {\newif\if@subfloatrow
+ \caption@ifundefined\subfloatrow{}%
+ {\caption@Debug{Patching subfloatrow environment}%
+ \g@addto@macro\capsubrowsettings{\@subfloatrowtrue}%
+ \g@addto@macro\killfloatstyle{%
+ \ifx\c@FRobj\c@FRsobj\@subfloatrowtrue\fi}}}%
+ {\caption@Debug{\string\if@subfloatrow is already defined}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@subcaption}
+% Makes a sub-caption.
+% \begin{macrocode}
+\newcommand*\caption@subcaption{%
+ \caption@checkgrouplevel{sub}\subcaption
+ \caption@star
+ {\caption@refstepcounter\@subcaptype}%
+ {\caption@dblarg{\@caption\@subcaptype}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@subphantom}
+% \changes{v3.2a}{2011/08/17}{This macro added}
+% Same as |\phantomcaption|, but for sub-captions.
+% \begin{macrocode}
+\newcommand*\caption@subphantom{%
+ \caption@checkgrouplevel{sub}\phantomsubcaption
+ \caption@refstepcounter\@subcaptype}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@sublistentry}
+% \changes{v3.3}{2013/06/17}{This macro added}
+% Same as |\captionlistentry|, but for sub-captions.
+% \begin{macrocode}
+\newcommand*\caption@sublistentry{%
+ \caption@teststar\@subcaptionlistentry\@firstoftwo\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\@subcaptionlistentry[1]{%
+ \@testopt{\caption@listentry{#1}}\@subcaptype}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{caption@clearsubcontentslines}
+% Clear pending sub-caption list entries.
+% \begin{macrocode}
+\newcommand*\caption@clearsubcontentslines{%
+ \global\let\caption@subcontentslines\@empty}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@clearsubcontentslines
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@addsubcontentsline}
+% \changes{v3.1i}{2008/08/02}{Bugfix 08-07-28:
+% \cs{label}, \cs{index}, and \cs{glossary} are allowed inside the list entry now}
+% \changes{v3.2}{2011/06/26}{Uses \cs{caption@@addcontentsline} instead of \cs{addcontentsline} now}
+% \changes{v3.2c}{2011/08/19}{Uses \cs{caption@gobble} instead of \cs{@gobble} now}
+% \changes{v3.3}{2012/01/15}{Debug message added}
+% \changes{v3.3}{2013/03/10}{A single \cs{protect} replaced by \cs{noexpand}}
+% Add a pending sub-caption list entry.
+% \begin{macrocode}
+\newcommand*\caption@addsubcontentsline[4]{%
+ \caption@Debug{\string\caption@addsubcontentsline{#1}{#2}}%
+ \begingroup
+ \let\label\caption@gobble
+ \let\index\caption@gobble
+ \let\glossary\caption@gobble
+ \protected@edef\@tempa{\endgroup
+ \noexpand\g@addto@macro\noexpand\caption@subcontentslines{%
+ \noexpand\@namedef{the#2}{\csname the#2\endcsname}%
+ \ifx\@currentHref\@undefined \else
+ \noexpand\def\noexpand\@currentHref{\@currentHref}%
+ \fi
+ \noexpand\caption@@@addcontentsline{#1}{#2}{#3}{#4}}}%
+ \@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\flushsubcaptionlistentries}
+% \changes{v3.3}{2012/01/15}{Renamed from \cs{caption@addsubcontentslines} to \cs{flushsubcaptionlistentries}}
+% \changes{v3.3}{2013/03/10}{Bugfix: Missing redefinition of \cs{caption@addsubcontentslines} added}
+% Writes pending sub-caption list entries.
+% \begin{macrocode}
+\newcommand*\flushsubcaptionlistentries{%
+ \caption@addsubcontentslines{user}}
+% \end{macrocode}
+% \begin{macrocode}
+\renewcommand*\caption@addsubcontentslines[1]{%
+ \caption@Debug{\string\flushsubcaptionlistentries (#1)}%
+ \begingroup
+ \caption@subcontentslines
+ \endgroup
+ \caption@clearsubcontentslines}
+% \end{macrocode}
+% We need to patch \cs{chapter} otherwise a vertical gap will be inserted into
+% the list prior pending sub-caption list entries.
+% We do this |\At|\-|Begin|\-|Document| so packages like \package{newfloat}
+% will not complain about an unknown document class.
+% \begin{macrocode}
+\AtBeginDocument{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@ifdefined\chapter{%
+ \let\caption@chapter@ORI\chapter
+ \def\chapter{%
+ \caption@addsubcontentslines{chapter}\caption@chapter@ORI}}{}%
+% \end{macrocode}
+% Same for \cs{appendix}.
+% \begin{macrocode}
+ \caption@ifdefined\appendix{%
+ \let\caption@appendix@ORI\appendix
+ \def\appendix{%
+ \caption@addsubcontentslines{appendix}\caption@appendix@ORI}}{}%
+% \end{macrocode}
+% Flush the list of pending sub-caption list entries at the end of the document.
+% \begin{macrocode}
+ \caption@addsubcontentslines{AtEndDocument}%
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \section{Document class \& Babel package support}
+%
+% \subsection{The \AmS{} \& \SmF{} classes}
+% \changes{v3.1}{2007/07/29}{\AmS\ \& \SmF\ classes support added}
+%
+% \begin{macrocode}
+\caption@ifdefined\smf@makecaption{\let\smf@makecaption\@makecaption}{}
+% \end{macrocode}
+%
+% \subsection{The beamer class}
+% \changes{v3.1}{2007/03/10}{beamer class support added}
+%
+% \begin{macrocode}
+\@ifclassloaded{beamer}{%
+ \caption@InfoNoLine{beamer document class}%
+% \end{macrocode}
+%
+% \begin{macro}{\figure}
+% \changes{v3.1f}{2007/12/17}{This re-definition for \class{beamer} document class added}
+% \changes{v3.3d}{2019/09/01}{This re-definition for \class{beamer} document class revised}
+% We redefine |figure| so our type-specific options will be used etc.
+% \begin{macrocode}
+ \let\caption@ORI@figure\figure
+ \def\figure{\caption@settype{figure}\caption@ORI@figure}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\table}
+% \changes{v3.1f}{2007/12/17}{This re-definition for \class{beamer} document class added}
+% \changes{v3.3d}{2019/09/01}{This re-definition for \class{beamer} document class revised}
+% \changes{v3.4a}{2019/10/18}{Bug fixed which was introduced in previous revision}
+% We redefine |table| so our type-specific options will be used etc.
+% \begin{macrocode}
+ \let\caption@ORI@table\table
+ \def\table{\caption@settype{table}\caption@ORI@table}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The \KOMAScript{} classes}
+%
+% \KOMAScript\ contains the code
+% |\AtBeginDocument{\let\scr@caption\caption}|
+% so we need to update |\scr@caption| here, too.
+%
+% \begin{macrocode}
+\caption@ifdefined\scr@caption{%
+ \caption@AtBeginDocument{\let\scr@caption\caption}}{}
+% \end{macrocode}
+%
+% \subsection{The frenchb Babel option}
+% \changes{v3.1}{2006/05/14}{Adaptation to \package{frenchb} added}
+%
+% Suppress
+% ``Package |frenchb.ldf| Warning: The definition of |\@makecaption| has been
+% changed, frenchb will NOT customize it.''
+% (but only if we emulate this customization)
+% \begin{macrocode}
+\@nameuse{caption@frenchb}\@nameundef{caption@frenchb}
+% \end{macrocode}
+%
+% \subsection{The frenchle/pro package}
+% \changes{v3.0h}{2005/10/03}{Adaptation to \package{frenchle/pro} added}
+%
+% \begin{macrocode}
+\caption@AtBeginDocument{\caption@ifdefined\frenchTeXmods{%
+ \caption@InfoNoLine{frenchle/pro package is loaded}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \let\captionfont@ORI\captionfont
+ \let\captionlabelfont@ORI\captionlabelfont
+ \let\@makecaption@ORI\@makecaption
+% \end{macrocode}
+
+% If |\GOfrench| is defined as |\relax| all the re-definitions regarding
+% captions have already been done, so we can do our patches immediately.
+% Otherwise we must add our stuff to |\GOfrench|.
+% \begin{macrocode}
+ \caption@ifdefined\GOfrench
+ {\def\caption@tempa{\g@addto@macro\GOfrench}}%
+ {\let\caption@tempa\@firstofone}%
+ \caption@tempa{%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \let\captionfont\captionfont@ORI
+ \let\captionfont@ORI\@undefined
+ \let\captionlabelfont\captionlabelfont@ORI
+ \let\captionlabelfont@ORI\@undefined
+ \let\@makecaption\@makecaption@ORI
+ \let\@makecaption@ORI\@undefined
+% \end{macrocode}
+%
+% \begin{macro}{\@cnORI}
+% We update the definition of |\@cnORI| so it actually reflects
+% our definition of |\caption|.
+% \begin{macrocode}
+ \let\@cnORI\caption
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@tablescaption}
+% The \package{frenchle/pro} package sets |\caption| to |\@tablescaption| at
+% |\begin{table}| for special treatment of footnotes.
+% Therefore we have to patch |\@tablescaption| so |\caption*| will work
+% inside the |table| environment.
+% \begin{macrocode}
+ \let\caption@tcORI\@tablescaption
+ \def\@tablescaption{\caption@star\relax\caption@tcORI}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\f@ffrench}
+% \begin{macro}{\f@tfrench}
+% |\f@ffrench| and |\f@tfrench| reflect |\fnum@figure| and |\fnum@table|
+% when used in French mode. These contain additional code which typesets
+% the caption separator |\captionseparator| instead of the usual colon.
+% Because this breaks with our |\@makecaption| code we have to remove
+% this additional code here.
+% \begin{macrocode}
+ \let\@eatDP\@undefined
+ \let\caption@tempa\@empty
+ \ifx\f@ffrench\fnum@figure
+ \l@addto@macro\caption@tempa{\let\fnum@figure\f@ffrench}%
+ \fi
+ \ifx\f@tfrench\fnum@table
+ \l@addto@macro\caption@tempa{\let\fnum@table\f@tfrench}%
+ \fi
+ \def\f@ffrench{\ifx\listoffigures\relax\else\figurename~\thefigure\fi}%
+ \def\f@tfrench{\ifx\listoftables\relax\else\tablename~\thetable\fi}%
+ \caption@tempa
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+ }%
+}{}}
+% \end{macrocode}
+%
+% \subsection{The hungarian and magyar Babel option}
+% \changes{v3.2}{2009/03/29}{\package{magyar} package support added}
+% \changes{v3.3}{2018/08/26}{\package{magyar} package support revised}
+%
+% \begin{macrocode}
+\def\caption@tempa#1{%
+ \@ifpackagewith{babel}{#1}{%
+ \caption@InfoNoLine{#1 babel option is loaded}%
+ \expandafter\addto\csname extras#1\endcsname{%
+ % reverse changes made by magyar.ldf
+ \let\@makecaption\caption@makecaption
+ \babel@save\@makecaption
+ \caption@redefine
+ \babel@save\@caption}%
+ }{}}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@tempa{hungarian}%
+\caption@tempa{magyar}%
+% \end{macrocode}
+%
+% \section{Package support}
+% \changes{v3.1}{2007/04/11}{Package options `float', `longtable' etc.
+% are not supported anymore, removed}
+%
+% \begin{macro}{\caption@IfPackageLoaded}
+% \changes{v3.0f}{2005/05/29}{3rd argument \meta{code} added,
+% so no extra check is needed}
+% \changes{v3.1}{2007/07/04}{Re-written \& renamed from \cs{caption@ifpackage}
+% to \cs{caption@IfPackageLoaded}}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
+% |\caption@IfPackageLoaded|\marg{package}\oarg{version}\marg{true}\marg{false}\par
+% Some kind of combination of |\@ifpackageloaded| and |\@ifpackagelater|.
+% If the \meta{package} is not loaded yet, the check will be (re-)done
+% |\AtBeginDocument|, so the \meta{package} could be loaded later on, too.
+% \begin{macrocode}
+\newcommand\caption@IfPackageLoaded[1]{%
+ \@testopt{\caption@@IfPackageLoaded{#1}}{}}
+\@onlypreamble\caption@IfPackageLoaded
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@IfPackageLoaded#1[#2]#3#4{%
+ \@ifpackageloaded{#1}\@firstofone{%
+ \caption@Debug{#1 package is not loaded (yet)\@gobble}%
+ \caption@AtBeginDocument}{%
+ \caption@If@Package@Loaded{#1}[{#2}]{#3}{#4}}}
+\@onlypreamble\caption@@IfPackageLoaded
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@If@Package@Loaded#1[#2]{%
+ \@ifpackageloaded{#1}{%
+ \caption@InfoNoLine{#1 package is loaded}%
+ \@ifpackagelater{#1}{#2}\@firstoftwo{%
+ \caption@Error{%
+ For a successful cooperation we need at least version\MessageBreak
+ `#2' of package #1,\MessageBreak
+ but only version\MessageBreak
+ `\csname ver@#1.\@pkgextension\endcsname'\MessageBreak
+ is available}%
+ \@secondoftwo}%
+ }{\@secondoftwo}}
+\@onlypreamble\caption@If@Package@Loaded
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@clearmargin}
+% \changes{v3.1}{2007/05/05}{This macro and its usage added}
+% This macro will be used by some package support stuff where the usual
+% margin setting is not welcome, e.g. in the \package{sidecap} package.
+% \begin{macrocode}
+\newcommand*\caption@clearmargin{%
+ \setcaptionmargin\z@
+ \let\caption@minmargin\@undefined}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@setbool{needfreeze}{0}
+\caption@AtBeginDocument*{%
+ \caption@ifneedfreeze{%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@freezetype}
+% \changes{v3.3}{2013/05/01}{This macro added}
+% |\caption@freezetype|\marg{type}\par
+% Used by the \package{fltpage} \& \package{sidecap} package support.
+% \begin{macrocode}
+ \newcommand*\caption@freezetype[1]{%
+ \caption@settype*{#1}%
+ \captionsetup*[sub]{hypcap=true}% Note: This is just a (q&d) workaround!
+ \caption@freeze}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@freeze}
+% \changes{v3.1}{2007/07/22}{This macro added}
+% \changes{v3.1c}{2007/10/06}{\cs{caption} \& \cs{@caption} revised for enhanced compatibility}
+% \changes{v3.1c}{2007/10/06}{Bugfix: Made \cs{@caption} long}
+% \changes{v3.1f}{2007/11/16}{Uses `space hack' instead of \cs{ignorespaces} now}
+% \changes{v3.1g}{2008/01/29}{Starred variants of \cs{ContinuedFloat} and \cs{captionsetup} added}
+% \changes{v3.2}{2010/10/26}{Bugfix 10-09-01a: Uses \cs{ignorespaces} instead of `space hack' again}
+% \changes{v3.2a}{2011/08/17}{Starred variant of \cs{caption@freeze} removed}
+% \changes{v3.2b}{2011/08/18}{Redefines \cs{caption@setup} instead of \cs{captionsetup} now}
+% \changes{v3.2b}{2011/08/18}{Redefinition of \cs{label} revised}
+% \changes{v3.2c}{2011/08/21}{Revised}
+% \changes{v3.3}{2013/01/06}{Adapted to new switch \cs{caption@caption} etc.}
+% |\caption@freeze|\par
+% Used by the \package{bicaption} package.
+% \begin{macrocode}
+ \newcommand*\caption@freeze{%
+ \let\caption@frozen@continuedfloat\continuedfloat
+ \def\continuedfloat{%
+ \caption@@freeze{\caption@@@@continuedfloat\@captype}%
+ \caption@frozen@continuedfloat}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@frozen@setup\caption@setup
+ \def\caption@setup##1{%
+ \caption@@freeze{\caption@setup{##1}}%
+ \caption@frozen@setup{##1}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@frozen@caption\caption
+ \def\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}%
+% \end{macrocode}
+% \begin{macrocode}
+ \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}}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \global\let\caption@frozen@content\@empty
+ \long\def\caption@@freeze{%
+ \g@addto@macro\caption@frozen@content}%
+% \end{macrocode}
+% \begin{macrocode}
+ \def\caption@warmup{%
+ \let\continuedfloat\caption@frozen@continuedfloat
+ \let\caption@setup\caption@frozen@setup
+ \let\caption\caption@frozen@caption
+ \let\label\caption@frozen@label}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@prepare@defrost}
+% \changes{v3.3}{2013/01/06}{This macro added}
+% Prevent resetting the caption flags
+% \begin{macrocode}
+ \newcommand*\caption@prepare@defrost{%
+ \let\caption@settype\caption@set@type}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@defrost}
+% \changes{v3.1}{2007/07/22}{This macro added}
+% \changes{v3.1g}{2008/01/30}{\cs{caption@defrost@setup} added}
+% \changes{v3.2c}{2011/08/21}{Adapted to changes of \cs{caption@freeze}}
+% \changes{v3.2c}{2011/08/21}{\cs{caption@defrost@setup} removed}
+% |\caption@defrost|
+% \begin{macrocode}
+ \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}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ }{}%
+ \caption@undefbool{needfreeze}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@warmup}
+% \changes{v3.2a}{2011/08/17}{This macro added}
+% |\caption@warmup|
+% \begin{macrocode}
+\let\caption@warmup\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{The changepage package}
+% \changes{v3.4k}{2020/05/30}{Patch of the \package{changepage} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{changepage}[2008/07/23 memoir-v3.7k]{%
+% \end{macrocode}
+%
+% Both environments, \env{adjustwidth} and \env{adjustwidth*}, are starting a \env{list} \cs{item}.
+% But \cs{hsize} isn't set properly inside a \env{list} item, and therefore \cs{@makecaption}
+% (offered by document classes) doesn't work properly when used inside \env{adjustwidth}.
+% Therefore we try to detect the situation ``Are we inside a adjustwidth environment?''
+% inside \cs{@makecaption} and fix this. (Sigh!)
+%
+% We cannot simply set and test a flag here since our adjustment to \cs{hsize} should
+% not be done within a \cs{parbox} within a adjustwidth environment for example,
+% and therefore we store \cs{hsize} and \cs{linewidth}, and test \cs{hsize} and \cs{linewidth}
+% against the stored values instead. If they are equal we are (hopefully) quite save
+% to assume that we are now inside a plain \env{adjustwidth} environment and therefore need
+% to fix \cs{hsize} before typesetting the caption. (Deep sigh!)
+%
+% \begin{macro}{\caption@adjustwidth@hsize}
+% \begin{macro}{\caption@adjustwidth@linewidth}
+% \begin{macrocode}
+ \newdimen\caption@adjustwidth@hsize
+ \newdimen\caption@adjustwidth@linewidth
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@set@adjustwidth}
+% \changes{v3.4k}{2020/05/30}{This macro and its usage added}
+% Store the values of \cs{hsize} and \cs{linewidth}.
+% \begin{macrocode}
+ \providecommand*\caption@set@adjustwidth{%
+ \caption@adjustwidth@hsize\hsize
+ \caption@adjustwidth@linewidth\linewidth}%
+% \end{macrocode}
+% \begin{macrocode}
+ \providecommand*\caption@patch@changepage[1]{%
+ \expandafter\let\csname caption@#1\expandafter\endcsname\csname #1\endcsname
+ \expandafter\renewcommand\csname #1\endcsname[2]{%
+ \@nameuse{caption@#1}{##1}{##2}%
+ \caption@set@adjustwidth}}%
+ \caption@patch@changepage{adjustwidth}%
+ \caption@patch@changepage{adjustwidth*}%
+ \let\caption@patch@changepage\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@test@adjustwidth}
+% \changes{v3.4k}{2020/05/30}{This macro and its usage added}
+% Test if the values of \cs{hsize} and \cs{linewidth} are identical to
+% the ones stored in the \env{adjustwidth} environment.
+% If yes, set \cs{hsize} to the correct value.
+% \begin{macrocode}
+ \providecommand\caption@test@adjustwidth{%
+ \ifdim\hsize=\caption@adjustwidth@hsize
+ \ifdim\linewidth=\caption@adjustwidth@linewidth
+ \hsize=\linewidth
+ \fi
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+ \AtBeginCaption{\caption@test@adjustwidth}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ }{}%
+% \end{macrocode}
+%
+% \subsection{The chkfloat package}
+% \changes{v3.3}{2018/09/06}{Support of the \package{chkfloat} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{chkfloat}[2012/08/19 v0.1]{%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@chkfloat}
+% \changes{v3.3}{2018/09/06}{This macro added}
+% \begin{macrocode}
+ \caption@ifdefined\chkfloat@addcontentsline{%
+ \renewcommand\caption@chkfloat{\chkfloat@addcontentsline}%
+ }{%
+ \renewcommand\caption@chkfloat[2]{%
+ \caption@ifdefined\chkfloat@page{%
+ \addtocontents{fof}{\protect\chkfloat@{\thepage}{\chkfloat@page}{\csname fnum@#1\endcsname: #2}}%
+ }{}}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ }{}%
+% \end{macrocode}
+%
+% \subsection{The float package}
+% \changes{v3.0f}{2005/05/31}{\package{float} package support rewritten and improved}
+% \iffalse
+% (This is a more straight-ahead implementation, but it only works with v1.3
+% now, so v1.2 is no longer supported. The old code including documentation
+% can be found in caption-30f-050530.zip)
+% \fi
+%
+% The \package{float} package usually do not use the \LaTeX\ kernel command
+% |\@caption| to typeset the caption but |\float@caption| instead.
+% (|\@caption| will only be used if the float is re-styled with
+% |\restylefloat*|.)
+%
+% The main two things |\float@caption| is doing different are:
+% \begin{itemize}
+% \item The caption will be typeset inside a |\savebox| called |\@floatcapt|
+% so it can be placed above or below the float contents afterwards.
+% \item |\@makecaption| will not be used to finally typeset the caption.
+% Instead |\@fs@capt| will be used which definition is part of the float
+% style.
+% (Note that |\@fs@capt| will not typeset any vertical space above or below
+% the caption; instead this space will be typeset by the float style code
+% itself.)
+% \end{itemize}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{float}[2001/11/08 v1.3d]{%
+ \@ifpackageloaded{floatrow}{%
+ \caption@If@Package@Loaded{floatrow}[2007/08/24 v0.2a]{}{}%
+ }{%
+% \end{macrocode}
+%
+% \begin{macro}{\@float@setevery}
+% \changes{v3.1k}{2009/10/09}{Bugfix 08-12-05: \cs{color@begin/endgroup} added
+% to redefinition of \cs{caption@setfloatcapt}}
+% \changes{v3.4b}{2019/12/16}{Usage of \cs{caption@float@setname} added}
+% |\@float@setevery|\marg{float type} is provided by the \package{float}
+% package; it's called every time a floating environment defined with
+% |\newfloat| or |\restylefloat| begins.
+% We use this hook to do some adaptations and to setup the proper caption
+% style (if defined) and additional settings declared with
+% |\captionsetup|\oarg{float style}.
+% \begin{macrocode}
+ \let\caption@ORI@float@setevery\@float@setevery
+ \def\@float@setevery#1{%
+ \float@ifcaption{#1}{%
+% \end{macrocode}
+%
+% First of all we set the caption position to it's proper value by
+% converting |\@fs@iftopcapt| (which is part of a float style and
+% controls where the caption will be typeset, above or below the float
+% contents) to our |position=| setting.
+% Since the spacing above and below the caption will be done by the float
+% style and \emph{not} by us this sounds quite useless. But in fact it isn't,
+% since some packages based on \thispackage\ (like the \package{subfig}
+% package) could have an interest for this information and therefore use the
+% |\caption@iftop| macro we provide in our kernel. Furthermore we need this
+% information for ourself in |\captionof| which uses |\@makecaption| to
+% finally typeset the caption with skips.
+% \begin{macrocode}
+ \caption@setposition{\@fs@iftopcapt t\else b\fi}%
+% \end{macrocode}
+%
+% Afterward we redefine |\caption@setfloatcapt| (which will be used inside
+% |\@caption|) so the caption will be set inside the box |\@floatcapt|,
+% without extra vertical space.
+% \begin{macrocode}
+ \renewcommand\caption@setfloatcapt[1]{%
+ \let\@makecaption\caption@@make
+ \global\setbox\@floatcapt\vbox{%
+ \color@begingroup ##1\color@endgroup}}%
+% \end{macrocode}
+%
+% To allow different caption styles for different float styles we also
+% determine the current float style (e.g. `ruled') and select
+% a caption style (and additional settings) with the same name, if defined.
+% \begin{macrocode}
+ \float@getstyle\float@style{#1}%
+ \caption@setstyle*\float@style
+ \caption@setoptions\float@style
+% \end{macrocode}
+%
+% \begin{macrocode}
+ }{}%
+ \caption@float@setname{#1}%
+ \caption@freezeHref % will be defrosted in \float@makebox
+ \caption@ORI@float@setevery{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\float@makebox}
+% \changes{v3.3}{2013/01/06}{Corrects wrong load order hyperref-float now}
+% \changes{v3.3}{2013/02/03}{Correction of wrong load order hyperref-float revised}
+% Redefine |\float@makebox| (only if we are not operating in compatibility mode).
+% \begin{macrocode}
+ \caption@AtBeginDocument{\caption@ifcompatibility{}{%
+% \end{macrocode}
+% If it was redefined by the \package{hyperref} package,
+% we need to build on the original definition (and not on the redefined one).
+% \begin{macrocode}
+ \caption@ifdefined\HyOrg@float@makebox
+ {\let\caption@ORI@float@makebox\HyOrg@float@makebox}%
+ {\let\caption@ORI@float@makebox\float@makebox}%
+ \renewcommand\float@makebox[1]{%
+ \caption@ORI@float@makebox{#1\relax \caption@defrostHref}}%
+% \end{macrocode}
+% \begin{macrocode}
+ }}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@float@setname}
+% \changes{v3.1}{2007/07/08}{float package hook added}
+% \changes{v3.4b}{2019/12/16}{Renamed from \cs{caption@typehook} to \cs{caption@float@setname}}
+% \LaTeX\ and almost every other packages use
+% |\|\meta{type}|name|
+% to provide a macro for the type resp.~environment name -- for example
+% the command |\figurename| will usually contain the name of the floating
+% environment |figure|:
+% \begin{quote}
+% |\newcommand\figurename{Figure}|
+% \end{quote}
+% But the \package{float} package doesn't follow this common naming
+% convention:
+% For floats defined with |\newfloat| it uses |\fname@|\meta{type} instead,
+% which breaks with our code (and with |\autoref| and some other things as
+% well).
+% So we have to map the \package{float} package name to the common one here.\par
+% \Note{If the float was not defined with \cs{newfloat} but with
+% \cs{restylefloat} instead, \cs{fname@}\meta{type} is not defined.}
+% \begin{macrocode}
+ \newcommand*\caption@float@setname[1]{%
+ \expandafter\ifx\csname #1name\endcsname\relax
+ \expandafter\let\csname #1name\expandafter\endcsname
+ \csname fname@#1\endcsname
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0f}{2005/06/26}{Skips of \env{plaintop} and \env{boxed} floats corrected}
+% \begin{macro}{\fs@plaintop}
+% \begin{macro}{\fs@boxed}
+% Since the float styles |plaintop| and |boxed| don't use |\abovecaptionskip|
+% which could be set with |skip=| (|plaintop| uses |\belowcaptionskip| instead of
+% |\abovecaptionskip|, and |boxed| uses a fixed space of |2pt|)
+% we patch the according float style macros here to change this.
+% \begin{macrocode}
+ \g@addto@macro\fs@plaintop{\def\@fs@mid{\vspace\abovecaptionskip\relax}}%
+ \g@addto@macro\fs@boxed{\def\@fs@mid{\kern\abovecaptionskip\relax}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\float@getstyle}
+% \changes{v3.1}{2007/06/10}{This macro added}
+% |\float@getstyle|\marg{cmd}\marg{type}\par
+% Determining the float style is not so easy because the only hint
+% provided by the \package{float} package is the macro
+% |\fst@|\meta{float type} which points to the macro which represents the
+% float style. So for example after
+% \begin{quote}
+% |\floatstyle{ruled}|\\
+% |\newfloat{Program}{tbp}{lop}|
+% \end{quote}
+% |\fst@Program| will be defined as
+% \begin{quote}
+% |\def\fst@Program{\fs@ruled}|\quad.
+% \end{quote}\par
+% So here is what we do: We make the first level expansion of
+% |\fst@|\meta{float type} a string so we can gobble the first four tokens
+% (= |\fs@|), so only the the name of the float style is left.\par
+% \emph{TODO:} We need to convert the catcodes here.
+% \begin{macrocode}
+ \providecommand*\float@getstyle[2]{%
+ \edef#1{%
+ \noexpand\expandafter\noexpand\@gobblefour\noexpand\string
+ \expandafter\expandafter\expandafter\noexpand
+ \csname fst@#2\endcsname}%
+ \edef#1{#1}%
+ \caption@Debug{floatstyle{#2} = `#1'}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\float@ifcaption}
+% \changes{v3.1}{2007/06/23}{This macro added}
+% |\float@ifcaption|\marg{type}\marg{if-clause}\marg{else-clause}\par
+% Here we determine if the user has used |\newfloat| resp.~|\restylefloat|,
+% or |\restylefloat*|.
+% This is quite easy: If |\@float@c@|\meta{captype} is the same as
+% |\float@caption|, the user has used |\newfloat| or |\restylefloat|,
+% otherwise we assume he has used |\restylefloat*|.
+% (This test will fail if some package re-defines |\float@caption|,
+% so we have to assume that there is no one.)
+% \begin{macrocode}
+ \providecommand*\float@ifcaption[1]{%
+ \expandafter\ifx\csname @float@c@#1\endcsname\float@caption
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}}{%
+ \providecommand*\float@ifcaption[1]{\@secondoftwo}%
+% \clearcaptionsetup{boxed}% used by the floatrow package?
+}
+% \end{macrocode}
+%
+% The skip between `boxed' floats and their caption defaults to |2pt|.
+%
+% \begin{macrocode}
+\captionsetup[boxed]{skip=2pt} % do not issue a warning when not used
+% \end{macrocode}
+%
+% \changes{v3.0f}{2005/05/26}{\opt{strut=0} added to caption style \opt{ruled}}
+% \changes{v3.0f}{2005/05/27}{Option \opt{ruled} fixed}
+% To emulate the `ruled' definition of |\@fs@capt| we provide a caption style
+% `ruled' with appropriate options. But if the package option |ruled| was
+% specified, we setup some caption parameters to emulate the behavior
+% of \thispackage\ \version{1.x} option |ruled| instead, i.e.,
+% the current caption settings will be used, but without margin and without
+% `single-line-check'.
+% \begin{macrocode}
+\caption@ifbool{ruled}{%
+ \captionsetup[ruled]{margin=0pt,minmargin=0,slc=0}%
+}{%
+ \DeclareCaptionStyle{ruled}{labelfont=bf,labelsep=space,strut=0}%
+}
+\caption@undefbool{ruled}
+% \end{macrocode}
+%
+% \subsection{The floatflt package}
+% \changes{v3.1}{2007/06/10}{Support of the \package{floatflt} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{floatflt}[1996/02/27 v1.3]{%
+% \end{macrocode}
+%
+% \begin{macro}{\floatingfigure}
+% We patch |\floatingfigure| so |\caption@floatflt| will be used.
+% \begin{macrocode}
+ \let\caption@ORI@floatingfigure\floatingfigure
+ \def\floatingfigure{%
+ \caption@floatflt{figure}%
+ \caption@ORI@floatingfigure}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\floatingtable}
+% Same with |\floatingtable|\ldots
+% \begin{macrocode}
+ \let\caption@ORI@floatingtable\floatingtable
+ \def\floatingtable{%
+ \caption@floatflt{table}%
+% \caption@setautoposition b%
+ \caption@ORI@floatingtable}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@floatflt}
+% \changes{v3.1c}{2007/10/06}{Bugfix: \cs{caption@clearmargin} added}
+% Here we do two things:
+% \begin{enumerate}
+% \item We use |\caption@set|\-|options{|\-|floating|\meta{type}|}| so
+% |\caption|\-|setup[|\-|floating|\meta{type}|]{|\ldots|}| is supported.
+% \item |\line|\-|width| must be set correctly.
+% Usually this is done by |\@par|\-|box|\-|restore| inside |\@caption|,
+% but since we use |\@caption@box|\-|restore| we have to map this to
+% |\@par|\-|box|\-|restore| instead.
+% \end{enumerate}
+% \begin{macrocode}
+ \newcommand*\caption@floatflt[1]{%
+ \caption@settype{#1}%
+ \caption@clearmargin
+ \caption@setfullparboxrestore
+ \caption@setoptions{floating#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The fltpage package}
+% \changes{v3.1}{2007/07/22}{Support of the \package{fltpage} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{fltpage}[1998/10/29 v.0.3]{%
+ \caption@setbool{needfreeze}{1}%
+% \end{macrocode}
+%
+% \begin{macro}{\FP@positionLabel}
+% \changes{v3.2c}{2011/08/28}{This redefinition added}
+% Original code:
+% \begin{verbatim}
+% \newcommand{\FP@positionLabel}{%
+% FP\@captype-\number\value{FP@\@captype C}-pos}
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \renewcommand\FP@positionLabel{%
+ FP\FP@captype-\number\value{FP@\FP@captype C}-pos}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FP@helpNote}
+% Original code:
+% \begin{verbatim}
+% \newcommand{\FP@helpNote}[2]{%
+% \typeout{FP#1 is inserted on page \pageref{#2}!}}%
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \renewcommand\FP@helpNote[2]{%
+ \begingroup % save \caption@thepage
+ \caption@pageref{#2}%
+ \typeout{FP#1 is inserted on page \caption@thepage!}%
+ \endgroup}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FP@floatBegin}
+% \changes{v3.1f}{2007/11/16}{Uses `space hack' instead of \cs{ignorespaces} now}
+% \changes{v3.1k}{2009/10/09}{Bugfix 09-09-11: Missing \cs{ignorespaces} added}
+% \changes{v3.2c}{2011/08/28}{Adapted to current version of \cs{caption@freeze}}
+% \changes{v3.2f}{2012/02/19}{Bugfix 12-02-16: \texttt{minipage} environment added}
+% \changes{v3.3}{2013/05/01}{Usage of \cs{caption@freeze} replaced by \cs{caption@freezetype}}
+% Original code:
+% \begin{verbatim}
+% \newcommand{\FP@floatBegin}[1]{%
+% \gdef\@captype{#1}%
+% \global\let\FP@savedCaptionCommand\caption%
+% \global\let\FP@savedLabelCommand\label%
+% \ifthenelse{\equal{\@captype}{figure}}
+% {\global\let\old@Fnum\fnum@figure}%
+% {\global\let\old@Fnum\fnum@table}%
+% \let\FP@LabelText\@empty%
+% \let\FP@CaptionText\@empty%
+% \let\FP@optionalCaptionText\@empty%
+% \renewcommand\label[1]{\gdef\FP@LabelText{##1}}%
+% \renewcommand\caption[2][]{%
+% \gdef\FP@optionalCaptionText{##1}\gdef\FP@CaptionText{##2}}%
+% \begin{lrbox}{\FP@floatCorpusBOX}%
+% }%
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \renewcommand*\FP@floatBegin[1]{%
+ \def\FP@captype{#1}%
+ \begin{lrbox}{\FP@floatCorpusBOX}%
+ \minipage\hsize % changes from LR mode to vertical mode
+ \caption@freezetype{#1}%
+ \ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FP@floatEnd}
+% \changes{v3.1g}{2008/01/30}{Some minor bugfixes}
+% \changes{v3.2c}{2011/08/28}{Adapted to current version of \cs{caption@freeze}}
+% \changes{v3.2f}{2012/02/19}{Bugfix 12-02-16: \texttt{minipage} environment added}
+% Original code:
+% \begin{verbatim}
+% \newcommand{\FP@floatEnd}{%
+% \end{lrbox}%
+% \global\setbox\FP@floatCorpusBOX=\box\FP@floatCorpusBOX
+% \stepcounter{FP@\@captype C}%
+% \FP@savedLabelCommand{\FP@positionLabel}%
+% \FP@helpNote{\@captype}{\FP@positionLabel}%
+% \FP@float
+% {\FP@positionLabel}% location label test
+% {\begin{\@captype}[p!]
+% \usebox{\FP@floatCorpusBOX}%
+% \refstepcounter{\@captype}%
+% \ifthenelse{\equal{\FP@LabelText}{\@empty}}
+% {}{\FP@savedLabelCommand{\expandafter\protect\FP@LabelText}}%
+% \end{\@captype}}
+% {\addtocounter{\@captype}{-1}}
+% {\begin{\@captype}[b!]%
+% \ifthenelse{\equal{\FP@guide}{\@empty}}%
+% {}{\ifthenelse{\equal{\@captype}{figure}}%
+% {\renewcommand{\fnum@figure}{\old@Fnum\ {\FP@guide}}}%
+% {\renewcommand{\fnum@table}{\old@Fnum\ {\FP@guide}}}}%
+% \setlength{\abovecaptionskip}{2pt plus2pt minus 1pt} % length above caption
+% \setlength{\belowcaptionskip}{2pt plus2pt minus 1pt} % length above caption
+% \FP@separatorCaption%
+% \ifthenelse{\equal{\FP@optionalCaptionText}{\@empty}}%
+% {\FP@savedCaptionCommand{\expandafter\protect\FP@CaptionText}}%
+% {\FP@savedCaptionCommand[\expandafter\protect\FP@optionalCaptionText]%
+% {\expandafter\protect\FP@CaptionText}}%
+% \end{\@captype}}%
+% }%
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \renewcommand*\FP@floatEnd{%
+ \endminipage
+ \end{lrbox}%
+% \end{macrocode}
+% \begin{macrocode}
+ \stepcounter{FP@\FP@captype C}%
+ \caption@label\FP@positionLabel
+ \FP@helpNote\FP@captype\FP@positionLabel
+% \end{macrocode}
+% \begin{macrocode}
+ \FP@float
+ {\FP@positionLabel}% location label test
+ {\caption@prepare@defrost
+ \begin\FP@captype[p!]%
+ \usebox\FP@floatCorpusBOX
+ \end\FP@captype}%
+ {\@ifundefined{theH\FP@captype}{}{%
+ \expandafter\l@addto@macro\csname theH\FP@captype\endcsname{.FP}}}%
+ {\caption@prepare@defrost
+ \begin\FP@captype[b!]%
+ \let\FP@savedSetfnumCommand\caption@setfnum
+ \def\caption@setfnum##1{%
+ \FP@savedSetfnumCommand{##1}%
+ \ifx\FP@guide\@empty \else
+ \expandafter\l@addto@macro\csname fnum@##1\endcsname{\ {\FP@guide}}%
+ \fi}%
+ \setlength\abovecaptionskip{2pt plus 2pt minus 1pt}% length above caption
+ \setlength\belowcaptionskip{2pt plus 2pt minus 1pt}% length below caption
+ \caption@setoptions{FP\@captype}%
+ \FP@separatorCaption
+ \caption@defrost
+ \end\FP@captype}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{%
+ \let\caption@ifFPlistcap\@undefined
+ \let\caption@ifFPrefcap\@undefined
+}
+% \end{macrocode}
+%
+% \subsection{The hyperref package}
+% \changes{v3.0f}{2005/06/11}{Support of the \package{hyperref} package added}
+% \changes{v3.1}{2007/03/09}{Usage of \cs{hyper@makecurrent} instead of
+% \cs{theHfigure} as indicator for \package{hyperref} package}
+% \changes{v3.2}{2011/07/30}{Test if \package{hyperref} has stopped early revised}
+% \changes{v3.2c}{2011/08/24}{Test if \package{hyperref} has stopped early adapted to current version of \package{hyperref} package: Usage of \cs{IfHyperBoolean} added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{hyperref}[2003/11/30 v6.74m]{%
+ % Test if hyperref has stopped early
+ \caption@ifundefined\IfHyperBoolean{%
+ \caption@set@bool\caption@ifhyp@stoppedearly0%
+ \caption@ifundefined\H@refstepcounter
+ {\caption@set@bool\caption@ifhyp@stoppedearly1}{%
+ \caption@ifundefined\hyper@makecurrent
+ {\caption@set@bool\caption@ifhyp@stoppedearly1}{%
+ \caption@ifundefined\measuring@true
+ {\caption@set@bool\caption@ifhyp@stoppedearly1}{}}}%
+ }{%
+ \def\caption@ifhyp@stoppedearly{\IfHyperBoolean{stoppedearly}}%
+ }%
+ \caption@ifhyp@stoppedearly{% hyperref has stopped early
+ \caption@InfoNoLine{%
+ Hyperref support is turned off\MessageBreak
+ because hyperref has stopped early}%
+ }{%
+ \g@addto@macro\caption@prepareslc{\measuring@true}%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@@@refstepcounter}
+% We redefine |\caption@@refstepcounter| so |\H@refstepcounter| will be used
+% instead of |\refstepcounter| inside |\caption| \& |\captionlistentry|.
+% \begin{macrocode}
+ \renewcommand*\caption@@@refstepcounter{\H@refstepcounter}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makecurrent}
+% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% We redefine |\caption@makecurrent| so a \package{hyperref} label
+% will be defined inside |\@caption|.
+% \Note{Will be redefined by \cs{caption@start}.}
+% \begin{macrocode}
+ \renewcommand*\caption@makecurrent[2]{%
+ \caption@makecurrentHref{#1}%
+ \caption@Debug{hyperref current=\@currentHref}%
+ \caption@gettitle{#2}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\caption@makecurrentHref{\hyper@makecurrent}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makeanchor}
+% \changes{v3.1l}{2010/01/09}{Adapted to the current hyperref package}
+% We redefine |\caption@makeanchor| so a \package{hyperref} anchor
+% will be set inside |\@caption|.
+% \Note{Will be redefined by \cs{caption@start}.}
+% \begin{macrocode}
+ \renewcommand\caption@makeanchor[1]{%
+ \caption@Debug{hyperref anchor: \@currentHref}%
+ % If we cannot have nesting, the anchor is empty.
+ \ifHy@nesting
+ \expandafter\hyper@@anchor\expandafter{\@currentHref}{#1}%
+ \else
+ \Hy@raisedlink{%
+ \expandafter\hyper@@anchor\expandafter{\@currentHref}{\relax}%
+ }#1%
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+ \g@addto@macro\caption@prepareslc{\let\caption@makeanchor\@firstofone}%
+% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{The hypcap option}
+%
+% \begin{macro}{\if@capstart}
+% Like the \package{hypcap} package we define the switch |\if@capstart|, too.
+% \begin{macrocode}
+ \newif\if@capstart
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@start}
+% \changes{v3.0l}{2007/02/20}{%
+% \cs{caption@currentHref} renamed to \cs{hc@currentHref}}
+% \changes{v3.1}{2007/06/21}{%
+% This macro renamed from \cs{capstart} to \cs{caption@start} and revised}
+% While the \package{hypcap} package defines a macro called |\capstart|
+% our variant is called |\caption@start| and is controlled by the option
+% |hypcap=||false|/|true|.
+% \begin{macrocode}
+ \def\caption@start{\caption@ifhypcap\caption@start@\relax}%
+ \def\caption@start@{%
+% \end{macrocode}
+% Generate the \package{hyperref} label and set the \package{hyperref} anchor,
+% usually (if |hypcap=false|) both is done inside |\@caption|.
+% \begin{macrocode}
+ \caption@makestart\@captype
+ \caption@startanchor\@currentHref
+% \end{macrocode}
+% Prevent |\@caption| from generating a new \package{hyperref} label,
+% use the label we save in |\hc@currentHref| instead.
+% (We also support the |@capstart| flag from the \package{hypcap} package.)
+% \begin{macrocode}
+ \global\@capstarttrue
+ \let\hc@currentHref\@currentHref
+ \def\caption@makecurrentHref##1{%
+ \global\@capstartfalse
+ \global\let\@currentHref\hc@currentHref}%
+% \end{macrocode}
+% Prevent |\@caption| from generating a \package{hyperref} anchor since this
+% has already been done.
+% \begin{macrocode}
+ \let\caption@makeanchor\@firstofone
+% \end{macrocode}
+% \begin{macrocode}
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makestart}
+% \changes{v3.1c}{2007/09/30}{\cs{@currentHref} will be extended by \texttt{caption}
+% instead of \texttt{xxx} now}
+% |\caption@makestart|\marg{type}
+% defines a \package{hyperref} anchor inside |\caption@start|.\par
+% Since we offer |\continuedfloat| the float counter can change between
+% `now' and |\caption|, i.e., we simply don't know the figure or table counter
+% yet and therefore we are not able to generate the `right' \package{hyperref}
+% label.
+% Two different solutions of this problem came into my mind:
+% \begin{enumerate}
+% \item I could use the aux file for this purpose.\par
+% -or-
+% \item I set |hypertexnames=false| locally.
+% Furthermore I use |#1.caption.|\meta{counter} (instead of |#1.|\meta{counter})
+% as naming scheme for |\@currentHref| to avoid conflicts with other hyper
+% links which are generated with |hypertexnames=true|.
+% \end{enumerate}
+% The first idea has the advantage that the `right' anchor name will be
+% generated, but one needs an additional \LaTeX\ run if figures or tables
+% will be inserted or removed.\par
+% The second idea has the advantage that it's very easy to implement, but
+% has some side-effects, e.g. the anchor names don't follow the figure or
+% table label names anymore.\par
+% Since I'm lazy I implemented the second idea, maybe I will revise this
+% later on.
+% \begin{macrocode}
+ \newcommand*\caption@makestart[1]{%
+ \begingroup
+ \Hy@hypertexnamesfalse
+% \gdef\@currentHlabel{}%
+ \hyper@makecurrent{#1.caption}%
+ \endgroup
+ \caption@Debug{hypcap start=\@currentHref}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@startanchor}
+% \changes{v3.1b}{2007/09/17}{Bugfix 06-09-17: We use \cs{caption@anchor} instead of \cs{hyper@@anchor}}
+% \changes{v3.1g}{2008/03/16}{Warning about TeX mode replaced with debug info}
+% |\caption@startanchor|\marg{Href}
+% sets a \package{hyperref} anchor inside |\caption@start|.\par
+% This code was taken from the \package{hypcap} package\cite{hypcap} and adapted.
+% \Note{Since \cs{hyper@@anchor}\marg{Href}\csmarg{\string\relax} can cause
+% a change from vertical mode to horizontal mode (design flaw in
+% \package{hyperref} package!?), and since the workaround
+% \cs{let}\cs{leavevmode}\cs{relax} which can be found in the
+% \package{hypcap} package is not always sufficient
+% (for example with ``Direct pdfmark support'' and \texttt{breaklinks=true}),
+% we use \cs{caption@anchor} instead of \cs{hyper@@anchor} here.}
+% \begin{macrocode}
+ \newcommand*\caption@startanchor[1]{%
+ \ifvmode\begingroup
+ \caption@Debug{hypcap anchor: #1 (vertical mode)}%
+ \@tempdima\prevdepth
+ \nointerlineskip
+ \vspace*{-\caption@hypcapspace}%
+ \caption@anchor{#1}%
+ \vspace*{\caption@hypcapspace}%
+ \prevdepth\@tempdima
+ \endgroup\else
+ \caption@Debug{hypcap anchor: #1 (horizontal mode)}%
+ \caption@anchor{#1}%
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@anchor}
+% \changes{v3.1c}{2007/10/17}{Workaround 07-10-17: We use \cs{caption@raisedlink} instead of \cs{Hy@raisedlink} now}
+% |\caption@anchor|\marg{Href} sets a \package{hyperref} anchor.
+% \begin{macrocode}
+ \newcommand*\caption@anchor[1]{%
+ \ifmeasuring@ \else
+ \caption@raisedlink{\hyper@anchorstart{#1}\hyper@anchorend}%
+ \fi}%
+% \end{macrocode}
+% \Note{Since \cs{Hy@raisedlink} change \cs{@tempdima} we surrounded it by \cs{ifvmode},
+% suppressing ``\texttt{LaTeX Warning: Float too large for page by 1.0pt}'' in \texttt{sideways} floats.
+% (This is not necessary since \package{hyperref} \version{6.77}.)}
+% \begin{macrocode}
+ \ifx\HyperRaiseLinkLength\@tempdima
+ \def\caption@raisedlink#1{\ifvmode#1\else\Hy@raisedlink{#1}\fi}%
+ \else
+ \let\caption@raisedlink\Hy@raisedlink
+ \fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@start}
+% Will be used by |\caption@freezeHref|. Apart from that we issue a warning
+% if we expect a saved \package{hyperref} label coming from |\caption@start|,
+% but there isn't any.
+% \begin{macrocode}
+ \def\caption@@start{%
+ \caption@ifundefined\hc@currentHref{%
+ \caption@Warning{%
+ The option `hypcap=true' will be ignored for this\MessageBreak
+ particular \string\caption}}{}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@freezeHref}
+% Suppress |\caption@start| from generating a \package{hyperref} label and
+% setting a \package{hyperref} anchor. Instead if |\@caption| generates a
+% \package{hyperref} label, it will be stored in |\caption@currentHref|.
+% Furthermore we need to redefine |\caption@setfloatcapt| so no
+% \package{hyperref} anchor will be placed in |\@caption|.
+% \iffalse
+% (Since |\caption@setfloatcapt| will be set to |\@firstofone| inside
+% |\subcaption| there is no need to add its restauration to
+% |\caption@subtypehook|.)
+% \fi
+% \begin{macrocode}
+ \def\caption@freezeHref{%
+ \let\caption@ORI@start\caption@start
+ \def\caption@start{\let\caption@start\caption@ORI@start}%
+% \end{macrocode}
+% \begin{macrocode}
+% \let\caption@ORI@@start\caption@@start
+% \l@addto@macro\caption@subtypehook{%
+% \let\caption@@start\caption@ORI@@start}%
+% \end{macrocode}
+% \begin{macrocode}
+ \global\let\caption@currentHref\@undefined
+ \def\caption@@start{\global\let\caption@currentHref\@currentHref}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@ORI@setfloatcapt\caption@setfloatcapt
+ \renewcommand*\caption@setfloatcapt{%
+ \ifx\caption@currentHref\@undefined \else
+ \let\caption@makeanchor\@firstofone
+ \fi
+ \caption@ORI@setfloatcapt}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@defrostHref}
+% If there is a freezed |\@currentHref|, we set the \package{hyperref}
+% anchor here.
+% \begin{macrocode}
+ \def\caption@defrostHref{%
+ \ifx\caption@currentHref\@undefined \else
+ \caption@startanchor\caption@currentHref
+ \global\let\caption@currentHref\@undefined
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ }}{}
+% \end{macrocode}
+%
+% \subsection{The hypcap package}
+% \changes{v3.0f}{2005/06/22}{Support of the \package{hypcap} package added}
+% \changes{v3.0l}{2007/02/20}{Adapted to \package{hypcap} \version{1.6}}
+% \changes{v3.1e}{2007/11/04}{\package{hypcap} support adapted to \package{hyperref} \version{6.77}}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{hypcap}{% v1.0
+ \ifx\caption@start\relax \else % hyperref hasn't stopped early
+% \end{macrocode}
+%
+% If the \package{hypcap} package was loaded, we give up our own
+% hyperlink placement algorithm and give the control over the placement
+% to the \package{hypcap} package instead.
+%
+% \begin{macro}{\capstart}
+% \changes{v3.1k}{2009/10/09}{Support of \cs{ifcapstart} (\package{hypcap} package \version{1.10}) added}
+% We do this simply by mapping |\capstart| to |\caption@start@|,
+% although our code does not behave exactly like the original one:
+% The original |\capstart| has an effect on the next |\caption|
+% only but our version affects \emph{all} |\caption|s in the same
+% environment, at least unless a new |\capstart| will be placed.
+% \begin{macrocode}
+ \let\caption@ORI@capstart\capstart % save for compatibility mode
+ \caption@ifundefined\capstarttrue % check for v1.10 of hypcap package
+ {\def\capstart{\caption@start@}}%
+ {\def\capstart{\ifcapstart\caption@start@\fi}}%
+ \let\caption@start\relax
+ \let\caption@@start\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@hypcapspace}
+% Furthermore we map our |\caption@hypcapspace| to |\hypcapspace|
+% offered by the \package{hypcap} package.
+% \begin{macrocode}
+ \caption@set@bool\caption@ifhypcap 1%
+ \renewcommand*\caption@hypcapspace{\hypcapspace}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \fi}{}
+% \end{macrocode}
+%
+% \subsection{The listings package}
+% \changes{v3.0b}{2004/05/16}{Support of the \package{listings} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{listings}[2004/02/13 v1.2]{%
+% \end{macrocode}
+%
+% \begin{macro}{\lst@MakeCaption}
+% \changes{v3.1g}{2008/01/20}{Bugfix: Skips are handled correctly now}
+% \changes{v3.1k}{2008/03/29}{Bugfix 08-10-16-dctt: \texttt{rule=0} added}
+% \changes{v3.2}{2010/10/26}{Bugfix 10-07-20a: Set \cs{hsize} to \cs{linewidth}, if necessary}
+% \changes{v3.4c}{2020/01/01}{Ugly workaround for usage in lists added}
+% \changes{v3.4d}{2020/01/01}{Ugly workaround for usage in lists revised}
+% To support the \package{listings} package we need to redefine
+% |\lst@Make|\-|Caption| so the original stuff is nested with
+% |\caption@begin| and |\caption@end| etc.\par
+% We set a flag inside the "Init" hook of the \package{listings} package (where adaption of |\line|\-|width| etc.~takes place).
+% \begin{macrocode}
+ \caption@setbool{lst@Init}{0}%
+ \lst@AddToHook{Init}{\caption@setbool{lst@Init}{1}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@ORI@lst@MakeCaption\lst@MakeCaption
+ \def\lst@MakeCaption#1{% #1 is `t' or `b'
+% \end{macrocode}
+% This macro is always called twice by the \package{listings} package (with `t' resp. `b' as parameter),
+% therefore we need an extra group here.
+% \begin{macrocode}
+ \begingroup
+% \end{macrocode}
+% Inside lists the \package{listings} package ignores the left margin (|\@total|\-|left|\-|margin|) for captions.
+% We emulate this behaviour by adding a negative skip which will be typeset ahead of |\caption@box|.\par
+% Note: We only need to do this if the ``Init'' hook of the \package{listings} package wasn't called yet.
+% \begin{macrocode}
+ \caption@iflst@Init{}{%
+ \edef\caption@lst@leftskip{\noexpand\hskip-\the\@totalleftmargin\noexpand\relax}%
+ \l@addto@macro\caption@beginhook\caption@lst@leftskip}%
+% \end{macrocode}
+% We set |position=#1| and if it was set to `top',
+% we swap the skips so the default behavior of the \package{listings} package
+% will not be changed. (Note that the \package{listings} package has set its
+% own |\abovecaptionskip| \& |\belowcaptionskip| values prior to calling
+% \cs{lst@MakeCaption}.)
+% \begin{macrocode}
+ \caption@setposition{#1}%
+ \caption@iftop{%
+ \@tempdima\belowcaptionskip
+ \belowcaptionskip\abovecaptionskip
+ \abovecaptionskip\@tempdima}{}%
+% \end{macrocode}
+% Workaround for issue with wrong skips (FIXME: This should be examined further)
+% \begin{macrocode}
+ \caption@setup{rule=0}%
+% \end{macrocode}
+% Afterwards we set the local `lstlisting' options.
+% \begin{macrocode}
+ \caption@setoptions{lstlisting}%
+% \end{macrocode}
+% If the |position=| is now set to |auto|, we take over the |captionpos=|
+% setting from the \package{listings} package.
+% \begin{macrocode}
+ \caption@setautoposition{#1}%
+% \end{macrocode}
+% At the end we do similar stuff as in our \cs{@caption} code.
+% \begin{macrocode}
+ \caption@begin{lstlisting}%
+ \caption@ORI@lst@MakeCaption{#1}%
+ \caption@end
+% \end{macrocode}
+% \begin{macrocode}
+ \endgroup}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\lst@makecaption}
+% \begin{macro}{\lst@maketitle}
+% Wrapper macros for typesetting the |caption=| resp. |title=| value.
+% \begin{macrocode}
+ \def\lst@makecaption{\caption@starfalse\@makecaption}%
+ \def\lst@maketitle{\caption@startrue\@makecaption\@empty}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ext@lstlisting}
+% \changes{v3.1}{2007/03/03}{This macro added}
+% Since the \package{listings} package do not define |\ext@lstlisting|
+% but we needed it when |\captionof{lstlisting}| will be done by the end user,
+% we define it here.
+% \begin{macrocode}
+ \providecommand*\ext@lstlisting{lol}%
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.1a}{2007/07/13}{Bugfix 07-09-13: \cs{lst@@caption} will not be re-defined anymore}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The longtable package}
+%
+% \begin{macro}{\LTcaptype}
+% \changes{v3.1}{2007/07/06}{This macro and its support added}
+% |\LTcaptype| is preset to |table|.
+% \begin{macrocode}
+\providecommand*\LTcaptype{table}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{longtable}[1995/05/24 v3.14]{%
+% \end{macrocode}
+% \begin{macrocode}
+ \RequirePackage{ltcaption}[=2018/08/26]%
+ \let\LT@@makecaption\@undefined
+% \end{macrocode}
+%
+% \begin{macro}{\LT@array}
+% \changes{v3.1}{2007/07/22}{This redefinition added}
+% \changes{v3.1a}{2007/09/14}{Bugfix 07-09-14: Redefinition of \cs{@captionabovetrue} \& \cs{@captionabovefalse} added}
+% \changes{v3.1a}{2007/09/16}{Bugfix: This redefinition will always be done \cs{AtBeginDocument}}
+% \changes{v3.1g}{2008/01/20}{Bugfix in \cs{captionlistentry}: Table counter will not be incremented anymore, \cs{nameref} works}
+% \changes{v3.3}{2016/01/31}{Support for \cs{bicaption} added}
+% \changes{v3.3}{2018/10/05}{Definition of \cs{captionlistentry} fixed}
+% We redefine |\LT@array| here to get |\captionsetup|\marg{options}
+% working inside |longtable|s.
+% \Note{Since the \package{hyperref} package patches \cs{LT@array} as well
+% and since this only works with the original definition of \cs{LT@array},
+% we have to do this after the \package{hyperref} package,
+% i.e.~\cs{AtBeginDocument}.}
+% \begin{macrocode}
+ \caption@AtBeginDocument{%
+ \let\caption@ORI@LT@array\LT@array
+ \renewcommand*\LT@array{%
+% \end{macrocode}
+% |\captionsetup| for longtable:
+% \begin{macrocode}
+ \global\let\caption@opt@@longtable\@undefined
+ \def\captionsetup{%
+ \noalign\bgroup
+ \@ifstar\@captionsetup\@captionsetup}% gobble *
+ \def\@captionsetup##1{\LT@captionsetup{##1}\egroup}%
+ \def\LT@captionsetup##1{%
+ \captionsetup@startrue\caption@setup@options[@longtable]{##1}%
+ \global\let\caption@opt@@longtable\caption@opt@@longtable}%
+% \end{macrocode}
+% |\captionabove| \& |\captionbelow| for longtable: (\KOMAScript\ document class)
+% \begin{macrocode}
+ \def\@captionabovetrue{\LT@captionsetup{position=t}}%
+ \def\@captionabovefalse{\LT@captionsetup{position=b}}%
+% \end{macrocode}
+% |\captionlistentry| for longtable:
+% \begin{macrocode}
+ \def\captionlistentry{%
+ \noalign\bgroup
+ \@ifstar{\egroup\LT@listentry\LTcaptype}% gobble *
+ {\egroup\LT@listentry\LTcaptype}}%
+% \end{macrocode}
+% |\continuedfloat| for longtable:\\
+% {\small(Commented out, since it's not deeply tested and quite useless anyway)}
+% \Note{\package{hyperref} versions $<$ v6.76j uses $2\times$ \cs{hyper@makecurrent}}
+% \begin{macrocode}
+% \caption@ifhypcap{%
+% \let\caption@ORI@hyper@makecurrent\hyper@makecurrent
+% \def\hyper@makecurrent##1{%
+% \let\hyper@makecurrent\caption@ORI@hyper@makecurrent
+% \caption@makestart{##1}%
+%% \let\Hy@LT@currentHlabel\@currentHlabel
+% \let\Hy@LT@currentHref\@currentHref
+% \def\hyper@makecurrent####1{%
+%% \let\@currentHlabel\Hy@LT@currentHlabel
+% \let\@currentHref\Hy@LT@currentHref}}%
+% \let\caption@ORI@continuedfloat\continuedfloat
+% \def\continuedfloat{\noalign{%
+% \gdef\caption@setContinuedFloat{%
+% \let\caption@reset@continuedfloat\@gobble}%
+% \def\caption@setoptions####1{%
+% \g@addto@macro\caption@setContinuedFloat{%
+% \caption@setoptions{####1}}}%
+% \let\@captype\LTcaptype
+% \caption@ORI@ContinuedFloat}}%
+% }{%
+% \def\continuedfloat{\noalign{%
+% \caption@Error{%
+% \noexpand\continuedfloat inside longtables\MessageBreak
+% is only available with `hypcap=true'}}}%
+% }%
+% \global\let\caption@setContinuedFloat\@empty
+ \def\continuedfloat{\noalign{%
+ \caption@Error{\noexpand\continuedfloat outside float}}}%
+% \end{macrocode}
+% |\bicaption| for longtable:
+% \begin{macrocode}
+ \let\bicaption\LT@bicaption
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@ORI@LT@array}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LT@capti@n}
+% \changes{v3.3}{2016/02/01}{This re-definition added}
+% The original implementation:
+% \begin{verbatim}
+% \def\LT@capti@n{%
+% \@ifstar
+% {\egroup\LT@c@ption\@gobble[]}%
+% {\egroup\@xdblarg{\LT@c@ption\@firstofone}}}
+% \end{verbatim}%^^A
+% Our implementation uses |\caption@xdblarg| instead of |\@xdblarg|:
+% \begin{macrocode}
+ \def\LT@capti@n{%
+ \@ifstar
+ {\egroup\LT@c@ption\@gobble[]}%
+ {\egroup\caption@xdblarg{\LT@c@ption\@firstofone}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LT@makecaption}
+% \changes{v3.0d}{2004/08/10}{%
+% Bugfix 04-08-04: \cs{abovecaptionskip} \& \cs{belowcaptionskip} will be used now}
+% \changes{v3.0e}{2005/05/05}{%
+% Bugfix: \cs{captionsetup[longtable]} overrides \cs{LTcapwidth} now}
+% \changes{v3.0h}{2005/10/07}{\cs{caption@LT@make} introduced}
+% \changes{v3.3}{2016/02/01}{Support for \cs{bicaption} via \cs{caption@LT@setup} added}
+% \changes{v3.3a}{2019/04/02}{Work-around for problem with \package{floatrow} added}
+% |\LT@makecaption|\marg{cmd}\marg{label}\marg{text}\par
+% \smallskip
+% The original definition:
+% \begin{verbatim}
+% \def\LT@makecaption#1#2#3{%
+% \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{%
+% % Based on article class "\@makecaption", "#1" is "\@gobble" in star
+% % form, and "\@firstofone" otherwise.
+% \sbox\@tempboxa{#1{#2: }#3}%
+% \ifdim\wd\@tempboxa>\hsize
+% #1{#2: }#3%
+% \else
+% \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
+% \fi
+% \endgraf\vskip\baselineskip}%
+% \hss}}}
+% \end{verbatim}%^^A
+% Our definition:
+% \begin{macrocode}
+ \renewcommand\LT@makecaption[3]{%
+ \caption@LT@make{%
+ \caption@LT@settype\LTcaptype
+% \end{macrocode}
+%
+% |\caption@LT@setup| is re-defined inside the \package{bicaption} package
+% and contains the preparation of typesetting of the bilingual caption.
+% \begin{macrocode}
+ \caption@LT@setup
+% \end{macrocode}
+%
+% \iffalse
+% The default |position=| setting for longtables is |top|.
+% (This emulates the standard behavior of the \package{longtable} package
+% which has no skip above the caption but a skip below it.)
+% \fi
+%
+% |position=auto| is a bad idea for longtables, but we do our very best.
+% This works quite well for captions inside the longtable contents, but
+% not for captions inside the longtable (end)foot.
+% \Note{This should be `top' if unclear!}
+% \begin{macrocode}
+ \caption@setautoposition{\ifcase\LT@rows t\else b\fi}%
+% \end{macrocode}
+%
+% We set |\ifcaption@star| according the 1st argument.
+% \begin{macrocode}
+ \caption@startrue#1\caption@starfalse
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@prepare@stepcounter\LTcaptype{LT}%
+% \end{macrocode}
+%
+% \changes{v3.1}{2007/05/05}{\cs{caption@normalsize} added}
+% \begin{macrocode}
+ \caption@begin\LTcaptype
+ \caption@normalsize
+% \end{macrocode}
+%
+% The following skip has the purpose to correct the height of the
+% |\parbox[t]|. Usually it's the height of the very first line, but
+% because of our extra skips (|\abovecaptionskip| and |\belowcaptionskip|)
+% it's always |0pt|.\par
+% (A different idea would be typesetting the first skip outside the longtable
+% column with |\noalign{\vskip|\ldots|}|, but this means we have to move
+% |\caption@begin| to some other place because it does not work in tabular
+% mode. And at the moment I have no idea on how to do this in an elegant
+% way\ldots)
+% \begin{macrocode}
+ \vskip-\ht\strutbox
+% \end{macrocode}
+%
+% Work-around for problem with \package{floatrow}:
+% The |\below|\-|caption|\-|skip| disturbs the environment in which the caption is actually typeset (by creating extra, unwanted space),
+% so we supress this skip if the \package{floatrow} package is loaded.
+% (This fixes \issue{50})
+% \begin{macrocode}
+ \caption@ifdefined\FBifcaptop{%
+ \let\caption@belowskip\@empty}{}%
+% \end{macrocode}
+%
+% The following code should look familiar. We do our skips and use
+% |\caption@@make| to typeset the caption itself.
+% \begin{macrocode}
+ \caption@make@above
+ \caption@@make{#2}{#3}\endgraf
+ \caption@make@below
+ \caption@end}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LT@listentry}
+% \changes{v3.3}{2018/08/26}{This macro added}
+% \changes{v3.3}{2018/10/05}{Bugfix: \cs{ignorespaces} added}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
+% \begin{macrocode}
+ \renewcommand*\LT@listentry[2]{%
+ \begingroup
+ \caption@LT@settype{#1}%
+ \caption@listentry\@firstoftwo[{#1}]{#2}%
+ \endgroup\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@LT@settype}
+% \changes{v3.3}{2018/08/26}{This macro added}
+% \changes{v3.3}{2018/10/05}{Uses argument no. 1 instead of \cs{LTcaptype}}
+% \begin{macrocode}
+ \newcommand*\caption@LT@settype[1]{%
+ \caption@settype*{#1}%
+% \end{macrocode}
+% If |\LTcapwidth| is not set to its default value |4in| we assume
+% that it shall overwrite our own setting.
+% (But |\captionsetup[longtable]{width=|\ldots|}| will overwrite |\LTcapwidth|.)
+% \begin{macrocode}
+ \ifdim\LTcapwidth=4in \else
+ \setcaptionwidth\LTcapwidth
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@setoptions{longtable}%
+% \caption@setContinuedFloat
+% \end{macrocode}
+% Finally set options applied by |\captionsetup| inside the longtable.
+% \begin{macrocode}
+ \caption@setoptions{@longtable}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\flrow@setlist}
+% \changes{v3.4g}{2020/01/03}{Redefinition of this macro added}
+% The \package{floatrow} package uses |\flrow@setlist{{table}{longtable}}| inside its redefinition of |\LT@array| without setting |\@captype| first,
+% and this makes |\captionsetup[table]{name=...}| doomed to fail for longtables (``Undefined control sequence'').
+% Unfortunately we cannot easily patch |\LT@array| again to fix this bug in \package{floatrow} since it will be patched |\AtBeginDocument|.
+% Therefore we patch |\flrow@setlist| instead to catch and fix the bug on-the-fly.
+% \begin{macrocode}
+ \caption@AtBeginDocument{\caption@ifdefined\flrow@setlist@{%
+ \caption@InfoNoLine{Fixing longtable code of `floatrow' package}%
+ \let\caption@flrow@setlist@\flrow@setlist@
+ \renewcommand\flrow@setlist@[1]{%
+ \def\caption@tempa{{table}{longtable}}%
+ \def\caption@tempb{#1}%
+ \ifx\caption@tempa\caption@tempb
+ \def\@captype{table}%
+ \fi
+ \caption@flrow@setlist@{#1}}%
+ }{}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@LT@setup}
+% \changes{v3.3}{2016/02/01}{This macro added}
+% Hook for stuff which prepares the typesetting of the \package{longtable} caption.
+% \begin{macrocode}
+\providecommand*\caption@LT@setup{}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{The picinpar package}
+% \changes{v3.1}{2007/06/13}{Support of the \package{picinpar} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{picinpar}{%
+% \end{macrocode}
+%
+% \begin{macro}{\figwindow}
+% \begin{macro}{\tabwindow}
+% The \package{picinpar} package comes with its own caption code
+% (|\wincaption|, |\@wincaption|, |\@makewincaption|, \ldots)
+% so we redefine |\figwindow| \& |\tabwindow| to use |\caption| instead.
+% \begin{macrocode}
+ \long\def\figwindow[#1,#2,#3,#4] {%
+ \caption@window{figure}%
+ \caption@setoptions{figwindow}%
+ \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }%
+% \end{macrocode}
+% \begin{macrocode}
+ \long\def\tabwindow[#1,#2,#3,#4] {%
+ \caption@window{table}%
+ \caption@setoptions{tabwindow}%
+ \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@window}
+% \changes{v3.1c}{2007/10/06}{Bugfix: \cs{caption@clearmargin} added}
+% Beside calling |\caption@settype| we redefine |\caption@boxrestore|
+% (as in \package{floatflt} \& \package{picins} package support)
+% and |\@makecaption| (as in \package{float} package support) here.
+% \begin{macrocode}
+ \newcommand*\caption@window[1]{%
+ \let\@makecaption\caption@@make
+ \caption@setautoposition b%
+ \caption@settype{#1}%
+ \caption@clearmargin
+ \caption@setfullparboxrestore}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@wincaption}
+% \changes{v3.1d}{2007/10/25}{Missing \% added}
+% \changes{v3.3}{2013/04/14}{\cs{caption@ContinuedFloattrue} added}
+% \changes{v3.3}{2018/10/06}{\cs{caption@ContinuedFloattrue} replaced by \cs{caption@setflag1}}
+% This one finally typesets the caption using |\caption|.
+% \begin{macrocode}
+ \newcommand\caption@wincaption[1]{%
+% \end{macrocode}
+% This will be done twice for every |figwindow| \& |tabwindow| caption --
+% on the first run |\picwd| is |0pt|, on the second run |\picwd| is |\hsize|.
+% \begin{macrocode}
+ \ifdim\picwd=\z@
+ \let\caption@makecurrent\@gobbletwo
+ \let\caption@@start\relax
+ \caption@prepareslc
+ \else
+ \caption@setflag1%
+ \fi
+% \end{macrocode}
+% The argument |#1| could contain simply the caption text
+% (e.g.~|A figure caption|), but it could also contain an optional argument,
+% the \meta{lst\_entry}
+% (e.g.~|[An| |entry| |to| |the| |LOF]||{A| |figure| |caption}|).
+% Therefore we have to test if |#1| begins with~|[| or not; furthermore we
+% support a starred variant -- as in |\caption*| -- so we test for~|*|, too.
+% \begin{macrocode}
+ \edef\@tempa{\expandafter\noexpand\@car#1\@nil}%
+ \if\@tempa*%
+ \let\@tempa\@firstofone
+ \else\if\@tempa[%]
+ \let\@tempa\@firstofone
+ \else
+ \let\@tempa\@empty
+ \fi\fi
+ \expandafter\caption\@tempa{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The picins package}
+% \changes{v3.0j}{2006/01/26}{Support of the \package{picins} package added}
+%
+% \begin{macro}{\piccaptiontype}
+% |\piccaptiontype|\marg{type}\par
+% We offer this macro for changing the \meta{type} of the caption, so the user
+% doesn't have to redefine |\@captype|, as proposed in the \package{picins}
+% documentation.
+% \Note{We define this macro here so it can be used in the
+% preamble of the document, even when \thispackage\ was loaded prior to the
+% \package{picins} package.}
+% \begin{macrocode}
+\newcommand*\piccaptiontype[1]{\def\@piccaptype{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{picins}{%
+% \end{macrocode}
+%
+% Initial set |\@piccaptype| and undefine |\@captype| which was set to
+% |figure| by the \package{picins} package.
+% \begin{macrocode}
+ \caption@ifundefined\@piccaptype{%
+ \caption@iftype{%
+ \let\@piccaptype\@captype
+ }{%
+ \def\@piccaptype{figure}%
+ }%
+ }{}%
+ \let\@captype\@undefined
+% \end{macrocode}
+%
+% \begin{macro}{\piccaption}
+% The original code:
+% \begin{verbatim}
+% \def\piccaption{\@ifnextchar [{\@piccaption}{\@piccaption[]}}
+% \end{verbatim}%^^A
+% Our code uses |\caption@star| so |\piccaption*| works,
+% and |\caption@dblarg| so |\piccaption{}| works correctly.
+% \begin{macrocode}
+ \def\piccaption{\caption@star\relax{\caption@dblarg\@piccaption}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\make@piccaption}
+% \changes{v3.1}{2007/12/06}{Bugfix: \cs{caption@clearmargin} will always be used now}
+% The original code:
+% \begin{verbatim}
+% \def\make@piccaption{%
+% [...]
+% \setbox\@TEXT=\vbox{\hsize\hsiz@\caption[\sh@rtf@rm]{\capti@nt@xt}}%
+% }
+% \end{verbatim}%^^A
+% In our code we have to correct several things:
+% \begin{enumerate}
+% \item |\@captype| must be defined, since we have removed the global
+% definition.
+% \item We use |\caption@setoptions{parpic}| so
+% |\captionsetup[parpic]{|\ldots|}| is supported.
+% \item |\linewidth| must be set correctly.
+% Usually this is done by |\@parboxrestore| inside |\@caption|,
+% but since we use |\@caption@boxrestore| we have to map this to
+% |\@parboxrestore| instead.
+% \item The two arguments of |\caption| (|\sh@rtf@rm| \& |\capti@nt@xt|)
+% should be expanded on first level so |\caption[]{|\ldots|}| and
+% |\caption[|\ldots|]{}| work correctly.
+% \end{enumerate}
+% \begin{macrocode}
+ \let\caption@ORI@make@piccaption\make@piccaption
+ \def\make@piccaption{%
+ \let\caption@ORI\caption
+% \end{macrocode}
+% \begin{macrocode}
+ \long\def\caption[##1]##2{%
+ \caption@freezeHref % will be defrosted in \ivparpic
+ \caption@settype\@piccaptype
+% \ifnum\c@piccaptionpos>2\relax
+ \caption@clearmargin
+% \else
+% \captionwidth\z@ % do not use "width=" setting
+% \fi
+ \caption@setfullparboxrestore
+ \caption@setoptions{parpic}%
+ \caption@setautoposition b%
+% \end{macrocode}
+% \begin{macrocode}
+ \expandafter\expandafter\expandafter\caption@ORI
+ \expandafter\expandafter\expandafter[%
+ \expandafter\expandafter\expandafter{%
+ \expandafter##1\expandafter}\expandafter]\expandafter{##2}}%
+% \end{macrocode}
+% {\footnotesize\begin{quote}
+% \leavevmode\llap{-or-\quad}%^^A
+% |\begingroup|\\
+% | \toks0\expandafter{##1}| |\toks2\expandafter{##2}|\\
+% | \edef\x{\endgroup|\\
+% | \noexpand\caption@ORI[{\the\toks0}]{\the\toks2}}|\\
+% | \x|
+% \end{quote}
+% \begin{quote}
+% \leavevmode\llap{-or-\quad}%^^A
+% |\edef\x{%|\\
+% | \noexpand\caption@ORI[{\unexpanded\expandafter{##1}}]%|\\
+% | {\unexpanded\expandafter{##2}}}|\\
+% |\-|
+% \end{quote}}
+% \begin{macrocode}
+ \caption@ORI@make@piccaption
+ \let\caption\caption@ORI}%
+% \end{macrocode}
+% \end{macro}
+%
+
+% \begin{macro}{\ivparpic}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
+% We need to set our \package{hyperref} anchor here.
+% Not bullet-proof since we have to redefine |\noindent| here!
+% \begin{macrocode}
+ \let\caption@ORI@ivparpic\ivparpic
+ \def\ivparpic(#1,#2)(#3,#4)[#5][#6]#7{%
+ \let\caption@ORI@noindent\noindent
+ \def\noindent{%
+ \caption@defrostHref
+ \let\noindent\caption@ORI@noindent
+ \noindent}%
+ \caption@ORI@ivparpic(#1,#2)(#3,#4)[{#5}][{#6}]{#7}%
+ \let\noindent\caption@ORI@noindent}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{%
+ \let\piccaptiontype\@undefined
+}
+% \end{macrocode}
+%
+% \subsection{The rotating package}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{rotating}[1995/08/22 v2.10]{%
+% \end{macrocode}
+%
+% \begin{macro}{\rotcaption}
+% \changes{v3.0c}{2004/07/16}{Bugfix: Check for \cs{caption@star} removed}
+% \changes{v3.0i}{2005/12/07}{Rewritten, works with \package{hyperref} now}
+% Make |\rotcaption*| work.
+% \begin{macrocode}
+ \def\rotcaption{\let\@makecaption\@makerotcaption\caption}%
+% \let\@rotcaption\@undefined
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\rotcaptionof}
+% \changes{v3.0i}{2005/12/07}{New}
+% Make |\rotcaptionof(*)| work.
+% \begin{macrocode}
+ \def\rotcaptionof{%
+ \caption@teststar\caption@of{\rotcaption*}\rotcaption}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makerotcaption}
+% \changes{v3.0i}{2005/12/06}{Rewritten, should finally work proper now}
+% \changes{v3.0m}{2007/03/04}{Uses \cs{caption@parbox} instead of \cs{caption@start/endbox} now}
+% \changes{v3.3}{2012/12/26}{Rewritten (again)}
+% Original (bugfixed) code:
+% \begin{verbatim}
+% \long\def\@makerotcaption#1#2{%
+% \setbox\@tempboxa\hbox{#1: #2}%
+% \ifdim \wd\@tempboxa > .8\vsize
+% \rotatebox{90}{%
+% \begin{minipage}{.8\textheight}#1: #2\end{minipage}%
+% }%\par % <== \par removed (AR)
+% \else%
+% \rotatebox{90}{\box\@tempboxa}%
+% \fi
+% \nobreak\hspace{12pt}% <== \nobreak added (AR)
+% }
+% \end{verbatim}%^^A
+% Our version emulates this behavior, but if |width=| is set,
+% the rotated caption is always typeset as |\parbox|.
+% (Note that |margin=| is not supported here.)
+% \begin{macrocode}
+ \long\def\@makerotcaption#1#2{%
+ \rotatebox{90}{%
+ \ifdim\captionwidth=\z@
+ \setcaptionwidth{.8\vsize}%
+ \l@addto@macro\caption@singleline{%
+ \caption@setup{parbox=none}}%
+ \fi
+ \let\caption@calcmargin\relax
+ \caption@@make{#1}{#2}}%
+ \nobreak\hspace{12pt}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The sidecap package}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{sidecap}[2003/06/06 v1.6f]{%
+ \caption@setbool{needfreeze}{1}%
+% \end{macrocode}
+%
+% \begin{macro}{\SC@zfloat}
+% \changes{v3.0b}{2004/05/16}{Local definition of \cs{captionsetup} added}
+% \changes{v3.0c}{2004/07/16}{Bugfix 04-07-15: Check for \cs{caption@star} removed}
+% \changes{v3.1c}{2007/10/06}{\cs{caption} will be saved \& restored now}
+% \changes{v3.2a}{2011/08/17}{Bugfix: Uses \cs{caption@freeze} instead of \cs{caption@freeze*} now}
+% \changes{v3.3}{2013/05/01}{Usage of \cs{caption@freeze} replaced by \cs{caption@freezetype}}
+% This macro will be called at the start of the environment, here is a good
+% opportunity to do some adaptations to |\caption| and |\captionsetup|.
+% \begin{macrocode}
+ \let\caption@ORI@SC@zfloat\SC@zfloat
+ \def\SC@zfloat#1#2#3[#4]{%
+% \end{macrocode}
+% First we use the original definition, but restore \cs{caption} and \cs{label}
+% so \cs{caption@freeze} and \cs{caption@warmup} will work correctly.
+% \begin{macrocode}
+ \caption@ORI@SC@zfloat{#1}{#2}{#3}[#4]%
+ \SC@RestoreCommands
+% \end{macrocode}
+% Since the sidecap package uses our |\caption| code outside the
+% environment the regular |\captionsetup| will not work.
+% So we need a special version here which saves the given argument list
+% which will be executed later on.
+% Furthermore we need to make |\caption*| work.
+% \begin{macrocode}
+ \caption@freezetype{#2}%
+% \end{macrocode}
+% The sidecap package uses |\ifx\label\SC@label| to test if it is just inside a
+% |SC|\-|figure| or not. So we redefine |\SC@label| here so this test will still work.
+% \begin{macrocode}
+ \let\SC@label\label}%
+% \end{macrocode}
+% \begin{macrocode}
+ \providecommand*\SC@RestoreCommands{%
+ \let\caption=\SC@orig@caption \let\label=\SC@orig@label}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\endSC@FLOAT}
+% \changes{v3.0i}{2006/01/12}{\cs{@listdepth}\cs{z@} added}
+% \changes{v3.1}{2007/05/05}{Call of \cs{caption@setoptions}\arg{SCfloat} added}
+% This macro will be called at the end of the environment, here we need to
+% setup our stuff before the \package{sidecap} package actually typesets
+% its caption.
+% \begin{macrocode}
+ \let\caption@ORI@endSC@FLOAT\endSC@FLOAT
+ \def\endSC@FLOAT{%
+% \end{macrocode}
+% Before we can typeset the caption we need to set the margin to zero
+% because any extra margin would only be disturbing here.\par
+% (We don't need to take care about the caption position because
+% the sidecap package set both |\abovecaptionskip| and |\belowcaptionskip|
+% to a skip of zero anyway.)\par
+% Furthermore |\SC@justify| will override the caption justification, if set.
+% The usage of |\SC@justify| differs from version to version of the
+% \package{sidecap} package:\par
+% \begin{tabular}{ll}
+% Version 1.4: & |\SC@justify| is not defined\\
+% Version 1.5: & |\SC@justify| is |\relax| when not set\\
+% Version 1.6: & |\SC@justify| is |\@empty| when not set\\
+% \end{tabular}
+% \begin{macrocode}
+ \def\caption@setSC@justify{%
+ \caption@clearmargin
+ \ifx\SC@justify\@empty \else
+ \let\caption@hj\SC@justify
+ \let\SC@justify\@empty
+ \fi}%
+% \end{macrocode}
+% Make the original definition of |\endSC@FLOAT| to use our caption
+% stuff instead of its own.
+% \Note{At this point the \package{sidecap} definition of \cs{caption} is valid,
+% not the regular one!}
+% \begin{macrocode}
+ \let\caption\SC@orig@caption
+ \def\SC@orig@caption[##1]##2{%
+ \caption@setSC@justify
+%%% \caption@setoptions{SC}%
+ \caption@setoptions{SC\@captype}%
+ \caption@defrost}%
+% \end{macrocode}
+% Finally we call the original definition of |\endSC@FLOAT|.
+% \begin{macrocode}
+ \caption@setSC@justify % for compatibility mode
+ \caption@prepare@defrost
+ \caption@ORI@endSC@FLOAT}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The subfigure package}
+% \changes{v3.1}{2007/04/06}{subfigure package support added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{subfigure}[2002/01/23 v2.1]{%
+% \end{macrocode}
+%
+% \begin{macro}{\sf@ifpositiontop}
+% \changes{v3.1a}{2007/09/15}{Bugfix 07-09-15: Check for \cs{@captype} added}
+% If the \package{subfigure} package is loaded, we map |\sf@ifpositiontop|
+% to |\iffiguretopcap| resp. |\iftabletopcap|, so the \package{subfigure}
+% \version{2.1} options \opt{figbotcap} etc. will still work.
+% \begin{macrocode}
+ \def\sf@ifpositiontop{%
+ \ifx\@captype\@undefined
+ \expandafter\@gobbletwo
+ \else\ifx\@captype\relax
+ \expandafter\expandafter\expandafter\@gobbletwo
+ \else
+ \expandafter\expandafter\expandafter\sf@if@position@top
+ \fi\fi}
+% \end{macrocode}
+% \begin{macrocode}
+ \def\sf@if@position@top{%
+ \@ifundefined{if\@captype topcap}%
+ {\@gobbletwo}%
+ {\@nameuse{if\@captype topcap}%
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The supertabular and xtab packages}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{supertabular}[2002/07/19 v4.1e]{%
+% \end{macrocode}
+%
+% \begin{macro}{\tablecaption}
+% \changes{v3.0e}{2005/05/05}{Made \cs{topcaption*} and \cs{bottomcaption*} work}
+% \changes{v3.1h}{2008/04/01}{Bugfix: Star variant does not increment table counter anymore}
+% Make |\topcaption*| and |\bottomcaption*| work.
+% \begin{macrocode}
+ \renewcommand*\tablecaption{%
+ \caption@star
+ {\refstepcounter{table}}%
+ {\caption@dblarg{\@xtablecaption}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@xtablecaption}
+% \changes{v3.1h}{2008/04/01}{Made \cs{nameref} \& \cs{autoref} work}
+% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
+% Make |\nameref| and |\autoref| work.
+% \begin{macrocode}
+ \let\caption@ORI@xtablecaption\@xtablecaption
+ \long\def\@xtablecaption[#1]#2{%
+ \caption@gettitle{#2}%
+ \caption@ORI@xtablecaption[{#1}]{#2}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@caption}
+% \changes{v3.0a}{2004/01/23}{Bugfix: Missing \cs{par} added}
+% \changes{v3.1h}{2008/04/01}{Bugfix: \cs{@currentlabelname} will be set now}
+% The original code:
+% \begin{verbatim}
+% \long\def\ST@caption#1[#2]#3{\par%
+% \addcontentsline{\csname ext@#1\endcsname}{#1}%
+% {\protect\numberline{%
+% \csname the#1\endcsname}{\ignorespaces #2}}
+% \begingroup
+% \@parboxrestore
+% \normalsize
+% \if@topcaption \vskip -10\p@ \fi
+% \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+% \if@topcaption \vskip 10\p@ \fi
+% \endgroup}
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \long\def\ST@caption#1[#2]#3{\par%
+ \caption@settype*{#1}%
+ \caption@setoptions{supertabular}%
+% \end{macrocode}
+% The |position=| setting will be overwritten by the
+% \package{supertabular} package: If |\topcaption| was used,
+% the position will be |top| automatically, |bottom| otherwise.
+% \begin{macrocode}
+ \def\caption@fixposition{%
+ \caption@setposition{\if@topcaption t\else b\fi}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@beginex{#1}{#2}{#3}%
+ \caption@boxrestore
+ \caption@normalsize
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+ \caption@end}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \changes{v3.1h}{2008/04/01}{Support of the xtab package added}
+% \begin{macrocode}
+\caption@IfPackageLoaded{xtab}[2000/04/09 v2.3]{%
+% \end{macrocode}
+%
+% \begin{macro}{\tablecaption}
+% Make |\topcaption*| and |\bottomcaption*| work.
+% \begin{macrocode}
+ \renewcommand*\tablecaption{%
+ \caption@star
+ {\refstepcounter{table}}%
+ {\caption@dblarg{\@xtablecaption}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@xtablecaption}
+% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
+% Make |\nameref| and |\autoref| work.
+% \begin{macrocode}
+ \let\caption@ORI@xtablecaption\@xtablecaption
+ \long\def\@xtablecaption[#1]#2{%
+ \caption@gettitle{#2}%
+ \caption@ORI@xtablecaption[{#1}]{#2}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@caption}
+% The original code:
+% \begin{verbatim}
+% \long\def\ST@caption#1[#2]#3{\par%
+% \@initisotab
+% \addcontentsline{\csname ext@#1\endcsname}{#1}%
+% {\protect\numberline{%
+% \csname the#1\endcsname}{\ignorespaces #2}}%
+% \begingroup
+% \@parboxrestore
+% \normalsize
+% %% \if@topcaption \vskip -10\p@ \fi
+% \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+% %% \if@topcaption \vskip 10\p@ \fi
+% \endgroup
+% \global\advance\ST@pageleft -\PWSTcapht
+% \ST@trace\tw@{Added caption. Space left for xtabular: \the\ST@pageleft}}
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \long\def\ST@caption#1[#2]#3{\par%
+ \caption@settype*{#1}%
+ \caption@setoptions{xtabular}%
+% \end{macrocode}
+% \begin{macrocode}
+ \def\caption@fixposition{%
+ \caption@setposition{\if@topcaption t\else b\fi}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \@initisotab
+ \caption@beginex{#1}{#2}{#3}%
+ \caption@boxrestore
+ \caption@normalsize
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+ \caption@end
+ \global\advance\ST@pageleft -\PWSTcapht
+ \ST@trace\tw@{Added caption. Space left for xtabular: \the\ST@pageleft}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The threeparttable package}
+% \changes{v3.1}{2007/05/08}{Support of the \package{threeparttable} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{threeparttable}[2003/06/13 v3.0]{%
+% \end{macrocode}
+%
+% \begin{macro}{\threeparttable}
+% \changes{v3.3}{2016/01/31}{Bugfix: \cs{@captype} will be used if already defined}
+% Unfortunately |\@captype| is not set when |\TPT@common| will be used,
+% so we have to redefine |\threeparttable| and |\measuredfigure| instead.
+% \begin{macrocode}
+ \let\caption@ORI@threeparttable\threeparttable
+ \renewcommand*\threeparttable{%
+ \caption@settype{\@ifundefined{@captype}{table}{\@captype}}%
+%%% \caption@setposition a% ?
+ \caption@clearmargin
+ \caption@setoptions{threeparttable}%
+ \caption@ORI@threeparttable}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\measuredfigure}
+% \changes{v3.3}{2016/01/31}{Bugfix: \cs{@captype} will be used if already defined}
+% Same here\ldots
+% \begin{macrocode}
+ \let\caption@ORI@measuredfigure\measuredfigure
+ \renewcommand*\measuredfigure{%
+ \caption@settype{\@ifundefined{@captype}{figure}{\@captype}}%
+%%% \caption@setposition a% ?
+ \caption@clearmargin
+ \caption@setoptions{measuredfigure}%
+ \caption@ORI@measuredfigure}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TPT@caption}
+% The original code:
+% \begin{verbatim}
+% \def\TPT@caption#1[#2]#3{\gdef\TPT@docapt
+% {\par\global\let\TPT@docapt\@undefined \TPT@LA@caption{#1}[{#2}]%
+% {\strut\ignorespaces#3\ifhmode\unskip\@finalstrut\strutbox\fi}}%
+% \ifx\TPT@hsize\@empty \let\label\TPT@gatherlabel \abovecaptionskip\z@skip
+% \else \TPT@docapt \fi \ignorespaces}
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \def\TPT@caption#1[#2]#3{%
+ \gdef\TPT@docapt{%
+ \global\let\TPT@docapt\@undefined
+ \caption@setautoposition\caption@TPT@position
+ \TPT@LA@caption{#1}[{#2}]{#3}}%
+ \ifx\TPT@hsize\@empty
+ \let\label\TPT@gatherlabel % Bug: does not work for measuredfigures
+ \gdef\caption@TPT@position{t}%
+ \g@addto@macro\TPT@docapt\caption@TPT@eatvskip
+ \else
+ \def\caption@TPT@position{b}%
+ \TPT@docapt
+ \fi
+ \ignorespaces}%
+% \end{macrocode}
+% \begin{macrocode}
+ %\newcommand*\caption@TPT@eatvskip{\vskip-.2\baselineskip}%
+ \def\caption@TPT@eatvskip#1\vskip{#1\@tempdima=}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The wrapfig package}
+% \changes{v3.1}{2007/05/05}{Support of the \package{wrapfig} package added}
+% \changes{v3.2d}{2011/11/02}{Support of the \package{wrapfig} package rewritten}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{wrapfig}[2003/01/31 v3.6]{%
+% \end{macrocode}
+%
+% \begin{macro}{\wrapfloat}
+% \changes{v3.2d}{2011/11/02}{Redefinition of this macro added}
+% First of all we make the \package{wrapfig} package independent from the package
+% load order regarding the \package{float} package.
+% Since the usage of |\@float@set|\-|every| is missing in the code of the \package{wrapfig}
+% package (it should be in the redefinition of |\float@re|\-|style|, right after
+% |\@nameuse{fst@#1}|), we don't use it here, too,
+% especially since |\wrap|\-|float| will usually not be used when used with re-styled floats.
+% \begin{macrocode}
+ \renewcommand*\wrapfloat[1]{%
+ \def\@captype{#1}%
+ \@ifundefined{fst@#1}{}{%
+ \@nameuse{fst@#1}%
+% \@float@setevery{#1}%
+ \def\WF@floatstyhook{\let\@currbox\WF@box
+ \global\setbox\WF@box\float@makebox{\wd\WF@box}}}%
+ \@ifnextchar[\WF@wr{\WF@wr[]}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\WF@rapt}
+% \changes{v3.2d}{2011/11/02}{Usage of \cs{WF@captionstyhook} added}
+% Original code:
+% \begin{verbatim}
+% \def\WF@rapt[#1]#2{% final two args: #1 = overhang, #2 = width,
+% \gdef\WF@ovh{#1}% hold overhang for later, when \width is known
+% \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}%
+% \ifdim\hsize>\z@ \@parboxrestore \else
+% \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption
+% \ignorespaces \fi}
+% \end{verbatim}%^^A
+% Our code has |\WF@captionstyhook| in addition:
+% \begin{macrocode}
+ \def\WF@rapt[#1]#2{% final two args: #1 = overhang, #2 = width,
+ \gdef\WF@ovh{#1}% hold overhang for later, when \width is known
+ \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}%
+ \expandafter\WF@captionstyhook\expandafter{\@captype}% <= new
+ \ifdim\hsize>\z@ \@parboxrestore \else
+ \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption
+ \ignorespaces \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\WF@captionstyhook}
+% \changes{v3.2d}{2011/11/02}{This macro added}
+% \changes{v3.2e}{2011/11/10}{Bugfix 11-11-09: float package support fixed}
+% We place our \package{hyperref} anchor here, apply the `wrap' options etc.
+% Since the usage of |\@float@set|\-|every| is missing in the \package{wrapfig}
+% package we will catch it up here for making the necessary adaptions to the
+% \package{float} package.
+% \begin{macrocode}
+ \def\WF@captionstyhook#1{%
+ \let\@captype\@undefined
+ \@ifundefined{fst@#1}{}{\@float@setevery{#1}}%
+ \caption@settype{#1}%
+ \caption@clearmargin
+%%% \caption@setoptions{wrap}%
+ \caption@setoptions{wrap#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \begin{thebibliography}{99}
+% \bibitem{beamer}
+% Till Tantau:\\
+% \href{http://www.ctan.org/pkg/beamer}%
+% {\emph{The beamer class, User Guide for version 3.25}},\\
+% December 26, 2012
+%
+% \bibitem{KOMAScript}
+% Markus Kohm \& Jens-Uwe-Morawski:\\
+% \href{http://www.ctan.org/pkg/koma-script}%
+% {\emph{KOMA-Script -- a versatile \LaTeXe\ bundle}},\\
+% 2012-07-22
+%
+% \bibitem{NTG}
+% Victor Eijkhout:\\
+% \href{http://www.ctan.org/pkg/ntgclass}%
+% {\emph{An introduction to the Dutch \LaTeX\ document classes}},\\
+% 3 September 1989
+%
+% \bibitem{float}
+% Anselm Lingnau:\\
+% \href{http://www.ctan.org/pkg/float}%
+% {\emph{An Improved Environment for Floats}},\\
+% 2001/11/08
+%
+% \bibitem{floatflt}
+% Mats Dahlgren:\\
+% \href{http://www.ctan.org/pkg/floatflt}%
+% {\emph{Welcome to the floatflt package}},\\
+% 1998/06/05
+%
+% \bibitem{floatrow}
+% Olga Lapko:\\
+% \href{http://www.ctan.org/pkg/floatrow}%
+% {\emph{The floatrow package documentation}},\\
+% 2009/08/02
+%
+% \bibitem{fltpage}
+% Sebastian Gross:\\
+% \href{http://www.ctan.org/pkg/fltpage}%
+% {\emph{Welcome to the beta test of fltpage package!}},\\
+% 1998/11/13
+%
+% \bibitem{hyperref}
+% Sebastian Rahtz \& Heiko Oberdiek:\\
+% \href{http://www.ctan.org/pkg/hyperref}%
+% {\emph{Hypertext marks in \LaTeX: a manual for hyperref}},\\
+% November 2012
+%
+% \bibitem{hypcap}
+% Heiko Oberdiek:\\
+% \href{http://www.ctan.org/pkg/oberdiek}%
+% {\emph{The hypcap package -- Adjusting anchors of captions}},\\
+% 2011/02/16
+%
+% \bibitem{listings}
+% Carsten Heinz \& Brooks Moses:\\
+% \href{http://www.ctan.org/pkg/listings}%
+% {\emph{The Listings Package}},\\
+% 2007/02/22
+%
+% \bibitem{longtable}
+% David Carlisle:\\
+% \href{http://www.ctan.org/pkg/longtable}%
+% {\emph{The longtable package}},\\
+% 2004/02/01
+%
+% \bibitem{picinpar}
+% Friedhelm Sowa:\\
+% \href{http://www.ctan.org/pkg/picinpar}%
+% {\emph{Pictures in Paragraphs}},\\
+% July 13, 1993
+%
+% \bibitem{picins}
+% Joachim Bleser and Edmund Lang:\\
+% \href{http://www.ctan.org/pkg/picins}%
+% {\emph{PicIns-Benutzerhandbuch Version 3.0}},\\
+% September~1992
+%
+% \bibitem{rotating}
+% Sebastian Rahtz and Leonor Barroca:\\
+% \href{http://www.ctan.org/pkg/rotating}%
+% {\emph{A style option for rotated objects in \LaTeX}},\\
+% 1997/09/26
+%
+% \bibitem{sidecap}
+% Rolf Niepraschk \& Hubert G\"a\ss lein:\\
+% \href{http://www.ctan.org/pkg/sidecap}%
+% {\emph{The sidecap package}},\\
+% 2003/06/06
+%
+% \bibitem{subfigure}
+% Steven D. Cochran:\\
+% \href{http://www.ctan.org/pkg/subfigure}%
+% {\emph{The subfigure package}},\\
+% 2005/03/15
+%
+% \bibitem{subfig}
+% Steven D. Cochran:\\
+% \href{http://www.ctan.org/pkg/subfig}%
+% {\emph{The subfig package}},\\
+% 2005/07/05
+%
+% \bibitem{supertabular}
+% Johannes Braams and Theo Jurriens:\\
+% \href{http://www.ctan.org/pkg/supertabular}%
+% {\emph{The supertabular environment}},\\
+% 2004/02/20
+%
+% \bibitem{threeparttable}
+% Donald Arseneau:\\
+% \href{http://www.ctan.org/pkg/threeparttable}%
+% {\emph{Three part tables: title, tabular environment, notes}},\\
+% March 5, 2010
+%
+% \bibitem{wrapfig}
+% Donald Arseneau:\\
+% \href{http://www.ctan.org/pkg/wrapfig}%
+% {\emph{WRAPFIG.STY ver 3.6}},\\
+% Jan 31, 2003
+%
+% \bibitem{xtab}
+% Peter Wilson:\\
+% \href{http://www.ctan.org/pkg/xtab}%
+% {\emph{The xtab package}},\\
+% 2011/07/31
+% \end{thebibliography}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/caption/fallback/v3.4/caption3.dtx b/Master/texmf-dist/source/latex/caption/fallback/v3.4/caption3.dtx
new file mode 100644
index 00000000000..2843145c183
--- /dev/null
+++ b/Master/texmf-dist/source/latex/caption/fallback/v3.4/caption3.dtx
@@ -0,0 +1,4231 @@
+% \iffalse meta-comment
+%
+% This is file `caption3.dtx'.
+%
+% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%
+% --------------------------------------------------------------------------
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Axel Sommerfeldt.
+%
+% This work consists of the files
+% caption.ins, caption.dtx, caption2.dtx, caption3.dtx,
+% bicaption.dtx, ltcaption.dtx, subcaption.dtx,
+% the derived files
+% caption.sty, caption2.sty, caption3.sty,
+% bicaption.sty, ltcaption.sty, subcaption.sty,
+% and the user manuals
+% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+%
+% \fi
+% \CheckSum{3607}
+%
+% \iffalse
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption3.drv}[2019/09/10 v1.13 Implementation of the caption kernel]
+\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
+%\errorcontextlines=3
+%
+\documentclass{ltxdoc}
+\setlength\parindent{0pt}
+\setlength\parskip{\smallskipamount}
+%
+\makeatletter % make room for subsections like 2.16.14 in the TOC
+%\newcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
+\renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.7em}}
+\makeatother
+%
+\usepackage{ifpdf}
+\ifpdf
+ \usepackage{mathptmx,courier}
+ \usepackage[scaled=0.90]{helvet}
+ \addtolength\marginparwidth{15pt}
+\fi
+%
+\usepackage{hypdoc}
+\ifpdf\usepackage{hypdestopt}\fi
+\hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}}
+%
+\usepackage{caption3}[2020/05/30]
+%
+\DeclareRobustCommand*\AmS{\texorpdfstring
+ {{\protect\usefont{OMS}{cmsy}{m}{n}A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}%
+ {AMS}}
+\DeclareRobustCommand*\KOMAScript{\texorpdfstring
+ {\textsf{K\kern.05em O\kern.05em M\kern.05em A\kern.1em-\kern.1em Script}}%
+ {KOMA-Script}}
+\DeclareRobustCommand*\NTG{NTG}
+\DeclareRobustCommand*\SmF{SMF}
+%
+\begin{document}
+ \DocInput{caption3.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \newcommand*\purerm[1]{{\upshape\mdseries\rmfamily #1}}
+% \newcommand*\puresf[1]{{\upshape\mdseries\sffamily #1}}
+% \newcommand*\purett[1]{{\upshape\mdseries\ttfamily #1}}
+% \let\class\puresf \let\package\puresf
+% \let\env\purett \let\opt\purett
+%
+% \def\thispackage{the \package{caption} kernel}
+% \def\Thispackage{The \package{caption} kernel}
+%
+% \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
+% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
+% \newcommand*\version[2][]{\textit{v#2}}
+%
+% \GetFileInfo{caption3.sty}
+%
+% \title{The Implementation of
+% \texorpdfstring{\thispackage\thanks{%^^A
+% This package has version number \fileversion, last revised \filedate.}}%^^A
+% {the caption kernel}}
+% \author{Axel Sommerfeldt\\
+% \url{https://gitlab.com/axelsommerfeldt/caption}}
+% \date{\filedate}
+% \maketitle
+%
+% \begin{abstract}
+% \Thispackage\ consists of two parts -- the kernel
+% (|caption3.sty|) and the main package (|caption.sty|).
+%
+% The kernel provides all the user commands and internal macros which are
+% necessary for typesetting captions and setting parameters regarding these.
+% While the standard \LaTeX\ document classes provide an internal command
+% called |\@makecaption| and no options to control its behavior (except the
+% vertical skips above and below the caption itself), we provide similar
+% commands called |\caption@make| and |\caption@@make|, but with a lot of
+% options which can be selected with |\captionsetup|.
+% Loading the kernel part do not change the output of a \LaTeX\ document
+% -- it just provides functionality which can be used by \LaTeXe\ packages
+% which typesets captions, for example the \package{caption} and
+% \package{subfig} packages.
+% \end{abstract}
+%
+% \StopEventually{}
+% \clearpage
+% \tableofcontents
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \DoNotIndex{\\,\_,\ ,\@@par}
+% \DoNotIndex{\@bsphack}
+% \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
+% \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
+% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
+% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
+% \DoNotIndex{\if@minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@minipagefalse,\@minipagetrue}
+% \DoNotIndex{\@namedef,\@nameuse}
+% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
+% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setminipage,\@setpar}
+% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
+% \DoNotIndex{\@testopt}
+% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
+% \DoNotIndex{\p@,\z@}
+% \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
+% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
+% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
+% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
+% \DoNotIndex{\fi,\footnotesize,\global}
+% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
+% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
+% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
+% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
+% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
+% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
+% \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
+% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
+% \DoNotIndex{\providecommand,\quad}
+% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
+% \DoNotIndex{\rightskip,\rmfamily}
+% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
+% \DoNotIndex{\small,\string,\space,\strut}
+% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
+% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
+% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
+% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
+% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
+% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
+% \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \setlength{\parskip}{0pt plus 1pt}
+% \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
+%
+% \changes{v1.0}{2003/12/20}{Rewritten; many new commands and features}
+% \changes{v1.0c}{2004/11/28}{Split into two packages:
+% \package{caption} \& \package{caption3}}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+%
+% \iffalse
+%<*package>
+% \fi
+%
+% \section{Identification}
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesPackage{caption3}[2020/07/29 v1.13 caption3 kernel (AR)]
+% \end{macrocode}
+%
+% \section{Workaround for bug in package \package{arabtex}}
+% \package{arabtex} re-defines \cs{@gobble} as not-long so the packages of the
+% \package{caption} package bundle are doomed to fail.
+% Since this fatal bug won't be fixed in \package{arabtex} but we are dependent on a
+% proper definition of \cs{@gobble}, \cs{@firstofone}, \cs{@firstoftwo}, \cs{@secondoftwo},
+% and so on we fix this here. (Sigh!)
+% \begin{macrocode}
+\providecommand\caption@FixArabTeX{%
+ \def\caption@tempa##1{}%
+ \ifx\caption@tempa\@gobble
+ \PackageInfo{caption3}{Fixing ArabTeX}%
+ \long\def\@gobble##1{}%
+ \fi}
+% \end{macrocode}
+% Do the fix now and at |\begin{document}|, in case \package{arabtex} will be loaded after \package{caption}.
+% \begin{macrocode}
+\caption@FixArabTeX
+\AtBeginDocument{%
+ \caption@FixArabTeX
+ \let\caption@FixArabTeX\@undefined}
+% \end{macrocode}
+%
+% \section{Generic helpers}
+%
+% \begin{macro}{\@nameundef}
+% This is the opposite to |\@namedef| which is offered by the \LaTeX\ kernel.
+% We use it to remove the definition of some commands and keyval options after
+% |\begin{document}| (to save \TeX\ memory) and to remove caption options defined
+% with |\captionsetup|\oarg{type}.
+% \begin{macrocode}
+\providecommand*\@nameundef[1]{%
+ \expandafter\let\csname #1\endcsname\@undefined}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@addto@macro}
+% \changes{v1.5}{2013/04/26}{Revised}
+% The \LaTeXe\ kernel offers the internal helper macro |\g@addto@macro| which
+% globally adds tokens to existing macros, like in |\AtBeginDocument|.
+% This is the same but it works local, not global.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname currentgrouplevel\endcsname\relax
+ \PackageInfo{caption3}{TeX engine: TeX}
+ \let\caption@ifeTeX\@secondoftwo
+ \providecommand\l@addto@macro[2]{%
+ \begingroup
+ \toks@\expandafter{#1#2}%
+ \xdef\caption@addto@temp{\the\toks@}%
+ \endgroup
+ \let#1\caption@addto@temp}
+\else
+ \PackageInfo{caption3}{TeX engine: e-TeX}
+ \let\caption@ifeTeX\@firstoftwo
+ \providecommand\l@addto@macro[2]{%
+ \edef#1{\unexpanded\expandafter{#1#2}}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bothIfFirst}
+% \begin{macro}{\bothIfSecond}
+% |\bothIfFirst| tests if the first argument is not empty, |\bothIfSecond|
+% tests if the second argument is not empty. If yes both arguments get
+% typeset, otherwise none of them.
+% \begin{macrocode}
+\def\bothIfFirst#1#2{%
+ \protected@edef\caption@tempa{#1}%
+ \ifx\caption@tempa\@empty \else
+ #1#2%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\def\bothIfSecond#1#2{%
+ \protected@edef\caption@tempa{#2}%
+ \ifx\caption@tempa\@empty \else
+ #1#2%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifundefined}
+% \changes{v1.3a}{2011/08/12}{This macro added}
+% \changes{v1.3b}{2011/08/18}{Made expandable}
+% Similar to \cs{@ifundefined} offered by the \LaTeX kernel,
+% but takes a macro as argument instead of a macro name.
+% \begin{macrocode}
+\newcommand*\caption@ifundefined[1]{%
+ \ifx#1\@undefined
+ \expandafter\@firstoftwo
+ \else\ifx#1\relax
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \fi\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifdefined}
+% \changes{v1.8e}{2018/05/11}{This macro added}
+% Similar to \cs{@ifundefined} offered by the \LaTeX kernel,
+% but takes a macro as argument instead of a macro name.
+% \begin{macrocode}
+\newcommand*\caption@ifdefined[1]{%
+ \ifx#1\@undefined
+ \expandafter\@secondoftwo
+ \else\ifx#1\relax
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \else
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \fi\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifinlist}
+% \changes{v1.1}{2007/07/29}{Rewritten}
+% This helper macro checks if the first argument is in the comma separated
+% list which is offered as second argument. So for example
+% \begin{quote}
+% |\caption@ifinlist{frank}{axel,frank,olga,steven}{yes}{no}|
+% \end{quote}
+% would expand to |yes|.
+% \begin{macrocode}
+\newcommand*\caption@ifinlist{%
+ \@expandtwoargs\caption@@ifinlist}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@ifinlist[2]{%
+ \begingroup
+ \def\@tempa##1,#1,##2\@nil{%
+ \endgroup
+ \ifx\relax##2\relax
+ \expandafter\@secondoftwo
+ \else
+ \expandafter\@firstoftwo
+ \fi}%
+ \@tempa,#2,#1,\@nil}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifin@list}
+% \changes{v1.1}{2007/08/12}{This macro added}
+% |\caption@ifin@list|\marg{cmd}\marg{list entry}\marg{yes}\marg{no}
+% \begin{macrocode}
+\newcommand*\caption@ifin@list[2]{%
+ \caption@ifempty@list#1%
+ {\@secondoftwo}%
+ {\@expandtwoargs\caption@@ifinlist{#2}{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@g@addto@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@g@addto@list|\marg{cmd}\marg{list entry}
+% \begin{macrocode}
+\newcommand*\caption@g@addto@list[2]{%
+ \caption@ifempty@list#1{\gdef#1{#2}}{\g@addto@macro#1{,#2}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@l@addto@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@l@addto@list|\marg{cmd}\marg{list entry}
+% \begin{macrocode}
+\newcommand*\caption@l@addto@list[2]{%
+ \caption@ifempty@list#1{\def#1{#2}}{\l@addto@macro#1{,#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@g@removefrom@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@g@removefrom@list|\marg{cmd}\marg{list entry}
+% \begin{macrocode}
+\newcommand*\caption@g@removefrom@list[2]{%
+ \caption@l@removefrom@list#1{#2}%
+ \global\let#1#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@l@removefrom@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@l@removefrom@list|\marg{cmd}\marg{list entry}\par
+% \Note[Caveat]{\meta{cmd} will be expanded during this process since
+% \cs{@removeelement} is using \cs{edef} to build the new list!}
+% \begin{macrocode}
+\newcommand*\caption@l@removefrom@list[2]{%
+ \caption@ifempty@list#1{}{\@expandtwoargs\@removeelement{#2}#1#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@for@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@for@list|\marg{cmd}\marg{code with \#1}
+% \begin{macrocode}
+\newcommand*\caption@for@list[2]{%
+ \caption@ifempty@list#1{}{%
+ \def\caption@tempb##1{#2}%
+ \@for\caption@tempa:=#1\do{%
+ \expandafter\caption@tempb\expandafter{\caption@tempa}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifempty@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@ifempty@list|\marg{cmd}\marg{true}\marg{false}
+% \begin{macrocode}
+\newcommand*\caption@ifempty@list[1]{%
+ \ifx#1\@undefined
+ \expandafter\@firstoftwo
+ \else\ifx#1\relax
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else\ifx#1\@empty
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \fi\fi\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \pagebreak[3]
+% \begin{macro}{\caption@setbool}
+% \begin{macro}{\caption@set@bool}
+% \changes{v1.1}{2007/04/05}{\cs{caption@set@bool}\marg{cmd}\marg{value} added}
+% \begin{macro}{\caption@ifbool}
+% \begin{macro}{\caption@undefbool}
+% For setting and testing boolean options we offer these three helper macros:
+% \begin{quote}
+% |\caption@setbool|\marg{name}\marg{value}\\
+% | |(with |value = false/true/no/yes/off/on/0/1|)\\
+% |\caption@ifbool|\marg{name}\marg{if-clause}\marg{else-clause}\\
+% |\caption@undefbool|\marg{name}
+% \end{quote}
+% \begin{macrocode}
+\newcommand*\caption@setbool[1]{%
+ \expandafter\caption@set@bool\csname caption@if#1\endcsname}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@set@bool[2]{%
+ \caption@ifinlist{#2}{1,true,yes,on}{%
+ \let#1\@firstoftwo
+ }{\caption@ifinlist{#2}{0,false,no,off}{%
+ \let#1\@secondoftwo
+ }{%
+ \caption@Error{Undefined boolean value `#2'}%
+ }}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@ifbool[1]{\@nameuse{caption@if#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@undefbool[1]{\@nameundef{caption@if#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@teststar}
+% \changes{v1.1}{2007/05/08}{This macro and its usage added}
+% \changes{v1.1e}{2007/10/28}{\cs{caption@teststar@} added}
+% |\caption@teststar|\marg{cmd}\marg{star arg}\marg{non-star arg}\\
+% |\caption@teststar@|\marg{cmd}\marg{star arg}\marg{non-star arg}
+% \begin{macrocode}
+\newcommand*\caption@teststar[3]{\@ifstar{#1{#2}}{#1{#3}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@teststar@[3]{%
+ \@ifstar{#1{#2}}{\caption@ifatletter{#1{#2}}{#1{#3}}}}
+\AtBeginDocument{\let\caption@teststar@\caption@teststar}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@ifatletter{%
+ \ifnum\the\catcode`\@=11
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+\AtBeginDocument{\let\caption@ifatletter\@secondoftwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@withoptargs}
+% \changes{v1.1}{2007/08/12}{This macro added}
+% \changes{v1.5}{2012/04/09}{This macro revised}
+% |\caption@withoptargs|\marg{cmd}
+% \begin{macrocode}
+\newcommand*\caption@withoptargs[1]{%
+ \@ifstar
+ {\def\caption@tempa{*}\caption@@withoptargs{#1}}%
+ {\def\caption@tempa{}\caption@@withoptargs{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@withoptargs#1{%
+ \@ifnextchar[%]
+ {\caption@@@withoptargs{#1}}%
+ {\caption@@@@withoptargs{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@@withoptargs#1[#2]{%
+ \l@addto@macro\caption@tempa{[{#2}]}%
+ \caption@@withoptargs{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@@@withoptargs#1{%
+ \def\caption@tempb{#1}%
+ \expandafter\caption@tempb\expandafter{\caption@tempa}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@gobble}
+% \changes{v1.4}{2011/08/19}{This macro added}
+% |\caption@gobble*|\oarg{arg}\oarg{\ldots}\marg{arg}\par
+% Same as |\@gobble|, but gobbles optional arguments as well.
+% \begin{macrocode}
+\DeclareRobustCommand*\caption@gobble{%
+ \caption@withoptargs\@gobbletwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@AtBeginDocument}
+% \changes{v1.1}{2007/04/13}{This macro and its usage added}
+% \changes{v1.2e}{2010/01/09}{Adapted to the combine document class}
+% |\caption@AtBeginDocument*|\marg{code}\\
+% Same as |\AtBeginDocument| but the execution of code
+% will be surrounded by two |\PackageInfo|s.
+% The starred variant causes the code to be executed after all code
+% specified using the non-starred variant.
+% \begin{macrocode}
+\let\caption@begindocumenthook\@empty
+\let\caption@@begindocumenthook\@empty
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@AtBeginDocument{%
+ \caption@teststar\g@addto@macro
+ \caption@@begindocumenthook\caption@begindocumenthook}
+%\@onlypreamble\caption@AtBeginDocument
+% \end{macrocode}
+% \begin{macrocode}
+\AtBeginDocument{%
+ \caption@InfoNoLine{Begin \noexpand\AtBeginDocument code}%
+% \end{macrocode}
+% \begin{macrocode}
+ \def\caption@AtBeginDocument{%
+ \@ifstar{\g@addto@macro\caption@@begindocumenthook}\@firstofone}%
+ \caption@begindocumenthook
+ \let\caption@begindocumenthook\relax
+% \end{macrocode}
+% \begin{macrocode}
+ \def\caption@AtBeginDocument{%
+ \@ifstar\@firstofone\@firstofone}%
+ \caption@@begindocumenthook
+ \let\caption@@begindocumenthook\relax
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@InfoNoLine{End \noexpand\AtBeginDocument code}}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Information, Warnings, and Errors}
+%
+% \begin{macro}{\caption@Info}
+% \changes{v1.3}{2010/10/25}{Moved from package to kernel}
+% |\caption@Info|\marg{message}
+% \begin{macrocode}
+\newcommand*\caption@Info[1]{%
+ \PackageInfo{caption}{#1}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@InfoNoLine}
+% \changes{v1.3}{2010/10/25}{Moved from package to kernel}
+% |\caption@InfoNoLine|\marg{message}\\
+% \Note{The \cs{@gobble} at the end of the 2nd argument of
+% \cs{PackageInfo} suppresses the line number info.
+% See TLC2\cite{TLC2}, A.4.7, p885 for details.}
+% \begin{macrocode}
+\newcommand*\caption@InfoNoLine[1]{%
+ \caption@Info{#1\@gobble}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@Warning}
+% \changes{v1.1c}{2007/10/14}{This macro added, will now be used for warnings}
+% |\caption@Warning|\marg{message}
+% \begin{macrocode}
+\newcommand*\caption@Warning[1]{%
+ \caption@WarningNoLine{#1\on@line}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@WarningNoLine}
+% \changes{v1.1c}{2007/10/14}{This macro added, will now be used for warnings}
+% |\caption@WarningNoLine|\marg{message}
+% \begin{macrocode}
+\newcommand*\caption@WarningNoLine[1]{%
+ \PackageWarning{caption}{#1.^^J\caption@wh\@gobbletwo}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@wh{%
+ See the caption package documentation for explanation.}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@Error}
+% \changes{v1.0j}{2007/01/20}{This macro added, will now be used for errors}
+% \changes{v1.0o}{2007/04/11}{Renamed from \cs{caption@error} to \cs{caption@Error}}
+% \changes{v1.1b}{2007/09/18}{Usage of \cs{caption@Package} removed}
+% |\caption@Error|\marg{message}
+% \begin{macrocode}
+\newcommand*\caption@Error[1]{%
+ \PackageError{caption}{#1}\caption@eh}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@eh{%
+ If you do not understand this error, please take a closer look\MessageBreak
+ at the documentation of the `caption' package, especially the\MessageBreak
+ section about errors.\MessageBreak\@ehc}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@KV@err}
+% \changes{v1.1b}{2007/09/18}{This macro added}
+% \begin{macrocode}
+\let\caption@KV@err\caption@Error
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Using the keyval package}
+%
+% We need the \package{keyval} package for option handling, so we load it here.
+% \begin{macrocode}
+\RequirePackage{keyval}[1997/11/10]
+% \end{macrocode}
+%
+% \begin{macro}{\undefine@key}
+% |\undefine@key|\marg{family}\marg{key}\par
+% This helper macro is the opposite of |\define@key|, it removes a keyval
+% definition.
+% \begin{macrocode}
+\providecommand*\undefine@key[2]{%
+ \@nameundef{KV@#1@#2}\@nameundef{KV@#1@#2@default}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@onlypreamble@key}
+% \changes{v1.1}{2007/07/22}{This macro added}
+% \changes{v1.1e}{2007/11/01}{\cs{KV@err} will be used now instead of \cs{@notprerr}}
+% |\onlypreamble@key|\marg{family}\marg{key}\par
+% Analogous to |\@onlypreamble| from \LaTeXe.
+% \begin{macrocode}
+\providecommand*\@preamble@keys{}
+\providecommand*\@onlypreamble@key[2]{\@cons\@preamble@keys{{#1}{#2}}}
+\@onlypreamble\@onlypreamble@key
+\@onlypreamble\@preamble@keys
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\@notprerr@key[1]{\KV@err{Can be used only in preamble}}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@AtBeginDocument*{%
+ \def\@elt#1#2{\expandafter\let\csname KV@#1@#2\endcsname\@notprerr@key}%
+ \@preamble@keys
+ \let\@elt\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionOption}
+% |\DeclareCaptionOption|\marg{option}\oarg{default value}\marg{code}\\
+% |\DeclareCaptionOption*|\marg{option}\oarg{default value}\marg{code}\par
+% We declare our options using these commands (instead of using
+% |\DeclareOption| offered by \LaTeXe), so the keyval package is used.
+% The starred form makes the option available during the lifetime of the
+% current package only, so they can be used with |\usepackage|, but
+% \emph{not} with |\captionsetup| later on.
+% \begin{macrocode}
+\newcommand*\DeclareCaptionOption{%
+ \caption@teststar\caption@declareoption\AtEndOfPackage\@gobble}
+\@onlypreamble\DeclareCaptionOption
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declareoption[2]{%
+ #1{\undefine@key{caption}{#2}}\caption@declare@option{#2}}
+\@onlypreamble\caption@declareoption
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declare@option{%
+ \define@key{caption}}
+%% no \@onlypreamble\caption@declare@option, will be used by \captionsetup
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionOptionNoValue}
+% \changes{v1.1c}{2007/10/06}{This macro added}
+% |\DeclareCaptionOptionNoValue|\marg{option}\marg{code}\\
+% |\DeclareCaptionOptionNoValue*|\marg{option}\marg{code}\par
+% Same as \cs{DeclareCaptionOption} but issues an error if a value is given.
+% \begin{macrocode}
+\newcommand*\DeclareCaptionOptionNoValue{%
+ \caption@teststar\caption@declareoption@novalue\AtEndOfPackage\@gobble}
+\@onlypreamble\DeclareCaptionOptionNoValue
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@declareoption@novalue[3]{%
+ \caption@declareoption{#1}{#2}[\KV@err]{%
+ \caption@option@novalue{#2}{##1}{#3}}}
+\@onlypreamble\caption@declareoption@novalue
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@option@novalue[2]{%
+ \ifx\KV@err#2%
+ \expandafter\@firstofone
+ \else
+ \KV@err{No value allowed for #1}%
+ \expandafter\@gobble
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifcaptionsetup@star}
+% \changes{v1.2a}{2008/01/12}{This macro added}
+% If the starred form of |\captionsetup| is used, this will be set to |true|.
+% (It will be reset to |false| at the end of |\caption@setkeys|.)
+% \begin{macrocode}
+\newif\ifcaptionsetup@star
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionsetup}
+% \changes{v1.0a}{2004/01/17}{Bugfix: Missing \% added}
+% \changes{v1.1}{2007/07/22}{Starred-variant added}
+% \changes{v1.1e}{2007/07/27}{Inside packages the starred variant will be used automatically}
+% \changes{v1.2}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% \changes{v1.2a}{2008/01/12}{\cs{ifcaptionsetup@star} will be set now}
+% \changes{v1.5}{2012/04/09}{Support of multiple optional arguments added}
+% \changes{v1.8h}{2020/01/03}{Syntax check of saved options added}
+% |\captionsetup|\oarg{type}\ldots\marg{keyval-list of options}\\
+% |\captionsetup*|\oarg{type}\ldots\marg{keyval-list of options}\par
+% If the optional argument `type' is specified, we simply save or append
+% the option list, otherwise we `execute' it with |\setkeys|.
+% (The non-starred variant issues a warning if \meta{keyval-list of options}
+% is not used later on.)
+% \Note{The starred variant will be used inside packages automatically.}
+% \begin{macrocode}
+\newcommand*\captionsetup{%
+ \caption@teststar@\@captionsetup\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\@captionsetup[1]{%
+ \captionsetup@startrue#1\captionsetup@starfalse
+ \@ifnextchar[%]
+ \caption@setup@options\caption@setup}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setup{\caption@setkeys{caption}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@setup@options[#1]{%
+ \@ifnextchar[%]
+ {\caption@stepthecounter
+ \caption@withoptargs{\@expandtwoargs
+ \caption@setup@options@i{#1}{@\caption@thecounter}}}%
+ {\caption@setup@options@{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setup@options@i[4]{%
+ \caption@declare@option{#2}[]{\captionsetup#3{#4}}%
+ \caption@setup@options@{#1}{#2}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setup@options@[2]{%
+ \@bsphack
+ \ifcaptionsetup@star\captionsetup@starfalse\else\caption@addtooptlist{#1}\fi
+ \caption@checkoptions{#2}%
+ \expandafter\caption@l@addto@list\csname caption@opt@#1\endcsname{#2}%
+ \@esphack}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@checkoptions}
+% \changes{v1.8h}{2020/01/03}{This macro added}
+% Check the syntax of the given options by executing them inside a group.
+% \begin{macrocode}
+\newcommand*\caption@checkoptions[1]{%
+ \begingroup
+ \caption@prepare@optioncheck
+ \caption@setup{#1}%
+ \endgroup}
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\caption@prepare@optioncheck{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\IfCaptionOptionCheck}
+% \changes{v1.10}{2020/05/10}{This macro added}
+% |\IfCaptionOptionCheck|\marg{yes-code}\marg{no-code}
+% executes the \meta{yes-code} if options are just checked for syntax, and \meta{no-code} if not.
+% \begin{macrocode}
+\let\IfCaptionOptionCheck\@secondoftwo
+% \end{macrocode}
+% \begin{macrocode}
+\g@addto@macro\caption@prepare@optioncheck{%
+ \let\IfCaptionOptionCheck\@firstoftwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clearcaptionsetup}
+% \changes{v1.1}{2007/07/29}{Optional argument added}
+% \changes{v1.1}{2007/08/17}{Starred variant added}
+% \changes{v1.1e}{2007/07/27}{Inside packages the starred variant will be used automatically}
+% \changes{v1.2}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% |\clearcaptionsetup|\oarg{option}\marg{type}\\
+% |\clearcaptionsetup*|\oarg{option}\marg{type}\par
+% This removes the saved option list associated with \meta{type}.
+% If \meta{option} is given, only this option will be removed from the list.
+% (The starred variant does not issue warnings.)
+% \Note{The starred variant will be used inside packages automatically.}
+% \begin{macrocode}
+\newcommand*\clearcaptionsetup{%
+ \caption@teststar@\@clearcaptionsetup\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\@clearcaptionsetup[1]{%
+ \let\caption@tempa#1%
+ \@testopt\@@clearcaptionsetup{}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\@@clearcaptionsetup[#1]#2{%
+ \@bsphack
+ \expandafter\caption@ifempty@list\csname caption@opt@#2\endcsname
+ {\caption@tempa{\caption@Warning{Option list `#2' undefined}}}%
+ {\ifx,#1,%
+ \caption@clearsetup{#2}%
+ \else
+ \caption@@removefromsetup{#1}{#2}%
+ \fi}%
+ \@esphack}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@clearsetup[1]{%
+ \caption@removefromoptlist{#1}%
+ \@nameundef{caption@opt@#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@removefromsetup{%
+ \let\caption@tempa\@gobble
+ \caption@@removefromsetup}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@removefromsetup[2]{%
+ \expandafter\let\expandafter\@tempa\csname caption@opt@#2\endcsname
+ \expandafter\let\csname caption@opt@#2\endcsname\@undefined
+ \def\@tempb##1=##2\@nil{##1}%
+ \edef\@tempc{#1}%
+ \@for\@tempa:=\@tempa\do{%
+ \edef\@tempd{\expandafter\@tempb\@tempa=\@nil}%
+ \ifx\@tempd\@tempc
+ \let\caption@tempa\@gobble
+ \else
+ \expandafter\expandafter\expandafter\caption@l@addto@list
+ \expandafter\csname caption@opt@#2\expandafter\endcsname
+ \expandafter{\@tempa}%
+ \fi}%
+ \expandafter\caption@ifempty@list\csname caption@opt@#2\endcsname
+ {\caption@removefromoptlist{#2}}{}%
+ \caption@tempa{\caption@Warning{%
+ Option `#1' was not in list `#2'}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\showcaptionsetup}
+% \changes{v1.0d}{2005/05/03}{Optimized for memory usage}
+% \changes{v1.1}{2007/07/29}{Bugfix: Does not expand option list anymore}
+% \changes{v1.2}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% |\showcaptionsetup|\oarg{package}\marg{type}\par
+% This comes for debugging issues: It shows the saved option list which
+% is associated with \meta{type}.
+% \begin{macrocode}
+\newcommand*\showcaptionsetup[2][\@firstofone]{%
+ \@bsphack
+ \GenericWarning{}{%
+ #1 Caption Info: Option list on `#2'\MessageBreak
+ #1 Caption Data: \@ifundefined{caption@opt@#2}{%
+ -none-%
+ }{%
+ {\expandafter\expandafter\expandafter\strip@prefix
+ \expandafter\meaning\csname caption@opt@#2\endcsname}%
+ }}%
+ \@esphack}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.1}{2007/07/02}{Option \opt{options=} added}
+% \changes{v1.3}{2010/09/05}{Option \opt{options*=} added}
+% \changes{v1.4b}{2012/01/12}{Option \opt{options*=} removed}
+% \begin{macrocode}
+\DeclareCaptionOption{options}{\caption@setoptions{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setoptions}
+% \changes{v1.0g}{2006/01/03}{Optional argument added}
+% \changes{v1.0h}{2006/01/26}{Revised}
+% \changes{v1.0j}{2007/01/30}{Optional argument removed}
+% \changes{v1.1}{2007/04/11}{Usage of \cs{clearcaptionsetup} added}
+% \changes{v1.1}{2007/05/09}{Renamed from \cs{caption@settype} to \cs{caption@setoptions}}
+% \changes{v1.2}{2007/12/03}{Definition of \cs{caption@iftypewarning} removed}
+% \changes{v1.3}{2010/09/05}{Starred variant added}
+% \changes{v1.4b}{2012/01/12}{Starred variant removed}
+% |\caption@setoptions|\marg{type or environment or\ldots}\par
+% Caption options which have been saved with |\captionsetup|\oarg{type} can
+% be executed by using this command.
+% It simply executes the saved option list (and clears it afterwards),
+% if there is any.
+% \iffalse
+% (The starred variant do not clear the option list.)
+% \fi
+% \begin{macrocode}
+\newcommand*\caption@setoptions[1]{%
+ \caption@Debug{options=#1}%
+ \expandafter\let\expandafter\caption@opt\csname caption@opt@#1\endcsname
+ \ifx\caption@opt\relax \else
+ \caption@xsetup\caption@opt
+ \caption@clearsetup{#1}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@xsetup[1]{\expandafter\caption@setup\expandafter{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@addtooptlist}
+% \changes{v1.1}{2007/07/22}{This macro added}
+% \begin{macro}{\caption@removefromoptlist}
+% \changes{v1.1}{2007/07/22}{This macro added}
+% \changes{v1.2c}{2008/08/24}{Fatal typo corrected}
+% |\caption@addtooptlist|\marg{type}\\
+% |\caption@removefromoptlist|\marg{type}\par
+% Adds or removes an \meta{type} to the list of unused caption options.
+% Note that the catcodes of \meta{type} are sanitized here so removing
+% \meta{type} from the list do not fail when the \package{float} package
+% is used (since |\float@getstyle| gives a result which tokens have catcode
+% 12 $=$ ``other'').
+% \begin{macrocode}
+\newcommand*\caption@addtooptlist[1]{%
+ \@ifundefined{caption@opt@#1@lineno}{%
+ \caption@dooptlist\caption@g@addto@list{#1}%
+ \expandafter\xdef\csname caption@opt@#1@lineno\endcsname{\the\inputlineno}%
+ }{}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@removefromoptlist[1]{%
+ \caption@dooptlist\caption@g@removefrom@list{#1}%
+ \global\expandafter\let\csname caption@opt@#1@lineno\endcsname\@undefined}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@dooptlist[2]{%
+ \begingroup
+ \edef\@tempa{#2}\@onelevel@sanitize\@tempa
+ \expandafter#1\expandafter\caption@optlist\expandafter{\@tempa}%
+ \endgroup}
+% \end{macrocode}
+% \begin{macrocode}
+\AtEndDocument{%
+ \caption@for@list\caption@optlist{%
+ \caption@WarningNoLine{%
+ Unused \string\captionsetup[#1]
+ on input line \csname caption@opt@#1@lineno\endcsname}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@setkeys}
+% \changes{v1.0g}{2006/01/03}{This macro added}
+% \changes{v1.0j}{2007/01/20}{Bugfix: Usage of \cs{caption@keydepth} added}
+% \changes{v1.0j}{2007/01/30}{Optional argument added}
+% \changes{v1.0n}{2007/04/08}{\cs{caption@keydepth} is now a command instead of a counter}
+% \changes{v1.1b}{2007/09/18}{Usage of \cs{caption@Package} removed, we use \cs{caption@KV@err} instead}
+% \changes{v1.2}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% \changes{v1.2a}{2008/01/12}{\cs{captionsetup@starfalse} added}
+% \changes{v1.2d}{2009/09/30}{Bugfix 09-09-29: Missing error handler will be defined automatically}
+% \changes{v1.4}{2011/08/24}{Redefinition of \cs{XKV@err} added}
+% |\caption@setkeys|\oarg{package}\marg{family}\marg{key-values}\par
+% This one simply calls |\setkeys|\marg{family}\marg{key-values}
+% but lets the error messages not refer to the \package{keyval} package,
+% but to the \meta{package} package instead.
+% \begin{macrocode}
+\newcommand*\caption@setkeys{\@dblarg\caption@@setkeys}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@setkeys[#1]#2#3{%
+ \@bsphack
+% \end{macrocode}
+% \begin{macrocode}
+ \expandafter\let\csname ORI@KV@err\caption@keydepth\endcsname\KV@err
+ \expandafter\let\csname ORI@KV@errx\caption@keydepth\endcsname\KV@errx
+ \expandafter\let\csname ORI@XKV@err\caption@keydepth\endcsname\XKV@err
+ \edef\caption@keydepth{\caption@keydepth i}%
+% \end{macrocode}
+% \begin{macrocode}
+ \expandafter\let\expandafter\KV@err\csname #1@KV@err\endcsname
+ \ifx\KV@err\relax
+ \def\KV@err##1{\PackageError{#1}{##1}{%
+ See the #1 package documentation for explanation.}}%
+ \fi
+ \def\KV@errx{\KV@err}%
+ \def\XKV@err{\let\@tempa\XKV@tkey\KV@err}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@Debug{\protect\setkeys{#2}{#3}}%
+ \setkeys{#2}{#3}%
+% \end{macrocode}
+% \begin{macrocode}
+ \edef\caption@keydepth{\expandafter\@gobble\caption@keydepth}%
+ \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
+% \end{macrocode}
+% \begin{macrocode}
+ \ifx\caption@keydepth\@empty \captionsetup@starfalse \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \@esphack}
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@keydepth\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ExecuteOptions}
+% \changes{v1.1}{2007/07/15}{This macro added}
+% \changes{v1.3}{2010/09/04}{Depends on package now}
+% |\caption@ExecuteOptions|\marg{package}\marg{key-values}\par
+% We execute our options using the keyval interface, so we use this one
+% instead of |\ExecuteOptions| offered by \LaTeXe.
+% \begin{macrocode}
+\newcommand*\caption@ExecuteOptions[2]{%
+ \expandafter\@expandtwoargs\csname caption@setkeys@#1\endcsname{#1}{#2}}%
+\@onlypreamble\caption@ExecuteOptions
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ProcessOptions}
+% \changes{v1.0a}{2004/01/23}{Bugfix, see
+% \purett{news:400D360C.9678329F@gmx.net} for details}
+% \changes{v1.0g}{2006/01/03}{Improvement, uses \cs{caption@setkeys}
+% instead of \cs{setkeys}}
+% \changes{v1.0h}{2006/02/23}{Bugfix, now processes only those global
+% options which have a default value}
+% \changes{v1.0j}{2007/01/30}{\cs{ProcessOptionsWithKV} renamed to
+% \cs{caption@ProcessOptions} and moved from the package to the kernel}
+% \changes{v1.1}{2007/04/17}{Star variant added}
+% |\caption@ProcessOptions*|\marg{package}\par
+% We process our options using the keyval package, so we use this one
+% instead of |\ProcessOptions| offered by \LaTeXe.
+% The starred variant do not process the global options.
+% (This code was taken from the \package{hyperref} package\cite{hyperref}
+% \version{6.74} and improved.)
+% \begin{macrocode}
+\newcommand*\caption@ProcessOptions{%
+ \caption@teststar\caption@@ProcessOptions\@gobble\@firstofone}
+\@onlypreamble\caption@ProcessOptions
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@@ProcessOptions[2]{%
+ \let\@tempc\relax
+ \let\caption@tempa\@empty
+ #1{% \@firstofone -or- \@gobble
+ \@for\CurrentOption:=\@classoptionslist\do{%
+ \@ifundefined{KV@#2@\CurrentOption}{}{%
+ \@ifundefined{KV@#2@\CurrentOption @default}{%
+ \PackageInfo{#2}{Global option `\CurrentOption' ignored}%
+ }{%
+ \PackageInfo{#2}{Global option `\CurrentOption' processed}%
+ \edef\caption@tempa{\caption@tempa\CurrentOption,}%
+ \@expandtwoargs\@removeelement\CurrentOption
+ \@unusedoptionlist\@unusedoptionlist
+ }%
+ }%
+ }%
+ \let\CurrentOption\@empty
+ }%
+ \caption@ExecuteOptions{#2}{\caption@tempa\@ptionlist{\@currname.\@currext}}%
+ \AtEndOfPackage{\let\@unprocessedoptions\relax}}
+\@onlypreamble\caption@@ProcessOptions
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@SetupOptions}
+% \changes{v1.3}{2010/09/04}{This macro added}
+% |\caption@SetupOptions|\marg{package}\marg{code}\par
+% After calling this macro |\caption@ExecuteOptions| and
+% |\usepackage|\oarg{options}\marg{package}
+% will both be mapped to \meta{code} with \meta{package} and \meta{options}
+% as arguments |#1| and |#2|. (This helps avoiding ``Option clash'' errors.)
+% \begin{macrocode}
+\newcommand\caption@SetupOptions[2]{%
+ \@namedef{caption@setkeys@#1}##1##2{#2}%
+ \expandafter\@onlypreamble\csname caption@setkeys@#1\endcsname
+ \@cons\caption@SetupOptions@list{{#1}}}
+\@onlypreamble\caption@SetupOptions
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@SetupOptions@list{}
+\@onlypreamble\caption@SetupOptions@list
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@onefilewithoptions\@onefilewithoptions
+\def\@onefilewithoptions#1[#2]{%
+ \begingroup
+ \def\@tempa{%
+ \endgroup
+ \caption@onefilewithoptions{#1}[{#2}]}%
+ \def\@tempb{#1}%
+ \def\@elt##1{%
+ \def\@tempc{##1}%
+ \ifx\@tempb\@tempc
+ \def\@tempa{%
+ \endgroup
+ \caption@ExecuteOptions{#1}{#2}%
+ \caption@onefilewithoptions{#1}[]}%
+ \fi}
+ \caption@SetupOptions@list
+ \@tempa}
+\@onlypreamble\caption@onefilewithoptions
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Margin resp. width}
+% \changes{v1.0n}{2007/04/01}{\cs{captionmarginx} renamed to \cs{captionmargin@}}
+% \changes{v1.0n}{2007/04/03}{Option `twoside' added}
+% \changes{v1.1}{2007/08/11}{Options `margin*', `minmargin', and `maxmargin' added}
+% \changes{v1.2}{2007/11/10}{Option `oneside' added}
+%
+% \begin{macro}{\captionmargin}
+% \begin{macro}{\captionwidth}
+% |\captionmargin| and |\captionwidth| contain the extra margin
+% resp. the total width used for captions. Please never set these values in
+% a direct way, they are just accessible in user documents to provide
+% compatibility to \version{1.x}.\par
+% Note that we can only set one value at a time, `margin' \emph{or} `width'.
+% If |\captionwidth| is not zero we will take this value afterwards,
+% otherwise |\captionmargin| and |\captionmargin@|.
+% \begin{macrocode}
+\newdimen\captionmargin
+\newdimen\captionmargin@
+\newdimen\captionwidth
+\newdimen\caption@tempdima
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{margin}{\setcaptionmargin{#1}}
+\DeclareCaptionOption{margin*}{\setcaptionmargin*{#1}}
+\DeclareCaptionOption{width}{\setcaptionwidth{#1}}
+\DeclareCaptionOption{width*}{\setcaptionwidth*{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{calcmargin}{\caption@setcalcmargin{#1}}
+\DeclareCaptionOption{calcmargin*}{\caption@setcalcmargin*{#1}}
+\DeclareCaptionOption{calcwidth}{\caption@setcalcwidth{#1}}
+\DeclareCaptionOption{calcwidth*}{\caption@setcalcwidth*{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{twoside}[1]{\caption@set@bool\caption@iftwoside{#1}}
+\DeclareCaptionOptionNoValue{oneside}{\caption@set@bool\caption@iftwoside0}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{minmargin}{\caption@setoptcmd\caption@minmargin{#1}}
+\DeclareCaptionOption{maxmargin}{\caption@setoptcmd\caption@maxmargin{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\setcaptionmargin}
+% \changes{v1.0f}{2005/10/24}{Renamed from \cs{caption@setmargin} to \cs{setcaptionmargin}}
+% \changes{v1.0f}{2005/10/24}{\cs{setcaptionmargin} enhanced so it can take
+% left+right margin}
+% \changes{v1.1}{2007/08/11}{Starred variant added}
+% \changes{v1.1}{2007/08/12}{\cs{setlength}\cs{captionmargin} \&
+% \cs{setlength}\cs{captionmargin@} swapped so
+% `\texttt{margin*=}\cs{captionmargin}' works in singleline options}
+% \changes{v1.3}{2010/11/07}{Support for option \opt{calcmargin} added}
+% |\setcaptionmargin|\marg{amount}\\
+% |\setcaptionmargin*|\marg{amount}\par
+% Please never use this in user documents, it's just there to
+% provide compatibility to the \package{caption2} package.
+% \begin{macrocode}
+\newcommand*\setcaptionmargin{%
+ \caption@resetcalcmargin
+ \caption@setmargin}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setmargin{%
+ \caption@teststar\caption@@setmargin\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setmargin[2]{%
+ #1{\captionwidth\z@}%
+ \caption@@@setmargin#2,#2,\@nil}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@@setmargin#1,#2,#3\@nil{%
+ \setlength\captionmargin@{#2}%
+ \setlength\captionmargin{#1}%
+ \addtolength\captionmargin@{-\captionmargin}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\setcaptionwidth}
+% \changes{v1.0f}{2005/10/24}{Renamed from \cs{caption@setwidth} to \cs{setcaptionwidth}}
+% \changes{v1.3}{2010/11/07}{Starred variant added}
+% \changes{v1.3}{2010/11/07}{Support for option \opt{calcwidth} added}
+% |\setcaptionwidth|\marg{amount}\\
+% |\setcaptionwidth*|\marg{amount}\par
+% Please never use this in user documents, it's just there to
+% provide compatibility to the \package{caption2} package.
+% \begin{macrocode}
+\newcommand*\setcaptionwidth{%
+ \caption@resetcalcmargin
+ \caption@setwidth}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setwidth{%
+ \caption@teststar\caption@@setwidth\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setwidth[2]{%
+ #1{\captionmargin\z@\captionmargin@\z@}%
+ \setlength\captionwidth{#2}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@resetcalcmargin}
+% \changes{v1.3}{2010/11/07}{This macro added}
+% \begin{macrocode}
+\newcommand*\caption@resetcalcmargin{%
+ \let\caption@calcmargin@hook\@empty}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setcalcmargin}
+% \changes{v1.3}{2010/11/07}{This macro added}
+% \begin{macrocode}
+\newcommand*\caption@setcalcmargin{%
+ \caption@teststar{\caption@@setcalcmargin\caption@setmargin}%
+ \@secondoftwo\@firstoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setcalcmargin[3]{%
+ #2{\caption@resetcalcmargin
+ \l@addto@macro\caption@calcmargin@hook{#1{#3}}}%
+ {\l@addto@macro\caption@calcmargin@hook{#1*{#3}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setcalcwidth}
+% \changes{v1.3}{2010/11/07}{This macro added}
+% \begin{macrocode}
+\newcommand*\caption@setcalcwidth{%
+ \caption@teststar{\caption@@setcalcmargin\caption@setwidth}%
+ \@secondoftwo\@firstoftwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@counter}
+% \changes{v1.0n}{2007/04/03}{This counter added}
+% \changes{v1.1e}{2007/10/28}{Renamed to \cs{caption@thecounter}; \cs{caption@stepcounter} added}
+% \changes{v1.5}{2012/04/09}{\cs{caption@stepcounter} renamed to \cs{caption@stepthecounter}}
+% Internal counter. At the moment it will be used inside
+% |\caption@ifoddpage| only.
+% \begin{macrocode}
+\newcommand*\caption@thecounter{0}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@stepthecounter{%
+ \@tempcnta\caption@thecounter
+ \advance\@tempcnta\@ne
+ \xdef\caption@thecounter{\the\@tempcnta}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@newlabel}
+% \changes{v1.0n}{2007/04/03}{This macro added}
+% This command is a modified version of |\newlabel| from \LaTeX2e.
+% It will be written to the \texttt{.aux} file to
+% pass label information from one run to another.
+% (We use it inside |\caption@ifoddpage| and |\caption@ragged|.)
+% \begin{macrocode}
+\newcommand*\caption@newlabel{\@newl@bel{caption@r}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@thepage}
+% \changes{v1.0n}{2007/04/03}{This macro added}
+% This command is a modified version of |\thepage| from \LaTeX2e.
+% It will be used inside |\caption@ifoddpage| only.
+% \begin{macrocode}
+\newcommand*\caption@thepage{\the\c@page}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@label}
+% \changes{v1.1}{2007/09/01}{This macro added}
+% \changes{v1.2}{2007/12/03}{Definition of \cs{caption@newlabel} in AUX file added}
+% This command is a modified version of |\label| from \LaTeX2e.
+% It will be used inside |\caption@ifoddpage| and |\FP@helpNote|.
+% \begin{macrocode}
+\newcommand*\caption@label[1]{%
+ \caption@@label
+ \protected@write\@auxout{\let\caption@thepage\relax}%
+ {\string\caption@newlabel{#1}{\caption@thepage}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@label{%
+ \global\let\caption@@label\relax
+ \protected@write\@auxout{}%
+ {\string\providecommand*\string\caption@newlabel[2]{}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@pageref}
+% \changes{v1.1}{2007/09/01}{This macro added}
+% \changes{v1.2d}{2009/10/09}{Uses \cs{@latex@warning} instead of \cs{caption@Warning} now}
+% This command is a modified version of |\pageref| from \LaTeX2e.
+% It will be used inside |\caption@ifoddpage| and |\FP@helpNote|.
+% \begin{macrocode}
+\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}%
+ \else
+ \expandafter\let\expandafter\caption@thepage\csname caption@r@#1\endcsname
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifoddpage}
+% \changes{v1.0n}{2007/04/03}{This macro added}
+% \changes{v1.1e}{2007/10/28}{Incrementation of counter moved to \cs{caption@@make}}
+% At the moment this macro uses an own label\ldots ref mechanism,
+% but an alternative implementation method would be using the
+% \package{refcount} package\cite{refcount} and |\ifodd\getpagerefnumber{|\ldots|}|.
+% \Note{This macro re-defines itself so the \texttt{.aux} file will
+% only be used once per group.}
+% \begin{macrocode}
+\newcommand*\caption@ifoddpage{%
+ \caption@iftwoside{%
+ \caption@label\caption@thecounter
+ \caption@pageref\caption@thecounter
+ \ifodd\caption@thepage
+ \let\caption@ifoddpage\@firstoftwo
+ \else
+ \let\caption@ifoddpage\@secondoftwo
+ \fi
+ }{\let\caption@ifoddpage\@firstoftwo}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@ifoddpage}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setoptcmd}
+% \changes{v1.1}{2007/08/11}{This macro added}
+% |\caption@setoptcmd|\marg{cmd}\marg{off -or- value}
+% \begin{macrocode}
+\newcommand*\caption@setoptcmd[2]{%
+ \caption@ifinlist{#2}{0,false,no,off}{\let#1\@undefined}{\def#1{#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Indentions}
+%
+% \begin{macro}{\caption@indent}
+% \changes{v1.1}{2007/07/29}{Renamed from \cs{captionindent} to \cs{caption@indent}}
+% \begin{macro}{\caption@parindent}
+% \begin{macro}{\caption@hangindent}
+% These are the indentions we support.
+% \begin{macrocode}
+\newdimen\caption@indent
+\newdimen\caption@parindent
+\newdimen\caption@hangindent
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \changes{v1.0b}{2004/05/16}{Defaults added for options \opt{parindent=}
+% and \opt{hangindent=}}
+% \changes{v1.0f}{2005/08/22}{Option \opt{parskip=}: \cs{AtBeginCaption}
+% replaced by \cs{caption@@par}}
+% \changes{v1.0f}{2005/08/22}{Undocumented defaults for \opt{parindent=},
+% \opt{hangindent=}, and \opt{parskip=} removed}
+% \begin{macrocode}
+\DeclareCaptionOption{indent}[\leftmargini]{% obsolete!
+ \setlength\caption@indent{#1}}
+\DeclareCaptionOption{indention}[\leftmargini]{%
+ \setlength\caption@indent{#1}}
+\DeclareCaptionOption{parindent}{%
+ \setlength\caption@parindent{#1}}
+\DeclareCaptionOption{hangindent}{%
+ \setlength\caption@hangindent{#1}}
+\DeclareCaptionOption{parskip}{%
+ \l@addto@macro\caption@@par{\setlength\parskip{#1}}}
+% \end{macrocode}
+%
+% \section{Styles}
+%
+% \begin{macro}{\DeclareCaptionStyle}
+% \changes{v1.0a}{2004/01/17}{Pass through argument \#3 so extra spaces
+% between arguments do make any harm}
+% |\DeclareCaptionStyle|\marg{name}\oarg{single-line-list-of-KV}\marg{list-of-KV}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionStyle[1]{%
+ \@testopt{\caption@declarestyle{#1}}{}}
+\@onlypreamble\DeclareCaptionStyle
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@declarestyle#1[#2]#3{%
+ \global\@namedef{caption@sls@#1}{#2}%
+ \global\@namedef{caption@sty@#1}{#3}}
+\@onlypreamble\caption@declarestyle
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.2a}{2008/01/20}{Option \opt{style*=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{style}{\caption@setstyle{#1}}
+\DeclareCaptionOption{style*}{\caption@setstyle*{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setstyle}
+% \changes{v1.0e}{2005/06/01}{Starred variant added}
+% \changes{v1.1}{2007/07/29}{Recursive style definitions should work now}
+% \changes{v1.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency}
+% \changes{v1.2}{2007/12/03}{Definition of \cs{caption@iftypewarning} removed}
+% |\caption@setstyle|\marg{name}\\
+% |\caption@setstyle*|\marg{name}\par
+% Selecting a caption style means saving the additional
+% \meta{single-line-list-of-KV} (this will be done by |\caption@sls|),
+% resetting the caption options to the base ones (this will be done using
+% |\caption@resetstyle|) and executing the \meta{list-of-KV} options
+% (this will be done using |\caption@setup|).\par
+% The starred version will give no error message if the given style is not
+% defined.
+% \begin{macrocode}
+\newcommand*\caption@setstyle{%
+ \caption@teststar\caption@@setstyle\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setstyle[2]{%
+ \@ifundefined{caption@sty@#2}%
+ {#1{\caption@Error{Undefined style `#2'}}}%
+ {\expandafter\let\expandafter\caption@sty\csname caption@sty@#2\endcsname
+ \ifx\caption@setstyle@flag\@undefined
+ \let\caption@setstyle@flag\relax
+ \caption@resetstyle
+ \caption@xsetup\caption@sty
+ \let\caption@setstyle@flag\@undefined
+ \else
+ \caption@xsetup\caption@sty
+ \fi
+ \expandafter\let\expandafter\caption@sls\csname caption@sls@#2\endcsname
+ \expandafter\caption@l@addto@list\expandafter\caption@opt@singleline
+ \expandafter{\caption@sls}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@resetstyle}
+% \changes{v1.1}{2007/02/04}{%
+% This macro renamed from \cs{caption@setdefault} to \cs{caption@resetstyle}}
+% \changes{v1.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency}
+% \changes{v1.2}{2007/11/17}{Usage of \opt{size=} added}
+% \changes{v1.2b}{2008/05/06}{Usage of \opt{rule} added}
+% \changes{v1.5}{2012/03/15}{\opt{box=parbox} added}
+% \changes{v1.6}{2013/05/01}{\opt{box=none} added, \opt{box=parbox} changed to \opt{parbox=parbox}}
+% This resets (nearly) all caption options to the base ones.
+% \emph{Note that this does not touch the skips and the positioning!}
+% \begin{macrocode}
+\newcommand*\caption@resetstyle{%
+ \caption@setup{%
+ box=none,boxcolor=white,parbox=parbox,%
+ format=plain,labelformat=default,labelsep=colon,textformat=simple,%
+ justification=justified,font=,size=,labelfont=,textfont=,%
+ margin=0pt,minmargin=0,maxmargin=0,%
+ indent=0pt,parindent=0pt,hangindent=0pt,%
+ slc,rule,strut}%
+ \caption@clearsetup{singleline}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.0c}{2005/02/12}{\opt{indent=0pt} added to caption style \opt{default}}
+% \changes{v1.1}{2007/02/04}{Caption style `default' renamed to `base', and a new `default' added}
+% \changes{v1.1}{2007/03/31}{\opt{format=plain} added to caption style \opt{default}}
+% \changes{v1.1c}{2007/10/14}{\opt{format=plain} removed from caption style \opt{default}}
+% \changes{v1.5}{2012/03/15}{\opt{box=default} added to caption style \opt{default}}
+% Currently there are two pre-defined styles, called `base' \& `default'.
+% The first one is a perfect match to the behavior of |\@makecaption| offered
+% by the standard \LaTeX\ document classes (and was called `default' in
+% \thispackage\ \version{1.0}), the second one matches the document
+% class actually used.
+% \begin{macrocode}
+\DeclareCaptionStyle{base}[indent=0pt,justification=centering]{}
+\DeclareCaptionStyle{default}[indent=0pt,justification=centering]{%
+ box=default,format=default,labelsep=default,textformat=default,%
+ justification=default,font=default,labelfont=default,textfont=default}
+% \end{macrocode}
+%
+% \changes{v1.2b}{2008/05/06}{Option \opt{slc=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{singlelinecheck}[1]{\caption@set@bool\caption@ifslc{#1}}
+\DeclareCaptionOption{slc}[1]{\KV@caption@singlelinecheck{#1}}
+% \end{macrocode}
+%
+% \section{Boxes}
+%
+% \begin{macro}{\DeclareCaptionBox}
+% \changes{v1.5}{2012/03/15}{This macro added}
+% |\DeclareCaptionBox|\marg{name}\marg{code with \#1 and \#2}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionBox[2]{%
+ \global\long\@namedef{caption@box@#1}##1##2{#2}}
+\@onlypreamble\DeclareCaptionBox
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.5}{2012/03/15}{Option \opt{box=} added}
+% \changes{v1.6}{2013/05/01}{Option \opt{parbox=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{box}{\caption@setbox{#1}}
+\DeclareCaptionOption{parbox}{\caption@set@box\caption@parbox{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setbox}
+% |\caption@setbox|\marg{name}\par
+% Selecting a caption box simply means saving the code (in |\caption@box|).
+% \begin{macrocode}
+\newcommand*\caption@setbox{%
+ \caption@set@box\caption@box}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@set@box[2]{%
+ \@ifundefined{caption@box@#2}%
+ {\caption@Error{Undefined box `#2'}}%
+ {\expandafter\let\expandafter#1\csname caption@box@#2\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% There are four pre-defined boxes, called `empty', `none',
+% `parbox', and `colorbox'.
+% \changes{v1.0i}{2006/05/13}{We define \cs{captionbox} instead of
+% \cs{caption@start/endbox}}
+% \changes{v1.0l}{2006/03/09}{Bugfix 07-03-09: \cs{captionbox} changed from
+% \cs{parbox-t} to \cs{parbox-b}}
+% \changes{v1.2}{2007/11/11}{\cs{captionbox} renamed to \cs{caption@parbox}}
+% \changes{v1.5}{2012/03/15}{\cs{caption@parbox} adapted to \cs{DeclareCaptionBox}}
+% \changes{v1.6}{2013/05/02}{Option \opt{boxsep=} added}
+% \begin{macrocode}
+\DeclareCaptionBox{empty}{}
+\DeclareCaptionBox{none}{#2}
+\DeclareCaptionBox{parbox}{\parbox[b]{#1}{#2}}
+%\DeclareCaptionBox{colorbox}{%
+% \colorbox{\caption@boxcolor}{\caption@box@parbox{\dimexpr #1-2\fboxsep}{#2}}}
+\DeclareCaptionBox{colorbox}{\colorbox{\caption@boxcolor}{%
+ \setlength\caption@tempdima{#1}%
+ \addtolength\caption@tempdima{-2\fboxsep}%
+ \linewidth\caption@tempdima
+ \hsize\caption@tempdima
+ #2}}
+\DeclareCaptionOption{boxcolor}{\def\caption@boxcolor{#1}}
+\DeclareCaptionOption{boxsep}{\setlength\fboxsep{#1}}
+% \end{macrocode}
+%
+% `default' usually maps to `none`.
+% \begin{macrocode}
+\def\caption@box@default{\caption@box@none}
+% \end{macrocode}
+%
+% \section{Formats}
+%
+% \begin{macro}{\DeclareCaptionFormat}
+% \changes{v1.0a}{2004/01/17}{Pass through argument \#3 so extra spaces
+% between arguments do make any harm}
+% \changes{v1.0c}{2005/02/09}{Starred variant added}
+% \changes{v1.1c}{2007/10/15}{Optional argument added}
+% |\DeclareCaptionFormat|\marg{name}\marg{code with \#1, \#2, and \#3}\\
+% |\DeclareCaptionFormat*|\marg{name}\marg{code with \#1, \#2, and \#3}\par
+% The starred form causes the code being typeset in vertical (instead of
+% horizontal) mode, but does not support the |indention=| option.
+% \begin{macrocode}
+\newcommand*\DeclareCaptionFormat{%
+ \caption@teststar\caption@declareformat\@gobble\@firstofone}
+\@onlypreamble\DeclareCaptionFormat
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declareformat[2]{%
+ \@dblarg{\caption@@declareformat#1{#2}}}
+\@onlypreamble\caption@declareformat
+% \end{macrocode}
+% \begin{macrocode}
+\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
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{format}{\caption@setformat{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setformat}
+% |\caption@setformat|\marg{name}\par
+% Selecting a caption format simply means saving the code (in |\caption@fmt|)
+% and if the code should be used in horizontal or vertical mode (|\caption@ifh|).
+% \begin{macrocode}
+\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}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionDefaultFormat}
+% \changes{v1.2a}{2008/01/31}{This macro added}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionDefaultFormat[1]{%
+ \expandafter\def\expandafter\caption@fmt@default\expandafter
+ {\csname caption@fmt@#1\endcsname}%
+ \expandafter\def\expandafter\caption@slfmt@default\expandafter
+ {\csname caption@slfmt@#1\endcsname}%
+ \expandafter\def\expandafter\caption@ifh@default\expandafter
+ {\csname caption@ifh@#1\endcsname}}
+\@onlypreamble\DeclareCaptionDefaultFormat
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.0a}{2004/01/23}{%
+% Caption format \opt{default} renamed to \opt{normal}}
+% \changes{v1.0e}{2005/05/12}{%
+% Caption format \opt{normal} renamed to \opt{@normal}}
+% \changes{v1.0f}{2005/08/25}{%
+% Caption format \opt{@normal} renamed to \opt{plain} and documented}
+% \changes{v1.1c}{2007/10/14}{%
+% Single-line variant of caption format \opt{hang} added}
+% There are two pre-defined formats, called `plain' and `hang'.
+% \begin{macrocode}
+\DeclareCaptionFormat{plain}{#1#2#3\par}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionFormat{hang}[#1#2#3\par]{%
+ \caption@ifin@list\caption@lsepcrlist\caption@lsepname
+ {\caption@Error{%
+ The option `labelsep=\caption@lsepname' does not work\MessageBreak
+ with `format=hang'}}%
+ {\@hangfrom{#1#2}%
+ \advance\caption@parindent\hangindent
+ \advance\caption@hangindent\hangindent
+ \caption@@par#3\par}}
+% \end{macrocode}
+%
+% \changes{v1.0a}{2004/01/23}{Caption format \opt{default} linked to \opt{plain}}
+% \changes{v1.0d}{2005/04/28}{Bugfix 05-04-28: Missing \cs{caption@ifh@default} added}
+% `default' usually maps to `plain'.
+% \begin{macrocode}
+\DeclareCaptionDefaultFormat{plain}
+% \end{macrocode}
+%
+% \section{Label formats}
+%
+% \begin{macro}{\DeclareCaptionLabelFormat}
+% \changes{v1.0a}{2004/01/17}{%
+% Pass through argument \#2 so extra spaces between arguments do make any harm}
+% |\DeclareCaptionLabelFormat|\marg{name}\marg{code with \#1 and \#2}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionLabelFormat[2]{%
+ \global\@namedef{caption@lfmt@#1}##1##2{#2}}
+\@onlypreamble\DeclareCaptionLabelFormat
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{labelformat}{\caption@setlabelformat{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlabelformat}
+% |\caption@setlabelformat|\marg{name}\par
+% Selecting a caption label format simply means saving the code (in |\caption@lfmt|).
+% \begin{macrocode}
+\newcommand*\caption@setlabelformat[1]{%
+ \@ifundefined{caption@lfmt@#1}%
+ {\caption@Error{Undefined label format `#1'}}%
+ {\expandafter\let\expandafter\caption@lfmt\csname caption@lfmt@#1\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.2}{2007/12/16}{Caption label format \opt{brace} added}
+% \changes{v1.7}{2015/09/16}{Caption label format \opt{autodot} added}
+% \changes{v1.7}{2016/05/22}{Caption label format \opt{autodot} fixed}
+% \changes{v1.8}{2016/05/22}{Caption label format \opt{unnumbered} added}
+% There are six pre-defined label formats, called `empty', `simple',
+% `parens', `brace', `autodot', and `unnumbered'.
+% \begin{macrocode}
+\DeclareCaptionLabelFormat{empty}{}
+\DeclareCaptionLabelFormat{simple}{\bothIfFirst{#1}{\nobreakspace}#2}
+\DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{\nobreakspace}(#2)}
+\DeclareCaptionLabelFormat{brace}{\bothIfFirst{#1}{\nobreakspace}#2)}
+\DeclareCaptionLabelFormat{autodot}{\bothIfFirst{#1}{\nobreakspace}#2\autodot}
+\DeclareCaptionLabelFormat{unnumbered}{#1}
+% \end{macrocode}
+%
+% `default' usually maps to `simple'.
+% \begin{macrocode}
+\def\caption@lfmt@default{\caption@lfmt@simple}
+% \end{macrocode}
+%
+% \section{Label separators}
+%
+% \begin{macro}{\DeclareCaptionLabelSeparator}
+% \changes{v1.0a}{2004/01/17}{Pass through argument \#2 so extra spaces
+% between arguments do make any harm}
+% \changes{v1.0f}{2005/08/25}{Starred variant added}
+% \changes{v1.1}{2007/07/13}{Test for CR added}
+% \changes{v1.3}{2011/08/06}{Test for CR revised}
+% |\DeclareCaptionLabelSeparator|\marg{name}\marg{code}\\
+% |\DeclareCaptionLabelSeparator*|\marg{name}\marg{code}\par
+% The starred form causes the label separator to be typeset \emph{without} using |\captionlabelfont|.
+% \begin{macrocode}
+\newcommand\DeclareCaptionLabelSeparator{%
+ \caption@teststar\caption@declarelabelseparator\@gobble\@firstofone}
+\@onlypreamble\DeclareCaptionLabelSeparator
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@declarelabelseparator[3]{%
+ \global\@namedef{caption@iflf@#2}{#1}%
+ \global\long\@namedef{caption@lsep@#2}{#3}%
+ \caption@@declarelabelseparator{#2}#3\\\@nil}
+\@onlypreamble\caption@declarelabelseparator
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@declarelabelseparator#1#2\\#3\@nil{%
+ \def\@tempa{#3}\ifx\@tempa\@empty \else
+ \caption@g@addto@list\caption@lsepcrlist{#1}%
+ \fi}
+\@onlypreamble\caption@@declarelabelseparator
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{labelsep}{\caption@setlabelseparator{#1}}
+\DeclareCaptionOption{labelseparator}{\caption@setlabelseparator{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlabelseparator}
+% |\caption@setlabelseparator|\marg{name}\par
+% Selecting a caption label separator simply means saving the code (in |\caption@lsep|).
+% \begin{macrocode}
+\newcommand*\caption@setlabelseparator[1]{%
+ \@ifundefined{caption@lsep@#1}%
+ {\caption@Error{Undefined label separator `#1'}}%
+ {\edef\caption@lsepname{#1}%
+ \expandafter\let\expandafter\caption@iflf\csname caption@iflf@#1\endcsname
+ \expandafter\let\expandafter\caption@lsep\csname caption@lsep@#1\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.0e}{2005/06/11}{Bugfix 05-03-23: Caption label separator
+% \opt{newline} implementation changed from \cs{newline} to \cs{\textbackslash}}
+% \changes{v1.0f}{2005/08/24}{Caption label separator \opt{endash} added}
+% There are seven pre-defined label separators, called `none', `colon', `period', `space',
+% `quad', `newline', and `endash'.
+% \begin{macrocode}
+\DeclareCaptionLabelSeparator{none}{}
+\DeclareCaptionLabelSeparator{colon}{: }
+\DeclareCaptionLabelSeparator{period}{. }
+\DeclareCaptionLabelSeparator{space}{ }
+\DeclareCaptionLabelSeparator*{quad}{\quad}
+\DeclareCaptionLabelSeparator*{newline}{\captionnewline}
+\DeclareCaptionLabelSeparator*{endash}{\space\textendash\space}
+% \end{macrocode}
+%
+% \begin{macro}{\captionnewline}
+% \changes{v1.12}{2020/05/30}{This macro added}
+% Will be used in the caption label separator |new|\-|line|,
+% and re-defined for |long|\-|table| environments.
+% \begin{macrocode}
+\newcommand*\captionnewline{\\}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setdefaultlabelsep}
+% \changes{v1.2d}{2009/03/29}{This macro added}
+% \begin{macrocode}
+\newcommand*\caption@setdefaultlabelsep[1]{%
+ \ifx\caption@lsep\caption@lsep@default
+ \caption@set@default@labelsep{#1}%
+ \caption@setlabelseparator{default}%
+ \else
+ \caption@set@default@labelsep{#1}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@set@default@labelsep[1]{%
+ \def\caption@lsep@default{\@nameuse{caption@lsep@#1}}%
+ \def\caption@iflf@default{\@nameuse{caption@iflf@#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% `default' usually maps to `colon'.
+% \begin{macrocode}
+\caption@set@default@labelsep{colon}
+% \end{macrocode}
+%
+% \section{Text formats}
+%
+% \begin{macro}{\DeclareCaptionTextFormat}
+% \changes{v1.0j}{2007/02/18}{This macro added}
+% |\DeclareCaptionTextFormat|\marg{name}\marg{code with \#1}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionTextFormat[2]{%
+ \global\long\@namedef{caption@tfmt@#1}##1{#2}}
+\@onlypreamble\DeclareCaptionTextFormat
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.0c}{2005/02/12}{Option \opt{strut=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{textformat}{\caption@settextformat{#1}}
+\DeclareCaptionOption{strut}[1]{\caption@set@bool\caption@ifstrut{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@settextformat}
+% \changes{v1.0j}{2007/02/18}{This macro added}
+% |\caption@settextformat|\marg{name}\par
+% Selecting a caption text format simply means saving the code (in |\caption@tfmt|).
+% \begin{macrocode}
+\newcommand*\caption@settextformat[1]{%
+ \@ifundefined{caption@tfmt@#1}%
+ {\caption@Error{Undefined text format `#1'}}%
+ {\expandafter\let\expandafter\caption@tfmt\csname caption@tfmt@#1\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% There are three pre-defined text formats, called `empty', `simple' and `period'.
+% \changes{v1.4}{2011/10/05}{Pre-defined text format `empty' added}
+% \changes{v1.7}{2015/09/16}{The text format `empty' now takes care of the \cs{label}}
+% \begin{macrocode}
+\DeclareCaptionTextFormat{empty}{%
+ \caption@get@label#1\caption@makeanchor{}\@nil
+ \caption@thelabel
+ \global\let\caption@thelabel\relax}
+\long\def\caption@get@label#1\caption@makeanchor#2#3\@nil{%
+ \def\caption@tempa{#2}%
+ \ifx\caption@tempa\@empty
+ \caption@getlabel#1\label{}\@nil
+ \else
+ \caption@getlabel#2\label{}\@nil
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionTextFormat{simple}{#1}
+\DeclareCaptionTextFormat{period}{#1.}
+% \end{macrocode}
+%
+% `default' usually maps to `simple'.
+% \begin{macrocode}
+\def\caption@tfmt@default{\caption@tfmt@simple}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@getlabel}
+% \changes{v1.0}{2011/09/03}{\cs{label} can have optional arguments now}
+% \changes{v1.7}{2015/09/16}{Moved from \package{bicaption} package to \package{caption3}}
+% \changes{v1.8d}{2019/09/01}{Bugfix: Global definition of \cs{caption@thelabel} added}
+% Gets the label command out of the (first) caption text and stores it to |\caption@thelabel|.
+% \begin{macrocode}
+\long\def\caption@getlabel#1\label#2#3\@nil{%
+ \def\@tempa{#2}%
+ \ifx\@tempa\@empty
+ \let\caption@thelabel\relax
+ \else
+ \def\@tempb{*}%
+ \ifx\@tempa\@tempb
+ \def\caption@thelabel{\label*}%
+ \caption@@getlabel#3\@nil
+ \else
+ \def\caption@thelabel{\label}%
+ \caption@@getlabel{#2}#3\@nil
+ \fi
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@getlabel#1#2\@nil{%
+ \def\@tempa{#1}%
+ \def\@tempb{[}%
+ \ifx\@tempa\@tempb
+ \caption@@@getlabel#1#2\@nil
+ \else
+ \l@addto@macro\caption@thelabel{{#1}}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@@getlabel[#1]#2\@nil{%
+ \l@addto@macro\caption@thelabel{[{#1}]}%
+ \caption@@getlabel#2\@nil}
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@thelabel\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Fonts}
+%
+% \begin{macro}{\DeclareCaptionFont}
+% \changes{v1.0a}{2004/01/22}{Bugfix: Multi token arguments are allowed now}
+% \changes{v1.1}{2007/05/07}{Internal: Uses \cs{caption@fnt} instead of \cs{caption@temp} now}
+% \changes{v1.8h}{2020/01/03}{Check for \package{ragged2e} package related options added}
+% \changes{v1.10}{2020/05/10}{Optional argument \opt{package} added}
+% |\DeclareCaptionFont|\oarg{package}\marg{name}\marg{code}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionFont{%
+ \@ifnextchar[%]
+ \caption@declare@font
+ \caption@declarefont}
+\@onlypreamble\DeclareCaptionFont
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@declare@font[#1]#2{%
+ \global\@namedef{caption@fnt@#2@package}{#1}%
+ \caption@@declarefont{#2}}
+\@onlypreamble\caption@declare@font
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declarefont[1]{%
+ \global\@nameundef{caption@fnt@#1@package}%
+ \caption@@declarefont{#1}}
+\@onlypreamble\caption@declarefont
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@declarefont[2]{%
+ \define@key{caption@fnt}{#1}[]{\caption@addto@fnt{#1}{#2}}%
+ \caption@@@declarefont{#1}{#2}}
+\@onlypreamble\caption@@declarefont
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@declarefont[2]{}% will be used by \DeclareCaptionJustification
+\@onlypreamble\caption@@@declarefont
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@addto@fnt[2]{%
+ \expandafter\let\expandafter\caption@package\csname caption@fnt@#1@package\endcsname
+ \caption@ifdefined\caption@package
+ {\caption@requirepackage\caption@package{#1}}% load package, if necessary
+ {}%
+ \l@addto@macro\caption@fnt{#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionDefaultFont}
+% \changes{v1.1}{2006/05/14}{This macro added}
+% \changes{v1.2a}{2008/01/31}{Renamed from \cs{DeclareDefaultCaptionFont} to \cs{DeclareCaptionDefaultFont}}
+% |\DeclareCaptionDefaultFont|\marg{name}\marg{code}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionDefaultFont[2]{%
+ \global\@namedef{caption#1@default}{#2}}
+\@onlypreamble\DeclareCaptionDefaultFont
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{font}{\caption@setfont{font}{#1}}
+\DeclareCaptionOption{font+}{\caption@addtofont{font}{#1}}
+\DeclareCaptionDefaultFont{font}{}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{labelfont}{\caption@setfont{labelfont}{#1}}
+\DeclareCaptionOption{labelfont+}{\caption@addtofont{labelfont}{#1}}
+\DeclareCaptionDefaultFont{labelfont}{}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{textfont}{\caption@setfont{textfont}{#1}}
+\DeclareCaptionOption{textfont+}{\caption@addtofont{textfont}{#1}}
+\DeclareCaptionDefaultFont{textfont}{}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setfont}
+% \changes{v1.0j}{2007/01/30}{Usage of \cs{caption@setkeys} with optional argument}
+% \changes{v1.1}{2006/05/14}{Support of \cs{DeclareDefaultCaptionFont} added}
+% |\caption@setfont|\marg{name}\marg{keyval-list of names}\par
+% Selecting a caption font means saving all the code snippets
+% in |\caption|\meta{name}.
+% \begin{macrocode}
+\newcommand*\caption@setfont[1]{%
+ \expandafter\let\csname caption#1\endcsname\@empty
+ \caption@addtofont{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@addtofont}
+% \changes{v1.2}{2007/11/17}{This macro added}
+% |\caption@addtofont|\marg{name}\marg{keyval-list of names}\par
+% Like |\caption@setfont|, but adds the code snippets to |\caption|\meta{name}.\par
+% Because we use |\setkeys| recursive here we need to do this inside an
+% extra group.
+% \begin{macrocode}
+\newcommand*\caption@addtofont[2]{%
+ \begingroup
+ \expandafter\let\expandafter\caption@fnt\csname caption#1\endcsname
+ \define@key{caption@fnt}{default}[]{%
+ \l@addto@macro\caption@fnt{\csname caption#1@default\endcsname}}%
+ \caption@setkeys[caption]{caption@fnt}{#2}%
+ \global\let\caption@tempa\caption@fnt
+ \endgroup
+ \expandafter\let\csname caption#1\endcsname\caption@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@font}
+% \changes{v1.1}{2007/05/07}{This macro added}
+% |\caption@font|\marg{keyval-list of names}\\
+% |\caption@font*|\marg{keyval-code}\par
+% Sets the given font, e.g.~|\caption@font{small,it}|
+% is equivalent to |\small\itshape|.
+% \begin{macrocode}
+\newcommand*\caption@font{%
+ \caption@teststar\caption@@font\@firstofone
+ {\caption@setkeys[caption]{caption@fnt}}}
+\newcommand*\caption@@font[2]{%
+ \begingroup
+ \def\caption@fnt{\endgroup}%
+ #1{#2}%
+ \caption@fnt}
+% \end{macrocode}
+% \end{macro}
+%
+% These are the pre-defined font code snippets.
+%
+% \changes{v1.1}{2007/05/07}{Color font support added}
+% \begin{macrocode}
+\DeclareCaptionFont{normalcolor}{\normalcolor}
+\DeclareCaptionFont{color}{\color{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionFont{normalfont}{\normalfont}
+\DeclareCaptionFont{up}{\upshape}
+\DeclareCaptionFont{it}{\itshape}
+\DeclareCaptionFont{sl}{\slshape}
+\DeclareCaptionFont{sc}{\scshape}
+\DeclareCaptionFont{md}{\mdseries}
+\DeclareCaptionFont{bf}{\bfseries}
+\DeclareCaptionFont{rm}{\rmfamily}
+\DeclareCaptionFont{sf}{\sffamily}
+\DeclareCaptionFont{tt}{\ttfamily}
+% \end{macrocode}
+%
+% \changes{v1.7}{2018/05/01}{Missing font sizes \texttt{tiny}, \texttt{LARGE}, \texttt{huge}, and \texttt{Huge} added}
+% \begin{macrocode}
+\DeclareCaptionFont{tiny}{\tiny}
+\DeclareCaptionFont{scriptsize}{\scriptsize}
+\DeclareCaptionFont{footnotesize}{\footnotesize}
+\DeclareCaptionFont{small}{\small}
+\DeclareCaptionFont{normalsize}{\normalsize}
+\DeclareCaptionFont{large}{\large}
+\DeclareCaptionFont{Large}{\Large}
+\DeclareCaptionFont{LARGE}{\LARGE}
+\DeclareCaptionFont{huge}{\huge}
+\DeclareCaptionFont{Huge}{\Huge}
+% \end{macrocode}
+%
+% \changes{v1.8}{2018/05/01}{Font size \texttt{smaller} added}
+% \begin{macrocode}
+\newcommand\caption@smaller{%
+ \ifx\@currsize\tiny
+ \relax
+ \else\ifx\@currsize\scriptsize
+ \tiny
+ \else\ifx\@currsize\footnotesize
+ \scriptsize
+ \else\ifx\@currsize\small
+ \footnotesize
+ \else\ifx\@currsize\normalsize
+ \small
+ \else\ifx\@currsize\large
+ \normalsize
+ \else\ifx\@currsize\Large
+ \large
+ \else\ifx\@currsize\LARGE
+ \Large
+ \else\ifx\@currsize\huge
+ \LARGE
+ \else\ifx\@currsize\Huge
+ \huge
+ \else
+ \caption@Warning{%
+ Cannot determine current font size.\MessageBreak
+ Try setting it with `size=' explicitly}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+\DeclareCaptionFont{smaller}{\caption@smaller}
+% \end{macrocode}
+%
+% \changes{v1.8}{2018/05/02}{Font size \texttt{larger} added}
+% \begin{macrocode}
+\newcommand\caption@larger{%
+ \ifx\@currsize\tiny
+ \scriptsize
+ \else\ifx\@currsize\scriptsize
+ \footnotesize
+ \else\ifx\@currsize\footnotesize
+ \small
+ \else\ifx\@currsize\small
+ \normalsize
+ \else\ifx\@currsize\normalsize
+ \large
+ \else\ifx\@currsize\large
+ \Large
+ \else\ifx\@currsize\Large
+ \LARGE
+ \else\ifx\@currsize\LARGE
+ \huge
+ \else\ifx\@currsize\huge
+ \Huge
+ \else\ifx\@currsize\Huge
+ \relax
+ \else
+ \caption@Warning{%
+ Cannot determine current font size.\MessageBreak
+ Try setting it with `size=' explicitly}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+\DeclareCaptionFont{larger}{\caption@larger}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionFont{singlespacing}{}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%\DeclareCaptionFont{normal}{%
+% \caption@font{normalcolor,normalfont,normalsize,singlespacing}
+\DeclareCaptionFont{normal}{%
+ \caption@font*{%
+ \KV@caption@fnt@normalcolor\@unused
+ \KV@caption@fnt@normalfont\@unused
+ \KV@caption@fnt@normalsize\@unused
+ \KV@caption@fnt@singlespacing\@unused}}
+% \end{macrocode}
+%
+% \changes{v1.0a}{2004/01/23}{Option \opt{size=} now sets \cs{captionsize} instead of \cs{captionfont}}
+% The old versions \version{1.x} of \thispackage\ offered this
+% command to setup the font size used for captions. We still do
+% so old documents will work fine.
+% \begin{macrocode}
+\DeclareCaptionOption{size}{\caption@setfont{size}{#1}}
+\DeclareCaptionDefaultFont{size}{}
+% \end{macrocode}
+%
+% \section{Justifications}
+%
+% \begin{macro}{\DeclareCaptionJustification}
+% \changes{v1.0a}{2004/01/17}{Pass through argument \#2 so extra spaces
+% between arguments do make any harm}
+% \changes{v1.1}{2007/07/03}{Mapped to \cs{DeclareCaptionFont}}
+% |\DeclareCaptionJustification|\marg{name}\marg{code}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionJustification{%
+ \def\caption@@@declarefont##1##2{%
+ \global\@namedef{caption@hj@##1}{##2}% for compatibility to v1.0, needed by floatrow package
+ \let\caption@@@declarefont\@gobbletwo}%
+ \DeclareCaptionFont}
+\@onlypreamble\DeclareCaptionJustification
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionDefaultJustification}
+% \changes{v1.1}{2007/07/03}{This macro added}
+% \changes{v1.2a}{2008/01/31}{Renamed from \cs{DeclareDefaultCaptionJustification} to \cs{DeclareCaptionDefaultJustification}}
+% |\DeclareCaptionDefaultJustification|\marg{code}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionDefaultJustification[1]{%
+ \global\@namedef{caption@hj@default}{#1}% for compatibility to v1.0
+ \DeclareCaptionDefaultFont{@hj}{#1}}
+\@onlypreamble\DeclareCaptionDefaultJustification
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{justification}{\caption@setjustification{#1}}
+\DeclareCaptionDefaultJustification{}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setjustification}
+% \changes{v1.1}{2007/07/03}{Mapped to \cs{caption@setfont}}
+% |\caption@setjustification|\marg{name}\par
+% Selecting a caption justification simply means saving the code (in |\caption@hj|).
+% \begin{macrocode}
+\newcommand*\caption@setjustification{\caption@setfont{@hj}}
+% \end{macrocode}
+% \end{macro}
+%
+% These are the pre-defined justification code snippets.
+% \begin{macrocode}
+\DeclareCaptionJustification{justified}{}
+\DeclareCaptionJustification{centering}{\centering}
+\DeclareCaptionJustification{centerfirst}{\centerfirst}
+\DeclareCaptionJustification{centerlast}{\centerlast}
+\DeclareCaptionJustification{raggedleft}{\raggedleft}
+\DeclareCaptionJustification{raggedright}{\raggedright}
+% \end{macrocode}
+%
+% \begin{macro}{\centerfirst}
+% \changes{v1.0j}{2007/01/21}{Bugfix: Usage of \cs{@centercr} added (Thanks to Olga!)}
+% \changes{v1.0j}{2007/01/21}{This macro renamed from \cs{caption@centerfirst} to \cs{centerfirst}}
+% Please blame Frank Mittelbach for the code of |\centerfirst| |:-)|
+% \begin{macrocode}
+\providecommand\centerfirst{%
+ \let\\\@centercr
+ \edef\caption@normaladjust{%
+ \leftskip\the\leftskip
+ \rightskip\the\rightskip
+ \parfillskip\the\parfillskip\relax}%
+ \leftskip\z@\@plus -1fil%
+ \rightskip\z@\@plus 1fil%
+ \parfillskip\z@skip
+ \noindent\hskip\z@\@plus 2fil%
+ \@setpar{\@@par\@restorepar\caption@normaladjust}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\centerlast}
+% \changes{v1.0j}{2007/01/21}{Bugfix: Usage of \cs{@centercr} added (Thanks to Olga!)}
+% \changes{v1.0j}{2007/01/21}{This macro renamed from \cs{caption@centerlast} to \cs{centerlast}}
+% This is based on code from Anne Br\"uggemann-Klein\cite{Anne}
+% \begin{macrocode}
+\providecommand\centerlast{%
+ \let\\\@centercr
+ \leftskip\z@\@plus 1fil%
+ \rightskip\z@\@plus -1fil%
+ \parfillskip\z@\@plus 2fil\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Vertical spaces before and after captions}
+%
+% \begin{macro}{\abovecaptionskip}
+% \begin{macro}{\belowcaptionskip}
+% Usually these skips are defined within the document class, but some
+% document classes don't do so.
+% \begin{macrocode}
+\caption@ifundefined\abovecaptionskip{%
+ \newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@}}{}
+\caption@ifundefined\belowcaptionskip{%
+ \newlength\belowcaptionskip\setlength\belowcaptionskip{0\p@}}{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \changes{v1.0c}{2005/02/12}{Option \opt{skip=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{aboveskip}{\setlength\abovecaptionskip{#1}}
+\DeclareCaptionOption{belowskip}{\setlength\belowcaptionskip{#1}}
+\DeclareCaptionOption{skip}{\setlength\abovecaptionskip{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@rule}
+% \changes{v1.2b}{2008/05/06}{This macro added}
+% |\caption@rule|\par
+% Draws an invisible rule to adjust the ``skip'' setting.
+% \begin{macrocode}
+\newcommand*\caption@rule{\caption@ifrule\caption@hrule\relax}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@hrule{\hrule\@height\z@}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.2b}{2008/05/06}{Option \opt{rule=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{rule}[1]{\caption@set@bool\caption@ifrule{#1}}
+% \end{macrocode}
+%
+% \section{Positioning}
+%
+% These macros handle the right position of the caption.
+% Note that the position is actually \emph{not} controlled by the
+% \package{caption3} kernel options, but by the user (or a specific package
+% like the \package{float} package) instead.
+% The user can put the |\caption| command wherever he likes! So this stuff
+% is only to give us a \emph{hint} where to put the right skips, the user
+% usually has to take care for himself that this hint actually matches the
+% right position.
+%
+% \begin{macrocode}
+\DeclareCaptionOption{position}{\caption@setposition{#1}}
+% \end{macrocode}
+% \changes{v1.0a}{2004/01/09}{Options \opt{figureposition} and \opt{tableposition} added}
+% \begin{macrocode}
+\DeclareCaptionOption{figureposition}{%
+ \captionsetup*[figure]{position=#1}}
+\@onlypreamble@key{caption}{figureposition}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{tableposition}{%
+ \captionsetup*[table]{position=#1}}
+\@onlypreamble@key{caption}{tableposition}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setposition}
+% \changes{v1.0a}{2004/01/22}{Now the positions \opt{t}, \opt{above}, \opt{b},
+% \opt{below}, and \opt{a} are allowed, too}
+% \changes{v1.0c}{2004/08/10}{Usage of \cs{caption@defaultpos} added}
+% |\caption@setposition|\marg{position}\par
+% Selecting the caption position means that we put |\caption@position| to
+% the right value. \emph{Please do \textbf{not} use the internal macro
+% \cs{caption@position} in your own package or document, but use the wrapper
+% macro \cs{caption@iftop} instead.}
+% \begin{macrocode}
+\newcommand*\caption@setposition[1]{%
+ \caption@ifinlist{#1}{d,default}{%
+ \let\caption@position\caption@defaultpos
+ }{\caption@ifinlist{#1}{t,top,above}{%
+ \let\caption@position\@firstoftwo
+ }{\caption@ifinlist{#1}{b,bottom,below}{%
+ \let\caption@position\@secondoftwo
+ }{\caption@ifinlist{#1}{a,auto}{%
+ \let\caption@position\@undefined
+ }{%
+ \caption@Error{Undefined position `#1'}%
+ }}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@defaultpos}
+% \changes{v1.1}{2007/05/08}{Default position changed from `bottom' to `auto'}
+% The default `position' is `auto', this means that \thispackage\ will try
+% to guess the current position of the caption.
+% (But in many cases, for example in |longtable|s, this is doomed to fail!)\par
+% The setting `bottom' correspondents to the |\@makecaption| implementation
+% in the standard \LaTeX\ document classes, but `auto' should give better
+% results in most cases.
+% \begin{macrocode}
+%\caption@setdefaultpos{a}% default = auto
+\let\caption@defaultpos\@undefined
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@iftop}
+% \changes{v1.0a}{2004/01/23}{Split into \cs{caption@iftop} \& \cs{caption@fixposition}}
+% \changes{v1.0c}{2005/02/12}{Adapted to \cs{caption@defaultpos}}
+% \changes{v1.1}{2007/05/08}{Position will be fixed to `bottom' if `auto'}
+% |\caption@iftop|\marg{true-code}\marg{false-code}\par
+% (If the |position=| is set to |auto| we assume a |bottom| position here.)
+% \begin{macrocode}
+\newcommand*\caption@iftop{%
+ \ifx\caption@position\@undefined
+ \let\caption@position\@secondoftwo
+% = \caption@setposition b%
+ \fi
+ \caption@position}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@fixposition}
+% \changes{v1.0b}{2004/05/16}{%
+% Split into \cs{caption@fixposition} & \cs{caption@autoposition}}
+% |\caption@fixposition|\par
+% This macro checks if the `position' is set to `auto'.
+% If yes, |\caption@autoposition| will be called to
+% set |\caption@position| to a proper value we can actually use.
+% \begin{macrocode}
+\newcommand*\caption@fixposition{%
+ \ifx\caption@position\@undefined
+ \caption@autoposition
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@autoposition}
+% \changes{v1.0a}{2004/01/23}{\cs{ifvmode} added}
+% |\caption@autoposition|\par
+% We guess the current position of the caption by checking |\prevdepth|.\par
+% A different solution would be setting the |\spacefactor| to something
+% not much less than 1000 (for example 994) in |\caption@start| and
+% checking this value here by |\ifnum\spacefactor=994|.
+% (It's implemented in the \package{threeparttable}
+% package\cite{threeparttable} this way.)\par
+% Another idea would be checking |\@ifminipage|, but since some packages
+% typeset the caption within a simple |\vbox| this does not seem to be a
+% good one.
+% \begin{macrocode}
+\newcommand*\caption@autoposition{%
+ \ifvmode
+ \edef\caption@tempa{\the\prevdepth}%
+ \caption@Debug{\protect\prevdepth=\caption@tempa}%
+ \ifdim\prevdepth>-\p@
+ \let\caption@position\@secondoftwo
+ \else
+ \let\caption@position\@firstoftwo
+ \fi
+% = \caption@setposition{\ifdim\prevdepth>-\p@ b\else t\fi}%
+ \else
+ \caption@Debug{no \protect\prevdepth}%
+ \let\caption@position\@secondoftwo
+% = \caption@setposition b%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@setautoposition}
+% \changes{v1.1}{2007/06/10}{This macro added}
+% |\caption@setautoposition|\marg{position}\par
+% replaces the above algorithm by a different one (or a fixed position setting).
+% \begin{macrocode}
+\newcommand*\caption@setautoposition[1]{%
+ \def\caption@autoposition{\caption@setposition{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Hooks}
+%
+% \begin{macro}{\AtBeginCaption}
+% \begin{macro}{\AtEndCaption}
+% |\AtBeginCaption| \marg{code}\\
+% |\AtEndCaption| \marg{code}\par
+% These hooks can be used analogous to |\AtBeginDocument| and |\AtEndDocument|.
+% \begin{macrocode}
+\newcommand*\caption@beginhook{}
+\newcommand*\caption@endhook{}
+\newcommand*\AtBeginCaption{\l@addto@macro\caption@beginhook}
+\newcommand*\AtEndCaption{\l@addto@macro\caption@endhook}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \section{Lists}
+%
+% \changes{v1.0b}{2004/05/16}{Option \opt{listof=} added}
+% \changes{v1.2}{2007/11/17}{Option \opt{list=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{list}[1]{\caption@setlist{#1}}
+\DeclareCaptionOption{listof}[1]{\caption@setlist{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlist}
+% \changes{v1.2a}{2008/03/20}{This macro added}
+% |\caption@setlist|\marg{boolean}
+% \begin{macrocode}
+\newcommand*\caption@setlist{\caption@set@bool\caption@iflist}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.4}{2011/08/30}{Option \opt{listtype=} added}
+% \changes{v1.4}{2011/08/30}{Option \opt{listtype+=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{listtype}{\caption@setlisttype{#1}}
+\DeclareCaptionOption{listtype+}{\caption@setlisttype@ext{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlisttype}
+% \changes{v1.4}{2011/08/30}{This macro added}
+% |\caption@setlisttype|\marg{type}
+% \begin{macrocode}
+\newcommand*\caption@setlisttype{%
+ \caption@setlisttype@ext{}%
+ \caption@@setlisttype\caption@listtype}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setlisttype[2]{%
+ \edef#1{#2}%
+ \ifx#1\@empty \let#1\@undefined \fi}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@setlisttype@ext}
+% \changes{v1.4}{2011/08/30}{This macro added}
+% |\caption@setlisttype@ext|\marg{type extension}
+% \begin{macrocode}
+\newcommand*\caption@setlisttype@ext{%
+ \caption@@setlisttype\caption@listtype@ext}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionListFormat}
+% \changes{v1.1}{2004/07/15}{This macro added}
+% \changes{v1.2}{2007/11/17}{Renamed from \cs{DeclareCaptionListOfFormat} to \cs{DeclareCaptionListFormat}}
+% |\DeclareCaptionListFormat|\marg{name}\marg{code with \#1 and \#2}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionListFormat[2]{%
+ \global\@namedef{caption@lstfmt@#1}##1##2{#2}}
+\@onlypreamble\DeclareCaptionListFormat
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.1}{2007/07/15}{Option \opt{listofformat=} added}
+% \changes{v1.2}{2007/11/17}{Option \opt{listofformat=} renamed to \opt{listformat=}}
+% \begin{macrocode}
+\DeclareCaptionOption{listformat}{\caption@setlistformat{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlistformat}
+% \changes{v1.1}{2004/07/15}{This macro added}
+% \changes{v1.2}{2007/11/17}{Renamed from \cs{caption@setlistofformat} to \cs{caption@setlistformat}}
+% |\caption@setlistformat|\marg{name}\par
+% Selecting a caption list format simply means saving the code (in |\caption@lstfmt|).
+% \begin{macrocode}
+\newcommand*\caption@setlistformat[1]{%
+ \@ifundefined{caption@lstfmt@#1}%
+ {\caption@Error{Undefined list format `#1'}}%
+ {\expandafter\let\expandafter\caption@lstfmt
+ \csname caption@lstfmt@#1\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% There are five pre-defined list formats, taken from the \package{subfig} package.
+% \begin{macrocode}
+\DeclareCaptionListFormat{empty}{}
+\DeclareCaptionListFormat{simple}{#1#2}
+\DeclareCaptionListFormat{parens}{#1(#2)}
+\DeclareCaptionListFormat{subsimple}{#2}
+\DeclareCaptionListFormat{subparens}{(#2)}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setdefaultlistformat}
+% \changes{v1.2d}{2009/03/29}{This macro added}
+% \begin{macrocode}
+\newcommand*\caption@setdefaultlistformat[1]{%
+ \ifx\caption@lstfmt\caption@lstfmt@default
+ \caption@set@default@listformat{#1}%
+ \caption@setlistformat{default}%
+ \else
+ \caption@set@default@listformat{#1}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@set@default@listformat[1]{%
+ \def\caption@lstfmt@default{\@nameuse{caption@lstfmt@#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% `default' usually maps to `subsimple'.
+% \begin{macrocode}
+\caption@set@default@listformat{subsimple}
+% \end{macrocode}
+%
+% \section{Debug option}
+% \changes{v1.0k}{2007/03/04}{Debug option added}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{debug}[1]{%
+ \caption@set@bool\caption@ifdebug{#1}%
+ \caption@ifdebug
+ {\let\caption@Debug\caption@Info}%
+ {\let\caption@Debug\@gobble}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareOption{debug}{\setkeys{caption}{debug}}
+% \end{macrocode}
+% \begin{macrocode}
+\setkeys{caption}{debug=0}
+% \end{macrocode}
+%
+% \section{Document classes \& Babel support}
+%
+% \begin{macro}{\caption@ifdocumentclass}
+% Boolean switch which is set if the document class could be detected successfully,
+% i.e. |\caption@document|\-|class| is set to a proper value.
+% (If |\caption@document|\-|class| is already set, this flag will also be set.)
+% \begin{macrocode}
+\caption@setbool{documentclass}{1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@documentclass}
+% \changes{v1.8e}{2018/05/11}{This macro added}
+% Determine document class used.
+% Set |\caption@document|\-|class| by good-guessing, if not already set.
+% \begin{macrocode}
+\caption@ifundefined\caption@documentclass{%
+% \end{macrocode}
+% \begin{macrocode}
+ \@ifclassloaded{beamer}{%
+ \caption@InfoNoLine{beamer document class detected}%
+ \def\caption@documentclass{beamer}%
+% \end{macrocode}
+% \begin{macrocode}
+ }{\@ifclassloaded{elsarticle}{%
+ \caption@InfoNoLine{elsarticle document class detected}%
+ \def\caption@documentclass{elsarticle}%
+% \end{macrocode}
+% \begin{macrocode}
+ }{\@ifclassloaded{memoir}{%
+ \caption@InfoNoLine{memoir document class detected}%
+ \def\caption@documentclass{memoir}%
+% \end{macrocode}
+% \begin{macrocode}
+ }{\caption@ifdefined\scr@caption{%
+ \caption@InfoNoLine{KOMA-Script document class detected}%
+ \def\caption@documentclass{koma}%
+% \end{macrocode}
+% If |\@captionheadfont| is defined, we assume it's a AMS or SMF document class.
+% \begin{macrocode}
+ }{\caption@ifdefined\@captionheadfont{%
+ \caption@InfoNoLine{AMS or SMF document class detected}%
+ \def\caption@documentclass{ams}%
+% \end{macrocode}
+% If |\@CaptionFonts| is defined, we assume it's a NTG Dutch document class.
+% \begin{macrocode}
+ }{\caption@ifdefined\CaptionFonts{%
+ \caption@InfoNoLine{NTG document class detected}%
+ \def\caption@documentclass{ntg}%
+% \end{macrocode}
+% If |\cph@font| and |\cpb@font| are defined, we assume it's a NTG Dutch document class.
+% \begin{macrocode}
+ }{\caption@ifdefined\cph@font{%
+ \caption@ifdefined\cpb@font\@firstoftwo\@secondoftwo
+ }{%
+ \@secondoftwo
+ }{%
+ \caption@InfoNoLine{thesis document class detected}%
+ \def\caption@documentclass{thesis}%
+ }{%
+% \end{macrocode}
+% If the definition of |\@makecaption| matches the one from the standard \LaTeX\ document classes
+% |article|, |report|, or |book|, we assume it's either one of them or is compatible to them.
+% \begin{macrocode}
+ % article|report|book [2005/09/16 v1.4f Standard LaTeX document class]
+ \long\def\caption@tempa#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1: #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ #1: #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}}
+ \ifx\caption@tempa\@makecaption
+ \caption@InfoNoLine{Standard document class detected}%
+ \else
+% \end{macrocode}
+% Otherwise we are clueless and use standard default settings for the captions anyway.
+% (And we unset the |document|\-|class| flag to indicate that the content of |\caption@document|\-|class| is not correct.)
+% \begin{macrocode}
+ \caption@InfoNoLine{%
+ Unknown document class (or package),\MessageBreak
+ standard defaults will be used}%
+ \caption@InfoNoLine{\string\@makecaption\space=\space\meaning\@makecaption\@gobble}%
+ \caption@setbool{documentclass}{0}%
+ \fi
+ \def\caption@documentclass{base}%
+ }}}}}}%
+}{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifclassloaded}
+% \changes{v1.8e}{2019/09/09}{This macro added}
+% |\caption@ifclassloaded|\marg{name}\marg{yes-code}\marg{no-code}
+% \begin{macrocode}
+\newcommand*\caption@ifclassloaded[1]{%
+ \edef\caption@tempa{#1}%
+ \ifx\caption@tempa\caption@documentclass
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{The standard \texorpdfstring{\LaTeX{}}{LaTeX} classes}
+%
+% Since this is the default, there is no extra work to be done here.
+%
+% \subsection{The elsarticle classes}
+% \changes{v1.5}{2013/01/06}{elsarticle class support added}
+%
+% \begin{macrocode}
+\caption@ifclassloaded{elsarticle}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionDefaultFont{font}{\footnotesize}
+% \end{macrocode}
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The \AmS{} \& \SmF{} classes}
+% \changes{v1.1}{2007/07/29}{\AmS\ \& \SmF\ classes support added}
+%
+% \begin{macrocode}
+\caption@ifclassloaded{ams}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \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
+ \caption@ifdefined\smf@makecaption{,maxmargin=.1\linewidth}{}}}
+ \@tempa
+ \caption@g@addto@list\caption@sls@default{margin*=.5\captionmargin}
+ \DeclareCaptionLabelSeparator{default}{.\enspace}
+ \DeclareCaptionDefaultFont{font}{\@captionfont}
+ \DeclareCaptionDefaultFont{labelfont}{\@captionheadfont}
+ \DeclareCaptionDefaultFont{textfont}{\@captionfont\upshape}
+ \captionsetup[figure]{position=b}
+ \captionsetup[table]{position=t}
+% \end{macrocode}
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The beamer class (Part one)}
+% \changes{v1.1}{2007/03/10}{\package{beamer} class support added}
+% \changes{v1.3}{2011/08/06}{\package{beamer} class support revised}
+% \changes{v1.5}{2013/04/27}{The \package{beamer} template \texttt{caption label separator} will be used now}
+% \changes{v1.7}{2016/05/22}{Re-definition of label format \texttt{simpleMagyar} added to \package{beamer} class support}
+% \changes{v1.7}{2018/04/15}{Re-definition of label format \texttt{simpleMagyar} revised}
+% \changes{v1.7}{2018/05/01}{Definition of \package{beamer} default label font revised}
+%
+% \begin{macrocode}
+\caption@ifclassloaded{beamer}{%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@ifbeamertemplate}
+% |\caption@ifbeamertemplate|\marg{caption template name}\marg{yes-code}\marg{no-code}\\
+% tests if the given beamer caption template was selected by the user (or not).
+% \begin{macrocode}
+ \newcommand*\caption@ifbeamertemplate[1]{%
+ \begingroup
+ \let\beamer@@tmpl@caption@ORI\beamer@@tmpl@caption
+ \@nameuse{beamer@@tmpop@caption@#1}%
+ \ifx\beamer@@tmpl@caption@ORI\beamer@@tmpl@caption
+ \endgroup\expandafter\@firstoftwo
+ \else
+ \endgroup\expandafter\@secondoftwo
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \DeclareCaptionLabelFormat{default}{%
+ \caption@ifbeamertemplate{numbered}%
+ \caption@lfmt@simple
+ \caption@lfmt@unnumbered
+ {#1}{#2}}
+% \end{macrocode}
+% The \package{magyar} babel package redefines the current label format to a one called |simple|\-|Magyar|,
+% defined within |\@@magyar@caption|\-|fix| which will be executed |\At|\-|Begin|\-|Document|.
+% \begin{macrocode}
+ \DeclareCaptionLabelFormat{default@magyar}{%
+ \caption@ifbeamertemplate{numbered}%
+ \caption@lfmt@simple@magyar
+ \caption@lfmt@unnumbered
+ {#1}{#2}}
+ \@ifundefined{@@magyar@captionfix}\AtBeginDocument\@firstofone{%
+ \@ifundefined{@@magyar@captionfix}{}{%
+ \g@addto@macro\@@magyar@captionfix{%
+ \let\caption@lfmt@simple@magyar\caption@lfmt@simpleMagyar
+ \let\caption@lfmt@simpleMagyar\caption@lfmt@default@magyar}}}
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@declarelabelseparator
+ {\caption@ifbeamertemplate{caption name own line}\@gobble\@firstofone}
+ {default}
+ {\caption@ifbeamertemplate{caption name own line}{\\}%
+ {\usebeamertemplate{caption label separator}}}
+ \DeclareCaptionDefaultFont{font}{%
+ \usebeamerfont*{caption}%
+ \usebeamercolor[fg]{caption}}
+ \DeclareCaptionDefaultFont{labelfont}{%
+ \setbeamercolor*{caption}{}% avoid setting "caption" color additionally
+ \usebeamercolor[fg]{caption name}%
+ \setbeamerfont*{caption}{}% avoid setting "caption" font additionally
+ \usebeamerfont{caption name}}
+ \DeclareCaptionDefaultJustification{\raggedright}
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareOption{beamerclass}{%
+ \renewcommand\caption@ifslc{%
+ \caption@ifbeamertemplate{caption name own line}\@secondoftwo\@firstoftwo}
+ % Since the beamer class do not offer a `list of figures' we switch this support off.
+ \captionsetup{list=0}}
+ \PassOptionsToPackage{beamerclass}{caption3}
+% \end{macrocode}
+%
+% If the \package{beamer} document class is used, we offer a beamer
+% template called `caption3' which can be used with option `beamer' or
+% |\setbeamertemplate{caption}[caption3]|.\par
+% (Note that this is of no use when the \package{caption} package is used, too.)
+% \begin{macrocode}
+ \defbeamertemplate{caption}{caption3}{%
+ \caption@make\insertcaptionname\insertcaptionnumber\insertcaption}
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareOption{beamer}{%
+ % \usebeamertemplate**{caption} will set font
+ \DeclareCaptionDefaultFont{font}{}%
+ \setbeamertemplate{caption}[caption3]}
+% \end{macrocode}
+% \begin{macrocode}
+%
+% \begin{macrocode]
+}{}
+% \end{macrocode}
+%
+% \subsection{The KOMA-Script classes}
+% \changes{v1.1}{2007/03/31}{\KOMAScript\ classes support added}
+%
+% \begin{macrocode}
+\caption@ifclassloaded{koma}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionFormat{default}[#1#2#3\par]{%
+ \ifdofullc@p
+ \caption@ifin@list\caption@lsepcrlist\caption@lsepname
+ {\caption@Error{%
+ The option `labelsep=\caption@lsepname' does not work\MessageBreak
+ with \noexpand\setcaphanging (which is set by default)}}%
+ {\caption@fmt@hang{#1}{#2}{#3}}%
+ \else
+ #1#2%
+ \ifdim\cap@indent<\z@
+ \par
+ \noindent\hspace*{-\cap@indent}%
+ \else\if@capbreak
+ \par
+ \fi\fi
+ #3\par
+ \fi}
+ \DeclareCaptionLabelSeparator{default}{\captionformat}
+ \DeclareCaptionDefaultFont{font}{\scr@fnt@caption}
+ \DeclareCaptionDefaultFont{labelfont}{\scr@fnt@captionlabel}
+% \end{macrocode}
+%
+% \changes{v1.0f}{2005/08/22}{Increased compatibility to KOMA-Script:
+% A special version of options `parindent' and `parskip' added}
+% \changes{v1.0g}{2006/01/03}{Bugfix 06-01-03: KOMA-Script variants of
+% `parskip' and `parindent' options revised and moved into caption kernel}
+% \changes{v1.0h}{2006/02/23}{KOMA-Script variants of `parskip' and
+% `parindent' are obsolete now, removed}
+% \changes{v1.0m}{2007/03/30}{KOMA-Script variants of `parskip' and
+% `parindent' re-added, since they still collide with the current
+% version of the subfig package (Sigh!)}
+%
+% There is an option clash between the \KOMAScript\ document classes
+% and the \package{caption} kernel, both define the options |parindent| and
+% |parskip| but with different meaning.
+% Furthermore the ones defined by the \package{caption} kernel take a
+% value as parameter but the \KOMAScript\ ones do not.
+% So we need special versions of the options |parindent| and |parskip| here
+% which determine if a value is given (and therefore should be treated as
+% our option) or not (and therefore should be ignored by us).\footnote{%^^A
+% This problem was completely solved due a change of \cs{caption@ProcessOptions}
+% in \thispackage\ \version{1.0h}, but we still need this workaround since
+% these options would otherwise still collide with the current version $1.3$
+% of the \package{subfig} package (Sigh!)}
+% \begin{macrocode}
+ \let\caption@KV@parindent\KV@caption@parindent
+ \DeclareCaptionOption{parindent}[]{%
+ \ifx,#1,%
+ \caption@Debug{Option `parindent' ignored}%
+ \else
+ \caption@KV@parindent{#1}%
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@KV@parskip\KV@caption@parskip
+ \DeclareCaptionOption{parskip}[]{%
+ \ifx,#1,%
+ \caption@Debug{Option `parskip' ignored}%
+ \else
+ \caption@KV@parskip{#1}%
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The \NTG{} Dutch classes}
+% \changes{v1.1}{2007/04/06}{NTG classes support added}
+%
+% \begin{macrocode}
+\caption@ifclassloaded{ntg}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionDefaultFont{labelfont}{\CaptionLabelFont}
+ \DeclareCaptionDefaultFont{textfont}{\CaptionTextFont}
+% \end{macrocode}
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The thesis class}
+% \changes{v1.2a}{2008/01/31}{thesis class support added}
+% \changes{v1.2e}{2009/11/15}{Bugfix 09-11-14: thesis class support revised}
+%
+% \begin{macrocode}
+\caption@ifclassloaded{thesis}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionDefaultFormat{hang}
+ \DeclareCaptionDefaultFont{labelfont}{\cph@font}
+ \DeclareCaptionDefaultFont{textfont}{\cpb@font}
+% \end{macrocode}
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The arabic Babel option}
+% \changes{v1.8}{2018/05/20}{\package{arabic} babel package support added}
+%
+% \begin{macrocode}
+\caption@ifdefined\ArabiCoreLoaded{%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@rl}
+% \changes{v1.8}{2018/05/20}{This macro added}
+% \begin{macrocode}
+ \newcommand\caption@rl[1]{\if@rl\textRL{#1}\else\textLR{#1}\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \def\fnum@figure{\figurename\nobreakspace\thefigure}%
+ \def\fnum@table{\tablename\nobreakspace\thetable}%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionLabelSeparator{arabi}{ : }
+ \DeclareCaptionLabelSeparator{default}{%
+ \if@rl\caption@lsep@arabi\else\caption@lsep@colon\fi}
+% \end{macrocode}
+% \begin{macrocode}
+}{%
+ \let\caption@rl\@firstofone
+}
+% \end{macrocode}
+%
+% \subsection{The frenchb Babel option}
+% \changes{v1.1}{2006/05/14}{\package{frenchb} babel package support added}
+%
+% \begin{macrocode}
+\caption@ifdefined\FB@makecaption{%
+% \end{macrocode}
+% \begin{macrocode}
+ \ifx\@makecaption\STD@makecaption
+ \DeclareCaptionLabelSeparator{default}{\CaptionSeparator}
+ \def\caption@frenchb{% supress frenchb warning
+ \let\STD@makecaption\@makecaption
+ \let\FB@makecaption\@makecaption}
+ \else
+ \ifx\@makecaption\@undefined\else
+ \caption@InfoNoLine{%
+ The definition of \protect\@makecaption\space
+ has been changed,\MessageBreak
+ frenchb will NOT customize it}%
+ \fi
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The frenchle/pro package}
+% \changes{v1.1}{2006/05/14}{\package{frenchle/pro} package support added}
+%
+% \begin{macrocode}
+\caption@ifdefined\frenchTeXmods{%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionDefaultFont{textfont}{\itshape}%
+ \DeclareCaptionLabelSeparator{default}{\captionseparator\space}%
+% \end{macrocode}
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The hungarian and magyar Babel option}
+% \changes{v1.3}{2009/03/29}{\package{magyar} package support added}
+% \changes{v1.3a}{2011/08/12}{\package{magyar} package support revised}
+% \changes{v1.8b}{2018/08/26}{\package{magyar} package support revised}
+%
+% \begin{macrocode}
+\DeclareCaptionListFormat{subperiod}{#2.}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\caption@tempa#1{%
+ \@ifpackagewith{babel}{#1}{%
+ \caption@InfoNoLine{#1 babel option is loaded}%
+ \expandafter\addto\csname extras#1\endcsname{%
+ % change default labelsep and listformat
+ \caption@setdefaultlabelsep{period}%
+ \caption@setdefaultlistformat{subperiod}}%
+ \expandafter\addto\csname noextras#1\endcsname{%
+ % change default labelsep and listformat
+ \caption@setdefaultlabelsep{colon}%
+ \caption@setdefaultlistformat{subsimple}}%
+ }{}}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@tempa{hungarian}
+\caption@tempa{magyar}
+% \end{macrocode}
+%
+% TODO: babel-latvian/latvian.ldf
+%
+% \section{Package support}
+%
+% \begin{macro}{\caption@xpackage}
+% \changes{v1.11}{2020/05/10}{This macro added}
+% |\caption@xpackage|\marg{macro}\marg{package}\marg{option}
+% expands the given macro if the given package is not loaded.
+% (Note: We cannot use |\@ifpackageloaded| here since it's not available after |\AtBeginDocument|.)
+% \begin{macrocode}
+\newcommand*\caption@xpackage[2]{%
+ \expandafter\ifx\csname ver@#2.\caption@pkgextension\endcsname\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobbletwo
+ \fi
+ {#1{#2}}}
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@pkgextension\@pkgextension
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@loadpackage}
+% \changes{v1.11}{2020/05/10}{This macro added}
+% |\caption@loadpackage|\marg{package}\marg{caption option}
+% loads the given package immediately.
+% \begin{macrocode}
+\newcommand*\caption@loadpackage{%
+ \caption@xpackage\caption@@loadpackage}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@loadpackage[2]{%
+ \caption@Info{Option `#2' requires the `#1' package}%
+ \RequirePackage{#1}\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@requirepackage}
+% \changes{v1.10}{2020/05/10}{This macro added}
+% |\caption@requirepackage|\marg{package}\marg{caption option}
+% indicates that the given package option needs a package.
+% \begin{macrocode}
+\newcommand*\caption@requirepackage{%
+ \caption@xpackage\caption@@requirepackage}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@requirepackage[2]{%
+ \@cons\caption@packagelist{{#1}{#2}}}% load package later on
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@pkg@list}
+% \changes{v1.4b}{2012/01/12}{This macro added}
+% We used this in the past as list of packages loaded |\AtBeginDocument|.
+% (Note: Old |.aux| files could contain |\@cons|\-|\caption@pkg@list|\-|{{|\meta{package}|}}|,
+% so this macro should always be defined, even if we change the following code in the future.)
+% \begin{macrocode}
+\newcommand*\caption@pkg@list{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@packagelist}
+% \changes{v1.11}{2020/05/10}{This macro added}
+% We use this as list of packages loaded |\AtBeginDocument|.
+% \begin{macrocode}
+\newcommand*\caption@packagelist{}
+\@onlypreamble\caption@packagelist
+% \end{macrocode}
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \def\caption@tempa{\endgroup}%
+ \begingroup
+ \def\@elt#1#2{%
+ \g@addto@macro\caption@tempa{%
+ \caption@loadpackage{#1}{#2}}}%
+ \caption@packagelist
+ \caption@tempa
+% \end{macrocode}
+% \begin{macrocode}
+ \renewcommand*\caption@@loadpackage[2]{%
+ \caption@Error{Option `#2' requires the `#1' package}}%
+ \let\caption@@requirepackage\caption@@loadpackage
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@usepackage}
+% \changes{v1.11}{2020/05/10}{This macro added}
+% |\caption@usepackage|\marg{package}\marg{option}\marg{code}
+% loads the given package and executes the given code.
+% (Note: Since the package might use the crappy \package{keyval}
+% package, too, we need to save \& restore some macros here, otherwise this
+% recursion won't work properly.)
+% \begin{macrocode}
+\newcommand*\caption@usepackage[3]{%
+ \IfCaptionOptionCheck
+ {\caption@requirepackage{#1}{#2}}%
+ {\let\KV@prefix@ORI\KV@prefix
+ \let\@tempc@ORI\@tempc
+ \caption@loadpackage{#1}{#2}%
+ #3%
+ \let\@tempc\@tempc@ORI
+ \let\KV@prefix\KV@prefix@ORI}}
+% \end{macro}
+%
+% \subsection{The newfloat package}
+%
+% \begin{macro}{\caption@newfloat}
+% \changes{v1.4b}{2012/01/12}{This macro added}
+% \changes{v1.8h}{2020/01/03}{Usage of \cs{caption@ifpackageloaded} replaced by \cs{RequirePackage}}
+% \changes{v1.11}{2020/05/10}{Usage of \cs{RequirePackage} replaced by \cs{caption@usepackage}}
+% |\caption@newfloat|\marg{option}\marg{code}
+% loads the \package{newfloat} package and executes the given code afterwards.
+% \begin{macrocode}
+\newcommand*\caption@newfloat{\caption@usepackage{newfloat}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.0c}{2004/08/03}{Options \opt{figurename} and \opt{tablename} added}
+% \changes{v1.1}{2007/07/04}{Options \opt{figurename} and \opt{tablename} re-written}
+% \changes{v1.2}{2007/11/18}{Option \opt{name} added}
+% \begin{macrocode}
+\DeclareCaptionOption{figurename}{\caption@SetName{figure}{#1}}
+\@onlypreamble@key{caption}{figurename}
+\DeclareCaptionOption{tablename}{\caption@SetName{table}{#1}}
+\@onlypreamble@key{caption}{tablename}
+% \end{macrocode}
+%
+% \changes{v1.2a}{2008/02/28}{Options \opt{listfigurename} and \opt{listtablename} added}
+% \begin{macrocode}
+\DeclareCaptionOption{listfigurename}{\caption@SetName{listfigure}{#1}}
+\@onlypreamble@key{caption}{listfigurename}
+\DeclareCaptionOption{listtablename}{\caption@SetName{listtable}{#1}}
+\@onlypreamble@key{caption}{listtablename}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@SetName}
+% \changes{v1.1}{2007/07/04}{This macro added}
+% \changes{v1.2}{2007/11/18}{After-preamble variant added}
+% \changes{v1.2a}{2008/02/28}{Renamed from \cs{caption@SetFloatName} to \cs{caption@SetName}}
+% \changes{v1.2b}{2008/08/02}{Bugfix: Works now without \cs{addto}, too}
+% \changes{v1.4a}{2011/10/29}{Outsourced to \package{newfloat} package}
+% \changes{v1.4b}{2012/01/12}{Bugfix: Uses \cs{caption@newfloat} now}
+% |\caption@SetName|\marg{float}\marg{name}
+% \begin{macrocode}
+\newcommand*\caption@SetName[2]{%
+ \caption@newfloat{#1name}{\newfloat@setname{#1}{#2}}}
+\@onlypreamble\caption@SetName
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{name}{%
+ \IfCaptionOptionCheck{}{\caption@setname\@captype{#1}}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setname}
+% |\caption@setname|\marg{float}\marg{name}
+% \begin{macrocode}
+\newcommand*\caption@setname[2]{%
+ \@namedef{#1name}{#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.2}{2007/12/21}{Options \opt{figurewithin} and \opt{tablewithin} added}
+% \changes{v1.2e}{2010/01/09}{The \opt{within} options are now available within the document, too}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{figurewithin}{\caption@within{figure}{#1}}
+\DeclareCaptionOptionNoValue{figurewithout}{\caption@within{figure}{none}}
+\DeclareCaptionOption{tablewithin}{\caption@within{table}{#1}}
+\DeclareCaptionOptionNoValue{tablewithout}{\caption@within{table}{none}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@within}
+% \changes{v1.2}{2007/12/21}{This macro added}
+% \changes{v1.4a}{2011/10/29}{Outsourced to \package{newfloat} package}
+% \changes{v1.4b}{2012/01/12}{Bugfix: Uses \cs{caption@newfloat} now}
+% |\caption@within|\marg{float}\marg{value}
+% \begin{macrocode}
+\newcommand*\caption@within[2]{%
+ \caption@newfloat{#1within}{\newfloat@setwithin{#1}{#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.2b}{2008/04/13}{Option \opt{within} added}
+% \changes{v1.2e}{2010/01/09}{The global \opt{within} option will now affect user-defined floats declared with \cs{DeclareCaptionType}, too}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{within}{%
+ \caption@newfloat{within}{\newfloatsetup{within=#1}}}
+\DeclareCaptionOptionNoValue{without}{%
+ \caption@newfloat{without}{\newfloatsetup{without}}}
+% \end{macrocode}
+%
+% \subsection{The ragged2e package}
+% \changes{v1.0b}{2004/05/16}{Improved \package{ragged2e} package support}
+% \changes{v1.8h}{2020/01/03}{Revised \package{ragged2e} package support}
+% \changes{v1.9}{2020/05/05}{Enhanced \package{ragged2e} package support}
+% \changes{v1.10}{2020/05/10}{Revised \package{ragged2e} package support}
+%
+% We support the upper-case commands offered by the \package{ragged2e}
+% package.
+% \begin{macrocode}
+\DeclareCaptionJustification[ragged2e]{Justified}{\justifying}
+\DeclareCaptionJustification[ragged2e]{Centering}{\Centering}
+\DeclareCaptionJustification[ragged2e]{RaggedLeft}{\RaggedLeft}
+\DeclareCaptionJustification[ragged2e]{RaggedRight}{\RaggedRight}
+% \end{macrocode}
+%
+% \subsection{The sansmath package}
+% \changes{v1.3}{2011/01/01}{\package{sansmath} package support added}
+% \changes{v1.10}{2020/05/10}{\package{sansmath} package support revised}
+%
+% \begin{macrocode}
+\DeclareCaptionFont[sansmath]{sansmath}{\sansmath}
+% \end{macrocode}
+%
+% \subsection{The setspace package}
+% \changes{v1.0n}{2007/04/02}{\package{setspace} package support added}
+% \changes{v1.2d}{2009/10/09}{\package{setspace} package support revised}
+%
+% \begin{macrocode}
+\DeclareCaptionFont{singlespacing}{%
+ \caption@ifdefined\setspace@singlespace{%
+ \setstretch\setspace@singlespace}{}}% normally 1
+\DeclareCaptionFont[setspace]{onehalfspacing}{\onehalfspacing}
+\DeclareCaptionFont[setspace]{doublespacing}{\doublespacing}
+\DeclareCaptionFont[setspace]{stretch}{\setstretch{#1}}
+% \end{macrocode}
+%
+% \subsection{The subfig package}
+% \changes{v1.1}{2007/07/07}{Several adaptions to the \package{subfig} package added}
+% \changes{v1.4a}{2011/11/01}{Test for the \package{subfig} package revised}
+%
+% Since the \package{subfig} package is not maintained anymore,
+% we have to make several adaptions to \thispackage~\version{1.1} here.
+% Please note that we only support the version $1.3$ of the \package{subfig} package here.
+% So older versions do not work with this version of \thispackage, and newer
+% versions are expected to be adapted.
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \def\@tempa{2005/06/28 ver: 1.3 subfig package}%
+ \expandafter\ifx\csname ver@subfig.sty\endcsname\@tempa
+ \caption@InfoNoLine{subfig package v1.3 is loaded}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@setfloattype\@gobble
+ \let\@dottedxxxline\sf@NEW@dottedxxxline
+ \let\sf@subfloat\sf@NEW@subfloat
+% \end{macrocode}
+% \begin{macrocode}
+ \fi
+ \let\sf@NEW@dottedxxxline\@undefined
+ \let\sf@NEW@subfloat\@undefined}
+% \end{macrocode}
+%
+% \begin{macro}{\@dottedxxxline}
+% New version of |\@dottedxxxline|
+% \begin{macrocode}
+\def\sf@NEW@dottedxxxline#1#2#3#4#5#6#7{%
+ \begingroup
+ \caption@setfloattype{#1}%
+ \caption@setoptions{subfloat}%
+ \caption@setoptions{sub#1}%
+ \ifnum #3>\@nameuse{c@#2depth}\else
+ \@dottedtocline{\z@}{#4}{#5}{#6}{#7}%
+ \fi
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\sf@subfloat}
+% \changes{v1.4b}{2011/12/29}{Bugfix 11-12-23: Usage of \cs{caption@warmup} added}
+% New version of |\sf@subfloat|
+% \begin{macrocode}
+\def\sf@NEW@subfloat{%
+ \begingroup
+ \@nameuse{caption@warmup}%
+ \caption@setfloattype\@captype
+ \sf@ifpositiontop{%
+ \maincaptiontoptrue
+ }{%
+ \maincaptiontopfalse
+ }%
+ \caption@setoptions{subfloat}%
+ \caption@setoptions{sub\@captype}%
+ \let\sf@oldlabel=\label
+ \let\label=\subfloat@label
+ \ifmaincaptiontop\else
+ \advance\@nameuse{c@\@captype}\@ne
+ \fi
+ \refstepcounter{sub\@captype}%
+ \setcounter{sub\@captype @save}{\value{sub\@captype}}%
+ \@ifnextchar [% %] match left bracket
+ {\sf@@subfloat}%
+ {\sf@@subfloat[\@empty]}}
+% \end{macrocode}
+% \end{macro}
+%
+% Make the \package{subfig} package documentation compile.
+% \begin{macrocode}
+%%\@ifl@aded{dtx}{subfig}{\caption@loadpackage{ragged2e}{}}{} % not needed
+\DeclareCaptionOption{lofdepth}[2]{\caption@ifdefined\c@lofdepth{\setcounter{lofdepth}{#1}}{}}
+\DeclareCaptionOption{lotdepth}[2]{\caption@ifdefined\c@lotdepth{\setcounter{lotdepth}{#1}}{}}
+% \end{macrocode}
+%
+% \section{Execution of options}
+%
+% \begin{macrocode}
+\captionsetup{style=default,position=default,%
+ list,listformat=default,twoside=\if@twoside 1\else 0\fi}
+% \end{macrocode}
+% \begin{macrocode}
+\ProcessOptions*
+% \end{macrocode}
+%
+% \section{Making an `List of' entry}
+%
+% \begin{macro}{\caption@addcontentsline}
+% \changes{v1.1}{2007/07/01}{This macro added}
+% \changes{v1.3}{2010/10/26}{Error check added}
+% \changes{v1.3}{2011/06/24}{Split into two macros}
+% \changes{v1.4}{2011/08/19}{Split into three macros}
+% \changes{v1.4}{2011/08/30}{Support for option \opt{listtype=} added}
+% \changes{v1.5}{2012/01/15}{Usage of \cs{caption@addsubcontentslines} added}
+% \changes{v1.7}{2015/09/15}{Argument \#3 which holds the environment name added to \cs{caption@lstfmt}}
+% \changes{v1.7}{2015/09/20}{Unfortunately \package{subfig} defines and uses \cs{caption@lstfmt} as well, so I replaced the third argument with \cs{captionlisttype}}
+% \changes{v1.8}{2018/09/06}{Adapted to the \package{chkfloat} package}
+% |\caption@addcontentsline|\marg{type}\marg{list entry}\par
+% Makes an entry in the list-of-whatever, if requested,
+% i.e.~the argument \meta{list entry} is not empty and
+% |listof=| was set to |true|.
+% \begin{macrocode}
+\newcommand\caption@addcontentsline[2]{%
+ \caption@ifcontentsline{#2}{%
+ \begingroup
+ \let\@tempa\@gobble
+ \caption@ifdefined\caption@listtype
+ {\let\@tempa\@firstofone}%
+ {\edef\caption@listtype{#1}}%
+ \caption@ifdefined\caption@listtype@ext
+ {\edef\caption@listtype{\caption@listtype\caption@listtype@ext}%
+ \let\@tempa\@firstofone}%
+ {}%
+ \@tempa
+ {\caption@Debug{addcontentsline: #1 => \caption@listtype}%
+% \caption@setoptions\caption@listtype
+ \@namedef{the\caption@listtype}{\@nameuse{the#1}}}%
+ \expandafter\caption@@addcontentsline\expandafter{\caption@listtype}{#2}%
+ \endgroup}%
+ \caption@addsubcontentslines{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@@addcontentsline[2]{%
+ {\let\\\space
+ \@ifundefined{ext@#1}%
+ {\caption@Error{No float type '#1' defined}}%
+ {\def\captionlisttype{#1}%
+ \caption@add@contentsline
+ {\csname ext@#1\endcsname}%
+ {#1}%
+ {\caption@lstfmt{\@nameuse{p@#1}}{\@nameuse{the#1}}}%
+ {\ignorespaces #2}%
+ \caption@chkfloat{#1}{#2}}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@add@contentsline{%
+ \caption@@@addcontentsline}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@addcontentsline[4]{%
+% \caption@ifdefined\main@Arabi@language
+% {\addtocontents{#1}{\xstring\select@language{\main@Arabi@language}}}{}%
+ \addcontentsline{#1}{#2}{\protect\numberline{#3}{#4}}}
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@chkfloat\@gobbletwo
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@ifcontentsline[1]{%
+ \caption@iflist
+ {\def\@tempa{#1}}%
+ {\let\@tempa\@empty}%
+ \ifx\@tempa\@empty
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@addsubcontentslines[1]{}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Typesetting the caption}
+%
+% \begin{macro}{\ifcaption@star}
+% If the starred form of |\caption| is used, this will be set to |true|.
+% (It will be reset to |false| at the end of |\caption@@make|.)
+% \begin{macrocode}
+\newif\ifcaption@star
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@fnum}
+% \changes{v1.1}{2007/08/21}{This macro added}
+% |\caption@fnum|\marg{float type}\par
+% Typesets the caption label; as replacement for |\fnum@|\meta{float type}.
+% \begin{macrocode}
+\newcommand*\caption@fnum[1]{\caption@lfmt{\@nameuse{#1name}}{\@nameuse{the#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@make}
+% |\caption@make|\marg{float name}\marg{ref.\ number}\marg{text}\par
+% Typesets the caption.
+% \begin{macrocode}
+\newcommand\caption@make[2]{\caption@@make{\caption@lfmt{#1}{#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@make}
+% \changes{v1.0b}{2004/05/16}{Bugfix 04-05-05: \cs{ifdim}\cs{captionindent=}\cs{z@} added}
+% \changes{v1.0c}{2005/02/12}{Bugfix 04-10-26: Use \cs{@tempdima} instead of
+% \cs{captionmargin} resp. \cs{captionwidth}; check for \cs{z@} added}
+% \changes{v1.0c}{2005/02/12}{Bugfix: \cs{hskip}\cs{captionmargin} to the end
+% of caption added}
+% \changes{v1.0c}{2005/02/12}{Bugfix: \cs{strut} moved from here to \cs{caption@@@make}}
+% \changes{v1.0c}{2005/02/12}{Single-line-check moved up so it can affect margins now}
+% \changes{v1.0c}{2005/02/09}{Improvement: \cs{caption@ifh} added}
+% \changes{v1.0c}{2005/02/09}{Bugfix: \cs{leavevmode} added}
+% \changes{v1.0f}{2005/08/24}{Uses \cs{sbox} instead of \cs{setbox} in single-line-check}
+% \changes{v1.0g}{2005/12/04}{Uses \cs{caption@slc} now}
+% \changes{v1.0g}{2006/01/11}{Bugfix: \cs{caption@calcmargin} inside
+% single-line-check replaced by \cs{relax}}
+% \changes{v1.0g}{2006/01/11}{Bugfix: \cs{caption@startbox} will always be
+% typeset in horizontal mode}
+% \changes{v1.0i}{2006/05/13}{Uses \cs{caption@parbox} instead of \cs{caption@start/endbox}}
+% \changes{v1.0j}{2007/01/04}{Oops, bugfix 04-05-05 got lost in v1.0h, re-added}
+% \changes{v1.0n}{2007/04/03}{Usage of \cs{caption@ifoddpage} added}
+% \changes{v1.1}{2007/07/29}{\cs{caption@calcmargin} moved below single-line-check}
+% \changes{v1.1e}{2007/10/28}{\cs{caption@stepcounter} added}
+% \changes{v1.5}{2012/03/15}{Uses \cs{caption@tempdima} instead of \cs{@tempdima}}
+% \changes{v1.5}{2012/12/26}{max-margin stuff moved to \cs{caption@calcmargin}}
+% \changes{v1.6}{2013/05/01}{Usage of \cs{caption@box} added}
+% \changes{v1.7}{2016/01/31}{Adapted to the \package{bicaption} package}
+% \changes{v1.8f}{2019/12/18}{Usage of \cs{linewidth} replaced by \cs{hsize}}
+% |\caption@@make|\marg{caption label}\marg{caption text}
+% \begin{macrocode}
+\newcommand\caption@@make[2]{%
+ \begingroup
+ \caption@@make@{#1}{#2}%
+ \endgroup
+ \caption@@make@epilogue}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@@make@[2]{%
+ \caption@stepthecounter
+ \caption@beginhook
+% \end{macrocode}
+%
+% Typeset the outer box |\caption@box|
+% \begin{macrocode}
+ \caption@box\hsize{%
+% \end{macrocode}
+%
+% Special single-line treatment (option |singlelinecheck=|)
+% \begin{macrocode}
+ \caption@ifslc{\caption@slc{#1}{#2}\caption@singleline\relax}{}%
+% \end{macrocode}
+%
+% Typeset the left margin (option |margin=|)
+% \begin{macrocode}
+ \caption@calcmargin
+ \caption@tempdima\captionmargin
+ \ifdim\captionmargin@=\z@ \else
+ \caption@ifoddpage{}{\advance\caption@tempdima\captionmargin@}%
+ \fi
+ \caption@ifh{\advance\caption@tempdima\caption@indent}%
+ \hspace\caption@tempdima
+% \end{macrocode}
+%
+% We actually use a |\vbox| of width |\captionwidth - \caption@indent|
+% to typeset the caption.
+% \Note{\cs{captionindent} is \emph{not} supported if the caption format
+% was defined with \cs{DeclareCaptionFormat*}.}
+% \begin{macrocode}
+ \caption@tempdima\captionwidth
+ \caption@ifh{\advance\caption@tempdima-\caption@indent}%
+ \caption@parbox\caption@tempdima{%
+% \end{macrocode}
+%
+% Typeset the indention (option |indention=|)\\
+% {\small Bugfix 04-05-05:
+% |\hskip-\caption@indent| replaced by |\ifdim\caption@indent=\z@|\ldots}
+% \begin{macrocode}
+ \caption@ifh{%
+ \ifdim\caption@indent=\z@
+ \leavevmode
+ \else
+ \hskip-\caption@indent
+ \fi}%
+% \end{macrocode}
+%
+% Typeset the caption itself and close the |\caption@parbox|
+% \begin{macrocode}
+ \caption@@@make{#1}{#2}}%
+% \end{macrocode}
+%
+% Typeset the right margin (option |margin=|)
+% \begin{macrocode}
+ \caption@tempdima\captionmargin
+ \ifdim\captionmargin@=\z@ \else
+ \caption@ifoddpage{\advance\caption@tempdima\captionmargin@}{}%
+ \fi
+ \hspace\caption@tempdima
+% \end{macrocode}
+%
+% Close the outer box |\caption@box|
+% \begin{macrocode}
+ }%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \caption@endhook}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@@make@epilogue{%
+ \global\caption@starfalse}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@calcmargin}
+% \changes{v1.0f}{2005/10/24}{Internal: \cs{ifcaption@width} replaced by \cs{ifdim}\cs{captionwidth=}\cs{z@}}
+% \changes{v1.0g}{2006/01/12}{Improvement: Takes care of list environment now}
+% \changes{v1.1}{2006/05/13}{Check of \cs{@listdepth} removed (not necessary anymore), use \cs{linewidth} instead of \cs{hsize}}
+% \changes{v1.5}{2012/12/26}{max-margin stuff moved from \cs{caption@@make} to here}
+% \changes{v1.8f}{2019/12/18}{Usage of \cs{linewidth} replaced by \cs{hsize}}
+% |\caption@calcmargin|\par
+% Calculate |\captionmargin| \& |\captionwidth|, so both contain valid
+% values.
+% \begin{macrocode}
+\newcommand*\caption@calcmargin{%
+ \caption@calcmargin@hook
+% \end{macrocode}
+% Check margin, if |\caption@minmargin| or |\caption@maxmargin| is set
+% \begin{macrocode}
+ \ifx\caption@maxmargin\@undefined \else
+ \ifdim\captionmargin>\caption@maxmargin\relax
+ \captionmargin\caption@maxmargin\relax
+ \fi
+ \fi
+ \ifx\caption@minmargin\@undefined \else
+ \ifdim\captionmargin<\caption@minmargin\relax
+ \captionmargin\caption@minmargin\relax
+ \fi
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \ifdim\captionwidth=\z@
+ \captionwidth\hsize
+ \advance\captionwidth by -2\captionmargin
+ \advance\captionwidth by -\captionmargin@
+ \else
+ \captionmargin\hsize
+ \advance\captionmargin by -\captionwidth
+ \divide\captionmargin by 2
+ \captionmargin@\z@
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@Debug{%
+ \string\hsize=\the\hsize,
+ \string\captionwidth=\the\captionwidth,\MessageBreak
+ \string\captionmargin=\the\captionmargin,
+ \string\captionmargin@=\the\captionmargin@}%
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@slc}
+% \changes{v1.1}{2007/06/13}{\cs{let}\cs{caption@hj}\cs{relax} added}
+% \changes{v1.1}{2007/07/29}{\cs{caption@setup}\cs{caption@sls} added after \cs{begingroup}}
+% \changes{v1.1}{2007/07/29}{\cs{caption@calcmargin} added}
+% \changes{v1.1c}{2007/10/14}{Support of \cs{caption@slfmt} added}
+% \changes{v1.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency}
+% \changes{v1.3}{2010/09/04}{Split into \cs{caption@slc} and \cs{caption@@slc}}
+% \changes{v1.5}{2012/12/26}{Merged into a single macro again}
+% \changes{v1.5}{2013/04/14}{Definition and usage of \cs{ifsinglelinecaption} added}
+% |\caption@slc|\marg{label}\marg{text}\marg{single-line-code}\marg{multi-line-code}\par
+% This one does the single-line-check.
+% \begin{macrocode}
+\newcommand\caption@slc[4]{%
+ \caption@Debug{Begin SLC}%
+ \singlelinecaptiontrue
+ \begingroup
+ \caption@singleline
+ \let\caption@hj\@empty
+ \caption@calcmargin % calculate \captionwidth
+ \caption@prepareslc
+ \sbox\@tempboxa{\caption@@@make{#1}{#2}}%
+ \ifdim\wd\@tempboxa>\captionwidth
+ \endgroup
+ \singlelinecaptionfalse
+ #4%
+ \else
+ \endgroup
+ #3%
+ \fi
+ \caption@Debug{End SLC}}
+% \end{macrocode}
+% \begin{macrocode}
+\newif\ifsinglelinecaption
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@singleline{%
+ \caption@xsetup\caption@opt@singleline
+ \let\caption@fmt\caption@slfmt}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@prepareslc}
+% \changes{v1.0b}{2004/05/16}{Bugfix: Redefinition of \cs{label} \& \cs{@footnotetext} added}
+% \changes{v1.0b}{2004/05/16}{Redefine \cs{stepcounter} instead of \cs{footnote(mark)}}
+% \changes{v1.0c}{2005/02/12}{\cs{let}\cs{caption@hj}\cs{relax} added}
+% \changes{v1.0f}{2005/07/09}{Support of \package{endnotes} package added}
+% \changes{v1.1}{2007/06/13}{\cs{let}\cs{caption@hj}\cs{relax} moved to \cs{caption@slc}}
+% \changes{v1.1}{2007/06/13}{Redefinition of \cs{(H@)refstepcounter} added}
+% \changes{v1.1}{2007/08/12}{Redefinition of \cs{label} improved}
+% \changes{v1.1c}{2007/10/06}{Definition of \cs{caption@l@stepcounter} added}
+% \changes{v1.3}{2011/07/07}{Bugfix 11-07-06: Redefinition of \cs{footnote} and \cs{footnotemark} added, redefinition of \cs{stepcounter} and \cs{refstepcounter} dropped}
+% \changes{v1.4a}{2011/10/21}{Redefinition of \cs{pagenote} from \textsf{memoir} document class added}
+% \changes{v1.4a}{2011/10/22}{Redefinition of \cs{footnote} revised}
+% \changes{v1.5}{2013/04/13}{Redefinition os \cs{glsunset} added}
+% \changes{v1.8}{2018/01/21}{Redefinition of \cs{endnote} added (thanks to Markus Kohm)}
+% \changes{v1.8}{2018/05/16}{Redefinition of \cs{acused} added}
+% \changes{v1.8}{2018/05/26}{Definition method changed so it can be pre-defined by other packages}
+% \changes{v1.8}{2018/05/27}{Redefinition of \cs{hypertarget} added}
+% \changes{v1.12b}{2020/07/20}{Special adaption to \class{beamer} added}
+% |\caption@prepareslc|\par
+% Re-define anything which would disturb the single-line-check.
+% \begin{macrocode}
+\providecommand*\caption@prepareslc{}
+\g@addto@macro\caption@prepareslc{%
+ \let\label\caption@gobble
+ \let\hypertarget\@gobbletwo
+% \end{macrocode}
+% We re-define \cs{footnote} so
+% \begin{enumerate}
+% \item The footnote counter will not be increased twice (but still the correct footnote mark will be used within the single-line-check)
+% \item The footnote text will not be evaluated twice
+% \end{enumerate}
+% \begin{macrocode}
+ \let\caption@footnote@ORI\footnote
+ \def\footnote{\caption@withoptargs\caption@footnote}%
+ \let\caption@footnotemark@ORI\footnotemark
+ \def\footnotemark{\caption@withoptargs\caption@footnotemark}%
+ \let\caption@footnotetext@ORI\@footnotetext
+ \let\@footnotetext\caption@gobble
+% \end{macrocode}
+% Same for \cs{endnote}
+% \begin{macrocode}
+ \let\caption@endnote@ORI\endnote
+ \def\endnote{\caption@withoptargs\caption@endnote}%
+ \let\caption@endnotemark@ORI\endnotemark
+ \def\endnotemark{\caption@withoptargs\caption@endnotemark}%
+ \let\caption@endnotetext@ORI\@endnotetext
+ \let\@endnotetext\caption@gobble
+% \end{macrocode}
+% \begin{macrocode}
+ \let\pagenote\caption@gobble
+% \end{macrocode}
+% Adaption to the \package{acronym} package\par
+% See also \url{https://tex.stackexchange.com/questions/428788}
+% \begin{macrocode}
+ \let\acused\@gobble
+ \let\AC@placelabel\@gobble
+% \end{macrocode}
+% Adaption to the \package{glossaries} package.\par
+% Please note that while this adaption is usually sufficient
+% it could give incorrect measuring results if \cs{gls} is both used
+% for the very first time and more than once (for a particular acronym).
+% The alternative would be using internal macros of the
+% \package{glossaries} package which I would like to avoid.\par
+% See also \url{https://tex.stackexchange.com/questions/108368}
+% \begin{macrocode}
+ \let\glsunset\@gobble
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@footnote[2]{%
+ \caption@footnotemark{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@footnotemark[1]{%
+ \begingroup
+ \let\stepcounter\caption@l@stepcounter
+ \caption@footnotemark@ORI#1\relax
+ \endgroup}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@endnote[2]{%
+ \caption@endnotemark{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@endnotemark[1]{%
+ \begingroup
+ \let\stepcounter\caption@l@stepcounter
+ \caption@endnotemark@ORI#1\relax
+ \endgroup}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@l@stepcounter[1]{%
+ \advance\csname c@#1\endcsname\@ne\relax}
+% \end{macrocode}
+% The patch above assumes that the optional arguments of \cs{footnote} and
+% \cs{footnotemark} match. Since this is not the case in \class{beamer} based documents,
+% and since \class{beamer} extents the syntax of \cs{footnote} in a special way,
+% we need a special patch here.\par
+% \emph{Note:} For this patch we assume that \cs{footnote} will always end with the usage of
+% \cs{beamer@footnotetext}. (Unfortunately \cs{footnote} is defined too monolithic
+% in \class{beamer} to offer a less dirty patch.)
+% \begin{macrocode}
+\caption@ifclassloaded{beamer}{%
+ \g@addto@macro\caption@prepareslc{%
+ \def\footnote{%
+ \begingroup
+ \let\stepcounter\caption@l@stepcounter
+ \renewcommand<>\beamer@framefootnotetext[1]{%
+ \endgroup}%
+ \let\@footnotetext\beamer@framefootnotetext
+ \caption@footnote@ORI}}}{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@applyfont}
+% \changes{v1.3}{2010/09/04}{This macro added}
+% |\caption@applyfont|\par
+% This macro executes the font relevant macros, i.e. by default
+% the options set by |justification=|, |font=|, and |size=|.
+% \begin{macrocode}
+\newcommand*\caption@applyfont{%
+ \caption@hj\captionfont\captionsize}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@@make}
+% \changes{v1.0b}{2004/05/16}{Bugfix 04-05-06: \cs{allowhyphens} added}
+% \changes{v1.0c}{2005/02/12}{Bugfix 04-12-16: Use some kind of
+% \cs{@startstrut}\cs{strutbox} instead of \cs{strut}}
+% \changes{v1.0c}{2005/02/12}{Bugfix 05-01-23: \cs{@finalstrut}\cs{strutbox} added}
+% \changes{v1.0d}{2005/05/05}{Use \cs{caption@ifempty};
+% \cs{let}\cs{caption@ifstrut}\cs{@secondoftwo} added}
+% \changes{v1.0d}{2005/05/05}{Bugfix: Handling of \cs{ifcaption@star} changed}
+% \changes{v1.0f}{2005/08/24}{Check for empty label added}
+% \changes{v1.0f}{2005/08/25}{\cs{caption@iflf} added}
+% \changes{v1.0j}{2007/02/18}{Usage of \cs{caption@tfmt} added}
+% \changes{v1.1}{2007/05/07}{Bugfix: \cs{ifhmode} added to \cs{@finalstrut}}
+% \changes{v1.2}{2007/11/17}{Made option \opt{size=} stronger than \opt{font=}}
+% \changes{v1.3}{2010/09/04}{Uses \cs{caption@applyfont} now}
+% \changes{v1.3}{2010/11/01}{Bugfix: If the caption text is empty, the text format will be set to \opt{simple} now}
+% \changes{v1.7}{2016/02/01}{Bugfix: \cs{relax} added before \cs{caption@lsep} so the label separator
+% will not be gobbled if the label font command ignores spaces, e.g. by usage of \cs{color}}
+% \changes{v1.8}{2018/09/12}{\cs{par} replaced by \cs{captiontextend}}
+% |\caption@@@make|\marg{caption label}\marg{caption text}\par
+% This one finally typesets the caption paragraph, without margin and indention.
+% \begin{macrocode}
+\newcommand\caption@@@make[2]{%
+% \end{macrocode}
+%
+% If the label is empty, we use no caption label separator.
+% \begin{macrocode}
+ \sbox\@tempboxa{#1}%
+ \ifdim\wd\@tempboxa=\z@
+ \let\caption@lsep\relax
+% \@capbreakfalse
+ \fi
+% \end{macrocode}
+%
+% If the text is empty, we use no caption label separator, too.
+% (And no text format either.)
+% \begin{macrocode}
+ \caption@ifempty{#2}{%
+ \let\caption@lsep\@empty
+ \let\caption@tfmt\@firstofone
+% \@capbreakfalse
+% \let\caption@ifstrut\@secondoftwo
+ }%
+% \end{macrocode}
+%
+% Take care that |\caption@parindent| and |\caption@hangindent| will be used
+% to typeset the paragraph.
+% \begin{macrocode}
+ \@setpar{\@@par\caption@@par}\caption@@par
+% \end{macrocode}
+%
+% Finally typeset the caption.
+% \begin{macrocode}
+ \caption@applyfont
+ \caption@fmt
+ {\ifcaption@star\else
+ \begingroup
+ \captionlabelfont
+ #1%
+ \endgroup
+ \fi}%
+ {\ifcaption@star\else
+ \begingroup
+ \caption@iflf\captionlabelfont
+ \relax\caption@lsep
+ \endgroup
+ \fi}%
+ {{\captiontextfont
+ \captiontextstart
+ \caption@ifstrut
+ {\vrule\@height\ht\strutbox\@width\z@}%
+ {}%
+ \nobreak\hskip\z@skip % enable hyphenation
+ \caption@tfmt{#2}%
+% \caption@ifstrut{\vrule\@height\z@\@depth\dp\strutbox\@width\z@}{}%
+ \caption@ifstrut
+ {\ifhmode\@finalstrut\strutbox\fi}%
+ {}%
+ \captiontextend}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\captiontextstart{}
+\newcommand*\captiontextend{\par}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifempty}
+% \changes{v1.0d}{2005/05/05}{This macro added}
+% \changes{v1.1}{2007/07/04}{Re-defines itself now}
+% \changes{v1.2a}{2007/01/22}{Revised so \cs{label} will be detected, too}
+% \changes{v1.2b}{2008/08/02}{Revised so \cs{index} and \cs{glossary} will be detected, too}
+% |\caption@ifempty|\marg{text}\marg{true} (\emph{no} \meta{false})\par
+% This one tests if the \meta{text} is actually empty.
+% \Note{This will be done without expanding the text,
+% therefore this is far away from being bullet-proof.}
+% \Note{This macro is re-defining itself so only
+% the first test (in a group) will actually be done.}
+% \begin{macrocode}
+\newcommand\caption@ifempty[1]{%
+ \caption@if@empty{#1}%
+ \caption@ifempty\@unused}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@if@empty[1]{%
+ \def\caption@tempa{#1}%
+ \ifx\caption@tempa\@empty
+ \let\caption@ifempty\@secondoftwo
+ \else
+ \expandafter\def\expandafter\caption@tempa\expandafter{%
+ \caption@car#1\caption@if@empty\caption@nil}%
+ \def\caption@tempb{\caption@if@empty}%
+ \ifx\caption@tempa\caption@tempb
+ \let\caption@ifempty\@secondoftwo
+ \else
+ \def\caption@tempb{\ignorespaces}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\caption@if@empty\expandafter{\@gobble#1}%
+ \else
+ \def\caption@tempb{\label}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
+ \else
+ \def\caption@tempb{\index}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
+ \else
+ \def\caption@tempb{\glossary}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
+ \else
+ \let\caption@ifempty\@gobbletwo
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@car#1#2\caption@nil{#1}% same as \@car, but \long
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@par}
+% \changes{v1.0f}{2005/08/22}{Made this definition global}
+% |\caption@@par|\par
+% This command will be executed with every |\par| inside the caption.
+% \begin{macrocode}
+\newcommand*\caption@@par{%
+ \parindent\caption@parindent\hangindent\caption@hangindent}%
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Types \& sub-types}
+%
+% \begin{macro}{\DeclareCaptionType}
+% \changes{v1.1}{2007/08/12}{This macro added}
+% \changes{v1.1a}{2007/09/07}{Three optional arguments added}
+% \changes{v1.2}{2007/12/06}{Renamed from \cs{DeclareFloatingEnvironment} to \cs{DeclareCaptionType}}
+% \changes{v1.2}{2007/12/21}{Optional argument revised, uses key-value syntax now}
+% \changes{v1.2b}{2008/04/13}{Uses \cs{caption@within@default} now}
+% \changes{v1.2b}{2008/08/02}{Support of \cs{float@exts} and \cs{float@addtolists} added}
+% \changes{v1.2e}{2010/01/09}{Usage of \cs{caption@DeclareWithinOption} added}
+% \changes{v1.3}{2011/08/06}{Definition of \cs{listofXXXes} added}
+% \changes{v1.4a}{2011/10/29}{Outsourced to \package{newfloat} package}
+% |\DeclareCaptionType|\oarg{options}\marg{environment}\oarg{name}\oarg{list name}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionType{%
+ \caption@loadpackage{newfloat}{}%
+ \DeclareFloatingEnvironment}
+\@onlypreamble\DeclareCaptionType
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ForEachCaptionType}
+% \changes{v1.4a}{2011/10/29}{This macro added}
+% \changes{v1.13}{2020/07/29}{Renamed from \cs{caption@ForEachType} to \cs{ForEachCaptionType} and starred variant added}
+% |\ForEachCaptionType|\marg{code with \#1}\\
+% |\ForEachCaptionType*|\marg{code with \#1}\par
+% will execute the given code for each (known) floating environment.
+% The starred variant will only work for already existing environments,
+% i.e.~no hook will be placed inside |\Declare|\-|Floating|\-|Environment|
+% (offered by the \package{newfloat} package).
+% \begin{macrocode}
+\newcommand*\ForEachCaptionType{%
+ \@ifstar
+ {\caption@foreach@type\@gobble}%
+ {\caption@foreach@type\@iden}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@foreach@type[2]{%
+ \caption@ifdefined\ForEachFloatingEnvironment
+ {\ForEachFloatingEnvironment*{#2}}%
+ {\def\@elt##1{#2}%
+ \caption@ifdefined\c@figure\@elt\@gobble{figure}%
+ \caption@ifdefined\c@table\@elt\@gobble{table}%
+ \let\@elt\relax}%
+ #1{\newfloat@addtohook{#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newfloat@addtohook}
+% |\newfloat@addtohook|\marg{code with \#1}\par
+% adds code to the hook called in |\Declare|\-|Floating|\-|Environment|.\par
+% Note: We use |\provide|\-|command| instead of |\new|\-|command| here since the
+% exact same code is defined in the \package{newfloat} package.
+% \begin{macrocode}
+\providecommand\newfloat@addtohook[1]{%
+ \toks@=\expandafter{\newfloat@hook{##1}#1}%
+ \edef\@tempa{\def\noexpand\newfloat@hook####1{\the\toks@}}%
+ \@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newfloat@hook}
+% Hook used in |\Declare|\-|Floating|\-|Environment|.
+% \begin{macrocode}
+\providecommand*\newfloat@hook[1]{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionSubType}
+% \changes{v1.2}{2007/11/16}{This macro added}
+% \changes{v1.2a}{2008/03/11}{Bugfix: \cs{subfigurename} will be defined now}
+% \changes{v1.2d}{2009/10/09}{Bugfix 08-10-01: Usage of \cs{caption@addtoreset} added}
+% \changes{v1.3}{2011/01/01}{\cs{@dottedlofline} will be defined \& used now}
+% \changes{v1.4}{2011/10/09}{Support of the titletoc package added}
+% \changes{v1.5}{2011/12/29}{Usage of \cs{caption@addtoreset} replaced by \cs{@addtoreset}}
+% \changes{v1.5}{2013/01/10}{Bugfix: Definition of autoref string corrected}
+% \changes{v1.6}{2013/06/17}{Bugfix: \cs{c@tocdepth} will be set (locally) now}
+% \changes{v1.8g}{2020/01/02}{Check revised if the sub-type is already defined or not}
+% \changes{v1.13}{2020/07/28}{Uses \cs{caption@l@addto@list} instead of \cs{@cons} now}
+% \changes{v1.13}{2020/07/29}{Usage of \cs{caption@subtype@hook} added}
+% \changes{v1.13}{2020/07/29}{We don't re-use existing counters anymore (This was a bad idea anyway)}
+% |\DeclareCaptionSubType|\oarg{numbering scheme}\marg{type}\\
+% |\DeclareCaptionSubType*|\oarg{numbering scheme}\marg{type}\par
+% The starred variant provides the numbering format
+% \meta{type}|.|\meta{subtype} while the non-starred variant simply
+% uses \meta{subtype}.
+% \begin{macrocode}
+\newcommand*\DeclareCaptionSubType{%
+ \caption@teststar\caption@declaresubtype\@firstoftwo\@secondoftwo}
+\@onlypreamble\DeclareCaptionSubType
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declaresubtype[1]{%
+ \@testopt{\caption@@declaresubtype{#1}}{alph}}
+\@onlypreamble\caption@declaresubtype
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@declaresubtype#1[#2]#3{%
+ \@ifundefined{c@#3}%
+ {\caption@Error{No float type '#3' defined}}%
+ {\caption@@@declaresubtype{#1}{#2}{#3}{sub#3}}}
+\@onlypreamble\caption@@declaresubtype
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@declaresubtype[4]{%
+% \end{macrocode}
+% \begin{macrocode}
+% Check if the sub-type was already defined by |\Declare|\-|Sub|\-|Type|.
+% If not, define the counter and list entry.
+% \begin{macrocode}
+ \caption@ifin@list\caption@subtypelist{#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}}%
+% \end{macrocode}
+% Support of \package{titletoc} package
+% \begin{macrocode}
+ \caption@ifdefined\contentsuse{%
+ \contentsuse{#4}{\csname ext@#4\endcsname}}{}%
+% \end{macrocode}
+% \begin{macrocode}
+ \@namedef{#4name}{}%
+ \@namedef{#4autorefname}{\csname #3autorefname\endcsname}%
+ #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}}}
+% \end{macrocode}
+% \begin{macrocode}
+\@onlypreamble\caption@@@declaresubtype
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declaresublistentry{%
+ \caption@ifdefined\l@chapter
+ {\caption@@declaresublistentry\l@subsection}%
+ {\caption@@declaresublistentry\l@subsubsection}}
+\@onlypreamble\caption@declaresublistentry
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@declaresublistentry[2]{%
+ \ifx#1\@undefined
+ \caption@@@declaresublistentry\relax\@dottedtocline\caption@nil{#2}%
+ \else
+ \expandafter\caption@@@declaresublistentry#1{}{}\@dottedtocline\caption@nil{#2}%
+ \fi}
+\@onlypreamble\caption@@declaresublistentry
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@@declaresublistentry#1\@dottedtocline#2\caption@nil#3{%
+ \def\@tempa{#1}%
+% Does \l@(sub)subsection start with \@dottedtocline?
+ \ifx\@tempa\@empty
+% Yes
+ \caption@@@@declaresublistentry{#3}#2\caption@nil
+ \else
+% No
+ \caption@@@@declaresublistentry{#3}@{3.8em}{3.2em}\caption@nil
+ \fi}
+\@onlypreamble\caption@@@declaresublistentry
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@@@declaresublistentry#1#2#3#4#5\caption@nil{%
+ \expandafter\caption@@@@@declaresublistentry\expandafter
+ {\csname @dotted\csname ext@#1\endcsname line\endcsname}{#1}{#3}{#4}}
+\@onlypreamble\caption@@@@declaresublistentry
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@@@declaresublistentry[4]{%
+ \@namedef{l@sub#2}{#1{2}{#3}{#4}}%
+ \expandafter\caption@@@@@@declaresublistentry
+ \expandafter#1\expandafter{\csname ext@#2\endcsname depth}}
+\@onlypreamble\caption@@@@@declaresublistentry
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@@@@declaresublistentry[2]{
+ \ifx#1\relax
+ \def#1##1{%
+ \def\next{\@dottedtocline{##1}}%
+ \@ifundefined{c@#2}{}{%
+ \ifnum ##1>\@nameuse{c@#2}\relax
+ \let\next\@gobblefour
+ \else
+ \c@tocdepth=\@nameuse{c@#2}\relax
+ \fi}%
+ \next}%
+ \fi}
+\@onlypreamble\caption@@@@@@declaresublistentry
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@subtypelist}
+% A list containing the sub-types defined with |\Declare|\-|Caption|\-|Sub|\-|Type|.
+% \begin{macrocode}
+\newcommand*\caption@subtypelist{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifsubtype}
+% \changes{v1.8g}{2020/01/02}{This macro added}
+% \changes{v1.13}{2020/07/28}{Uses \cs{caption@ifin@list} now}
+% This macro checks if the given subtype was defined
+% with |\Declare|\-|Caption|\-|Sub|\-|Type|.
+% \begin{macrocode}
+\newcommand*\caption@ifsubtype{%
+ \caption@ifin@list\caption@subtypelist}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ForEachCaptionSubType}
+% \changes{v1.13}{2020/07/29}{This macro added as replacement for \cs{caption@For}}
+% |\ForEachCaptionSubType|\marg{code with \#1}\\
+% |\ForEachCaptionSubType*|\marg{code with \#1}\par
+% will execute the given code for each (known) sub-type.
+% The starred variant will only work for already existing sub-types,
+% i.e.~no hook will be placed inside |\Declare|\-|Caption|\-|Sub|\-|Type|.
+% \begin{macrocode}
+\newcommand*\ForEachCaptionSubType{%
+ \@ifstar
+ {\caption@foreach@subtype\@gobble}%
+ {\caption@foreach@subtype\@iden}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@foreach@subtype[2]{%
+ \caption@for@list\caption@subtypelist{#2}%
+ #1{\caption@addto@subtype@hook{#2}}}
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand\caption@addto@subtype@hook[1]{%
+ \toks@=\expandafter{\caption@subtype@hook{##1}#1}%
+ \edef\@tempa{\def\noexpand\caption@subtype@hook####1{\the\toks@}}%
+ \@tempa}
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\caption@subtype@hook[1]{}
+% \end{macrocode}
+% \end{macro}
+%
+% Unfortunately the \class{memoir} document class resets the
+% \texttt{subfigure} resp.~\texttt{subtable} counter at the begin
+% of floating environments, i.e.~at |\@float|.
+% As a side-effect |\continued|\-|float| does not work correctly.
+% For that reason we need to introduce macros to save and restore
+% all sub-caption counters here.
+%
+% \begin{macro}{\caption@savesubcounters}
+% \changes{v1.5}{2013/05/01}{This macro added}
+% \changes{v1.13}{2020/07/28}{Uses \cs{caption@for@list} now for iterating the list}
+% |\caption@save|\-|sub|\-|counters| saves all sub-caption counters,
+% so they can be restored with |\caption@restore|\-|counters| later on.
+% \begin{macrocode}
+\newcommand*\caption@savesubcounters{%
+ \caption@for@list\caption@subtypelist{\caption@savecounter{##1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@savecounter}
+% \changes{v1.5}{2013/05/01}{This macro added}
+% |\caption@save|\-|counter|\marg{counter} saves the given counter,
+% so it can be restored with |\caption@restore|\-|counters| later on.
+% \begin{macrocode}
+\newcommand*\caption@savecounter[1]{%
+ \edef\caption@tempa{%
+ \noexpand\l@addto@macro\noexpand\caption@restore@counters
+ {\noexpand\setcounter{#1}{\number\value{#1}}}}%
+ \caption@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@restorecounters}
+% \changes{v1.5}{2013/05/01}{This macro added}
+% |\caption@restore|\-|counters| restores all counters saved with
+% |\caption@save|\-|counter|.
+% \begin{macrocode}
+\newcommand*\caption@restorecounters{%
+ \caption@restore@counters
+ \global\let\caption@restore@counters\@empty}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@restore@counters{}
+% \end{macrocode}
+% \end{macro}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \clearpage
+% \begin{thebibliography}{99}
+% \bibitem{TLC2}
+% Frank Mittelbach and Michel Goossens:\\
+% \newblock {\em The {\LaTeX} Companion (2nd.~Ed.)},\\
+% \newblock Addison-Wesley, 2004.
+%
+% \bibitem{Anne}
+% Anne Br\"uggemann-Klein:\\
+% \emph{Einf\"uhrung in die Dokumentverarbeitung},\\
+% B.G. Teubner, Stuttgart, 1989
+%
+% \bibitem{hyperref}
+% Sebastian Rahtz \& Heiko Oberdiek:\\
+% \href{http://www.ctan.org/pkg/hyperref}%
+% {\emph{Hypertext marks in \LaTeX}},\\
+% November 12, 2007
+%
+% \bibitem{refcount}
+% Heiko Oberdiek:\\
+% \href{http://www.ctan.org/pkg/refcount}%
+% {\emph{The refcount package}},\\
+% 2006/02/20
+%
+% \bibitem{threeparttable}
+% Donald Arseneau:\\
+% \href{http://www.ctan.org/pkg/threeparttable}%
+% {\emph{Three part tables: title, tabular environment, notes}},\\
+% 2003/06/13
+% \end{thebibliography}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/caption/fallback/v3.5/caption.dtx b/Master/texmf-dist/source/latex/caption/fallback/v3.5/caption.dtx
new file mode 100644
index 00000000000..c573255554c
--- /dev/null
+++ b/Master/texmf-dist/source/latex/caption/fallback/v3.5/caption.dtx
@@ -0,0 +1,4292 @@
+% \iffalse meta-comment
+%
+% This is file `caption.dtx'.
+%
+% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%
+% --------------------------------------------------------------------------
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Axel Sommerfeldt.
+%
+% This work consists of the files
+% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
+% the derived files
+% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
+% and the user manuals
+% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+%
+% \fi
+% \CheckSum{2692}
+%
+% \iffalse
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption.drv}[2020/10/11 v3.5 Implementation of the caption package]
+\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
+%\errorcontextlines=3
+%
+\documentclass{ltxdoc}
+\setlength\parindent{0pt}
+\setlength\parskip{\smallskipamount}
+%
+\makeatletter % make room for subsections like 2.16.14 in the TOC
+%\newcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
+\renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.7em}}
+\makeatother
+%
+\usepackage{ifpdf}
+\ifpdf
+ \usepackage{mathptmx,courier}
+ \usepackage[scaled=0.90]{helvet}
+ \addtolength\marginparwidth{15pt}
+\fi
+%
+\usepackage{hypdoc}
+\ifpdf\usepackage{hypdestopt}\fi
+\hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}}
+%
+\usepackage[debug]{caption}[2013/01/01]
+%
+\DeclareRobustCommand*\eTeX{\texorpdfstring
+ {\leavevmode\hbox{$\varepsilon$}-\TeX}%
+ {e-TeX}}
+%
+\begin{document}
+ \DocInput{caption.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \newcommand*\purerm[1]{\texorpdfstring{{\upshape\mdseries\rmfamily #1}}{#1}}
+% \newcommand*\puresf[1]{\texorpdfstring{{\upshape\mdseries\sffamily #1}}{#1}}
+% \newcommand*\purett[1]{\texorpdfstring{{\upshape\mdseries\ttfamily #1}}{#1}}
+% \let\class\puresf \let\package\puresf
+% \let\env\purett \let\opt\purett
+%
+% \def\thispackage{the \package{caption} package}
+% \def\Thispackage{The \package{caption} package}
+%
+% \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
+% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
+% \newcommand*\version[2][]{v$#2$}
+%
+% \newcommand*\issue[1]{GitLab~\##1}
+%
+% \GetFileInfo{caption.drv}
+% \let\docdate\filedate
+% \let\docversion\fileversion
+% \GetFileInfo{caption.sty}
+%
+% \title{The Implementation of
+% \texorpdfstring{\thispackage\thanks{%^^A
+% This package has version number \docversion.}}%^^A
+% {the caption package}}
+% \author{Axel Sommerfeldt\\
+% \url{https://gitlab.com/axelsommerfeldt/caption}}
+% \date{\docdate}
+% \maketitle
+%
+% \begin{abstract}
+% \Thispackage\ consists of two parts -- the kernel
+% (|caption3.sty|) and the main package (|caption.sty|).
+%
+% \Thispackage\ redefines the \LaTeX\ commands
+% |\caption|, |\@caption|, and |\@makecaption| and maps the latter one to
+% |\caption@@make|, giving the user the possibility to control the look \& feel
+% of the captions from floating environments like |figure| and |table|.
+% Furthermore it does similar to the caption stuff coming from other packages
+% (like the \package{longtable} or \package{supertabular} package):
+% Mapping the appropriate internal commands (like |\LT@makecaption| or
+% |\ST@caption|) to the ones offered by the \package{caption3} kernel.
+% So you can think of \thispackage\ as a layer package, it
+% simply provides adaptation layers between the caption stuff coming from
+% \LaTeXe\ or packages, and the caption stuff offered by the
+% \package{caption3} kernel.
+% \end{abstract}
+%
+% \section*{User manual}
+%
+% This document is describing the code implementation only.
+% The user documentation can be found in
+% \nopagebreak\begin{quote}
+% \begin{tabular}{ll}
+% \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-eng.pdf}%
+% {\texttt{caption-eng.pdf}} & The English documentation \\
+% \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-rus.pdf}%
+% {\texttt{caption-rus.pdf}} & The Russian documentation\footnotemark \\
+% \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-deu.pdf}%
+% {\texttt{caption-deu.pdf}} & The German documentation \\
+% \end{tabular}
+% \footnotetext{Thanks a lot to Olga Lapko for this translation}
+% \end{quote}
+%
+% \pagebreak[4]
+% \section*{Internal commands}
+%
+% These internal commands are save to use by other packages as well
+% since their interface will not change in future releases:
+% \begin{quote}\begin{tabular}{ll}
+% Internal command & Currently used by \\
+% \hline
+% |\caption@kernel@addcontentsline| & \package{floatrow} \\
+% |\caption@makecaption| & \package{bidi} \\
+% |\caption@settype| & \package{newfloat} \\
+% |\caption@setsubtype| & \package{floatrow} \\
+% |\caption@starfalse| & \package{bidi} \\
+% |\caption@startrue| & \package{bidi} \\
+% |\caption@xlabel| & \package{cleveref} \\
+% \end{tabular}\end{quote}
+%
+% If your package wants to use any other internal command of the \package{caption} package,
+% please write me an e-mail so we can define a proper interface together.
+%
+% The \package{lwarp} package uses a lot of internal commands as well,
+% but we are working on it on the Git branch \texttt{feature/lwarp}:
+% \url{https://gitlab.com/axelsommerfeldt/caption/-/tree/feature/lwarp}
+%
+% \StopEventually{}
+% \clearpage
+% \tableofcontents
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \DoNotIndex{\\,\_,\ ,\@@par}
+% \DoNotIndex{\@bsphack}
+% \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
+% \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
+% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
+% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
+% \DoNotIndex{\if@minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@minipagefalse,\@minipagetrue}
+% \DoNotIndex{\@namedef,\@nameuse}
+% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
+% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setminipage,\@setpar}
+% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
+% \DoNotIndex{\@testopt}
+% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
+% \DoNotIndex{\p@,\z@}
+% \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
+% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
+% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
+% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
+% \DoNotIndex{\fi,\footnotesize,\global}
+% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
+% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
+% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
+% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
+% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
+% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
+% \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
+% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
+% \DoNotIndex{\providecommand,\quad}
+% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
+% \DoNotIndex{\rightskip,\rmfamily}
+% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
+% \DoNotIndex{\small,\string,\space,\strut}
+% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
+% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
+% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
+% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
+% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
+% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
+% \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \setlength{\parskip}{0pt plus 1pt}
+% \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
+%
+% \changes{v1.0}{1994/10/27}{First release}
+% \changes{v1.1}{1994/11/03}{New option \texttt{centerlast}}
+% \changes{v1.2}{1994/11/28}{Support of the \package{float} package}
+% \changes{v1.3}{1995/01/09}{Support of \cs{captionlabelfont} in subcaptions}
+% \changes{v1.4}{1995/01/30}{New option \texttt{nooneline}}
+% \changes{v1.4b}{1995/04/05}{Bugfix release}
+% \changes{v3.0}{2003/12/20}{Rewritten; many new commands and features}
+% \changes{v3.0d}{2004/11/28}{Split into two packages: \package{caption} \& \package{caption3}}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+%
+% \iffalse
+%<*package>
+% \fi
+%
+% \section{Identification}
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesPackage{caption}[2020/10/26 v3.5g Customizing captions (AR)]
+% \end{macrocode}
+%
+% \section{Loading the kernel}
+%
+% \begin{macrocode}
+\RequirePackage{caption3}[=2020/10/06] % needs v2.2b or newer
+% \end{macrocode}
+%
+% \section{Check against unknown document classes}
+%
+% \begin{macrocode}
+\caption@ifbool{documentclass}{}{%
+ \caption@WarningNoLine{%
+ Unknown document class (or package),\MessageBreak
+ standard defaults will be used}}
+% \end{macrocode}
+%
+% \section{Check against incompatible packages}
+%
+% \changes{v3.0p}{2007/04/06}{Check against obsolete \package{caption2} package added}
+% \begin{macrocode}
+\@ifpackageloaded{caption2}{%
+ \caption@Error{%
+ You can't use both, the (obsolete) caption2 *and*\MessageBreak
+ the (current) caption package}%
+ \endinput
+}{}
+% \end{macrocode}
+%
+% \changes{v3.1}{2007/06/15}{Check against incompatible \package{ftcap} package added}
+% \changes{v3.1}{2007/06/15}{Check against incompatible \package{nonfloat} package added}
+% \changes{v3.1}{2007/06/18}{Check against incompatible \package{topcapt} package added}
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \@ifpackageloaded{ftcap}{\caption@DisablePositionOption{ftcap}}{}%
+ \@ifpackageloaded{nonfloat}{\caption@DisablePositionOption{nonfloat}}{}%
+ \@ifpackageloaded{topcapt}{\caption@DisablePositionOption{topcapt}}{}}
+% \end{macrocode}
+% \begin{macro}{\caption@DisablePositionOption}
+% \changes{v3.1g}{2008/03/20}{\texttt{position=b} added}
+% \changes{v3.1h}{2008/03/29}{%
+% Name changed from \cs{caption@IncompatiblePackage} to \cs{caption@DisablePositionOption};
+% disables the `position' option now instead of issuing a warning}
+% |\caption@DisablePositionOption|\marg{package}\par
+% disables the `position' option.
+% \begin{macrocode}
+\newcommand*\caption@DisablePositionOption[1]{%
+ \caption@InfoNoLine{%
+ `#1' package detected; setting `position=b' for compatibility reasons}%
+ \caption@setposition b%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionOption{position}{%
+ \caption@Error{Usage of the `position' option is incompatible\MessageBreak
+ to the `#1' package}}}
+% \end{macrocode}
+% \begin{macrocode}
+\@onlypreamble\caption@DisablePositionOption
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Declaration of options}
+%
+% \subsection{Miscellaneous options}
+%
+% \begin{macrocode}
+\DeclareCaptionOption*{config}[caption]{%
+ \InputIfFileExists{#1.cfg}%
+ {\typeout{*** Local configuration file #1.cfg used ***}}%
+ {\caption@Warning{Configuration file #1.cfg not found}}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@selectlistentry}
+% \changes{v3.2}{2010/11/07}{This macro added}
+% |\caption@selectlistentry|\marg{\purett{heading} or \purett{entry}}
+% \begin{macrocode}
+\newcommand*\caption@selectlistentry[1]{%
+ \caption@ifinlist{#1}{heading}{%
+ \let\caption@iflistheading\@firstoftwo
+ }{\caption@ifinlist{#1}{default,list-entry,entry}{%
+ \let\caption@iflistheading\@secondoftwo
+ }{%
+ \caption@Error{Undefined list-entry selection `#1'}%
+ }}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.3}{2012-03-25}{Option \opt{list-entry} added}
+% \begin{macrocode}
+\DeclareCaptionOption{list-entry}{\caption@selectlistentry{#1}}
+\captionsetup{list-entry=default}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@declparboxrestore}
+% \changes{v3.5g}{2020/10/26}{This macro added}
+% |\caption@declparboxrestore|\marg{name}\marg{code}
+% \begin{macrocode}
+% TODO: Remove \caption@declparboxrestore
+\newcommand\caption@declparboxrestore{%
+ \caption@decl{parboxrestore}}
+% \end{macrocode}
+% \begin{macrocode}
+\@onlypreamble\caption@declparboxrestore
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setparboxrestore}
+% \changes{v3.2}{2010/11/07}{This macro added}
+% \changes{v3.5g}{2020/10/26}{New implementation; default changed from `partial' to `full'}
+% |\caption@setparboxrestore|\marg{\purett{partial} or \purett{full}}
+% \begin{macrocode}
+% TODO: Remove \caption@setparboxrestore
+\newcommand*\caption@setparboxrestore{%
+ \caption@set{parboxrestore}}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@declparboxrestore{full}{%
+ \@parboxrestore}
+% \end{macrocode}
+% The original code (from |latex/base/ltboxes.dtx|):
+% \begin{verbatim}
+% \def\@parboxrestore{\@arrayparboxrestore\let\\\@normalcr}
+% \def\@arrayparboxrestore{%
+% \let\if@nobreak\iffalse
+% \let\if@noskipsec\iffalse
+% \let\par\@@par
+% \let\-\@dischyph
+% \let\'\@acci\let\`\@accii\let\=\@acciii
+% \parindent\z@ \parskip\z@skip
+% \everypar{}%
+% \linewidth\hsize
+% \@totalleftmargin\z@
+% \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
+% \parfillskip\@flushglue \lineskip\normallineskip
+% \baselineskip\normalbaselineskip
+% \sloppy}
+% \end{verbatim}%^^A
+% This one will be used by |\@caption| instead of |\@parboxrestore|.
+% \begin{macrocode}
+\caption@declparboxrestore{partial}{%
+ \let\if@nobreak\iffalse
+ \let\if@noskipsec\iffalse
+ \let\par\@@par
+% \let\-\@dischyph
+% \let\'\@acci\let\`\@accii\let\=\@acciii
+ \parindent\z@ \parskip\z@skip
+ \everypar{}%
+% \linewidth\hsize
+% \@totalleftmargin\z@
+ \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
+ \parfillskip\@flushglue \lineskip\normallineskip
+ \baselineskip\normalbaselineskip
+ \sloppy
+ \let\\\@normalcr}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@parboxrestore@mini}
+% \changes{v3.2}{2010/10/24}{This macro added}
+% \changes{v3.5g}{2020/10/26}{Renamed from \cs{caption@boxrestore@mini} to \cs{caption@parboxrestore@mini}}
+% Resets |\par| so the very first |\par| in |\@caption| behaves quite the same as in floating environments.
+% Will be used by |\set|\-|caption|\-|type|.
+% \begin{macrocode}
+\caption@declparboxrestore{mini}{%
+ \let\par\@@par
+ \parindent\z@ \parskip\z@skip
+ \sloppy}
+% \end{macrocode}
+% \end{macro}
+%
+% `default' usually maps to `full'.
+% \changes{v3.5g}{2020/10/26}{The default of \cs{caption@parboxrestore} maps to `full' instead of `partial' now}
+% \begin{macrocode}
+\SetCaptionDefault{parboxrestore}{full}
+% \end{macrocode}
+%
+% \changes{v3.2}{2010/11/07}{Option \opt{parboxrestore} added}
+% \begin{macrocode}
+% TODO: Remove the (undocumentated) option "parboxrestore"
+\DeclareCaptionOption{parboxrestore}{\caption@setparboxrestore{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@parboxrestore}
+% \changes{v3.1}{2007/03/03}{This macro and its usage added}
+% \changes{v3.1b}{2007/09/17}{Bugfix: Redefinition of CR added}
+% \changes{v3.2}{2010/11/07}{Support of option \opt{parboxrestore} added}
+% \changes{v3.5g}{2020/10/26}{New implementation; renamed from \cs{caption@boxrestore} to \cs{caption@parboxrestore}}
+% \begin{macrocode}
+% TODO: Change definition to \def\caption@parboxrestore{\@parboxrestore}
+\captionsetup{parboxrestore=default}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.1f}{2007/11/28}{Option \opt{@minipage=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{@minipage}{%
+ \caption@ifinlist{#1}{auto,default}%
+ {\let\caption@if@minipage\@gobbletwo}%
+ {\caption@set@bool\caption@if@minipage{#1}}}
+\captionsetup{@minipage=default}
+% \end{macrocode}
+%
+% \subsection{caption v1.x compatibility options}
+% \changes{v3.1}{2007/07/21}{Option `compatibility' added}
+% \changes{v3.1}{2007/09/01}{caption v1.x compatibility options revised}
+% \changes{v3.1d}{2007/10/24}{Bugfix 07-10-24 in caption v1.x$ compatibility options}
+% \changes{v3.5a}{2020/09/02}{caption v1.x compatibility options fixed}
+%
+% Currently we support |v1| and |v3| as values for the |compatibility=| option.
+% But since this used to be a boolean option is the past we still support any boolean value
+% for compatibility reasons.
+%
+% \begin{macrocode}
+\DeclareCaptionOption{compatibility}[v1]{%
+ \caption@ifinlist{#1}{v1,1,true,yes,on}{%
+ \let\caption@ifcompatibility\@firstoftwo
+ }{\caption@ifinlist{#1}{v3,3,0,false,no,off}{%
+ \let\caption@ifcompatibility\@secondoftwo
+ }{%
+ \caption@Error{Undefined compatibility value `#1'}%
+ }}}
+\@onlypreamble@key{caption}{compatibility}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@setbool{compatibility}{0} % default: Try not to be compatible to v1.x
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setincompatible}
+% \changes{v3.4}{2019/09/09}{This macro added}
+% |\caption@setincompatible|\marg{condition}\marg{message text}
+% \begin{macrocode}
+\newcommand*\caption@setincompatible[2]{%
+ #1{%
+ \caption@WarningNoLine{%
+ #2;\MessageBreak
+ Setting compatibility to v1}%
+ \caption@setbool{compatibility}{1}%
+ }{}}
+% \end{macrocode}
+% \end{macro}
+%
+% Check against incompatible packages which used to work fine with v1 of the `caption' package.
+% \begin{macrocode}
+\caption@AtBeginDocument{\caption@ifcompatibility{}{%
+% \end{macrocode}
+% The usage of the (now obsolete) \package{captcont} package,
+% which brings its own definition of |\caption*|, was quite common in the old days.
+% \begin{macrocode}
+ \caption@setincompatible{\@ifpackageloaded{captcont}}{captcont package is loaded}%
+% \end{macrocode}
+% To be continued\ldots
+% \begin{macrocode}
+}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{normal}{%
+ \caption@setup{format=plain,justification=justified}}
+\DeclareCaptionOptionNoValue*{isu}{%
+ \caption@setup{format=hang,justification=justified}}
+\DeclareCaptionOptionNoValue*{hang}{%
+ \caption@setup{format=hang,justification=justified}}
+\DeclareCaptionOptionNoValue*{center}{%
+ \caption@setup{format=plain,justification=centering}}
+\DeclareCaptionOptionNoValue*{centerlast}{%
+ \caption@setup{format=plain,justification=centerlast}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{scriptsize}{\def\captionfont{\scriptsize}}
+\DeclareCaptionOptionNoValue*{footnotesize}{\def\captionfont{\footnotesize}}
+\DeclareCaptionOptionNoValue*{small}{\def\captionfont{\small}}
+\DeclareCaptionOptionNoValue*{normalsize}{\def\captionfont{\normalsize}}
+\DeclareCaptionOptionNoValue*{large}{\def\captionfont{\large}}
+\DeclareCaptionOptionNoValue*{Large}{\def\captionfont{\Large}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{up}{\caption@setup{labelfont+=up}}
+\DeclareCaptionOptionNoValue*{it}{\caption@setup{labelfont+=it}}
+\DeclareCaptionOptionNoValue*{sl}{\caption@setup{labelfont+=sl}}
+\DeclareCaptionOptionNoValue*{sc}{\caption@setup{labelfont+=sc}}
+\DeclareCaptionOptionNoValue*{md}{\caption@setup{labelfont+=md}}
+\DeclareCaptionOptionNoValue*{bf}{\caption@setup{labelfont+=bf}}
+\DeclareCaptionOptionNoValue*{rm}{\caption@setup{labelfont+=rm}}
+\DeclareCaptionOptionNoValue*{sf}{\caption@setup{labelfont+=sf}}
+\DeclareCaptionOptionNoValue*{tt}{\caption@setup{labelfont+=tt}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{nooneline}{\caption@setup{slc=0}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\caption@setbool{ruled}{0}
+\DeclareCaptionOptionNoValue*{ruled}{\caption@setbool{ruled}{1}}
+% \end{macrocode}
+%
+% \subsection{caption2 v2.x compatibility options}
+% \changes{v3.0h}{2005/07/08}{caption2 \version{2.x} compatibility options added}
+% \changes{v3.1}{2007/09/01}{caption2 v2.x compatibility options revised}
+% \changes{v3.1d}{2007/10/24}{Bugfix 07-10-24 in caption v2.x$ compatibility options}
+% \changes{v3.5a}{2020/09/02}{caption v2.x compatibility options fixed}
+%
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{flushleft}{%
+ \caption@setup{format=plain,justification=raggedright}}
+\DeclareCaptionOptionNoValue*{flushright}{%
+ \caption@setup{format=plain,justification=raggedleft}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{oneline}{\caption@setup{slc=1}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOptionNoValue*{ignoreLTcapwidth}{%
+ \caption@WarningNoLine{Obsolete option `ignoreLTcapwidth' ignored}}
+% \end{macrocode}
+%
+% \subsection{Obsolete caption v3.0 options}
+% \changes{v3.1}{2007/05/07}{Package option \opt{caption} marked as obsolete,
+% gives error now}
+%
+% \begin{macrocode}
+\DeclareCaptionOption*{caption}{%
+ \caption@setbool{temp}{#1}%
+ \caption@ifbool{temp}{}{%
+ \caption@Error{%
+ The package option `caption=#1' is obsolete.\MessageBreak
+ Please pass this option to the subfig package instead\MessageBreak
+ and do *not* load the caption package anymore}}}
+% \end{macrocode}
+%
+% \subsection{fltpage package support options}
+%
+% \changes{v3.1}{2007/09/01}{Options `FPlist' \& `FPref' added}
+% With these options is controlled where the list-of entry and |\ref| resp.
+% |\pageref| or |\autoref| will link to.
+% Defaults are |FPlist=caption| and |FPref=figure| which is inconsistent,
+% but compatible to the usual behaviour of the \package{fltpage} package.
+% \begin{macrocode}
+\DeclareCaptionOption{FPlist}[1]{\caption@setFPoption{list}{#1}}
+\DeclareCaptionOption{FPref}[1]{\caption@setFPoption{ref}{#1}}
+\@onlypreamble@key{caption}{FPlist}
+\@onlypreamble@key{caption}{FPref}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setFPoption[2]{%
+ \edef\caption@tempa{\@car#2\@nil}%
+ \caption@setbool{FP#1cap}{\if c\caption@tempa 1\else 0\fi}}
+\@onlypreamble\caption@setFPoption
+% \end{macrocode}
+% \begin{macrocode}
+\captionsetup{FPlist=caption,FPref=figure}
+% \end{macrocode}
+%
+% \subsection{hyperref package support options}
+%
+% \changes{v3.1}{2007/06/21}{Options `hypcap' \& `hypcapspace' added}
+% With |hypcap=off| one can turn the \package{hypcap} support off
+% (default is |on|).
+% \begin{macrocode}
+\DeclareCaptionOption{hypcap}[1]{\caption@setbool{hypcap}{#1}}
+\DeclareCaptionOption{hypcapspace}{\def\caption@hypcapspace{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\captionsetup{hypcap=1,hypcapspace=.5\baselineskip}
+% \end{macrocode}
+%
+% \section{Document class support}
+%
+% Execute the code declared with |\At|\-|Caption|\-|Package|.
+% We do this right before processing the options so stuff done with
+% |\At|\-|Caption|\-|Package| could be overwritten by user options.
+%
+% \begin{macrocode}
+\caption@documentclass@code
+\let\caption@documentclass@code\@undefined
+\let\AtCaptionPackage\@firstofone
+% \end{macrocode}
+%
+% \section{Processing of options}
+%
+% \changes{v3.0m}{2007/03/04}{Verbose option added}
+% \changes{v3.1}{2007/07/02}{Verbose option removed from package}
+% \changes{v3.1}{2007/03/17}{We do not process global options anymore}
+%
+% \begin{macrocode}
+\caption@SetupOptions{caption}{\caption@setkeys{#1}{#2}}
+\caption@ProcessOptions*{caption}
+% \end{macrocode}
+%
+% \section{\cs{caption}, \cs{@caption}, and \cs{@makecaption}}
+%
+% \begin{macro}{\caption@ifflag}
+% \changes{v3.3}{2011/12/28}{This switch added}
+% \changes{v3.3}{2018/08/08}{Rewritten (and renamed) so a counter is used instead of a switch}
+% Since we support continued floats and sub-figures it's not an easy task
+% to manage the figure (and table) counter. (Especially since previous versions
+% of the caption package has proven that correcting a counter locally is not a good idea.)
+%
+% These three switches hold the
+% current status: |\caption@if|\-|flag{2}| is set if the caption was already
+% typeset (so the counter doesn't need to be incremented for sub-figures),
+% |\caption@if|\-|flag{4}| is set if there is already content which have
+% incremented the counter (so the counter doesn't need to be incremented
+% for the main caption, further sub-figures, and other stuff), and
+% |\caption@if|\-|flag{1}| is set if |\continued|\-|float| was given.
+%
+% In the past three boolean switches were used to store the flags, but since some
+% packages (like the \package{floatrow} and \package{tabu} package) try hard to keep
+% counter changes locally under certain circumstances, it seems a good idea to make
+% these flags a counter value, too.
+% \begin{macrocode}
+\newcounter{caption@flags}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@ifflag[1]{%
+ \@tempcnta\c@caption@flags
+ \divide\@tempcnta #1\relax
+ \ifodd\@tempcnta
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@clrflags}
+% \changes{v3.3}{2018/08/08}{This macro added}
+% \begin{macro}{\caption@clrflag}
+% \changes{v3.3}{2013/04/14}{This macro added}
+% \changes{v3.3}{2018/08/08}{Rewritten so a counter is used instead of a switch}
+% \begin{macro}{\caption@setflag}
+% \changes{v3.3}{2013/04/14}{This macro added}
+% \changes{v3.3}{2018/08/08}{Rewritten so a counter is used instead of a switch}
+% Furthermore we introduce the macros \cs{caption@clrflag} and \cs{caption@setflag}
+% for clearing resp.~setting these flags.
+% \begin{macrocode}
+\newcommand*\caption@clrflags{%
+ \setcounter{caption@flags}\z@}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@clrflag[1]{%
+ \caption@ifflag{#1}{\caption@addtoflags{-#1}}{}}
+\newcommand*\caption@setflag[1]{%
+ \caption@ifflag{#1}{}{\caption@addtoflags{#1}}}
+\newcommand*\caption@addtoflags{%
+ \addtocounter{caption@flags}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@caption}
+% \changes{v3.0f}{2005/05/22}{Bugfix: \cs{ContinuedFloat} added}
+% \changes{v3.0f}{2005/06/13}{Support of \cs{caption*[]} removed}
+% \changes{v3.0l}{2007/01/19}{Minimal support of \textsf{combine} package added}
+% \changes{v3.1}{2007/02/04}{Re-written, does not save\&use original definition anymore}
+% Here comes our definition of |\caption| and |\caption*|.
+% Beside the support of the starred variant this code was adapted to the
+% various packages we support.
+% We are using |\caption@dblarg| instead of |\@dblarg| so |\caption{}|
+% (with an empty arg.) will produce a list-of entry, but |\caption[]{}|
+% won't.
+% \begin{macrocode}
+\def\caption@caption{%
+ \caption@iftype
+ {\caption@checkgrouplevel\@empty\caption
+ \caption@star
+ {\caption@refstepcounter\@captype}%
+ {\caption@dblarg{\@caption\@captype}}}%
+ {\caption@Error{\noexpand\caption outside float}%
+ \caption@gobble}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@star}
+% \changes{v3.1}{2007/06/24}{Renamed from \cs{caption@caption} to \cs{caption@star}}
+% \changes{v3.2c}{2011/08/21}{\cs{global} removed}
+% A helper macro which processes the optional |*| after |\caption|.
+% \begin{macrocode}
+\newcommand*\caption@star[2]{%
+ \@ifstar{\caption@startrue#2[]}{#1#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@caption}
+% \changes{v3.1}{2007/02/04}{Re-written, does not save\&use original definition anymore}
+% \changes{v3.1f}{2007/11/28}{Bugfix: Handling of \texttt{@minipage} flag added}
+% \changes{v3.1f}{2007/11/28}{Support of option \opt{@minipage} added}
+% \changes{v3.1g}{2008/03/16}{Internal: Uses \cs{caption@prepareanchor} now}
+% \changes{v3.2d}{2011/10/21}{Adapted to the \textsf{memoir} document class}
+% \changes{v3.2f}{2012/01/14}{Usage of \cs{M@gettitle} moved to \cs{caption@prepareanchor}}
+% \changes{v3.3}{2013/01/06}{Adapted to the \textsf{nag} package}
+% As above, our version has been adapted to the packages we support.
+% Additionally our code is nested by |\caption@begin|\-|ex| \&
+% |\caption@end| instead of |\begin|\-|group| \& |\end|\-|group|.
+% Furthermore we use |\caption@par|\-|box|\-|restore| instead of
+% |\@parbox|\-|restore|.
+% \begin{macrocode}
+\long\def\caption@@caption#1[#2]#3{%
+% \end{macrocode}
+% \begin{macrocode}
+ \ifcaption@star \else
+ \caption@prepareanchor{#1}{#2}%
+ \memcaptioninfo{#1}{\csname the#1\endcsname}{#2}{#3}%
+ \@nameuse{nag@hascaptiontrue}%
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \par
+ \caption@beginex{#1}{#2}{#3}%
+ \caption@setfloatcapt{%
+ \caption@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \caption@normalsize
+ \ifcaption@star
+ \let\caption@makeanchor\@firstofone
+ \fi
+ \@makecaption{\csname fnum@#1\endcsname}%
+ {\ignorespaces\caption@makeanchor{#3}}\par
+ \caption@if@minipage\@minipagetrue\@minipagefalse}%
+ \caption@end}
+% \end{macrocode}
+% \class{memoir} document class stuff:
+% \begin{macrocode}
+\providecommand\memcaptioninfo[4]{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@prepareanchor}
+% \changes{v3.1g}{2008/03/16}{This macro added}
+% \changes{v3.2f}{2012/01/14}{Usage of \cs{M@gettitle} moved from \cs{caption@@caption}}
+% \begin{macrocode}
+\newcommand*\caption@prepareanchor[2]{%
+ \caption@makecurrent{#1}{#2}%
+ \caption@ifhypcap\caption@@start\relax
+ \M@gettitle{#2}}
+% \end{macrocode}
+% \class{memoir} document class stuff:
+% \begin{macrocode}
+\providecommand\M@gettitle[1]{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makecaption}
+% \changes{v3.1i}{2008/05/06}{Usage of \cs{caption@rule} added}
+% |\@makecaption|\marg{label}\marg{text}\par
+% We do basically the same as the original code (from the standard
+% \LaTeX\ document classes), but take care of the |position=| setting
+% and use |\caption@@make| from the \package{caption} kernel to finally
+% typeset the caption.
+% \begin{macrocode}
+\long\def\caption@makecaption#1#2{%
+ \caption@make@above
+ \caption@@make{#1}{#2}%
+ \caption@make@below}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@make@above}
+% \begin{macro}{\caption@make@below}
+% \changes{v3.3a}{2019/04/02}{This macro added}
+% |\caption@make@above|\\
+% |\caption@make@below|\par
+% Typesets the stuff above resp.~below the caption, depending on |\caption@iftop|.
+% \begin{macrocode}
+\newcommand*\caption@make@above{%
+ \caption@iftop
+ \caption@belowskip
+ {\caption@rule\caption@aboveskip}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@make@below{%
+ \caption@iftop
+ {\caption@aboveskip\caption@rule}%
+ \caption@belowskip}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@redefine}
+% \changes{v3.1k}{2009/03/30}{This macro added, it contains the patching code now}
+% \begin{macrocode}
+\newcommand*\caption@redefine{}
+% \end{macrocode}
+% \end{macro}
+%
+% Prior to \version{3.4} we only redefined |\caption| and |\@caption| if the current definitions
+% were well known, so documents written in the old (\package{caption} package \version{1.x}) days
+% (where |\caption| \& |\@caption| were not redefined by us) still compiled fine.
+% This used to make sense when introducing \version{3.0} in the year 2003
+% but is simply overcautious and especially unwanted by the user nowadays.
+% So starting with \version{3.4} we only do not redefine |\caption| and |\@caption| if the
+% `compatibility' option is set to `v1'.
+%
+% \begin{macrocode}
+\g@addto@macro\caption@redefine{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@ifcompatibility{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@InfoNoLine{
+ \noexpand\caption will not be redefined since `compatibility' is set to v1}%
+% \end{macrocode}
+% \begin{macrocode}
+ \renewcommand*\caption@redefine{}%
+% \end{macrocode}
+%
+% |\continuedfloat| is not supported in compatibility mode `v1'.
+% \begin{macrocode}
+ \renewcommand*\caption@continuedfloat[1]{%
+ \caption@Error{Not available with option `compatibility=v1'}}%
+% \end{macrocode}
+%
+% |\caption@start| is not supported in compatibility mode `v1'.
+% \begin{macrocode}
+ \caption@AtBeginDocument*{%
+ \let\caption@start\relax
+ \caption@ifdefined\caption@ORI@capstart{%
+ \caption@Debug{%
+ Restore hypcap definition of \string\capstart\@gobble}%
+ \let\capstart\caption@ORI@capstart}{}%
+ }%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@star}
+% We redefine |\caption@star| here so it does not make any harm.
+% \begin{macrocode}
+ \renewcommand*\caption@star[2]{#1#2}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ }{%
+% \end{macrocode}
+%
+% \begin{macro}{\caption}
+% \begin{macro}{\@caption}
+% \begin{macrocode}
+ \renewcommand*\caption@redefine{%
+ \let\caption\caption@caption
+ \let\@caption\caption@@caption}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+ }%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@redefine
+ \caption@AtBeginDocument*{%
+ \let\caption@ORI@capstart\@undefined}%
+% \end{macrocode}
+%
+% \begin{macro}{\@xfloat}
+% \changes{v3.1}{2007/05/09}{This re-definition added}
+% \changes{v3.1b}{2007/09/22}{Will now be redefined in compatibility mode, too}
+% \changes{v3.5}{2020/08/30}{Hook added}
+% We redefine |\@x|\-|float| so inside floating environments our
+% type-specific options will be used, a \package{hyperref}
+% anchor will be set etc.
+% \begin{macrocode}
+ \let\caption@ORI@xfloat\@xfloat
+% \end{macrocode}
+% \begin{macrocode}
+ \def\@xfloat#1[#2]{%
+ \caption@ORI@xfloat{#1}[#2]%
+ \caption@settype{#1}%
+ \caption@xfloat@hook}%
+% \end{macrocode}
+% Hook, could be extended with |\g@addto@macro\caption@x|\-|float@hook{|\ldots|}|.
+% (The caption type could be found in |\@cap|\-|type|.)
+% \begin{macrocode}
+ \newcommand*\caption@xfloat@hook{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@xdblfloat}
+% \changes{v3.5}{2020/08/30}{Re-definition of \cs{xdblfloat} added}
+% We redefine |\@xdbl|\-|float|, too, so special options for |figure*|
+% resp.~|table*| will be applied here.
+% \begin{macrocode}
+ \let\caption@ORI@xdblfloat\@xdblfloat
+% \end{macrocode}
+% \begin{macrocode}
+ \def\@xdblfloat#1[#2]{%
+ \caption@ORI@xdblfloat{#1}[#2]% expands to \@xfloat{#1}[#2] + extra stuff
+ \caption@setoptions{#1*}%
+ \caption@xdblfloat@hook}%
+% \end{macrocode}
+% Hook, could be extended with |\g@addto@macro\caption@xdbl|\-|float@hook{|\ldots|}|.
+% (The caption type could be found in |\@cap|\-|type|.)
+% \begin{macrocode}
+ \newcommand*\caption@xdblfloat@hook{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% Some packages (like the \package{hyperref} package for example) redefines
+% |\caption| and |\@caption|, too.
+% So we have to use |\AtBeginDocument| here, so we can make sure
+% our definition is the one which will be valid at last.
+% \begin{macrocode}
+\caption@AtBeginDocument{\caption@redefine}
+% \end{macrocode}
+%
+% \begin{macro}{\@makecaption}
+% \begin{macrocode}
+\let\@makecaption\caption@makecaption
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\phantomcaption}
+% \changes{v3.2}{2010/10/31}{Bugfix 10-09-01b: This macro added}
+% |\phantomcaption|\par
+% Use this one for figures with subcaptions but without main caption.
+% \begin{macrocode}
+\newcommand\phantomcaption{%
+ \caption@iftype
+ {\caption@refstepcounter\@captype}%
+ {\caption@Error{\noexpand\phantomcaption outside float}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \section{\cs{setcaptiontype} and \cs{setcaptionsubtype}}
+%
+% \changes{v3.0d}{2004/08/03}{Option \opt{type=} added}
+% \changes{v3.1}{2007/06/25}{Option \opt{type*=} added}
+% \changes{v3.1f}{2007/11/16}{Option \opt{subtype} \& \opt{subtype*} added}
+% \changes{v3.2}{2010/10/24}{Bugfix 10-10-17: Option \opt{type=} uses \cs{setcaptiontype} instead of \cs{caption@settype} now}
+%
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionOption{type}{\setcaptiontype{#1}}%
+ \DeclareCaptionOption{type*}{\setcaptiontype*{#1}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionOptionNoValue{subtype}{\setcaptionsubtype\relax}%
+ \DeclareCaptionOptionNoValue{subtype*}{\setcaptionsubtype*}%
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \emph{Important Note:}
+% Like |\captionof| the option |type=| should only be used inside a
+% group, box, or environment and does not check if the argument is a valid
+% floating environment or not.
+%
+% \begin{macro}{\setcaptiontype}
+% \changes{v3.2}{2010/10/24}{This macro added}
+% \changes{v3.4e}{2020/01/02}{Check added if the subtype is defined}
+% \changes{v3.5}{2020/08/24}{Definition method adapted to the \package{caption-light} package}
+% Like |\captionsetup{type=xxx}|, but also works if |\caption|\-|setup| was redefined.
+% \begin{macrocode}
+\def\setcaptiontype{%
+ \caption@parboxrestore@mini
+ \caption@settype}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\setcaptionsubtype}
+% \changes{v3.2a}{2011/08/15}{This macro added}
+% \changes{v3.5d}{2020/09/28}{This macro revised}
+% Same, but sets the sub-type.
+% \begin{macrocode}
+\newcommand\setcaptionsubtype{%
+ \caption@iftype
+ \caption@setsubtype
+ {\caption@Error{\noexpand\setcaptionsubtype outside float}}}%
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@setsubtype{%
+ \caption@teststar\caption@@setsubtype\@firstoftwo\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setsubtype[1]{%
+ \caption@@@settype{sub}{#1}{sub\@captype}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@settype}
+% \changes{v3.1}{2007/05/09}{This macro added}
+% \changes{v3.1b}{2007/09/22}{Usage of \cs{caption@xlabel} added}
+% \changes{v3.1d}{2007/10/23}{Error message for \cs{caption@checkgrouplevel} revised}
+% \changes{v3.1f}{2007/11/16}{\cs{caption@setsubtype} added}
+% \changes{v3.1f}{2007/12/03}{Crappy \cs{caption@iftypewarning} replaced}
+% \changes{v3.1g}{2008/01/12}{Usage of \cs{ifcaptionsetup@star} added}
+% \changes{v3.2}{2010/10/26}{Error message moved from here to \cs{caption@refstepcounter}}
+% \changes{v3.3}{2011/12/28}{Resetting of \cs{ifcaption@caption} and \cs{ifcaption@subcaption} added}
+% \changes{v3.4e}{2020/01/02}{Checks added to prevent misuse regading subtypes}
+% \changes{v3.5d}{2020/09/28}{This macro revised}
+% |\caption@settype*|\marg{type}\par
+% sets |\@captype| and executes the options associated with it
+% (using |\caption@set|\-|options|).
+% Furthermore we check |\current|\-|group|\-|level| (if avail),
+% redefine |\@currentlabel| so a |\label| before |\caption| will result
+% in a hint instead of a wrong reference, and
+% use the macro |\caption@|(|sub|)|type|\-|hook| (which will be used by our
+% \package{float} package support).\par
+% The non-starred version sets a \package{hyperref} anchor additionally
+% (if |hypcap=|\-|true| and the \package{hypcap} package is not loaded).
+% \begin{macrocode}
+\newcommand*\caption@settype{%
+ \caption@clrflags
+ \caption@set@type}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@set@type{%
+ \caption@teststar\caption@@settype\@firstoftwo\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@settype{%
+ \caption@@@settype{}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@settype[3]{%
+% #1 = "" or "sub"
+% #2 = \@firstoftwo in star form, \@secondoftwo otherwise
+% #3 = <type>, e.g.: "figure" or "subfigure"
+ \caption@Debug{#1type=#3}%
+ \@nameuse{caption@check#1type}{#3}%
+ {\caption@checkgrouplevel{#1}{%
+ \captionsetup{#1type#2*\@empty=...}#2{ or
+ \@backslashchar#1captionof}{}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \edef\caption@tempa{#3}%
+ \expandafter\ifx\csname @#1captype\endcsname\caption@tempa \else
+ \ifcaptionsetup@star\else\@nameuse{caption@#1type@warning}\fi
+ \fi
+ \expandafter\let\csname @#1captype\endcsname\caption@tempa
+% \end{macrocode}
+% \begin{macrocode}
+ \@nameuse{caption@#1typehook}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@setoptions{#3}%
+ \ifx\caption@opt\relax
+ \@nameundef{caption@#1type@warning}%
+ \else
+ \@namedef{caption@#1type@warning}{\caption@Warning{%
+ The #1type was already set to
+ `\csname @#1captype\endcsname'\MessageBreak}}%
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ #2{}{%
+ \let\@currentlabel\caption@undefinedlabel
+% \let\@currentHlabel\@undefined
+ \ifx\caption@x@label\@undefined
+ \let\caption@x@label\label
+ \let\label\caption@xlabel
+ \fi
+ \caption@start}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@iftype}
+% \changes{v3.1}{2007/04/11}{This macro and its usage added}
+% Since we often need to check if |\@captype| is defined (means: we
+% are inside a floating environment) this helper macro was introduced.
+% \begin{macrocode}
+\newcommand*\caption@iftype{\caption@ifdefined\@captype}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@checktype}
+% \changes{v3.4g}{2020/01/02}{This macro and its usage added}
+% \changes{v3.4m}{2020/07/29}{Check of \cs{sf@counterlist} from \package{subfig} package added}
+% |\caption@checktype|\marg{type}\marg{code}\par
+% is used by |\caption@settype| and should either expand the code or issue an error
+% if the given type is not a proper type, i.e. it is a sub-type instead (either defined by
+% |\DeclareCaptionSubType| or |\newsubfloat|\cite{subfig}).
+% \begin{macrocode}
+\newcommand*\caption@checktype[1]{%
+ \caption@ifsubtype{#1}\@firstoftwo{\caption@ifin@list\sf@counterlist{#1}}%
+ {\caption@Error{Should not be used with subtype `#1'}%
+ \@gobble}%
+ \@firstofone}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@checksubtype}
+% \changes{v3.4g}{2020/01/02}{This macro and its usage added}
+% \changes{v3.4m}{2020/07/29}{Check of \cs{sf@counterlist} from \package{subfig} package added}
+% |\caption@checksubtype|\marg{type}\marg{code}\par
+% is used by |\caption@settype| and should either expand the code or issue an error
+% if the given type is not a proper sub-type, i.e. not defined by |\Declare|\-|Caption|\-|Sub|\-|Type|.
+% Since the |sub|\-|float|\-|row| environment offered by the \package{floatrow} package\cite{floatrow}
+% is using |\caption|\-|setup{sub|\-|type}| even if the sub-type was defined by |\new|\-|sub|\-|float|
+% offered by \package{subfig}\cite{subfig}, we take a more relaxed view of things here and allow
+% those sub-types as well (but not without warning since we do not support this).
+% \begin{macrocode}
+\newcommand*\caption@checksubtype[1]{%
+ \caption@ifsubtype{#1}%
+ \@firstofone
+ {\caption@ifin@list\sf@counterlist{#1}%
+ {\caption@Warning{%
+ \noexpand\setcaptionsubtype without \string\DeclareCaptionSubType.\MessageBreak
+ This is not designed to work; you could try replacing\MessageBreak
+ the `subfig' package with `subcaption' to resolve\MessageBreak
+ this problem which occurred}%
+ \@firstofone}%
+ {\caption@Error{Undefined subtype `#1'}%
+ \@gobble}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@checkgrouplevel}
+% \changes{v3.1}{2007/07/15}{This macro and its usage added}
+% \changes{v3.1f}{2007/11/28}{Error changed to warning (compatibility)}
+% \changes{v3.3}{2013/04/21}{Uses \cs{caption@ifeTeX} now}
+% \changes{v3.5}{2019/09/11}{Relies on \eTeX{} now}
+% Checks if |\captionsetup{type=|\ldots|}| or |\caption| is done
+% inside a group or not -- in the latter case a warning message will
+% be issued.
+% \begin{macrocode}
+\newcommand*\caption@checkgrouplevel[2]{%
+ \@ifundefined{#1caption@grouplevel}{%
+ \caption@ifundefined\caption@grouplevel{\let\caption@grouplevel\z@}{}%
+ \ifnum\currentgrouplevel>\caption@grouplevel\relax
+ \expandafter\edef\csname #1caption@grouplevel\endcsname{%
+ \the\currentgrouplevel}%
+ \else
+ \caption@Warning{\string#2\MessageBreak outside box or environment}%
+ \fi
+ }{}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@undefinedlabel}
+% \changes{v3.1}{2007/07/03}{This macro and its usage added}
+% \changes{v3.1b}{2007/09/22}{Contents changed to \texttt{??}}
+% \changes{v3.1i}{2008/04/13}{Contents changed to \cs{caption@xref}(\ldots)}
+% \changes{v3.1k}{2009/03/30}{Bugfix 08-12-08: \cs{caption@xref} is robust now}
+% \changes{v3.2c}{2011/09/13}{Text changed from `before' to `without proper'}
+% \changes{v3.3}{2016/02/21}{Text changed from `without proper \cs{caption}' to `without proper reference'}
+% This label will be used for |\currentlabel| inside (floating) environments
+% as default. (see above)
+% \iffalse\Note{All commands used have to be robust here.}\fi
+% \begin{macrocode}
+\newcommand*\caption@undefinedlabel{%
+ \protect\caption@xref{\caption@labelname}{\on@line}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareRobustCommand*\caption@xref[2]{%
+ \caption@WarningNoLine{\noexpand\label without proper reference#2}%
+ \@setref\relax\@undefined{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@labelname{??}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@xlabel}
+% \changes{v3.1b}{2007/09/22}{This macro and its usage added}
+% \changes{v3.1f}{2007/11/11}{Revised}
+% \changes{v3.1i}{2008/04/13}{Bugfix: \cs{pageref} should always work now}
+% \changes{v3.2c}{2011/08/19}{Works with optional arguments now, too}
+% The new code of |\label| inside floating environments.
+% |\label| will be redefined using |\caption@withoptargs|, so
+% |#1| are the optional arguments (if any), and
+% |#2| is the mandatory argument here.
+% \begin{macrocode}
+\newcommand*\caption@xlabel{%
+ \caption@withoptargs\caption@@xlabel}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@xlabel[2]{%
+ \caption@@@xlabel
+ \def\caption@labelname{#2}%
+ \caption@x@label#1{#2}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@xlabel{%
+ \global\let\caption@@@xlabel\@empty
+ \@bsphack
+ \protected@write\@auxout{}%
+ {\string\providecommand*\string\caption@xref[2]{%
+ \string\@setref\string\relax\string\@undefined{\string##1}}}%
+ \@esphack}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionof}
+% \changes{v3.1}{2007/05/09}{Uses \cs{caption@settype} instead of \cs{def}\cs{@captype}}
+% \changes{v3.1c}{2007/09/22}{Bugfix: Redefinition of \cs{caption@setfloatcapt} removed}
+% \changes{v3.1e}{2007/10/30}{Better compatibility: Will be defined with \cs{AtBeginDocument} now}
+% \changes{v3.2}{2010/10/24}{Bugfix 10-10-17: Uses \cs{setcaptiontype} instead of \cs{caption@settype} now}
+% \changes{v3.5}{2020/08/24}{Definition method adapted to the \package{caption-light} package}
+% |\captionof|\marg{type}\oarg{lst\_entry}\marg{heading}\\
+% |\captionof*|\oarg{lst\_entry}\marg{heading}\par
+% \Note{This will be defined with \cs{AtBeginDocument} so
+% \cs{usepackage}\csmarg{caption,capt-of} will still work.
+% (Compatibility to \version{1.x})}
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \def\captionof{\caption@teststar\caption@of{\caption*}\caption}}
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\caption@of[2]{\setcaptiontype*{#2}#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{\cs{captionlistentry}}
+%
+% \begin{macro}{\captionlistentry}
+% \changes{v3.1}{2007/07/28}{This macro added}
+% \changes{v3.1f}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% \changes{v3.1g}{2008/01/20}{Starred variant added}
+% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% |\captionlistentry|\oarg{float type}\marg{list entry}\\
+% |\captionlistentry*|\oarg{float type}\marg{list entry}
+% \begin{macrocode}
+\newcommand*\captionlistentry{%
+ \caption@teststar\@captionlistentry\@firstoftwo\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\@captionlistentry[1]{%
+ \@testopt{\caption@listentry{#1}}\@captype}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@listentry#1[#2]#3{%
+ \@bsphack
+ #1{\caption@gettitle{#3}}%
+ {\caption@refstepcounter{#2}%
+ \caption@makecurrent{#2}{#3}}%
+ \caption@addcontentsline{#2}{#3}%
+ \@esphack}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{\cs{captionbox}}
+%
+% \begin{macro}{\captionbox}
+% \changes{v3.2}{2010/12/17}{This macro added}
+% \changes{v3.2a}{2011/08/16}{\cs{captionsetup} replaces with \cs{captionbox@settype} and \cs{caption@setposition}}
+% \changes{v3.3}{2012/04/09}{Adapted to revised version of \cs{caption@withoptargs}}
+% \changes{v3.3}{2017/03/19}{When used with fixed witdh the content will not be hboxed anymore}
+% \changes{v3.3c}{2019/09/01}{Adapted so it could be used by \cs{subfloat} offered by \package{subcaption}}
+% \changes{v3.5}{2020/07/28}{Adapted to \package{caption3} v2.0}
+% A |\parbox| with contents and caption, separated by an invisible |\hrule|.
+% \begin{macrocode}
+\newcommand*\captionbox{%
+ \caption@withoptargs{\caption@ibox\@gobble}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@ibox[3]{%
+ \kernel@ifnextchar[%]
+ {\caption@iibox{#1}{#2}{#3}}%
+ {\caption@iibox@{#1}{#2}{#3}}}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@iibox#1#2#3[#4]{%
+ \@testopt{\caption@iiibox{#1}{#2}{#3}[{#4}]}\captionbox@innerpos@default}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@iibox@#1#2#3#4{%
+ \setbox\@tempboxa\hbox{#4}%
+ \caption@iiibox{#1}{#2}{#3}[\wd\@tempboxa][\captionbox@innerpos@default]{\unhbox\@tempboxa}}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@iiibox#1{%
+ \caption@iiiibox{#1}\vbox\vtop}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@iiiibox#1#2#3#4#5[#6][#7]#8{%
+ \begingroup
+ #1*% set \caption@position
+ \caption@iftop{%
+ \endgroup
+ \parbox[t]{#6}{%
+ #1\relax
+ \caption@setposition t%
+ #2{\caption#4{#5}}%
+ \captionbox@hrule
+ \csname caption@justification@#7\endcsname
+ #8}%
+ }{%
+ \endgroup
+ \parbox[b]{#6}{%
+ #1\relax
+ \caption@setposition b%
+ \csname caption@justification@#7\endcsname
+ #8%
+ \captionbox@hrule
+ #3{\caption#4{#5}}}%
+ }}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\captionbox@innerpos@default{c}
+\newcommand*\captionbox@hrule{\hrule\@height\z@\relax}
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\caption@justification@c{\centering}
+\providecommand*\caption@justification@l{\raggedright}
+\providecommand*\caption@justification@r{\raggedleft}
+\providecommand*\caption@justification@s{}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{\cs{continuedfloat}}
+%
+% \begin{macro}{\continuedfloat}
+% \changes{v3.0i}{2005/11/12}{Optional argument added}
+% \changes{v3.0g}{2005/06/28}{Bugfix: \cs{newcounter} replaced by \cs{newcount}}
+% \changes{v3.1}{2007/07/02}{Format of \package{hyperref} extension changed}
+% \changes{v3.1}{2007/07/07}{\cs{caption@setoptions} added}
+% \changes{v3.1g}{2008/01/29}{Starred variant added}
+% \changes{v3.2f}{2011/12/17}{Undocumented optional argument removed}
+% \changes{v3.3}{2011/12/28}{Uses \cs{ifcaption@ContinuedFloat} now}
+% \changes{v3.3}{2013/05/01}{Usage of \cs{caption@restorecounters} added}
+% \changes{v3.3}{2013/12/16}{Bugfix: Does not use \cs{caption@ContinuedFloat} anymore since this breaks \cs{ContinuedFloat} offered by the \package{subfig} package}
+% \changes{v3.4}{2015/09/16}{Renamed from \cs{ContinuedFloat} to \cs{continuedfloat}}
+% \changes{v3.5f}{2020/10/06}{Usage of \cs{caption@restorecounters} removed}
+% |\continuedfloat|\\
+% |\continuedfloat*|\par
+% This mainly sets the appropriate flag, increments the
+% continuation counter, and executes the given options.
+% Furthermore we set |\caption@reset|\-|continued|\-|float| to |\@gobble| so the
+% continuation counter will not be reset to zero inside |\caption@ref|\-|step|\-|counter|.\par
+% When the \package{hyperref} package is used we have the problem
+% that the usage of |\continued|\-|float| will create duplicate
+% hyper links -- |\@current|\-|Href| will be the same for the main float and
+% the continued ones. So we have to make sure unique labels and references
+% will be created each time. We do this by extending |\the|\-|H|\-|figure| and
+% |\the|\-|H|\-|table|, so for continued floats the scheme
+% \begin{quote}\meta{type}|.|\meta{type \#}|\alph{|\meta{continued \#}|}|\end{quote}
+% will be used instead of
+% \begin{quote}\meta{type}|.|\meta{type \#}\quad\quad.\end{quote}
+% \par{\small(This implementation follows an idea from Steven Douglas Cochran.)}
+% \Note{This does not help if the \package{hyperref} package option
+% \texttt{naturalnames=true} is set.}
+% \begin{macrocode}
+\def\continuedfloat{%
+ \caption@iftype
+ {\caption@continuedfloat\@captype}%
+ {\caption@Error{\noexpand\continuedfloat outside float}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@continuedfloat[1]{%
+ \@ifstar
+ {\caption@@refstepcounter\@captype
+ \caption@@continuedfloat{#1}}%
+ {\caption@continued@float{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@continued@float[1]{%
+ \edef\caption@tempa{#1}%
+ \ifx\caption@tempa\caption@CFtype
+ \caption@@continuedfloat{#1}%
+ \else
+ \caption@Error{Continued `#1' after `\caption@CFtype'}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@continuedfloat{%
+ \caption@setflag1% continued float
+ \caption@@@continuedfloat}
+\newcommand*\caption@@@continuedfloat{%
+ \stepcounter{continuedfloat}%
+ \caption@@@@continuedfloat}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@@continuedfloat[1]{%
+ \caption@setoptions{ContinuedFloat}% for compatibility reasons
+ \caption@setoptions{continuedfloat}%
+ \caption@setoptions{continued#1}%
+ \expandafter\l@addto@macro\csname the#1\endcsname\thecontinuedfloat
+ \@ifundefined{theH#1}{}{%
+ \expandafter\l@addto@macro\csname theH#1\endcsname{%
+ \@alph\c@continuedfloat}}%
+ \let\caption@@@@continuedfloat\@gobble}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@CFtype{??}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\thecontinuedfloat}
+% \changes{v3.4}{2015/09/16}{Renamed from \cs{theContinuedFloat} to \cs{thecontinuedfloat}}
+% This one is preset to \cs{@empty}, so usually the continuation counter is not
+% included in the caption label or references.
+% \begin{macrocode}
+\newcounter{continuedfloat}
+\let\c@ContinuedFloat\c@continuedfloat % defined for compatibility reasons
+\def\thecontinuedfloat{\theContinuedFloat}
+\let\theContinuedFloat\@empty % defined for compatibility reasons
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@reset@continuedfloat}
+% \changes{v3.2f}{2011/12/17}{Redefinition of \cs{continuedfloat} added}
+% |\caption@reset@continuedfloat|\marg{type}\par
+% If a continuation counter is defined, we reset it.
+% (This one will be called inside |\@caption|.)
+% \begin{macrocode}
+\newcommand*\caption@reset@continuedfloat[1]{%
+ \xdef\caption@CFtype{#1}%
+ \@stpelt{continuedfloat}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ContinuedFloat}
+% For compatibility reasons we still support |\Continued|\-|Float|.
+% \begin{macrocode}
+\def\ContinuedFloat{\continuedfloat} % defined for compatibility reasons
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ContinuedFloat}
+% \changes{v3.0f}{2005/06/11}{This macro added}
+% \changes{v3.3}{2013/12/16}{Bugfix: Revised and defined with \cs{def} instead of \cs{newcommand}}
+% |\caption@ContinuedFloat|\marg{type}\par
+% This one is used by \cs{ContinuedFloat} offered by the \package{subfig} package.
+% \begin{macrocode}
+\def\caption@ContinuedFloat{%
+ \let\caption@reset@continuedfloat\@gobble
+ \caption@@@continuedfloat}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Internal helpers}
+%
+% \begin{macro}{\caption@refstepcounter}
+% \changes{v3.1}{2007/07/28}{This macro added}
+% \changes{v3.2}{2010/10/26}{Error message moved from \cs{caption@@@settype} to here}
+% \changes{v3.2c}{2011/09/04}{Support of \cs{donemaincaptiontrue} from \textsf{memoir} document class added}
+% \changes{v3.3}{2011/12/28}{Usage of \cs{ifcaption@caption}, \cs{ifcaption@subcaption}, and \cs{ifcaption@ContinuedFloat} added}
+% \changes{v3.5e}{2020/09/28}{Bugfix in re-definition of \cs{stepcounter}; uses \cs{edef} instead of \cs{def} now}
+% Increments the float (i.e. |figure| or |table|) counter,
+% resets the continuation counter, and redefines itself to |\@gobble|.
+% \begin{macrocode}
+\newcommand*\caption@refstepcounter[1]{%
+ \@ifundefined{c@#1}%
+ {\caption@Error{No float type '#1' defined}}%
+ {\caption@ref@stepcounter{#1}%
+% \end{macrocode}
+% Set flag if this part of the figure (or table) contains a caption now.
+% (If |\caption@if|\-|top| is not set, |\caption| is at the bottom of this part,
+% therefore ending this part, so we set the flag to |false| in this case.)
+% \begin{macrocode}
+ \caption@fixposition % TODO: Make this independant on the "position" setting
+ \caption@iftop\caption@setflag\caption@clrflag2% caption
+% \end{macrocode}
+% This part does not contain content (like sub-figures) yet,
+% so we set |\if|\-|caption@sub|\-|caption| to |false|.
+% \begin{macrocode}
+ \caption@clrflag4% subcaption
+% \end{macrocode}
+% Support of the \textsf{memoir} document class.
+% \begin{macrocode}
+ \@nameuse{donemaincaptiontrue}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@ref@stepcounter{%
+ \caption@ifflag1{% continued float
+ \let\caption@tempa\caption@@refcounter
+ \caption@clrflag1% continued float
+ }{%
+ \let\caption@tempa\caption@@refstepcounter
+ \caption@ifflag2{}{% caption
+ \caption@ifflag4{% subcaption
+ % Counter was already incremented by content, so we suppress \stepcounter{#1} here
+ \let\caption@tempa\caption@@refcounter
+ }{}%
+ }%
+ }%
+ \caption@tempa}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@refcounter[1]{%
+ \let\caption@stepcounter@ORI\stepcounter
+ \def\stepcounter##1{%
+ \edef\caption@tempa{#1}%
+ \edef\caption@tempb{##1}%
+ \ifx\caption@tempa\caption@tempb \else
+ \caption@stepcounter@ORI{##1}%
+ \fi}%
+ \caption@@@refstepcounter{#1}%
+ \let\stepcounter\caption@stepcounter@ORI}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@refstepcounter[1]{%
+ \caption@prepare@stepcounter{#1}{ref}%
+ \caption@@@refstepcounter{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@stepcounter[1]{%
+ \caption@prepare@stepcounter{#1}{}%
+ \caption@@@stepcounter{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@prepare@stepcounter[2]{%
+ \caption@addsubcontentslines{#2stepcounter}%
+ \caption@reset@continuedfloat{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@refstepcounter{\refstepcounter}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@stepcounter{\stepcounter}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@dblarg}
+% \changes{v3.1}{2007/02/05}{This macro added}
+% \changes{v3.1f}{2007/12/06}{Bugfix 07-12-06: Changed so it works without \cs{kernel@ifnextchar} (which was introduced in \LaTeXe\ 2004/01/23), too}
+% \changes{v3.3}{2012/03/25}{Support of option \opt{list-entry} added}
+% A |\relax| was added compared to |\@dblarg| so |\caption{}| will be
+% expanded to |\caption[\relax]{}| (and not to |\caption[]{}|).
+% Furthermore support for option \opt{list-entry} was added.
+% \begin{macrocode}
+\@ifundefined{kernel@ifnextchar}{\let\kernel@ifnextchar\@ifnextchar}{}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@dblarg[1]{%
+ \kernel@ifnextchar[{\caption@ydblarg{#1}}{\caption@xdblarg{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@xdblarg[2]{%
+ #1[{#2\relax}]{#2}}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@ydblarg#1[#2]#3{%
+ \caption@iflistheading{#1[{#3}]{#3}}{#1[{#2}]{#3}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@begin}
+% \changes{v3.0a}{2004/01/23}{\cs{caption@settype} changed to \cs{caption@setfloattype}}
+% \changes{v3.0e}{2005/04/12}{Check for default label format added}
+% \changes{v3.0f}{2005/06/11}{Usage of \cs{caption@resetContinuedFloat} added}
+% \changes{v3.1}{2007/05/09}{Usage of \cs{caption@setfloattype} \& \cs{caption@resetContinuedFloat} removed}
+% \changes{v3.3}{2011/12/29}{Usage of \cs{caption@fixedposition} removed}
+% Our handling of |\caption| will always be surrounded by
+% |\caption@begin| (or |\caption@beginex|) and |\caption@end|.\par
+% |\caption@begin|\marg{type} performs these tasks:
+% \begin{enumerate}
+% \item[1.] Override the |position=| setting, if necessary.
+% (for example if set to |auto| or used inside a |supertabular|)
+% \item[2.] Start a new group.
+% \item[3.] Define |\fnum@|\meta{type} if the caption label format is set
+% to non-default.
+% \end{enumerate}
+% \begin{macrocode}
+\newcommand*\caption@begin[1]{%
+ \caption@fixposition
+ \begingroup
+ \caption@setfnum{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@beginex}
+% \changes{v3.0b}{2004/05/16}{Support of \opt{listof=} added}
+% \changes{v3.0l}{2007/02/04}{Takes now 3 args instead of 2, check for empty heading added}
+% \changes{v3.1}{2007/07/01}{Makes lst-entry now instead of redefining \cs{addcontentsline}}
+% \changes{v3.2}{2010/10/26}{Bugfix 09-05-15: Setting of \cs{lst@@caption} added}
+% |\caption@beginex|\marg{type}\marg{list entry}\marg{heading}\par
+% performs the same tasks as |\caption@begin| and additionally:
+% \begin{enumerate}
+% \item[4.] Set |\lst@@caption|, so |\fnum@lstlisting| will include a numbering.
+% \item[5.] Make an entry in the list-of-whatever.
+% \item[6.] Set |\caption@ifempty| according argument \meta{heading}.
+% \end{enumerate}
+% \begin{macrocode}
+\newcommand\caption@beginex[3]{%
+ \caption@begin{#1}%
+ \let\lst@@caption\relax
+ \caption@addcontentsline{#1}{#2}%
+ \caption@ifempty{#3}{}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@end}
+% \changes{v3.3}{2011/12/29}{Usage of \cs{caption@fixedposition} removed}
+% |\caption@end| closes the group.
+% \begin{macrocode}
+\newcommand*\caption@end{%
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0a}{2004/01/23}{Internal hooks \cs{caption@@begin} \& \cs{caption@@end} added}
+% \changes{v3.0h}{2005/10/06}{Internal hooks \cs{caption@@begin} \& \cs{caption@@end} removed}
+%
+% \begin{macro}{\caption@setfnum}
+% \changes{v3.1}{2007/03/10}{This macro added}
+% \changes{v3.5}{2020/08/03}{Adapted to \package{caption3} v2.0}
+% |\caption@setfnum|\marg{type}\\
+% stores the original definition of |\fnum@|\meta{type} in |\caption@fnum@|\meta{type}
+% and re-defines it according the caption label format set with |label|\-|format=|.
+% \begin{macrocode}
+\newcommand*\caption@setfnum[1]{%
+ \@ifundefined{caption@fnum@#1}%
+ {\expandafter\let\csname caption@fnum@#1\expandafter\endcsname\csname fnum@#1\endcsname
+ \@namedef{fnum@#1}{\caption@fnum{#1}}}%
+ {}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@normalsize}
+% \changes{v3.1}{2007/05/05}{This macro and its usage added}
+% \changes{v3.5}{2020/07/27}{Adapted to \package{caption3} v2.0}
+% This one will be used by |\@caption| instead of |\normalsize|.
+% \begin{macrocode}
+\newcommand*\caption@normalsize{%
+ \caption@font@normal\@unused}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setfloatcapt}
+% Needed for support of the \package{float} package, where the caption will
+% not be typeset directly, but catched in a |\vbox| called |\@floatcapt|
+% instead.
+% \begin{macrocode}
+\let\caption@setfloatcapt\@firstofone
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makecurrent}
+% This one is needed for support of the \package{nameref} and \package{hyperref} package.
+% \changes{v3.2f}{2012/01/14}{Bugfix: Usage of \cs{caption@gettitle} added}
+% \begin{macrocode}
+\newcommand*\caption@makecurrent[1]{\caption@gettitle}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makeanchor}
+% \begin{macro}{\caption@start}
+% \begin{macro}{\caption@@start}
+% \begin{macro}{\caption@freezeHref}
+% \begin{macro}{\caption@defrostHref}
+% All these are needed for support of the \package{hyperref} package.
+% \begin{macrocode}
+\let\caption@makeanchor\@firstofone
+\let\caption@start\relax
+\let\caption@@start\relax
+\let\caption@freezeHref\relax
+\let\caption@defrostHref\relax
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@gettitle}
+% \changes{v3.1}{2007/05/05}{This macro and its usage added}
+% This one is needed for support of the \package{nameref} package.
+% \begin{macrocode}
+\newcommand\caption@gettitle[1]{%
+ \caption@ifdefined\NR@gettitle
+ {\NR@gettitle{#1}}%
+ {\def\@currentlabelname{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Support for sub-captions}
+% \changes{v3.1f}{2007/11/16}{Support for sub-captions added}
+%
+% \begin{macro}{\caption@subtypehook}
+% \changes{v3.1g}{2008/03/20}{Redefinition of \cs{caption@setlist} added}
+% \changes{v3.1k}{2009/10/09}{Bugfix 09-08-12b: \cs{@makecaption} will now be restored here, too}
+% \changes{v3.2}{2011/06/26}{Uses \cs{caption@@addcontentsline} instead of \cs{addcontentsline} now}
+% \changes{v3.2a}{2011/08/17}{Redefinition of \cs{phantomcaption} added}
+% \changes{v3.2a}{2011/08/17}{Usage of \cs{caption@warmup} added}
+% \changes{v3.2c}{2011/09/30}{Bugfix 11-09-26: Usage of \cs{if@subfloatrow} added}
+% \changes{v3.3}{2011/12/28}{Bugfix 11-12-16: \cs{caption@l@stepcounter} replaced by \cs{stepcounter}}
+% \changes{v3.3}{2012/03/15}{Usage of \cs{caption@setbox} added}
+% \changes{v3.3}{2013/05/01}{Redefinition of \cs{caption@settype} added}
+% \changes{v3.3}{2013/06/17}{Missing redefinition of \cs{captionlistentry} added}
+% \changes{v3.3}{2018/09/06}{Adapted to the \package{chkfloat} package}
+% \changes{v3.4f}{2020/01/03}{Redefinition of \cs{@caption} added since it was redefined by the \env{threeparttable} environment}
+% \changes{v3.5}{2020/07/27}{Adapted to \package{caption3} v2.0}
+% Hook, will be used inside \cs{caption@setsubtype}.\par
+% (Note: If we are inside an |sub|\-|float|\-|row| environment we have to keep
+% the |\@make|\-|caption| code of the \package{floatrow} package intact.)
+% \begin{macrocode}
+\newcommand*\caption@subtypehook{%
+ \ifx\caption\caption@subcaption \else
+ \caption@warmup
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@ifflag2{}{% caption
+% no \caption in this part of the (floating) environment yet
+ \let\caption@add@contentsline\caption@addsubcontentsline
+ \let\caption@addsubcontentslines\@gobble
+ \caption@ifflag4{}{% subcaption
+% no \subcaption in this part of the (floating) environment yet
+ \caption@ifflag1{% continued float
+ \caption@clrflag1%
+ }{%
+ \caption@@stepcounter\@captype
+ }%
+ \caption@setflag4% subcaption
+ }%
+ }%
+% \end{macrocode}
+% \begin{macrocode}
+ \c@continuedfloat=0\relax
+ \let\caption@setfloatcapt\@firstofone
+ \let\caption@chkfloat\@gobbletwo
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@set{box}{none}%
+ \caption@clearmargin
+ \caption@iflist{}{\let\caption@setlist\@gobble}%
+ \caption@setoptions{sub}%
+ \caption@setoptions{subfloat}% for subfig-package compatibility
+% \end{macrocode}
+% \begin{macrocode}
+% redefine \setcaptiontype
+ \def\caption@settype{\caption@withoptargs\caption@sub@settype}%
+ \def\caption@sub@settype##1##2{%
+ \edef\caption@tempa{##2}%
+ \ifx\caption@tempa\@captype
+%%% \caption@setsubtype##1\relax
+ \else
+ \caption@Error{##2 inside \@subcaptype}%
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+% redefine \caption
+ \let\caption\caption@subcaption
+ \let\@caption\caption@@caption
+ \let\phantomcaption\caption@subphantom
+ \let\captionlistentry\caption@sublistentry
+% \let\@captype\@subcaptype
+ \let\caption@refstepcounter\caption@@@refstepcounter
+% \end{macrocode}
+% \begin{macrocode}
+% restore \@makecaption
+ \if@subfloatrow
+ \caption@Debug{Keeping \string\@makecaption}%
+ \else
+ \let\@makecaption\caption@makecaption
+ \fi
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@subfloatrow}
+% \changes{v3.2c}{2011/09/30}{This macro added}
+% This macro tests if we are inside an |sub|\-|float|\-|row| or |sub|\-|float|\-|row*| environment.
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \caption@ifundefined\@subfloatrowtrue
+ {\newif\if@subfloatrow
+ \caption@ifundefined\subfloatrow
+ {}%
+ {\caption@Debug{Patching subfloatrow environment}%
+ \g@addto@macro\capsubrowsettings{\@subfloatrowtrue}%
+ \g@addto@macro\killfloatstyle{%
+ \ifx\c@FRobj\c@FRsobj\@subfloatrowtrue\fi}}}%
+ {\caption@Debug{\string\if@subfloatrow is already defined}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@subcaption}
+% Makes a sub-caption.
+% \begin{macrocode}
+\newcommand*\caption@subcaption{%
+ \caption@checkgrouplevel{sub}\subcaption
+ \caption@star
+ {\caption@refstepcounter\@subcaptype}%
+ {\caption@dblarg{\@caption\@subcaptype}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@subphantom}
+% \changes{v3.2a}{2011/08/17}{This macro added}
+% Same as |\phantomcaption|, but for sub-captions.
+% \begin{macrocode}
+\newcommand*\caption@subphantom{%
+ \caption@checkgrouplevel{sub}\phantomsubcaption
+ \caption@refstepcounter\@subcaptype}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@sublistentry}
+% \changes{v3.3}{2013/06/17}{This macro added}
+% Same as |\captionlistentry|, but for sub-captions.
+% \begin{macrocode}
+\newcommand*\caption@sublistentry{%
+ \caption@teststar\@subcaptionlistentry\@firstoftwo\@secondoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\@subcaptionlistentry[1]{%
+ \@testopt{\caption@listentry{#1}}\@subcaptype}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{caption@clearsubcontentslines}
+% Clear pending sub-caption list entries.
+% \begin{macrocode}
+\newcommand*\caption@clearsubcontentslines{%
+ \global\let\caption@subcontentslines\@empty}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@clearsubcontentslines
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@addsubcontentsline}
+% \changes{v3.1i}{2008/08/02}{\cs{label}, \cs{index}, and \cs{glossary} are allowed inside the list entry now}
+% \changes{v3.2}{2011/06/26}{Uses \cs{caption@@addcontentsline} instead of \cs{addcontentsline} now}
+% \changes{v3.2c}{2011/08/19}{Uses \cs{caption@gobble} instead of \cs{@gobble} now}
+% \changes{v3.3}{2012/01/15}{Debug message added}
+% \changes{v3.3}{2013/03/10}{A single \cs{protect} replaced by \cs{noexpand}}
+% Add a pending sub-caption list entry.
+% \begin{macrocode}
+\newcommand*\caption@addsubcontentsline[4]{%
+ \caption@Debug{\string\caption@addsubcontentsline{#1}{#2}}%
+ \begingroup
+ \let\label\caption@gobble
+ \let\index\caption@gobble
+ \let\glossary\caption@gobble
+ \protected@edef\@tempa{\endgroup
+ \noexpand\g@addto@macro\noexpand\caption@subcontentslines{%
+ \noexpand\@namedef{the#2}{\csname the#2\endcsname}%
+ \ifx\@currentHref\@undefined \else
+ \noexpand\def\noexpand\@currentHref{\@currentHref}%
+ \fi
+ \noexpand\caption@@@addcontentsline{#1}{#2}{#3}{#4}}}%
+ \@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\flushsubcaptionlistentries}
+% \changes{v3.3}{2012/01/15}{Renamed from \cs{caption@addsubcontentslines} to \cs{flushsubcaptionlistentries}}
+% \changes{v3.3}{2013/03/10}{Bugfix: Missing redefinition of \cs{caption@addsubcontentslines} added}
+% Writes pending sub-caption list entries.
+% \begin{macrocode}
+\newcommand*\flushsubcaptionlistentries{%
+ \caption@addsubcontentslines{user}}
+% \end{macrocode}
+% \begin{macrocode}
+\renewcommand*\caption@addsubcontentslines[1]{%
+ \caption@Debug{\string\flushsubcaptionlistentries (#1)}%
+ \begingroup
+ \caption@subcontentslines
+ \endgroup
+ \caption@clearsubcontentslines}
+% \end{macrocode}
+% We need to patch \cs{chapter} otherwise a vertical gap will be inserted into
+% the list prior pending sub-caption list entries.
+% We do this |\At|\-|Begin|\-|Document| so packages like \package{newfloat}
+% will not complain about an unknown document class.
+% \begin{macrocode}
+\AtBeginDocument{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@ifdefined\chapter{%
+ \let\caption@chapter@ORI\chapter
+ \def\chapter{%
+ \caption@addsubcontentslines{chapter}\caption@chapter@ORI}}{}%
+% \end{macrocode}
+% Same for \cs{appendix}.
+% \begin{macrocode}
+ \caption@ifdefined\appendix{%
+ \let\caption@appendix@ORI\appendix
+ \def\appendix{%
+ \caption@addsubcontentslines{appendix}\caption@appendix@ORI}}{}%
+% \end{macrocode}
+% Flush the list of pending sub-caption list entries at the end of the document.
+% \begin{macrocode}
+ \caption@addsubcontentslines{AtEndDocument}%
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Babel package support}
+%
+% \subsection{The arabic \& farsi babel option}
+% \changes{v3.5}{2020/08/02}{\package{arabic} babel support addded}
+%
+% \begin{macrocode}
+\caption@IfBabelArabi{%
+% \end{macrocode}
+%
+% The \package{arabicore} package re-defines |\@make|\-|caption|, |\fnum@figure|, and |\fnum@table|
+% incompatible to the \package{caption} package, therefore we have to restore our resp.~the original definitions here.
+%
+% \begin{macrocode}
+ \let\@makecaption\caption@makecaption
+ \def\fnum@figure{\figurename\nobreakspace\thefigure}%
+ \def\fnum@table{\tablename\nobreakspace\thetable}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The frenchle \& frenchpro package}
+% \changes{v3.0h}{2005/10/03}{\package{frenchle/pro} package support added}
+% \changes{v3.5}{2020/08/01}{\package{frenchle/pro} package support updated}
+%
+% \begin{macrocode}
+\caption@IfFrenchLe{%
+% \end{macrocode}
+%
+% \begin{macro}{\f@ffrench}
+% \begin{macro}{\f@tfrench}
+% |\f@ffrench| and |\f@tfrench| reflect |\fnum@figure| and |\fnum@table|
+% when used in French mode. These contain additional code which typesets
+% the caption separator |\caption|\-|separator| instead of the usual colon.
+% Because this breaks with our |\@make|\-|caption| code we have to remove
+% this additional code here.
+% \begin{macrocode}
+ \def\f@ffrench{\ifx\listoffigures\relax\else\figurename~\thefigure\fi}%
+ \def\f@tfrench{\ifx\listoftables\relax\else\tablename~\thetable\fi}%
+ \let\@eatDP\@undefined
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% Since the \package{frenchle} package overwrites |\@make|\-|caption| (within |\GO|\-|french|),
+% we need to save it beforehand and restore it afterwards.
+% \begin{macrocode}
+ \caption@AtBeginDocument{%
+ \let\caption@original@makecaption\@makecaption}%
+ \g@addto@macro\GOfrench{%
+ \let\@makecaption\caption@original@makecaption}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The hungarian \& magyar babel option}
+% \changes{v3.2}{2009/03/29}{\package{magyar} babel support added}
+% \changes{v3.3}{2018/08/26}{\package{magyar} babel support revised}
+% \changes{v3.5}{2020/08/02}{\package{magyar} babel support updated}
+%
+% \begin{macrocode}
+\caption@IfBabelHungarian{%
+% \end{macrocode}
+%
+% Since the \package{magyar} package tends to overwrite |\@make|\-|caption|
+% we save it beforehand and restore it afterwards.
+% \Note{Currently it will not be overwritten, caused by a side-effect of a
+% work-around for the \package{floatrow} package within \package{caption3}.}
+%
+% \begin{macrocode}
+ \caption@AtBeginDocument{%
+ \let\caption@original@makecaption\@makecaption}%
+ \caption@ifdefined\extrashungarian{%
+ \addto\extrashungarian{%
+ \let\@makecaption\caption@original@makecaption}}{}%
+ \caption@ifdefined\extrasmagyar{%
+ \addto\extrasmagyar{%
+ \let\@makecaption\caption@original@makecaption}}{}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The latvian babel option}
+% \changes{v3.5}{2020/08/02}{\package{latvian} babel support updated}
+%
+% \begin{macrocode}
+\caption@IfBabelLatvian{%
+% \end{macrocode}
+%
+% The \package{latvian} package re-defines |\@make|\-|caption| incompatible to the \package{caption} package,
+% therefore we have to restore our definitions here.
+%
+% \begin{macrocode}
+ \let\@makecaption\caption@makecaption
+% \end{macrocode}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \section{Package support}
+% \changes{v3.1}{2007/04/11}{Package options `float', `longtable' etc.~are not supported anymore, removed}
+%
+% \begin{macro}{\caption@IfPackageLoaded}
+% \changes{v3.0f}{2005/05/29}{3rd argument \meta{code} added, so no extra check is needed}
+% \changes{v3.1}{2007/07/04}{Re-written \& renamed from \cs{caption@ifpackage} to \cs{caption@IfPackageLoaded}}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
+% |\caption@IfPackageLoaded|\marg{package}\oarg{version}\marg{true}\marg{false}\par
+% Some kind of combination of |\@ifpackageloaded| and |\@ifpackagelater|.
+% If the \meta{package} is not loaded yet, the check will be (re-)done
+% |\AtBeginDocument|, so the \meta{package} could be loaded later on, too.
+% \begin{macrocode}
+\newcommand\caption@IfPackageLoaded[1]{%
+ \@testopt{\caption@@IfPackageLoaded{#1}}{}}
+\@onlypreamble\caption@IfPackageLoaded
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@IfPackageLoaded#1[#2]#3#4{%
+ \@ifpackageloaded{#1}\@firstofone{%
+ \caption@Debug{#1 package is not loaded (yet)\@gobble}%
+ \caption@AtBeginDocument}{%
+ \caption@If@Package@Loaded{#1}[{#2}]{#3}{#4}}}
+\@onlypreamble\caption@@IfPackageLoaded
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@If@Package@Loaded#1[#2]{%
+ \@ifpackageloaded{#1}{%
+ \caption@InfoNoLine{#1 package is loaded}%
+ \@ifpackagelater{#1}{#2}\@firstoftwo{%
+ \caption@Error{%
+ For a successful cooperation we need at least version\MessageBreak
+ `#2' of package #1,\MessageBreak
+ but only version\MessageBreak
+ `\csname ver@#1.\@pkgextension\endcsname'\MessageBreak
+ is available}%
+ \@secondoftwo}%
+ }{\@secondoftwo}}
+\@onlypreamble\caption@If@Package@Loaded
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@clearmargin}
+% \changes{v3.1}{2007/05/05}{This macro and its usage added}
+% This macro will be used by some package support stuff where the usual
+% margin setting is not welcome, e.g. in the \package{sidecap} package.
+% \begin{macrocode}
+\newcommand*\caption@clearmargin{%
+ \setcaptionmargin\z@
+ \let\caption@minmargin\@undefined}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@setbool{needfreeze}{0}
+\caption@AtBeginDocument*{%
+ \caption@ifneedfreeze{%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@freezetype}
+% \changes{v3.3}{2013/05/01}{This macro added}
+% |\caption@freezetype|\marg{type}\par
+% Used by the \package{fltpage} \& \package{sidecap} package support.
+% \begin{macrocode}
+ \newcommand*\caption@freezetype[1]{%
+ \caption@settype*{#1}%
+ \captionsetup*[sub]{hypcap=true}% Note: This is just a (q&d) workaround!
+ \caption@freeze}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@freeze}
+% \changes{v3.1}{2007/07/22}{This macro added}
+% \changes{v3.1c}{2007/10/06}{\cs{caption} \& \cs{@caption} revised for enhanced compatibility}
+% \changes{v3.1c}{2007/10/06}{Bugfix: Made \cs{@caption} long}
+% \changes{v3.1f}{2007/11/16}{Uses `space hack' instead of \cs{ignorespaces} now}
+% \changes{v3.1g}{2008/01/29}{Starred variants of \cs{ContinuedFloat} and \cs{captionsetup} added}
+% \changes{v3.2}{2010/10/26}{Bugfix 10-09-01a: Uses \cs{ignorespaces} instead of `space hack' again}
+% \changes{v3.2a}{2011/08/17}{Starred variant of \cs{caption@freeze} removed}
+% \changes{v3.2b}{2011/08/18}{Redefines \cs{caption@setup} instead of \cs{captionsetup} now}
+% \changes{v3.2b}{2011/08/18}{Redefinition of \cs{label} revised}
+% \changes{v3.2c}{2011/08/21}{Revised}
+% \changes{v3.3}{2013/01/06}{Adapted to new switch \cs{caption@caption} etc.}
+% |\caption@freeze|\par
+% Used by the \package{bicaption} package.
+% \begin{macrocode}
+ \newcommand*\caption@freeze{%
+ \let\caption@frozen@continuedfloat\continuedfloat
+ \def\continuedfloat{%
+ \caption@@freeze{\caption@@@@continuedfloat\@captype}%
+ \caption@frozen@continuedfloat}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@frozen@setup\caption@setup
+ \def\caption@setup##1{%
+ \caption@@freeze{\caption@setup{##1}}%
+ \caption@frozen@setup{##1}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@frozen@caption\caption
+ \def\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}%
+% \end{macrocode}
+% \begin{macrocode}
+ \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}}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \global\let\caption@frozen@content\@empty
+ \long\def\caption@@freeze{%
+ \g@addto@macro\caption@frozen@content}%
+% \end{macrocode}
+% \begin{macrocode}
+ \def\caption@warmup{%
+ \let\continuedfloat\caption@frozen@continuedfloat
+ \let\caption@setup\caption@frozen@setup
+ \let\caption\caption@frozen@caption
+ \let\label\caption@frozen@label}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@prepare@defrost}
+% \changes{v3.3}{2013/01/06}{This macro added}
+% Prevent resetting the caption flags
+% \begin{macrocode}
+ \newcommand*\caption@prepare@defrost{%
+ \let\caption@settype\caption@set@type}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@defrost}
+% \changes{v3.1}{2007/07/22}{This macro added}
+% \changes{v3.1g}{2008/01/30}{\cs{caption@defrost@setup} added}
+% \changes{v3.2c}{2011/08/21}{Adapted to changes of \cs{caption@freeze}}
+% \changes{v3.2c}{2011/08/21}{\cs{caption@defrost@setup} removed}
+% |\caption@defrost|
+% \begin{macrocode}
+ \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}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ }{}%
+ \caption@undefbool{needfreeze}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@warmup}
+% \changes{v3.2a}{2011/08/17}{This macro added}
+% |\caption@warmup|
+% \begin{macrocode}
+\let\caption@warmup\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{The changepage package}
+% \changes{v3.4k}{2020/05/30}{Patch of the \package{changepage} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{changepage}[2008/07/23 memoir-v3.7k]{%
+% \end{macrocode}
+%
+% Both environments, \env{adjustwidth} and \env{adjustwidth*}, are starting a \env{list} \cs{item}.
+% But \cs{hsize} isn't set properly inside a \env{list} item, and therefore \cs{@makecaption}
+% (offered by document classes) doesn't work properly when used inside \env{adjustwidth}.
+% Therefore we try to detect the situation ``Are we inside a adjustwidth environment?''
+% inside \cs{@makecaption} and fix this. (Sigh!)
+%
+% We cannot simply set and test a flag here since our adjustment to \cs{hsize} should
+% not be done within a \cs{parbox} within a adjustwidth environment for example,
+% and therefore we store \cs{hsize} and \cs{linewidth}, and test \cs{hsize} and \cs{linewidth}
+% against the stored values instead. If they are equal we are (hopefully) quite save
+% to assume that we are now inside a plain \env{adjustwidth} environment and therefore need
+% to fix \cs{hsize} before typesetting the caption. (Deep sigh!)
+%
+% \begin{macro}{\caption@adjustwidth@hsize}
+% \begin{macro}{\caption@adjustwidth@linewidth}
+% \begin{macrocode}
+ \newdimen\caption@adjustwidth@hsize
+ \newdimen\caption@adjustwidth@linewidth
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@set@adjustwidth}
+% \changes{v3.4k}{2020/05/30}{This macro and its usage added}
+% Store the values of \cs{hsize} and \cs{linewidth}.
+% \begin{macrocode}
+ \providecommand*\caption@set@adjustwidth{%
+ \caption@adjustwidth@hsize\hsize
+ \caption@adjustwidth@linewidth\linewidth}%
+% \end{macrocode}
+% \begin{macrocode}
+ \providecommand*\caption@patch@changepage[1]{%
+ \expandafter\let\csname caption@#1\expandafter\endcsname\csname #1\endcsname
+ \expandafter\renewcommand\csname #1\endcsname[2]{%
+ \@nameuse{caption@#1}{##1}{##2}%
+ \caption@set@adjustwidth}}%
+ \caption@patch@changepage{adjustwidth}%
+ \caption@patch@changepage{adjustwidth*}%
+ \let\caption@patch@changepage\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@test@adjustwidth}
+% \changes{v3.4k}{2020/05/30}{This macro and its usage added}
+% Test if the values of \cs{hsize} and \cs{linewidth} are identical to
+% the ones stored in the \env{adjustwidth} environment.
+% If yes, set \cs{hsize} to the correct value.
+% \begin{macrocode}
+ \providecommand\caption@test@adjustwidth{%
+ \ifdim\hsize=\caption@adjustwidth@hsize
+ \ifdim\linewidth=\caption@adjustwidth@linewidth
+ \hsize=\linewidth
+ \fi
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+ \AtBeginCaption{\caption@test@adjustwidth}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ }{}%
+% \end{macrocode}
+%
+% \subsection{The chkfloat package}
+% \changes{v3.3}{2018/09/06}{Support of the \package{chkfloat} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{chkfloat}[2012/08/19 v0.1]{%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@chkfloat}
+% \changes{v3.3}{2018/09/06}{This macro added}
+% \begin{macrocode}
+ \caption@ifdefined\chkfloat@addcontentsline{%
+ \renewcommand\caption@chkfloat{\chkfloat@addcontentsline}%
+ }{%
+ \renewcommand\caption@chkfloat[2]{%
+ \caption@ifdefined\chkfloat@page{%
+ \addtocontents{fof}{\protect\chkfloat@{\thepage}{\chkfloat@page}{\csname fnum@#1\endcsname: #2}}%
+ }{}}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ }{}%
+% \end{macrocode}
+%
+% \subsection{The float package}
+% \changes{v3.0f}{2005/05/31}{\package{float} package support rewritten and improved}
+% \iffalse
+% (This is a more straight-ahead implementation, but it only works with v1.3
+% now, so v1.2 is no longer supported. The old code including documentation
+% can be found in caption-30f-050530.zip)
+% \fi
+%
+% The \package{float} package usually do not use the \LaTeX\ kernel command
+% |\@caption| to typeset the caption but |\float@caption| instead.
+% (|\@caption| will only be used if the float is re-styled with
+% |\restylefloat*|.)
+%
+% The main two things |\float@caption| is doing different are:
+% \begin{itemize}
+% \item The caption will be typeset inside a |\savebox| called |\@floatcapt|
+% so it can be placed above or below the float contents afterwards.
+% \item |\@makecaption| will not be used to finally typeset the caption.
+% Instead |\@fs@capt| will be used which definition is part of the float
+% style.
+% (Note that |\@fs@capt| will not typeset any vertical space above or below
+% the caption; instead this space will be typeset by the float style code
+% itself.)
+% \end{itemize}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{float}[2001/11/08 v1.3d]{%
+ \@ifpackageloaded{floatrow}{%
+ \caption@If@Package@Loaded{floatrow}[2007/08/24 v0.2a]{}{}%
+ }{%
+% \end{macrocode}
+%
+% \begin{macro}{\@float@setevery}
+% \changes{v3.1k}{2009/10/09}{Bugfix 08-12-05: \cs{color@begin/endgroup} added
+% to redefinition of \cs{caption@setfloatcapt}}
+% \changes{v3.4b}{2019/12/16}{Usage of \cs{caption@float@setname} added}
+% |\@float@setevery|\marg{float type} is provided by the \package{float}
+% package; it's called every time a floating environment defined with
+% |\newfloat| or |\restylefloat| begins.
+% We use this hook to do some adaptations and to setup the proper caption
+% style (if defined) and additional settings declared with
+% |\captionsetup|\oarg{float style}.
+% \begin{macrocode}
+ \let\caption@ORI@float@setevery\@float@setevery
+ \def\@float@setevery#1{%
+ \float@ifcaption{#1}{%
+% \end{macrocode}
+%
+% First of all we set the caption position to it's proper value by
+% converting |\@fs@iftopcapt| (which is part of a float style and
+% controls where the caption will be typeset, above or below the float
+% contents) to our |position=| setting.
+% Since the spacing above and below the caption will be done by the float
+% style and \emph{not} by us this sounds quite useless. But in fact it isn't,
+% since some packages based on \thispackage\ (like the \package{subfig}
+% package) could have an interest for this information and therefore use the
+% |\caption@iftop| macro we provide in our kernel. Furthermore we need this
+% information for ourself in |\captionof| which uses |\@makecaption| to
+% finally typeset the caption with skips.
+% \begin{macrocode}
+ \caption@setposition{\@fs@iftopcapt t\else b\fi}%
+% \end{macrocode}
+%
+% Afterward we redefine |\caption@setfloatcapt| (which will be used inside
+% |\@caption|) so the caption will be set inside the box |\@floatcapt|,
+% without extra vertical space.
+% \begin{macrocode}
+ \renewcommand\caption@setfloatcapt[1]{%
+ \let\@makecaption\caption@@make
+ \global\setbox\@floatcapt\vbox{%
+ \color@begingroup ##1\color@endgroup}}%
+% \end{macrocode}
+%
+% To allow different caption styles for different float styles we also
+% determine the current float style (e.g. `ruled') and select
+% a caption style (and additional settings) with the same name, if defined.
+% \begin{macrocode}
+ \float@getstyle\float@style{#1}%
+ \caption@setstyle*\float@style
+ \caption@setoptions\float@style
+% \end{macrocode}
+%
+% \begin{macrocode}
+ }{}%
+ \caption@float@setname{#1}%
+ \caption@freezeHref % will be defrosted in \float@makebox
+ \caption@ORI@float@setevery{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\float@makebox}
+% \changes{v3.3}{2013/01/06}{Corrects wrong load order hyperref-float now}
+% \changes{v3.3}{2013/02/03}{Correction of wrong load order hyperref-float revised}
+% Redefine |\float@makebox| (only if we are not operating in compatibility mode `v1').
+% \begin{macrocode}
+ \caption@AtBeginDocument{\caption@ifcompatibility{}{%
+% \end{macrocode}
+% If it was redefined by the \package{hyperref} package,
+% we need to build on the original definition (and not on the redefined one).
+% \begin{macrocode}
+ \caption@ifdefined\HyOrg@float@makebox
+ {\let\caption@ORI@float@makebox\HyOrg@float@makebox}%
+ {\let\caption@ORI@float@makebox\float@makebox}%
+ \renewcommand\float@makebox[1]{%
+ \caption@ORI@float@makebox{#1\relax \caption@defrostHref}}%
+% \end{macrocode}
+% \begin{macrocode}
+ }}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@float@setname}
+% \changes{v3.1}{2007/07/08}{float package hook added}
+% \changes{v3.4b}{2019/12/16}{Renamed from \cs{caption@typehook} to \cs{caption@float@setname}}
+% \LaTeX\ and almost every other packages use
+% |\|\meta{type}|name|
+% to provide a macro for the type resp.~environment name -- for example
+% the command |\figurename| will usually contain the name of the floating
+% environment |figure|:
+% \begin{quote}
+% |\newcommand\figurename{Figure}|
+% \end{quote}
+% But the \package{float} package doesn't follow this common naming
+% convention:
+% For floats defined with |\newfloat| it uses |\fname@|\meta{type} instead,
+% which breaks with our code (and with |\autoref| and some other things as
+% well).
+% So we have to map the \package{float} package name to the common one here.\par
+% \Note{If the float was not defined with \cs{newfloat} but with
+% \cs{restylefloat} instead, \cs{fname@}\meta{type} is not defined.}
+% \begin{macrocode}
+ \newcommand*\caption@float@setname[1]{%
+ \expandafter\ifx\csname #1name\endcsname\relax
+ \expandafter\let\csname #1name\expandafter\endcsname\csname fname@#1\endcsname
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0f}{2005/06/26}{Skips of \env{plaintop} and \env{boxed} floats corrected}
+% \begin{macro}{\fs@plaintop}
+% \begin{macro}{\fs@boxed}
+% Since the float styles |plaintop| and |boxed| don't use |\abovecaptionskip|
+% which could be set with |skip=| (|plaintop| uses |\belowcaptionskip| instead of
+% |\abovecaptionskip|, and |boxed| uses a fixed space of |2pt|)
+% we patch the according float style macros here to change this.
+% \begin{macrocode}
+ \g@addto@macro\fs@plaintop{\def\@fs@mid{\vspace\abovecaptionskip\relax}}%
+ \g@addto@macro\fs@boxed{\def\@fs@mid{\kern\abovecaptionskip\relax}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\float@getstyle}
+% \changes{v3.1}{2007/06/10}{This macro added}
+% |\float@getstyle|\marg{cmd}\marg{type}\par
+% Determining the float style is not so easy because the only hint
+% provided by the \package{float} package is the macro
+% |\fst@|\meta{float type} which points to the macro which represents the
+% float style. So for example after
+% \begin{quote}
+% |\floatstyle{ruled}|\\
+% |\newfloat{Program}{tbp}{lop}|
+% \end{quote}
+% |\fst@Program| will be defined as
+% \begin{quote}
+% |\def\fst@Program{\fs@ruled}|\quad.
+% \end{quote}\par
+% So here is what we do: We make the first level expansion of
+% |\fst@|\meta{float type} a string so we can gobble the first four tokens
+% (= |\fs@|), so only the the name of the float style is left.\par
+% \emph{TODO:} We need to convert the catcodes here.
+% \begin{macrocode}
+ \providecommand*\float@getstyle[2]{%
+ \edef#1{%
+ \noexpand\expandafter\noexpand\@gobblefour\noexpand\string
+ \expandafter\expandafter\expandafter\noexpand
+ \csname fst@#2\endcsname}%
+ \edef#1{#1}%
+ \caption@Debug{floatstyle{#2} = `#1'}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\float@ifcaption}
+% \changes{v3.1}{2007/06/23}{This macro added}
+% |\float@ifcaption|\marg{type}\marg{if-clause}\marg{else-clause}\par
+% Here we determine if the user has used |\newfloat| resp.~|\restylefloat|,
+% or |\restylefloat*|.
+% This is quite easy: If |\@float@c@|\meta{captype} is the same as
+% |\float@caption|, the user has used |\newfloat| or |\restylefloat|,
+% otherwise we assume he has used |\restylefloat*|.
+% (This test will fail if some package re-defines |\float@caption|,
+% so we have to assume that there is no one.)
+% \begin{macrocode}
+ \providecommand*\float@ifcaption[1]{%
+ \expandafter\ifx\csname @float@c@#1\endcsname\float@caption
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}}{%
+ \providecommand*\float@ifcaption[1]{\@secondoftwo}%
+% \clearcaptionsetup{boxed}% used by the floatrow package?
+}
+% \end{macrocode}
+%
+% The skip between `boxed' floats and their caption defaults to |2pt|.
+%
+% \begin{macrocode}
+\captionsetup[boxed]{skip=2pt} % do not issue a warning when not used
+% \end{macrocode}
+%
+% \changes{v3.0f}{2005/05/26}{\opt{strut=0} added to caption style \opt{ruled}}
+% \changes{v3.0f}{2005/05/27}{Option \opt{ruled} fixed}
+% To emulate the `ruled' definition of |\@fs@capt| we provide a caption style
+% `ruled' with appropriate options. But if the package option |ruled| was
+% specified, we setup some caption parameters to emulate the behavior
+% of \thispackage\ \version{1.x} option |ruled| instead, i.e.,
+% the current caption settings will be used, but without margin and without
+% `single-line-check'.
+% \begin{macrocode}
+\caption@ifbool{ruled}{%
+ \captionsetup[ruled]{margin=0pt,minmargin=0,slc=0}%
+}{%
+ \DeclareCaptionStyle{ruled}{labelfont=bf,labelsep=space,strut=0}%
+}
+\caption@undefbool{ruled}
+% \end{macrocode}
+%
+% \subsection{The floatflt package}
+% \changes{v3.1}{2007/06/10}{Support of the \package{floatflt} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{floatflt}[1996/02/27 v1.3]{%
+% \end{macrocode}
+%
+% \begin{macro}{\floatingfigure}
+% We patch |\floatingfigure| so |\caption@floatflt| will be used.
+% \begin{macrocode}
+ \let\caption@ORI@floatingfigure\floatingfigure
+ \def\floatingfigure{%
+ \caption@floatflt{figure}%
+ \caption@ORI@floatingfigure}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\floatingtable}
+% Same with |\floatingtable|\ldots
+% \begin{macrocode}
+ \let\caption@ORI@floatingtable\floatingtable
+ \def\floatingtable{%
+ \caption@floatflt{table}%
+% \caption@setautoposition b%
+ \caption@ORI@floatingtable}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@floatflt}
+% \changes{v3.1c}{2007/10/06}{Bugfix: \cs{caption@clearmargin} added}
+% Here we do two things:
+% \begin{enumerate}
+% \item We use |\caption@set|\-|options{|\-|floating|\meta{type}|}| so
+% |\caption|\-|setup[|\-|floating|\meta{type}|]{|\ldots|}| is supported.
+% \item |\line|\-|width| must be set correctly.
+% Usually this is done by |\@par|\-|box|\-|restore| inside |\@caption|,
+% but since we use |\@caption@parbox|\-|restore| we have to map this to
+% |\@par|\-|box|\-|restore| instead.
+% \end{enumerate}
+% \begin{macrocode}
+ \newcommand*\caption@floatflt[1]{%
+ \caption@settype{#1}%
+ \caption@clearmargin
+ \caption@setparboxrestore{full}%
+ \caption@setoptions{floating#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The fltpage package}
+% \changes{v3.1}{2007/07/22}{Support of the \package{fltpage} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{fltpage}[1998/10/29 v.0.3]{%
+ \caption@setbool{needfreeze}{1}%
+% \end{macrocode}
+%
+% \begin{macro}{\FP@positionLabel}
+% \changes{v3.2c}{2011/08/28}{This redefinition added}
+% Original code:
+% \begin{verbatim}
+% \newcommand{\FP@positionLabel}{%
+% FP\@captype-\number\value{FP@\@captype C}-pos}
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \renewcommand\FP@positionLabel{%
+ FP\FP@captype-\number\value{FP@\FP@captype C}-pos}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FP@helpNote}
+% Original code:
+% \begin{verbatim}
+% \newcommand{\FP@helpNote}[2]{%
+% \typeout{FP#1 is inserted on page \pageref{#2}!}}%
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \renewcommand\FP@helpNote[2]{%
+ \begingroup % save \caption@thepage
+ \caption@pageref{#2}%
+ \typeout{FP#1 is inserted on page \caption@thepage!}%
+ \endgroup}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FP@floatBegin}
+% \changes{v3.1f}{2007/11/16}{Uses `space hack' instead of \cs{ignorespaces} now}
+% \changes{v3.1k}{2009/10/09}{Bugfix 09-09-11: Missing \cs{ignorespaces} added}
+% \changes{v3.2c}{2011/08/28}{Adapted to current version of \cs{caption@freeze}}
+% \changes{v3.2f}{2012/02/19}{Bugfix 12-02-16: \texttt{minipage} environment added}
+% \changes{v3.3}{2013/05/01}{Usage of \cs{caption@freeze} replaced by \cs{caption@freezetype}}
+% Original code:
+% \begin{verbatim}
+% \newcommand{\FP@floatBegin}[1]{%
+% \gdef\@captype{#1}%
+% \global\let\FP@savedCaptionCommand\caption%
+% \global\let\FP@savedLabelCommand\label%
+% \ifthenelse{\equal{\@captype}{figure}}
+% {\global\let\old@Fnum\fnum@figure}%
+% {\global\let\old@Fnum\fnum@table}%
+% \let\FP@LabelText\@empty%
+% \let\FP@CaptionText\@empty%
+% \let\FP@optionalCaptionText\@empty%
+% \renewcommand\label[1]{\gdef\FP@LabelText{##1}}%
+% \renewcommand\caption[2][]{%
+% \gdef\FP@optionalCaptionText{##1}\gdef\FP@CaptionText{##2}}%
+% \begin{lrbox}{\FP@floatCorpusBOX}%
+% }%
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \renewcommand*\FP@floatBegin[1]{%
+ \def\FP@captype{#1}%
+ \begin{lrbox}{\FP@floatCorpusBOX}%
+ \minipage\hsize % changes from LR mode to vertical mode
+ \caption@freezetype{#1}%
+ \ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FP@floatEnd}
+% \changes{v3.1g}{2008/01/30}{Some minor bugfixes}
+% \changes{v3.2c}{2011/08/28}{Adapted to current version of \cs{caption@freeze}}
+% \changes{v3.2f}{2012/02/19}{Bugfix 12-02-16: \texttt{minipage} environment added}
+% Original code:
+% \begin{verbatim}
+% \newcommand{\FP@floatEnd}{%
+% \end{lrbox}%
+% \global\setbox\FP@floatCorpusBOX=\box\FP@floatCorpusBOX
+% \stepcounter{FP@\@captype C}%
+% \FP@savedLabelCommand{\FP@positionLabel}%
+% \FP@helpNote{\@captype}{\FP@positionLabel}%
+% \FP@float
+% {\FP@positionLabel}% location label test
+% {\begin{\@captype}[p!]
+% \usebox{\FP@floatCorpusBOX}%
+% \refstepcounter{\@captype}%
+% \ifthenelse{\equal{\FP@LabelText}{\@empty}}
+% {}{\FP@savedLabelCommand{\expandafter\protect\FP@LabelText}}%
+% \end{\@captype}}
+% {\addtocounter{\@captype}{-1}}
+% {\begin{\@captype}[b!]%
+% \ifthenelse{\equal{\FP@guide}{\@empty}}%
+% {}{\ifthenelse{\equal{\@captype}{figure}}%
+% {\renewcommand{\fnum@figure}{\old@Fnum\ {\FP@guide}}}%
+% {\renewcommand{\fnum@table}{\old@Fnum\ {\FP@guide}}}}%
+% \setlength{\abovecaptionskip}{2pt plus2pt minus 1pt} % length above caption
+% \setlength{\belowcaptionskip}{2pt plus2pt minus 1pt} % length above caption
+% \FP@separatorCaption%
+% \ifthenelse{\equal{\FP@optionalCaptionText}{\@empty}}%
+% {\FP@savedCaptionCommand{\expandafter\protect\FP@CaptionText}}%
+% {\FP@savedCaptionCommand[\expandafter\protect\FP@optionalCaptionText]%
+% {\expandafter\protect\FP@CaptionText}}%
+% \end{\@captype}}%
+% }%
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \renewcommand*\FP@floatEnd{%
+ \endminipage
+ \end{lrbox}%
+% \end{macrocode}
+% \begin{macrocode}
+ \stepcounter{FP@\FP@captype C}%
+ \caption@label\FP@positionLabel
+ \FP@helpNote\FP@captype\FP@positionLabel
+% \end{macrocode}
+% \begin{macrocode}
+ \FP@float
+ {\FP@positionLabel}% location label test
+ {\caption@prepare@defrost
+ \begin\FP@captype[p!]%
+ \usebox\FP@floatCorpusBOX
+ \end\FP@captype}%
+ {\@ifundefined{theH\FP@captype}{}{%
+ \expandafter\l@addto@macro\csname theH\FP@captype\endcsname{.FP}}}%
+ {\caption@prepare@defrost
+ \begin\FP@captype[b!]%
+ \let\FP@savedSetfnumCommand\caption@setfnum
+ \def\caption@setfnum##1{%
+ \FP@savedSetfnumCommand{##1}%
+ \ifx\FP@guide\@empty \else
+ \expandafter\l@addto@macro\csname fnum@##1\endcsname{\ {\FP@guide}}%
+ \fi}%
+ \setlength\abovecaptionskip{2pt plus 2pt minus 1pt}% length above caption
+ \setlength\belowcaptionskip{2pt plus 2pt minus 1pt}% length below caption
+ \caption@setoptions{FP\@captype}%
+ \FP@separatorCaption
+ \caption@defrost
+ \end\FP@captype}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{%
+ \let\caption@ifFPlistcap\@undefined
+ \let\caption@ifFPrefcap\@undefined
+}
+% \end{macrocode}
+%
+% \subsection{The hyperref package}
+% \changes{v3.0f}{2005/06/11}{Support of the \package{hyperref} package added}
+% \changes{v3.1}{2007/03/09}{Usage of \cs{hyper@makecurrent} instead of
+% \cs{theHfigure} as indicator for \package{hyperref} package}
+% \changes{v3.2}{2011/07/30}{Test if \package{hyperref} has stopped early revised}
+% \changes{v3.2c}{2011/08/24}{Test if \package{hyperref} has stopped early adapted to current version of \package{hyperref} package: Usage of \cs{IfHyperBoolean} added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{hyperref}[2003/11/30 v6.74m]{%
+ % Test if hyperref has stopped early
+ \caption@ifundefined\IfHyperBoolean{%
+ \caption@set@bool\caption@ifhyp@stoppedearly0%
+ \caption@ifundefined\H@refstepcounter
+ {\caption@set@bool\caption@ifhyp@stoppedearly1}{%
+ \caption@ifundefined\hyper@makecurrent
+ {\caption@set@bool\caption@ifhyp@stoppedearly1}{%
+ \caption@ifundefined\measuring@true
+ {\caption@set@bool\caption@ifhyp@stoppedearly1}{}}}%
+ }{%
+ \def\caption@ifhyp@stoppedearly{\IfHyperBoolean{stoppedearly}}%
+ }%
+ \caption@ifhyp@stoppedearly{% hyperref has stopped early
+ \caption@InfoNoLine{%
+ Hyperref support is turned off\MessageBreak
+ because hyperref has stopped early}%
+ }{%
+ \g@addto@macro\caption@prepareslc{\measuring@true}%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@@@refstepcounter}
+% We redefine |\caption@@refstepcounter| so |\H@refstepcounter| will be used
+% instead of |\refstepcounter| inside |\caption| \& |\captionlistentry|.
+% \begin{macrocode}
+ \renewcommand*\caption@@@refstepcounter{\H@refstepcounter}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makecurrent}
+% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% We redefine |\caption@makecurrent| so a \package{hyperref} label
+% will be defined inside |\@caption|.
+% \Note{Will be redefined by \cs{caption@start}.}
+% \begin{macrocode}
+ \renewcommand*\caption@makecurrent[2]{%
+ \caption@makecurrentHref{#1}%
+ \caption@Debug{hyperref current=\@currentHref}%
+ \caption@gettitle{#2}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\caption@makecurrentHref{\hyper@makecurrent}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makeanchor}
+% \changes{v3.1l}{2010/01/09}{Adapted to the current hyperref package}
+% We redefine |\caption@makeanchor| so a \package{hyperref} anchor
+% will be set inside |\@caption|.
+% \Note{Will be redefined by \cs{caption@start}.}
+% \begin{macrocode}
+ \renewcommand\caption@makeanchor[1]{%
+ \caption@Debug{hyperref anchor: \@currentHref}%
+ % If we cannot have nesting, the anchor is empty.
+ \ifHy@nesting
+ \expandafter\hyper@@anchor\expandafter{\@currentHref}{#1}%
+ \else
+ \Hy@raisedlink{%
+ \expandafter\hyper@@anchor\expandafter{\@currentHref}{\relax}%
+ }#1%
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+ \g@addto@macro\caption@prepareslc{\let\caption@makeanchor\@firstofone}%
+% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{The hypcap option}
+%
+% \begin{macro}{\if@capstart}
+% Like the \package{hypcap} package we define the switch |\if@capstart|, too.
+% \begin{macrocode}
+ \newif\if@capstart
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@start}
+% \changes{v3.0l}{2007/02/20}{%
+% \cs{caption@currentHref} renamed to \cs{hc@currentHref}}
+% \changes{v3.1}{2007/06/21}{%
+% This macro renamed from \cs{capstart} to \cs{caption@start} and revised}
+% While the \package{hypcap} package defines a macro called |\capstart|
+% our variant is called |\caption@start| and is controlled by the option
+% |hypcap=||false|/|true|.
+% \begin{macrocode}
+ \def\caption@start{\caption@ifhypcap\caption@start@\relax}%
+ \def\caption@start@{%
+% \end{macrocode}
+% Generate the \package{hyperref} label and set the \package{hyperref} anchor,
+% usually (if |hypcap=false|) both is done inside |\@caption|.
+% \begin{macrocode}
+ \caption@makestart\@captype
+ \caption@startanchor\@currentHref
+% \end{macrocode}
+% Prevent |\@caption| from generating a new \package{hyperref} label,
+% use the label we save in |\hc@currentHref| instead.
+% (We also support the |@capstart| flag from the \package{hypcap} package.)
+% \begin{macrocode}
+ \global\@capstarttrue
+ \let\hc@currentHref\@currentHref
+ \def\caption@makecurrentHref##1{%
+ \global\@capstartfalse
+ \global\let\@currentHref\hc@currentHref}%
+% \end{macrocode}
+% Prevent |\@caption| from generating a \package{hyperref} anchor since this
+% has already been done.
+% \begin{macrocode}
+ \let\caption@makeanchor\@firstofone
+% \end{macrocode}
+% \begin{macrocode}
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@makestart}
+% \changes{v3.1c}{2007/09/30}{\cs{@currentHref} will be extended by \texttt{caption}
+% instead of \texttt{xxx} now}
+% |\caption@makestart|\marg{type}
+% defines a \package{hyperref} anchor inside |\caption@start|.\par
+% Since we offer |\continuedfloat| the float counter can change between
+% `now' and |\caption|, i.e., we simply don't know the figure or table counter
+% yet and therefore we are not able to generate the `right' \package{hyperref}
+% label.
+% Two different solutions of this problem came into my mind:
+% \begin{enumerate}
+% \item I could use the aux file for this purpose.\par
+% -or-
+% \item I set |hypertexnames=false| locally.
+% Furthermore I use |#1.caption.|\meta{counter} (instead of |#1.|\meta{counter})
+% as naming scheme for |\@currentHref| to avoid conflicts with other hyper
+% links which are generated with |hypertexnames=true|.
+% \end{enumerate}
+% The first idea has the advantage that the `right' anchor name will be
+% generated, but one needs an additional \LaTeX\ run if figures or tables
+% will be inserted or removed.\par
+% The second idea has the advantage that it's very easy to implement, but
+% has some side-effects, e.g. the anchor names don't follow the figure or
+% table label names anymore.\par
+% Since I'm lazy I implemented the second idea, maybe I will revise this
+% later on.
+% \begin{macrocode}
+ \newcommand*\caption@makestart[1]{%
+ \begingroup
+ \Hy@hypertexnamesfalse
+% \gdef\@currentHlabel{}%
+ \hyper@makecurrent{#1.caption}%
+ \endgroup
+ \caption@Debug{hypcap start=\@currentHref}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@startanchor}
+% \changes{v3.1b}{2007/09/17}{Bugfix 06-09-17: We use \cs{caption@anchor} instead of \cs{hyper@@anchor}}
+% \changes{v3.1g}{2008/03/16}{Warning about TeX mode replaced with debug info}
+% |\caption@startanchor|\marg{Href}
+% sets a \package{hyperref} anchor inside |\caption@start|.\par
+% This code was taken from the \package{hypcap} package\cite{hypcap} and adapted.
+% \Note{Since \cs{hyper@@anchor}\marg{Href}\csmarg{\string\relax} can cause
+% a change from vertical mode to horizontal mode (design flaw in
+% \package{hyperref} package!?), and since the workaround
+% \cs{let}\cs{leavevmode}\cs{relax} which can be found in the
+% \package{hypcap} package is not always sufficient
+% (for example with ``Direct pdfmark support'' and \texttt{breaklinks=true}),
+% we use \cs{caption@anchor} instead of \cs{hyper@@anchor} here.}
+% \begin{macrocode}
+ \newcommand*\caption@startanchor[1]{%
+ \ifvmode\begingroup
+ \caption@Debug{hypcap anchor: #1 (vertical mode)}%
+ \@tempdima\prevdepth
+ \nointerlineskip
+ \vspace*{-\caption@hypcapspace}%
+ \caption@anchor{#1}%
+ \vspace*{\caption@hypcapspace}%
+ \prevdepth\@tempdima
+ \endgroup\else
+ \caption@Debug{hypcap anchor: #1 (horizontal mode)}%
+ \caption@anchor{#1}%
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@anchor}
+% \changes{v3.1c}{2007/10/17}{Workaround 07-10-17: We use \cs{caption@raisedlink} instead of \cs{Hy@raisedlink} now}
+% |\caption@anchor|\marg{Href} sets a \package{hyperref} anchor.
+% \begin{macrocode}
+ \newcommand*\caption@anchor[1]{%
+ \ifmeasuring@ \else
+ \caption@raisedlink{\hyper@anchorstart{#1}\hyper@anchorend}%
+ \fi}%
+% \end{macrocode}
+% \Note{Since \cs{Hy@raisedlink} change \cs{@tempdima} we surrounded it by \cs{ifvmode},
+% suppressing ``\texttt{LaTeX Warning: Float too large for page by 1.0pt}'' in \texttt{sideways} floats.
+% (This is not necessary since \package{hyperref} \version{6.77}.)}
+% \begin{macrocode}
+ \ifx\HyperRaiseLinkLength\@tempdima
+ \def\caption@raisedlink#1{\ifvmode#1\else\Hy@raisedlink{#1}\fi}%
+ \else
+ \let\caption@raisedlink\Hy@raisedlink
+ \fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@start}
+% Will be used by |\caption@freezeHref|. Apart from that we issue a warning
+% if we expect a saved \package{hyperref} label coming from |\caption@start|,
+% but there isn't any.
+% \begin{macrocode}
+ \def\caption@@start{%
+ \caption@ifundefined\hc@currentHref{%
+ \caption@Warning{%
+ The option `hypcap=true' will be ignored for this\MessageBreak
+ particular \string\caption}}{}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@freezeHref}
+% Suppress |\caption@start| from generating a \package{hyperref} label and
+% setting a \package{hyperref} anchor. Instead if |\@caption| generates a
+% \package{hyperref} label, it will be stored in |\caption@currentHref|.
+% Furthermore we need to redefine |\caption@setfloatcapt| so no
+% \package{hyperref} anchor will be placed in |\@caption|.
+% \iffalse
+% (Since |\caption@setfloatcapt| will be set to |\@firstofone| inside
+% |\subcaption| there is no need to add its restauration to
+% |\caption@subtypehook|.)
+% \fi
+% \begin{macrocode}
+ \def\caption@freezeHref{%
+ \let\caption@ORI@start\caption@start
+ \def\caption@start{\let\caption@start\caption@ORI@start}%
+% \end{macrocode}
+% \begin{macrocode}
+% \let\caption@ORI@@start\caption@@start
+% \l@addto@macro\caption@subtypehook{%
+% \let\caption@@start\caption@ORI@@start}%
+% \end{macrocode}
+% \begin{macrocode}
+ \global\let\caption@currentHref\@undefined
+ \def\caption@@start{\global\let\caption@currentHref\@currentHref}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@ORI@setfloatcapt\caption@setfloatcapt
+ \renewcommand*\caption@setfloatcapt{%
+ \ifx\caption@currentHref\@undefined \else
+ \let\caption@makeanchor\@firstofone
+ \fi
+ \caption@ORI@setfloatcapt}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@defrostHref}
+% If there is a freezed |\@currentHref|, we set the \package{hyperref}
+% anchor here.
+% \begin{macrocode}
+ \def\caption@defrostHref{%
+ \ifx\caption@currentHref\@undefined \else
+ \caption@startanchor\caption@currentHref
+ \global\let\caption@currentHref\@undefined
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ }}{}
+% \end{macrocode}
+%
+% \subsection{The hypcap package}
+% \changes{v3.0f}{2005/06/22}{Support of the \package{hypcap} package added}
+% \changes{v3.0l}{2007/02/20}{Adapted to \package{hypcap} \version{1.6}}
+% \changes{v3.1e}{2007/11/04}{\package{hypcap} support adapted to \package{hyperref} \version{6.77}}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{hypcap}{% v1.0
+ \ifx\caption@start\relax \else % hyperref hasn't stopped early
+% \end{macrocode}
+%
+% If the \package{hypcap} package was loaded, we give up our own
+% hyperlink placement algorithm and give the control over the placement
+% to the \package{hypcap} package instead.
+%
+% \begin{macro}{\capstart}
+% \changes{v3.1k}{2009/10/09}{Support of \cs{ifcapstart} (\package{hypcap} package \version{1.10}) added}
+% We do this simply by mapping |\capstart| to |\caption@start@|,
+% although our code does not behave exactly like the original one:
+% The original |\capstart| has an effect on the next |\caption|
+% only but our version affects \emph{all} |\caption|s in the same
+% environment, at least unless a new |\capstart| will be placed.
+% \begin{macrocode}
+ \let\caption@ORI@capstart\capstart % save for compatibility mode
+ \caption@ifundefined\capstarttrue % check for v1.10 of hypcap package
+ {\def\capstart{\caption@start@}}%
+ {\def\capstart{\ifcapstart\caption@start@\fi}}%
+ \let\caption@start\relax
+ \let\caption@@start\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@hypcapspace}
+% Furthermore we map our |\caption@hypcapspace| to |\hypcapspace|
+% offered by the \package{hypcap} package.
+% \begin{macrocode}
+ \caption@set@bool\caption@ifhypcap 1%
+ \renewcommand*\caption@hypcapspace{\hypcapspace}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \fi}{}
+% \end{macrocode}
+%
+% \subsection{The listings package}
+% \changes{v3.0b}{2004/05/16}{Support of the \package{listings} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{listings}[2004/02/13 v1.2]{%
+% \end{macrocode}
+%
+% \begin{macro}{\lst@MakeCaption}
+% \changes{v3.1g}{2008/01/20}{Bugfix: Skips are handled correctly now}
+% \changes{v3.1k}{2008/03/29}{Bugfix 08-10-16-dctt: \texttt{rule=0} added}
+% \changes{v3.2}{2010/10/26}{Bugfix 10-07-20a: Set \cs{hsize} to \cs{linewidth}, if necessary}
+% \changes{v3.4c}{2020/01/01}{Ugly workaround for usage in lists added}
+% \changes{v3.4d}{2020/01/01}{Ugly workaround for usage in lists revised}
+% To support the \package{listings} package we need to redefine
+% |\lst@Make|\-|Caption| so the original stuff is nested with
+% |\caption@begin| and |\caption@end| etc.\par
+% We set a flag inside the "Init" hook of the \package{listings} package (where adaption of |\line|\-|width| etc.~takes place).
+% \begin{macrocode}
+ \caption@setbool{lst@Init}{0}%
+ \lst@AddToHook{Init}{\caption@setbool{lst@Init}{1}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@ORI@lst@MakeCaption\lst@MakeCaption
+ \def\lst@MakeCaption#1{% #1 is `t' or `b'
+% \end{macrocode}
+% This macro is always called twice by the \package{listings} package (with `t' resp. `b' as parameter),
+% therefore we need an extra group here.
+% \begin{macrocode}
+ \begingroup
+% \end{macrocode}
+% Inside lists the \package{listings} package ignores the left margin (|\@total|\-|left|\-|margin|) for captions.
+% We emulate this behaviour by adding a negative skip which will be typeset ahead of |\caption@box|.\par
+% Note: We only need to do this if the ``Init'' hook of the \package{listings} package wasn't called yet.
+% \begin{macrocode}
+ \caption@iflst@Init{}{%
+ \edef\caption@lst@leftskip{\noexpand\hskip-\the\@totalleftmargin\noexpand\relax}%
+ \l@addto@macro\caption@beginhook\caption@lst@leftskip}%
+% \end{macrocode}
+% We set |position=#1| and if it was set to `top',
+% we swap the skips so the default behavior of the \package{listings} package
+% will not be changed. (Note that the \package{listings} package has set its
+% own |\abovecaptionskip| \& |\belowcaptionskip| values prior to calling
+% \cs{lst@MakeCaption}.)
+% \begin{macrocode}
+ \caption@setposition{#1}%
+ \caption@iftop{%
+ \@tempdima\belowcaptionskip
+ \belowcaptionskip\abovecaptionskip
+ \abovecaptionskip\@tempdima}{}%
+% \end{macrocode}
+% Workaround for issue with wrong skips (FIXME: This should be examined further)
+% \begin{macrocode}
+ \caption@setup{rule=0}%
+% \end{macrocode}
+% Afterwards we set the local `lstlisting' options.
+% \begin{macrocode}
+ \caption@setoptions{lstlisting}%
+% \end{macrocode}
+% If the |position=| is now set to |auto|, we take over the |captionpos=|
+% setting from the \package{listings} package.
+% \begin{macrocode}
+ \caption@setautoposition{#1}%
+% \end{macrocode}
+% At the end we do similar stuff as in our \cs{@caption} code.
+% \begin{macrocode}
+ \caption@begin{lstlisting}%
+ \caption@ORI@lst@MakeCaption{#1}%
+ \caption@end
+% \end{macrocode}
+% \begin{macrocode}
+ \endgroup}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\lst@makecaption}
+% \begin{macro}{\lst@maketitle}
+% Wrapper macros for typesetting the |caption=| resp. |title=| value.
+% \begin{macrocode}
+ \def\lst@makecaption{\caption@starfalse\@makecaption}%
+ \def\lst@maketitle{\caption@startrue\@makecaption\@empty}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ext@lstlisting}
+% \changes{v3.1}{2007/03/03}{This macro added}
+% Since the \package{listings} package do not define |\ext@lstlisting|
+% but we needed it when |\captionof{lstlisting}| will be done by the end user,
+% we define it here.
+% \begin{macrocode}
+ \providecommand*\ext@lstlisting{lol}%
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.1a}{2007/07/13}{Bugfix 07-09-13: \cs{lst@@caption} will not be re-defined anymore}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The longtable package}
+%
+% \begin{macro}{\LTcaptype}
+% \changes{v3.1}{2007/07/06}{This macro and its support added}
+% |\LTcaptype| is preset to |table|.
+% \begin{macrocode}
+\providecommand*\LTcaptype{table}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@AtBeginLongtable}
+% \changes{v3.5}{2018/04/15}{This macro added}
+% \begin{macrocode}
+\providecommand*\caption@LT@array{}
+\newcommand\caption@AtBeginLongtable{%
+ \g@addto@macro\caption@LT@array}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{longtable}[1995/05/24 v3.14]{%
+% \end{macrocode}
+% \begin{macrocode}
+ \RequirePackage{ltcaption}[=2018/08/26]%
+ \let\LT@@makecaption\@undefined
+% \end{macrocode}
+%
+% \begin{macro}{\LT@array}
+% \changes{v3.1}{2007/07/22}{This redefinition added}
+% \changes{v3.1a}{2007/09/16}{Bugfix: This redefinition will always be done \cs{AtBeginDocument}}
+% \changes{v3.1g}{2008/01/20}{Bugfix in \cs{captionlistentry}: Table counter will not be incremented anymore, \cs{nameref} works}
+% \changes{v3.3}{2016/01/31}{Support for \cs{bicaption} added}
+% \changes{v3.3}{2018/10/05}{Definition of \cs{captionlistentry} fixed}
+% \changes{v3.5}{2018/04/15}{Usage of \cs{caption@AtBeginLongtable} added}
+% We redefine |\LT@array| here to get |\captionsetup|\marg{options} working inside |longtable|s.
+% \Note{Since the \package{hyperref} package patches \cs{LT@array} as well
+% and since this only works with the original definition of \cs{LT@array},
+% we have to do this after the \package{hyperref} package, i.e.~\cs{AtBeginDocument}.}
+% \begin{macrocode}
+ \caption@AtBeginDocument{%
+ \let\caption@ORI@LT@array\LT@array
+ \renewcommand*\LT@array{%
+ \caption@LT@array
+ \caption@ORI@LT@array}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@AtBeginLongtable{%
+% |\captionsetup| for longtable:
+% \begin{macrocode}
+ \global\let\caption@opt@@longtable\@undefined
+ \def\captionsetup{%
+ \noalign\bgroup
+ \@ifstar\@captionsetup\@captionsetup}% gobble *
+ \def\@captionsetup#1{\LT@captionsetup{#1}\egroup}%
+ \def\LT@captionsetup#1{%
+ \captionsetup@startrue\caption@setup@options[@longtable]{#1}%
+ \global\let\caption@opt@@longtable\caption@opt@@longtable}%
+% \end{macrocode}
+% |\captionlistentry| for longtable:
+% \begin{macrocode}
+ \def\captionlistentry{%
+ \noalign\bgroup
+ \@ifstar{\egroup\LT@listentry\LTcaptype}% gobble *
+ {\egroup\LT@listentry\LTcaptype}}%
+% \end{macrocode}
+% |\continuedfloat| for longtable:\\
+% {\small(Commented out, since it's not deeply tested and quite useless anyway)}
+% \Note{\package{hyperref} versions $<$ v6.76j uses $2\times$ \cs{hyper@makecurrent}}
+% \begin{macrocode}
+% \caption@ifhypcap{%
+% \let\caption@ORI@hyper@makecurrent\hyper@makecurrent
+% \def\hyper@makecurrent##1{%
+% \let\hyper@makecurrent\caption@ORI@hyper@makecurrent
+% \caption@makestart{##1}%
+%% \let\Hy@LT@currentHlabel\@currentHlabel
+% \let\Hy@LT@currentHref\@currentHref
+% \def\hyper@makecurrent####1{%
+%% \let\@currentHlabel\Hy@LT@currentHlabel
+% \let\@currentHref\Hy@LT@currentHref}}%
+% \let\caption@ORI@continuedfloat\continuedfloat
+% \def\continuedfloat{\noalign{%
+% \gdef\caption@setContinuedFloat{%
+% \let\caption@reset@continuedfloat\@gobble}%
+% \def\caption@setoptions##1{%
+% \g@addto@macro\caption@setContinuedFloat{%
+% \caption@setoptions{##1}}}%
+% \let\@captype\LTcaptype
+% \caption@ORI@ContinuedFloat}}%
+% }{%
+% \def\continuedfloat{\noalign{%
+% \caption@Error{%
+% \noexpand\continuedfloat inside longtables\MessageBreak
+% is only available with `hypcap=true'}}}%
+% }%
+% \global\let\caption@setContinuedFloat\@empty
+ \def\continuedfloat{\noalign{%
+ \caption@Error{\noexpand\continuedfloat outside float}}}%
+% \end{macrocode}
+% |\bicaption| for longtable:
+% \begin{macrocode}
+ \let\bicaption\LT@bicaption
+% \end{macrocode}
+% \begin{macrocode}
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LT@capti@n}
+% \changes{v3.3}{2016/02/01}{This re-definition added}
+% The original implementation:
+% \begin{verbatim}
+% \def\LT@capti@n{%
+% \@ifstar
+% {\egroup\LT@c@ption\@gobble[]}%
+% {\egroup\@xdblarg{\LT@c@ption\@firstofone}}}
+% \end{verbatim}%^^A
+% Our implementation uses |\caption@xdblarg| instead of |\@xdblarg|:
+% \begin{macrocode}
+ \def\LT@capti@n{%
+ \@ifstar
+ {\egroup\LT@c@ption\@gobble[]}%
+ {\egroup\caption@xdblarg{\LT@c@ption\@firstofone}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LT@makecaption}
+% \changes{v3.0d}{2004/08/10}{Bugfix 04-08-04: \cs{abovecaptionskip} \& \cs{belowcaptionskip} will be used now}
+% \changes{v3.0e}{2005/05/05}{Bugfix: \cs{captionsetup[longtable]} overrides \cs{LTcapwidth} now}
+% \changes{v3.0h}{2005/10/07}{\cs{caption@LT@make} introduced}
+% \changes{v3.3}{2016/02/01}{Support for \cs{bicaption} via \cs{caption@LT@setup} added}
+% \changes{v3.3a}{2019/04/02}{Work-around for problem with \package{floatrow} added}
+% |\LT@makecaption|\marg{cmd}\marg{label}\marg{text}\par
+% \smallskip
+% The original definition:
+% \begin{verbatim}
+% \def\LT@makecaption#1#2#3{%
+% \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{%
+% % Based on article class "\@makecaption", "#1" is "\@gobble" in star
+% % form, and "\@firstofone" otherwise.
+% \sbox\@tempboxa{#1{#2: }#3}%
+% \ifdim\wd\@tempboxa>\hsize
+% #1{#2: }#3%
+% \else
+% \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
+% \fi
+% \endgraf\vskip\baselineskip}%
+% \hss}}}
+% \end{verbatim}%^^A
+% Our definition:
+% \begin{macrocode}
+ \renewcommand\LT@makecaption[3]{%
+ \caption@LT@make{%
+ \caption@LT@settype\LTcaptype
+% \end{macrocode}
+% |\caption@LT@setup| is re-defined inside the \package{bicaption} package
+% and contains the preparation of typesetting of the bilingual caption.
+% \begin{macrocode}
+ \caption@LT@setup
+% \end{macrocode}
+% \iffalse
+% The default |position=| setting for longtables is |top|.
+% (This emulates the standard behavior of the \package{longtable} package
+% which has no skip above the caption but a skip below it.)
+% \fi
+% |position=auto| is a bad idea for longtables, but we do our very best.
+% This works quite well for captions inside the longtable contents, but
+% not for captions inside the longtable (end)foot.
+% \Note{This should be `top' if unclear!}
+% \begin{macrocode}
+ \caption@setautoposition{\ifcase\LT@rows t\else b\fi}%
+% \end{macrocode}
+% We set |\ifcaption@star| according the 1st argument.
+% \begin{macrocode}
+ \caption@startrue#1\caption@starfalse
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@prepare@stepcounter\LTcaptype{LT}%
+% \end{macrocode}
+% \changes{v3.1}{2007/05/05}{\cs{caption@font@normal} added}
+% \begin{macrocode}
+ \caption@begin\LTcaptype
+ \caption@normalsize
+% \end{macrocode}
+% The following skip has the purpose to correct the height of the
+% |\parbox[t]|. Usually it's the height of the very first line, but
+% because of our extra skips (|\abovecaptionskip| and |\belowcaptionskip|)
+% it's always |0pt|.\par
+% (A different idea would be typesetting the first skip outside the longtable
+% column with |\noalign{\vskip|\ldots|}|, but this means we have to move
+% |\caption@begin| to some other place because it does not work in tabular
+% mode. And at the moment I have no idea on how to do this in an elegant
+% way\ldots)
+% \begin{macrocode}
+ \vskip-\ht\strutbox
+% \end{macrocode}
+% Work-around for problem with \package{floatrow}:
+% The |\below|\-|caption|\-|skip| disturbs the environment in which the caption is actually typeset (by creating extra, unwanted space),
+% so we supress this skip if the \package{floatrow} package is loaded.
+% (This fixes \issue{50})
+% \begin{macrocode}
+ \caption@ifdefined\FBifcaptop{%
+ \let\caption@belowskip\@empty}{}%
+% \end{macrocode}
+% The following code should look familiar. We do our skips and use
+% |\caption@@make| to typeset the caption itself.
+% \begin{macrocode}
+ \caption@make@above
+ \caption@@make{#2}{#3}\endgraf
+ \caption@make@below
+ \caption@end}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LT@listentry}
+% \changes{v3.3}{2018/08/26}{This macro added}
+% \changes{v3.3}{2018/10/05}{Bugfix: \cs{ignorespaces} added}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
+% \begin{macrocode}
+ \renewcommand*\LT@listentry[2]{%
+ \begingroup
+ \caption@LT@settype{#1}%
+ \caption@listentry\@firstoftwo[{#1}]{#2}%
+ \endgroup\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@LT@settype}
+% \changes{v3.3}{2018/08/26}{This macro added}
+% \changes{v3.3}{2018/10/05}{Uses argument no. 1 instead of \cs{LTcaptype}}
+% \begin{macrocode}
+ \newcommand*\caption@LT@settype[1]{%
+ \caption@settype*{#1}%
+% \end{macrocode}
+% If |\LTcapwidth| is not set to its default value |4in| we assume
+% that it shall overwrite our own setting.
+% (But |\captionsetup[longtable]{width=|\ldots|}| will overwrite |\LTcapwidth|.)
+% \begin{macrocode}
+ \ifdim\LTcapwidth=4in \else
+ \setcaptionwidth\LTcapwidth
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@setoptions{longtable}%
+% \caption@setContinuedFloat
+% \end{macrocode}
+% Finally set options applied by |\captionsetup| inside the longtable.
+% \begin{macrocode}
+ \caption@setoptions{@longtable}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\flrow@setlist}
+% \changes{v3.4g}{2020/01/03}{Redefinition of this macro added}
+% The \package{floatrow} package uses |\flrow@setlist{{table}{longtable}}| inside its redefinition of |\LT@array| without setting |\@captype| first,
+% and this makes |\captionsetup[table]{name=...}| doomed to fail for longtables (``Undefined control sequence'').
+% Unfortunately we cannot easily patch |\LT@array| again to fix this bug in \package{floatrow} since it will be patched |\AtBeginDocument|.
+% Therefore we patch |\flrow@setlist| instead to catch and fix the bug on-the-fly.
+% \begin{macrocode}
+ \caption@AtBeginDocument{\caption@ifdefined\flrow@setlist@{%
+ \caption@InfoNoLine{Fixing longtable code of `floatrow' package}%
+ \let\caption@flrow@setlist@\flrow@setlist@
+ \renewcommand\flrow@setlist@[1]{%
+ \def\caption@tempa{{table}{longtable}}%
+ \def\caption@tempb{#1}%
+ \ifx\caption@tempa\caption@tempb
+ \def\@captype{table}%
+ \fi
+ \caption@flrow@setlist@{#1}}%
+ }{}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{%
+ \let\caption@AtBeginLongtable\@gobble
+ \let\caption@LT@array\@undefined
+}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@LT@setup}
+% \changes{v3.3}{2016/02/01}{This macro added}
+% Hook for stuff which prepares the typesetting of the \package{longtable} caption.
+% \begin{macrocode}
+\providecommand*\caption@LT@setup{}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{The picinpar package}
+% \changes{v3.1}{2007/06/13}{Support of the \package{picinpar} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{picinpar}{%
+% \end{macrocode}
+%
+% \begin{macro}{\figwindow}
+% \begin{macro}{\tabwindow}
+% The \package{picinpar} package comes with its own caption code
+% (|\wincaption|, |\@wincaption|, |\@makewincaption|, \ldots)
+% so we redefine |\figwindow| \& |\tabwindow| to use |\caption| instead.
+% \begin{macrocode}
+ \long\def\figwindow[#1,#2,#3,#4] {%
+ \caption@window{figure}%
+ \caption@setoptions{figwindow}%
+ \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }%
+% \end{macrocode}
+% \begin{macrocode}
+ \long\def\tabwindow[#1,#2,#3,#4] {%
+ \caption@window{table}%
+ \caption@setoptions{tabwindow}%
+ \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@window}
+% \changes{v3.1c}{2007/10/06}{Bugfix: \cs{caption@clearmargin} added}
+% Beside calling |\caption@settype| we redefine |\caption@par|\-|box|\-|restore|
+% (as in \package{floatflt} \& \package{picins} package support)
+% and |\@makecaption| (as in \package{float} package support) here.
+% \begin{macrocode}
+ \newcommand*\caption@window[1]{%
+ \let\@makecaption\caption@@make
+ \caption@setautoposition b%
+ \caption@settype{#1}%
+ \caption@clearmargin
+ \caption@setparboxrestore{full}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@wincaption}
+% \changes{v3.1d}{2007/10/25}{Missing \% added}
+% \changes{v3.3}{2013/04/14}{\cs{caption@ContinuedFloattrue} added}
+% \changes{v3.3}{2018/10/06}{\cs{caption@ContinuedFloattrue} replaced by \cs{caption@setflag1}}
+% This one finally typesets the caption using |\caption|.
+% \begin{macrocode}
+ \newcommand\caption@wincaption[1]{%
+% \end{macrocode}
+% This will be done twice for every |figwindow| \& |tabwindow| caption --
+% on the first run |\picwd| is |0pt|, on the second run |\picwd| is |\hsize|.
+% \begin{macrocode}
+ \ifdim\picwd=\z@
+ \let\caption@makecurrent\@gobbletwo
+ \let\caption@@start\relax
+ \caption@prepareslc
+ \else
+ \caption@setflag1%
+ \fi
+% \end{macrocode}
+% The argument |#1| could contain simply the caption text
+% (e.g.~|A figure caption|), but it could also contain an optional argument,
+% the \meta{lst\_entry}
+% (e.g.~|[An| |entry| |to| |the| |LOF]||{A| |figure| |caption}|).
+% Therefore we have to test if |#1| begins with~|[| or not; furthermore we
+% support a starred variant -- as in |\caption*| -- so we test for~|*|, too.
+% \begin{macrocode}
+ \edef\@tempa{\expandafter\noexpand\@car#1\@nil}%
+ \if\@tempa*%
+ \let\@tempa\@firstofone
+ \else\if\@tempa[%]
+ \let\@tempa\@firstofone
+ \else
+ \let\@tempa\@empty
+ \fi\fi
+ \expandafter\caption\@tempa{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The picins package}
+% \changes{v3.0j}{2006/01/26}{Support of the \package{picins} package added}
+%
+% \begin{macro}{\piccaptiontype}
+% |\piccaptiontype|\marg{type}\par
+% We offer this macro for changing the \meta{type} of the caption, so the user
+% doesn't have to redefine |\@captype|, as proposed in the \package{picins}
+% documentation.
+% \Note{We define this macro here so it can be used in the
+% preamble of the document, even when \thispackage\ was loaded prior to the
+% \package{picins} package.}
+% \begin{macrocode}
+\newcommand*\piccaptiontype[1]{\def\@piccaptype{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{picins}{%
+% \end{macrocode}
+%
+% Initial set |\@piccaptype| and undefine |\@captype| which was set to
+% |figure| by the \package{picins} package.
+% \begin{macrocode}
+ \caption@ifundefined\@piccaptype{%
+ \caption@iftype{%
+ \let\@piccaptype\@captype
+ }{%
+ \def\@piccaptype{figure}%
+ }%
+ }{}%
+ \let\@captype\@undefined
+% \end{macrocode}
+%
+% \begin{macro}{\piccaption}
+% The original code:
+% \begin{verbatim}
+% \def\piccaption{\@ifnextchar [{\@piccaption}{\@piccaption[]}}
+% \end{verbatim}%^^A
+% Our code uses |\caption@star| so |\piccaption*| works,
+% and |\caption@dblarg| so |\piccaption{}| works correctly.
+% \begin{macrocode}
+ \def\piccaption{\caption@star\relax{\caption@dblarg\@piccaption}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\make@piccaption}
+% \changes{v3.1}{2007/12/06}{Bugfix: \cs{caption@clearmargin} will always be used now}
+% The original code:
+% \begin{verbatim}
+% \def\make@piccaption{%
+% [...]
+% \setbox\@TEXT=\vbox{\hsize\hsiz@\caption[\sh@rtf@rm]{\capti@nt@xt}}%
+% }
+% \end{verbatim}%^^A
+% In our code we have to correct several things:
+% \begin{enumerate}
+% \item |\@captype| must be defined, since we have removed the global
+% definition.
+% \item We use |\caption@setoptions{parpic}| so
+% |\captionsetup[parpic]{|\ldots|}| is supported.
+% \item |\linewidth| must be set correctly.
+% Usually this is done by |\@parbox|\-|restore| inside |\@caption|,
+% but since we use |\@caption@parbox|\-|restore| we have to map this to
+% |\@parbox|\-|restore| instead.
+% \item The two arguments of |\caption| (|\sh@rtf@rm| \& |\capti@nt@xt|)
+% should be expanded on first level so |\caption[]{|\ldots|}| and
+% |\caption[|\ldots|]{}| work correctly.
+% \end{enumerate}
+% \begin{macrocode}
+ \let\caption@ORI@make@piccaption\make@piccaption
+ \def\make@piccaption{%
+ \let\caption@ORI\caption
+% \end{macrocode}
+% \begin{macrocode}
+ \long\def\caption[##1]##2{%
+ \caption@freezeHref % will be defrosted in \ivparpic
+ \caption@settype\@piccaptype
+% \ifnum\c@piccaptionpos>2\relax
+ \caption@clearmargin
+% \else
+% \captionwidth\z@ % do not use "width=" setting
+% \fi
+ \caption@setparboxrestore{full}%
+ \caption@setoptions{parpic}%
+ \caption@setautoposition b%
+% \end{macrocode}
+% \begin{macrocode}
+ \expandafter\expandafter\expandafter\caption@ORI
+ \expandafter\expandafter\expandafter[%
+ \expandafter\expandafter\expandafter{%
+ \expandafter##1\expandafter}\expandafter]\expandafter{##2}}%
+% \end{macrocode}
+% {\footnotesize\begin{quote}
+% \leavevmode\llap{-or-\quad}%^^A
+% |\begingroup|\\
+% | \toks0\expandafter{##1}| |\toks2\expandafter{##2}|\\
+% | \edef\x{\endgroup|\\
+% | \noexpand\caption@ORI[{\the\toks0}]{\the\toks2}}|\\
+% | \x|
+% \end{quote}
+% \begin{quote}
+% \leavevmode\llap{-or-\quad}%^^A
+% |\edef\x{%|\\
+% | \noexpand\caption@ORI[{\unexpanded\expandafter{##1}}]%|\\
+% | {\unexpanded\expandafter{##2}}}|\\
+% |\-|
+% \end{quote}}
+% \begin{macrocode}
+ \caption@ORI@make@piccaption
+ \let\caption\caption@ORI}%
+% \end{macrocode}
+% \end{macro}
+%
+
+% \begin{macro}{\ivparpic}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
+% We need to set our \package{hyperref} anchor here.
+% Not bullet-proof since we have to redefine |\noindent| here!
+% \begin{macrocode}
+ \let\caption@ORI@ivparpic\ivparpic
+ \def\ivparpic(#1,#2)(#3,#4)[#5][#6]#7{%
+ \let\caption@ORI@noindent\noindent
+ \def\noindent{%
+ \caption@defrostHref
+ \let\noindent\caption@ORI@noindent
+ \noindent}%
+ \caption@ORI@ivparpic(#1,#2)(#3,#4)[{#5}][{#6}]{#7}%
+ \let\noindent\caption@ORI@noindent}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{%
+ \let\piccaptiontype\@undefined
+}
+% \end{macrocode}
+%
+% \subsection{The rotating package}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{rotating}[1995/08/22 v2.10]{%
+% \end{macrocode}
+%
+% \begin{macro}{\rotcaption}
+% \changes{v3.0c}{2004/07/16}{Bugfix: Check for \cs{caption@star} removed}
+% \changes{v3.0i}{2005/12/07}{Rewritten, works with \package{hyperref} now}
+% Make |\rotcaption*| work.
+% \begin{macrocode}
+ \def\rotcaption{\let\@makecaption\@makerotcaption\caption}%
+% \let\@rotcaption\@undefined
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\rotcaptionof}
+% \changes{v3.0i}{2005/12/07}{New}
+% Make |\rotcaptionof(*)| work.
+% \begin{macrocode}
+ \def\rotcaptionof{%
+ \caption@teststar\caption@of{\rotcaption*}\rotcaption}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makerotcaption}
+% \changes{v3.0i}{2005/12/06}{Rewritten, should finally work proper now}
+% \changes{v3.0m}{2007/03/04}{Uses \cs{caption@parbox} instead of \cs{caption@start/endbox} now}
+% \changes{v3.3}{2012/12/26}{Rewritten (again)}
+% Original (bugfixed) code:
+% \begin{verbatim}
+% \long\def\@makerotcaption#1#2{%
+% \setbox\@tempboxa\hbox{#1: #2}%
+% \ifdim \wd\@tempboxa > .8\vsize
+% \rotatebox{90}{%
+% \begin{minipage}{.8\textheight}#1: #2\end{minipage}%
+% }%\par % <== \par removed (AR)
+% \else%
+% \rotatebox{90}{\box\@tempboxa}%
+% \fi
+% \nobreak\hspace{12pt}% <== \nobreak added (AR)
+% }
+% \end{verbatim}%^^A
+% Our version emulates this behavior, but if |width=| is set,
+% the rotated caption is always typeset as |\parbox|.
+% (Note that |margin=| is not supported here.)
+% \begin{macrocode}
+ \long\def\@makerotcaption#1#2{%
+ \rotatebox{90}{%
+ \ifdim\captionwidth=\z@
+ \setcaptionwidth{.8\vsize}%
+ \l@addto@macro\caption@singleline{%
+ \caption@setup{parbox=none}}%
+ \fi
+ \let\caption@calcmargin\relax
+ \caption@@make{#1}{#2}}%
+ \nobreak\hspace{12pt}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The sidecap package}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{sidecap}[2003/06/06 v1.6f]{%
+ \caption@setbool{needfreeze}{1}%
+% \end{macrocode}
+%
+% \begin{macro}{\SC@zfloat}
+% \changes{v3.0b}{2004/05/16}{Local definition of \cs{captionsetup} added}
+% \changes{v3.0c}{2004/07/16}{Bugfix 04-07-15: Check for \cs{caption@star} removed}
+% \changes{v3.1c}{2007/10/06}{\cs{caption} will be saved \& restored now}
+% \changes{v3.2a}{2011/08/17}{Bugfix: Uses \cs{caption@freeze} instead of \cs{caption@freeze*} now}
+% \changes{v3.3}{2013/05/01}{Usage of \cs{caption@freeze} replaced by \cs{caption@freezetype}}
+% This macro will be called at the start of the environment, here is a good
+% opportunity to do some adaptations to |\caption| and |\captionsetup|.
+% \begin{macrocode}
+ \let\caption@ORI@SC@zfloat\SC@zfloat
+ \def\SC@zfloat#1#2#3[#4]{%
+% \end{macrocode}
+% First we use the original definition, but restore \cs{caption} and \cs{label}
+% so \cs{caption@freeze} and \cs{caption@warmup} will work correctly.
+% \begin{macrocode}
+ \caption@ORI@SC@zfloat{#1}{#2}{#3}[#4]%
+ \SC@RestoreCommands
+% \end{macrocode}
+% Since the sidecap package uses our |\caption| code outside the
+% environment the regular |\captionsetup| will not work.
+% So we need a special version here which saves the given argument list
+% which will be executed later on.
+% Furthermore we need to make |\caption*| work.
+% \begin{macrocode}
+ \caption@freezetype{#2}%
+% \end{macrocode}
+% The sidecap package uses |\ifx\label\SC@label| to test if it is just inside a
+% |SC|\-|figure| or not. So we redefine |\SC@label| here so this test will still work.
+% \begin{macrocode}
+ \let\SC@label\label}%
+% \end{macrocode}
+% \begin{macrocode}
+ \providecommand*\SC@RestoreCommands{%
+ \let\caption=\SC@orig@caption \let\label=\SC@orig@label}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\endSC@FLOAT}
+% \changes{v3.0i}{2006/01/12}{\cs{@listdepth}\cs{z@} added}
+% \changes{v3.1}{2007/05/05}{Call of \cs{caption@setoptions}\arg{SCfloat} added}
+% This macro will be called at the end of the environment, here we need to
+% setup our stuff before the \package{sidecap} package actually typesets
+% its caption.
+% \begin{macrocode}
+ \let\caption@ORI@endSC@FLOAT\endSC@FLOAT
+ \def\endSC@FLOAT{%
+% \end{macrocode}
+% Before we can typeset the caption we need to set the margin to zero
+% because any extra margin would only be disturbing here.\par
+% (We don't need to take care about the caption position because
+% the sidecap package set both |\abovecaptionskip| and |\belowcaptionskip|
+% to a skip of zero anyway.)\par
+% Furthermore |\SC@justify| will override the caption justification, if set.
+% The usage of |\SC@justify| differs from version to version of the
+% \package{sidecap} package:\par
+% \begin{tabular}{ll}
+% Version 1.4: & |\SC@justify| is not defined\\
+% Version 1.5: & |\SC@justify| is |\relax| when not set\\
+% Version 1.6: & |\SC@justify| is |\@empty| when not set\\
+% \end{tabular}
+% \begin{macrocode}
+ \def\caption@setSC@justify{%
+ \caption@clearmargin
+ \ifx\SC@justify\@empty \else
+ \let\caption@justification\SC@justify
+ \let\SC@justify\@empty
+ \fi}%
+% \end{macrocode}
+% Make the original definition of |\endSC@FLOAT| to use our caption
+% stuff instead of its own.
+% \Note{At this point the \package{sidecap} definition of \cs{caption} is valid,
+% not the regular one!}
+% \begin{macrocode}
+ \let\caption\SC@orig@caption
+ \def\SC@orig@caption[##1]##2{%
+ \caption@setSC@justify
+%%% \caption@setoptions{SC}%
+ \caption@setoptions{SC\@captype}%
+ \caption@defrost}%
+% \end{macrocode}
+% Finally we call the original definition of |\endSC@FLOAT|.
+% \begin{macrocode}
+ \caption@setSC@justify % for compatibility mode
+ \caption@prepare@defrost
+ \caption@ORI@endSC@FLOAT}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The subfigure package}
+% \changes{v3.1}{2007/04/06}{subfigure package support added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{subfigure}[2002/01/23 v2.1]{%
+% \end{macrocode}
+%
+% \begin{macro}{\sf@ifpositiontop}
+% \changes{v3.1a}{2007/09/15}{Bugfix 07-09-15: Check for \cs{@captype} added}
+% If the \package{subfigure} package is loaded, we map |\sf@ifpositiontop|
+% to |\iffiguretopcap| resp. |\iftabletopcap|, so the \package{subfigure}
+% \version{2.1} options \opt{figbotcap} etc. will still work.
+% \begin{macrocode}
+ \def\sf@ifpositiontop{%
+ \ifx\@captype\@undefined
+ \expandafter\@gobbletwo
+ \else\ifx\@captype\relax
+ \expandafter\expandafter\expandafter\@gobbletwo
+ \else
+ \expandafter\expandafter\expandafter\sf@if@position@top
+ \fi\fi}
+% \end{macrocode}
+% \begin{macrocode}
+ \def\sf@if@position@top{%
+ \@ifundefined{if\@captype topcap}%
+ {\@gobbletwo}%
+ {\@nameuse{if\@captype topcap}%
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The supertabular and xtab packages}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{supertabular}[2002/07/19 v4.1e]{%
+% \end{macrocode}
+%
+% \begin{macro}{\tablecaption}
+% \changes{v3.0e}{2005/05/05}{Made \cs{topcaption*} and \cs{bottomcaption*} work}
+% \changes{v3.1h}{2008/04/01}{Bugfix: Star variant does not increment table counter anymore}
+% Make |\topcaption*| and |\bottomcaption*| work.
+% \begin{macrocode}
+ \renewcommand*\tablecaption{%
+ \caption@star
+ {\refstepcounter{table}}%
+ {\caption@dblarg{\@xtablecaption}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@xtablecaption}
+% \changes{v3.1h}{2008/04/01}{Made \cs{nameref} \& \cs{autoref} work}
+% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
+% Make |\nameref| and |\autoref| work.
+% \begin{macrocode}
+ \let\caption@ORI@xtablecaption\@xtablecaption
+ \long\def\@xtablecaption[#1]#2{%
+ \caption@gettitle{#2}%
+ \caption@ORI@xtablecaption[{#1}]{#2}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@caption}
+% \changes{v3.0a}{2004/01/23}{Bugfix: Missing \cs{par} added}
+% \changes{v3.1h}{2008/04/01}{Bugfix: \cs{@currentlabelname} will be set now}
+% The original code:
+% \begin{verbatim}
+% \long\def\ST@caption#1[#2]#3{\par%
+% \addcontentsline{\csname ext@#1\endcsname}{#1}%
+% {\protect\numberline{%
+% \csname the#1\endcsname}{\ignorespaces #2}}
+% \begingroup
+% \@parboxrestore
+% \normalsize
+% \if@topcaption \vskip -10\p@ \fi
+% \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+% \if@topcaption \vskip 10\p@ \fi
+% \endgroup}
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \long\def\ST@caption#1[#2]#3{\par%
+ \caption@settype*{#1}%
+ \caption@setoptions{supertabular}%
+% \end{macrocode}
+% The |position=| setting will be overwritten by the
+% \package{supertabular} package: If |\topcaption| was used,
+% the position will be |top| automatically, |bottom| otherwise.
+% \begin{macrocode}
+ \caption@setposition{\if@topcaption t\else b\fi}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@beginex{#1}{#2}{#3}%
+ \caption@parboxrestore
+ \caption@normalsize
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+ \caption@end}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \changes{v3.1h}{2008/04/01}{Support of the xtab package added}
+% \begin{macrocode}
+\caption@IfPackageLoaded{xtab}[2000/04/09 v2.3]{%
+% \end{macrocode}
+%
+% \begin{macro}{\tablecaption}
+% Make |\topcaption*| and |\bottomcaption*| work.
+% \begin{macrocode}
+ \renewcommand*\tablecaption{%
+ \caption@star
+ {\refstepcounter{table}}%
+ {\caption@dblarg{\@xtablecaption}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@xtablecaption}
+% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
+% Make |\nameref| and |\autoref| work.
+% \begin{macrocode}
+ \let\caption@ORI@xtablecaption\@xtablecaption
+ \long\def\@xtablecaption[#1]#2{%
+ \caption@gettitle{#2}%
+ \caption@ORI@xtablecaption[{#1}]{#2}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@caption}
+% The original code:
+% \begin{verbatim}
+% \long\def\ST@caption#1[#2]#3{\par%
+% \@initisotab
+% \addcontentsline{\csname ext@#1\endcsname}{#1}%
+% {\protect\numberline{%
+% \csname the#1\endcsname}{\ignorespaces #2}}%
+% \begingroup
+% \@parboxrestore
+% \normalsize
+% %% \if@topcaption \vskip -10\p@ \fi
+% \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+% %% \if@topcaption \vskip 10\p@ \fi
+% \endgroup
+% \global\advance\ST@pageleft -\PWSTcapht
+% \ST@trace\tw@{Added caption. Space left for xtabular: \the\ST@pageleft}}
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \long\def\ST@caption#1[#2]#3{\par%
+ \caption@settype*{#1}%
+ \caption@setoptions{xtabular}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@set{position}{\if@topcaption t\else b\fi}%
+% \end{macrocode}
+% \begin{macrocode}
+ \@initisotab
+ \caption@beginex{#1}{#2}{#3}%
+ \caption@parboxrestore
+ \caption@normalsize
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+ \caption@end
+ \global\advance\ST@pageleft -\PWSTcapht
+ \ST@trace\tw@{Added caption. Space left for xtabular: \the\ST@pageleft}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The threeparttable package}
+% \changes{v3.1}{2007/05/08}{Support of the \package{threeparttable} package added}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{threeparttable}[2003/06/13 v3.0]{%
+% \end{macrocode}
+%
+% \begin{macro}{\threeparttable}
+% \changes{v3.3}{2016/01/31}{Bugfix: \cs{@captype} will be used if already defined}
+% Unfortunately |\@captype| is not set when |\TPT@common| will be used,
+% so we have to redefine |\threeparttable| and |\measuredfigure| instead.
+% \begin{macrocode}
+ \let\caption@ORI@threeparttable\threeparttable
+ \renewcommand*\threeparttable{%
+ \caption@settype{\@ifundefined{@captype}{table}{\@captype}}%
+%%% \caption@setposition{auto}% ?
+ \caption@clearmargin
+ \caption@setoptions{threeparttable}%
+ \caption@ORI@threeparttable}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\measuredfigure}
+% \changes{v3.3}{2016/01/31}{Bugfix: \cs{@captype} will be used if already defined}
+% Same here\ldots
+% \begin{macrocode}
+ \let\caption@ORI@measuredfigure\measuredfigure
+ \renewcommand*\measuredfigure{%
+ \caption@settype{\@ifundefined{@captype}{figure}{\@captype}}%
+%%% \caption@setposition{auto}% ?
+ \caption@clearmargin
+ \caption@setoptions{measuredfigure}%
+ \caption@ORI@measuredfigure}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TPT@caption}
+% The original code:
+% \begin{verbatim}
+% \def\TPT@caption#1[#2]#3{\gdef\TPT@docapt
+% {\par\global\let\TPT@docapt\@undefined \TPT@LA@caption{#1}[{#2}]%
+% {\strut\ignorespaces#3\ifhmode\unskip\@finalstrut\strutbox\fi}}%
+% \ifx\TPT@hsize\@empty \let\label\TPT@gatherlabel \abovecaptionskip\z@skip
+% \else \TPT@docapt \fi \ignorespaces}
+% \end{verbatim}%^^A
+% \begin{macrocode}
+ \def\TPT@caption#1[#2]#3{%
+ \gdef\TPT@docapt{%
+ \global\let\TPT@docapt\@undefined
+ \caption@setautoposition\caption@TPT@position
+ \TPT@LA@caption{#1}[{#2}]{#3}}%
+ \ifx\TPT@hsize\@empty
+ \let\label\TPT@gatherlabel % Bug: does not work for measuredfigures
+ \gdef\caption@TPT@position{t}%
+ \g@addto@macro\TPT@docapt\caption@TPT@eatvskip
+ \else
+ \def\caption@TPT@position{b}%
+ \TPT@docapt
+ \fi
+ \ignorespaces}%
+% \end{macrocode}
+% \begin{macrocode}
+ %\newcommand*\caption@TPT@eatvskip{\vskip-.2\baselineskip}%
+ \def\caption@TPT@eatvskip#1\vskip{#1\@tempdima=}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The wrapfig package}
+% \changes{v3.1}{2007/05/05}{Support of the \package{wrapfig} package added}
+% \changes{v3.2d}{2011/11/02}{Support of the \package{wrapfig} package rewritten}
+%
+% \begin{macrocode}
+\caption@IfPackageLoaded{wrapfig}[2003/01/31 v3.6]{%
+% \end{macrocode}
+%
+% \begin{macro}{\wrapfloat}
+% \changes{v3.2d}{2011/11/02}{Redefinition of this macro added}
+% First of all we make the \package{wrapfig} package independent from the package
+% load order regarding the \package{float} package.
+% Since the usage of |\@float@set|\-|every| is missing in the code of the \package{wrapfig}
+% package (it should be in the redefinition of |\float@re|\-|style|, right after
+% |\@nameuse{fst@#1}|), we don't use it here, too,
+% especially since |\wrap|\-|float| will usually not be used when used with re-styled floats.
+% \begin{macrocode}
+ \renewcommand*\wrapfloat[1]{%
+ \def\@captype{#1}%
+ \@ifundefined{fst@#1}{}{%
+ \@nameuse{fst@#1}%
+% \@float@setevery{#1}%
+ \def\WF@floatstyhook{\let\@currbox\WF@box
+ \global\setbox\WF@box\float@makebox{\wd\WF@box}}}%
+ \@ifnextchar[\WF@wr{\WF@wr[]}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\WF@rapt}
+% \changes{v3.2d}{2011/11/02}{Usage of \cs{WF@captionstyhook} added}
+% Original code:
+% \begin{verbatim}
+% \def\WF@rapt[#1]#2{% final two args: #1 = overhang, #2 = width,
+% \gdef\WF@ovh{#1}% hold overhang for later, when \width is known
+% \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}%
+% \ifdim\hsize>\z@ \@parboxrestore \else
+% \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption
+% \ignorespaces \fi}
+% \end{verbatim}%^^A
+% Our code has |\WF@captionstyhook| in addition:
+% \begin{macrocode}
+ \def\WF@rapt[#1]#2{% final two args: #1 = overhang, #2 = width,
+ \gdef\WF@ovh{#1}% hold overhang for later, when \width is known
+ \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}%
+ \expandafter\WF@captionstyhook\expandafter{\@captype}% <= new
+ \ifdim\hsize>\z@ \@parboxrestore \else
+ \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption
+ \ignorespaces \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\WF@captionstyhook}
+% \changes{v3.2d}{2011/11/02}{This macro added}
+% \changes{v3.2e}{2011/11/10}{Bugfix 11-11-09: float package support fixed}
+% We place our \package{hyperref} anchor here, apply the `wrap' options etc.
+% Since the usage of |\@float@set|\-|every| is missing in the \package{wrapfig}
+% package we will catch it up here for making the necessary adaptions to the
+% \package{float} package.
+% \begin{macrocode}
+ \def\WF@captionstyhook#1{%
+ \let\@captype\@undefined
+ \@ifundefined{fst@#1}{}{\@float@setevery{#1}}%
+ \caption@settype{#1}%
+ \caption@clearmargin
+%%% \caption@setoptions{wrap}%
+ \caption@setoptions{wrap#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \section{That's all Folks!}
+%
+% Execute the code declared with |\After|\-|Caption|\-|Package|.
+%
+% \begin{macrocode}
+\caption@endtitles@code
+\let\caption@endtitles@code\@undefined
+\let\AfterCaptionPackage\@firstofone
+% \end{macrocode}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \begin{thebibliography}{99}
+% \bibitem{float}
+% Anselm Lingnau:\\
+% \href{http://www.ctan.org/pkg/float}%
+% {\emph{An Improved Environment for Floats}},\\
+% 2001/11/08
+%
+% \bibitem{floatflt}
+% Mats Dahlgren:\\
+% \href{http://www.ctan.org/pkg/floatflt}%
+% {\emph{Welcome to the floatflt package}},\\
+% 1998/06/05
+%
+% \bibitem{floatrow}
+% Olga Lapko:\\
+% \href{http://www.ctan.org/pkg/floatrow}%
+% {\emph{The floatrow package documentation}},\\
+% 2009/08/02
+%
+% \bibitem{fltpage}
+% Sebastian Gross:\\
+% \href{http://www.ctan.org/pkg/fltpage}%
+% {\emph{Welcome to the beta test of fltpage package!}},\\
+% 1998/11/13
+%
+% \bibitem{hyperref}
+% Sebastian Rahtz \& Heiko Oberdiek:\\
+% \href{http://www.ctan.org/pkg/hyperref}%
+% {\emph{Hypertext marks in \LaTeX: a manual for hyperref}},\\
+% November 2012
+%
+% \bibitem{hypcap}
+% Heiko Oberdiek:\\
+% \href{http://www.ctan.org/pkg/oberdiek}%
+% {\emph{The hypcap package -- Adjusting anchors of captions}},\\
+% 2011/02/16
+%
+% \bibitem{listings}
+% Carsten Heinz \& Brooks Moses:\\
+% \href{http://www.ctan.org/pkg/listings}%
+% {\emph{The Listings Package}},\\
+% 2007/02/22
+%
+% \bibitem{longtable}
+% David Carlisle:\\
+% \href{http://www.ctan.org/pkg/longtable}%
+% {\emph{The longtable package}},\\
+% 2004/02/01
+%
+% \bibitem{picinpar}
+% Friedhelm Sowa:\\
+% \href{http://www.ctan.org/pkg/picinpar}%
+% {\emph{Pictures in Paragraphs}},\\
+% July 13, 1993
+%
+% \bibitem{picins}
+% Joachim Bleser and Edmund Lang:\\
+% \href{http://www.ctan.org/pkg/picins}%
+% {\emph{PicIns-Benutzerhandbuch Version 3.0}},\\
+% September~1992
+%
+% \bibitem{rotating}
+% Sebastian Rahtz and Leonor Barroca:\\
+% \href{http://www.ctan.org/pkg/rotating}%
+% {\emph{A style option for rotated objects in \LaTeX}},\\
+% 1997/09/26
+%
+% \bibitem{sidecap}
+% Rolf Niepraschk \& Hubert G\"a\ss lein:\\
+% \href{http://www.ctan.org/pkg/sidecap}%
+% {\emph{The sidecap package}},\\
+% 2003/06/06
+%
+% \bibitem{subfigure}
+% Steven D. Cochran:\\
+% \href{http://www.ctan.org/pkg/subfigure}%
+% {\emph{The subfigure package}},\\
+% 2005/03/15
+%
+% \bibitem{subfig}
+% Steven D. Cochran:\\
+% \href{http://www.ctan.org/pkg/subfig}%
+% {\emph{The subfig package}},\\
+% 2005/07/05
+%
+% \bibitem{supertabular}
+% Johannes Braams and Theo Jurriens:\\
+% \href{http://www.ctan.org/pkg/supertabular}%
+% {\emph{The supertabular environment}},\\
+% 2004/02/20
+%
+% \bibitem{threeparttable}
+% Donald Arseneau:\\
+% \href{http://www.ctan.org/pkg/threeparttable}%
+% {\emph{Three part tables: title, tabular environment, notes}},\\
+% March 5, 2010
+%
+% \bibitem{wrapfig}
+% Donald Arseneau:\\
+% \href{http://www.ctan.org/pkg/wrapfig}%
+% {\emph{WRAPFIG.STY ver 3.6}},\\
+% Jan 31, 2003
+%
+% \bibitem{xtab}
+% Peter Wilson:\\
+% \href{http://www.ctan.org/pkg/xtab}%
+% {\emph{The xtab package}},\\
+% 2011/07/31
+% \end{thebibliography}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/caption/fallback/v3.5/caption3.dtx b/Master/texmf-dist/source/latex/caption/fallback/v3.5/caption3.dtx
new file mode 100644
index 00000000000..5918f4a540c
--- /dev/null
+++ b/Master/texmf-dist/source/latex/caption/fallback/v3.5/caption3.dtx
@@ -0,0 +1,4680 @@
+% \iffalse meta-comment
+%
+% This is file `caption3.dtx'.
+%
+% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%
+% --------------------------------------------------------------------------
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Axel Sommerfeldt.
+%
+% This work consists of the files
+% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
+% the derived files
+% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
+% and the user manuals
+% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+%
+% \fi
+% \CheckSum{3674}
+%
+% \iffalse
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption3.drv}[2020/10/11 v2.2 Implementation of the caption kernel]
+\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
+%\errorcontextlines=3
+%
+\documentclass{ltxdoc}
+\setlength\parindent{0pt}
+\setlength\parskip{\smallskipamount}
+%
+\makeatletter % make room for subsections like 2.16.14 in the TOC
+%\newcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
+\renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.7em}}
+\makeatother
+%
+\usepackage{ifpdf}
+\ifpdf
+ \usepackage{mathptmx,courier}
+ \usepackage[scaled=0.90]{helvet}
+ \addtolength\marginparwidth{15pt}
+\fi
+%
+\usepackage{hypdoc}
+\ifpdf\usepackage{hypdestopt}\fi
+\hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}}
+%
+\usepackage{caption3}[2020/09/12]
+%
+\DeclareRobustCommand*\eTeX{\texorpdfstring
+ {\leavevmode\hbox{$\varepsilon$}-\TeX}%
+ {e-TeX}}
+%
+\begin{document}
+ \DocInput{caption3.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \def\thispackage{the \package{caption} kernel}
+% \def\Thispackage{The \package{caption} kernel}
+%
+% \newcommand*\purerm[1]{{\upshape\mdseries\rmfamily #1}}
+% \newcommand*\puresf[1]{{\upshape\mdseries\sffamily #1}}
+% \newcommand*\purett[1]{{\upshape\mdseries\ttfamily #1}}
+% \let\class\puresf \let\package\puresf
+% \let\env\purett \let\opt\purett
+%
+% \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
+% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
+% \newcommand*\version[2][]{v$#2$}
+%
+% \GetFileInfo{caption3.drv}
+% \let\docdate\filedate
+% \let\docversion\fileversion
+% \GetFileInfo{caption3.sty}
+%
+% \title{The Implementation of
+% \texorpdfstring{\thispackage\thanks{%^^A
+% This package has version number \docversion.}}%^^A
+% {the caption kernel}}
+% \author{Axel Sommerfeldt\\
+% \url{https://gitlab.com/axelsommerfeldt/caption}}
+% \date{\docdate}
+% \maketitle
+%
+% \begin{abstract}
+% \Thispackage\ consists of two parts -- the kernel
+% (|caption3.sty|) and the main package (|caption.sty|).
+%
+% The kernel provides all the user commands and internal macros which are
+% necessary for typesetting captions and setting parameters regarding these.
+% While the standard \LaTeX\ document classes provide an internal command
+% called |\@makecaption| and no options to control its behavior (except the
+% vertical skips above and below the caption itself), we provide similar
+% commands called |\caption@make| and |\caption@@make|, but with a lot of
+% options which can be selected with |\captionsetup|.
+% Loading the kernel part do not change the output of a \LaTeX\ document
+% -- it just provides functionality which can be used by \LaTeXe\ packages
+% which typesets captions, for example the \package{caption} and
+% \package{subfig} packages.
+% \end{abstract}
+%
+% \section*{Internal commands}
+%
+% These internal commands are save to use by other packages as well
+% since their interface will not change in future releases:
+% \begin{quote}\begin{tabular}{ll}
+% Internal command & Currently used by \\
+% \hline
+% |\caption@addcontentsline| & \package{floatrow} \\
+% |\caption@fnun| & \package{floatrow} \\
+% |\caption@ifinlist| & \package{floatrow} \\
+% |\caption@iftop| & \package{keyfloat}, \package{subfig} \\
+% |\caption@make| & \package{subfig} \\
+% |\caption@@make| & \package{floatrow} \\
+% |\caption@setautoposition| & \package{bidi} \\
+% |\caption@setoptions| & \package{floatrow} \\
+% |\caption@setposition| & \package{floatrow} \\
+% |\caption@switchdefault| & \emph{none} \\
+% \end{tabular}\end{quote}
+%
+% If your package wants to use any other internal command of the \package{caption3} package,
+% please write me an e-mail so we can define a proper interface together.
+%
+% Unfortunately these internal commands are used by other packages and therefore will likely
+% not change in the future, too, but I do not support them (and maybe I will change them anyway
+% and patch the other package on-the-fly instead, at least if it's unmaintained):
+% \begin{quote}\begin{tabular}{ll}
+% Internal command & Currently used by \\
+% \hline
+% |\caption@hangindent | & \package{bidi} \\
+% |\caption@@@make| & \package{floatrow} \\
+% |\caption@@par| & \package{bidi} \\
+% |\caption@parindent| & \package{bidi} \\
+% |\caption@set@bool| & \package{floatrow} \\
+% |\caption@setfont| & \package{floatrow} \\
+% |\caption@setkeys| & \package{floatrow} \\
+% |\caption@setstyle*| & \package{floatrow} \\
+% \hline
+% |\caption@hj@|\meta{name} & \package{floatrow} \\
+% |\caption@lsep@|\meta{name} & \package{floatrow} \\
+% |\caption@lsep@default| & \package{babel-hungarian} \\
+% |\caption@sty@|\meta{name} & \package{floatrow} \\
+% \end{tabular}\end{quote}
+%
+% Furthermore the \package{floatrow} package uses the undocumented option
+% |position=a| (as abbreviation of |position=auto|).
+%
+% The \package{lwarp} package uses a lot of internal commands as well,
+% but we are working on it on the Git branch \texttt{feature/lwarp}:
+% \url{https://gitlab.com/axelsommerfeldt/caption/-/tree/feature/lwarp}
+%
+% \StopEventually{}
+% \clearpage
+% \tableofcontents
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \DoNotIndex{\\,\_,\ ,\@@par}
+% \DoNotIndex{\@bsphack}
+% \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
+% \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
+% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
+% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
+% \DoNotIndex{\if@minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@minipagefalse,\@minipagetrue}
+% \DoNotIndex{\@namedef,\@nameuse}
+% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
+% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setminipage,\@setpar}
+% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
+% \DoNotIndex{\@testopt}
+% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
+% \DoNotIndex{\p@,\z@}
+% \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
+% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
+% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
+% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
+% \DoNotIndex{\fi,\footnotesize,\global}
+% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
+% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
+% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
+% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
+% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
+% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
+% \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
+% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
+% \DoNotIndex{\providecommand,\quad}
+% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
+% \DoNotIndex{\rightskip,\rmfamily}
+% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
+% \DoNotIndex{\small,\string,\space,\strut}
+% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
+% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
+% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
+% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
+% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
+% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
+% \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \setlength{\parskip}{0pt plus 1pt}
+% \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
+%
+% \changes{v1.0}{2003/12/20}{Rewritten; many new commands and features}
+% \changes{v1.0c}{2004/11/28}{Split into two packages: \package{caption} \& \package{caption3}}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+%
+% \iffalse
+%<*package>
+% \fi
+%
+% \section{Identification}
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesPackage{caption3}[2020/10/26 v2.2f caption3 kernel (AR)]
+% \end{macrocode}
+%
+% \section{Generic helpers}
+%
+% \begin{macro}{\@nameundef}
+% |\@nameundef|\marg{command name}\\
+% is the opposite to |\@name|\-|def| which is offered by the \LaTeX\ kernel.
+% We use it to remove the definition of some commands and keyval options after
+% |\begin{document}| (to save \TeX\ memory) and to remove caption options defined
+% with |\caption|\-|setup|\oarg{type}.
+% \begin{macrocode}
+\providecommand*\@nameundef[1]{%
+ \expandafter\let\csname #1\endcsname\@undefined}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@addto@macro}
+% \changes{v1.5}{2013/04/26}{Revised}
+% \changes{v2.0}{2019/09/11}{Relies on \eTeX{} now}
+% |\l@addto@macro|\marg{command}\marg{code}\\
+% The \LaTeXe\ kernel offers the internal helper macro |\g@addto@macro| which
+% globally adds tokens to existing macros, like in |\AtBeginDocument|.
+% This one is the same but it works locally, not globally.
+% \begin{macrocode}
+\providecommand\l@addto@macro[2]{%
+ \edef#1{\unexpanded\expandafter{#1#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bothIfFirst}
+% \changes{v2.2}{2020/09/21}{Usage of \cs{caption@prepare@bothif} added}
+% \begin{macro}{\bothIfSecond}
+% \changes{v2.2}{2020/09/21}{Usage of \cs{caption@prepare@bothif} added}
+% |\bothIfFirst|\marg{code no. 1}\marg{code no. 2}\\
+% |\bothIfSecond|\marg{code no. 1}\marg{code no. 2}\\
+% |\bothIfFirst| tests if the first argument is not empty, |\bothIfSecond|
+% tests if the second argument is not empty. If yes both arguments get
+% typeset, otherwise none of them.
+% \begin{macrocode}
+\def\bothIfFirst#1#2{\caption@bothif{#1}{#1#2}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\bothIfSecond#1#2{\caption@bothif{#2}{#1#2}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@bothif[2]{%
+ \begingroup
+ \caption@prepare@bothif
+ \protected@xdef\caption@tempa{#1}%
+ \endgroup
+ \ifx\caption@tempa\@empty \else
+ #2%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@prepare@bothif}
+% \changes{v2.2}{2020/09/21}{This macro added}
+% |\caption@prepare@bothif|\\
+% re-defines anything which could disturb either |\both|\-|If|\-|First| or |\both|\-|If|\-|Second| check.
+% \begin{macrocode}
+\providecommand*\caption@prepare@bothif{}
+\g@addto@macro\caption@prepare@bothif{%
+ \let\inputencoding\@gobble}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifundefined}
+% \changes{v1.3a}{2011/08/12}{This macro added}
+% \changes{v1.3b}{2011/08/18}{Made expandable}
+% |\caption@ifundefined|\marg{command}\marg{yes-code}\marg{no-code}\\
+% is similar to \cs{@ifundefined} offered by the \LaTeX kernel,
+% but takes a command as argument instead of a command name.
+% \begin{macrocode}
+\newcommand*\caption@ifundefined[1]{%
+ \ifdefined#1%
+ \ifx#1\relax
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \fi
+ \else
+ \expandafter\@firstoftwo
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifdefined}
+% \changes{v1.8e}{2018/05/11}{This macro added}
+% |\caption@ifdefined|\marg{command}\marg{yes-code}\marg{no-code}\\
+% is similar to \cs{@ifundefined} offered by the \LaTeX kernel,
+% but takes a command as argument instead of a command name.
+% \begin{macrocode}
+\newcommand*\caption@ifdefined[1]{%
+ \ifdefined#1%
+ \ifx#1\relax
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \else
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \fi
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifinlist}
+% \changes{v1.1}{2007/07/29}{Rewritten}
+% |\caption@ifinlist|\marg{element}\marg{list}\marg{yes-code}\marg{no-code}\\
+% This helper command checks if the \meta{element} is in the comma separated
+% \meta{list}. So for example
+% \begin{quote}
+% |\caption@ifinlist{frank}{axel,frank,olga,steven}{yes}{no}|
+% \end{quote}
+% would expand to |yes|.\par
+% (Note: Since this command is used by the \package{floatrow} package as well
+% its syntax should not change.)
+% \begin{macrocode}
+\newcommand*\caption@ifinlist{%
+ \@expandtwoargs\caption@@ifinlist}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@ifinlist[2]{%
+ \begingroup
+ \def\@tempa##1,#1,##2\@nil{%
+ \endgroup
+ \ifx\relax##2\relax
+ \expandafter\@secondoftwo
+ \else
+ \expandafter\@firstoftwo
+ \fi}%
+ \@tempa,#2,#1,\@nil}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifin@list}
+% \changes{v1.1}{2007/08/12}{This macro added}
+% |\caption@ifin@list|\marg{cmd}\marg{element}\marg{yes-code}\marg{no-code}\\
+% is the same as |\caption@ifinlist| but with a command (containing a list)
+% instead of the list itself.
+% \begin{macrocode}
+\newcommand*\caption@ifin@list[2]{%
+ \caption@ifempty@list#1%
+ {\@secondoftwo}%
+ {\@expandtwoargs\caption@@ifinlist{#2}{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@g@addto@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@g@addto@list|\marg{cmd}\marg{element}\\
+% adds an element to a command containing a list.
+% (The command will get defined if it isn't defined yet.)
+% \begin{macrocode}
+\newcommand*\caption@g@addto@list[2]{%
+ \caption@ifempty@list#1{\gdef#1{#2}}{\g@addto@macro#1{,#2}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@l@addto@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@l@addto@list|\marg{cmd}\marg{element}\\
+% is the same as |\caption@g@addto@list| but works locally.
+% \begin{macrocode}
+\newcommand*\caption@l@addto@list[2]{%
+ \caption@ifempty@list#1{\def#1{#2}}{\l@addto@macro#1{,#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@g@removefrom@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@g@removefrom@list|\marg{cmd}\marg{element}\\
+% removes an element from a command containing a list.
+% \Note[Caveat]{\meta{cmd} will be expanded during this process since
+% \cs{@removeelement} is using \cs{edef} to build the new list.}
+% \begin{macrocode}
+\newcommand*\caption@g@removefrom@list[2]{%
+ \caption@l@removefrom@list#1{#2}%
+ \global\let#1#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@l@removefrom@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@l@removefrom@list|\marg{cmd}\marg{element}\\
+% is the same as |\caption@g@removefrom@list| but works locally.
+% \Note[Caveat]{\meta{cmd} will be expanded during this process since
+% \cs{@removeelement} is using \cs{edef} to build the new list.}
+% \begin{macrocode}
+\newcommand*\caption@l@removefrom@list[2]{%
+ \caption@ifempty@list#1{}{\@expandtwoargs\@removeelement{#2}#1#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@for@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@for@list|\marg{cmd}\marg{code with \#1}\\
+% iterates all elements of the list (within \meta{cmd}) using the given
+% \meta{code}.
+% \begin{macrocode}
+\newcommand*\caption@for@list[2]{%
+ \caption@ifempty@list#1{}%
+ {\def\caption@tempb##1{#2}%
+ \@for\caption@tempa:=#1\do{%
+ \expandafter\caption@tempb\expandafter{\caption@tempa}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifempty@list}
+% \changes{v1.1}{2007/07/29}{This macro added}
+% |\caption@ifempty@list|\marg{cmd}\marg{yes-code}\marg{no-code}\\
+% This helper command checks if the list (within \meta{cmd}) is empty.
+% \begin{macrocode}
+\newcommand*\caption@ifempty@list[1]{%
+ \ifx#1\@undefined
+ \expandafter\@firstoftwo
+ \else\ifx#1\relax
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else\ifx#1\@empty
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \fi\fi\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \pagebreak[3]
+% \begin{macro}{\caption@setbool}
+% \changes{v1.1}{2007/04/05}{\cs{caption@set@bool}\marg{cmd}\marg{value} added}
+% \begin{macro}{\caption@ifbool}
+% \changes{v1.1}{2020/08/02}{\cs{caption@if@bool}\marg{value} added}
+% \begin{macro}{\caption@undefbool}
+% For setting and testing boolean options we offer these three helper macros:
+% \begin{quote}
+% |\caption@setbool|\marg{name}\marg{value}\\
+% | |(with |value = false/true/no/yes/off/on/0/1|)\\
+% |\caption@ifbool|\marg{name}\marg{if-clause}\marg{else-clause}\\
+% |\caption@undefbool|\marg{name}
+% \end{quote}
+% \begin{macrocode}
+\newcommand*\caption@setbool[1]{%
+ \expandafter\caption@set@bool\csname caption@if#1\endcsname}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@set@bool[2]{%
+ \caption@if@bool{#2}{\let#1\@firstoftwo}{\let#1\@secondoftwo}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@if@bool[1]{%
+ \caption@ifinlist{#1}{1,true,yes,on}%
+ {\@firstoftwo}%
+ {\caption@ifinlist{#1}{0,false,no,off}%
+ {}%
+ {\caption@Error{Undefined boolean value `#1'}}%
+ \@secondoftwo}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@ifbool[1]{\@nameuse{caption@if#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@undefbool[1]{\@nameundef{caption@if#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@teststar}
+% \changes{v1.1}{2007/05/08}{This macro and its usage added}
+% \changes{v1.1e}{2007/10/28}{\cs{caption@teststar@} added}
+% |\caption@teststar|\marg{cmd}\marg{star-arg}\marg{non-star-arg}\\
+% expands \meta{cmd} with either argument \marg{star-arg} or
+% \meta{non-star-arg}, depending on if the next char is a star (or not).\par
+% |\caption@teststar@|\marg{cmd}\marg{star-arg}\marg{non-star-arg}\\
+% will test the catcode of the character \@ additionally.
+% \begin{macrocode}
+\newcommand*\caption@teststar[3]{%
+ \@ifstar{#1{#2}}{#1{#3}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@teststar@[3]{%
+ \@ifstar{#1{#2}}{\caption@ifatletter{#1{#2}}{#1{#3}}}}
+\AtBeginDocument{\let\caption@teststar@\caption@teststar}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifatletter}
+% \changes{v1.1e}{2007/10/28}{This macro added}
+% |\caption@ifatletter|\marg{yes-code}\marg{no-code}\\
+% will either expand \meta{yes-code} or \meta{no-code},
+% depending on the catcode of the character \@.
+% \begin{macrocode}
+\newcommand*\caption@ifatletter{%
+ \ifnum\the\catcode`\@=11
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\AtBeginDocument{\let\caption@ifatletter\@secondoftwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@withoptargs}
+% \changes{v1.1}{2007/08/12}{This macro added}
+% \changes{v1.5}{2012/04/09}{This macro revised}
+% |\caption@withoptargs|\marg{cmd}\\
+% collects a star and all optional arguments, and expands \meta{cmd}
+% afterwards with the collected stuff as first argument.
+% \begin{macrocode}
+\newcommand*\caption@withoptargs[1]{%
+ \@ifstar
+ {\def\caption@tempa{*}\caption@@withoptargs{#1}}%
+ {\def\caption@tempa{}\caption@@withoptargs{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@withoptargs#1{%
+ \@ifnextchar[%]
+ {\caption@@@withoptargs{#1}}%
+ {\caption@@@@withoptargs{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@@withoptargs#1[#2]{%
+ \l@addto@macro\caption@tempa{[{#2}]}%
+ \caption@@withoptargs{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@@@withoptargs#1{%
+ \def\caption@tempb{#1}%
+ \expandafter\caption@tempb\expandafter{\caption@tempa}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@gobble}
+% \changes{v1.4}{2011/08/19}{This macro added}
+% |\caption@gobble*|\oarg{arg}\oarg{\ldots}\marg{arg}\\
+% is similar to |\@gobble| but gobbles a star and optional arguments as well.
+% \begin{macrocode}
+\DeclareRobustCommand*\caption@gobble{%
+ \caption@withoptargs\@gobbletwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@AtBeginDocument}
+% \changes{v1.1}{2007/04/13}{This macro and its usage added}
+% \changes{v1.2e}{2010/01/09}{Adapted to the combine document class}
+% |\caption@AtBeginDocument*|\marg{code}\\
+% is similar to |\AtBeginDocument| but the execution of code will be
+% surrounded by two |\Package|\-|Info|s.
+% The starred variant causes the code to be executed after all code
+% specified using the non-starred variant.
+% \begin{macrocode}
+\let\caption@begindocumenthook\@empty
+\let\caption@@begindocumenthook\@empty
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@AtBeginDocument{%
+ \caption@teststar\g@addto@macro
+ \caption@@begindocumenthook\caption@begindocumenthook}
+%\@onlypreamble\caption@AtBeginDocument
+% \end{macrocode}
+% \begin{macrocode}
+\AtBeginDocument{%
+ \caption@InfoNoLine{Begin \noexpand\AtBeginDocument code}%
+% \end{macrocode}
+% \begin{macrocode}
+ \def\caption@AtBeginDocument{%
+ \@ifstar{\g@addto@macro\caption@@begindocumenthook}\@firstofone}%
+ \caption@begindocumenthook
+ \let\caption@begindocumenthook\relax
+% \end{macrocode}
+% \begin{macrocode}
+ \def\caption@AtBeginDocument{%
+ \@ifstar\@firstofone\@firstofone}%
+ \caption@@begindocumenthook
+ \let\caption@@begindocumenthook\relax
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@InfoNoLine{End \noexpand\AtBeginDocument code}}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Information, Warnings, and Errors}
+%
+% \begin{macro}{\caption@Info}
+% \changes{v1.3}{2010/10/25}{Moved from package to kernel}
+% |\caption@Info|\marg{message}\\
+% issues an info message (with code line indication).
+% \begin{macrocode}
+\newcommand*\caption@Info[1]{%
+ \PackageInfo{caption}{#1}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@InfoNoLine}
+% \changes{v1.3}{2010/10/25}{Moved from package to kernel}
+% |\caption@InfoNoLine|\marg{message}\\
+% issues an info message without code line indication.
+% \Note{The \cs{@gobble} at the end of the 2nd argument of
+% \cs{PackageInfo} suppresses the line number info.
+% See TLC2\cite{TLC2}, A.4.7, p885 for details.}
+% \begin{macrocode}
+\newcommand*\caption@InfoNoLine[1]{%
+ \caption@Info{#1\@gobble}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@Warning}
+% \changes{v1.1c}{2007/10/14}{This macro added, will now be used for warnings}
+% |\caption@Warning|\marg{message}\\
+% issues a warning message (with code line indication).
+% \begin{macrocode}
+\newcommand*\caption@Warning[1]{%
+ \caption@WarningNoLine{#1\on@line}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\caption@WarningNoLine}
+% \changes{v1.1c}{2007/10/14}{This macro added, will now be used for warnings}
+% |\caption@WarningNoLine|\marg{message}\\
+% issues a warning message without code line indication.
+% \begin{macrocode}
+\newcommand*\caption@WarningNoLine[1]{%
+ \PackageWarning{caption}{#1.^^J\caption@wh\@gobbletwo}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@wh{%
+ See the caption package documentation for explanation.}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@Error}
+% \changes{v1.0j}{2007/01/20}{This macro added, will now be used for errors}
+% \changes{v1.0o}{2007/04/11}{Renamed from \cs{caption@error} to \cs{caption@Error}}
+% \changes{v1.1b}{2007/09/18}{Usage of \cs{caption@Package} removed}
+% \changes{v2.2a}{2020/09/28}{\cs{caption@eh} renamed to \cs{caption@@eh} and revised}
+% |\caption@Error|\marg{message}\\
+% issues an error message (with code line indication).
+% \begin{macrocode}
+\newcommand*\caption@Error[1]{%
+ \PackageError{caption}{#1}{\caption@@eh{caption}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@eh[1]{%
+ If you do not understand this error, please take a closer look\MessageBreak
+ at the documentation of the `#1' package, especially the\MessageBreak
+ section about errors.\MessageBreak\@ehc}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@KV@err}
+% \changes{v1.1b}{2007/09/18}{This macro added}
+% |\caption@KV@err|\marg{message}\\
+% will be used to issue an error while parsing the key-value (package)
+% options.
+% \begin{macrocode}
+\let\caption@KV@err\caption@Error
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Using the keyval package}
+%
+% We need the \package{keyval} package for option handling, so we load it here.\par
+% \emph{TODO:} Use some recent stuff instead, for example kvdefinekey and kvsetkeys.
+% \begin{macrocode}
+\RequirePackage{keyval}[1997/11/10]
+% \end{macrocode}
+%
+% \begin{macro}{\undefine@key}
+% |\undefine@key|\marg{family}\marg{key}\\
+% is the opposite of |\define@key|, it removes a keyval definition.
+% \begin{macrocode}
+\providecommand*\undefine@key[2]{%
+ \@nameundef{KV@#1@#2}\@nameundef{KV@#1@#2@default}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@onlypreamble@key}
+% \changes{v1.1}{2007/07/22}{This macro added}
+% \changes{v1.1e}{2007/11/01}{\cs{KV@err} will be used now instead of \cs{@notprerr}}
+% |\onlypreamble@key|\marg{family}\marg{key}\\
+% marks a keyval definition only valid in the document preamble, analogous to
+% |\@only|\-|preamble| from \LaTeXe.
+% \begin{macrocode}
+\providecommand*\@preamble@keys{}
+\providecommand*\@onlypreamble@key[2]{\@cons\@preamble@keys{{#1}{#2}}}
+\@onlypreamble\@onlypreamble@key
+\@onlypreamble\@preamble@keys
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\@notprerr@key[1]{\KV@err{Can be used only in preamble}}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@AtBeginDocument*{%
+ \def\@elt#1#2{\expandafter\let\csname KV@#1@#2\endcsname\@notprerr@key}%
+ \@preamble@keys
+ \let\@elt\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionOption}
+% |\DeclareCaptionOption*|\marg{option}\oarg{default value}\marg{code}\\
+% We declare our options using these commands (instead of using
+% |\Declare|\-|Option| offered by \LaTeXe), so the keyval package is used.
+% The starred form makes the option available during the lifetime of the
+% current package only, so they can be used with |\use|\-|package|, but
+% \emph{not} with |\caption|\-|setup| later on.
+% \begin{macrocode}
+\newcommand*\DeclareCaptionOption{%
+ \caption@teststar\caption@declareoption\AtEndOfPackage\@gobble}
+\@onlypreamble\DeclareCaptionOption
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declareoption[2]{%
+ #1{\undefine@key{caption}{#2}}\caption@declare@option{#2}}
+\@onlypreamble\caption@declareoption
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declare@option{%
+ \define@key{caption}}
+%% no \@onlypreamble\caption@declare@option since it will be used by \captionsetup
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionOptionNoValue}
+% \changes{v1.1c}{2007/10/06}{This macro added}
+% |\DeclareCaptionOptionNoValue*|\marg{option}\marg{code}\\
+% is the same as |\DeclareCaptionOption| but issues an error if a value is
+% given.
+% \begin{macrocode}
+\newcommand*\DeclareCaptionOptionNoValue{%
+ \caption@teststar\caption@declareoption@novalue\AtEndOfPackage\@gobble}
+\@onlypreamble\DeclareCaptionOptionNoValue
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@declareoption@novalue[3]{%
+ \caption@declareoption{#1}{#2}[\KV@err]{%
+ \caption@option@novalue{#2}{##1}{#3}}}
+\@onlypreamble\caption@declareoption@novalue
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@option@novalue[2]{%
+ \ifx\KV@err#2%
+ \expandafter\@firstofone
+ \else
+ \KV@err{No value allowed for #1}%
+ \expandafter\@gobble
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifcaptionsetup@star}
+% \changes{v1.2a}{2008/01/12}{This macro added}
+% If the starred form of |\caption|\-|setup| is used, this will be set to |true|.
+% (It will be reset to |false| at the end of |\caption@set|\-|keys|.)
+% \begin{macrocode}
+\newif\ifcaptionsetup@star
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionsetup}
+% \changes{v1.0a}{2004/01/17}{Bugfix: Missing \% added}
+% \changes{v1.1}{2007/07/22}{Starred-variant added}
+% \changes{v1.1e}{2007/07/27}{Inside packages the starred variant will be used automatically}
+% \changes{v1.2}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% \changes{v1.2a}{2008/01/12}{\cs{ifcaptionsetup@star} will be set now}
+% \changes{v1.5}{2012/04/09}{Support of multiple optional arguments added}
+% \changes{v1.8h}{2020/01/03}{Syntax check of saved options added}
+% |\captionsetup*|\oarg{type}\ldots\marg{keyval-list of options}\\
+% applies the given list of options.
+% If the optional argument `type' is specified, we simply save or append
+% the option list, otherwise we `execute' it with |\set|\-|keys|.
+% (The non-starred variant issues a warning if \meta{keyval-list of options}
+% is not used later on.)
+% \Note{The starred variant will be used inside packages automatically.}
+% \begin{macrocode}
+\newcommand*\captionsetup{%
+ \caption@teststar@\@captionsetup\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\@captionsetup[1]{%
+ \captionsetup@startrue#1\captionsetup@starfalse
+ \@ifnextchar[%]
+ \caption@setup@options\caption@setup}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setup{\caption@setkeys{caption}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@setup@options[#1]{%
+ \@ifnextchar[%]
+ {\caption@stepthecounter
+ \caption@withoptargs{\@expandtwoargs
+ \caption@setup@options@i{#1}{@\caption@thecounter}}}%
+ {\caption@setup@options@{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setup@options@i[4]{%
+ \caption@declare@option{#2}[]{\captionsetup#3{#4}}%
+ \caption@setup@options@{#1}{#2}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setup@options@[2]{%
+ \@bsphack
+ \ifcaptionsetup@star\captionsetup@starfalse\else\caption@addtooptlist{#1}\fi
+ \caption@checkoptions{#2}%
+ \expandafter\caption@l@addto@list\csname caption@opt@#1\endcsname{#2}%
+ \@esphack}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@checkoptions}
+% \changes{v1.8h}{2020/01/03}{This macro added}
+% |\caption@checkoptions|\marg{keyval-list of options}\\
+% checks the syntax of the given options by executing them inside a group.
+% \begin{macrocode}
+\newcommand*\caption@checkoptions[1]{%
+ \begingroup
+ \caption@prepare@optioncheck
+ \caption@setup{#1}%
+ \endgroup}
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\caption@prepare@optioncheck{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\IfCaptionOptionCheck}
+% \changes{v1.10}{2020/05/10}{This macro added}
+% |\IfCaptionOptionCheck|\marg{yes-code}\marg{no-code}\\
+% executes the \meta{yes-code} if options are just checked for syntax,
+% and \meta{no-code} if not.
+% \begin{macrocode}
+\let\IfCaptionOptionCheck\@secondoftwo
+% \end{macrocode}
+% \begin{macrocode}
+\g@addto@macro\caption@prepare@optioncheck{%
+ \let\IfCaptionOptionCheck\@firstoftwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clearcaptionsetup}
+% \changes{v1.1}{2007/07/29}{Optional argument added}
+% \changes{v1.1}{2007/08/17}{Starred variant added}
+% \changes{v1.1e}{2007/07/27}{Inside packages the starred variant will be used automatically}
+% \changes{v1.2}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% |\clearcaptionsetup*|\oarg{option}\marg{type}\\
+% removes the saved option list associated with \meta{type}.
+% If \meta{option} is given, only this option will be removed from the list.
+% (The starred variant does not issue warnings.)
+% \Note{The starred variant will be used inside packages automatically.}
+% \begin{macrocode}
+\newcommand*\clearcaptionsetup{%
+ \caption@teststar@\@clearcaptionsetup\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\@clearcaptionsetup[1]{%
+ \let\caption@tempa#1%
+ \@testopt\@@clearcaptionsetup{}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\@@clearcaptionsetup[#1]#2{%
+ \@bsphack
+ \expandafter\caption@ifempty@list\csname caption@opt@#2\endcsname
+ {\caption@tempa{\caption@Warning{Option list `#2' undefined}}}%
+ {\ifx,#1,%
+ \caption@clearsetup{#2}%
+ \else
+ \caption@@removefromsetup{#1}{#2}%
+ \fi}%
+ \@esphack}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@clearsetup[1]{%
+ \caption@removefromoptlist{#1}%
+ \@nameundef{caption@opt@#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@removefromsetup{%
+ \let\caption@tempa\@gobble
+ \caption@@removefromsetup}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@removefromsetup[2]{%
+ \expandafter\let\expandafter\@tempa\csname caption@opt@#2\endcsname
+ \expandafter\let\csname caption@opt@#2\endcsname\@undefined
+ \def\@tempb##1=##2\@nil{##1}%
+ \edef\@tempc{#1}%
+ \@for\@tempa:=\@tempa\do{%
+ \edef\@tempd{\expandafter\@tempb\@tempa=\@nil}%
+ \ifx\@tempd\@tempc
+ \let\caption@tempa\@gobble
+ \else
+ \expandafter\expandafter\expandafter\caption@l@addto@list
+ \expandafter\csname caption@opt@#2\expandafter\endcsname
+ \expandafter{\@tempa}%
+ \fi}%
+ \expandafter\caption@ifempty@list\csname caption@opt@#2\endcsname
+ {\caption@removefromoptlist{#2}}{}%
+ \caption@tempa{\caption@Warning{%
+ Option `#1' was not in list `#2'}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\showcaptionsetup}
+% \changes{v1.0d}{2005/05/03}{Optimized for memory usage}
+% \changes{v1.1}{2007/07/29}{Bugfix: Does not expand option list anymore}
+% \changes{v1.2}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% |\showcaptionsetup|\oarg{package}\marg{type}\\
+% shows the saved option list which is associated with \meta{type}
+% (as warning message).
+% \begin{macrocode}
+\newcommand*\showcaptionsetup[2][\@firstofone]{%
+ \@bsphack
+ \GenericWarning{}{%
+ #1 Caption Info: Option list on `#2'\MessageBreak
+ #1 Caption Data: \@ifundefined{caption@opt@#2}{%
+ -none-%
+ }{%
+ {\expandafter\expandafter\expandafter\strip@prefix
+ \expandafter\meaning\csname caption@opt@#2\endcsname}%
+ }}%
+ \@esphack}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.1}{2007/07/02}{Option \opt{options=} added}
+% \changes{v1.3}{2010/09/05}{Option \opt{options*=} added}
+% \changes{v1.4b}{2012/01/12}{Option \opt{options*=} removed}
+% \begin{macrocode}
+\DeclareCaptionOption{options}{\caption@setoptions{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setoptions}
+% \changes{v1.0g}{2006/01/03}{Optional argument added}
+% \changes{v1.0h}{2006/01/26}{Revised}
+% \changes{v1.0j}{2007/01/30}{Optional argument removed}
+% \changes{v1.1}{2007/04/11}{Usage of \cs{clearcaptionsetup} added}
+% \changes{v1.1}{2007/05/09}{Renamed from \cs{caption@settype} to \cs{caption@setoptions}}
+% \changes{v1.2}{2007/12/03}{Definition of \cs{caption@iftypewarning} removed}
+% \changes{v1.3}{2010/09/05}{Starred variant added}
+% \changes{v1.4b}{2012/01/12}{Starred variant removed}
+% |\caption@setoptions|\marg{type or environment or\ldots}\\
+% applies caption options which have been saved with |\caption|\-|setup|\oarg{type}.
+% To prevent multiple application the list will be cleared (locally) afterwards.
+% \begin{macrocode}
+\newcommand*\caption@setoptions[1]{%
+ \caption@Debug{options=#1}%
+ \expandafter\let\expandafter\caption@opt\csname caption@opt@#1\endcsname
+ \ifx\caption@opt\relax \else
+ \caption@xsetup\caption@opt
+ \caption@clearsetup{#1}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@xsetup[1]{\expandafter\caption@setup\expandafter{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@addtooptlist}
+% \changes{v1.1}{2007/07/22}{This macro added}
+% \begin{macro}{\caption@removefromoptlist}
+% \changes{v1.1}{2007/07/22}{This macro added}
+% \changes{v1.2c}{2008/08/24}{Fatal typo corrected}
+% |\caption@addtooptlist|\marg{type}\\
+% |\caption@removefromoptlist|\marg{type}\\
+% adds or removes an \meta{type} to the list of unused caption options.
+% Note that the catcodes of \meta{type} are sanitized here so removing
+% \meta{type} from the list do not fail when the \package{float} package
+% is used (since |\float@getstyle| gives a result which tokens have catcode
+% 12 $=$ ``other'').
+% \begin{macrocode}
+\newcommand*\caption@addtooptlist[1]{%
+ \@ifundefined{caption@opt@#1@lineno}%
+ {\caption@dooptlist\caption@g@addto@list{#1}%
+ \expandafter\xdef\csname caption@opt@#1@lineno\endcsname{\the\inputlineno}}%
+ {}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@removefromoptlist[1]{%
+ \caption@dooptlist\caption@g@removefrom@list{#1}%
+ \global\expandafter\let\csname caption@opt@#1@lineno\endcsname\@undefined}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@dooptlist[2]{%
+ \begingroup
+ \edef\@tempa{#2}\@onelevel@sanitize\@tempa
+ \expandafter#1\expandafter\caption@optlist\expandafter{\@tempa}%
+ \endgroup}
+% \end{macrocode}
+% \begin{macrocode}
+\AtEndDocument{%
+ \caption@for@list\caption@optlist
+ {\caption@WarningNoLine{%
+ Unused \string\captionsetup[#1]
+ on input line \csname caption@opt@#1@lineno\endcsname}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@setkeys}
+% \changes{v1.0g}{2006/01/03}{This macro added}
+% \changes{v1.0j}{2007/01/20}{Bugfix: Usage of \cs{caption@keydepth} added}
+% \changes{v1.0j}{2007/01/30}{Optional argument added}
+% \changes{v1.0n}{2007/04/08}{\cs{caption@keydepth} is now a command instead of a counter}
+% \changes{v1.1b}{2007/09/18}{Usage of \cs{caption@Package} removed, we use \cs{caption@KV@err} instead}
+% \changes{v1.2}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
+% \changes{v1.2a}{2008/01/12}{\cs{captionsetup@starfalse} added}
+% \changes{v1.2d}{2009/09/30}{Bugfix 09-09-29: Missing error handler will be defined automatically}
+% \changes{v1.4}{2011/08/24}{Redefinition of \cs{XKV@err} added}
+% |\caption@setkeys|\oarg{package}\marg{family}\marg{key-values}\\
+% expands to |\setkeys|\marg{family}\marg{key-values},
+% but lets the error messages not refer to the \package{keyval} package
+% but to the \meta{package} package instead.
+% \begin{macrocode}
+\newcommand*\caption@setkeys{\@dblarg\caption@@setkeys}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@setkeys[#1]#2#3{%
+ \@bsphack
+% \end{macrocode}
+% \begin{macrocode}
+ \expandafter\let\csname ORI@KV@err\caption@keydepth\endcsname\KV@err
+ \expandafter\let\csname ORI@KV@errx\caption@keydepth\endcsname\KV@errx
+ \expandafter\let\csname ORI@XKV@err\caption@keydepth\endcsname\XKV@err
+ \edef\caption@keydepth{\caption@keydepth i}%
+% \end{macrocode}
+% \begin{macrocode}
+ \expandafter\let\expandafter\KV@err\csname #1@KV@err\endcsname
+ \ifx\KV@err\relax
+ \def\KV@err##1{\PackageError{#1}{##1}{%
+ See the #1 package documentation for explanation.}}%
+ \fi
+ \def\KV@errx{\KV@err}%
+ \def\XKV@err{\let\@tempa\XKV@tkey\KV@err}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@Debug{\noexpand\setkeys{#2}{#3}}%
+ \setkeys{#2}{#3}%
+% \end{macrocode}
+% \begin{macrocode}
+ \edef\caption@keydepth{\expandafter\@gobble\caption@keydepth}%
+ \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
+% \end{macrocode}
+% \begin{macrocode}
+ \ifx\caption@keydepth\@empty \captionsetup@starfalse \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \@esphack}
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@keydepth\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ExecuteOptions}
+% \changes{v1.1}{2007/07/15}{This macro added}
+% \changes{v1.3}{2010/09/04}{Depends on package now}
+% |\caption@ExecuteOptions|\marg{package}\marg{key-value options}\\
+% applies the given options using the keyval interface, so we use this one
+% instead of |\Execute|\-|Options| offered by \LaTeXe.
+% \begin{macrocode}
+\newcommand*\caption@ExecuteOptions[2]{%
+ \expandafter\@expandtwoargs\csname caption@setkeys@#1\endcsname{#1}{#2}}%
+\@onlypreamble\caption@ExecuteOptions
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ProcessOptions}
+% \changes{v1.0a}{2004/01/23}{Bugfix, see \purett{news:400D360C.9678329F@gmx.net} for details}
+% \changes{v1.0g}{2006/01/03}{Improvement, uses \cs{caption@setkeys} instead of \cs{setkeys}}
+% \changes{v1.0h}{2006/02/23}{Bugfix, now processes only those global options which have a default value}
+% \changes{v1.0j}{2007/01/30}{\cs{ProcessOptionsWithKV} renamed to \cs{caption@ProcessOptions} and moved from the package to the kernel}
+% \changes{v1.1}{2007/04/17}{Starred variant added}
+% |\caption@ProcessOptions*|\marg{package}\\
+% processes the given options using the keyval package, so we use this one
+% instead of |\Process|\-|Options| offered by \LaTeXe.
+% The starred variant does not process the global options.
+% (This code was taken from the \package{hyperref} package\cite{hyperref}
+% \version{6.74} and modified.)
+% \begin{macrocode}
+\newcommand*\caption@ProcessOptions{%
+ \caption@teststar\caption@@ProcessOptions\@gobble\@firstofone}
+\@onlypreamble\caption@ProcessOptions
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@@ProcessOptions[2]{%
+ \let\@tempc\relax
+ \let\caption@tempa\@empty
+ #1{% \@firstofone -or- \@gobble
+ \@for\CurrentOption:=\@classoptionslist\do{%
+ \@ifundefined{KV@#2@\CurrentOption}{}{%
+ \@ifundefined{KV@#2@\CurrentOption @default}{%
+ \PackageInfo{#2}{Global option `\CurrentOption' ignored}%
+ }{%
+ \PackageInfo{#2}{Global option `\CurrentOption' processed}%
+ \edef\caption@tempa{\caption@tempa\CurrentOption,}%
+ \@expandtwoargs\@removeelement\CurrentOption
+ \@unusedoptionlist\@unusedoptionlist
+ }%
+ }%
+ }%
+ \let\CurrentOption\@empty
+ }%
+ \caption@ExecuteOptions{#2}{\caption@tempa\@ptionlist{\@currname.\@currext}}%
+ \AtEndOfPackage{\let\@unprocessedoptions\relax}}
+\@onlypreamble\caption@@ProcessOptions
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@SetupOptions}
+% \changes{v1.3}{2010/09/04}{This macro added}
+% |\caption@SetupOptions|\marg{package}\marg{code}\\
+% After application of this command |\caption@Execute|\-|Options| and
+% |\use|\-|package| will both be mapped to \meta{code} with \meta{package}
+% and \meta{options} as arguments |#1| and |#2|.
+% (This helps avoiding ``Option clash'' errors.)
+% \begin{macrocode}
+\newcommand\caption@SetupOptions[2]{%
+ \@namedef{caption@setkeys@#1}##1##2{#2}%
+ \expandafter\@onlypreamble\csname caption@setkeys@#1\endcsname
+ \@cons\caption@SetupOptions@list{{#1}}}
+\@onlypreamble\caption@SetupOptions
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@SetupOptions@list{}
+\@onlypreamble\caption@SetupOptions@list
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@onefilewithoptions\@onefilewithoptions
+\def\@onefilewithoptions#1[#2]{%
+ \begingroup
+ \def\@tempa{%
+ \endgroup
+ \caption@onefilewithoptions{#1}[{#2}]}%
+ \def\@tempb{#1}%
+ \def\@elt##1{%
+ \def\@tempc{##1}%
+ \ifx\@tempb\@tempc
+ \def\@tempa{%
+ \endgroup
+ \caption@ExecuteOptions{#1}{#2}%
+ \caption@onefilewithoptions{#1}[]}%
+ \fi}
+ \caption@SetupOptions@list
+ \@tempa}
+\@onlypreamble\caption@onefilewithoptions
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Declaring and setting key values}
+%
+% \begin{macro}{\caption@decl}
+% \changes{v2.0}{2019/09/10}{This macro added}
+% |\caption@decl|\oarg{command}\marg{option}\marg{name}\\
+% is used for declaring boxes, fonts, formats etc.
+% (It defines |\caption@|\meta{option}|@|\meta{name}
+% using the given \meta{command}.)
+% \begin{macrocode}
+\newcommand*\caption@decl[3][\def]{%
+ \global\long\expandafter#1\csname caption@#2@#3\endcsname}
+\@onlypreamble\caption@decl
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifdecl}
+% \changes{v2.0}{2019/09/10}{This macro added}
+% |\caption@ifdecl|\marg{option}\marg{name}\marg{yes-code}\marg{no-code}\\
+% checks if the given \meta{option} and \meta{name} combination is
+% already declared.
+% \begin{macrocode}
+\newcommand*\caption@ifdecl[2]{%
+ \@ifundefined{caption@#1@#2}\@secondoftwo\@firstoftwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@checkdecl}
+% \changes{v2.0}{2019/09/10}{This macro added}
+% |\caption@checkdecl|\marg{option}\marg{name}\marg{yes-code}\\
+% behaves similar to |\caption@if|\-|decl| but issues an error message if the
+% given \meta{option} plus \meta{name} is not defined.
+% \begin{macrocode}
+\newcommand*\caption@checkdecl[2]{%
+ \caption@ifdecl{#1}{#2}%
+ \@firstofone
+ {\caption@Error{Undefined #1 `#2'}%
+ \@gobble}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@set}
+% \changes{v2.0}{2019/09/10}{This macro added}
+% \changes{v2.0}{2020/07/26}{Uses \cs{def} instead of \cs{let} internally}
+% |\caption@set|\marg{option}\marg{name}\\
+% sets the declared \meta{option} to \meta{name}, for example
+% |label|\-|format| to |simple|.
+% Note that since version \version{2.0} future changes to \meta{name}
+% (via |\caption@decl|) will effect the outcome,
+% for example |\caption@decl{labelformat}{simple}\ldots| will not only change
+% the definition of the label format |simple| but also effect the current
+% label format if set to |simple| (via |\caption@set|).
+% \begin{macrocode}
+\newcommand*\caption@set{%
+ \caption@maparg\caption@@set}%
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@set[3]{%
+ \caption@checkdecl{#1}{#3}{%
+% \expandafter\edef\csname caption@@#2\endcsname{#3}% could be used for debugging
+ \expandafter\def\csname caption@#2\expandafter\endcsname\expandafter{\csname caption@#1@#3\endcsname}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SetCaptionDefault}
+% \changes{v2.0}{2019/09/10}{This macro added}
+% \changes{v2.0}{2020/07/28}{Check for `default' added to prevent infinite loop}
+% |\SetCaptionDefault*|\marg{option}\marg{name}\\
+% sets the default value for the \meta{option}.
+% The starred variant is only relevant for setting default values for lengths
+% like |margin|. (See definition of |\caption@set|\-|default@length| for
+% details.)
+% \begin{macrocode}
+\newcommand*\SetCaptionDefault{%
+ \caption@teststar\caption@setdefault\def\edef}
+\@onlypreamble\SetCaptionDefault
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setdefault[2]{%
+ \@ifundefined{caption@setdefault@#2}%
+ {\caption@maparg\caption@@setdefault}%
+ {\@nameuse{caption@setdefault@#2}{#1}}%
+ {#2}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setdefault[3]{%
+ \caption@ifdefault{#3}%
+ {\caption@Error{Invalid argument for \string\SetCaptionDefault: `#3'}}% would cause an infinite loop otherwise
+ {\caption@@set{#1}{#2@default}{#3}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifdefault}
+% \changes{v2.0}{2020/08/23}{This macro added}
+% |\caption@ifdefault|\marg{value}\marg{yes-code}\marg{no-code}\\
+% expands to \meta{yes-code} if the \meta{value} expands to `default',
+% and to \meta{no-code} otherwise.
+% \begin{macrocode}
+\newcommand*\caption@ifdefault{\caption@ifequal{default}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@ifequal[2]{%
+ \edef\caption@tempa{#1}%
+ \edef\caption@tempb{#2}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setmapping}
+% \changes{v2.0}{2020/08/23}{This macro added}
+% |\caption@setmapping|\marg{source option}\marg{destination option}\\
+% sets a mapping from the \meta{source option} to the
+% \meta{destination option}, for example |label|\-|font| to |font|
+% since |label|\-|font| does not have any own definitions but shares
+% them with |font|.
+% \begin{macrocode}
+\newcommand*\caption@setmapping[2]{%
+ \@namedef{caption@map@#1}{#2}}
+\@onlypreamble\caption@setmapping
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@maparg}
+% \changes{v2.0}{2020/08/23}{This macro added}
+% |\caption@maparg|\marg{command}\marg{option}\\
+% similar to |\@dblarg| but either duplicates the given \meta{option} or
+% expands it to \meta{destination option} plus \meta{option} if a mapping
+% was defined for the given option (via |\caption@set|\-|mapping|).
+% \begin{macrocode}
+\newcommand*\caption@maparg[2]{%
+ \@ifundefined{caption@map@#2}%
+ {#1{#2}}%
+ {#1{\csname caption@map@#2\endcsname}}%
+ {#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@switchdefault}
+% \changes{v2.0}{2020/08/01}{This macro added}
+% |\caption@switchdefault\marg{option}|\marg{code with \#1}\marg{name}\\
+% like |\Set|\-|Caption|\-|Default| but first expands the given code with the
+% to-be-overwritten internal command as argument, so it can be stored (and
+% restored later on).
+% The main purpose of this command is switching default settings in
+% \package{babel} language packages, e.g.:
+% \begin{quote}|\caption@switchdefault{labelfont}{\babel@save #1}{sc}|\end{quote}
+% \begin{macrocode}
+\def\caption@switchdefault#1#2{%
+ \def\caption@tempa##1{#2}%
+ \expandafter\caption@tempa\csname caption@#1@default\endcsname
+ \caption@setdefault\def{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@restoredefault}
+% \changes{v2.0}{2020/08/01}{This macro added}
+% |\caption@restoredefault\marg{option}|\marg{command}\\
+% restores a default setting which was stored to \meta{command} before
+% (via |\caption@switch|\-|default|).
+% \begin{macrocode}
+\def\caption@restoredefault#1#2{%
+ \caption@checkdecl{#1}{default}{%
+ \caption@ifdefined#2{%
+ \expandafter\let\csname caption@#1@default\endcsname#2%
+ \let#2\@undefined}{}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SetCaptionFallback}
+% \changes{v2.2}{2020/09/21}{This macro added}
+% |\SetCaptionFallback|\marg{option}\marg{name}\\
+% sets the fallback value for the \meta{option}.
+% \begin{macrocode}
+\newcommand*\SetCaptionFallback{%
+ \caption@maparg\caption@@setfallback}
+\@onlypreamble\SetCaptionFallback
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setfallback[3]{%
+ \caption@ifequal{fallback}{#3}%
+ {\caption@Error{Invalid argument for \string\SetCaptionFallback: `#3'}}% would cause an infinite loop otherwise
+ {\caption@@set{#1}{#2@fallback}{#3}}}
+\@onlypreamble\caption@@setfallback
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@decl@package}
+% \changes{v2.0}{2020/07/26}{This macro added}
+% |\caption@decl@package|\marg{option}\marg{cmd}\oarg{package}\marg{name}\ldots\\
+% Helper command to declare a caption package option value which is dependent
+% on the existence of a specific package, for example the |font| value
+% |one|\-|half|\-|spacing| which is dependent on the \package{setspace}
+% package.
+% \begin{macrocode}
+\newcommand*\caption@decl@package[2]{%
+ \@ifnextchar[%]
+ {\caption@declare@package{#1}{#2}}%
+ {\caption@declarepackage{#1}{#2}}}
+\@onlypreamble\caption@decl@package
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@declare@package#1#2[#3]#4{%
+ \global\@namedef{caption@#1@#4@package}{#3}%
+ #2{#4}}
+\@onlypreamble\caption@declare@package
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declarepackage[3]{%
+ \global\@nameundef{caption@#1@#3@package}%
+ #2{#3}}
+\@onlypreamble\caption@declarepackage
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@load@package}
+% \changes{v2.0}{2020/07/26}{This macro added}
+% |\caption@load@package|\marg{option}\marg{value}\\
+% If the given option value needs a package, it will be loaded automatically.
+% \begin{macrocode}
+\newcommand*\caption@load@package[2]{%
+ \expandafter\let\expandafter\caption@tempa\csname caption@#1@#2@package\endcsname
+ \caption@ifdefined\caption@tempa
+ {\caption@requirepackage\caption@tempa{#1=#2}}%
+ {}}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Declaring and setting lengths}
+%
+% \begin{macro}{\DeclareCaptionLength}
+% \changes{v2.0}{2020/08/09}{This macro added}
+% |\DeclareCaptionLength|\marg{name}\marg{default value}\\
+% \begin{enumerate}
+% \item Defines a new length (dimension)
+% \item Installes a hook for |\caption@set|\-|default| so
+% |\caption@set|\-|default@length| will be used to set a default
+% value for this length
+% \item Sets a default value using |\Set|\-|Caption|\-|Default*|.
+% \end{enumerate}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionLength[1]{%
+ \expandafter\newdimen\csname caption#1\endcsname
+ \@namedef{caption@setdefault@#1}##1{%
+ \caption@setdefault@length{##1}}%
+ \SetCaptionDefault*{#1}}
+\@onlypreamble\DeclareCaptionLength
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setdefault@length}
+% \changes{v2.0}{2020/08/09}{This macro added}
+% |\caption@setdefault@length*|\marg{cmd}\marg{name}\marg{value}\\
+% sets a default value for the given \meta{length}, either using |\def|
+% (if the starred variant is used) or |\edef| (if the non-starred variant is
+% used).
+% \begin{macrocode}
+\newcommand*\caption@setdefault@length[3]{%
+ \expandafter#1\csname caption#2@default\endcsname{#3}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setlength}
+% \changes{v2.0}{2020/08/09}{This macro added}
+% |\caption@setlength|\marg{name}\marg{value}\\
+% sets a length to either the given \meta{value} or to the default value if
+% \meta{value} is `default'.
+% \begin{macrocode}
+\newcommand*\caption@setlength[2]{%
+ \caption@ifdefault{#2}%
+ {\expandafter\let\expandafter\caption@tempa\csname caption#1@default\endcsname}%
+ {\def\caption@tempa{#2}}%
+ \expandafter\setlength\csname caption#1\endcsname\caption@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Margin resp. width}
+% \changes{v1.0n}{2007/04/01}{\cs{captionmarginx} renamed to \cs{captionmargin@}}
+% \changes{v1.0n}{2007/04/03}{Option `twoside' added}
+% \changes{v1.1}{2007/08/11}{Options `margin*', `minmargin', and `maxmargin' added}
+% \changes{v1.2}{2007/11/10}{Option `oneside' added}
+%
+% \begin{macro}{\captionmargin}
+% \begin{macro}{\captionwidth}
+% |\captionmargin| and |\captionwidth| contain the extra margin
+% resp. the total width used for captions. Please never set these values in
+% a direct way, they are just accessible in user documents to provide
+% compatibility to \version{1.x} of the \package{caption} package.\par
+% Note that we can only set one value at a time, `margin' \emph{or} `width'.
+% If |\caption|\-|width| is not zero we will take this value afterwards,
+% otherwise |\caption|\-|margin| and |\caption|\-|margin@|.
+% \begin{macrocode}
+\DeclareCaptionLength{margin}{0pt}
+\DeclareCaptionLength{margin@}{\the\captionmargin}
+\DeclareCaptionLength{width}{0pt}
+\newdimen\caption@tempdima
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{margin}{\setcaptionmargin{#1}}
+\DeclareCaptionOption{margin*}{\setcaptionmargin*{#1}}
+\DeclareCaptionOption{width}{\setcaptionwidth{#1}}
+\DeclareCaptionOption{width*}{\setcaptionwidth*{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{calcmargin}{\caption@setcalcmargin{#1}}
+\DeclareCaptionOption{calcmargin*}{\caption@setcalcmargin*{#1}}
+\DeclareCaptionOption{calcwidth}{\caption@setcalcwidth{#1}}
+\DeclareCaptionOption{calcwidth*}{\caption@setcalcwidth*{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{twoside}[1]{\caption@set@bool\caption@iftwoside{#1}}
+\DeclareCaptionOptionNoValue{oneside}{\caption@set@bool\caption@iftwoside0}
+\caption@set@bool\caption@iftwoside{\if@twoside 1\else 0\fi}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{minmargin}{\caption@setoptcmd\caption@minmargin{#1}}
+\DeclareCaptionOption{maxmargin}{\caption@setoptcmd\caption@maxmargin{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\setcaptionmargin}
+% \changes{v1.0f}{2005/10/24}{Renamed from \cs{caption@setmargin} to \cs{setcaptionmargin}}
+% \changes{v1.0f}{2005/10/24}{\cs{setcaptionmargin} enhanced so it can take left+right margin}
+% \changes{v1.1}{2007/08/11}{Starred variant added}
+% \changes{v1.1}{2007/08/12}{\cs{setlength}\cs{captionmargin} \& \cs{setlength}\cs{captionmargin@} swapped so `\texttt{margin*=}\cs{captionmargin}' works in singleline options}
+% \changes{v1.3}{2010/11/07}{Support for option \opt{calcmargin} added}
+% |\setcaptionmargin*|\marg{amount}\\
+% sets the caption margin to the given \meta{amount}.
+% Please never use this in user documents, it's just there to
+% provide compatibility to the \package{caption2} package.
+% \begin{macrocode}
+\newcommand*\setcaptionmargin{%
+ \caption@resetcalcmargin
+ \caption@setmargin}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setmargin{%
+ \caption@teststar\caption@@setmargin\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setmargin[2]{%
+ #1{\captionwidth\z@}%
+ \caption@@@setmargin#2,#2,\@nil}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@@setmargin#1,#2,#3\@nil{%
+ \caption@setlength{margin}{#1}%
+ \caption@setlength{margin@}{#2}%
+ \addtolength\captionmargin@{-\captionmargin}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\setcaptionwidth}
+% \changes{v1.0f}{2005/10/24}{Renamed from \cs{caption@setwidth} to \cs{setcaptionwidth}}
+% \changes{v1.3}{2010/11/07}{Starred variant added}
+% \changes{v1.3}{2010/11/07}{Support for option \opt{calcwidth} added}
+% |\setcaptionwidth*|\marg{amount}\\
+% sets the caption width to the given \meta{amount}.
+% Please never use this in user documents, it's just there to
+% provide compatibility to the \package{caption2} package.
+% \begin{macrocode}
+\newcommand*\setcaptionwidth{%
+ \caption@resetcalcmargin
+ \caption@setwidth}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setwidth{%
+ \caption@teststar\caption@@setwidth\@gobble\@firstofone}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setwidth[2]{%
+ #1{\captionmargin\z@\captionmargin@\z@}%
+ \caption@setlength{width}{#2}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setcalcmargin}
+% \changes{v1.3}{2010/11/07}{This macro added}
+% |\caption@setcalcmargin*|\marg{amount}\\
+% sets the caption margin to the given \meta{amount}
+% right before the caption will be typeset, i.e.\meta{amount} will
+% not be evaluated immediately.
+% \begin{macrocode}
+\newcommand*\caption@setcalcmargin{%
+ \caption@teststar{\caption@@setcalcmargin\caption@setmargin}%
+ \@secondoftwo\@firstoftwo}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setcalcmargin[3]{%
+ #2{\caption@resetcalcmargin
+ \l@addto@macro\caption@calcmargin@hook{#1{#3}}}%
+ {\l@addto@macro\caption@calcmargin@hook{#1*{#3}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@resetcalcmargin}
+% \changes{v1.3}{2010/11/07}{This macro added}
+% |\caption@resetcalcmargin|\\
+% clears the value which was stored in |\caption@set|\-|calc|\-|margin|.
+% \begin{macrocode}
+\newcommand*\caption@resetcalcmargin{%
+ \let\caption@calcmargin@hook\@empty}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setcalcwidth}
+% \changes{v1.3}{2010/11/07}{This macro added}
+% |\caption@setcalcwidth*|\marg{amount}\\
+% sets the caption width to the given \meta{amount}
+% right before the caption will be typeset, i.e.\meta{amount} will
+% not be evaluated immediately.
+% \begin{macrocode}
+\newcommand*\caption@setcalcwidth{%
+ \caption@teststar{\caption@@setcalcmargin\caption@setwidth}%
+ \@secondoftwo\@firstoftwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@thecounter}
+% \changes{v1.0n}{2007/04/03}{This counter added}
+% \changes{v1.1e}{2007/10/28}{Renamed from \cs{caption@counter} to \cs{caption@thecounter}; \cs{caption@stepcounter} added}
+% \changes{v1.5}{2012/04/09}{\cs{caption@stepcounter} renamed to \cs{caption@stepthecounter}}
+% Internal counter.
+% At the moment it will be used inside |\caption@if|\-|odd|\-|page| only.
+% \begin{macrocode}
+\newcommand*\caption@thecounter{0}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@stepthecounter{%
+ \@tempcnta\caption@thecounter
+ \advance\@tempcnta\@ne\relax
+ \xdef\caption@thecounter{\the\@tempcnta}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@newlabel}
+% \changes{v1.0n}{2007/04/03}{This macro added}
+% |\caption@newlabel|\marg{name}\marg{value}\\
+% This command is a modified version of |\new|\-|label| from \LaTeX2e.
+% It will be written to the \texttt{.aux} file to
+% pass label information from one run to another.
+% (We use it inside |\caption@if|\-|odd|\-|page|.)
+% \begin{macrocode}
+\newcommand*\caption@newlabel{\@newl@bel{caption@r}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@thepage}
+% \changes{v1.0n}{2007/04/03}{This macro added}
+% This command is a modified version of |\the|\-|page| from \LaTeX2e.
+% It will be used inside |\caption@if|\-|odd|\-|page| only.
+% \begin{macrocode}
+\newcommand*\caption@thepage{\the\c@page}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@label}
+% \changes{v1.1}{2007/09/01}{This macro added}
+% \changes{v1.2}{2007/12/03}{Definition of \cs{caption@newlabel} in aux file added}
+% |\caption@label|\marg{name}\\
+% This command is a modified version of |\label| from \LaTeX2e.
+% It will be used inside |\caption@if|\-|odd|\-|page| and |\FP@help|\-|Note|.
+% \begin{macrocode}
+\newcommand*\caption@label[1]{%
+ \caption@@label
+ \protected@write\@auxout{\let\caption@thepage\relax}%
+ {\string\caption@newlabel{#1}{\caption@thepage}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@label{%
+ \global\let\caption@@label\relax
+ \protected@write\@auxout{}%
+ {\string\providecommand*\string\caption@newlabel[2]{}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@pageref}
+% \changes{v1.1}{2007/09/01}{This macro added}
+% \changes{v1.2d}{2009/10/09}{Uses \cs{@latex@warning} instead of \cs{caption@Warning} now}
+% |\caption@pageref|\marg{name}\\
+% This command is a modified version of |\page|\-|ref| from \LaTeX2e.
+% It will be used inside |\caption@if|\-|odd|\-|page| and |\FP@help|\-|Note|.
+% \begin{macrocode}
+\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}%
+ \else
+ \expandafter\let\expandafter\caption@thepage\csname caption@r@#1\endcsname
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifoddpage}
+% \changes{v1.0n}{2007/04/03}{This macro added}
+% \changes{v1.1e}{2007/10/28}{Incrementation of counter moved to \cs{caption@@make}}
+% Currently this macro uses an own label\ldots ref mechanism,
+% but an alternative implementation method would use the
+% \package{refcount} package\cite{refcount} and
+% |\ifodd\get|\-|page|\-|ref|\-|number{|\ldots|}|.
+% Maybe we will change that in a later release.
+% \Note{This macro re-defines itself so the \texttt{.aux} file will
+% only be used once per group.}
+% \begin{macrocode}
+\newcommand*\caption@ifoddpage{%
+ \caption@iftwoside{%
+ \caption@label\caption@thecounter
+ \caption@pageref\caption@thecounter
+ \ifodd\caption@thepage
+ \let\caption@ifoddpage\@firstoftwo
+ \else
+ \let\caption@ifoddpage\@secondoftwo
+ \fi
+ }{\let\caption@ifoddpage\@firstoftwo}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@ifoddpage}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setoptcmd}
+% \changes{v1.1}{2007/08/11}{This macro added}
+% |\caption@setoptcmd|\marg{command}\marg{off -or- value}\\
+% defines the given \meta{command} to \meta{value},
+% but if \meta{value} if `off' the given \meta{command} is undefined instead.
+% \begin{macrocode}
+\newcommand*\caption@setoptcmd[2]{%
+ \caption@ifinlist{#2}{0,false,no,off}{\let#1\@undefined}{\def#1{#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Indentions}
+%
+% \begin{macro}{\caption@indent}
+% \changes{v1.1}{2007/07/29}{Renamed from \cs{captionindent} to \cs{caption@indent}}
+% \begin{macro}{\caption@parindent}
+% \begin{macro}{\caption@hangindent}
+% These are the indentions we support.
+% \begin{macrocode}
+\DeclareCaptionLength{@indent}{0pt}
+\DeclareCaptionLength{@parindent}{0pt}
+\DeclareCaptionLength{@hangindent}{0pt}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \changes{v1.0b}{2004/05/16}{Defaults added for options \opt{parindent=} and \opt{hangindent=}}
+% \changes{v1.0f}{2005/08/22}{Option \opt{parskip=}: \cs{AtBeginCaption} replaced by \cs{caption@@par}}
+% \changes{v1.0f}{2005/08/22}{Undocumented defaults for \opt{parindent=}, \opt{hangindent=}, and \opt{parskip=} removed}
+% \begin{macrocode}
+\DeclareCaptionOption{indent}[\leftmargini]{% obsolete
+ \caption@setlength{@indent}{#1}}
+\DeclareCaptionOption{indention}[\leftmargini]{%
+ \caption@setlength{@indent}{#1}}
+\DeclareCaptionOption{parindent}{%
+ \caption@setlength{@parindent}{#1}}
+\DeclareCaptionOption{hangindent}{%
+ \caption@setlength{@hangindent}{#1}}
+\DeclareCaptionOption{parskip}{%
+ \l@addto@macro\caption@@par{\setlength\parskip{#1}}}
+% \end{macrocode}
+%
+% \section{Styles}
+%
+% \begin{macro}{\DeclareCaptionStyle}
+% \changes{v1.0a}{2004/01/17}{Pass through argument \#3 so extra spaces between arguments do make any harm}
+% \changes{v2.0}{2019/09/10}{Uses \cs{caption@decl} now}
+% \changes{v2.0}{2020/07/27}{\cs{caption@sls} renamed to \cs{caption@slsty}}
+% |\DeclareCaptionStyle|\marg{name}\oarg{single-line-list-of-KV}\marg{list-of-KV}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionStyle[1]{%
+ \@testopt{\caption@declarestyle{#1}}{}}
+\@onlypreamble\DeclareCaptionStyle
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@declarestyle#1[#2]#3{%
+ \caption@decl{style}{#1}%
+ {\def\caption@slsty{#2}%
+ \def\caption@sty{#3}}%
+% \end{macrocode}
+% The \package{floatrow} package uses |\@if|\-|undefined{caption@sty@#1}| to
+% determine in |\flrow@set|\-|style| if a caption style is defined or not.
+% Since the \package{floatrow} package is unmaintained we fake the definition
+% so the test will still work.
+% \begin{macrocode}
+ \@namedef{caption@sty@#1}{\@unused}}
+\@onlypreamble\caption@declarestyle
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.2a}{2008/01/20}{Option \opt{style*=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{style}{\caption@setstyle{#1}}
+\DeclareCaptionOption{style*}{\caption@setstyle*{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setstyle}
+% \changes{v1.0e}{2005/06/01}{Starred variant added}
+% \changes{v1.1}{2007/07/29}{Recursive style definitions should work now}
+% \changes{v1.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency}
+% \changes{v1.2}{2007/12/03}{Definition of \cs{caption@iftypewarning} removed}
+% \changes{v2.0}{2019/09/10}{Uses \cs{caption@ifdecl} and \cs{caption@checkdecl} now}
+% |\caption@setstyle*|\marg{name}\\
+% Selecting a caption style means saving the additional
+% \meta{single-line-list-of-KV} (this will be done by |\caption@sl|\-|sty|),
+% resetting the caption options to the base ones (this will be done using
+% |\caption@reset|\-|style|) and executing the \meta{list-of-KV} options
+% (this will be done using |\caption@setup|).\par
+% The starred version will give no error message if the given style is not
+% defined.
+% \begin{macrocode}
+\newcommand*\caption@setstyle{%
+ \caption@teststar\caption@@setstyle\caption@ifdecl\caption@checkdecl}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setstyle[2]{%
+ #1{style}{#2}%
+ {\caption@set{style}{#2}%
+ \caption@style % defines \caption@sty & \caption@slsty
+ \ifx\caption@setstyle@flag\@undefined
+ \let\caption@setstyle@flag\relax % prevent \caption@resetstyle if called recursively
+ \caption@resetstyle
+ \caption@xsetup\caption@sty
+ \let\caption@setstyle@flag\@undefined
+ \else
+ \caption@xsetup\caption@sty
+ \fi}%
+ {}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@resetstyle}
+% \changes{v1.1}{2007/02/04}{This macro renamed from \cs{caption@setdefault} to \cs{caption@resetstyle}}
+% \changes{v1.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency}
+% \changes{v1.2}{2007/11/17}{Usage of \opt{size=} added}
+% \changes{v1.2b}{2008/05/06}{Usage of \opt{rule} added}
+% \changes{v1.5}{2012/03/15}{\opt{box=parbox} added}
+% \changes{v1.6}{2013/05/01}{\opt{box=none} added, \opt{box=parbox} changed to \opt{parbox=parbox}}
+% |\caption@resetstyle|\\
+% This resets (nearly) all caption options to the base ones.
+% \emph{Note that this does not touch the skips and the positioning.}
+% \begin{macrocode}
+\newcommand*\caption@resetstyle{%
+ \caption@setup{%
+ box=none,boxcolor=white,parbox=parbox,%
+ format=plain,labelformat=default,labelsep=colon,textformat=simple,%
+ font=,labelfont=,textfont=,size=,%
+ justification=justified,slc,rule,strut,%
+ margin=0pt,minmargin=0,maxmargin=0,%
+ indent=0pt,parindent=0pt,hangindent=0pt}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.0c}{2005/02/12}{\opt{indent=0pt} added to caption style \opt{default}}
+% \changes{v1.1}{2007/02/04}{Caption style `default' renamed to `base', and a new `default' added}
+% \changes{v1.1}{2007/03/31}{\opt{format=plain} added to caption style \opt{default}}
+% \changes{v1.1c}{2007/10/14}{\opt{format=plain} removed from caption style \opt{default}}
+% \changes{v1.5}{2012/03/15}{\opt{box=default} added to caption style \opt{default}}
+% Currently there are two pre-defined styles, called `base' \& `default'.
+% The first one is a perfect match to the behavior of |\@make|\-|caption|
+% offered by the standard \LaTeX\ document classes (and was called `default'
+% in \thispackage\ \version{1.0}), the second one matches the document
+% class actually used.
+% \begin{macrocode}
+\DeclareCaptionStyle{base}[indent=0pt,justification=centering]{}
+\DeclareCaptionStyle{default}[indent=0pt,justification=centering]{%
+ box=default,%
+ format=default,labelformat=default,labelsep=default,textformat=default,%
+ font=default,labelfont=default,textfont=default,size=default,%
+ justification=default,slc=default,margin=default,%
+ indent=default,parindent=default,hangindent=default}
+% \end{macrocode}
+%
+% \begin{macro}{\DeclareCaptionSinglelinecheck}
+% \changes{v2.0}{2019/09/10}{This macro added}
+% |\DeclareCaptionSinglelinecheck|\marg{name}\marg{code}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionSinglelinecheck[2]{%
+ \caption@decl{singlelinecheck}{#1}{#2}}
+\@onlypreamble\DeclareCaptionSinglelinecheck
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.2b}{2008/05/06}{Option \opt{slc=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{singlelinecheck}[1]{\caption@setsinglelinecheck{#1}}
+\DeclareCaptionOption{slc}[1]{\KV@caption@singlelinecheck{#1}}
+% \end{macrocode}
+%
+% These are the pre-defined single-line-check code snippets.
+% \begin{macrocode}
+\DeclareCaptionSinglelinecheck{on}{\@firstoftwo}
+\DeclareCaptionSinglelinecheck{off}{\@secondoftwo}
+% \end{macrocode}
+%
+% `default' usually maps to `on'.
+% \begin{macrocode}
+\SetCaptionDefault{singlelinecheck}{on}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setsinglelinecheck}
+% \changes{v2.0}{2018/03/13}{This macro added}
+% |\caption@setsinglelinecheck|\marg{value}\\
+% sets the single-line-check either on or off,
+% where \meta{value} could be either a \meta{name} or boolean value.
+% \begin{macrocode}
+\newcommand*\caption@setsinglelinecheck[1]{%
+ \caption@ifdecl{singlelinecheck}{#1}%
+ {\caption@set{singlelinecheck}{#1}}%
+ {\caption@set@bool\caption@singlelinecheck{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Boxes}
+%
+% \begin{macro}{\DeclareCaptionBox}
+% \changes{v1.5}{2012/03/15}{This macro added}
+% \changes{v2.0}{2019/09/10}{Uses \cs{caption@decl} now}
+% \changes{v2.2f}{2020/10/26}{\cs{par} is now allowed as part of the \meta{code} argument}
+% |\DeclareCaptionBox|\marg{name}\marg{code with \#1 and \#2}
+% \begin{macrocode}
+\newcommand\DeclareCaptionBox[2]{%
+ \caption@decl{box}{#1}##1##2{#2}}
+\@onlypreamble\DeclareCaptionBox
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.5}{2012/03/15}{Option \opt{box=} added}
+% \changes{v1.6}{2013/05/01}{Option \opt{parbox=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{box}{\caption@set{box}{#1}}
+\DeclareCaptionOption{parbox}{\caption@set{parbox}{#1}}
+\caption@setmapping{parbox}{box}
+% \end{macrocode}
+%
+% There are four pre-defined boxes, called `empty', `none',
+% `parbox', and `colorbox'.
+% \changes{v1.0i}{2006/05/13}{We define \cs{captionbox} instead of \cs{caption@start/endbox}}
+% \changes{v1.0l}{2006/03/09}{Bugfix 07-03-09: \cs{captionbox} changed from \cs{parbox-t} to \cs{parbox-b}}
+% \changes{v1.2}{2007/11/11}{\cs{captionbox} renamed to \cs{caption@parbox}}
+% \changes{v1.5}{2012/03/15}{\cs{caption@parbox} adapted to \cs{DeclareCaptionBox}}
+% \changes{v1.6}{2013/05/02}{Option \opt{boxsep=} added}
+% \changes{v2.1b}{2020/09/17}{Missing braces re-added to \opt{colorbox} option code}
+% \begin{macrocode}
+\DeclareCaptionBox{empty}{}
+\DeclareCaptionBox{none}{#2}
+\DeclareCaptionBox{parbox}{\parbox[b]{#1}{#2}}
+\DeclareCaptionBox{colorbox}{%
+ \colorbox{\caption@boxcolor}{%
+ \setlength\caption@tempdima{#1}%
+ \addtolength\caption@tempdima{-2\fboxsep}%
+ \linewidth\caption@tempdima\relax
+ \hsize\caption@tempdima\relax
+ #2}}
+\DeclareCaptionOption{boxcolor}{\def\caption@boxcolor{#1}}
+\DeclareCaptionOption{boxsep}{\setlength\fboxsep{#1}}
+% \end{macrocode}
+%
+% `default' usually maps to `none' resp.~`parbox'.
+% \begin{macrocode}
+\SetCaptionDefault{box}{none}
+%\SetCaptionDefault{parbox}{parbox}
+% \end{macrocode}
+%
+% \section{Formats}
+%
+% \begin{macro}{\DeclareCaptionFormat}
+% \changes{v1.0a}{2004/01/17}{Pass through argument \#3 so extra spaces between arguments do make any harm}
+% \changes{v1.0c}{2005/02/09}{Starred variant added}
+% \changes{v1.1c}{2007/10/15}{Optional argument added}
+% \changes{v2.0}{2019/09/10}{Uses \cs{caption@decl} now}
+% \changes{v2.0}{2020/07/27}{\cs{caption@ifh} renamed to \cs{caption@ifhmode}}
+% |\DeclareCaptionFormat*|\marg{name}\marg{code with \#1, \#2, and \#3}\\
+% The starred form causes the code being typeset in vertical (instead of
+% horizontal) mode, but does not support the |indention=| option.
+% \begin{macrocode}
+\newcommand*\DeclareCaptionFormat{%
+ \caption@teststar\caption@declareformat\@gobble\@firstofone}
+\@onlypreamble\DeclareCaptionFormat
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declareformat[2]{%
+ \@dblarg{\caption@@declareformat#1{#2}}}
+\@onlypreamble\caption@declareformat
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@declareformat#1#2[#3]#4{%
+ \caption@decl[\edef]{format}{#2}{%
+ \unexpanded{\let\caption@ifhmode#1}%
+ \unexpanded{\long\def\caption@slfmt}####1####2####3\unexpanded{{#3}}%
+ \unexpanded{\long\def\caption@fmt}####1####2####3\unexpanded{{#4}}}}
+\@onlypreamble\caption@@declareformat
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@useformat}
+% \changes{v2.0}{2020/07/31}{This macro added}
+% |\caption@useformat|\marg{name}\\
+% expands |\caption@fmt| based on the given format \meta{name}.
+% \begin{macrocode}
+\newcommand*\caption@useformat[1]{% used by caption-koma.sto
+ \caption@checkdecl{format}{#1}{%
+ \begingroup
+ \@nameuse{caption@format@#1}\global\let\caption@tempa\caption@fmt
+ \endgroup\caption@tempa}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{format}{\caption@set{format}{#1}}
+% \end{macrocode}
+%
+% \changes{v1.0a}{2004/01/23}{Caption format \opt{default} renamed to \opt{normal}}
+% \changes{v1.0e}{2005/05/12}{Caption format \opt{normal} renamed to \opt{@normal}}
+% \changes{v1.0f}{2005/08/25}{Caption format \opt{@normal} renamed to \opt{plain} and documented}
+% \changes{v1.1c}{2007/10/14}{Single-line variant of caption format \opt{hang} added}
+% There are two pre-defined formats, called `plain' and `hang'.
+% \begin{macrocode}
+\DeclareCaptionFormat{plain}{#1#2#3\par}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionFormat{hang}[#1#2#3\par]{%
+ \caption@iflabelseparatorwithnewline
+ {\caption@Error{%
+ The option `labelsep=\caption@labelsep@name' does not work\MessageBreak
+ with `format=hang'}}%
+ {\@hangfrom{#1#2}%
+ \advance\caption@parindent\hangindent\relax
+ \advance\caption@hangindent\hangindent\relax
+ \caption@@par#3\par}}
+% \end{macrocode}
+%
+% `default' usually maps to `plain'.
+% \begin{macrocode}
+\SetCaptionDefault{format}{plain}
+% \end{macrocode}
+%
+% \section{Label formats}
+%
+% \begin{macro}{\DeclareCaptionLabelFormat}
+% \changes{v1.0a}{2004/01/17}{Pass through argument \#2 so extra spaces between arguments do make any harm}
+% \changes{v2.0}{2019/09/10}{Uses \cs{caption@decl} now}
+% |\DeclareCaptionLabelFormat|\marg{name}\marg{code with \#1 and \#2}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionLabelFormat[2]{%
+ \caption@decl{labelformat}{#1}##1##2{#2}}
+\@onlypreamble\DeclareCaptionLabelFormat
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{labelformat}{\caption@set{labelformat}{#1}}
+% \end{macrocode}
+%
+% \changes{v1.2}{2007/12/16}{Caption label format \opt{brace} added}
+% \changes{v1.7}{2015/09/16}{Caption label format \opt{autodot} added}
+% \changes{v1.7}{2016/05/22}{Caption label format \opt{autodot} fixed}
+% \changes{v1.8}{2016/05/22}{Caption label format \opt{unnumbered} added}
+% There are six pre-defined label formats, called `empty', `simple',
+% `parens', `brace', `autodot', and `unnumbered'.
+%
+% \begin{macrocode}
+\DeclareCaptionLabelFormat{empty}{}
+\DeclareCaptionLabelFormat{simple}{\bothIfFirst{#1}{\nobreakspace}#2}
+\DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{\nobreakspace}(#2)}
+\DeclareCaptionLabelFormat{brace}{\bothIfFirst{#1}{\nobreakspace}#2)}
+\DeclareCaptionLabelFormat{autodot}{\bothIfFirst{#1}{\nobreakspace}#2\autodot}
+\DeclareCaptionLabelFormat{unnumbered}{#1}
+% \end{macrocode}
+%
+% \changes{v2.0}{2020/08/03}{Caption label format \opt{original} added}
+% The label format `original' tries to preserve the original definition
+% of the label format which was defined by |\fnum@|\meta{environment}.
+% If no original definition is available, use the label format `simple'
+% as fallback.
+%
+% \begin{macrocode}
+\DeclareCaptionLabelFormat{original}{%
+ \caption@ifdefined\caption@original@fnum
+ {\caption@original@fnum}%
+ {\caption@labelformat@fallback{#1}{#2}}}
+% \end{macrocode}
+%
+% `default' usually maps to `original' resp. `simple'.
+% \begin{macrocode}
+\SetCaptionDefault{labelformat}{original}
+\SetCaptionFallback{labelformat}{simple}
+% \end{macrocode}
+%
+% \section{Label separators}
+%
+% \begin{macro}{\DeclareCaptionLabelSeparator}
+% \changes{v1.0a}{2004/01/17}{Pass through argument \#2 so extra spaces between arguments do make any harm}
+% \changes{v1.0f}{2005/08/25}{Starred variant added}
+% \changes{v1.1}{2007/07/13}{Test for CR added}
+% \changes{v1.3}{2011/08/06}{Test for CR revised}
+% \changes{v2.0}{2018/05/15}{Variant with two stars added}
+% \changes{v2.0}{2019/09/10}{Uses \cs{caption@decl} now}
+% \changes{v2.0}{2020/07/27}{\cs{caption@iflf} renamed to \cs{caption@iflabelfont}}
+% \changes{v2.0}{2020/07/27}{\cs{caption@lsep} renamed to \cs{caption@labelsep}}
+% \changes{v2.0}{2020/07/27}{Definition of \cs{caption@labelsep@name} added}
+% |\DeclareCaptionLabelSeparator|\marg{name}\marg{code}\\
+% |\DeclareCaptionLabelSeparator*|\marg{name}\marg{code}\\
+% |\DeclareCaptionLabelSeparator**|\marg{name}\marg{condition}\marg{code}\\
+% The starred form causes the label separator to be typeset \emph{without}
+% using |\caption|\-|label|\-|font|.
+% The two-starred form uses \meta{condition} to decide if the label separator
+% should be typeset with or without using |\caption|\-|label|\-|font|.
+% \begin{macrocode}
+\newcommand\DeclareCaptionLabelSeparator{%
+ \@ifstar
+ \DeclareCaptionLabelSeparator@
+ {\caption@declarelabelseparator\@firstofone}}
+\@onlypreamble\DeclareCaptionLabelSeparator
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\DeclareCaptionLabelSeparator@{%
+ \@ifstar
+ \DeclareCaptionLabelSeparator@@
+ {\caption@declarelabelseparator\@gobble}}
+\@onlypreamble\DeclareCaptionLabelSeparator@
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionLabelSeparator@@[2]{%
+ \caption@declarelabelseparator
+ {#2\@gobble\@firstofone}%
+ {#1}}
+\@onlypreamble\DeclareCaptionLabelSeparator@@
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@declarelabelseparator[3]{%
+ \caption@decl{labelseparator}{#2}%
+ {\def\caption@iflabelfont{#1}%
+ \def\caption@labelsep@name{#2}%
+ \def\caption@labelsep{#3}}%
+% \end{macrocode}
+% Unfortunately |\Declare|\-|Float|\-|Separators| of the \package{floatrow}
+% package mis-uses |\Declare|\-|Caption|\-|Label|\-|Separator| instead of
+% storing the definition on its own. Since the \package{floatrow} package is
+% unmaintained we have to store the separator definition inside
+% |\caption@lsep@|\meta{name} for \package{floatrow}, too. (Sigh!)
+% \begin{macrocode}
+ \@namedef{caption@lsep@#2}{#3}}
+% \end{macrocode}
+% Since the `default' caption label separator will usually not be defined
+% with |\Declare|\-|Caption|\-|Label|\-|Separator|, we need to define
+% |\caption@lsep@default| manually.
+% \Note{This definition is used by \package{magyar.ldf} but only needs to be different
+% than \cs{caption@lsep} (which is usually undefined).}
+% \begin{macrocode}
+\newcommand*\caption@lsep@default{\caption@labelseparator@default\caption@labelsep}%
+% \end{macrocode}
+% \begin{macrocode}
+\@onlypreamble\caption@declarelabelseparator
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@LabelSeparatorWithNewline}
+% \changes{v2.0}{2020/07/27}{This macro added}
+% |\caption@LabelSeparatorWithNewline|\marg{name}\\
+% adds the given label separator to a list of label separators which uses
+% |\\| internally. (They are incompatible to the `hang' caption format.)
+% \begin{macrocode}
+\newcommand*\caption@LabelSeparatorWithNewline[1]{%
+ \caption@g@addto@list\caption@labelsep@crlist{#1}}
+\@onlypreamble\caption@LabelSeparatorWithNewline
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@iflabelseparatorwithnewline}
+% \changes{v2.0}{2020/07/31}{This macro added}
+% |\caption@iflabelseparatorwithnewline|\marg{yes-code}\marg{no-code}\\
+% tests if the current label separator uses |\\| internally.
+% \begin{macrocode}
+\newcommand*\caption@iflabelseparatorwithnewline{%
+ \caption@ifin@list\caption@labelsep@crlist\caption@labelsep@name}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{labelsep}{\caption@set{labelseparator}{#1}}
+\DeclareCaptionOption{labelseparator}{\caption@set{labelseparator}{#1}}
+% \end{macrocode}
+%
+% \changes{v1.0e}{2005/06/11}{Caption label separator \opt{newline} implementation changed from \cs{newline} to \cs{textbackslash}}
+% \changes{v1.0f}{2005/08/24}{Caption label separator \opt{endash} added}
+% \changes{v1.12}{2020/05/30}{Caption label separator \opt{newline} implementation changed from \cs{textbackslash} to \cs{captionnewline}}
+% There are seven pre-defined label separators, called `none', `colon', `period', `space',
+% `quad', `newline', and `endash'.
+% \begin{macrocode}
+\DeclareCaptionLabelSeparator{none}{}
+\DeclareCaptionLabelSeparator{colon}{: }
+\DeclareCaptionLabelSeparator{period}{. }
+\DeclareCaptionLabelSeparator{space}{ }
+\DeclareCaptionLabelSeparator*{quad}{\quad}
+\DeclareCaptionLabelSeparator*{newline}{\captionnewline}
+% TODO: \DeclareCaptionLabelSeparator should detect on its own if it contains \captionnewline or not
+\caption@LabelSeparatorWithNewline{newline} % does not work with "format=hang"
+\DeclareCaptionLabelSeparator*{endash}{\space\textendash\space}
+% \end{macrocode}
+%
+% \changes{v2.2c}{2020/10/10}{Caption label separators \opt{gobble} and \opt{gobbletwo} added}
+%
+% It's a common hack to mis-use |\fnum@figure| and |\fnum@table| to replace the caption
+% label separator, for example changing the separator to a period plus space with
+% \begin{quote}
+% |\renewcommand\fnum@figure[1]{\figurename~\thefigure.}|
+% \end{quote}
+% or dropping the label and separator completely with
+% \begin{quote}
+% |\renewcommand\fnum@figure[1]{\ignorespaces}|\quad
+% \end{quote}
+% (taken from \url{http://compgroups.net/comp.text.tex/figure-without-caption/1915079}).
+%
+% We emulate the behaviour of |\@make|\-|caption| of the base document classes
+% \class{article}, \class{report}, and \class{book} in this regard (in |\caption@@@make|)
+% so these hacks still work if the \package{caption} package is loaded.
+%
+% These are the label separators used when one or two tokens after the label format
+% should be dropped, called `gobble' and `gobbletwo':
+% \begin{macrocode}
+\DeclareCaptionLabelSeparator{gobble}{ }
+\DeclareCaptionLabelSeparator{gobbletwo}{}
+% \end{macrocode}
+%
+% \begin{macro}{\captionnewline}
+% \changes{v1.12}{2020/05/30}{This macro added}
+% \changes{v2.0}{2020/07/31}{\cs{relax} added to definition}
+% |\captionnewline|\\
+% will be used in the caption label separator |new|\-|line|,
+% and re-defined for |long|\-|table| environments
+% (in package \package{ltcaption}).
+% \begin{macrocode}
+\newcommand*\captionnewline{\\\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% `default' usually maps to `colon'.
+% \begin{macrocode}
+\SetCaptionDefault{labelseparator}{colon}
+% \end{macrocode}
+%
+% \section{Text formats}
+%
+% \begin{macro}{\DeclareCaptionTextFormat}
+% \changes{v1.0j}{2007/02/18}{This macro added}
+% \changes{v2.0}{2019/09/10}{Uses \cs{caption@decl} now}
+% \changes{v2.2f}{2020/10/26}{\cs{par} is now allowed as part of the \meta{code} argument}
+% |\DeclareCaptionTextFormat|\marg{name}\marg{code with \#1}
+% \begin{macrocode}
+\newcommand\DeclareCaptionTextFormat[2]{%
+ \caption@decl{textformat}{#1}##1{#2}}
+\@onlypreamble\DeclareCaptionTextFormat
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{textformat}{\caption@set{textformat}{#1}}
+% \end{macrocode}
+%
+% There are three pre-defined text formats, called `empty', `simple' and `period'.
+% \changes{v1.4}{2011/10/05}{Pre-defined text format `empty' added}
+% \changes{v1.7}{2015/09/16}{The text format `empty' now takes care of the \cs{label}}
+% \begin{macrocode}
+\DeclareCaptionTextFormat{empty}{%
+ \caption@get@label#1\caption@makeanchor{}\@nil
+ \caption@thelabel
+ \global\let\caption@thelabel\relax}
+\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}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionTextFormat{simple}{#1}
+\DeclareCaptionTextFormat{period}{#1.}
+% \end{macrocode}
+%
+% `default' usually maps to `simple'.
+% \begin{macrocode}
+\SetCaptionDefault{textformat}{simple}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@getlabel}
+% \changes{v1.0}{2011/09/03}{\cs{label} can have optional arguments now}
+% \changes{v1.7}{2015/09/16}{Moved from \package{bicaption} package to \package{caption3}}
+% \changes{v1.8d}{2019/09/01}{Bugfix: Global definition of \cs{caption@thelabel} added}
+% \changes{v2.0}{2020/08/23}{Syntax changed}
+% |\caption@getlabel|\marg{text}\\
+% gets the label command out of the given caption text and stores it to
+% |\caption@the|\-|label|.
+% \begin{macrocode}
+\newcommand\caption@getlabel[1]{%
+ \caption@@getlabel#1\label{}\@nil}
+\long\def\caption@@getlabel#1\label#2#3\@nil{%
+ \def\@tempa{#2}%
+ \ifx\@tempa\@empty
+ \let\caption@thelabel\relax
+ \else
+ \def\@tempb{*}%
+ \ifx\@tempa\@tempb
+ \def\caption@thelabel{\label*}%
+ \caption@@@getlabel#3\@nil
+ \else
+ \def\caption@thelabel{\label}%
+ \caption@@@getlabel{#2}#3\@nil
+ \fi
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@@getlabel#1#2\@nil{%
+ \def\@tempa{#1}%
+ \def\@tempb{[}%
+ \ifx\@tempa\@tempb
+ \caption@@@@getlabel#1#2\@nil
+ \else
+ \l@addto@macro\caption@thelabel{{#1}}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@@@getlabel[#1]#2\@nil{%
+ \l@addto@macro\caption@thelabel{[{#1}]}%
+ \caption@@@getlabel#2\@nil}
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@thelabel\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.0c}{2005/02/12}{Option \opt{strut=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{strut}[1]{\caption@set@bool\caption@ifstrut{#1}}
+% \end{macrocode}
+%
+% \section{Fonts}
+%
+% \begin{macro}{\DeclareCaptionFont}
+% \changes{v1.0a}{2004/01/22}{Bugfix: Multi token arguments are allowed now}
+% \changes{v1.1}{2007/05/07}{Internal: Uses \cs{caption@fnt} instead of \cs{caption@temp} now}
+% \changes{v1.8h}{2020/01/03}{Check for \package{ragged2e} package related options added}
+% \changes{v1.10}{2020/05/10}{Optional argument \opt{package} added}
+% |\DeclareCaptionFont|\oarg{package}\marg{name}\marg{code}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionFont{%
+ \caption@decl@package{font}{\caption@declarefont}}
+\@onlypreamble\DeclareCaptionFont
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declarefont[2]{%
+ \caption@decl{font}{#1}##1{#2}%
+ \define@key{caption@font}{#1}[]{\caption@addto@font{#1}{##1}}}
+\@onlypreamble\caption@@declarefont
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@addto@font[1]{%
+% \end{macrocode}
+% \begin{macrocode}
+% Load package first, if necessary
+ \caption@load@package{font}{#1}%
+% \end{macrocode}
+% Add the content to \cs{caption@fnt}
+% \begin{macrocode}
+ \caption@add@to@font{font}{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@add@to@font[3]{%
+ \expandafter\g@addto@macro\expandafter\caption@fnt\expandafter{\csname caption@#1@#2\endcsname{#3}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{font}{\caption@setfont{font}{#1}}
+\DeclareCaptionOption{font+}{\caption@addtofont{font}{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{labelfont}{\caption@setfont{labelfont}{#1}}
+\DeclareCaptionOption{labelfont+}{\caption@addtofont{labelfont}{#1}}
+\caption@setmapping{labelfont}{font}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{textfont}{\caption@setfont{textfont}{#1}}
+\DeclareCaptionOption{textfont+}{\caption@addtofont{textfont}{#1}}
+\caption@setmapping{textfont}{font}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setfont}
+% \changes{v1.0j}{2007/01/30}{Usage of \cs{caption@setkeys} with optional argument}
+% \changes{v1.1}{2006/05/14}{Support of \cs{DeclareDefaultCaptionFont} added}
+% |\caption@setfont|\marg{name}\marg{keyval-list of names}\\
+% Selecting a caption font means saving all the code snippets
+% in |\caption|\meta{name}.
+% \begin{macrocode}
+\newcommand*\caption@setfont[1]{%
+ \expandafter\let\csname caption#1\endcsname\@empty
+ \caption@addtofont{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@addtofont}
+% \changes{v1.2}{2007/11/17}{This macro added}
+% |\caption@addtofont|\marg{name}\marg{keyval-list of names}\\
+% Like |\caption@set|\-|font|, but adds the code snippets to |\caption|\meta{name}.
+% Because we use |\set|\-|keys| recursive here we need to do this inside an
+% extra group.
+% \begin{macrocode}
+\newcommand*\caption@addtofont[2]{%
+ \expandafter\let\expandafter\caption@fnt\csname caption#1\endcsname
+ \begingroup
+ \define@key{caption@font}{default}[]{\caption@add@to@font{#1}{default}{##1}}%
+ \caption@setkeys[caption]{caption@font}{#2}%
+ \endgroup
+ \expandafter\let\csname caption#1\endcsname\caption@fnt}
+% \end{macrocode}
+% \end{macro}
+%
+% These are the pre-defined font code snippets.
+%
+% \changes{v1.1}{2007/05/07}{Color font support added}
+% \begin{macrocode}
+\DeclareCaptionFont{normalcolor}{\normalcolor}
+\DeclareCaptionFont{color}{\color{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionFont{normalfont}{\normalfont}
+\DeclareCaptionFont{up}{\upshape}
+\DeclareCaptionFont{it}{\itshape}
+\DeclareCaptionFont{sl}{\slshape}
+\DeclareCaptionFont{sc}{\scshape}
+\DeclareCaptionFont{md}{\mdseries}
+\DeclareCaptionFont{bf}{\bfseries}
+\DeclareCaptionFont{rm}{\rmfamily}
+\DeclareCaptionFont{sf}{\sffamily}
+\DeclareCaptionFont{tt}{\ttfamily}
+% \end{macrocode}
+%
+% \changes{v1.7}{2018/05/01}{Missing font sizes \texttt{tiny}, \texttt{LARGE}, \texttt{huge}, and \texttt{Huge} added}
+% \begin{macrocode}
+\DeclareCaptionFont{tiny}{\tiny}
+\DeclareCaptionFont{scriptsize}{\scriptsize}
+\DeclareCaptionFont{footnotesize}{\footnotesize}
+\DeclareCaptionFont{small}{\small}
+\DeclareCaptionFont{normalsize}{\normalsize}
+\DeclareCaptionFont{large}{\large}
+\DeclareCaptionFont{Large}{\Large}
+\DeclareCaptionFont{LARGE}{\LARGE}
+\DeclareCaptionFont{huge}{\huge}
+\DeclareCaptionFont{Huge}{\Huge}
+% \end{macrocode}
+%
+% \changes{v1.8}{2018/05/01}{Font sizes \texttt{smaller} and \texttt{larger} added}
+% \begin{macrocode}
+\DeclareCaptionFont{smaller}{\caption@smaller}
+\DeclareCaptionFont{larger}{\caption@larger}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionFont{none}{}
+\DeclareCaptionFont{normal}{%
+ \caption@font@normalcolor\@unused
+ \caption@font@normalfont\@unused
+ \caption@font@normalsize\@unused
+ \caption@font@singlespacing\@unused}
+% \end{macrocode}
+%
+% `default' usually maps to `none'.
+% \begin{macrocode}
+\SetCaptionDefault{font}{none}
+\SetCaptionDefault{labelfont}{none}
+\SetCaptionDefault{textfont}{none}
+% \end{macrocode}
+%
+% The \package{floatrow} package uses the fonts `footfont` and `@tempa` additionally,
+% so we need to map and define the default value for them, too.
+% \begin{macrocode}
+\caption@setmapping{footfont}{font}
+\SetCaptionDefault{footfont}{none}
+\caption@setmapping{@tempa}{font}
+\SetCaptionDefault{@tempa}{none}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@smaller}
+% |\caption@smaller|\\
+% selects a font size which is smaller than the current one.
+% \begin{macrocode}
+\newcommand\caption@smaller{%
+ \ifx\@currsize\tiny
+ \relax
+ \else\ifx\@currsize\scriptsize
+ \tiny
+ \else\ifx\@currsize\footnotesize
+ \scriptsize
+ \else\ifx\@currsize\small
+ \footnotesize
+ \else\ifx\@currsize\normalsize
+ \small
+ \else\ifx\@currsize\large
+ \normalsize
+ \else\ifx\@currsize\Large
+ \large
+ \else\ifx\@currsize\LARGE
+ \Large
+ \else\ifx\@currsize\huge
+ \LARGE
+ \else\ifx\@currsize\Huge
+ \huge
+ \else
+ \caption@Warning{%
+ Cannot determine current font size.\MessageBreak
+ Try setting it with `size=' explicitly}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@larger}
+% |\caption@larger|\\
+% selects a font size which is larger than the current one.
+% \begin{macrocode}
+\newcommand\caption@larger{%
+ \ifx\@currsize\tiny
+ \scriptsize
+ \else\ifx\@currsize\scriptsize
+ \footnotesize
+ \else\ifx\@currsize\footnotesize
+ \small
+ \else\ifx\@currsize\small
+ \normalsize
+ \else\ifx\@currsize\normalsize
+ \large
+ \else\ifx\@currsize\large
+ \Large
+ \else\ifx\@currsize\Large
+ \LARGE
+ \else\ifx\@currsize\LARGE
+ \huge
+ \else\ifx\@currsize\huge
+ \Huge
+ \else\ifx\@currsize\Huge
+ \relax
+ \else
+ \caption@Warning{%
+ Cannot determine current font size.\MessageBreak
+ Try setting it with `size=' explicitly}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@hypersetup}
+% |\caption@hypersetup|\marg{options}\\
+% expands to |\hypersetup|\marg{options} if defined, to nothing otherwise.
+% \begin{macrocode}
+\newcommand*\caption@hypersetup{\caption@ifdefined\hypersetup\hypersetup\@gobble}
+\DeclareCaptionFont{hypersetup}{\caption@hypersetup{#1}} % for usage in \captionsetup{font={hypersetup=...}}
+\DeclareCaptionOption{hypersetup}{\caption@hypersetup{#1}} % for usage in \captionsetup[<env>]{hypersetup=...}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Sizes}
+%
+% \changes{v1.0a}{2004/01/23}{Option \opt{size=} now sets \cs{captionsize} instead of \cs{captionfont}}
+% The old versions \version{1.x} of \thispackage\ offered this
+% command to setup the font size used for captions. We still do
+% so old documents will work fine.
+% \begin{macrocode}
+\DeclareCaptionOption{size}{\caption@setfont{size}{#1}}
+\caption@setmapping{size}{font}
+% \end{macrocode}
+%
+% `default' usually maps to `none'.
+% \begin{macrocode}
+\SetCaptionDefault{size}{none}
+% \end{macrocode}
+%
+% \section{Justifications}
+%
+% \begin{macro}{\DeclareCaptionJustification}
+% \changes{v1.0a}{2004/01/17}{Pass through argument \#2 so extra spaces between arguments do make any harm}
+% \changes{v1.1}{2007/07/03}{Mapped to \cs{DeclareCaptionFont}}
+% \changes{v2.0}{2020/07/26}{Uses \cs{caption@decl} now}
+% |\DeclareCaptionJustification|\oarg{package}\marg{name}\marg{code}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionJustification{%
+% \caption@decl@package{justification}{\caption@decl{justification}}} % Because of floatrow it isn't so easy...
+% \end{macrocode}
+% Unfortunately the (unmaintained) \package{floatrow} uses the old storage scheme
+% of the \package{caption} package and therefore expects the justification code
+% in |\caption@hj@|\meta{name} instead of |\caption@justification@|\meta{name}.
+% For this reason we have to store the code for the \package{floatrow} package
+% additionally, so |\flrow@FBo|\-|Align| will still work fine.
+% \begin{macrocode}
+ \caption@withoptargs\caption@declare@justification}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declare@justification[3]{%
+ \caption@decl@package{justification}{\caption@decl{justification}}#1{#2}{#3}%
+ \expandafter\let\csname caption@hj@#2\expandafter\endcsname\csname caption@justification@#2\endcsname}
+\@onlypreamble\DeclareCaptionJustification
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{justification}{%
+ \caption@load@package{justification}{#1}%
+ \caption@set{justification}{#1}}
+% \end{macrocode}
+%
+% These are the pre-defined justification code snippets.
+% \begin{macrocode}
+\DeclareCaptionJustification{justified}{}
+\DeclareCaptionJustification{centering}{\centering}
+\DeclareCaptionJustification{centerfirst}{\centerfirst}
+\DeclareCaptionJustification{centerlast}{\centerlast}
+\DeclareCaptionJustification{raggedleft}{\raggedleft}
+\DeclareCaptionJustification{raggedright}{\raggedright}
+% \end{macrocode}
+%
+% `default' usually maps to `justified'.
+% \begin{macrocode}
+\SetCaptionDefault{justification}{justified}
+% \end{macrocode}
+%
+% \begin{macro}{\centerfirst}
+% \changes{v1.0j}{2007/01/21}{Bugfix: Usage of \cs{@centercr} added (Thanks to Olga!)}
+% \changes{v1.0j}{2007/01/21}{This macro renamed from \cs{caption@centerfirst} to \cs{centerfirst}}
+% Please blame Frank Mittelbach for the code of |\center|\-|first| |:-)|
+% \begin{macrocode}
+\providecommand\centerfirst{%
+ \let\\\@centercr
+ \edef\caption@normaladjust{%
+ \leftskip\the\leftskip
+ \rightskip\the\rightskip
+ \parfillskip\the\parfillskip\relax}%
+ \leftskip\z@\@plus -1fil%
+ \rightskip\z@\@plus 1fil%
+ \parfillskip\z@skip
+ \noindent\hskip\z@\@plus 2fil%
+ \@setpar{\@@par\@restorepar\caption@normaladjust}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\centerlast}
+% \changes{v1.0j}{2007/01/21}{Bugfix: Usage of \cs{@centercr} added (Thanks to Olga!)}
+% \changes{v1.0j}{2007/01/21}{This macro renamed from \cs{caption@centerlast} to \cs{centerlast}}
+% This one is based on code from Anne Br\"uggemann-Klein\cite{Anne}.
+% \begin{macrocode}
+\providecommand\centerlast{%
+ \let\\\@centercr
+ \leftskip\z@\@plus 1fil%
+ \rightskip\z@\@plus -1fil%
+ \parfillskip\z@\@plus 2fil\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Vertical spaces before and after captions}
+%
+% \begin{macro}{\abovecaptionskip}
+% \begin{macro}{\belowcaptionskip}
+% Usually these skips are defined within the document class, but some
+% document classes don't.
+% \begin{macrocode}
+\caption@ifundefined\abovecaptionskip{%
+ \newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@}}{}
+\caption@ifundefined\belowcaptionskip{%
+ \newlength\belowcaptionskip\setlength\belowcaptionskip{0\p@}}{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \changes{v1.0c}{2005/02/12}{Option \opt{skip=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{aboveskip}{\setlength\abovecaptionskip{#1}}
+\DeclareCaptionOption{belowskip}{\setlength\belowcaptionskip{#1}}
+\DeclareCaptionOption{skip}{\setlength\abovecaptionskip{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@rule}
+% \changes{v1.2b}{2008/05/06}{This macro added}
+% |\caption@rule|\\
+% Draws an invisible rule to adjust the ``skip'' setting.
+% \begin{macrocode}
+\newcommand*\caption@rule{\caption@ifrule\caption@hrule\relax}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@hrule{\hrule\@height\z@}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.2b}{2008/05/06}{Option \opt{rule=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{rule}[1]{\caption@set@bool\caption@ifrule{#1}}
+% \end{macrocode}
+%
+% \section{Positioning}
+%
+% These macros handle the right position of the caption.
+% Note that the position is actually \emph{not} controlled by the
+% \package{caption3} kernel options, but by the user (or a specific package
+% like the \package{float} package) instead.
+% The user can put the |\caption| command wherever he likes! So this stuff
+% is only to give us a \emph{hint} where to put the right skips, the user
+% usually has to take care for himself that this hint actually matches the
+% right position.
+%
+% \begin{macro}{\caption@declare@position}
+% \changes{v2.0}{2020/07/26}{This macro added}
+% |\caption@declare@position|\marg{name}\marg{code}\\
+% declares a captionposition setting of the given \meta{name},
+% \meta{code} must either expand to |\@first|\-|of|\-|two| (top) or
+% |\@second|\-|of|\-|two| (below).
+% \begin{macrocode}
+\newcommand*\caption@declare@position[2]{%
+ \caption@decl{position}{#1}{#2}}
+\@onlypreamble\caption@declare@position
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{position}{\caption@setposition{#1}}
+% \end{macrocode}
+% \changes{v1.0a}{2004/01/09}{Options \opt{figureposition} and \opt{tableposition} added}
+% \begin{macrocode}
+\DeclareCaptionOption{figureposition}{\captionsetup*[figure]{position=#1}}
+\@onlypreamble@key{caption}{figureposition}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{tableposition}{\captionsetup*[table]{position=#1}}
+\@onlypreamble@key{caption}{tableposition}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setposition}
+% \changes{v1.0a}{2004/01/22}{Now the positions \opt{t}, \opt{above}, \opt{b}, \opt{below}, and \opt{a} are allowed, too}
+% \changes{v1.0c}{2004/08/10}{Usage of \cs{caption@defaultpos} added}
+% \changes{v2.0}{2020/07/27}{Uses \cs{caption@set} now}
+% |\caption@setposition|\marg{position}\\
+% puts |\caption@position| to the right value.
+% (Note: Since this command is used by the \package{floatrow} package as well
+% its syntax should not change.)
+% \begin{macrocode}
+\newcommand*\caption@setposition{\caption@set{position}}
+% \end{macrocode}
+% \end{macro}
+%
+% These are the pre-defined position code snippets.
+% \begin{macrocode}
+\caption@declare@position{t}{\@firstoftwo}
+\caption@declare@position{top}{\@firstoftwo}
+\caption@declare@position{above}{\@firstoftwo}
+\caption@declare@position{b}{\@secondoftwo}
+\caption@declare@position{bottom}{\@secondoftwo}
+\caption@declare@position{below}{\@secondoftwo}
+\caption@declare@position{a}{\caption@autoposition}% needed by floatrow package, \flrow@cappos
+\caption@declare@position{auto}{\caption@autoposition}
+% \end{macrocode}
+%
+% \changes{v1.1}{2007/05/08}{Default position changed from `bottom' to `auto'}
+% `default' usually maps to `auto'.
+% \begin{macrocode}
+\SetCaptionDefault{position}{auto}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@autoposition}
+% \changes{v2.0}{2020/07/27}{This macro added}
+% If in doubt, `position=auto' maps to `position=below'.
+% \begin{macrocode}
+\let\caption@autoposition\@secondoftwo
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@iftop}
+% \changes{v1.0a}{2004/01/23}{Split into \cs{caption@iftop} \& \cs{caption@fixposition}}
+% \changes{v1.0c}{2005/02/12}{Adapted to \cs{caption@defaultpos}}
+% \changes{v1.1}{2007/05/08}{Position will be fixed to `bottom' if `auto'}
+% \changes{v2.0}{2020/07/27}{Adapted to current implementation of `auto'}
+% |\caption@iftop|\marg{true-code}\marg{false-code}\\
+% Since version \version{2.0} this command is identical to |\caption@position|.
+% \begin{macrocode}
+\newcommand*\caption@iftop{\caption@position}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@fixposition}
+% \changes{v1.0a}{2004/01/23}{\cs{ifvmode} added}
+% \changes{v1.0b}{2004/05/16}{Split into \cs{caption@fixposition} & \cs{caption@autoposition}}
+% \changes{v2.0}{2020/07/27}{Adapted to current implementation of `auto'}
+% |\caption@fixposition|\\
+% We try to guess the current position of the caption by checking |\prev|\-|depth|.\par
+% A different solution would be setting the |\space|\-|factor| to something
+% not much less than 1000 (for example 994) in |\caption@start| and
+% checking this value here by |\ifnum\space|\-|factor=994|.
+% (It's implemented in the \package{threeparttable} package\cite{threeparttable} this way.)\par
+% Another idea would be checking |\@if|\-|mini|\-|page|, but since some packages
+% typeset the caption within a simple |\vbox| this does not seem to be a good one.
+% \begin{macrocode}
+\newcommand*\caption@fixposition{%
+ \ifvmode
+ \edef\caption@tempa{\the\prevdepth}%
+ \caption@Debug{\protect\prevdepth=\caption@tempa}%
+ \ifdim\prevdepth>-\p@
+ \let\caption@autoposition\@secondoftwo % position=below
+ \else
+ \let\caption@autoposition\@firstoftwo % position=above
+ \fi
+ \else
+ \caption@Debug{no \protect\prevdepth}%
+ \let\caption@autoposition\@secondoftwo % position=below
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setautoposition}
+% \changes{v1.1}{2007/06/10}{This macro added}
+% \changes{v2.0}{2020/07/27}{Adapted to current implementation of `auto'}
+% |\caption@setautoposition|\marg{position}\\
+% replaces the above algorithm by a different one (or a fixed position setting).
+% \begin{macrocode}
+\newcommand*\caption@setautoposition[1]{%
+ \def\caption@fixposition{\caption@@set{position}{autoposition}{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Hooks}
+%
+% \begin{macro}{\AtBeginCaption}
+% \begin{macro}{\AtEndCaption}
+% |\AtBeginCaption|\marg{code}\\
+% |\AtEndCaption|\marg{code}\\
+% These hooks can be used analogous to |\At|\-|Begin|\-|Document| and
+% |\At|\-|End|\-|Document|.
+% \begin{macrocode}
+\newcommand*\caption@beginhook{}
+\newcommand*\caption@endhook{}
+\newcommand*\AtBeginCaption{\l@addto@macro\caption@beginhook}
+\newcommand*\AtEndCaption{\l@addto@macro\caption@endhook}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \section{Lists}
+%
+% \changes{v1.0b}{2004/05/16}{Option \opt{listof=} added}
+% \changes{v1.2}{2007/11/17}{Option \opt{list=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{list}[1]{\caption@setlist{#1}}
+\DeclareCaptionOption{listof}[1]{\caption@setlist{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlist}
+% \changes{v1.2a}{2008/03/20}{This macro added}
+% |\caption@setlist|\marg{boolean value}\\
+% sets the `list' option to either `off' or `on'.
+% \begin{macrocode}
+\newcommand*\caption@setlist{\caption@set@bool\caption@iflist}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@setlist{on}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.4}{2011/08/30}{Option \opt{listtype=} added}
+% \changes{v1.4}{2011/08/30}{Option \opt{listtype+=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{listtype}{\caption@setlisttype{#1}}
+\DeclareCaptionOption{listtype+}{\caption@setlisttype@ext{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setlisttype}
+% \changes{v1.4}{2011/08/30}{This macro added}
+% |\caption@setlisttype|\marg{type}\\
+% sets the `listtype' option to the given \meta{type}.
+% \begin{macrocode}
+\newcommand*\caption@setlisttype{%
+ \caption@setlisttype@ext{}%
+ \caption@@setlisttype\caption@listtype}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setlisttype[2]{%
+ \edef#1{#2}%
+ \ifx#1\@empty \let#1\@undefined \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setlisttype@ext}
+% \changes{v1.4}{2011/08/30}{This macro added}
+% |\caption@setlisttype@ext|\marg{type extension}\\
+% sets the `listtype' option to the given \meta{type extension}.
+% \begin{macrocode}
+\newcommand*\caption@setlisttype@ext{%
+ \caption@@setlisttype\caption@listtype@ext}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionListFormat}
+% \changes{v1.1}{2004/07/15}{This macro added}
+% \changes{v1.2}{2007/11/17}{Renamed from \cs{DeclareCaptionListOfFormat} to \cs{DeclareCaptionListFormat}}
+% \changes{v2.0}{2020/07/26}{Uses \cs{caption@decl} now}
+% |\DeclareCaptionListFormat|\marg{name}\marg{code with \#1 and \#2}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionListFormat[2]{%
+ \caption@decl{listformat}{#1}##1##2{#2}}
+\@onlypreamble\DeclareCaptionListFormat
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.1}{2007/07/15}{Option \opt{listofformat=} added}
+% \changes{v1.2}{2007/11/17}{Option \opt{listofformat=} renamed to \opt{listformat=}}
+% \begin{macrocode}
+\DeclareCaptionOption{listformat}{\caption@set{listformat}{#1}}
+% \end{macrocode}
+%
+% There are seven pre-defined list formats. (The first five were taken from the \package{subfig} package.)
+% \begin{macrocode}
+\DeclareCaptionListFormat{empty}{}
+\DeclareCaptionListFormat{simple}{#1#2}
+\DeclareCaptionListFormat{subsimple}{#2}
+\DeclareCaptionListFormat{parens}{#1(#2)}
+\DeclareCaptionListFormat{subparens}{(#2)}
+\DeclareCaptionListFormat{period}{#1#2.}
+\DeclareCaptionListFormat{subperiod}{#2.}
+% \end{macrocode}
+%
+% `default' usually maps to `subsimple'.
+% \begin{macrocode}
+\SetCaptionDefault{listformat}{subsimple}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@lstfmt}
+% \changes{v2.0}{This macro added}
+% To provide backward compatibility we still offer \cs{caption@lstfmt}.
+% (\cs{caption@lstfmt} is used in the \package{dgruyter} package.)
+% \begin{macrocode}
+\newcommand*\caption@lstfmt{\caption@listformat}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Debug option}
+% \changes{v1.0k}{2007/03/04}{Debug option added}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{debug}[1]{%
+ \caption@set@bool\caption@ifdebug{#1}%
+ \caption@ifdebug
+ {\let\caption@Debug\caption@Info}%
+ {\let\caption@Debug\@gobble}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareOption{debug}{\setkeys{caption}{debug}}
+% \end{macrocode}
+% \begin{macrocode}
+\setkeys{caption}{debug=0}
+% \end{macrocode}
+%
+% \section{Document class support}
+% \changes{v2.0}{2018/05/11}{Document class support re-written}
+%
+% \begin{macro}{\@makecaption@standard}
+% \begin{macrocode}
+% article|report|book.sty [2005/09/16 v1.4f Standard LaTeX document class]
+\newcommand\@makecaption@standard[2]{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1: #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ #1: #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}
+\@onlypreamble\@makecaption@standard
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makecaption@arabic}
+% \begin{macrocode}
+% arabicore.sty [2006/01/01 v1.0 Arabi Core switching commands (may still change)]
+\newcommand\@makecaption@arabic[2]{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1: #2}%
+ \sbox\@Arabitempboxa{\textRL{#2} : #1}%
+ \if@rl{
+ \ifdim \wd\@Arabitempboxa >\hsize
+ \textRL{#2} : #1\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@Arabitempboxa\hfil}%
+ \fi}\else{
+ \ifdim \wd\@tempboxa >\hsize
+ #1: #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi}\fi
+ \vskip\belowcaptionskip}
+\@onlypreamble\@makecaption@arabic
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makecaption@latvian}
+% \begin{macrocode}
+% latvian.ldf [2018/02/19 v2.0b Latvian support from the babel system]
+\newcommand\@makecaption@latvian[2]{%
+ \vskip10\p@
+ \sbox\@tempboxa{#1\if\empty#2\else: #2\fi}%
+ \ifdim\wd\@tempboxa>\hsize
+ #1: #2\par
+ \else
+ \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi}
+\@onlypreamble\@makecaption@latvian
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifdocumentclass}
+% Boolean switch which is set if the document class could be detected
+% successfully, i.e. |\caption@document|\-|class| is set to a proper value.
+% (If |\caption@document|\-|class| is already set, this flag will also be set.)
+% \begin{macrocode}
+\caption@setbool{documentclass}{1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@documentclass}
+% \changes{v1.8e}{2018/05/11}{This macro added}
+% Determine document class used.
+% Set |\caption@document|\-|class| by good-guessing, if not already set.
+% \begin{macrocode}
+\caption@ifundefined\caption@documentclass{%
+% \end{macrocode}
+% \begin{macrocode}
+ \@ifclassloaded{beamer}{%
+ \caption@InfoNoLine{beamer document class detected}%
+ \def\caption@documentclass{beamer}%
+% \end{macrocode}
+% \begin{macrocode}
+ }{\@ifclassloaded{elsarticle}{%
+ \caption@InfoNoLine{elsarticle document class detected}%
+ \def\caption@documentclass{elsarticle}%
+% \end{macrocode}
+% \begin{macrocode}
+ }{\@ifclassloaded{memoir}{%
+ \caption@InfoNoLine{memoir document class detected}%
+ \def\caption@documentclass{memoir}%
+% \end{macrocode}
+% \begin{macrocode}
+ }{\caption@ifdefined\scr@caption{%
+ \caption@InfoNoLine{KOMA-Script document class detected}%
+ \def\caption@documentclass{koma}%
+% \end{macrocode}
+% If |\@captionheadfont| is defined, we assume it's a AMS or SMF document class.
+% \begin{macrocode}
+ }{\caption@ifdefined\@captionheadfont{%
+ \caption@InfoNoLine{AMS or SMF document class detected}%
+ \def\caption@documentclass{ams-smf}%
+% \end{macrocode}
+% If |\CaptionFonts| is defined, we assume it's a NTG Dutch document class.
+% \begin{macrocode}
+ }{\caption@ifdefined\CaptionFonts{%
+ \caption@InfoNoLine{NTG document class detected}%
+ \def\caption@documentclass{ntg}%
+% \end{macrocode}
+% If |\cph@font| and |\cpb@font| are defined, we assume it's the thesis document class.
+% \begin{macrocode}
+ }{\caption@ifdefined\cph@font{%
+ \caption@ifdefined\cpb@font\@firstoftwo\@secondoftwo
+ }{%
+ \@secondoftwo
+ }{%
+ \caption@InfoNoLine{thesis document class detected}%
+ \def\caption@documentclass{thesis}%
+ }{%
+% \end{macrocode}
+% If the definition of |\@make|\-|caption| matches the one from the standard
+% \LaTeX\ document classes |article|, |report|, or |book|, we assume it's
+% either one of them or is compatible to them.
+% \begin{macrocode}
+ \ifx\@makecaption\@undefined
+ \caption@InfoNoLine{Document class w/o caption stuff detected}%
+ \else
+ \ifx\@makecaption\@makecaption@standard
+ \caption@InfoNoLine{Standard document class detected}%
+ \else
+ \ifx\@makecaption\@makecaption@arabic
+ \caption@InfoNoLine{arabic babel option detected}%
+ \else
+ \ifx\@makecaption\@makecaption@latvian
+ \caption@InfoNoLine{latvian babel option detected}%
+ \else
+% \end{macrocode}
+% Otherwise we are clueless and use standard default settings for the captions.
+% (And we unset the |document|\-|class| flag to indicate that the content of
+% |\caption@document|\-|class| is not correct.)
+% \begin{macrocode}
+ \caption@InfoNoLine{%
+ Unknown document class (or package),\MessageBreak
+ standard defaults will be used}%
+ \caption@InfoNoLine{\string\@makecaption\space=\space\meaning\@makecaption\@gobble}%
+ \caption@setbool{documentclass}{0}% unknown document class
+ \fi
+ \fi
+ \fi
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@documentclass\@empty % don't load adaption code later on
+ }}}}}}}%
+}{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtCaptionPackage}
+% \changes{v2.0}{2018/05/14}{This macro added}
+% |\AtCaptionPackage|\marg{code}\\
+% can be used by the document class adaption packages to execute extra code
+% if the \package{caption} package is loaded (later on).
+% This code will by applied right before the package options are evaluated.
+% \begin{macrocode}
+\newcommand*\AtCaptionPackage{%
+ \g@addto@macro\caption@documentclass@code}
+\@onlypreamble\AtCaptionPackage
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\caption@documentclass@code{}
+\@onlypreamble\caption@documentclass@code
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AfterCaptionPackage}
+% \changes{v2.1}{2020/09/12}{This macro added}
+% |\AfterCaptionPackage|\marg{code}\\
+% can be used by the document class adaption packages to execute extra code
+% if the \package{caption} package is loaded (later on).
+% This code will by applied at the very end.
+% \begin{macrocode}
+\newcommand*\AfterCaptionPackage{%
+ \g@addto@macro\caption@endtitles@code}
+\@onlypreamble\AfterCaptionPackage
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\caption@endtitles@code{}
+\@onlypreamble\caption@endtitles@code
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Babel support}
+%
+% \begin{macro}{\caption@IfBabelPackageLoaded}
+% |\caption@IfBabelPackageLoaded|\marg{option}\marg{cmd}\marg{yes-code}\marg{no-code}\\
+% expands the given \meta{yes-code} if |\caption@if|\-|babel@|\meta{option}
+% is set and \meta{cmd} is defined.
+% Otherwise the \meta{no-code} is expanded.\par
+% This way the adaption could be prevented by defining
+% \begin{quote}|\def\caption@ifbabel@|\meta{option}|{false}|\end{quote}
+% \begin{macrocode}
+\newcommand*\caption@IfBabelPackageLoaded[4]{%
+ \caption@ifdefined#2\@firstofone\caption@AtBeginDocument{%
+ \caption@if@bool{\@nameuse{caption@ifbabel@#1}}%
+ {\def\caption@tempa{\caption@ifdefined#2}}%
+ {\let\caption@tempa\@secondoftwo}%
+ \caption@tempa
+ {\caption@InfoNoLine{#1 babel package is loaded}#3}%
+ {#4}}}
+\@onlypreamble\caption@IfBabelPackageLoaded
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{The arabic \& farsi babel option}
+% \changes{v1.8}{2018/05/20}{\package{arabic} babel support added}
+% \changes{v2.0}{2020/08/02}{\package{arabic} babel support updated}
+% \changes{v2.0}{2020/08/02}{\package{farsi} babel support added}
+%
+% \begin{macrocode}
+\DeclareCaptionLabelSeparator{arabi}{\if@rl\space\fi: }
+% \end{macrocode}
+%
+% \begin{macro}{\caption@IfBabelArabi}
+% |\caption@IfBabelArabic|\marg{yes-code}\marg{no-code}
+% \begin{macrocode}
+\newcommand*\caption@IfBabelArabi{%
+ \caption@IfBabelPackageLoaded{arabi}{\ArabiCoreLoaded}}
+\@onlypreamble\caption@IfBabelArabi
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\caption@ifbabel@arabi{true}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@IfBabelArabi{%
+% \end{macrocode}
+%
+% \begin{macro}{\caption@rl}
+% \changes{v1.8}{2018/05/20}{This macro added}
+% \begin{macrocode}
+ \newcommand\caption@rl[1]{\if@rl\textRL{#1}\else\textLR{#1}\fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% If the language `arabic' or `farsi' is selected, we switch the default label separator to `arabi'.
+%
+% \begin{macrocode}
+ \caption@ifdefined\extrasarabic{%
+ \addto\extrasarabic{%
+ \caption@switchdefault{labelseparator}{\babel@save #1}{arabi}}}{}%
+ \caption@ifdefined\extrasfarsi{%
+ \addto\extrasfarsi{%
+ \caption@switchdefault{labelseparator}{\babel@save #1}{arabi}}}{}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+}{%
+ \let\caption@rl\@firstofone
+}
+% \end{macrocode}
+%
+% \subsection{The babel-french package}
+% \changes{v1.1}{2006/05/14}{\package{frenchb} babel support added}
+% \changes{v2.0}{2020/08/01}{\package{french} babel support updated}
+%
+% We provide a `french' caption label separator.
+% |\caption@french@label|\-|separator| will be defined later on,
+% dependent on the `french' package used later on.
+%
+% \begin{macrocode}
+\DeclareCaptionLabelSeparator{french}{\caption@french@labelseparator}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@IfBabelFrench}
+% |\caption@IfBabelFrench|\marg{yes-code}\marg{no-code}
+% \begin{macrocode}
+\newcommand*\caption@IfBabelFrench{%
+ \caption@IfBabelPackageLoaded{french}{\FB@makecaption}}
+\@onlypreamble\caption@IfBabelFrench
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\caption@ifbabel@french{true}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@IfBabelFrench{%
+% \end{macrocode}
+%
+% The \package{babel-french} package uses |\Caption|\-|Separator| as label separator.
+%
+% \begin{macrocode}
+ \providecommand\caption@french@labelseparator{\CaptionSeparator}%
+% \end{macrocode}
+%
+% Add a space before the label separator `colon' in French
+% in order to avoid problems when |Auto|\-|Space|\-|Punctuation| is set to |false|.
+%
+% \begin{macrocode}
+ \ifFB@active@punct
+ \DeclareCaptionLabelSeparator{colon}{%
+ \ifFBfrench\penalty\@M\FBcolonspace\fi : }%
+ \fi
+% \end{macrocode}
+%
+% We switch the default label separator to `french', dependant on the switches
+% |Customise|\-|Fig|\-|Tab|\-|Captions| and |Old|\-|Fig|\-|Tab|\-|Captions|.
+%
+% \begin{macrocode}
+ \ifFBOldFigTabCaptions
+ \caption@ifdefined\extrasfrench{%
+ \addto\extrasfrench{%
+ \caption@switchdefault{labelseparator}{\babel@save #1}{french}}}{}%
+ \caption@ifdefined\extrasacadian{%
+ \addto\extrasacadian{%
+ \caption@switchdefault{labelseparator}{\babel@save #1}{french}}}{}%
+ \else
+ \ifFBCustomiseFigTabCaptions
+ \caption@AtBeginDocument{%
+ \ifFB@mainlanguage@FR
+ \SetCaptionDefault{labelseparator}{french}%
+ \fi}%
+ \fi
+ \fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The frenchle \& frenchpro package}
+% \changes{v1.1}{2006/05/14}{\package{frenchle/pro} package support added}
+% \changes{v2.0}{2020/08/01}{\package{frenchle/pro} package support updated}
+%
+% \begin{macro}{\caption@IfFrenchLe}
+% |\caption@IfFrenchLe|\marg{yes-code}\marg{no-code}
+% \begin{macrocode}
+\newcommand*\caption@IfFrenchLe{%
+ \caption@IfBabelPackageLoaded{frenchle}{\frenchTeXmods}}
+\@onlypreamble\caption@IfBabelFrenchLe
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\caption@ifbabel@frenchle{true}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@IfFrenchLe{%
+% \end{macrocode}
+%
+% The \package{frenchle} package uses |\caption|\-|separator| plus |\space| as label separator.
+%
+% \begin{macrocode}
+ \providecommand\caption@french@labelseparator{\captionseparator\space}%
+% \end{macrocode}
+%
+% If the language `french' is selected, we switch the default label separator to `french',
+% and switch the default font to `it' and the default label font to `up'.
+%
+% \begin{macrocode}
+ \g@addto@macro\extrasfrench{%
+ \caption@switchdefault{labelseparator}{\let\caption@original@labelseparator#1}{french}%
+ \caption@switchdefault{font}{\let\caption@original@font#1}{it}%
+ \caption@switchdefault{labelfont}{\let\caption@original@labelfont#1}{up}}%
+ \g@addto@macro\extrasenglish{%
+ \caption@restoredefault{labelseparator}{\caption@original@labelseparator}%
+ \caption@restoredefault{font}{\caption@original@font}%
+ \caption@restoredefault{labelfont}{\caption@original@labelfont}}%
+% \end{macrocode}
+%
+% Since the \package{frenchle} package overwrites |\caption|\-|font| and |\caption|\-|label|\-|font|
+% (within |\GOfrench|) we need to save them beforehand and restore them afterwards.
+%
+% \begin{macrocode}
+ \caption@AtBeginDocument{%
+ \let\captionfont@original\captionfont
+ \let\captionlabelfont@original\captionlabelfont}%
+ \g@addto@macro\GOfrench{%
+ \let\captionfont\captionfont@original
+ \let\captionlabelfont\captionlabelfont@original}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The babel-hungarian package}
+% \changes{v1.3}{2009/03/29}{\package{magyar} babel support added}
+% \changes{v1.3a}{2011/08/12}{\package{magyar} babel support revised}
+% \changes{v1.8b}{2018/08/26}{\package{magyar} babel support revised}
+% \changes{v2.0}{2020/08/03}{\package{magyar} babel support updated}
+%
+% \begin{macrocode}
+\DeclareCaptionLabelFormat{magyar}{#2\bothIfSecond{.~}{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@IfBabelHungarian}
+% |\caption@IfBabelHungarian|\marg{yes-code}\marg{no-code}
+% \begin{macrocode}
+\newcommand*\caption@IfBabelHungarian{%
+ \caption@IfBabelPackageLoaded{hungarian}{\magyar@opt@defaults}}
+\@onlypreamble\caption@IfBabelHungarian
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\caption@ifbabel@hungarian{true}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@IfBabelHungarian{%
+% \end{macrocode}
+%
+% If the language `hungarian' or `magyar' is selected,
+% we switch the default label format to `magyar', the default separator to `period',
+% and the default list format to `subperiod'.
+%
+% \begin{macrocode}
+ \caption@ifdefined\extrashungarian{%
+ \addto\extrashungarian{%
+ \caption@switchdefault{labelformat}{\babel@save #1}{magyar}%
+ \caption@switchdefault{labelseparator}{\babel@save #1}{period}%
+ \caption@switchdefault{listformat}{\babel@save #1}{subperiod}}}{}%
+ \caption@ifdefined\extrasmagyar{%
+ \addto\extrasmagyar{%
+ \caption@switchdefault{labelformat}{\babel@save #1}{magyar}%
+ \caption@switchdefault{labelseparator}{\babel@save #1}{period}%
+ \caption@switchdefault{listformat}{\babel@save #1}{subperiod}}}{}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \subsection{The latvian babel option}
+%
+% \begin{macrocode}
+\DeclareCaptionLabelFormat{latvian}{#2\bothIfSecond{~}{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@IfBabelLatvian}
+% |\caption@IfBabelLatvian|\marg{yes-code}\marg{no-code}
+% \begin{macrocode}
+\newcommand*\caption@IfBabelLatvian{%
+ \caption@IfBabelPackageLoaded{latvian}{\bbl@latvianindent}}
+\@onlypreamble\caption@IfBabelLatvian
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\caption@ifbabel@latvian{true}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@IfBabelLatvian{%
+% \end{macrocode}
+%
+% If the language `latvian' is selected, we switch the default label format to `latvian'.
+%
+% \begin{macrocode}
+ \caption@ifdefined\extraslatvian{%
+ \addto\extraslatvian{%
+ \caption@switchdefault{labelformat}{\babel@save #1}{latvian}}}{}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% \section{Package support}
+%
+% \begin{macro}{\caption@ifpackageloaded}
+% \changes{v2.0}{2020/07/26}{This macro added}
+% |\caption@ifpackageloaded|\marg{package}\marg{yes-code}\marg{no-code}\\
+% expands the given code if the given package is (not) loaded.
+% (Note: We cannot use |\@if|\-|package|\-|loaded| here since it's not
+% available after |\At|\-|Begin|\-|Document|.)
+% \begin{macrocode}
+\newcommand*\caption@ifpackageloaded[1]{%
+ \expandafter\ifx\csname ver@#1.\caption@pkgextension\endcsname\relax
+ \expandafter\@secondoftwo
+ \else
+ \expandafter\@firstoftwo
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@pkgextension\@pkgextension
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@pkg@list}
+% \changes{v1.4b}{2012/01/12}{This macro added}
+% We used this in the past as list of packages loaded
+% |\At|\-|Begin|\-|Document|.
+% (Note: Old |.aux| files could contain
+% |\@cons|\-|\caption@pkg@list|\-|{{|\meta{package}|}}|,
+% so this macro should always be defined, even if we don't use it anymore.)
+% \begin{macrocode}
+\newcommand*\caption@pkg@list{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@requirepackage}
+% \changes{v1.10}{2020/05/10}{This macro added}
+% \changes{v2.0}{2020/07/27}{This macro revised}
+% |\caption@requirepackage|\marg{package}\marg{option}\marg{value}\\
+% indicates that the given package option needs a package.
+% \begin{macrocode}
+\newcommand*\caption@requirepackage[2]{%
+ \caption@ifpackageloaded{#1}{}{\caption@@requirepackage{#1}{#2}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@requirepackage[2]{%
+ \@cons\caption@packagelist{{#1}{#2}}} % load package later on
+% \end{macrocode}
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \renewcommand*\caption@@requirepackage[2]{%
+ \caption@Error{Option `#2' requires the `#1' package}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@packagelist}
+% \changes{v1.11}{2020/05/10}{This macro added}
+% We use this as list of packages loaded |\At|\-|Begin|\-|Document|.
+% \begin{macrocode}
+\newcommand*\caption@packagelist{}
+\@onlypreamble\caption@packagelist
+% \end{macrocode}
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \def\caption@tempa{\endgroup}%
+ \begingroup
+ \def\@elt#1#2{%
+ \g@addto@macro\caption@tempa{%
+ \caption@loadpackage{#1}{#2}}}%
+ \caption@packagelist
+ \caption@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@loadpackage}
+% \changes{v1.11}{2020/05/10}{This macro added}
+% \changes{v2.0}{2020/07/26}{This macro revised}
+% |\caption@loadpackage|\marg{package}\marg{option}\marg{value}\\
+% loads the given package immediately.
+% \begin{macrocode}
+\newcommand*\caption@loadpackage[2]{%
+ \caption@ifpackageloaded{#1}{}{\caption@@loadpackage{#1}{#2}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@loadpackage[2]{%
+ \caption@Info{Option `#2' requires the `#1' package}%
+ \RequirePackage{#1}\relax}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \let\caption@@loadpackage\caption@@requirepackage}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{The newfloat package}
+%
+% \begin{macro}{\caption@newfloat}
+% \changes{v1.4b}{2012/01/12}{This macro added}
+% \changes{v1.8h}{2020/01/03}{Usage of \cs{caption@ifpackageloaded} replaced by \cs{RequirePackage}}
+% \changes{v1.11}{2020/05/10}{Usage of \cs{RequirePackage} replaced by \cs{caption@usepackage}}
+% \changes{v2.0}{2020/07/27}{This macro revised}
+% |\caption@newfloat|\marg{option}\marg{value}\marg{code}\\
+% loads the \package{newfloat} package and executes the given code afterwards.
+% (Note: Since the package might use the crappy \package{keyval}
+% package, too, we need to save \& restore some macros here, otherwise this
+% recursion won't work properly.)
+% \begin{macrocode}
+\newcommand*\caption@newfloat[2]{%
+ \IfCaptionOptionCheck
+ {\caption@requirepackage{newfloat}{#1}}%
+ {\let\KV@prefix@ORI\KV@prefix
+ \let\@tempc@ORI\@tempc
+ \caption@loadpackage{newfloat}{#1}%
+ #2%
+ \let\@tempc\@tempc@ORI
+ \let\KV@prefix\KV@prefix@ORI}}
+% \end{macro}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.0c}{2004/08/03}{Options \opt{figurename} and \opt{tablename} added}
+% \changes{v1.1}{2007/07/04}{Options \opt{figurename} and \opt{tablename} re-written}
+% \changes{v1.2}{2007/11/18}{Option \opt{name} added}
+% \begin{macrocode}
+\DeclareCaptionOption{figurename}{\caption@SetName{figure}{#1}}
+\@onlypreamble@key{caption}{figurename}
+\DeclareCaptionOption{tablename}{\caption@SetName{table}{#1}}
+\@onlypreamble@key{caption}{tablename}
+% \end{macrocode}
+%
+% \changes{v1.2a}{2008/02/28}{Options \opt{listfigurename} and \opt{listtablename} added}
+% \begin{macrocode}
+\DeclareCaptionOption{listfigurename}{\caption@SetName{listfigure}{#1}}
+\@onlypreamble@key{caption}{listfigurename}
+\DeclareCaptionOption{listtablename}{\caption@SetName{listtable}{#1}}
+\@onlypreamble@key{caption}{listtablename}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@SetName}
+% \changes{v1.1}{2007/07/04}{This macro added}
+% \changes{v1.2}{2007/11/18}{After-preamble variant added}
+% \changes{v1.2a}{2008/02/28}{Renamed from \cs{caption@SetFloatName} to \cs{caption@SetName}}
+% \changes{v1.2b}{2008/08/02}{Bugfix: Works now without \cs{addto}, too}
+% \changes{v1.4a}{2011/10/29}{Outsourced to \package{newfloat} package}
+% \changes{v1.4b}{2012/01/12}{Bugfix: Uses \cs{caption@newfloat} now}
+% |\caption@SetName|\marg{float}\marg{name}\\
+% loads the \package{newfloat} package and uses |\newfloat@set|\-|name|.
+% \begin{macrocode}
+\newcommand*\caption@SetName[2]{%
+ \caption@newfloat{#1name}{\newfloat@setname{#1}{#2}}}
+\@onlypreamble\caption@SetName
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{name}{%
+ \IfCaptionOptionCheck{}{\caption@setname\@captype{#1}}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setname}
+% |\caption@setname|\marg{float}\marg{name}\\
+% sets the given float name, e.g.: `Figure` for `figure`.
+% \begin{macrocode}
+\newcommand*\caption@setname[2]{%
+ \@namedef{#1name}{#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.2}{2007/12/21}{Options \opt{figurewithin} and \opt{tablewithin} added}
+% \changes{v1.2e}{2010/01/09}{The \opt{within} options are now available within the document, too}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{figurewithin}{\caption@within{figure}{#1}}
+\DeclareCaptionOptionNoValue{figurewithout}{\caption@within{figure}{none}}
+\DeclareCaptionOption{tablewithin}{\caption@within{table}{#1}}
+\DeclareCaptionOptionNoValue{tablewithout}{\caption@within{table}{none}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@within}
+% \changes{v1.2}{2007/12/21}{This macro added}
+% \changes{v1.4a}{2011/10/29}{Outsourced to \package{newfloat} package}
+% \changes{v1.4b}{2012/01/12}{Bugfix: Uses \cs{caption@newfloat} now}
+% |\caption@within|\marg{float}\marg{value}\\
+% loads the \package{newfloat} package and uses |\newfloat@set|\-|within|.
+% \begin{macrocode}
+\newcommand*\caption@within[2]{%
+ \caption@newfloat{#1within=#2}{\newfloat@setwithin{#1}{#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.2b}{2008/04/13}{Option \opt{within} added}
+% \changes{v1.2e}{2010/01/09}{The global \opt{within} option will now affect user-defined floats declared with \cs{DeclareCaptionType}, too}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{within}{%
+ \caption@newfloat{within=#1}{\newfloatsetup{within=#1}}}
+\DeclareCaptionOptionNoValue{without}{%
+ \caption@newfloat{without}{\newfloatsetup{without}}}
+% \end{macrocode}
+%
+% \subsection{The ragged2e package}
+% \changes{v1.0b}{2004/05/16}{Improved \package{ragged2e} package support}
+% \changes{v1.8h}{2020/01/03}{Revised \package{ragged2e} package support}
+% \changes{v1.9}{2020/05/05}{Enhanced \package{ragged2e} package support}
+% \changes{v1.10}{2020/05/10}{Revised \package{ragged2e} package support}
+%
+% We support the upper-case commands offered by the \package{ragged2e}
+% package.
+% \begin{macrocode}
+\DeclareCaptionJustification[ragged2e]{Justified}{\justifying}
+\DeclareCaptionJustification[ragged2e]{Centering}{\Centering}
+\DeclareCaptionJustification[ragged2e]{RaggedLeft}{\RaggedLeft}
+\DeclareCaptionJustification[ragged2e]{RaggedRight}{\RaggedRight}
+% \end{macrocode}
+%
+% \subsection{The sansmath package}
+% \changes{v1.3}{2011/01/01}{\package{sansmath} package support added}
+% \changes{v1.10}{2020/05/10}{\package{sansmath} package support revised}
+%
+% \begin{macrocode}
+\DeclareCaptionFont[sansmath]{sansmath}{\sansmath}
+% \end{macrocode}
+%
+% \subsection{The setspace package}
+% \changes{v1.0n}{2007/04/02}{\package{setspace} package support added}
+% \changes{v1.2d}{2009/10/09}{\package{setspace} package support revised}
+%
+% \begin{macrocode}
+\DeclareCaptionFont{singlespacing}{%
+ \caption@ifdefined\setspace@singlespace{%
+ \setstretch\setspace@singlespace}{}}% normally 1
+\DeclareCaptionFont[setspace]{onehalfspacing}{\onehalfspacing}
+\DeclareCaptionFont[setspace]{doublespacing}{\doublespacing}
+\DeclareCaptionFont[setspace]{stretch}{\setstretch{#1}}
+% \end{macrocode}
+%
+% \subsection{The subfig package}
+% \changes{v1.1}{2007/07/07}{Adaptions to the \package{subfig} package added}
+% \changes{v1.4a}{2011/11/01}{Test for the \package{subfig} package revised}
+% \changes{v2.0a}{2020/09/07}{Re-definition of \cs{sf@ifpositiontop} added}
+%
+% Since the \package{subfig} package is not maintained anymore,
+% we have to make adaptions to \thispackage~\version{1.1} here.
+% Please note that we only support the version $1.3$ of the \package{subfig} package,
+% so older versions do not work with this version of \thispackage, and newer
+% versions are expected to be adapted.
+%
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \def\@tempa{2005/06/28 ver: 1.3 subfig package}%
+ \expandafter\ifx\csname ver@subfig.sty\endcsname\@tempa
+ \caption@InfoNoLine{subfig package v1.3 is loaded}%
+% \end{macrocode}
+% \begin{macrocode}
+ \def\caption@eh{\caption@@eh{subfig}}%
+ \let\caption@setfloattype\@gobble
+ \let\@dottedxxxline\sf@NEW@dottedxxxline
+ \let\sf@subfloat\sf@NEW@subfloat
+ \let\sf@ifpositiontop\caption@iftop
+% \end{macrocode}
+% \begin{macrocode}
+ \fi
+ \let\sf@NEW@dottedxxxline\@undefined
+ \let\sf@NEW@subfloat\@undefined}
+% \end{macrocode}
+%
+% \begin{macro}{\@dottedxxxline}
+% New version of |\@dottedxxxline|
+% \begin{macrocode}
+\def\sf@NEW@dottedxxxline#1#2#3#4#5#6#7{%
+ \begingroup
+ \caption@setfloattype{#1}%
+ \caption@setoptions{subfloat}%
+ \caption@setoptions{sub#1}%
+ \ifnum #3>\@nameuse{c@#2depth}\else
+ \@dottedtocline{\z@}{#4}{#5}{#6}{#7}%
+ \fi
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\sf@subfloat}
+% \changes{v1.4b}{2011/12/29}{Bugfix 11-12-23: Usage of \cs{caption@warmup} added}
+% New version of |\sf@subfloat|
+% \begin{macrocode}
+\def\sf@NEW@subfloat{%
+ \begingroup
+ \@nameuse{caption@warmup}%
+ \caption@setfloattype\@captype
+ \sf@ifpositiontop{%
+ \maincaptiontoptrue
+ }{%
+ \maincaptiontopfalse
+ }%
+ \caption@setoptions{subfloat}%
+ \caption@setoptions{sub\@captype}%
+ \let\sf@oldlabel=\label
+ \let\label=\subfloat@label
+ \ifmaincaptiontop\else
+ \advance\@nameuse{c@\@captype}\@ne\relax
+ \fi
+ \refstepcounter{sub\@captype}%
+ \setcounter{sub\@captype @save}{\value{sub\@captype}}%
+ \@ifnextchar [% %] match left bracket
+ {\sf@@subfloat}%
+ {\sf@@subfloat[\@empty]}}
+% \end{macrocode}
+% \end{macro}
+%
+% Make the \package{subfig} package documentation compile.
+% \begin{macrocode}
+\DeclareCaptionOption{lofdepth}[2]{\caption@ifdefined\c@lofdepth{\setcounter{lofdepth}{#1}}{}}
+\DeclareCaptionOption{lotdepth}[2]{\caption@ifdefined\c@lotdepth{\setcounter{lotdepth}{#1}}{}}
+% \end{macrocode}
+%
+% \section{Making an `List of' entry}
+%
+% \begin{macro}{\caption@addcontentsline}
+% \changes{v1.1}{2007/07/01}{This macro added}
+% \changes{v1.3}{2010/10/26}{Error check added}
+% \changes{v1.3}{2011/06/24}{Split into two macros}
+% \changes{v1.4}{2011/08/19}{Split into three macros}
+% \changes{v1.4}{2011/08/30}{Support for option \opt{listtype=} added}
+% \changes{v1.5}{2012/01/15}{Usage of \cs{caption@addsubcontentslines} added}
+% \changes{v1.7}{2015/09/15}{Argument \#3 which holds the environment name added to \cs{caption@lstfmt}}
+% \changes{v1.7}{2015/09/20}{Unfortunately \package{subfig} defines and uses \cs{caption@lstfmt} as well, so I replaced the third argument with \cs{captionlisttype}}
+% \changes{v1.8}{2018/09/06}{Adapted to the \package{chkfloat} package}
+% |\caption@addcontentsline|\marg{type}\marg{list entry}\\
+% makes an entry in the list-of-whatever, if requested, i.e.~the argument
+% \meta{list entry} is not empty and |list|\-|of=| was set to |true|.
+% \begin{macrocode}
+\newcommand\caption@addcontentsline[2]{%
+ \caption@ifcontentsline{#2}{%
+ \begingroup
+ \let\@tempa\@gobble
+ \caption@ifdefined\caption@listtype
+ {\let\@tempa\@firstofone}%
+ {\edef\caption@listtype{#1}}%
+ \caption@ifdefined\caption@listtype@ext
+ {\edef\caption@listtype{\caption@listtype\caption@listtype@ext}%
+ \let\@tempa\@firstofone}%
+ {}%
+ \@tempa
+ {\caption@Debug{addcontentsline: #1 => \caption@listtype}%
+% \caption@setoptions\caption@listtype
+ \@namedef{the\caption@listtype}{\@nameuse{the#1}}}%
+ \expandafter\caption@@addcontentsline\expandafter{\caption@listtype}{#2}%
+ \endgroup}%
+ \caption@addsubcontentslines{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@@addcontentsline[2]{%
+ {\let\\\space
+ \@ifundefined{ext@#1}%
+ {\caption@Error{No float type '#1' defined}}%
+ {\def\captionlisttype{#1}%
+ \caption@add@contentsline
+ {\csname ext@#1\endcsname}%
+ {#1}%
+ {\caption@listformat{\@nameuse{p@#1}}{\@nameuse{the#1}}}%
+ {\ignorespaces #2}%
+ \caption@chkfloat{#1}{#2}}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@add@contentsline{%
+ \caption@@@addcontentsline}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@addcontentsline[4]{%
+% \caption@ifdefined\main@Arabi@language
+% {\addtocontents{#1}{\xstring\select@language{\main@Arabi@language}}}{}%
+ \addcontentsline{#1}{#2}{\protect\numberline{#3}{#4}}}
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@chkfloat\@gobbletwo
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@ifcontentsline[1]{%
+ \caption@iflist
+ {\def\@tempa{#1}}%
+ {\let\@tempa\@empty}%
+ \ifx\@tempa\@empty
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@addsubcontentslines[1]{}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Typesetting the caption}
+%
+% \begin{macro}{\ifcaption@star}
+% If the starred form of |\caption| is used, this will be set to |true|.
+% (It will be reset to |false| at the end of |\caption@@make|.)
+% \begin{macrocode}
+\newif\ifcaption@star
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@aboveskip}
+% \begin{macro}{\caption@belowskip}
+% \changes{v2.0}{2020/08/23}{This macro moved from package to kernel}
+% |\caption@aboveskip| and |\caption@belowskip|\\
+% typeset the skip above resp.~below the caption.
+% \begin{macrocode}
+\newcommand*\caption@aboveskip{%
+ \vskip\abovecaptionskip}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@belowskip{%
+ \vskip\belowcaptionskip}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@fnum}
+% \changes{v1.1}{2007/08/21}{This macro added}
+% \changes{v2.0}{2020/08/03}{The original definition will be stored in \cs{caption@original@fnum}}
+% |\caption@fnum|\marg{float type}\\
+% typesets the caption label; this acts as replacement for |\fnum@|\meta{float type}.
+% \begin{macrocode}
+\newcommand*\caption@fnum[1]{%
+ \expandafter\let\expandafter\caption@original@fnum\csname caption@fnum@#1\endcsname % for label format `original'
+ \caption@labelformat{\@nameuse{#1name}}{\@nameuse{the#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@make}
+% |\caption@make|\marg{float name}\marg{ref.\ number}\marg{text}\\
+% typesets the caption.
+% \begin{macrocode}
+\newcommand\caption@make[2]{\caption@@make{\caption@labelformat{#1}{#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@make}
+% \changes{v1.0b}{2004/05/16}{Bugfix 04-05-05: \cs{ifdim}\cs{captionindent=}\cs{z@} added}
+% \changes{v1.0c}{2005/02/12}{Bugfix 04-10-26: Use \cs{@tempdima} instead of \cs{captionmargin} resp. \cs{captionwidth}; check for \cs{z@} added}
+% \changes{v1.0c}{2005/02/12}{Bugfix: \cs{hskip}\cs{captionmargin} to the end of caption added}
+% \changes{v1.0c}{2005/02/12}{Bugfix: \cs{strut} moved from here to \cs{caption@@@make}}
+% \changes{v1.0c}{2005/02/12}{Single-line-check moved up so it can affect margins now}
+% \changes{v1.0c}{2005/02/09}{Improvement: \cs{caption@ifhmode} added}
+% \changes{v1.0c}{2005/02/09}{Bugfix: \cs{leavevmode} added}
+% \changes{v1.0f}{2005/08/24}{Uses \cs{sbox} instead of \cs{setbox} in single-line-check}
+% \changes{v1.0g}{2005/12/04}{Uses \cs{caption@slc} now}
+% \changes{v1.0g}{2006/01/11}{Bugfix: \cs{caption@calcmargin} inside single-line-check replaced by \cs{relax}}
+% \changes{v1.0g}{2006/01/11}{Bugfix: \cs{caption@startbox} will always be typeset in horizontal mode}
+% \changes{v1.0i}{2006/05/13}{Uses \cs{caption@parbox} instead of \cs{caption@start/endbox}}
+% \changes{v1.0j}{2007/01/04}{Oops, bugfix 04-05-05 got lost in v1.0h, re-added}
+% \changes{v1.0n}{2007/04/03}{Usage of \cs{caption@ifoddpage} added}
+% \changes{v1.1}{2007/07/29}{\cs{caption@calcmargin} moved below single-line-check}
+% \changes{v1.1e}{2007/10/28}{\cs{caption@stepcounter} added}
+% \changes{v1.5}{2012/03/15}{Uses \cs{caption@tempdima} instead of \cs{@tempdima}}
+% \changes{v1.5}{2012/12/26}{max-margin stuff moved to \cs{caption@calcmargin}}
+% \changes{v1.6}{2013/05/01}{Usage of \cs{caption@box} added}
+% \changes{v1.7}{2016/01/31}{Adapted to the \package{bicaption} package}
+% \changes{v1.8f}{2019/12/18}{Usage of \cs{linewidth} replaced by \cs{hsize}}
+% |\caption@@make|\marg{caption label}\marg{caption text}
+% \begin{macrocode}
+\newcommand\caption@@make[2]{%
+ \begingroup
+ \caption@@make@{#1}{#2}%
+ \endgroup
+ \caption@@make@epilogue}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@@make@[2]{%
+ \caption@stepthecounter
+ \caption@beginhook
+% \end{macrocode}
+% Typeset the outer box |\caption@box|
+% \begin{macrocode}
+ \caption@box\hsize{%
+% \end{macrocode}
+% Special single-line treatment (option |singlelinecheck=|)
+% \begin{macrocode}
+ \caption@singlelinecheck{\caption@slc{#1}{#2}\caption@singleline\caption@multiline}{\caption@multiline}%
+% \end{macrocode}
+% Typeset the left margin (option |margin=|)
+% \begin{macrocode}
+ \caption@calcmargin
+ \caption@tempdima\captionmargin
+ \ifdim\captionmargin@=\z@ \else
+ \caption@ifoddpage{}{\advance\caption@tempdima\captionmargin@\relax}%
+ \fi
+ \caption@ifhmode{\advance\caption@tempdima\caption@indent\relax}%
+ \hspace\caption@tempdima
+% \end{macrocode}
+% We actually use a |\vbox| of width |\captionwidth - \caption@indent|
+% to typeset the caption.
+% \Note{\cs{captionindent} is \emph{not} supported if the caption format
+% was defined with \cs{DeclareCaptionFormat*}.}
+% \begin{macrocode}
+ \caption@tempdima\captionwidth
+ \caption@ifhmode{\advance\caption@tempdima-\caption@indent\relax}%
+ \caption@parbox\caption@tempdima{%
+% \end{macrocode}
+% Typeset the indention (option |indention=|)\\
+% {\small Bugfix 04-05-05:
+% |\hskip-\caption@indent| replaced by |\ifdim\caption@indent=\z@|\ldots}
+% \begin{macrocode}
+ \caption@ifhmode{%
+ \ifdim\caption@indent=\z@
+ \leavevmode
+ \else
+ \hskip-\caption@indent
+ \fi}%
+% \end{macrocode}
+% Typeset the caption itself and close the |\caption@parbox|
+% \begin{macrocode}
+ \caption@@@make{#1}{#2}}%
+% \end{macrocode}
+% Typeset the right margin (option |margin=|)
+% \begin{macrocode}
+ \caption@tempdima\captionmargin
+ \ifdim\captionmargin@=\z@ \else
+ \caption@ifoddpage{\advance\caption@tempdima\captionmargin@\relax}{}%
+ \fi
+ \hspace\caption@tempdima
+% \end{macrocode}
+% Close the outer box |\caption@box|
+% \begin{macrocode}
+ }%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@endhook}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@@make@epilogue{%
+ \global\caption@starfalse}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@calcmargin}
+% \changes{v1.0f}{2005/10/24}{Internal: \cs{ifcaption@width} replaced by \cs{ifdim}\cs{captionwidth=}\cs{z@}}
+% \changes{v1.0g}{2006/01/12}{Improvement: Takes care of list environment now}
+% \changes{v1.1}{2006/05/13}{Check of \cs{@listdepth} removed (not necessary anymore), use \cs{linewidth} instead of \cs{hsize}}
+% \changes{v1.5}{2012/12/26}{max-margin stuff moved from \cs{caption@@make} to here}
+% \changes{v1.8f}{2019/12/18}{Usage of \cs{linewidth} replaced by \cs{hsize}}
+% |\caption@calcmargin|\\
+% calculates |\caption|\-|margin| and |\caption|\-|width|, so both contain
+% valid values.
+% \begin{macrocode}
+\newcommand*\caption@calcmargin{%
+ \caption@calcmargin@hook
+% \end{macrocode}
+% Check margin, if |\caption@min|\-|margin| or |\caption@max|\-|margin| is set
+% \begin{macrocode}
+ \ifx\caption@maxmargin\@undefined \else
+ \ifdim\captionmargin>\caption@maxmargin\relax
+ \captionmargin\caption@maxmargin\relax
+ \fi
+ \fi
+ \ifx\caption@minmargin\@undefined \else
+ \ifdim\captionmargin<\caption@minmargin\relax
+ \captionmargin\caption@minmargin\relax
+ \fi
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \ifdim\captionwidth=\z@
+ \captionwidth\hsize\relax
+ \advance\captionwidth by -2\captionmargin\relax
+ \advance\captionwidth by -\captionmargin@\relax
+ \else
+ \captionmargin\hsize\relax
+ \advance\captionmargin by -\captionwidth\relax
+ \divide\captionmargin by 2\relax
+ \captionmargin@\z@\relax
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@Debug{%
+ \string\hsize=\the\hsize,
+ \string\captionwidth=\the\captionwidth,\MessageBreak
+ \string\captionmargin=\the\captionmargin,
+ \string\captionmargin@=\the\captionmargin@}%
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@slc}
+% \changes{v1.1}{2007/06/13}{\cs{let}\cs{caption@justification}\cs{relax} added}
+% \changes{v1.1}{2007/07/29}{\cs{caption@setup}\cs{caption@sls} added after \cs{begingroup}}
+% \changes{v1.1}{2007/07/29}{\cs{caption@calcmargin} added}
+% \changes{v1.1c}{2007/10/14}{\cs{caption@setup}\cs{caption@opt@SingleLine} outsourced to \cs{caption@SingleLine}}
+% \changes{v1.3}{2010/09/04}{Split into \cs{caption@slc} and \cs{caption@@slc}}
+% \changes{v1.5}{2012/12/26}{Merged into a single macro again}
+% \changes{v1.5}{2013/04/14}{Usage of \cs{ifsinglelinecaption} added}
+% |\caption@slc|\marg{label}\marg{text}\marg{single-line-code}\marg{multi-line-code}\\
+% This one does the single-line-check.
+% \begin{macrocode}
+\newcommand\caption@slc[4]{%
+ \caption@Debug{Begin SLC}%
+ \singlelinecaptiontrue
+ \begingroup
+ \caption@singleline
+ \let\caption@justification\relax
+ \caption@calcmargin % calculate \captionwidth
+ \caption@prepareslc
+ \sbox\@tempboxa{\caption@@@make{#1}{#2}}%
+ \ifdim\wd\@tempboxa>\captionwidth
+ \endgroup
+ \singlelinecaptionfalse
+ #4%
+ \else
+ \endgroup
+ #3%
+ \fi
+ \caption@Debug{End SLC}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifsinglelinecaption}
+% \changes{v1.5}{2013/04/14}{This definition added}
+% |\ifsinglelinecaption|\\
+% could be used inside own caption formats to test if the caption is
+% currently typeset as single-line caption (or not).
+% \begin{macrocode}
+\newif\ifsinglelinecaption
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@singleline}
+% \changes{v1.1c}{2007/10/14}{This macro extracted from \cs{caption@slc}}
+% \changes{v1.1c}{2007/10/14}{Support of \cs{caption@slfmt} added}
+% \changes{v1.1d}{2007/10/23}{This macro renamed from \cs{caption@SingleLine} to \cs{caption@singleline} for consistency}
+% |\caption@singleline|\\
+% prepares the typesetting of a single-line caption.
+% \begin{macrocode}
+\newcommand*\caption@singleline{%
+ \caption@xsetup\caption@slsty % Note: This could change \caption@format
+ \caption@format % defines \caption@ifhmode, \caption@slfmt, and \caption@fmt
+ \let\caption@fmt\caption@slfmt}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@multiline}
+% \changes{v2.0}{2020/07/28}{This macro added}
+% |\caption@multiline|\\
+% prepares the typesetting of a multi-line caption.
+% \begin{macrocode}
+\newcommand*\caption@multiline{%
+ \caption@format} % defines \caption@ifhmode, \caption@slfmt, and \caption@fmt
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@prepareslc}
+% \changes{v1.0b}{2004/05/16}{Bugfix: Redefinition of \cs{label} \& \cs{@footnotetext} added}
+% \changes{v1.0b}{2004/05/16}{Redefine \cs{stepcounter} instead of \cs{footnote(mark)}}
+% \changes{v1.0c}{2005/02/12}{\cs{let}\cs{caption@justification}\cs{relax} added}
+% \changes{v1.0f}{2005/07/09}{Support of \package{endnotes} package added}
+% \changes{v1.1}{2007/06/13}{\cs{let}\cs{caption@justification}\cs{relax} moved to \cs{caption@slc}}
+% \changes{v1.1}{2007/06/13}{Redefinition of \cs{(H@)refstepcounter} added}
+% \changes{v1.1}{2007/08/12}{Redefinition of \cs{label} improved}
+% \changes{v1.1c}{2007/10/06}{Definition of \cs{caption@l@stepcounter} added}
+% \changes{v1.3}{2011/07/07}{Bugfix 11-07-06: Redefinition of \cs{footnote} and \cs{footnotemark} added, redefinition of \cs{stepcounter} and \cs{refstepcounter} dropped}
+% \changes{v1.4a}{2011/10/22}{Redefinition of \cs{footnote} revised}
+% \changes{v1.5}{2013/04/13}{Redefinition os \cs{glsunset} added}
+% \changes{v1.8}{2018/01/21}{Redefinition of \cs{endnote} added (thanks to Markus Kohm)}
+% \changes{v1.8}{2018/05/16}{Redefinition of \cs{acused} added}
+% \changes{v1.8}{2018/05/26}{Definition method changed so it can be pre-defined by other packages}
+% \changes{v1.8}{2018/05/27}{Redefinition of \cs{hypertarget} added}
+% |\caption@prepareslc|\\
+% re-defines anything which could disturb the single-line-check.
+% \begin{macrocode}
+\providecommand*\caption@prepareslc{}
+\g@addto@macro\caption@prepareslc{%
+ \let\label\caption@gobble
+ \let\hypertarget\@gobbletwo
+% \end{macrocode}
+% We re-define \cs{footnote} so
+% \begin{enumerate}
+% \item The footnote counter will not be increased twice (but still the
+% correct footnote mark will be used within the single-line-check)
+% \item The footnote text will not be evaluated twice
+% \end{enumerate}
+% \begin{macrocode}
+ \let\caption@footnote@ORI\footnote
+ \def\footnote{\caption@withoptargs\caption@footnote}%
+ \let\caption@footnotemark@ORI\footnotemark
+ \def\footnotemark{\caption@withoptargs\caption@footnotemark}%
+ \let\caption@footnotetext@ORI\@footnotetext
+ \let\@footnotetext\caption@gobble
+% \end{macrocode}
+% Same for \cs{endnote}
+% \begin{macrocode}
+ \let\caption@endnote@ORI\endnote
+ \def\endnote{\caption@withoptargs\caption@endnote}%
+ \let\caption@endnotemark@ORI\endnotemark
+ \def\endnotemark{\caption@withoptargs\caption@endnotemark}%
+ \let\caption@endnotetext@ORI\@endnotetext
+ \let\@endnotetext\caption@gobble
+% \end{macrocode}
+% Adaption to the \package{acronym} package\par
+% See also \url{https://tex.stackexchange.com/questions/428788}
+% \begin{macrocode}
+ \let\acused\@gobble
+ \let\AC@placelabel\@gobble
+% \end{macrocode}
+% Adaption to the \package{glossaries} package.\par
+% Please note that while this adaption is usually sufficient
+% it could give incorrect measuring results if \cs{gls} is both used
+% for the very first time and more than once (for a particular acronym).
+% The alternative would be using internal macros of the
+% \package{glossaries} package which I would like to avoid.\par
+% See also \url{https://tex.stackexchange.com/questions/108368}
+% \begin{macrocode}
+ \let\glsunset\@gobble
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@footnote[2]{%
+ \caption@footnotemark{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@footnotemark[1]{%
+ \begingroup
+ \let\stepcounter\caption@l@stepcounter
+ \caption@footnotemark@ORI#1\relax
+ \endgroup}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@endnote[2]{%
+ \caption@endnotemark{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@endnotemark[1]{%
+ \begingroup
+ \let\stepcounter\caption@l@stepcounter
+ \caption@endnotemark@ORI#1\relax
+ \endgroup}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@l@stepcounter[1]{%
+ \advance\csname c@#1\endcsname\@ne\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@applyfont}
+% \changes{v1.3}{2010/09/04}{This macro added}
+% |\caption@applyfont|\\
+% applies the relevant font settings, i.e. by default
+% the options set by |justification=|, |font=|, and |size=|.
+% \begin{macrocode}
+\newcommand*\caption@applyfont{%
+ \caption@justification\captionfont\captionsize}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@@make}
+% \changes{v1.0b}{2004/05/16}{Bugfix 04-05-06: \cs{allowhyphens} added}
+% \changes{v1.0c}{2005/02/12}{Bugfix 04-12-16: Use some kind of \cs{@startstrut}\cs{strutbox} instead of \cs{strut}}
+% \changes{v1.0c}{2005/02/12}{Bugfix 05-01-23: \cs{@finalstrut}\cs{strutbox} added}
+% \changes{v1.0d}{2005/05/05}{Use \cs{caption@ifempty}; \cs{let}\cs{caption@ifstrut}\cs{@secondoftwo} added}
+% \changes{v1.0d}{2005/05/05}{Bugfix: Handling of \cs{ifcaption@star} changed}
+% \changes{v1.0f}{2005/08/24}{Check for empty label added}
+% \changes{v1.0f}{2005/08/25}{\cs{caption@iflf} added}
+% \changes{v1.0j}{2007/02/18}{Usage of \cs{caption@textformat} added}
+% \changes{v1.1}{2007/05/07}{Bugfix: \cs{ifhmode} added to \cs{@finalstrut}}
+% \changes{v1.2}{2007/11/17}{Made option \opt{size=} stronger than \opt{font=}}
+% \changes{v1.3}{2010/09/04}{Uses \cs{caption@applyfont} now}
+% \changes{v1.3}{2010/11/01}{Bugfix: If the caption text is empty, the text format will be set to \opt{simple} now}
+% \changes{v1.7}{2016/02/01}{Bugfix: \cs{relax} added before \cs{caption@lsep} so the label separator will not be gobbled if the label font command ignores spaces, e.g. by usage of \cs{color}}
+% \changes{v1.8}{2018/09/12}{\cs{par} replaced by \cs{caption@textend}}
+% \changes{v2.2c}{2020/10/10}{Usage of the label separators \opt{gobble} and \opt{gobbletwo} added}
+% \changes{v2.2e}{2020/10/21}{Adaptions to \package{floatrow} package added}
+% |\caption@@@make|\marg{caption label}\marg{caption text}\\
+% This one finally typesets the caption paragraph, without margin and indention.
+% \begin{macrocode}
+\newcommand\caption@@@make[2]{%
+% \end{macrocode}
+% The \package{floatrow} package uses |\caption@@@make|, too,
+% but without using |\caption@single|\-|line| or |\caption@multi|\-|line|.
+% For this reason we must expand |\caption@format| if |\caption@fmt| isn't defined yet.
+% Furthermore it uses |\caption@lfmt| as argument which was renamed to
+% |\caption@label|\-|format| in \package{caption3}\version{2.0}.
+% \begin{macrocode}
+ \ifx\caption@fmt\@undefined\caption@format\fi
+ \let\caption@lfmt\caption@labelformat
+% \end{macrocode}
+% If the label is empty, we use the label separator `none'.
+% Futhermore we use this check to determine if |#1| ends with either
+% |\@gobble|, |\@gobble|\-|two|, and/or |\ignore|\-|spaces|.
+% If yes, we use the corresponding label separator.
+% \begin{macrocode}
+ \global\def\caption@tempa{gobbletwo}%
+ \global\def\caption@tempb{}%
+ \sbox\@tempboxa{%
+ \let\caption@ignorespaces\ignorespaces
+ \def\ignorespaces{%
+ \global\def\caption@tempb{two}% "gobble" -> "gobbletwo" if \ignorespaces is used addtionally
+ \caption@ignorespaces}%
+ #1%
+ {\global\let\caption@tempa\@undefined\aftergroup\@gobble}%
+ {\global\def\caption@tempa{gobble\caption@tempb}}}%
+ \ifdim\wd\@tempboxa=\z@
+ \gdef\caption@tempa{none}%
+% \@capbreakfalse
+ \fi
+ \ifx\caption@tempa\@undefined \else
+ \@expandtwoargs\caption@set{labelseparator}{\caption@tempa}%
+ \fi
+% \end{macrocode}
+% If the text is empty, we use no caption label separator, too.
+% (And no text format either.)
+% \begin{macrocode}
+ \caption@ifempty{#2}{%
+ \caption@set{labelseparator}{none}%
+ \caption@set{textformat}{simple}%
+% \@capbreakfalse
+% \let\caption@ifstrut\@secondoftwo
+ }%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@labelseparator % defines \caption@iflabelfont, \caption@labelsep and \caption@labelsep@name (the latter is needed by \caption@fmt)
+% \end{macrocode}
+% Take care that |\caption@par|\-|indent| and |\caption@hang|\-|indent|
+% will be used to typeset the paragraph.
+% \begin{macrocode}
+ \@setpar{\@@par\caption@@par}\caption@@par
+% \end{macrocode}
+% Finally typeset the caption.
+% \begin{macrocode}
+ \caption@applyfont
+ \caption@fmt
+ {\ifcaption@star\else
+ \begingroup
+ \captionlabelfont
+ #1\relax\relax
+ \endgroup
+ \fi}%
+ {\ifcaption@star\else
+ \begingroup
+ \caption@iflabelfont\captionlabelfont
+ \relax\caption@labelsep
+ \endgroup
+ \fi}%
+ {{\captiontextfont
+ \caption@textstart
+ \caption@ifstrut
+ {\vrule\@height\ht\strutbox\@width\z@}%
+ {}%
+ \nobreak\hskip\z@skip % enable hyphenation
+ \caption@textformat{#2}%
+% \caption@ifstrut{\vrule\@height\z@\@depth\dp\strutbox\@width\z@}{}%
+ \caption@ifstrut
+ {\ifhmode\@finalstrut\strutbox\fi}%
+ {}%
+ \caption@textend}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@textstart{}
+\newcommand*\caption@textend{\par}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifempty}
+% \changes{v1.0d}{2005/05/05}{This macro added}
+% \changes{v1.1}{2007/07/04}{Re-defines itself now}
+% \changes{v1.2a}{2007/01/22}{Revised so \cs{label} will be detected, too}
+% \changes{v1.2b}{2008/08/02}{Revised so \cs{index} and \cs{glossary} will be detected, too}
+% |\caption@ifempty|\marg{text}\marg{yes-code}\\
+% tests if the \meta{text} is actually empty.
+% \Note{This will be done without expanding the text,
+% therefore this is far away from being bullet-proof.}
+% \Note{This macro is re-defining itself so only
+% the first test (in a group) will actually be done.}
+% \begin{macrocode}
+\newcommand\caption@ifempty[1]{%
+ \caption@if@empty{#1}%
+ \caption@ifempty\@unused}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@if@empty[1]{%
+ \def\caption@tempa{#1}%
+ \ifx\caption@tempa\@empty
+ \let\caption@ifempty\@secondoftwo
+ \else
+ \expandafter\def\expandafter\caption@tempa\expandafter{%
+ \caption@car#1\caption@if@empty\caption@nil}%
+ \def\caption@tempb{\caption@if@empty}%
+ \ifx\caption@tempa\caption@tempb
+ \let\caption@ifempty\@secondoftwo
+ \else
+ \def\caption@tempb{\ignorespaces}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\caption@if@empty\expandafter{\@gobble#1}%
+ \else
+ \def\caption@tempb{\label}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
+ \else
+ \def\caption@tempb{\index}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
+ \else
+ \def\caption@tempb{\glossary}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
+ \else
+ \let\caption@ifempty\@gobbletwo
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@car#1#2\caption@nil{#1}% same as \@car, but \long
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@@par}
+% \changes{v1.0f}{2005/08/22}{Made this definition global}
+% |\caption@@par|\\
+% will be expanded with every |\par| inside the caption.
+% \begin{macrocode}
+\newcommand*\caption@@par{%
+ \parindent\caption@parindent\hangindent\caption@hangindent}%
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Types \& sub-types}
+%
+% \begin{macro}{\DeclareCaptionType}
+% \changes{v1.1}{2007/08/12}{This macro added}
+% \changes{v1.1a}{2007/09/07}{Three optional arguments added}
+% \changes{v1.2}{2007/12/06}{Renamed from \cs{DeclareFloatingEnvironment} to \cs{DeclareCaptionType}}
+% \changes{v1.2}{2007/12/21}{Optional argument revised, uses key-value syntax now}
+% \changes{v1.2b}{2008/04/13}{Uses \cs{caption@within@default} now}
+% \changes{v1.2b}{2008/08/02}{Support of \cs{float@exts} and \cs{float@addtolists} added}
+% \changes{v1.2e}{2010/01/09}{Usage of \cs{caption@DeclareWithinOption} added}
+% \changes{v1.3}{2011/08/06}{Definition of \cs{listofXXXes} added}
+% \changes{v1.4a}{2011/10/29}{Outsourced to \package{newfloat} package}
+% |\DeclareCaptionType|\oarg{options}\marg{environment}\oarg{name}\oarg{list name}\\
+% loads the \package{newfloat} package and uses |\Declare|\-|Floating|\-|Environment|.
+% \begin{macrocode}
+\newcommand*\DeclareCaptionType{%
+ \caption@loadpackage{newfloat}{declare type}%
+ \DeclareFloatingEnvironment}
+\@onlypreamble\DeclareCaptionType
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ForEachCaptionType}
+% \changes{v1.4a}{2011/10/29}{This macro added}
+% \changes{v1.13}{2020/07/29}{Renamed from \cs{caption@ForEachType} to \cs{ForEachCaptionType} and starred variant added}
+% |\ForEachCaptionType*|\marg{code with \#1}\\
+% will execute the given code for each (known) floating environment.
+% The starred variant will only work for already existing environments,
+% i.e.~no hook will be placed inside |\Declare|\-|Floating|\-|Environment|
+% (offered by the \package{newfloat} package).
+% \begin{macrocode}
+\newcommand*\ForEachCaptionType{%
+ \@ifstar
+ {\caption@foreach@type\@gobble}%
+ {\caption@foreach@type\@iden}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@foreach@type[2]{%
+ \caption@ifdefined\ForEachFloatingEnvironment
+ {\ForEachFloatingEnvironment*{#2}}%
+ {\def\@elt##1{#2}%
+ \caption@ifdefined\c@figure\@elt\@gobble{figure}%
+ \caption@ifdefined\c@table\@elt\@gobble{table}%
+ \let\@elt\relax}%
+ #1{\newfloat@addtohook{#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newfloat@addtohook}
+% |\newfloat@addtohook|\marg{code with \#1}\\
+% adds code to the hook called in |\Declare|\-|Floating|\-|Environment|.\par
+% Note: We use |\provide|\-|command| instead of |\new|\-|command| here since the
+% exact same code is defined in the \package{newfloat} package.
+% \begin{macrocode}
+\providecommand\newfloat@addtohook[1]{%
+ \toks@=\expandafter{\newfloat@hook{##1}#1}%
+ \edef\@tempa{\def\noexpand\newfloat@hook####1{\the\toks@}}%
+ \@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newfloat@hook}
+% Hook used in |\Declare|\-|Floating|\-|Environment|.
+% \begin{macrocode}
+\providecommand*\newfloat@hook[1]{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareCaptionSubType}
+% \changes{v1.2}{2007/11/16}{This macro added}
+% \changes{v1.2a}{2008/03/11}{Bugfix: \cs{subfigurename} will be defined now}
+% \changes{v1.2d}{2009/10/09}{Bugfix 08-10-01: Usage of \cs{caption@addtoreset} added}
+% \changes{v1.3}{2011/01/01}{\cs{@dottedlofline} will be defined \& used now}
+% \changes{v1.4}{2011/10/09}{Support of the titletoc package added}
+% \changes{v1.5}{2011/12/29}{Usage of \cs{caption@addtoreset} replaced by \cs{@addtoreset}}
+% \changes{v1.5}{2013/01/10}{Bugfix: Definition of autoref string corrected}
+% \changes{v1.6}{2013/06/17}{Bugfix: \cs{c@tocdepth} will be set (locally) now}
+% \changes{v1.8g}{2020/01/02}{Check revised if the sub-type is already defined or not}
+% \changes{v1.13}{2020/07/28}{Uses \cs{caption@l@addto@list} instead of \cs{@cons} now}
+% \changes{v1.13}{2020/07/29}{Usage of \cs{caption@subtype@hook} added}
+% \changes{v1.13}{2020/07/29}{We don't re-use existing counters anymore (This was a bad idea anyway)}
+% |\DeclareCaptionSubType*|\oarg{numbering scheme}\marg{type}\\
+% The starred variant provides the numbering format
+% \meta{type}|.|\meta{subtype} while the non-starred variant simply uses
+% \meta{subtype}.
+% \begin{macrocode}
+\newcommand*\DeclareCaptionSubType{%
+ \caption@teststar\caption@declaresubtype\@firstoftwo\@secondoftwo}
+\@onlypreamble\DeclareCaptionSubType
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declaresubtype[1]{%
+ \@testopt{\caption@@declaresubtype{#1}}{alph}}
+\@onlypreamble\caption@declaresubtype
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@declaresubtype#1[#2]#3{%
+ \@ifundefined{c@#3}%
+ {\caption@Error{No float type '#3' defined}}%
+ {\caption@@@declaresubtype{#1}{#2}{#3}{sub#3}}}
+\@onlypreamble\caption@@declaresubtype
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@declaresubtype[4]{%
+% \end{macrocode}
+% \begin{macrocode}
+% Check if the sub-type was already defined by |\Declare|\-|Sub|\-|Type|.
+% If not, define the counter and list entry.
+% \begin{macrocode}
+ \caption@ifsubtype{#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}}%
+% \end{macrocode}
+% Support of \package{titletoc} package
+% \begin{macrocode}
+ \caption@ifdefined\contentsuse{%
+ \contentsuse{#4}{\csname ext@#4\endcsname}}{}%
+% \end{macrocode}
+% \begin{macrocode}
+ \@namedef{#4name}{}%
+ \@namedef{#4autorefname}{\csname #3autorefname\endcsname}%
+ #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}}}
+% \end{macrocode}
+% \begin{macrocode}
+\@onlypreamble\caption@@@declaresubtype
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declaresublistentry{%
+ \caption@ifdefined\l@chapter
+ {\caption@@declaresublistentry\l@subsection}%
+ {\caption@@declaresublistentry\l@subsubsection}}
+\@onlypreamble\caption@declaresublistentry
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@declaresublistentry[2]{%
+ \ifx#1\@undefined
+ \caption@@@declaresublistentry\relax\@dottedtocline\caption@nil{#2}%
+ \else
+ \expandafter\caption@@@declaresublistentry#1{}{}\@dottedtocline\caption@nil{#2}%
+ \fi}
+\@onlypreamble\caption@@declaresublistentry
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@@declaresublistentry#1\@dottedtocline#2\caption@nil#3{%
+ \def\@tempa{#1}%
+% Does \l@(sub)subsection start with \@dottedtocline?
+ \ifx\@tempa\@empty
+% Yes
+ \caption@@@@declaresublistentry{#3}#2\caption@nil
+ \else
+% No
+ \caption@@@@declaresublistentry{#3}@{3.8em}{3.2em}\caption@nil
+ \fi}
+\@onlypreamble\caption@@@declaresublistentry
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@@@@declaresublistentry#1#2#3#4#5\caption@nil{%
+ \expandafter\caption@@@@@declaresublistentry\expandafter
+ {\csname @dotted\csname ext@#1\endcsname line\endcsname}{#1}{#3}{#4}}
+\@onlypreamble\caption@@@@declaresublistentry
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@@@declaresublistentry[4]{%
+ \@namedef{l@sub#2}{#1{2}{#3}{#4}}%
+ \expandafter\caption@@@@@@declaresublistentry
+ \expandafter#1\expandafter{\csname ext@#2\endcsname depth}}
+\@onlypreamble\caption@@@@@declaresublistentry
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@@@@declaresublistentry[2]{
+ \ifx#1\relax
+ \def#1##1{%
+ \def\next{\@dottedtocline{##1}}%
+ \@ifundefined{c@#2}{}{%
+ \ifnum ##1>\@nameuse{c@#2}\relax
+ \let\next\@gobblefour
+ \else
+ \c@tocdepth=\@nameuse{c@#2}\relax
+ \fi}%
+ \next}%
+ \fi}
+\@onlypreamble\caption@@@@@@declaresublistentry
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@subtypelist}
+% A list containing the sub-types defined with
+% |\Declare|\-|Caption|\-|Sub|\-|Type|.
+% \begin{macrocode}
+\newcommand*\caption@subtypelist{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifsubtype}
+% \changes{v1.8g}{2020/01/02}{This macro added}
+% \changes{v1.13}{2020/07/28}{Uses \cs{caption@ifin@list} now}
+% |\caption@ifsubtype|\marg{yes-code}\marg{no-code}\\
+% checks if the given subtype was defined with
+% |\Declare|\-|Caption|\-|Sub|\-|Type|.
+% \begin{macrocode}
+\newcommand*\caption@ifsubtype{%
+ \caption@ifin@list\caption@subtypelist}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ForEachCaptionSubType}
+% \changes{v1.13}{2020/07/29}{This macro added as replacement for \cs{caption@For}}
+% |\ForEachCaptionSubType*|\marg{code with \#1}\\
+% will execute the given code for each (known) sub-type.
+% The starred variant will only work for already existing sub-types,
+% i.e.~no hook will be placed inside |\Declare|\-|Caption|\-|Sub|\-|Type|.
+% \begin{macrocode}
+\newcommand*\ForEachCaptionSubType{%
+ \@ifstar
+ {\caption@foreach@subtype\@gobble}%
+ {\caption@foreach@subtype\@iden}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@foreach@subtype[2]{%
+ \caption@for@list\caption@subtypelist{#2}%
+ #1{\caption@addto@subtype@hook{#2}}}
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand\caption@addto@subtype@hook[1]{%
+ \toks@=\expandafter{\caption@subtype@hook{##1}#1}%
+ \edef\@tempa{\def\noexpand\caption@subtype@hook####1{\the\toks@}}%
+ \@tempa}
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\caption@subtype@hook[1]{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@memresetsubcounter}
+% \changes{v1.5}{2013/05/01}{The macro \cs{caption@savesubcounters} added}
+% \changes{v1.13}{2020/07/28}{Uses \cs{caption@for@list} now for iterating the list}
+% \changes{v2.2b}{2020/10/06}{This stuff replaced by a patch of \cs{@memresetsubcounter}}
+% The \class{memoir} document class resets the \texttt{subfigure}
+% resp.~\texttt{subtable} counter at the begin of floating environments using
+% |\@mem|\-|reset|\-|sub|\-|counter|.
+% As a side-effect |\continued|\-|float| does not work correctly.
+% For that reason we need to patch |\@mem|\-|reset|\-|sub|\-|counter| here,
+% suppressing the counter reset if the counter was defined with
+% |\Declare|\-|Caption|\-|Sub|\-|Type|.
+% \begin{macrocode}
+\caption@ifdefined\@memresetsubcounter
+ {\let\caption@memresetsubcounter\@memresetsubcounter
+ \renewcommand*\@memresetsubcounter[1]{%
+ \caption@ifsubtype{sub#1}\@gobble\caption@memresetsubcounter{#1}}}%
+ {}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Execution of options}
+%
+% \begin{macrocode}
+\ifx\caption@documentclass\@empty\else
+ \@pushfilename
+ \edef\@currname{caption-\caption@documentclass}
+ \edef\@currext{sto}
+ \InputIfFileExists
+ {\@currname.\@currext}%
+ {}%
+ {\@missingfileerror\@currname\@currext}%
+ \@popfilename
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\captionsetup{style=default,position=default,listformat=default}
+% \end{macrocode}
+% \begin{macrocode}
+\ProcessOptions*
+% \end{macrocode}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \clearpage
+% \begin{thebibliography}{99}
+% \bibitem{TLC2}
+% Frank Mittelbach and Michel Goossens:\\
+% \newblock {\em The {\LaTeX} Companion (2nd.~Ed.)},\\
+% \newblock Addison-Wesley, 2004.
+%
+% \bibitem{Anne}
+% Anne Br\"uggemann-Klein:\\
+% \emph{Einf\"uhrung in die Dokumentverarbeitung},\\
+% B.G. Teubner, Stuttgart, 1989
+%
+% \bibitem{hyperref}
+% Sebastian Rahtz \& Heiko Oberdiek:\\
+% \href{http://www.ctan.org/pkg/hyperref}%
+% {\emph{Hypertext marks in \LaTeX}},\\
+% November 12, 2007
+%
+% \bibitem{refcount}
+% Heiko Oberdiek:\\
+% \href{http://www.ctan.org/pkg/refcount}%
+% {\emph{The refcount package}},\\
+% 2006/02/20
+%
+% \bibitem{threeparttable}
+% Donald Arseneau:\\
+% \href{http://www.ctan.org/pkg/threeparttable}%
+% {\emph{Three part tables: title, tabular environment, notes}},\\
+% 2003/06/13
+% \end{thebibliography}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/caption/ltcaption.dtx b/Master/texmf-dist/source/latex/caption/ltcaption.dtx
index fab8a4c05ea..1b6c813a53f 100644
--- a/Master/texmf-dist/source/latex/caption/ltcaption.dtx
+++ b/Master/texmf-dist/source/latex/caption/ltcaption.dtx
@@ -27,12 +27,11 @@
% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
-% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
-% and the user manuals
-% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty.
%
% \fi
-% \CheckSum{381}
+%
+% \CheckSum{388}
%
% \iffalse
%<*driver>
@@ -424,6 +423,7 @@
% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\kernel@ifnextchar}
% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
@@ -464,9 +464,26 @@
%
% \subsection{Identification}
%
+% We need at least \LaTeX2e\ version 1994/12/01.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{ltcaption}[2020/05/30 v1.4b longtable captions (AR)]
+% \end{macrocode}
+%
+% Bypass the release declarations in case the \LaTeX\ kernel doesn’t know how to deal with them
+% (as suggested by \url{https://www.latex-project.org/publications/2018-FMi-TUB-tb122mitt-version-rollback.pdf}).
+% \begin{macrocode}
+\providecommand\DeclareRelease[3]{}
+\providecommand\DeclareCurrentRelease[2]{}
+% \end{macrocode}
+%
+% Declare all supported releases.
+% \begin{macrocode}
+\DeclareCurrentRelease{v1}{2007-04-15}
+% \end{macrocode}
+%
+% Identify the current version of the package.
+% \begin{macrocode}
+\ProvidesPackage{ltcaption}[2021/01/08 v1.4c longtable captions (AR)]
% \end{macrocode}
%
% \begin{macrocode}
@@ -808,6 +825,7 @@
%
% \begin{environment}{longtable*}
% \changes{v1.1a}{2008/03/21}{Improved redefinition of \cs{refstepcounter} etc.}
+% \changes{v1.4c}{2021/01/08}{Improved error message if \cs{caption} is used}
% A |longtable| environment without reference counter and hyperlink anchors.
% \begin{macrocode}
\newenvironment{longtable*}{%
@@ -831,7 +849,7 @@
\def\LT@c@ption##1[##2]##3{%
\ifx##1\@firstofone
\PackageError{ltcaption}%
- {Not allowed in longtable* environment}%
+ {\noexpand\caption is not available in longtable* environment}%
{If you do not understand this error, please take a closer
look\MessageBreak at the documentation of the `ltcaption'
package.\MessageBreak \@ehc}%
diff --git a/Master/texmf-dist/source/latex/caption/subcaption.dtx b/Master/texmf-dist/source/latex/caption/subcaption.dtx
index 3dc8cca22e0..38104d18ce3 100644
--- a/Master/texmf-dist/source/latex/caption/subcaption.dtx
+++ b/Master/texmf-dist/source/latex/caption/subcaption.dtx
@@ -2,7 +2,7 @@
%
% This is file `subcaption.dtx'.
%
-% Copyright (C) 2007-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+% Copyright (C) 2007-2022 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
%
% --------------------------------------------------------------------------
%
@@ -27,53 +27,47 @@
% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
-% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
-% and the user manuals
-% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty.
%
% \fi
-% \CheckSum{221}
+%
+% \CheckSum{468}
%
% \iffalse
%<*driver>
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesFile{subcaption.drv}[2020/08/24 v1.3 Adds a sub-caption feature to the caption package]
+\ProvidesFile{subcaption.drv}[2022/02/20 v1.5 Adds a sub-caption feature to the caption package]
\hbadness=9999 \newcount\hbadness \hfuzz=74pt % Make TeX shut up.
%\errorcontextlines=3
%
\documentclass{ltxdoc}
\setlength\parindent{0pt}
\setlength\parskip{\smallskipamount}
+\addtolength\marginparwidth{15pt}
%
-\newcommand\LineBreak{\linebreak[3]}
-\newcommand\PageBreak{\pagebreak[3]}
\usepackage{ifpdf}
\ifpdf
\usepackage{mathptmx,courier}
\usepackage[scaled=0.90]{helvet}
- \addtolength\marginparwidth{15pt}
- \ifdim\paperheight=297mm % a4paper
- \renewcommand\LineBreak{\\}
- \renewcommand\PageBreak{\clearpage}
- \fi
\fi
%
\usepackage[bottom]{footmisc}
-\usepackage{array,graphicx,overpic,pict2e,diagbox}
+\usepackage{array,diagbox,graphicx,overpic,pict2e,stackengine,tikz}
%
\PassOptionsToPackage{breaklinks=true}{hyperref}
\usepackage{hypdoc}
\ifpdf\usepackage{hypdestopt}\fi
\hypersetup{pdfkeywords={LaTeX, package, subcaption},pdfstartpage={},pdfstartview={}}
%
-\usepackage{subcaption}[2011/08/01] % needs v1.1 or newer
+\usepackage{caption}[2022/01/07] % needs v3.6 or newer to typeset this document
+\usepackage{subcaption}[2022/01/07] % needs v1.5 or newer to typeset this document
\DeclareCaptionSubType*[arabic]{table}
\captionsetup[subtable]{labelformat=simple,labelsep=colon}
%
\newcommand*\purerm[1]{{\upshape\mdseries\rmfamily #1}}
\newcommand*\puresf[1]{{\upshape\mdseries\sffamily #1}}
\newcommand*\purett[1]{{\upshape\mdseries\ttfamily #1}}
-\let\package\puresf
+\let\pkg\puresf
\let\env\purett \let\opt\purett
%
\newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
@@ -90,8 +84,14 @@
\newenvironment{background}{\par\bigskip\csname background*\endcsname}{\csname endbackground*\endcsname}
\newenvironment{background*}{\small\MARGINSYM{\Mountain}\ignorespaces}{\par}
%
+\makeatletter
\newcommand*\MARGINSYM[1]{\hskip 1sp \marginpar{\raggedleft\textcolor{blue}{{#1}}}}
-\newcommand*\NEW[2]{\MARGINSYM{\vskip2pt\footnotesize#1\\#2}}
+\newcommand*\NEW[1]{\@ifstar{\@NEW{#1}{\vskip2pt}}{\@NEW{#1}{}}}
+\newcommand*\@NEW[3]{\MARGINSYM{#2\footnotesize#1\\#3}}
+\makeatother
+%
+\newcommand*\PageBreak{\pagebreak[3]}
+\newcommand*\changenote[1]{}
%
\begin{document}
\DocInput{subcaption.dtx}
@@ -102,8 +102,8 @@
% \let\subsectionautorefname\sectionautorefname
% \let\subsubsectionautorefname\sectionautorefname
%
-% \def\thispackage{the \package{subcaption} package}
-% \def\Thispackage{The \package{subcaption} package}
+% \def\thispackage{the \pkg{subcaption} package}
+% \def\Thispackage{The \pkg{subcaption} package}
%
% \newcommand\NEWfeature{\NEW{New feature}}
% \newcommand\NEWdescription{\NEW{New description}}
@@ -128,8 +128,7 @@
% \maketitle
%
% \begin{abstract}
-% This package supports typesetting of sub-captions
-% (by using the the sub-caption feature of the \package{caption} package).
+% This package offers an user interface to typeset sub-captions.
% \end{abstract}
%
% \begin{background}
@@ -141,21 +140,27 @@
% \end{background}
%
% \begin{background*}
-% This package demonstrates the usage of |\Declare|\-|Caption|\-|Sub|\-|Type|,
-% |\caption|\-|setup{sub|\-|type}|, and the internal hook
-% |\caption@sub|\-|type|\-|hook| (offered by the \package{caption} package).
+% Since version $3.1$ the \pkg{caption} package offers a low-level interface to typeset sub-captions:
+% |\Declare|\-|Caption|\-|Sub|\-|Type| defines the required counters and internal commands,
+% |\set|\-|caption|\-|sub|\-|type| switches to the sub-caption mode, and
+% |\caption@sub|\-|type|\-|hook| could be extended to apply own code when a switch to the sub-caption mode is in progress.
+%
+% This package demonstrates its usage by offering a high-level user interface additionally.
% \end{background*}
%
% \bigskip
-% \INFO*
+% \INFO
% \emph{Please note:}
-% This package is incompatible with the \package{subfigure} and \package{subfig}
-% packages.
+% This package is incompatible with the \pkg{subfigure} and \pkg{subfig} packages.
%
% \clearpage
% \setcounter{tocdepth}{2}
% \tableofcontents
%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
% \clearpage
% \section{Loading the package}
%
@@ -163,7 +168,7 @@
% \begin{quote}
% |\usepackage|\oarg{options}|{subcaption}|\quad.
% \end{quote}
-% The options for \thispackage\ are the same ones as for the \package{caption}
+% The options for \thispackage\ are the same ones as for the \pkg{caption}
% package, but specify settings which are used for sub-captions
% \emph{additionally}.
% In fact
@@ -178,12 +183,13 @@
%
% \bigskip
%
-% The default settings for |sub|captions are:
+% \pagebreak[3]
+% The default settings for sub-captions are:
% \begin{quote}
% |margin=0pt,font+=smaller,labelformat=parens,labelsep=space,|\\
% |skip=6pt,list=false,hypcap=false|~\footnote{%^^A
% This means that sub-captions are not listed in the List of Figures
-% or Tables by default, but you can enable that by
+% or Tables by default, but you can enable it by
% specifying the option \texttt{list=true}.}
% \end{quote}
%
@@ -209,6 +215,8 @@
% \item Local `sub' settings
% {\small(|\captionsetup{|\ldots|}| inside |sub|\-|figure| or |sub|\-|table|)}
% \end{enumerate}
+%
+% \pagebreak[3]
% An example:
% \begin{quote}
% |\usepackage[labelsep=quad,indention=10pt]{caption}|\\
@@ -224,14 +232,18 @@
% |labelfont=bf,list=true,textfont=sf|\quad.
% \end{quote}
%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
% \PageBreak
% \section{The \cs{subcaptionbox} command}
%
% \DescribeMacro\subcaptionbox
-% The easiest way to apply a sub-caption is by using the
-% |\sub|\-|caption|\-|box| command, which automatically aligns the
-% sub-figures resp.~sub-tables by their very first caption line.
+% The |\sub|\-|caption|\-|box| command typesets given content and caption.
+% It automatically aligns the sub-figures resp.~sub-tables by their very first caption line.
%
+% \pagebreak[3]
% Its syntax is:
% \begingroup
% \leftmargini=12pt
@@ -241,29 +253,28 @@
% \end{quote}
% \endgroup
% \begin{small}
-% The arguments \meta{list entry} \& \meta{heading} will be used for
-% typesetting the |\caption|.\par
-% \meta{width} is the width of the resulting |\par|\-|box|; the default value is
-% the width of the contents.\par
-% \meta{inner-pos} specifies how the contents will be justified inside the
-% resulting |\parbox|;
+% The arguments \meta{list entry} \& \meta{heading} will be used for typesetting the |\caption|.
+%
+% \meta{width} is the width of the resulting |\par|\-|box|; the default value is the width of the contents.
+%
+% \meta{inner-pos} specifies how the contents will be justified inside the resulting |\parbox|;
% it can be either `c' (for |\centering|), `l' (for |\ragged|\-|right|),
% `r' (for |\ragged|\-|left|), or `s' (for no special justification).
% The default is `c'.
% (But you can use any justification defined with
% |\Declare|\-|Caption|\-|Jus|\-|ti|\-|fi|\-|ca|\-|tion| as well,
-% e.g.~`|center|\-|last|'.)
+% e.g.: `|center|\-|last|')
% \end{small}
%
% \bigskip
%
-% Using |\sub|\-|caption|\-|box|, the baseline of the resulting box will be placed
-% right between contents and heading, so usually you don't have to care about the
+% When using |\sub|\-|caption|\-|box|, the baseline of the resulting box will be placed
+% right between contents and heading. So usually you don't have to care about the
% vertical alignment of the sub-figures for yourself.
-% Also the hyperlink anchor is placed properly with respect to the |hyp|\-|cap=|
-% setting.
+% Also the hyperlink anchor is placed properly with respect to the |hyp|\-|cap=| setting.
%
-% One example:
+% \pagebreak[3]
+% An example:
% \begin{quote}
% |\begin{figure}|\\
% | \centering|\\
@@ -274,14 +285,13 @@
% | \caption{Two animals}\label{animals}|\\
% |\end{figure}|
% \end{quote}
-% gives the result:\par
% \noindent\begin{minipage}{\linewidth}
-% \setcaptiontype{figure}
+% \captionsetup{type=figure}
% \centering
% \subcaptionbox{A cat\label{cat}}
% {\includegraphics[width=30pt]{cat}}
% \subcaptionbox{An elephant\label{elephant}}
-% {\includegraphics[width=.4\textwidth]{elephant}}
+% {\includegraphics[width=140pt]{elephant}}
% \caption[Two animals]{Two animals~\footnotemark}\label{animals}
% \end{minipage}
% \footnotetext{The pictures were taken with permission from the
@@ -300,12 +310,12 @@
% | |\ldots
% \end{quote}
% \noindent\begin{minipage}{\linewidth}
-% \setcaptiontype{figure}
+% \captionsetup{type=figure}
% \centering
% \subcaptionbox{A cat\label{cat2}}
% [2.5cm]{\includegraphics[width=30pt]{cat}}
% \subcaptionbox{An elephant\label{elephant2}}
-% {\includegraphics[width=.4\textwidth]{elephant}}
+% {\includegraphics[width=140pt]{elephant}}
% \caption{Two animals}\label{animals2}
% \end{minipage}
%
@@ -318,176 +328,295 @@
% \begin{quote}
% | |\ldots\\
% | \subcaptionbox{A cat\label{cat}}|\\
-% | |\textcolor{blue}{\csoarg{.4\cs{linewidth}}}|{\includegraphics{cat}}%|\\
+% | |\textcolor{blue}{\csoarg{.4\cs{textwidth}}}|{\includegraphics{cat}}%|\\
% | \subcaptionbox{An elephant\label{elephant}}|\\
-% | |\textcolor{blue}{\csoarg{.4\cs{linewidth}}}|{\includegraphics{elephant}}|\\
+% | |\textcolor{blue}{\csoarg{.4\cs{textwidth}}}|{\includegraphics{elephant}}|\\
% | |\ldots
% \end{quote}
% \noindent\begin{minipage}{\linewidth}
-% \setcaptiontype{figure}
+% \captionsetup{type=figure}
% \centering
% \subcaptionbox{A cat\label{cat3}}
-% [.4\linewidth]{\includegraphics[width=39.34724pt]{cat}}%^^A
+% [.4\textwidth]{\includegraphics[width=30pt]{cat}}%^^A
% \subcaptionbox{An elephant\label{elephant3}}
-% [.4\linewidth]{\includegraphics[width=.4\textwidth]{elephant}}
+% [.4\textwidth]{\includegraphics[width=140pt]{elephant}}
% \caption{Two animals}\label{animals3}
% \end{minipage}
%
% \bigskip
%
-% \iffalse
+% \begin{background}
+% The |\sub|\-|caption|\-|box| is a |\par|\-|box| with
+% |\set|\-|caption|\-|sub|\-|type| as first contents line.
+% \end{background}
+%
+% \subsection{Comparison with \cs{captionbox}}
+%
+% Both, |\caption|\-|box| (offered by the \pkg{caption} package) and |\sub|\-|caption|\-|box|,
+% put its contents and caption into a |\par|\-|box| of either natural or given width and share the
+% same (mandatory and optional) arguments, but while |\caption|\-|box| uses a regular caption,
+% |\sub|\-|caption|\-|box| uses a sub-caption instead, like ``(a)'' or ``2.1''.
+%
+% \pagebreak[3]
+% So for example the last example would look like this when using |\caption|\-|box|
+% instead of |\sub|\-|caption|\-|box|:
+% \begin{quote}
+% |\begin{figure}|\\
+% | \centering|\\
+% | \captionbox{A cat\label{cat}}|\\
+% | |\csoarg{.4\cs{textwidth}}|{\includegraphics{cat}}%|\\
+% | \captionbox{An elephant\label{elephant}}|\\
+% | |\csoarg{.4\cs{textwidth}}|{\includegraphics{elephant}}|\\
+% |\end{figure}|
+% \end{quote}
% \noindent\begin{minipage}{\linewidth}
-% \setcaptiontype{figure}
+% \captionsetup{type=figure}
% \centering
-% \hbox{\subcaptionbox{An elephant\label{elephant4}}
-% {\includegraphics[width=.4\textwidth]{elephant}}%^^A
-% \vbox{\subcaptionbox{Cat 1\label{cat4.1}}
-% {\includegraphics[width=30pt]{cat}}\par
-% \subcaptionbox{Cat 2\label{cat4.2}}
-% {\includegraphics[width=30pt]{cat}}}}%^^A
-% \caption{Two animals}\label{animals4}
+% \captionbox{A cat\label{cat3.1}}
+% [.4\textwidth]{\includegraphics[width=30pt]{cat}}%^^A
+% \captionbox{An elephant\label{elephant3.1}}
+% [.4\textwidth]{\includegraphics[width=140pt]{elephant}}
% \end{minipage}
-% \bigskip
-% \fi
%
-% \begin{background}
-% The |\sub|\-|caption|\-|box| is a |\par|\-|box| with
-% |\set|\-|caption|\-|sub|\-|type| as first contents line.
% \iffalse
-% Prepared with |\Declare|\-|Caption|\-|Sub|\-|Type| (offered by the
-% \package{caption} package), the caption package command |\set|\-|caption|\-|sub|\-|type|
-% becames available.
-% Analogous to the |\set|\-|caption|\-|type| command of the \package{caption} package,
-% the |\set|\-|caption|\-|sub|\-|type| command sets the sub-type of the box or environment
-% (so |\caption| will typeset a sub-caption instead of an ordinary one),
-% places a proper hyperlink anchor (non-starred variant only),
-% executes options associated with the sub-type etc.
+% --------------------------------------------------------------------------- %
% \fi
-% \end{background}
%
% \PageBreak
-% \section{The subfigure \& subtable environments}
+% \section{The \env{subcaptionblock} environment}
%
-% \DescribeEnv{subfigure}
-% \DescribeEnv{subtable}
-% After loading \thispackage\ the new environments |sub|\-|figure| and
-% |sub|\-|table| are available, which have the same (optional \& mandatory)
-% arguments as the |mini|\-|page| environment:
-% \begin{quote}
-% |\begin{subfigure}|\oarg{outer-pos}\oarg{height}\oarg{inner-pos}\marg{width}\\
-% \ldots\\
-% |\end{subfigure}|
-% \end{quote}
-% and
+% \DescribeEnv{subcaptionblock}
+% \NEWfeature*{v1.5}
+% The |sub|\-|caption|\-|block| environment makes a box with given width.
+% Inside this box the regular caption commands (like |\caption|, |\phantom|\-|caption|, \ldots) could be used to typeset sub-captions.
+%
+% \pagebreak[3]
+% |sub|\-|caption|\-|block| has the same (optional \& mandatory) arguments as the |mini|\-|page| environment:
+% \begingroup
+% \leftmargini=12pt
% \begin{quote}
-% |\begin{subtable}|\oarg{outer-pos}\oarg{height}\oarg{inner-pos}\marg{width}\\
-% \ldots\\
-% |\end{subtable}|
+% |\begin{subcaptionblock}|\oarg{outer-pos}\oarg{height}\oarg{inner-pos}\marg{width}\\
+% | |\ldots\\
+% |\end{subcaptionblock}|
% \end{quote}
-% Inside these environments you use the ordinary |\caption| command
-% for typesetting captions. So this example is the same as the last one,
-% but uses the |sub|\-|figure| environment:
+% \endgroup
+%
+% The default value for \meta{outer-pos} is `b' and the default value for \meta{inner-pos} is `s'.
+% (Note that the default value for \meta{outer-pos} has changed from `c' to `b' in version $1.5$ of \thispackage.)
+%
+% \NEWfeature{v1.2}
+% Beside the \meta{outer-pos} values of `c', `t', and `b', \thispackage\ also offers the
+% values `T' and `B' additionally which align the |sub|\-|figure| at the
+% very top resp.~bottom. (In contrast `t' and `b' align the |sub|\-|figure| at the
+% top resp.~bottom \textit{baseline}.)
+%
+% \bigskip
+%
+% \pagebreak[3]
+% The same example as \autoref{animals3}, but this time using the |sub|\-|caption|\-|block| environment
+% instead of |\sub|\-|caption|\-|box|:
% \begin{quote}
% |\begin{figure}|\\
-% | \begin{|\textcolor{blue}{\texttt{subfigure}}|}[b]{.5\linewidth}|\\
-% | \centering\large A|\\
-% | |\textcolor{blue}{\cs{caption}}|{A subfigure}\label{fig:1a}|\\
-% | \end{|\textcolor{blue}{\texttt{subfigure}}|}%|\\
-% | \begin{|\textcolor{blue}{\texttt{subfigure}}|}[b]{.5\linewidth}|\\
-% | \centering\large B|\\
-% | |\textcolor{blue}{\cs{caption}}|{Another subfigure}\label{fig:1b}|\\
-% | \end{|\textcolor{blue}{\texttt{subfigure}}|}|\\
-% | \caption{A figure}\label{fig:1}|\\
+% | \centering|\\
+% | |\textcolor{blue}{\cs{begin}\csmarg{subcaptionblock}\csmarg{.4\cs{textwidth}}}\\
+% | \centering|\\
+% | \includegraphics{cat}|\\
+% | |\textcolor{blue}{\cs{caption}}|{A cat}\label{cat}|\\
+% | |\textcolor{blue}{\cs{end}\csmarg{subcaptionblock}}|%|\\
+% | |\textcolor{blue}{\cs{begin}\csmarg{subcaptionblock}\csmarg{.4\cs{textwidth}}}\\
+% | \centering|\\
+% | \includegraphics{elephant}|\\
+% | |\textcolor{blue}{\cs{caption}}|{An elephant}\label{elephant}|\\
+% | |\textcolor{blue}{\cs{end}\csmarg{subcaptionblock}}|%|\\
+% | \caption{Two animals}\label{animals}|\\
% |\end{figure}|
% \end{quote}
+% \noindent\begin{minipage}{\linewidth}
+% \captionsetup{type=figure}
+% \centering
+% \begin{subcaptionblock}{.4\textwidth}
+% \centering
+% \includegraphics[width=30pt]{cat}
+% \caption{A cat}\label{cat4}
+% \end{subcaptionblock}%
+% \begin{subcaptionblock}{.4\textwidth}
+% \centering
+% \includegraphics[width=140pt]{elephant}
+% \caption{An elephant}\label{elephant4}
+% \end{subcaptionblock}
+% \caption{Two animals}\label{animals4}
+% \end{minipage}
+%
+% \medskip
+%
+% \pagebreak[3]
% Some additional notes:
% \begin{itemize}
-% \item You can override the setttings for a specific subcaption
-% with a |\caption|\-|setup| inside the |sub|\-|figure| or |sub|\-|table| environment, e.g.:
+% \item
+% You can override the setttings for a specific subcaption
+% with a |\caption|\-|setup| inside the |sub|\-|caption|\-|block|, e.g.:
% \begin{quote}
-% |\begin{subfigure}[b]{.5\linewidth}|\\
-% | \centering\large A|\\
+% |\begin{subcaptionblock}{.4\textwidth}|\\
+% | \centering|\\
+% | \includegraphics{owl}|\\
% | |\textcolor{blue}{\cs{captionsetup}\csmarg{skip=3pt}}\\
-% | \caption{A subfigure}\label{fig:1a}|\\
-% |\end{subfigure}|\\
+% | \caption{An owl}\label{owl}|\\
+% |\end{subcaptionblock}|
% \end{quote}
-% \item Hyperlinks targeted to this subfigure will jump to the beginning
-% of the subfigure, and not to the caption of the subfigure
+% \item
+% Just like |figure| or |table|, a |sub|\-|caption|\-|block| could have multiple captions, e.g.:
+% \begin{quote}
+% |\begin{subcaptionblock}{.4\textwidth}|\\
+% | \centering|\\
+% | \includegraphics{cat}|\\
+% | \caption{A cat}\label{cat}|\\
+% | \medskip|\\
+% | \includegraphics{elephant}|\\
+% | \caption{An elephant}\label{elephant}|\\
+% |\end{subcaptionblock}|
+% \end{quote}
+% \item
+% Hyperlinks targeted to this sub-figure will jump to the beginning
+% of the |sub|\-|caption|\-|block|, and not to the |\caption| inside it
% (if |hypcap=true| is set for sub-captions).
% \See{\Ref{hypcap}}
% \end{itemize}
%
-% \NEWfeature{v1.2}
-% Beside the \meta{outer-pos} values of `c', `t', and `b', \thispackage\ also offers the
-% values `T' and `B' additionally which align the |sub|\-|figure| at the
-% very top resp.~bottom. (In contrast `t' and `b' align the |sub|\-|figure| at the
-% top resp.~bottom \textit{baseline}.)
+% \DescribeEnv{subfigure}
+% \DescribeEnv{subtable}
+% The |sub|\-|caption|\-|block| environment is also offered as |sub|\-|figure| resp.~|sub|\-|table|.
+% (And prior version $1.5$ of \thispackage\ it was only available as |sub|\-|figure| resp.~|sub|\-|table|.)
%
-% \bigskip
+% There is no difference in them except the environment name should match the current floating environment,
+% i.e. inside a |figure| a |sub|\-|figure| should be used, and inside a |table| a |sub|\-|table| should be used.
+% Using the wrong sub-environment will cause a warning since \version{1.5} of the \pkg{subcaption} package.
+%
+% So if in doubt, or when writing own \LaTeX\ commands which should work in every floating environment,
+% using |sub|\-|caption|\-|block| is the correct choice.
+%
+% \smallskip
%
% \begin{background}
-% The |subfigure| \& |subtable| environments are just simple |minipage|
+% The |sub|\-|caption|\-|block|, |sub|\-|figure|, and |sub|\-|table| environments are |mini|\-|page|
% environments with |\set|\-|caption|\-|sub|\-|type| as first contents line.
-% These environments are defined with the help of
-% |\For|\-|Each|\-|Caption|\-|Sub|\-|Type|, which executes code for every sub-type
-% declared with |\Declare|\-|Caption|\-|Sub|\-|Type|.
+%
+% |sub|\-|figure| and |sub|\-|table| are defined with the help of
+% |\For|\-|Each|\-|Caption|\-|Sub|\-|Type| offered by the \pkg{caption} package,
+% which executes code for every sub-type declared with |\Declare|\-|Caption|\-|Sub|\-|Type|.
% \end{background}
%
-% \iffalse\PageBreak\fi
-% \section{The \cs{subcaption} command}
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
%
-% \DescribeMacro\subcaption
-% The most flexible way to apply a sub-caption is by using the
-% |\subcaption| command. Its syntax is analogous to the one of the |\caption|
-% command and shares its features:
+% \PageBreak
+% \section{The \env{subcaptiongroup} environment}
+%
+% \DescribeEnv{subcaptiongroup}
+% \NEWfeature*{v1.5}
+% The |sub|\-|caption|\-|group| environment is only switching to the sub-caption mode inside an own \TeX\ group.
+% Inside this environment the regular caption commands (like |\caption|, |\phantom|\-|caption|, \ldots) could be used to typeset sub-captions.
+%
+% \pagebreak[3]
+% Its syntax is:
+% \begingroup
+% \leftmargini=12pt
% \begin{quote}
-% |\subcaption|\oarg{list entry}\marg{heading}\\
-% |\subcaption*|\marg{heading}
+% |\begin{subcaptiongroup}|\\
+% | |\ldots\\
+% |\end{subcaptiongroup}|
% \end{quote}
-% Please note that the |\subcaption| command \emph{must} be applied inside
-% its own box or environment.
+% \endgroup
%
-% An example:
+% \pagebreak[3]
+% There is a starred variant of this environment as well which uses |\set|\-|caption|\-|sub|\-|type*|
+% instead of |\set|\-|caption|\-|sub|\-|type| internally:
+% \begingroup
+% \leftmargini=12pt
+% \begin{quote}
+% |\begin{subcaptiongroup*}|\\
+% | |\ldots\\
+% |\end{subcaptiongroup*}|
+% \end{quote}
+% \endgroup
+%
+% While this gives you great flexibility, it also offers you no help formatting its contents.
+%
+% \pagebreak[3]
+% The same example as \autoref{animals4}, but this time using the |sub|\-|caption|\-|group| environment
+% instead of |\sub|\-|caption|\-|block|:
% \begin{quote}
% |\begin{figure}|\\
-% | \begin{minipage}[b]{.5\linewidth}|\\
-% | \centering\large A|\\
-% | \subcaption{A subfigure}\label{fig:1a}|\\
-% | \end{minipage}%|\\
-% | \begin{minipage}[b]{.5\linewidth}|\\
-% | \centering\large B|\\
-% | \subcaption{Another subfigure}\label{fig:1b}|\\
-% | \end{minipage}|\\
-% | \caption{A figure}\label{fig:1}|\\
+% | \centering|\\
+% | |\textcolor{blue}{\cs{begin}\csmarg{subcaptiongroup}}\\
+% | \centering|\\
+% | \parbox[b]{.4\textwidth}{%|\\
+% | \centering|\\
+% | \includegraphics{cat}|\\
+% | \caption{A cat}\label{cat}}%|\\
+% | \parbox[b]{.4\textwidth}{%|\\
+% | \centering|\\
+% | \includegraphics{elephant}|\\
+% | \caption{An elephant}\label{elephant}}%|\\
+% | |\textcolor{blue}{\cs{end}\csmarg{subcaptiongroup}}\\
+% | \caption{Two animals}\label{animals}|\\
+% |\end{figure}|
+% \end{quote}
+% --or--
+% \begin{quote}
+% |\begin{figure}|\\
+% | \centering|\\
+% | |\textcolor{blue}{\cs{begin}\csmarg{subcaptiongroup}}\\
+% | \centering|\\
+% | \begin{minipage}[b]{.4\textwidth}|\\
+% | \centering|\\
+% | \includegraphics{cat}|\\
+% | \caption{A cat}\label{cat}|\\
+% | \end{minipage}%|\\
+% | \begin{minipage}[b]{.4\textwidth}|\\
+% | \centering|\\
+% | \includegraphics{elephant}|\\
+% | \caption{An elephant}\label{elephant}|\\
+% | \end{minipage}|\\
+% | |\textcolor{blue}{\cs{end}\csmarg{subcaptiongroup}}\\
+% | \caption{Two animals}\label{animals}|\\
% |\end{figure}|
% \end{quote}
-% gives the result:
-% \par\bigskip
% \noindent\begin{minipage}{\linewidth}
-% \setcaptiontype{figure}
-% \begin{minipage}[b]{.5\linewidth}
-% \centering\large A
-% \subcaption{A subfigure}\label{fig:1a}
-% \end{minipage}%^^A
-% \begin{minipage}[b]{.5\linewidth}
-% \centering\large B
-% \subcaption{Another subfigure}\label{fig:1b}
-% \end{minipage}
-% \caption{A figure}\label{fig:1}
+% \captionsetup{type=figure}
+% \centering
+% \begin{subcaptiongroup}
+% \centering
+% \begin{minipage}[b]{.4\textwidth}
+% \centering
+% \includegraphics[width=30pt]{cat}
+% \caption{A cat}\label{cat5}
+% \end{minipage}%
+% \begin{minipage}[b]{.4\textwidth}
+% \centering
+% \includegraphics[width=140pt]{elephant}
+% \caption{An elephant}\label{elephant5}
+% \end{minipage}
+% \end{subcaptiongroup}
+% \caption{Two animals}\label{animals5}
% \end{minipage}
%
% \bigskip
%
% \begin{background}
-% The |\subcaption| command is just a simple combination of
-% |\set|\-|caption|\-|sub|\-|type*| and |\caption|.
+% The |sub|\-|caption|\-|group| environment is a \LaTeX\ environment
+% with |\set|\-|caption|\-|sub|\-|type| as first contents line.
% \end{background}
%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
% \PageBreak
% \section{The \cs{DeclareCaptionSubType} command}
%
% \DescribeMacro\DeclareCaptionSubType
-% For using the sub-caption feature of the \package{caption} package some
+% For using the sub-caption feature of the \pkg{caption} package some
% commands and counters must be prepared. This is done with
% \begin{quote}
% |\DeclareCaptionSubType|\oarg{numbering scheme}\marg{type}\\
@@ -495,30 +624,35 @@
% \end{quote}
% For the environments |figure| \& |table|, and all the ones
% defined with |\Declare|\-|Floating|\-|Environment| offered by the
-% \package{newfloat} package, this will be done automatically,
+% \pkg{newfloat} package, this will be done automatically,
% but for other environments (e.g.~the ones defined with |\newfloat| offered by the
-% \package{float} package or |\Declare|\-|New|\-|Float|\-|Type| offered by the
-% \package{floatrow} package) this has to be done manually.
+% \pkg{float} package or |\Declare|\-|New|\-|Float|\-|Type| offered by the
+% \pkg{floatrow} package) this has to be done manually.
%
% \medskip
%
% The starred variant provides the sub-caption numbering format
-% \meta{type}|.|\meta{subtype} (e.g.~`|1.2|') while the non-starred variant
-% simply uses \meta{subtype} (e.g.~`|a|').
+% \meta{type}|.|\meta{subtype} (for example `|1.2|') while the non-starred variant
+% simply uses \meta{subtype} (for example `|a|').
%
-% \begin{small}
-% Own numbering formats can be created by redefining |\thesub|\meta{type}, e.g.
-% \begin{quote}|\DeclareCaptionSubType*{figure}|\\
-% |\renewcommand\thesubfigure{\thefigure\alph{subfigure}}|\end{quote}
+% \pagebreak[3]
+% Own numbering formats can be created by redefining |\thesub|\meta{type}, e.g.:
+% \begingroup
+% \leftmargini=12pt
+% \begin{quote}
+% |\DeclareCaptionSubType*{figure}|\\
+% |\renewcommand\thesubfigure{\thefigure\alph{subfigure}}|
+% \end{quote}
+% \endgroup
% would give you sub-caption numbers like `|1b|'.
-% \end{small}
%
% The default numbering scheme is |alph|, but you can use any \LaTeX\ (or self-defined)
-% command name here which converts a counter to a text value, e.g. |arabic|, |roman|,
+% command name here which converts a counter to a text value, e.g.: |arabic|, |roman|,
% |Roman|, |alph|, |Alph|, |fnsymbol|, \ldots
%
+% \pagebreak[3]
% But |\DeclareCaptionSubType| is not only for defining new sub-caption types,
-% you can use this command for re-definitions as well, e.g.
+% you can use this command for re-definitions as well, e.g.:
% \begingroup
% \leftmargini=12pt
% \begin{quote}
@@ -530,7 +664,7 @@
% will give you sub-captions in |table|s like these ones:
% \par\bigskip
% \noindent\begin{minipage}{\linewidth}
-% \setcaptiontype{table}
+% \captionsetup{type=table}
% \centering
% \caption{Two tables}
% \subcaptionbox{Table one}[3cm][c]{\begin{tabular}{cc}A & B\\ C & D\\ \end{tabular}}
@@ -539,11 +673,16 @@
%
% \begin{background}
% |\Declare|\-|Caption|\-|Sub|\-|Type| and |\For|\-|Each|\-|Caption|\-|Sub|\-|Type|
-% are integral parts of the \package{caption} package kernel.
+% are integral parts of the \pkg{caption} package kernel.
% \end{background}
%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
% \PageBreak
-% \section{References}
+% \section{Cross Referencing}
+% \label{crossreferencing}
%
% The macro |\the|\-\meta{counter} is not only responsible for the look of the \meta{counter},
% but for the look of the references typeset with |\ref|, too. References will be prefixed by
@@ -554,6 +693,7 @@
% |\Declare|\-|Caption|\-|Sub|\-|Type| will give you some options to control the
% internal (re-)definition of |\the|\-\meta{counter} and |\p@|\-\meta{counter}.
%
+% \pagebreak[3]
% \DescribeMacro\thesubfigure
% \DescribeMacro\p@subfigure
% For example |\thesubfigure| and |\p@subfigure| are (as default) internally defined as
@@ -596,23 +736,26 @@
% |\captionsetup[subfigure]{labelformat=opening}|
% \end{quote}
%
-% {\small(Please note that you need to surround redefinitions of |\p@|\-\meta{counter}
+% \bigskip
+%
+% \INFO
+% {\small Please note that you need to surround redefinitions of |\p@|\-\meta{counter}
% with |\makeatletter| and |\makeatother|. See
% \url{http://tex.stackexchange.com/questions/8351/}
-% for details.)}
+% for details.}
%
% \pagebreak[3]
% \subsection{The \cs{subref} command}
% \label{subref}
%
-% While |\ref|\marg{key} (and |\ref*|\marg{key}, if the \package{hyperref}
+% While |\ref|\marg{key} (and |\ref*|\marg{key}, if the \pkg{hyperref}
% package is used) usually gives a combined result representing the main
% caption counter and the sub-caption one, it is sometimes useful to have
% a reference to the sub-caption only. For this purpose you can use
% \begin{quote}
% |\subref|\marg{key}\\
% |\subref*|\marg{key}~\footnote{%^^A
-% Like \cs{ref*}, \cs{subref*} is only available if the \package{hyperref}
+% Like \cs{ref*}, \cs{subref*} is only available if the \pkg{hyperref}
% package\cite{hyperref} is used.}%^^A
% \qquad.
% \end{quote}
@@ -635,12 +778,15 @@
% \label{subrefformat}
%
% \DescribeMacro{subrefformat=}
-% \NEWfeature{v1.1}
+% \NEWfeature*{v1.1}
% By applying |\Declare|\-|Caption|\-|Sub|\-|Type|, or by redefining |\the|\-\meta{counter}
% and |\p@|\-\meta{counter}, you will change the look of references typeset with |\ref|
% \emph{and} |\sub|\-|ref|.
+%
% But maybe you only want to change the output of |\sub|\-|ref| without
% affecting the references typeset with |\ref|?
+%
+% \pagebreak[3]
% This is possible, too, by using the option \opt{subrefformat}:
% \begin{quote}
% |\captionsetup{subrefformat=|\meta{label format}|}|
@@ -650,6 +796,7 @@
% The default one is |simple| which has no decorative elements but simply typeset
% the reference as it is.
%
+% \pagebreak[3]
% For example
% \begin{quote}
% |\captionsetup{subrefformat=parens}|
@@ -658,95 +805,179 @@
% (typeset with |\subref|) like `|(a)|'.
%
% \subsection{Referencing sub-figures without sub-captions}
+% \label{without}
%
-% \DescribeMacro\phantomsubcaption
% \DescribeMacro\phantomcaption
-% \NEWfeature{v1.1}
-% If you don't want to give a sub-figure a caption, because the picture itself
-% already contains the caption, or for some other reason, you can use the command
+% If you don't want to give a sub-figure a caption (yet), because the picture itself
+% already contains the caption, or for some other reason, you could use the command
% \begin{quote}
-% |\phantomsubcaption|
+% |\phantomcaption|
% \end{quote}
-% instead of |\sub|\-|caption|, or
-% -- when inside a |sub|\-|figure| or |sub|\-|table| environment --
-% |\phantom|\-|caption| instead of |\caption|.
-% |\phantom|\-|sub|\-|caption| and |\phantom|\-|caption| do not have any arguments, and
-% they do not generate any output, but give you an anchor for a |\label| command
-% which can be placed afterwards.
-% Furthermore it increases the sub-figure resp. sub-table counter.
+% instead of |\caption|.
%
-% Please note that -- just like |\sub|\-|caption| -- the |\phantom|\-|sub|\-|caption|
-% command \emph{must} be applied inside its own group, box, or environment.
+% |\phantom|\-|caption| is offered by the \pkg{caption} package since version $3.2$ and
+% does not generate any output but increases the sub-figure resp.~sub-table counter
+% and gives you an anchor for a |\label| command which can be placed after it.
%
% \pagebreak[3]
% An example:
% \begin{quote}
% |\begin{figure}|\\
% | \centering|\\
-% | {\includegraphics{cat_with_a}|\\
-% | \phantomsubcaption\label{cat}}|\\
-% | {\includegraphics{elephant_with_b}|\\
-% | \phantomsubcaption\label{elephant}}|\\
-% | \caption{Two animals: \subref{cat} a huge cat,|\\
+% | \begin{subcaptiongroup}|\\
+% | \includegraphics{cat_with_a}|\\
+% | |\textcolor{blue}{\cs{phantomcaption}}|\label{cat}|\\
+% | \includegraphics{elephant_with_b}|\\
+% | |\textcolor{blue}{\cs{phantomcaption}}|\label{elephant}|\\
+% | \end{subcaptionblock}|\\
+% | \captionsetup{subrefformat=parens}|\\
+% | \caption{Two animals: \subref{cat} a cat,|\\
% | and \subref{elephant} an elephant}|\\
+% | \label{animals}|\\
% |\end{figure}|
% \end{quote}
-%
% \noindent\begin{minipage}{\linewidth}
-% \setcaptiontype{figure}
+% \captionsetup{type=figure}
% \centering
-% {\begin{overpic}[width=60pt]{cat}
-% \put(40,34){(a)}
-% \end{overpic}
-% \phantomsubcaption\label{cat6.3}}
-% {\begin{overpic}[width=.4\textwidth]{elephant}
-% \put(60,50){(b)}
-% \end{overpic}
-% \phantomsubcaption\label{elephant6.3}}
+% \begin{subcaptiongroup}
+% \phantomcaption\label{cat6.3}
+% \begin{overpic}[width=30pt]{cat}
+% \put(40,34){\captiontext*{}}
+% \end{overpic}
+% \phantomcaption\label{elephant6.3}
+% \begin{overpic}[width=140pt]{elephant}
+% \put(58,40){\captiontext*{}}
+% \end{overpic}
+% \end{subcaptiongroup}
% \captionsetup{subrefformat=parens}
-% \caption{Two animals: \subref{cat6.3} a huge cat, and \subref{elephant6.3} an elephant}
+% \caption{Two animals: \subref{cat6.3} a cat, and \subref{elephant6.3} an elephant}
% \end{minipage}
%
+% \bigskip
+%
+% \pagebreak[3]
+% \DescribeMacro\captionlistentry
+% If you don't want to give a sub-figure a caption (yet), because the picture itself
+% already contains the caption, or for some other reason, you could also use the command
+% \begin{quote}
+% |\captionlistentry|\marg{list entry}
+% \end{quote}
+% instead of |\caption|.
+%
+% |\caption|\-|list|\-|entry| is offered by the \pkg{caption} package since version $3.3$ and
+% (just like |\phantom|\-|caption|) does not generate any output but increases
+% the sub-figure resp.~sub-table counter
+% and gives you an anchor for a |\label| command which can be placed after it.
+% Additionally to |\phantom|\-|caption| this command puts an entry into the list
+% of figures resp.~tables.
+%
+% \pagebreak[3]
+% An example:
+% \begin{quote}
+% |\begin{figure}|\\
+% | \centering|\\
+% | \begin{subcaptiongroup}|\\
+% | \includegraphics{cat_with_a}|\\
+% | |\textcolor{blue}{\cs{captionlistentry}\csmarg{A cat}}\\
+% | \label{cat}|\\
+% | \includegraphics{elephant_with_b}|\\
+% | |\textcolor{blue}{\cs{captionlistentry}\csmarg{An elephant}}\\
+% | \label{elephant}|\\
+% | \end{subcaptionblock}|\\
+% | \captionsetup{subrefformat=parens}|\\
+% | \caption{Two animals: \subref{cat} a cat,|\\
+% | and \subref{elephant} an elephant}|\\
+% | \label{animals}|\\
+% |\end{figure}|
+% \end{quote}
+%
+% \pagebreak[3]
+% \subsection{Typesetting sub-captions without generating a (new) reference}
+% \label{without2}
+%
+% The |\caption| command is a multi-purpose command:
+% \begin{enumerate}
+% \item It increments the sub-figure resp.~sub-table counter and generates an internal reference which could be used with |\label|
+% \item It puts an entry into the list of figures resp.~tables
+% \item It finally typesets a caption
+% \end{enumerate}
+%
+% When put into a command or into an environment which either evaluates its content more than once or
+% does not like one of the first two actions (for whatever reason), the result could be either an error message or an incorrect
+% result, for example a sub-figure resp.~sub-table counter which was incremented more than once.
+%
+% \DescribeMacro\captiontext
+% In these cases the |\caption| command could be split into
+% |\phantom|\-|caption| which performs step one only (or |\caption|\-|list|\-|entry| which performs steps one and two),
+% and |\caption|\-|text| which performs step three only.
+% This way critical steps could be out-sourced from the target command or environment,
+% for example by prepending |\phantom|\-|caption| and using |\caption|\-|text| inside.
+%
+% \pagebreak[3]
+% The syntax of |caption|\-|text| is
+% \begin{quote}
+% |\captiontext|\oarg{number}\marg{text of sub-caption}\\
+% |\captiontext*|\oarg{number}\marg{text of sub-caption}
+% \end{quote}
+% |\caption|\-|text| is offered by the \pkg{caption} package since version $3.6$ and
+% as opposite to |\caption| it does not increase the sub-figure resp.~sub-table counter
+% and does not give you an anchor for a |\label| command.
+% It typesets the caption only, using existing counter values unless a \meta{number} is given explicitly.
+%
+% For example code please take a look at \Ref{inside}.
+%
% \pagebreak[3]
% \subsection{Where to place the \cs{label} command?}
% \label{label}
%
-% When using |\sub|\-|caption| or |\phantom|\-|sub|\-|caption|,
-% or |\caption| or |\phantom|\-|caption| inside a |sub|\-|figure| or |sub|\-|table| environment,
-% the |\label| can be either placed inside the caption text or right after the |\sub|\-|caption| or
-% |\caption| command, e.g:
+% When |\caption|
+% inside a |caption|\-|sub|\-|block|, |sub|\-|figure|, |sub|\-|table|, or |caption|\-|sub|\-|group| environment,
+% the |\label| can be either placed inside the caption text or right after the command, e.g.:
% \begin{quote}
-% |\subcaption{Some text here\label{label1}}|\\
+% |\caption{Some text here\label{text}}|\\
% \ldots\\
-% |\subcaption{Some other text}\label{label2}}|\\
+% |\caption{Some other text}\label{othertext}|\\
% \ldots\\
-% |\subcaption{Something different}|\\
-% |\label{label3}|
+% |\caption{Something completely different}|\\
+% |\label{differenttext}|
% \end{quote}
%
-% When using the |\sub|\-|caption|\-|box| command, the |\label| should be placed inside
+% When using |\phantom|\-|caption| or |\caption|\-|list|\-|entry|
+% inside a |caption|\-|sub|\-|block|, |sub|\-|figure|, |sub|\-|table|, or |caption|\-|sub|\-|group| environment,
+% the |\label| should be placed right after the command, e.g.:
+% \begin{quote}
+% |\phantomcaption\label{this}|\\
+% \ldots\\
+% |\phantomcaption|\\
+% |\label{that}|
+% \end{quote}
+%
+% But when using the |\sub|\-|caption|\-|box| command, the |\label| should be placed inside
% the caption text, e.g.:
% \begin{quote}
-% |\subcaptionbox{A description here\label{label4}}|\\
+% |\subcaptionbox{A description here\label{todo1}}|\\
% | {Some content here}|\\
% \ldots\\
% |\subcaptionbox[List-of-Figures entry]|\\
-% | {A description here\label{label5}}|\\
+% | {A description here\label{todo2}}|\\
% | {Some content here}|
% \end{quote}
+% Placing |\label| outside the |\sub|\-|caption|\-|box| would produce an incorrect reference.
%
% \pagebreak[3]
% \subsection{Where do hyperlinks jump?}
% \label{hypcap}
%
-% For the |subfigure| \& |subtable| environments and |\subcaptionbox| boxes
-% (and own constructs which use |\set|\-|caption|\-|sub|\-|type|) the
-% hyperlink anchors will be placed in respect to the |hypcap=| setting.
+% For the |caption|\-|sub|\-|block|, |sub|\-|figure|, |sub|\-|table|, and |caption|\-|sub|\-|group| environments,
+% and for the |\sub|\-|caption|\-|box| command (and all other constructs which use |\set|\-|caption|\-|sub|\-|type|)
+% the hyperlink anchors will be placed in respect to the |hypcap=| setting.
% While usage of this option is straight-forward for ordinary captions,
% the usage for sub-captions depends on the setting regarding the main captions.
-% This table gives you an overview where the hyperlinks will jump:\par
+%
+% This table gives you an overview where the hyperlinks will jump:
%
% \bigskip
+%
% \begin{small}
% \centering
% \DeleteShortVerb{\|}
@@ -767,27 +998,565 @@
% \end{small}
% \bigskip
%
-% But if |\subcaption| is used and |hypcap=true| is set for sub-captions,
+% But if the |caption|\-|sub|\-|group*| environment is used
+% (or a different construct which uses |\set|\-|caption|\-|sub|\-|type*|)
+% and |hypcap=true| is set for sub-captions,
% \thispackage\ does not know where the sub-figure or sub-table actually
% begins, so it will jump to the sub-caption instead.
%
% \medskip
-% \emph{Remember:} If you use the \package{hypcap} package\cite{hypcap},
+% \emph{Remember:} If you use the \pkg{hypcap} package\cite{hypcap},
% it controls the placement of the hyperlink anchors, making the rules
% above invalid.
%
% \bigskip
-% {\small(See also the documentation of the \package{caption} package,
-% sections about \package{hyperref} \& \package{hypcap}.)}
+% {\small(See also the documentation of the \pkg{caption} package,
+% sections about \pkg{hyperref} \& \pkg{hypcap}.)}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \PageBreak
+% \section{Captions inside sub-figures}
+% \label{inside}
+%
+% Nearly all code examples so far have placed the caption either above or below the sub-figure.
+% But it is possible to put the caption inside the sub-figure, too:
+% \begin{itemize}
+% \item The caption could already be part of the image. (This case is already handled in \Ref{without}.)
+% \item \LaTeX\ packages like \pkg{overpic}, \pkg{stackengine}, or \pkg{tikz} could be used.
+% Note that the commands resp.~environments offered by these packages usually evaluate their content more than once,
+% resulting in either errors or wrong reference counters.
+% For this reason |\caption| should not be used here, instead
+% |\phantomcaption| or |\captionlistentry| should be used outside the command resp.~environment and
+% |\captiontext| should be used inside it.
+% See also \Ref{without2}
+% \item The options |skip=| and |margin=| could be used to place the caption onto the image.
+% \end{itemize}
+%
+% \pagebreak[3]
+% \subsection{Using the overpic package}
+% \label{overpic}
+%
+% The same example as in section \Ref{without}, but using the \env{overpic} environment
+% offered by the \pkg{overpic} package~\cite{overpic}
+% to place the captions inside the pictures:
+% \begin{quote}
+% |\usepackage{overpic}|\\
+% \ldots\\
+% |\begin{figure}|\\
+% | \centering|\\
+% | \begin{subcaptiongroup}|\\
+% | |\textcolor{blue}{\cs{subcaptionlistentry}\csmarg{A cat}}\\
+% | \label{cat}|\\
+% | \begin{overpic}[width=60pt]{cat}|\\
+% | \put(40,34){|\textcolor{blue}{\cs{captiontext*}\csmarg{}}|}|\\
+% | \end{overpic}|\\
+% | |\textcolor{blue}{\cs{subcaptionlistentry}\csmarg{An elephant}}\\
+% | \label{elephant}|\\
+% | \begin{overpic}[width=140pt]{elephant}|\\
+% | \put(58,40){|\textcolor{blue}{\cs{captiontext*}\csmarg{}}|}|\\
+% | \end{overpic}|\\
+% | \end{subcaptiongroup}|\\
+% | \captionsetup{subrefformat=parens}|\\
+% | \caption{Two animals: \subref{cat} a huge cat,|\\
+% | and \subref{elephant} an elephant}|\\
+% |\end{figure}|
+% \end{quote}
+% \noindent\begin{minipage}{\linewidth}
+% \captionsetup{type=figure}
+% \centering
+% \begin{subcaptiongroup}
+% \subcaptionlistentry{A cat}\label{cat7.1}
+% \begin{overpic}[width=60pt]{cat}
+% \put(40,34){\captiontext*{}}
+% \end{overpic}
+% \subcaptionlistentry{An elephant}\label{elephant7.1}
+% \begin{overpic}[width=140pt]{elephant}
+% \put(58,40){\captiontext*{}}
+% \end{overpic}
+% \end{subcaptiongroup}
+% \captionsetup{subrefformat=parens}
+% \caption{Two animals: \subref{cat7.1} a huge cat, and \subref{elephant7.1} an elephant}
+% \end{minipage}
+%
+% \bigskip
+%
+% If neither a reference to the sub-figures nor an entry in the List of Figures is needed,
+% the usage of |\phantom|\-|caption| resp.~|\caption|\-|list|\-|entry| could be dropped.
+% Since this leaves |\caption|\-|text| without a valid sub-figure number value it must be
+% given to it explicitly as optional argument.
+%
+% Furthermore the usage of the |sub|\-|caption|\-|group| environment could be dropped here,
+% instead it would be sufficient to replace |\caption|\-|text| with |\sub|\-|caption|\-|text|.
+% \See{\Ref{subcaption}}
+%
+% \begin{quote}
+% |\usepackage{overpic}|\\
+% \ldots\\
+% |\begin{figure}|\\
+% | \centering|\\
+% | \begin{overpic}[width=60pt]{cat}|\\
+% | \put(40,34){|\textcolor{blue}{\cs{subcaptiontext*}\csoarg{1}\csmarg{}}|}|\\
+% | \end{overpic}|\\
+% | \begin{overpic}[width=140pt]{elephant}|\\
+% | \put(58,40){|\textcolor{blue}{\cs{subcaptiontext*}\csoarg{2}\csmarg{}}|}|\\
+% | \end{overpic}|\\
+% | \caption{Two animals: A huge cat and an elephant}|\\
+% |\end{figure}|
+% \end{quote}
+%
+% \pagebreak[3]
+% \subsection{Using the stackengine package}
+% \label{stackengine}
+%
+% The same example as in section \Ref{without}, but using the |\stack|\-|inset| command
+% offered by the \pkg{stackengine} package~\cite{stackengine}
+% to place the captions inside the pictures:
+% \begin{quote}
+% |\usepackage{stackengine}|\\
+% \ldots\\
+% |\begin{figure}|\\
+% | \centering|\\
+% | \begin{subcaptiongroup}|\\
+% | |\textcolor{blue}{\cs{subcaptionlistentry}\csmarg{A cat}}\\
+% | \label{cat}|\\
+% | \stackinset{l}{25pt}{b}{20pt}{|\textcolor{blue}{\cs{captiontext*}\csmarg{}}|}|\\
+% | {\includegraphics[width=60pt]{cat}}|\\
+% | |\textcolor{blue}{\cs{subcaptionlistentry}\csmarg{An elephant}}\\
+% | \label{elephant}|\\
+% | \stackinset{l}{80pt}{b}{60pt}{|\textcolor{blue}{\cs{captiontext*}\csmarg{}}|}|\\
+% | {\includegraphics[width=140pt]{elephant}}|\\
+% | \end{subcaptiongroup}|\\
+% | \captionsetup{subrefformat=parens}|\\
+% | \caption{Two animals: \subref{cat} a huge cat,|\\
+% | and \subref{elephant} an elephant}|\\
+% |\end{figure}|
+% \end{quote}
+% \noindent\begin{minipage}{\linewidth}
+% \captionsetup{type=figure}
+% \centering
+% \begin{subcaptiongroup}
+% \subcaptionlistentry{A cat}\label{cat7.2}
+% \stackinset{l}{25pt}{b}{20pt}{\captiontext*{}}{\includegraphics[width=60pt]{cat}}
+% \subcaptionlistentry{An elephant}\label{elephant7.2}
+% \stackinset{l}{80pt}{b}{60pt}{\captiontext*{}}{\includegraphics[width=140pt]{elephant}}
+% \end{subcaptiongroup}
+% \captionsetup{subrefformat=parens}
+% \caption{Two animals: \subref{cat7.2} a huge cat, and \subref{elephant7.2} an elephant}
+% \end{minipage}
+%
+% \bigskip
+%
+% \pagebreak[3]
+% If neither a reference to the sub-figures nor an entry in the List of Figures is needed,
+% this code could be simpified to:
+% \begin{quote}
+% |\usepackage{stackengine}|\\
+% \ldots\\
+% |\begin{figure}|\\
+% | \centering|\\
+% | \stackinset{l}{25pt}{b}{20pt}{|\textcolor{blue}{\cs{subcaptiontext*}\csoarg{1}\csmarg{}}|}|\\
+% | {\includegraphics[width=60pt]{cat}}|\\
+% | \stackinset{l}{80pt}{b}{60pt}{|\textcolor{blue}{\cs{subcaptiontext*}\csoarg{2}\csmarg{}}|}|\\
+% | {\includegraphics[width=140pt]{elephant}}|\\
+% | \caption{Two animals: A huge cat and an elephant}|\\
+% |\end{figure}|
+% \end{quote}
+%
+% \pagebreak[3]
+% \subsection{Using the tikz package}
+% \label{tikz}
+%
+% The same example as in section \Ref{without}, but using the \env{tikzpicture} environment
+% offered by the \pkg{tikz} package~\cite{tikz}
+% to place the captions inside the pictures:
+% \begin{quote}
+% |\usepackage{tikz}|\\
+% \ldots\\
+% |\begin{figure}|\\
+% | \centering|\\
+% | \begin{subcaptiongroup}|\\
+% | |\textcolor{blue}{\cs{subcaptionlistentry}\csmarg{A cat}}\\
+% | \label{cat}|\\
+% | \begin{tikzpicture}|\\
+% | \node (cat) at (0,0)|\\
+% | {\includegraphics[width=60pt]{cat}};|\\
+% | \node at (0.1,-0.1) {|\textcolor{blue}{\cs{captiontext*}\csmarg{}}|};|\\
+% | \end{tikzpicture}|\\
+% | |\textcolor{blue}{\cs{subcaptionlistentry}\csmarg{An elephant}}\\
+% | \label{elephant}|\\
+% | \begin{tikzpicture}|\\
+% | \node (elephant) at (0,0)|\\
+% | {\includegraphics[width=140pt]{elephant}};|\\
+% | \node at (0.5,-0.1) {|\textcolor{blue}{\cs{captiontext*}\csmarg{}}|};|\\
+% | \end{tikzpicture}|\\
+% | \end{subcaptiongroup}|\\
+% | \captionsetup{subrefformat=parens}|\\
+% | \caption{Two animals: \subref{cat} a huge cat,|\\
+% | and \subref{elephant} an elephant}|\\
+% |\end{figure}|
+% \end{quote}
+%
+% \noindent\begin{minipage}{\linewidth}
+% \captionsetup{type=figure}
+% \centering
+% \begin{subcaptiongroup}
+% \subcaptionlistentry{A cat}\label{cat7.3}
+% \begin{tikzpicture}
+% \node (cat) at (0,0) {\includegraphics[width=60pt]{cat}};
+% \node at (0.1,-0.1) {\captiontext*{}};
+% \end{tikzpicture}
+% \subcaptionlistentry{An elephant}\label{elephant7.3}
+% \begin{tikzpicture}
+% \node (cat) at (0,0) {\includegraphics[width=140pt]{elephant}};
+% \node at (0.5,-0.1) {\captiontext*{}};
+% \end{tikzpicture}
+% \end{subcaptiongroup}
+% \captionsetup{subrefformat=parens}
+% \caption{Two animals: \subref{cat7.3} a huge cat, and \subref{elephant7.3} an elephant}
+% \end{minipage}
+%
+% \bigskip
+%
+% \pagebreak[3]
+% If neither a reference to the sub-figures nor an entry in the List of Figures is needed,
+% this code could be simpified to:
+% \begin{quote}
+% |\usepackage{tikz}|\\
+% \ldots\\
+% |\begin{figure}|\\
+% | \centering|\\
+% | \begin{tikzpicture}|\\
+% | \node (cat) at (0,0)|\\
+% | {\includegraphics[width=60pt]{cat}};|\\
+% | \node at (0.1,-0.1) {|\textcolor{blue}{\cs{subcaptiontext*}\csoarg{1}\csmarg{}}|};|\\
+% | \end{tikzpicture}|\\
+% | \begin{tikzpicture}|\\
+% | \node (elephant) at (0,0)|\\
+% | {\includegraphics[width=140pt]{elephant}};|\\
+% | \node at (0.5,-0.1) {|\textcolor{blue}{\cs{subcaptiontext*}\csoarg{2}\csmarg{}}|};|\\
+% | \end{tikzpicture}|\\
+% | \caption{Two animals: A huge cat and an elephant}|\\
+% |\end{figure}|
+% \end{quote}
+%
+% \pagebreak[3]
+% \subsection{Using the skip and margin options}
+% For a particular sub-caption the |skip=|\ldots could be set to a negative value so it will overlap with the image.
+% Combined with |singlelinecheck=off| (to switch off the centering of short captions) and |margin=|\ldots it could be placed
+% at a specific horizontal position within the image, too.
+%
+% \pagebreak[3]
+% The same example as in section \Ref{without}, but using the |skip=|\ldots and |margin=|\ldots options:
+% \begin{quote}
+% |\begin{figure}|\\
+% | \centering|\\
+% | \captionsetup[subfigure]|\\
+% | {skip=-28pt,slc=off,margin={25pt,0pt}}|\\
+% | \subcaptionbox{\label{cat}}|\\
+% | {\includegraphics[width=60pt]{cat}}|\\
+% | \captionsetup[subfigure]|\\
+% | {skip=-60pt,slc=off,margin={80pt,0pt}}|\\
+% | \subcaptionbox{\label{elephant}}|\\
+% | {\includegraphics[width=140pt]{elephant}}|\\
+% | \captionsetup{subrefformat=parens}|\\
+% | \caption{Two animals: \subref{cat} a huge cat,|\\
+% | and \subref{elephant} an elephant}|\\
+% |\end{figure}|
+% \end{quote}
+%
+% \noindent\begin{minipage}{\linewidth}
+% \captionsetup{type=figure}
+% \centering
+% \captionsetup[subfigure]{skip=-28pt,slc=off,margin={25pt,0pt}}
+% \subcaptionbox{\label{cat7.4}}{\includegraphics[width=60pt]{cat}}
+% \captionsetup[subfigure]{skip=-60pt,slc=off,margin={80pt,0pt}}
+% \subcaptionbox{\label{elephant7.4}}{\includegraphics[width=140pt]{elephant}}
+% \captionsetup{subrefformat=parens}
+% \caption{Two animals: \subref{cat7.4} a huge cat, and \subref{elephant7.4} an elephant}
+% \end{minipage}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \PageBreak
+% \section{Numbering}
+%
+% \subsection{Pittfall \#1: Using multiple main captions}
+%
+% When multiple main captions are used within a figure or table, and sub-captions
+% are used as well, how does the \pkg{subcaption} package know which
+% sub-captions belong to which caption, i.e. what is the main counter value for
+% the sub-captions?
+%
+% \pagebreak[3]
+% Let's illustrate this problem with an example document:
+% \begin{quote}
+% |\documentclass{article}|\\
+% |\usepackage{graphicx,subcaption}|\\
+% |\begin{document}|\\
+% |\begin{figure}|\\
+% | \centering|\\
+% | \includegraphics[width=4cm]{example-image-c}|\\
+% | \caption{Caption no. 1}|\\
+% | \bigskip|\\
+% | \subcaptionbox|\\
+% | {\label{fig:2a}}|\\
+% | {\includegraphics[width=2cm]{example-image-a}}|\\
+% | \subcaptionbox|\\
+% | {\label{fig:2b}}|\\
+% | {\includegraphics[width=2cm]{example-image-b}}|\\
+% | \caption{Caption no. 2}|\\
+% |\end{figure}|\\
+% |Look at sub-figures \ref{fig:2a} and \ref{fig:2b}.|\\
+% |\end{document}|
+% \end{quote}
+%
+% It's obvious that the sub-captions belong to 2nd caption, and therefore
+% |\ref{fig:2a}| will become ``2a'', isn't it?
+% But since the \pkg{subcaption} package is only involved when using
+% \LaTeX\ commands either defined or patched by the \pkg{caption} or
+% \pkg{subcaption} package, this is what the \pkg{caption} package
+% is aware of:
+% \begin{quote}
+% |\usepackage{subcaption}|\\
+% |\begin{document}|\\
+% |\begin{figure}|\\
+% | \caption{Caption no. 1}|\\
+% | \subcaptionbox|\\
+% | {\label{fig:2a}}|\\
+% | {|\meta{unknown content}|}|\\
+% | \subcaptionbox|\\
+% | {\label{fig:2b}}|\\
+% | {|\meta{unknown content}|}|\\
+% | \caption{Caption no. 2}|\\
+% |\end{figure}|\\
+% |\end{document}|
+% \end{quote}
+%
+% So from \pkg{caption}s point of view it's not easy to decide if the
+% sub-captions belong to the 1st or 2nd main caption since they are placed
+% between them. (Note: The \pkg{subcaption} package is only offering
+% an user interface to the sub-caption feature of the \pkg{caption} package,
+% and therefore this decision is the responsibility of the \pkg{caption} package.)
+%
+% But how does the \pkg{caption} package makes a decision?
+% If in doubt, it rather clings to the past than to the future, i.e.~in this
+% case it decides that the sub-captions belong to the 1st caption and therefore
+% the result of |\ref{fig:2a}| is not ``2a'' but ``1a''.
+% If the \pkg{caption} package is unsure about its decision (like in this
+% case), a warning will be issued:
+% \begingroup
+% \leftmargini=12pt
+% \begin{quote}
+% |Package caption Warning: Ambiguous sub-caption(s),|\\
+% | use \nextfloat on input line 15.|\\
+% |See the caption package documentation for explanation.|
+% \end{quote}
+% \endgroup
+%
+% \pagebreak[3]
+% How to fix it? Use |\next|\-|float| to tell the \pkg{caption} package
+% where the 2nd figure within the |figure| environment starts:
+% \begin{quote}
+% |\documentclass{article}|\\
+% |\usepackage{graphicx,subcaption}|\\
+% |\begin{document}|\\
+% |\begin{figure}|\\
+% | \centering|\\
+% | \includegraphics[width=4cm]{example-image-c}|\\
+% | \caption{Caption no. 1}|\\
+% | \bigskip|\\
+% ||\textcolor{blue}{\cs{nextfloat}}\\
+% | \subcaptionbox|\\
+% | {\label{fig:2a}}|\\
+% | {\includegraphics[width=2cm]{example-image-a}}|\\
+% | \subcaptionbox|\\
+% | {\label{fig:2b}}|\\
+% | {\includegraphics[width=2cm]{example-image-b}}|\\
+% | \caption{Caption no. 2}|\\
+% |\end{figure}|\\
+% |Look at sub-figures \ref{fig:2a} and \ref{fig:2b}.|\\
+% |\end{document}|
+% \end{quote}
+%
+% \INFO
+% Note that the |\next|\-|float| command was introduced in \pkg{caption} package
+% \version{3.6}.
+% Previous versions of the \pkg{caption} package have bound the decision to the
+% |position=| setting of the floating environment instead, i.e.~sub-captions belonged to
+% the caption above if |position=top| was set and they belonged to the caption below
+% if |position=below| was set.
+% While this would be beneficial in this case, there were several cases were it was not
+% and especially it was not always comprehensible to the user why his references got an
+% incorrect numbering.
+%
+% Furthermore the new decision algorithm always succeeds if there is only one caption
+% within the figure or table (which is the case most of the time) while the old one did not.
+%
+% \pagebreak[3]
+% If you still prefer the old decision algorithm (for example because you want to process
+% an already existing document), you need to specify the \pkg{caption} package version
+% explicitly, for example:
+% \begin{quote}
+% |\documentclass{article}|\\
+% |\usepackage{caption}[=v3.5]|\\
+% |\usepackage{graphicx,subcaption}|\\
+% \ldots
+% \end{quote}
+%
+% See also: \Ref{sec:caption}
+%
+% \subsection{Pittfall \#2: Expecting \cs{caption} to increment the counter}
+%
+% \pagebreak[3]
+% Usually |\caption| increments the figure resp.~table counter and therefore
+% it is usally safe to assume that the counter was not incremented yet in code
+% used before |\caption|:
+% \begin{quote}
+% |\documentclass{article}|\\
+% |\begin{document}|\\
+% |\begin{figure}|\\
+% | Figure counter before caption: \thefigure|\\
+% | \caption{Some text}|\\
+% | Figure counter after caption: \thefigure|\\
+% |\end{figure}|\\
+% |\end{document}|
+% \end{quote}
+%
+% Unsurprisingly the results are 0 and 1 for the counter values.
+%
+% \pagebreak[3]
+% But this happens if we use the \pkg{subcaption} package:
+% \begin{quote}
+% |\documentclass{article}|\\
+% |\usepackage{subcaption}|\\
+% |\begin{document}|\\
+% |\begin{figure}|\\
+% | \subcaptionbox{}{some content}|\\
+% | \subcaptionbox{}{some content}|\\
+% | Figure counter before caption: \thefigure|\\
+% | \caption{Some text}|\\
+% | Figure counter after caption: \thefigure|\\
+% |\end{figure}|\\
+% |\end{document}|
+% \end{quote}
+%
+% Here the results are 1 and 1 for the counter values. Why?
+%
+% Since the \pkg{caption} package assumes that there will be a |\caption|
+% following |\sub|\-|caption|\-|box| it decides that the sub-captions belong
+% to the upcoming main caption and therefore share the same main counter value
+% which needs to be incremented before its use.
+% Therefore the first |\sub|\-|caption|\-|box| in the figure increments the
+% figure counter while the second one and especially the |\caption| does not.
+%
+% Usually this is no problem at all but keep this in mind if you are doing
+% tricky stuff with the figure resp.~table counter within figures resp.~tables.
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \PageBreak
+% \section{Abbreviatory commands}
+% \label{subcaption}
+%
+% \DescribeMacro\subcaption
+% \DescribeMacro\phantomsubcaption
+% \DescribeMacro\subcaptionlistentry
+% \DescribeMacro\subcaptiontext
+% \hskip1pt %^^A work-around for bug in \DescribeMacro to prevent red colored margin note
+% As we have seen in sections {\Ref{overpic}, \Ref{stackengine}, and \Ref{tikz}}
+% it's sometimes inconvenient to use the commands and environments
+% described so far.
+%
+% \pagebreak[3]
+% For example it would be inconvenient to use \env{captiongroup} just for
+% a single |\caption|\-|text| in this particular case:
+% \begin{quote}
+% \ldots\\
+% |\begin{overpic}[width=60pt]{cat}|\\
+% | \put(40,34)|\\
+% | {\begin{captiongroup*}|\\
+% | \captiontext*[1]{}|\\
+% | \end{captiongroup*}}|\\
+% |\end{overpic}|\\
+% \ldots
+% \end{quote}
+%
+% \pagebreak[3]
+% Since |\caption|\-|text| is already used in an extra environment (|overpic|)
+% we don't need an extra |caption|\-|group*| here,
+% instead using |\set|\-|caption|\-|sub|\-|type*| (which switches into the
+% sub-caption mode without making an \pkg{hyperref} anchor) would be sufficient:
+% \begin{quote}
+% \ldots\\
+% |\begin{overpic}[width=60pt]{cat}|\\
+% | \put(40,34)|\\
+% | {\setcaptionsubtype*|\\
+% | \captiontext*[1]{}}|\\
+% |\end{overpic}|\\
+% \ldots
+% \end{quote}
+%
+% \pagebreak[3]
+% But this is still inconvenient when used many times, and therefore \thispackage\ defines
+% several extra commands which are prefixed with |\set|\-|caption|\-|sub|\-|type*|:
+%
+% \medskip
+%
+% \begin{minipage}{\textwidth}
+% \centering
+% \begin{tabular}{l|l|l}
+% Regular command & with \cs{setcaptionsubtype*} & available since \\
+% \hline
+% |\caption| & |\subcaption| & \version{1.0} \\
+% |\phantomcaption| & |\phantomsubcaption| & \version{1.1} \\
+% |\captionlistentry| & |\subcaptionlistentry| & \version{1.5} \\
+% |\captiontext| & |\subcaptiontext| & \version{1.5} \\
+% \end{tabular}
+% \end{minipage}
+%
+% \bigskip
%
% \pagebreak[3]
+% This way our code snipped above could be simplified to:
+% \begin{quote}
+% \ldots\\
+% |\begin{overpic}[width=60pt]{cat}|\\
+% | \put(40,34){\subcaptiontext*[1]{}}|\\
+% |\end{overpic}|\\
+% \ldots
+% \end{quote}
+%
+% \INFO
+% Since |\set|\-|caption|\-|sub|\-|type| should only be used within an
+% extra group or environment, the same applies to these commands as well.
+% (In this case |\sub|\-|caption|\-|text| is encapsulated by the
+% |overpic| environment, so we are ok here.
+%
+% \begin{background}
+% The |\sub|\-|caption| command is just a simple combination of
+% |\set|\-|caption|\-|sub|\-|type*| and |\caption|. Same for all other
+% abbreviatory commands here.
+% \end{background}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \PageBreak
% \section{The \cs{subfloat} command}
% \label{subfloat}
%
% \DescribeMacro\subfloat
-% \NEWfeature{v1.3}
-% To allow a smoother transition from the \package{subfig} package
-% (which is unmaintained for over 14 years)
+% \NEWfeature*{v1.3}
+% To allow a smoother transition from the \pkg{subfig} package~\cite{subfig}
+% (which is unmaintained for over 16 years)
% this package also offers |\sub|\-|float| with the same syntax:
% \begin{quote}
% |\subfloat|\oarg{list\_entry}\oarg{sub-caption}\marg{body}
@@ -797,24 +1566,55 @@
% --------------------------------------------------------------------------- %
% \fi
%
+% \section{Required packages}
+% \label{sec:caption}
+%
+% \NEWfeature{v1.4}
+% Starting with version $1.4$ the \pkg{subcaption} package requires at least version $3.1$
+% of the \pkg{caption} package and loads it automatically.
+% (Older versions of the \pkg{subcaption} package have required exactly the version of the
+% \pkg{caption} package which was released with it.)
+%
% \pagebreak[3]
+% If you need to use a specific version of the \pkg{caption} package you need to load it
+% \emph{before} the \pkg{subcaption} package, e.g.:
+% \begin{quote}
+% |\usepackage[| \ldots |]{caption}[=v3.5]|\\
+% |\usepackage[| \ldots |]{subcaption}|
+% \end{quote}
+%
+% \pagebreak[3]
+% Note that there are limitations if an older version of the \pkg{caption} package
+% is used:
+% \begin{itemize}
+% \item The |\phantomsubcaption| command need at least \pkg{caption} \version{3.2}.
+% \item The |\subcaptionlistentry| command need at least \pkg{caption} \version{3.3}.
+% \item The |\subcaptiontext| command need at least \pkg{caption} \version{3.6}.
+% \item The |\subfloat| emulation needs at least \pkg{caption} \version{3.4}.
+% \end{itemize}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \PageBreak
% \section{Beyond this package}
% \label{keyfloat}\label{floatrow}
%
% For a more advanced usage of the sub-caption feature of the
-% \package{caption} package, please take a look at the excellent
-% \package{keyfloat} package\cite{keyfloat} which provides the environments
+% \pkg{caption} package, please take a look at the excellent
+% \pkg{keyfloat} package\cite{keyfloat} which provides the environments
% |key|\-|sub|\-|figs|, |key|\-|sub|\-|tabs|, and |key|\-|sub|\-|floats| for
% typesetting sub-figures and sub-tables.
%
-% Furthermore the \package{floatrow} package\cite{floatrow} provides the
+% Furthermore the \pkg{floatrow} package\cite{floatrow} provides the
% |sub|\-|float|\-|row| environment for typesetting sub-figures.
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
-% \pagebreak[3]
+% \PageBreak
% \section{Thanks}
%
% I would like to thank
@@ -827,37 +1627,66 @@
%
% \StopEventually{%^^A
% \begin{thebibliography}{9}
+%
% \bibitem{TLC2}
% Frank Mittelbach and Michel Goossens:\\
-% \newblock {\em The {\LaTeX} Companion (2nd.~Ed.)},
+% \newblock {\em The {\LaTeX} Companion (2nd.~Ed.)},\\
% \newblock Addison-Wesley, 2004.
+%
+% \bibitem{caption}
+% Axel Sommerfeldt:\\
+% \href{http://www.ctan.org/pkg/caption}%
+% {\emph{Customizing captions of floating environments}},\\
+% 2022/01/07
+%
% \bibitem{floatrow}
% Olga Lapko:\\
% \href{http://www.ctan.org/pkg/floatrow}%
-% {\emph{The floatrow package documentation}},
+% {\emph{The floatrow package documentation}},\\
% 2007/12/24
+%
% \bibitem{hyperref}
% Sebastian Rahtz \& Heiko Oberdiek:\\
% \href{http://www.ctan.org/pkg/hyperref}%
-% {\emph{Hypertext marks in \LaTeX}},
+% {\emph{Hypertext marks in \LaTeX}},\\
% November 12, 2007
+%
% \bibitem{hypcap}
% Heiko Oberdiek:\\
% \href{http://www.ctan.org/pkg/hypcap}%
-% {\emph{The hypcap package -- Adjusting anchors of captions}},
+% {\emph{The hypcap package -- Adjusting anchors of captions}},\\
% 2007/04/09
+%
% \bibitem{keyfloat}
% Brian Duun:\\
% \href{http://www.ctan.org/pkg/keyfloat}%
-% {\emph{The \LaTeX\ keyfloat Package}},
+% {\emph{The \LaTeX\ keyfloat Package}},\\
% 2019/09/23
-% \iffalse
+%
+% \bibitem{overpic}
+% Rolf Niepraschk:\\
+% \href{http://www.ctan.org/pkg/overpic}%
+% {\emph{The overpic package}},\\
+% 2020/02/22
+%
+% \bibitem{stackengine}
+% Steven B. Segletes:\\
+% \href{http://www.ctan.org/pkg/stackengine}%
+% {\emph{The stackengine Package}},\\
+% July 22, 2021
+%
+% \bibitem{tikz}
+% Till Tantau:\\
+% \href{http://www.ctan.org/pkg/tikz}%
+% {\emph{The TikZ and PGF Packages}},\\
+% May 15, 2021
+%
% \bibitem{subfig}
% Steven D. Cochran:\\
% \href{http://www.ctan.org/pkg/subfig}%
-% {\emph{The subfig package}},
+% {\emph{The subfig package}},\\
% 2005/07/05
-% \fi
+%
% \end{thebibliography}
% }
%
@@ -887,6 +1716,7 @@
% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\kernel@ifnextchar}
% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
@@ -914,7 +1744,7 @@
% \setlength{\parskip}{0pt plus 1pt}
% \changes{v0.1}{2007/09/01}{First demo}
% \changes{v0.2}{2007/11/11}{\cs{subcaptionbox} added}
-% \changes{v0.3}{2007/12/06}{Adapted to \package{caption} package \version{3.1f}}
+% \changes{v0.3}{2007/12/06}{Adapted to \pkg{caption} package \version{3.1f}}
% \changes{v1.0}{2008/03/16}{\cs{subfloat} added}
% \changes{v1.0}{2010/10/27}{An error message will be issued when the subfigure or subfig package is loaded}
% \changes{v1.0}{2011/01/22}{Undocumented command \cs{subfloat} removed}
@@ -927,23 +1757,51 @@
%
% \clearpage
% \section{The implementation}
+%
% \iffalse
%<*package>
% \fi
%
% \subsection{Identification}
%
+% We need at least \LaTeX2e\ version 1994/12/01.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{subcaption}[2020/10/07 v1.3j Sub-captions (AR)]
+% \end{macrocode}
+%
+% Bypass the release declarations in case the \LaTeX\ kernel doesn’t know how to deal with them
+% (as suggested by \url{https://www.latex-project.org/publications/2018-FMi-TUB-tb122mitt-version-rollback.pdf}).
+% \begin{macrocode}
+\providecommand\DeclareRelease[3]{}
+\providecommand\DeclareCurrentRelease[2]{}
+% \end{macrocode}
+%
+% Declare all supported releases.
+% \begin{macrocode}
+\DeclareCurrentRelease{v1}{2007/12/06}
+% \end{macrocode}
+%
+% Identify the current version of the package.
+% \begin{macrocode}
+\ProvidesPackage{subcaption}[2022/01/07 v1.5 Sub-captions (AR)]
+% \end{macrocode}
+%
+% Since we base on the \pkg{caption} package we load it here.
+% \begin{macrocode}
+\RequirePackage{caption}[2010/01/09] % we need at least v3.1m
% \end{macrocode}
%
% \subsection{Initial code}
%
-% Since we base on the \package{caption} package we load it here.
+% \begin{macro}{\subcaption@Warning}
+% \changes{v1.5}{2022/01/06}{This macro added}
+% |\subcaption@Warning|\marg{message}\\
+% issues an warning message (with code line indication).
% \begin{macrocode}
-\RequirePackage{caption}[2020/09/28] % needs v3.5c or newer
+\newcommand*\subcaption@Warning{%
+ \PackageWarning{subcaption}}
% \end{macrocode}
+% \end{macro}
%
% \begin{macro}{\subcaption@Error}
% \changes{v1.3h}{2020/09/28}{This macro added}
@@ -953,25 +1811,34 @@
\newcommand*\subcaption@Error[1]{%
\PackageError{subcaption}{#1}{\caption@@eh{subcaption}}}
% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\caption@@eh[1]{%
+ If you do not understand this error, please take a closer look\MessageBreak
+ at the documentation of the `#1' package, especially the\MessageBreak
+ section about errors.\MessageBreak\@ehc}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\subcaption@OutsideFloat}
+% \changes{v1.5}{2022/01/07}{This macro definition added}
+% |\subcaption@OutsideFloat}| issues a ``\meta{command} outside float'' error.
+% \begin{macrocode}
+\newcommand*\subcaption@OutsideFloat[1]{%
+ \subcaption@Error{\string#1 outside float}}
+% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subcaption@CheckCompatibility}
% \changes{v1.1}{2011/09/01}{Compatibility error added}
-% \changes{v1.1}{2016/05/22}{The presence of \package{subfigure} or \package{subfig} will be checked \cs{AtBeginDocument}, too}
-% \changes{v1.3g}{2020/08/01}{Error text adapted to \package{caption} package~\version{4.0}}
+% \changes{v1.1}{2016/05/22}{The presence of \pkg{subfigure} or \pkg{subfig} will be checked \cs{AtBeginDocument}, too}
+% \changes{v1.3g}{2020/08/01}{Error text adapted to \pkg{caption} package~\version{4.0}}
+% \changes{v1.4}{2020/12/22}{Adapted to fallback concept}
% Since we are incompatible to them an error message will be issued when
-% the \package{subfigure} or \package{subfig} package is loaded.
+% the \pkg{subfigure} or \pkg{subfig} package is loaded.
% \begin{macrocode}
\newcommand*\subcaption@CheckCompatibility{%
% \end{macrocode}
% \begin{macrocode}
- \caption@ifcompatibility{%
- \subcaption@Error
- {This package does not work with\MessageBreak
- caption option `compatibility=v1'}%
- \endinput}{}%
-% \end{macrocode}
-% \begin{macrocode}
\@ifpackageloaded{subfigure}{%
\subcaption@Error
{This package can't be used in cooperation\MessageBreak
@@ -998,87 +1865,71 @@
%
% \subsection{Main code}
%
-% \pagebreak[3]
-% \subsubsection{The \cs{subcaption} command}
-%
-% \begin{macro}{\subcaption}
-% \changes{v1.1}{2012/04/06}{\cs{newcommand} changed to \cs{def} so it works with the \package{memoir} document class, too}
-% \changes{v1.3h}{2020/09/28}{Usage of \cs{caption@Error} replaced by \cs{subcaption@Error}}
-% Without a prefacing |\set|\-|caption|\-|sub|\-|type|, |\sub|\-|caption| is some kind
-% of |\caption|\-|of{sub|\-|\@cap|\-|type}|.
-% \Note{Like \cs{captionof}, this command is designed to be used inside an
-% own group!}
+% \begin{macro}{\setcaptionsubtype}
+% \changes{v1.4}{2020/12/24}{This macro definition added}
+% \changes{v1.5}{2022/01/07}{Check added if used inside a floating environment}
+% |\setcaptionsubtype| is available since \pkg{caption} package \version{3.2},
+% so we need to define it first if only an older version is loaded (in fallback mode).
% \begin{macrocode}
-\def\subcaption{%
+\providecommand\setcaptionsubtype{%
\caption@iftype
- {\setcaptionsubtype*\caption}%
- {\subcaption@Error{\noexpand\subcaption outside float}%
- \caption@gobble}}%
-% \end{macrocode}
-% But with a prefacing |\set|\-|caption|\-|sub|\-|type|, |\sub|\-|caption| is simply
-% |\caption|.
-% \begin{macrocode}
-\g@addto@macro\caption@subtypehook{%
- \let\subcaption\caption}
+ {\@ifstar{\captionsetup{subtype*}}{\captionsetup{subtype}}}%
+ {\subcaption@OutsideFloat\setcaptionsubtype}}
% \end{macrocode}
% \end{macro}
%
-% \pagebreak[3]
-% \subsubsection{The \cs{phantomsubcaption} command}
+% \subsubsection{The \env{subcaptiongroup} environment}
%
-% \begin{macro}{\phantomsubcaption}
-% \changes{v1.1}{2011/08/17}{This macro added}
-% \changes{v1.3h}{2020/09/28}{Usage of \cs{caption@Error} replaced by \cs{subcaption@Error}}
-% Same as |\phantom|\-|caption|, but for subfigures.
+% \begin{environment}{subcaptiongroup}
+% \changes{v1.5}{2022/01/07}{This environment definition added}
+% \env{subcaptiongroup} is the simplest of all environments or commands this package has to offer.
+% It's simply an environment containing |\set|\-|caption|\-|sub|\-|type|, that's all.
+% A starred variant of this environment is available, too, which uses |\set|\-|caption|\-|sub|\-|type*|.
% \begin{macrocode}
-\newcommand*\phantomsubcaption{%
- \caption@iftype
- {\setcaptionsubtype*\phantomcaption}%
- {\subcaption@Error{\noexpand\phantomsubcaption outside float}}}%
+\newenvironment{subcaptiongroup}
+ {\caption@iftype
+ {\setcaptionsubtype\relax}%
+ {\subcaption@OutsideFloat{subcaptiongroup}}}
+ {}
% \end{macrocode}
% \begin{macrocode}
-\g@addto@macro\caption@subtypehook{%
- \let\phantomsubcaption\phantomcaption}
+\newenvironment{subcaptiongroup*}
+ {\caption@iftype
+ {\setcaptionsubtype*}%
+ {\subcaption@OutsideFloat{subcaptiongroup*}}}
+ {}
% \end{macrocode}
-% \end{macro}
+% \end{environment}
%
-% \pagebreak[3]
-% \subsubsection{The subfigure \& subtable environments}
+% \subsubsection{The \env{subcaptionblock} environment (and aliases)}
%
-% \begin{macro}{subfigure}
-% \begin{macro}{subtable}
+% \begin{macro}{\subcaption@minipage}
% \changes{v1.2}{2016/02/21}{Optional argument values `B' and `T' added}
% \changes{v1.3d}{2020/01/22}{Definition and usage of \cs{@subfloatboxreset} added}
-% \changes{v1.3e}{2020/07/29}{Uses \cs{ForEachCaptionSubType} (instead of \cs{caption@For}) to define the environments now}
-% This is just an ordinary \env{minipage} environment with
-% |\setcaptionsubtype| as first contents line.
-% It will be defined using the helper macro |\For|\-|Each|\-|Caption|\-|Sub|\-|Type|
-% offered by the \package{caption} kernel, so for every caption sub-type
-% declared with |\Declare|\-|Caption|\-|Sub|\-|Type| a corresponding
-% `sub' environment will be defined automatically.
-% \begin{macrocode}
-\ForEachCaptionSubType{%
- \newenvironment{#1}%
- {\@ifnextchar[%]
- \subcaption@iminipage
- {\subcaption@iminipage[c]}}%
- {\subcaption@endminipage
- \endminipage}}
+% \changes{v1.5}{2022/01/07}{This macro definition out-sourced from \cs{subcaption@newminipage}}
+% \changes{v1.5}{2022/01/07}{Usage of \cs{@ifnextchar} replaced by \cs{@testopt}}
+% \changes{v1.5}{2022/01/07}{Default value of \meta{outer-pos} changes from `c' to `b'}
+% This is a \env{minipage} with |\set|\-|caption|\-|sub|\-|type| as first contents line.
+% \begin{macrocode}
+\newcommand*\subcaption@minipage{%
+ \@testopt\subcaption@iminipage b}
% \end{macrocode}
% We pass all other optional arguments using the generic helper macro
-% |\caption@with|\-|opt|\-|args| offered by the \package{caption} kernel).
+% |\caption@with|\-|opt|\-|args| offered by the \pkg{caption} kernel).
% \begin{macrocode}
\def\subcaption@iminipage[#1]{%
- \caption@withoptargs{\subcaption@iiminipage{#1}}}
+% \caption@withoptargs{\subcaption@iiminipage{#1}}} % would need at least caption3 v1.5
+ \def\subcaption@tempa{\subcaption@iiminipage{#1}}%
+ \caption@withoptargs\subcaption@tempa}
% \end{macrocode}
% `B' and `T' will add a |\vspace{0pt}|, all other values (and additional
% optional arguments) will be passed unseen to the |minipage| environment.
% \begin{macrocode}
\newcommand*\subcaption@iiminipage[3]{%
- \let\subcaption@endminipage\@empty
+ \let\subcaption@endminipage@hook\@empty
\if#1B%
\minipage[b]#2{#3}%
- \def\subcaption@endminipage{\vspace{0pt}}%
+ \def\subcaption@endminipage@hook{\vspace{0pt}}%
\else\if#1T%
\minipage[t]#2{#3}%
\vspace{0pt}%
@@ -1089,31 +1940,170 @@
\setcaptionsubtype\relax}
% \end{macrocode}
% \begin{macrocode}
+\newcommand*\subcaption@endminipage{%
+ \subcaption@endminipage@hook
+ \endminipage}
+% \end{macrocode}
+% \begin{macrocode}
\providecommand*\@subfloatboxreset{}
% \end{macrocode}
% \end{macro}
+%
+% \begin{environment}{subcaptionblock}
+% \changes{v1.5}{2022/01/07}{This environment definition added}
+% \env{subcaptionblock} is a \env{minipage} with |\set|\-|caption|\-|sub|\-|type| as first contents line.
+% \begin{macrocode}
+\newenvironment{subcaptionblock}{\subcaption@minipage}{\subcaption@endminipage}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\subcaption@newminipage}
+% \changes{v1.4d}{2022/01/04}{Test of environment name added, should match `sub\cs{@captype}'}
+% \changes{v1.5}{2022/01/06}{Test of environment name revised, results in a warning now instead of an error}
+% \changes{v1.5}{2022/01/07}{This command renamed from \cs{subcaption@newenvironment} to \cs{subcaption@newminipage} and revised}
+% |\subcaption@newminipage|\marg{name of new environment}\\
+% defines a new environment containing |\sub|\-|caption@mini|\-|page| and |\sub|\-|caption@end|\-|mini|\-|page|.
+% Furthermore a test will be included which checks if the environment name matches |sub\@captype|.
+% \begin{macrocode}
+\newcommand*\subcaption@newminipage[1]{%
+ \newenvironment{#1}{\subcaption@minipage@{#1}}{\subcaption@endminipage}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\subcaption@minipage@[1]{%
+ \caption@iftype
+ {\edef\caption@tempa{#1}%
+ \edef\caption@tempb{sub\@captype}%
+ \ifx\caption@tempa\caption@tempb \else
+ \subcaption@Warning{%
+ `\caption@tempa' is treated as `\caption@tempb'\MessageBreak}%
+ \fi}%
+ {\subcaption@OutsideFloat{#1}}%
+ \subcaption@minipage}
+% \end{macrocode}
% \end{macro}
%
-% \pagebreak[3]
+% \begin{environment}{subfigure}
+% \begin{environment}{subtable}
+% \changes{v1.3e}{2020/07/29}{Uses \cs{ForEachCaptionSubType} (instead of \cs{caption@For}) to define the environments now}
+% The sub-environments will be defined using the helper macro |\For|\-|Each|\-|Caption|\-|Sub|\-|Type|
+% offered by the \pkg{caption} kernel v1.13 (2020/07/29), so for every caption sub-type
+% declared with |\Declare|\-|Caption|\-|Sub|\-|Type| a corresponding `sub' environment will be defined automatically.
+% (If the \pkg{caption} kernel v1.13 is not available we use \cs{caption@For} as fallback.)
+% \begin{macrocode}
+\@ifundefined{ForEachCaptionSubType} % caption3 v1.13
+ {\caption@For{subtypelist}{\subcaption@newminipage{sub#1}}}
+ {\ForEachCaptionSubType{\subcaption@newminipage{#1}}}
+% \end{macrocode}
+% \end{environment}
+% \end{environment}
+%
% \subsubsection{The \cs{subcaptionbox} command}
%
% \begin{macro}{\subcaptionbox}
-% \changes{v1.0}{2008/05/06}{Adapted to the \opt{rule} option of the \package{caption} package}
+% \changes{v1.0}{2008/05/06}{Adapted to the \opt{rule} option of the \pkg{caption} package}
% \changes{v1.0}{2008/08/31}{Definition and usage of \cs{subcaption@hrule} added}
% \changes{v1.0}{2010/12/17}{Uses \cs{caption@box} now}
% \changes{v1.1}{2011/08/16}{Adapted to actual version of \cs{caption@box}}
% \changes{v1.1}{2012/04/09}{Adapted to actual version of \cs{caption@ibox}}
-% A |\parbox| with contents and sub-caption, separated by an invisible |\hrule|.
+% \changes{v1.4}{2020/12/24}{Fallback definition of \cs{caption@ibox} added}
+% A |\parbox| with contents and sub-caption, separated by an invisible |\hrule|.\par
+% The code of this macro was moved to the \pkg{caption} package \version{3.2}
+% (so it could offer it as |\caption|\-|box| as well), so since then it's
+% sufficient to simply use |\caption@ibox| here.\par
+% But if only \pkg{caption} package \version{3.1} is available (since the user
+% decided to use this particular fallback version), we still must define the code
+% on our own.
+% \begin{macrocode}
+\@ifundefined{caption@ibox}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\subcaptionbox{% caption v3.1
+ \def\subcaption@tempa{\caption@ibox\setcaptionsubtype\relax}%
+ \caption@withoptargs\subcaption@tempa}
+% \end{macrocode}
% \begin{macrocode}
-\newcommand*\subcaptionbox{%
- \caption@withoptargs{\caption@ibox\setcaptionsubtype}}
+ \newcommand\caption@ibox[3]{%
+ \kernel@ifnextchar[%]
+ {\caption@iibox{#1}{#2}{#3}}%
+ {\caption@iibox@{#1}{#2}{#3}}}
+% \end{macrocode}
+% \begin{macrocode}
+ \long\def\caption@iibox#1#2#3[#4]{%
+ \@testopt{\caption@iiibox{#1}{#2}{#3}[{#4}]}\captionbox@innerpos@default}
+% \end{macrocode}
+% \begin{macrocode}
+ \long\def\caption@iibox@#1#2#3#4{%
+ \setbox\@tempboxa\hbox{#4}%
+ \caption@iiibox{#1}{#2}{#3}%
+ [\wd\@tempboxa]%
+ [\captionbox@innerpos@default]%
+ {\unhbox\@tempboxa}}
+% \end{macrocode}
+% \begin{macrocode}
+ \long\def\caption@iiibox#1{%
+ \caption@iiiibox{#1}\vbox\vtop}
+% \end{macrocode}
+% \begin{macrocode}
+ \long\def\caption@iiiibox#1#2#3#4#5[#6][#7]#8{%
+ \@ifundefined{caption@hj@#7}%
+ {\subcaption@Error{Undefined justification `#7'}\@gobble}%
+ {\@firstofone}%
+ {\begingroup
+ #1*% set \caption@position so \caption@iftop expands correctly
+ \caption@iftop{%
+ \endgroup
+ \parbox[t]{#6}{%
+ #1\relax
+ \caption@setposition t%
+ #2{\caption#4{#5}}%
+ \captionbox@hrule
+ \csname caption@hj@#7\endcsname
+ #8}%
+ }{%
+ \endgroup
+ \parbox[b]{#6}{%
+ #1\relax
+ \caption@setposition b%
+ \csname caption@hj@#7\endcsname
+ #8%
+ \captionbox@hrule
+ #3{\caption#4{#5}}}%
+ }}}
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\captionbox@innerpos@default{c}
+ \newcommand*\captionbox@hrule{\hrule\@height\z@\relax}
+% \end{macrocode}
+% \begin{macrocode}
+ \providecommand*\caption@hj@c{\centering}
+ \providecommand*\caption@hj@l{\raggedright}
+ \providecommand*\caption@hj@r{\raggedleft}
+ \providecommand*\caption@hj@s{}
+% \end{macrocode}
+% \begin{macrocode}
+}{\@ifundefined{caption@iiibox}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\subcaptionbox{% caption v3.2
+ \def\captionbox@type{subtype}%
+ \let\captionbox@settype\setcaptionsubtype
+ \caption@withoptargs\caption@box}
+% \end{macrocode}
+% \begin{macrocode}
+}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\subcaptionbox{% caption >= v3.3
+ \caption@withoptargs{\caption@ibox\setcaptionsubtype}}
+% \end{macrocode}
+% \begin{macrocode}
+}}
% \end{macrocode}
% \end{macro}
%
-% \pagebreak[3]
% \subsubsection{The \cs{subref} command}
%
-% At |\captionsetup{subtype}|, we redefine |\label|.
+% We redefine |\label| to |\subcaption@label| at |\setcaptionsubtype|.
% \begin{macrocode}
\g@addto@macro\caption@subtypehook{%
\ifx\label\subcaption@label \else
@@ -1123,11 +2113,13 @@
% \end{macrocode}
%
% \begin{macro}{\subcaption@label}
-% \changes{v1.1}{2011/09/12}{Redefinition of \cs{SK@} added}
+% \changes{v1.1}{2011/09/12}{Adapted to the \pkg{showkeys} package}
% \changes{v1.1}{2011/09/12}{Uses \cs{caption@withoptargs} now}
% \changes{v1.1}{2016/02/20}{Unwanted space removed}
+% \changes{v1.4b}{2021/01/08}{Local re-definitions of \cs{@bsphack} and \cs{@esphack} added}
+% \changes{v1.4c}{2021/04/10}{Adaption to the \pkg{showkeys} package out-sourced to \cs{subcaption@prepare@label}}
% When a label will be placed for a sub-caption, we automatically place
-% a second one for |\subref|, too. This second label will contain
+% a second one for |\sub|\-|ref|, too. This second label will contain
% the sub-type counter only.
% \begin{macrocode}
\newcommand*\subcaption@label{%
@@ -1136,14 +2128,41 @@
% \begin{macrocode}
\newcommand*\subcaption@@label[2]{%
\@bsphack\begingroup
+ \let\@bsphack\relax
+ \let\@esphack\relax
+% \end{macrocode}
+% Label |\@currentlabel| by expanding the original |\label| code.
+% \begin{macrocode}
\subcaption@ORI@label#1{#2}%
- \let\SK@\@gobbletwo
+% \end{macrocode}
+% Set |\@currentlabel| to the `sub' counter value and expand the original |\label| code again.
+% (But this time without optional arguments.)
+% \begin{macrocode}
+ \subcaption@prepare@label
\protected@edef\@currentlabel{\csname thesub\@captype\endcsname}%
- \subcaption@ORI@label#1{sub@#2}%
+ \subcaption@ORI@label{sub@#2}%
\endgroup\@esphack}
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\subcaption@prepare@label}
+% \changes{v1.4c}{2021/04/10}{This macro added}
+% \changes{v1.4c}{2021/04/10}{Adapted to the \pkg{showlabels} package}
+% \begin{macrocode}
+\newcommand*\subcaption@prepare@label{%
+% \end{macrocode}
+% Adaption to the \pkg{showkeys} package: Hide the `sub' label from it.
+% \begin{macrocode}
+ \let\SK@\@gobbletwo
+% \end{macrocode}
+% Adaption to the \pkg{showlabels} package: Hide the `sub' label from it
+% by expanding to the original definition saved to |\SL@orig#1|
+% (with |#1| $=$ |\SL@orig|\-|label|, \ldots).
+% \begin{macrocode}
+ \def\SL@showlabels##1{\@nameuse{SL@orig##1}}}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\subref}
% \changes{v1.1}{2011/08/14}{Caption option \opt{subrefformat=} added}
% \changes{v1.1}{2011/08/18}{Uses \cs{caption@setoptions*} now}
@@ -1157,7 +2176,7 @@
{\caption@withoptargs\subcaption@ref*}%
{\caption@withoptargs\@subref}}
\newcommand*\@subref[2]{%
- \caption@ifundefined\hyperref
+ \@ifundefined{hyperref}%
{\subcaption@ref{#1}{#2}}%
{\hyperref[{#2}]{\subcaption@ref{*#1}{#2}}}}
% \end{macrocode}
@@ -1178,21 +2197,24 @@
% \end{macrocode}
%
% \begin{macro}{\subcaption@setrefformat}
-% \changes{v1.3g}{2020/07/27}{Adapted to \package{caption3} v2.0}
+% \changes{v1.3g}{2020/07/27}{Adapted to \pkg{caption3} v2.0}
% \changes{v1.3h}{2020/09/28}{Usage of \cs{caption@Error} replaced by \cs{subcaption@Error}}
% \changes{v1.3j}{2020/10/07}{Definition of the label formats \texttt{subsimple} and \texttt{subparens} added}
+% \changes{v1.4}{2020/12/24}{Adapted to older versions of the caption package (fallback)}
% |\subcaption@setrefformat|\marg{name}\par
% Selecting a subref format simply means saving the code (in |\subcaption@reffmt|).
% \begin{macrocode}
\newcommand*\subcaption@setrefformat[1]{%
- \@ifundefined{caption@labelformat@#1}%
- {\subcaption@Error{Undefined label format `#1'}}%
+ \@ifundefined{caption@labelformat@#1}% caption3 v2.x
+ {\@ifundefined{caption@lfmt@#1}% caption3 v1.x
+ {\subcaption@Error{Undefined label format `#1'}}%
+ {\expandafter\let\expandafter\subcaption@reffmt\csname caption@lfmt@#1\endcsname}}%
{\expandafter\let\expandafter\subcaption@reffmt\csname caption@labelformat@#1\endcsname}}
% \end{macrocode}
% \begin{macrocode}
\subcaption@setrefformat{simple}
% \end{macrocode}
-% To offer a smooth transition from the \package{subfig} to the \package{subcaption} package
+% To offer a smooth transition from the \pkg{subfig} to the \pkg{subcaption} package
% we offer the options |sub|\-|ref|\-|format=sub|\-|simple| and |sub|\-|ref|\-|format=sub|\-|parens|, too.
% \begin{macrocode}
\DeclareCaptionLabelFormat{subsimple}{#2}
@@ -1202,50 +2224,154 @@
%
% \subsection{Execution of options}
%
-% \changes{v1.1}{2018/05/01}{Option \texttt{font+=smaller} changed to \texttt{size=smaller}}
-% \changes{v1.3e}{2020/07/27}{Option \texttt{size=smaller} changed back to \texttt{font+=smaller}}
+% \changes{v1.1}{2018/05/01}{Option \texttt{font+=small} changed to \texttt{font+=smaller}} \changenote{released 2018/05/02}
+% \changes{v1.2}{2018/05/13}{Option \texttt{font+=smaller} changed to \texttt{size=smaller}} \changenote{merged from former SVN/trunk 2019/03/16, released 2019/08/18}
+% \changes{v1.3e}{2020/07/27}{Option \texttt{size=smaller} changed back to \texttt{font+=smaller}} \changenote{merged from feature/documentclass 2020/07/29, released 2020/08/30}
% We use |\caption@Execute|\-|Options| and |\caption@Process|\-|Options| here to add
% the options to the `|sub|' option list instead of executing them immediately.
% \begin{macrocode}
-\caption@SetupOptions{subcaption}{\captionsetup[sub]{#2}}%
-\caption@ExecuteOptions{subcaption}{%
- font+=smaller,labelformat=parens,labelsep=space,skip=6pt,list=0,hypcap=0}
+\let\caption@setkeys@ORI\caption@setkeys
+\@ifundefined{caption@SetupOptions} % caption3 v1.3
+ {\renewcommand\caption@setkeys[2]{\captionsetup[sub]{#2}}}
+ {\caption@SetupOptions{subcaption}{\captionsetup[sub]{#2}}}
+% \end{macrocode}
+% \begin{macrocode}
+\@ifundefined{caption@smaller} % caption3 v1.7-169
+ {\caption@ExecuteOptions{subcaption}{%
+ font+=small,labelformat=parens,labelsep=space,skip=6pt,list=0,hypcap=0}}
+ {\caption@ExecuteOptions{subcaption}{%
+ font+=smaller,labelformat=parens,labelsep=space,skip=6pt,list=0,hypcap=0}}
+% \end{macrocode}
+% \begin{macrocode}
\caption@ProcessOptions*{subcaption}
% \end{macrocode}
+% \begin{macrocode}
+\let\caption@setkeys\caption@setkeys@ORI
+\let\caption@setkeys@ORI\@undefined
+% \end{macrocode}
%
-% \changes{v1.1}{2011/10/30}{Adapted to the newfloat package}
-% We call |\Declare|\-|Caption|\-|Sub|\-|Type| for |figure|, |table|,
+% We call |\Declare|\-|Caption|\-|Sub|\-|Type| for |figure| and |table|,
% and each floating environment declared with |\Declare|\-|Floating|\-|Environment| here.
% \begin{macrocode}
-\ForEachCaptionType{\DeclareCaptionSubType{#1}}
+\@ifundefined{ForEachCaptionType} % caption3 v1.13
+ {\@ifundefined{caption@ForEachType} % caption3 v1.4a
+ {\@ifundefined{c@figure}{}{\DeclareCaptionSubType{figure}}%
+ \@ifundefined{c@table}{}{\DeclareCaptionSubType{table}}%
+ \caption@For{typelist}{\DeclareCaptionSubType{#1}}}
+ {\caption@ForEachType{\DeclareCaptionSubType{#1}}}}
+ {\ForEachCaptionType{\DeclareCaptionSubType{#1}}}
% \end{macrocode}
%
% \subsection{Bonus material}
%
+% \subsubsection{The \cs{subcaption}, \cs{phantomsubcaption}, \cs{subcaptionlistentry}, and \cs{subcaptiontext} commands}
+%
+% \begin{macro}{\subcaption@newabbreviation}
+% \changes{v1.5}{2022/01/07}{This macro added}
+% |\subcaption@newabbreviation|\marg{new command}\marg{existing command}\marg{extra code in case of error}\\
+% defines a new command as abbreviation of |\set|\-|caption|\-|sub|\-|type*| plus \meta{command}.
+% (With a prefacing |\set|\-|caption|\-|sub|\-|type|, \meta{new command} is reduced to \meta{command}.
+% Unfortunately we have to do this on our own since using |\set|\-|caption|\-|sub|\-|type| multiple times
+% is not suppressed until \pkg{caption} package \version{3.6}.)
+% \Note{Since \cs{setcaptionsubtype} is used, the new command is designed to be used inside an own group!}
+% \begin{macrocode}
+\newcommand*\subcaption@newabbreviation[3]{%
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*{#1}{%
+ \caption@iftype
+ {\setcaptionsubtype*#2}%
+ {\subcaption@OutsideFloat#1#3}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \g@addto@macro\caption@subtypehook{\let#1#2}}% needed for caption < 3.6
+% \end{macrocode}
+% \begin{macrocode}
+\@onlypreamble\subcaption@newabbreviation
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@gobble}
+% \changes{v1.4}{2020/12/24}{This macro added}
+% |\caption@gobble*|\oarg{arg}\oarg{\ldots}\marg{arg}\\
+% is similar to |\@gobble| but gobbles a star and optional arguments as well.
+% \begin{macrocode}
+\@ifundefined{caption@gobble}{%
+ \DeclareRobustCommand*\caption@gobble{% caption3 < v1.4
+ \caption@withoptargs\@gobbletwo}%
+}{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\subcaption}
+% \changes{v1.1}{2012/04/06}{Overwrites the definition defined by the \pkg{memoir} document class}
+% |\subcaption| is an abbreviation of |\set|\-|caption|\-|sub|\-|type*| plus |\caption|.
+% \begin{macrocode}
+\@ifclassloaded{memoir}{\let\subcaption\undefined}{}
+\subcaption@newabbreviation\subcaption\caption\caption@gobble
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\phantomsubcaption}
+% \changes{v1.1}{2011/08/17}{This macro added}
+% \changes{v1.3h}{2020/09/28}{Usage of \cs{caption@Error} replaced by \cs{subcaption@Error}}
+% |\phantom|\-|sub|\-|caption| is an abbreviation of |\set|\-|caption|\-|sub|\-|type*| plus |\phantom|\-|caption|.
+% \Note{This commands needs at least \pkg{caption} package \version{3.2}.}
+% \begin{macrocode}
+\subcaption@newabbreviation\phantomsubcaption\phantomcaption\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\subcaptionlistentry}
+% \changes{v1.5}{2022/01/05}{This macro added}
+% |\sub|\-|caption|\-|list|\-|entry| is an abbreviation of |\set|\-|caption|\-|sub|\-|type*| plus |\caption|\-|list|\-|entry|.
+% \Note{This commands needs at least \pkg{caption} package \version{3.3}.}
+% \begin{macrocode}
+\subcaption@newabbreviation\subcaptionlistentry\captionlistentry\caption@gobble
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\subcaptiontext}
+% \changes{v1.5}{2022/01/05}{This macro added}
+% |\sub|\-|caption|\-|text| is an abbreviation of |\set|\-|caption|\-|sub|\-|type*| plus |\caption|\-|text|.
+% \Note{This commands needs at least \pkg{caption} package \version{3.6}.}
+% \begin{macrocode}
+\subcaption@newabbreviation\subcaptiontext\captiontext\caption@gobble
+% \end{macrocode}
+% \end{macro}
+%
% \subsubsection{The \cs{subfloat} command}
%
% \begin{macro}{\subfloat}
% \changes{v0.4}{2008/03/01}{This macro added}
-% \changes{v1.0c}{2011/01/22}{This macro removed since it's too incompatible with the one from \package{subfig}}
+% \changes{v1.0c}{2011/01/22}{This macro removed since it's too incompatible with the one from \pkg{subfig}}
% \changes{v1.3}{2019/08/31}{This macro re-added and revised}
% \changes{v1.3a}{2019/09/01}{\cs{ignorespaces} copied from \cs{sf@@@subfloat}}
% \changes{v1.3b}{2020/01/03}{Previous definition of \cs{subfloat} will be overwritten}
% \changes{v1.3f}{2020/07/29}{Bugfix: Usage of \cs{caption@hj@default} replaced by \cs{captionbox@innerpos@default}}
% \changes{v1.3i}{2020/09/28}{This macro will be defined with \cs{providecommand} now to preserve an original definition}
+% \changes{v1.4}{2020/12/24}{Usage of \cs{caption@getlabel} replaced by \cs{subcaption@getlabel}}
+% \changes{v1.4a}{2020/12/26}{Clearance of \cs{caption@thelabel} replaced by \cs{subcaption@clrlabel}}
+% \changes{v1.5}{2022/01/07}{Usage of \cs{@ifnextchar} replaced by \cs{kernel@ifnextchar}}
+% \changes{v1.5}{2022/01/07}{Overwrites the definition defined by the \pkg{memoir} document class}
% |\subfloat|\oarg{list\_entry}\oarg{sub-caption}\marg{body}\par
% If \meta{sub-caption} is given, we map this to |\sub|\-|caption|\-|box|
% but transfer the |\label| from \meta{body} to \meta{sub-caption}.
% If not, we do the same as |\sub|\-|caption|\-|box| does, but use |\phantom|\-|caption| instead of |\caption|.
% In both cases we do a |\ignore|\-|spaces| at the end since the original implementation of |\sub|\-|float| does this, too.
% \begin{macrocode}
-\caption@AtBeginDocument{\providecommand*\subfloat{%
- \@ifnextchar[%]
- \subcaption@subfloat
- \subcaption@subfloat@}}
+\@ifclassloaded{memoir}{\let\subfloat\undefined\let\endsubfloat\undefined}{}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \providecommand*\subfloat{%
+ \kernel@ifnextchar[%]
+ \subcaption@subfloat
+ \subcaption@subfloat@}}
% \end{macrocode}
% \begin{macrocode}
\long\def\subcaption@subfloat[#1]{%
- \@ifnextchar[%]
+ \kernel@ifnextchar[%]
{\subcaption@@subfloat{#1}}%
{\subcaption@@@subfloat\subcaptionbox{#1}}}
% \end{macrocode}
@@ -1255,9 +2381,9 @@
% \end{macrocode}
% \begin{macrocode}
\long\def\subcaption@@@subfloat#1#2#3{%
- \caption@getlabel{#3}%
+ \subcaption@getlabel{#3}%
#1{#2\caption@thelabel}{\let\label\caption@gobble#3}%
- \global\let\caption@thelabel\relax
+ \subcaption@clrlabel
\ignorespaces}
% \end{macrocode}
% \begin{macrocode}
@@ -1274,6 +2400,60 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\subcaption@getlabel}
+% \changes{v1.4}{2020/12/24}{This macro added}
+% |\subcaption@getlabel|\marg{text}\\
+% gets the label command out of the given caption text and stores it to |\caption@the|\-|label|.
+% It uses |\caption@get|\-|label| for this purpose which interface unfortunately has changed over time.
+% (Changing the interface was a bad idea in the first place but now it is as it is).
+% \begin{macrocode}
+\@ifundefined{caption@getlabel}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand\subcaption@getlabel[1]{% caption3 < v1.7
+ \subcaption@Error{\noexpand\subfloat needs at least caption v3.4}%
+ \let\caption@thelabel\relax}
+% \end{macrocode}
+% \begin{macrocode}
+}{\@ifundefined{caption@@@@getlabel}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand\subcaption@getlabel[1]{% caption3 >= v1.7
+ \caption@getlabel#1\label{}\@nil}
+% \end{macrocode}
+% \begin{macrocode}
+}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\subcaption@getlabel{% caption3 >= v2.0
+ \caption@getlabel}
+% \end{macrocode}
+% \begin{macrocode}
+}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\subcaption@clrlabel}
+% \changes{v1.4a}{2020/12/26}{This macro added}
+% |\subcaption@clrlabel|\\
+% resets |\caption@the|\-|label| to |\relax|.
+% \begin{macrocode}
+\@ifundefined{caption@clrlabel}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\subcaption@clrlabel{\let\caption@thelabel\relax} % caption3 < v2.3
+% \end{macrocode}
+% \begin{macrocode}
+}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \newcommand*\subcaption@clrlabel{\caption@clrlabel} % caption3 >= v2.3
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \end{macro}
+%
% \iffalse
%</package>
% \fi