summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/caption/caption.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/caption/caption.dtx')
-rw-r--r--Master/texmf-dist/source/latex/caption/caption.dtx6208
1 files changed, 5383 insertions, 825 deletions
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
+