% \iffalse meta-comment
% 
% This is file `caption.dtx'.
% 
% Copyright (C) 1994-2004 Axel Sommerfeldt (caption@sommerfeldt.net)
% 
% --------------------------------------------------------------------------
% 
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
% 
% This work has the LPPL maintenance status "maintained".
% 
% This Current Maintainer of this work is Axel Sommerfeldt.
% 
% This work consists of the files caption.ins, caption.dtx,
% caption2.dtx, caption.xml, and anleitung.tex and the derived files
% caption.sty, caption2.sty, and manual.tex.
% 
% \fi
% \CheckSum{1667}
%
% \iffalse
%<*driver>
\documentclass{ltxdoc}
\setlength\parindent{0pt}
\setlength\parskip{\smallskipamount}
%
\newcommand\NEWfeature{\NEW{New feature}}
\newcommand\NEWdescription{\NEW{New description}}
\newcommand\NEW[2]{%
  \hskip 1sp \marginpar{\footnotesize\sffamily\raggedleft
    #1\\#2}}
%
\ifx\pdfoutput\undefined\else
  \ifcase\pdfoutput\else
    \usepackage{mathptmx,courier}
    \usepackage[scaled=0.90]{helvet}
  \fi
\fi
%
\usepackage{caption}[2003/12/20]
%\usepackage{float}
\usepackage{longtable}
%\usepackage[raggedright]{sidecap}
%
\DeclareCaptionLabelSeparator{period-newline}{. \newline}
\DeclareCaptionStyle{period-newline}[labelsep=period]{labelsep=period-newline}
\DeclareCaptionStyle{period-newline2}[labelsep=period,justification=centering]{labelsep=period-newline}
\DeclareCaptionFormat{reverse}{#3#2#1}
\DeclareCaptionFormat{llap}{\llap{#1#2}#3\par}
\DeclareCaptionLabelFormat{fullparens}{(\bothIfFirst{#1}{ }#2)}
\DeclareCaptionLabelSeparator{fill}{\hfill}
%
\DeclareRobustCommand{\KOMAScript}{\textsf{K\kern.05em O\kern.05em%
    M\kern.05em A\kern.1em-\kern.1em Script}}
%
\begin{document}
  \DocInput{caption.dtx}
\end{document}
%</driver>
% \fi
%
% \newcommand*{\purerm}[1]{{\upshape\mdseries\rmfamily #1}}
% \newcommand*{\puresf}[1]{{\upshape\mdseries\sffamily #1}}
% \newcommand*{\purett}[1]{{\upshape\mdseries\ttfamily #1}}
% \let\package\puresf\def\thispackage{\package{caption}}
% \let\env\purett \let\opt\purett
% 
% \newenvironment{Options}[1]%
%   {\list{}{\renewcommand{\makelabel}[1]{\texttt{##1}\hfil}%
%    \settowidth{\labelwidth}{\texttt{#1\space}}%
%    \setlength{\leftmargin}{\labelwidth}%
%    \addtolength{\leftmargin}{\labelsep}}}%
%   {\endlist}
% 
% \newenvironment{Example}%
%   {\ifvmode\else\unskip\par\fi
%    \minipage{\linewidth}\smallskip}%
%   {\smallskip\endminipage}
% \newcommand\example[3][figure]{%
%   \begingroup
%     \captionsetup{#2}%
%     \captionof{#1}[]{#3}%
%   \endgroup}
% 
% \GetFileInfo{caption.sty}
% \title{Typesetting captions with the
%        \thispackage\ package\thanks{This package has version number
%        \fileversion, last revised \filedate.}}
% \author{Axel Sommerfeldt\\\texttt{caption@sommerfeldt.net}}
% \date{2004/07/16}
% \maketitle
% 
% 
% \begin{abstract}
% The \thispackage\ package provides many ways to customise the captions
% in floating environments such |figure| and |table| and cooperates with
% many other packages.\footnote{A complete re-work of the user interface
% done together with Steven D. Cochran and Frank Mittelbach has lead to
% this new enhanced version 3.0.}
% \end{abstract}
% 
% \iffalse
% \tableofcontents
% \fi
% 
% 
% \section{Introduction}
% 
% \newcommand\figuretext{%
%   White sand beaches. The pink smoothness of the conch shell. A sea abundant
%   with possibilities. Duty-free shops filled with Europe's finest gifts and
%   perfumes. Play your favorite game of golf amidst the tropical greens on one
%   of the many championship courses.}
% 
% Within the standard \LaTeX\ classes captions haven't received the attention
% they deserve. Simply typeset as an ordinary paragraph there is no
% remarkable visual difference from the rest of the text, like here:
% 
% \example{belowskip=\abovecaptionskip}{\figuretext}
% 
% There should be possibilities to change this; e.g., it would be nice if you
% can make the text of the caption a little bit smaller as the normal text,
% add an extra margin, typeset the caption label with the same font family and
% shape as your headings etc. Just like this one:
% 
% \example{belowskip=\abovecaptionskip,size=small,margin=10pt,labelfont=bf}{\figuretext}
% 
% With this package you can do this easily as there are many ready-to-use
% caption formatting options, but you are free to define your very own stuff, too.
% 
% 
% \pagebreak[4]
% \section{Using the package}
% \label{usage}
% 
% \DescribeMacro{\usepackage}
% Insert
% \begin{quote}
%   |\usepackage|\oarg{options}|{caption}[|\texttt{\filedate}|]|
% \end{quote}
% into the preamble of your document, i.e.~the part of your document
% between |\documentclass| and |\begin{document}|.
% The options control how your captions will look like; e.g.,
% \begin{quote}
%   |\usepackage[margin=10pt,font=small,labelfont=bf]{caption}|
% \end{quote}
% would result in captions looking like the second one in the introduction.
% 
% \DescribeMacro{\captionsetup}
% For a later change of options the \thispackage\ package provides the command
% \begin{quote}
%   |\captionsetup|\oarg{float type}\marg{options}
% \end{quote}
% So
% \begin{quote}
%   |\usepackage[margin=10pt,font=small,labelfont=bf]{caption}|
% \end{quote}
% and
% \begin{quote}
%   |\usepackage{caption}|\\
%   |\captionsetup{margin=10pt,font=small,labelfont=bf}|
% \end{quote}
% are equal in their results.
% 
% It's good to know that |\captionsetup| has an effect on the current
% environment only. So if you want to change some settings for the
% current |figure| or |table| only, just place the |\captionsetup| command
% inside the |figure| or |table| right before the |\caption| command.
% For example
% \begin{quote}
%   |\begin{figure}|\\
%   |  |\ldots\\
%   |  \captionsetup{singlelinecheck=off}|\\
%   |  \caption{|\ldots|}|\\
%   |\end{figure}|
% \end{quote}
% switches the single-line-check off, but only for this |figure| so all
% the other captions remain untouched.
% 
% (For a description of the optional parameter \meta{float type} see
%  section \ref{misc}: \textit{``Useful stuff''}.)
% 
% \section{Options}
% \def\OptionLabel{RaggedRight}
% 
% 
% \subsection{Formatting}
% 
% \DescribeMacro{format=}
% A figure or table caption mainly consits of three parts: the caption label,
% which says if this object is a `Figure' or `Table' and what number is
% associated with it, the caption text itself, which is normally a short
% description of contents, and the caption separator which separates the text
% from the label.
%
% The \textit{caption format} determines how this information will be presented;
% it is specified with the option
% \begin{quote}
%   |format=|\meta{format name}\quad ,
% \end{quote}
% having the name of the caption format as its argument.
%
% There are two standard caption formats:\footnote{You have the option to
% define your own ones, too. See section \ref{declare}:
% \textit{``Do it yourself!''} for details.}
% 
% \begin{Options}{\OptionLabel}
%   \item[default]
%   Typesets the captions as a normal paragraph.
%   (This is the default behaviour, it
%   is adapted from the standard \LaTeX\ document classes.)
% 
%   \item[hang]
%   Indents the caption text, so it will `hang' under the first line of the text.
% \end{Options}
% 
% \begin{Example}
%   An example: Specifing the option
%   \begin{quote}
%     |format=hang|
%   \end{quote}
%   yields captions like this:
%   \example{format=hang}{\figuretext}
% \end{Example}
% 
% \DescribeMacro{indention=}
% For both formats (\texttt{default} and \texttt{hang}) you can setup an extra
% indention starting at the second line of the caption. You do this with the
% option
% \begin{quote}
%   |indention=|\meta{amount}.
% \end{quote}
% 
% Two examples:
% 
% \begin{Example}
%   \begin{quote}
%     |format=default,indention=.5cm|
%   \end{quote}
%   \captionsetup{aboveskip=0pt}
%   \example{format=default,indention=.5cm}{\figuretext}
% \end{Example}
% 
% \begin{Example}
%   \begin{quote}
%     |format=hang,indention=-0.5cm|
%   \end{quote}
%   \captionsetup{aboveskip=0pt}
%   \example{format=hang,indention=-0.5cm}{\figuretext}
% \end{Example}
% 
% \DescribeMacro{labelformat=}
% With the option
% \begin{quote}
%   |labelformat=|\meta{label format name}
% \end{quote}
% you specify how the caption label will be typeset.
% There are three standard caption label formats:
% 
% \begin{Options}{\OptionLabel}
%   \item[empty]
%   The caption label will be empty. This option only makes sense when used
%   together with other options like \texttt{labelsep=none}.
% 
%   \item[simple]
%   The caption label will be typeset as a name and a number.
%   (This is the default behaviour.)
% 
%   \item[parens]
%   The number of the caption label will be typeset in parentheses.
% \end{Options}
% 
% \begin{Example}
%   An example: Using the options
%   \begin{quote}
%     |labelformat=parens,labelsep=quad|
%   \end{quote}
%   yields captions like this one:
%   \example{labelformat=parens,labelsep=quad}{\figuretext}
% \end{Example}
% 
% \DescribeMacro{labelsep=}
% With the options
% \begin{quote}
%   |labelsep=|\meta{label separator name}
% \end{quote}
% you specify what caption separator will be used.
% You can choose one of the following:
% 
% \begin{Options}{\OptionLabel}
%   \item[none]
%   There is no caption separator. This option only makes sense when used
%   together with other options like \texttt{labelformat=empty}.
% 
%   \item[colon]
%   The caption label and text will be separated by a colon and a space.
%   (This is the default one.)
% 
%   \item[period]
%   The caption label and text will be separated by a period and a space.
% 
%   \item[space]
%   The caption label and text will be separated by a single space.
% 
%   \item[quad]
%   The caption label and text will be separated by a |\quad|.
% 
%   \item[newline]
%   The caption label and text will be separated by a line break (|\newline|).
% \end{Options}
% 
% Two examples:
% \begin{Example}
%   \begin{quote}
%     |labelsep=period|
%   \end{quote}
%   \captionsetup{aboveskip=0pt}
%   \example{labelsep=period}{\figuretext}
% \end{Example}
% 
% \begin{Example}
%   \begin{quote}
%     |labelsep=newline,singlelinecheck=false|
%   \end{quote}
%   \captionsetup{aboveskip=0pt}
%   \example{labelsep=newline,singlelinecheck=false}{\figuretext}
% \end{Example}
% 
% 
% \subsection{Justification}
% 
% \DescribeMacro{justification=}
% As addition to the caption format you could also specify a
% \emph{caption justification}; it is specified with the option
% \begin{quote}
%   |justification=|\meta{justification name}\quad.
% \end{quote}
%
% You can choose one of the following:
% 
% \begin{Options}{\OptionLabel}
%   \item[justified]
%   Typesets the caption as a normal paragraph. (This is the default.)
% 
%   \item[centering]
%   Each line of the caption will be centered.
% 
% \iffalse
%   \item[Centering]
%   Each line of the caption will be centered, too.
%   But this time the command |\Centering| of the \package{ragged2e} package
%   will be used to achieve this. This difference is that this time the word
%   breaking algorithm of \TeX\ will work inside the caption.
% \fi
% 
%   \item[centerlast]
%   The last line of each paragraph of the caption text will be centered.
% 
%   \item[centerfirst]
%   Only the first line of the caption will be centered.
% 
%   \item[raggedright]
%   Each line of the caption will be moved to the left margin.
% 
% \iffalse
%   \item[RaggedRight]
%   Each line of the caption will be moved to the left margin using
%   the command |\RaggedRight| from the \package{ragged2e} package.
% \fi
%   \item[RaggedRight]
%   Each line of the caption will be moved to the left margin, too.
%   But this time the command |\RaggedRight| of the \package{ragged2e} package
%   will be used to achieve this. This difference is that this time the word
%   breaking algorithm of \TeX\ will work inside the caption.
% 
%   \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
% \end{Options}
% 
% Two examples:
% \begin{Example}
%   \begin{quote}
%     |justification=centerlast|
%   \end{quote}
%   \captionsetup{aboveskip=0pt}
%   \example{justification=centerlast}{\figuretext}
% \end{Example}
% 
% \begin{Example}
%   \begin{quote}
%     |format=hang,justification=raggedright|
%   \end{quote}
%   \captionsetup{aboveskip=0pt}
%   \example{format=hang,justification=raggedright}{\figuretext}
% \end{Example}
% 
% \DescribeMacro{singlelinecheck=}
% If the caption fit in a single line it will always be centered, ignoring
% the justification you set:
%
% \example{belowskip=\abovecaptionskip}{A short caption.}
%
% This behaviour is adapted from the standard \LaTeX\ document classes
% |article|, |report|, and |book|), but using the \thispackage\ package
% you can switch this special treatment of such short captions off
% with the option
% \begin{quote}
%   |singlelinecheck=|\marg{bool}\quad.
% \end{quote}
% Using |false|, |no|, |off| or |0| for \meta{bool} you switch off the
% extra centering:
% \begin{quote}
%   |singlelinecheck=false|
% \end{quote}
% Doing so the above short caption would look like
%
% \example{belowskip=\abovecaptionskip,singlelinecheck=false}{A short caption.}
% 
% Using |true|, |yes|, |on| or |1| for \meta{bool} you switch on the
% extra centering again. (The default is on.)
% 
% 
% \subsection{Fonts}
% 
% \DescribeMacro{font=}
% \DescribeMacro{labelfont=}
% \DescribeMacro{textfont=}
% There are three font options which affects different parts of the caption:
% One affecting the whole caption (|font|), one which only affects the caption
% label and separator (|labelfont|) and at last one which only affects the
% caption text (|testfont|).
% You set them up using the options
% \begin{quote}\begin{tabular}{@{}r@{}ll}
%   |font=|      & \marg{font options} & ,\\
%   |labelfont=| & \marg{font options} & and\\
%   |textfont=|  & \marg{font options} & .\\
% \end{tabular}\end{quote}
% 
% And these are the available font options:
% 
% \begin{Options}{\OptionLabel}
%   \item[scriptsize]   {\scriptsize Very small size}
%   \item[footnotesize] {\footnotesize The size usually used for footnotes}
%   \item[small]        {\small Small size}
%   \item[normalsize]   {\normalsize Normal size}
%   \item[large]        {\large Large size}
%   \item[Large]        {\Large Even larger size}
% 
%   \item[up]           {\upshape Upright shape}
%   \item[it]           {\itshape Italic shape}
%   \item[sl]           {\slshape Slanted shape}
%   \item[sc]           {\scshape Small Caps shape}
% 
%   \item[md]           {\mdseries Medium series}
%   \item[bf]           {\bfseries Bold series}
% 
%   \item[rm]           {\rmfamily Roman family}
%   \item[sf]           {\sffamily Sans Serif family}
%   \item[tt]           {\ttfamily Typewriter family}
% \end{Options}
% 
% If you use only one of these options you can omit the braces;
% e.g., the options
% \iffalse
% \begin{quote}
% \fi
%   |font={small}|
% \iffalse
% \end{quote}
% \fi
% and
% \iffalse
% \begin{quote}
% \fi
%   |font=small|
% \iffalse
% \end{quote}
% \fi
% yield the same result.
% 
% Two examples:
% \begin{Example}
%   \begin{quote}
%     |font={small,it},labelfont=bf|
%   \end{quote}
%   \captionsetup{aboveskip=0pt}
%   \example{font={small,it},labelfont=bf}{\figuretext}
% \end{Example}
% 
% \begin{Example}
%   \begin{quote}
%     |font=small,labelfont=bf,textfont=it|
%   \end{quote}
%   \captionsetup{aboveskip=0pt}
%   \example{font=small,labelfont=bf,textfont=it}{\figuretext}
% \end{Example}
% 
% 
% \subsection{Margins and further paragraph options}
% 
% \DescribeMacro{margin=}
% \DescribeMacro{width=}
% For all captions you can specify \emph{either} an extra margin \emph{or}
% a fixed width. You do this using the options
% \begin{quote}\begin{tabular}{@{}r@{}ll}
%   |margin=| & \meta{amount}   & \emph{or}\\
%   |width=|  & \meta{amount} & \\
% \end{tabular}\end{quote}
% Nevertheless what option you use, the left and right margin will be the
% same.
% 
% Two examples illustrating this:
% \begin{Example}
%   \begin{quote}
%     |margin=10pt|
%   \end{quote}
%   \captionsetup{aboveskip=0pt}
%   \example{margin=10pt}{\figuretext}
% \end{Example}
% 
% \begin{Example}
%   \begin{quote}
%     |width=.75\textwidth|
%   \end{quote}
%   \captionsetup{aboveskip=0pt}
%   \example{width=.75\textwidth}{\figuretext}
% \end{Example}
% 
% \DescribeMacro{parskip=}
% This option is useful for captions containing more than one paragraph.
% If specifies the extra vertical space inserted between them:
% \begin{quote}
%   |parskip=|\meta{amount}
% \end{quote}
% One example:
% \begin{Example}
%   \begin{quote}
%     |margin=10pt,parskip=5pt|
%   \end{quote}
%   \captionsetup{aboveskip=0pt}
%   \example{margin=10pt,parskip=5pt}{
%     First paragraph of the caption. This one contains some test, just to
%     show how these options affect the layout of the caption.
% 
%     Second paragraph of the caption. This one contains some text, too, to
%     show how these options affect the layout of the caption.}
% \end{Example}
% 
% \DescribeMacro{hangindent=}
% The option
% \begin{quote}
%   |hangindent=|\meta{amount}
% \end{quote}
% is for setting up a hanging indention starting from the second line of each
% paragraph. If the caption contains just a single paragraph, using this option
% leads to the same result as the option |indention=| you already know about.
% But if the caption contains multiple paragraphs you will notice the difference:
% 
% \begin{Example}
%   \begin{quote}
%     |format=hang,indention=-.5cm|
%   \end{quote}
%   \captionsetup{aboveskip=0pt}
%   \example{format=hang,indention=-.5cm}{
%     First paragraph of the caption. This one contains some test, just to
%     show how these options affect the layout of the caption.
% 
%     Second paragraph of the caption. This one contains some text, too, to
%     show how these options affect the layout of the caption.}
% \end{Example}
% 
% \begin{Example}
%   \begin{quote}
%     |format=hang,hangindent=-.5cm|
%   \end{quote}
%   \captionsetup{aboveskip=0pt}
%   \example{format=hang,hangindent=-.5cm}{
%     First paragraph of the caption. This one contains some test, just to
%     show how these options affect the layout of the caption.
% 
%     Second paragraph of the caption. This one contains some text, too, to
%     show how these options affect the layout of the caption.}
% \end{Example}
% 
% 
% \subsection{Styles}
% \label{style}
% 
% \DescribeMacro{style=}
% A suitable combination of caption options is called \emph{caption style}.
% You can compare them more or less to page styles which you set up with
% |\pagestyle|: The caption style provides all settings for a whole caption layout.
% 
% You switch to an already defined caption style with the option
% \begin{quote}
%   |style=|\meta{style name}\quad.
% \end{quote}
% The \thispackage\ package usually defines only the style |default| which
% puts all options you already know about to the default ones.
% This means that specifing the option
% \begin{quote}
%   |style=default|
% \end{quote}
% has the same effect as specifing all these options:
% \begin{quote}
%   |format=default,labelformat=simple,labelsep=colon,|\\
%   |justification=justified,font=default,labelfont=default,|\\
%   |textfont=default,margin=0pt,indention=0pt,parindent=0pt|\\
%   |hangindent=0pt,singlelinecheck=true|
% \end{quote}
% 
% 
% \subsection{Skips}
% 
% \DescribeMacro{aboveskip=}
% \DescribeMacro{belowskip=}
% The spaces above and below the caption are controlled by the skips
% |\abovecaptionskip| and |\belowcaptionskip|. The standard \LaTeX\ document
% classes |article|, |report| and |book| set |\abovecaptionskip| to |10pt|
% and |\belowcaptionskip| to |0pt|.
%
% \pagebreak[3]
% Both skips can be changed with the command |\setlength|, but you can
% use these options, too:
% \nopagebreak[3]
% \begin{quote}\begin{tabular}{@{}r@{}ll}
%   |aboveskip=| & \meta{amount} & and\\
%   |belowskip=| & \meta{amount} & .\\
% \end{tabular}\end{quote}
%
% \DescribeMacro{position=}
% Using |\abovecaptionskip| and |\belowcaptionskip| has a major design flaw:
% If the caption is typeset \emph{above} (and not \emph{below}) the figure
% or table they are not set up very useful at default, because there will be
% some extra space above the caption but no space between the caption and the
% figure or table itself. (Remember: |\belowcaptionskip| is usually set to |0pt|.)
% 
% Please compare the spacing in these small tables:
% \begin{Example}
%   \begin{minipage}[c]{.5\linewidth}
% \iffalse
%     \captionsetup{aboveskip=0pt}%
% \fi
%     \captionof{table}{A table}
%     \centering\begin{tabular}{ll}
%       A & B \\
%       C & D \\
%     \end{tabular}
%   \end{minipage}
%   \begin{minipage}[c]{.5\linewidth}
%     \centering\begin{tabular}{ll}
%       A & B \\
%       C & D \\
%     \end{tabular}
%     \captionof{table}{A table}
%   \end{minipage}
% \end{Example}
% 
% But you can fix this by using the option |position=|: It specifies how the
% spacing above and below the caption will be used:
% \begin{quote}
%   |position=top|\quad(or |position=above|)
% \end{quote}
% tells the \thispackage\ package to use the spacing useful for caption
% \emph{above} the figure or table and
% \begin{quote}
%   |position=bottom|\quad(or |position=below|)
% \end{quote}
% tells the \thispackage\ package to use the spacing useful for captions
% \emph{below} the figure or table. (The last one is the default setting.)
% 
% So adding an extra |\captionsetup{position=top}| to the left example
% table gives you proper spacing around both captions:
% \begin{Example}
%   \begin{minipage}[c]{.5\linewidth}
%     \captionsetup{position=top}
%     \captionof{table}{A table}
%     \centering\begin{tabular}{ll}
%       A & B \\
%       C & D \\
%     \end{tabular}
%   \end{minipage}
%   \begin{minipage}[c]{.5\linewidth}
%     \centering\begin{tabular}{ll}
%       A & B \\
%       C & D \\
%     \end{tabular}
%     \captionof{table}{A table}
%   \end{minipage}
% \end{Example}
%
% (Technically speaking |\abovecaptionskip| and |\belowcaptionskip| will
% be swapped if you specify the option |position=top|, so in both cases
% |\abovecaptionskip| will be used between the caption and the figure or
% table itself.)
% 
% \DescribeMacro{tableposition=}
% This option is especially useful when used together with the optional
% argument of the |\captionsetup| command. (See section \ref{misc}:
% \textit{``Useful stuff''} for details.) E.g.,
% \begin{quote}
%   |\captionsetup[table]{position=top}|
% \end{quote}
% causes all captions within tables to be treated as captions \emph{above}
% the table (regarding spacing around it).
% \NEWfeature{v3.0a}
% Because this is a very common setting the \thispackage\ package offers
% an abbreviating option for the use with |\usepackage|:
% \begin{quote}
%   |\usepackage[|\ldots|,tableposition=top]{caption}|
% \end{quote}
% is equivalent to
% \begin{quote}
%   |\usepackage[|\ldots|]{caption}|\\
%   |\captionsetup[table]{position=top}|
% \end{quote}
%
% 
% \pagebreak[4]
% \section{Useful stuff}
% \label{misc}
% 
% \DescribeMacro{\caption}
% The command
% \nopagebreak[3]
% \begin{quote}
%   |\caption|\oarg{lst\_entry}\marg{heading}
% \end{quote}
% \nopagebreak[3]
% typesets the caption inside a floating environment like |figure| or |table|.
% Well, you already know this, but what is new is the fact then when you leave
% the argument \meta{lst\_entry} empty, no entry in the list of figures or
% tables will be made; e.g.,
% \begin{quote}
%   |\caption[]{A figure without entry in the list of figures.}|
% \end{quote}
% 
% \DescribeMacro{\caption*}
% The \package{longtable} package defines the command |\caption*| which
% typesets the caption without label and without entry in the list of tables.
% An example:
% \begin{quote}
%   |\begin{longtable}{cc}|\\
%   |  \caption*{A table}\\|\\
%   |  A & B \\|\\
%   |  C & D \\|\\
%   |\end{longtable}|
% \end{quote}
% looks like
% \begin{longtable}{cc}
%   \caption*{A table}\\
%   A & B \\
%   C & D \\
% \end{longtable}
% 
% This package does it, too, so you can use this command now within every
% floating environment like |figure| or |table|. Additionally you can specify
% an entry for the list of figures or tables within square brackets, like here:
% \begin{quote}
%   |\begin{table}|\\
%   |  \caption*[List entry for the table]{A table}|\\
%   |  \begin{tabular}{cc}|\\
%   |    A & B \\|\\
%   |    C & D \\|\\
%   |  \end{longtable}|\\
%   |\end{table}|
% \end{quote}
% 
% \DescribeMacro{\captionof}
% \DescribeMacro{\captionof*}
% Sometimes you want to typeset a caption \emph{outside} a floating environment,
% putting a figure within a |minipage| for instance. For this purpose the
% \thispackage\ package offers the command
% \begin{quote}
%   |\captionof|\marg{float type}\oarg{lst\_entry}\marg{heading}\quad.
% \end{quote}
% Note that the first argument, the \meta{float type}, is mandatory here, because
% the |\captionof| command needs to know which name to put into the caption label
% (e.g. ``Figure'' or ``Table'') and in which list to put the contents entry.
% An example:
% \begin{quote}
%   |\captionof{figure}{A figure}|\\
%   |\captionof{table}{A table}|
% \end{quote}
% typesets captions like this:
% \begin{Example}
%   \captionof{figure}{A figure}
%   \captionsetup{belowskip=\abovecaptionskip}
%   \captionof{table}{A table}
% \end{Example}
% 
% The star variant |\captionof*| has the same behaviour as the |\caption*| command:
% it typesets the caption without label and without entry to the list of figures
% or tables (if not specified otherwise).
%
% Please use both |\captionof| and |\captionof*| only \emph{inside} environments
% (like |minipage| or |\parbox|), otherwise a page break can appear between content
% and caption. Furthermore some strange effects could occur (e.g., wrong spacing
% around captions).
% 
% \DescribeMacro{\ContinuedFloat}
% Sometimes you want to split figures or tables without giving them
% their own reference number. This is what the command
% \begin{quote}
%   |\ContinuedFloat|
% \end{quote}
% is for; it should be used as first command inside the floating environment.
% It prevents the increment of the relevant counter so a figure or table
% with a |\ContinuedFloat| in it gets the same reference number as the figure
% or table before.
% 
% An example:
% \begin{quote}
%   |\begin{table}|\\
%   |\caption{A table}|\\
%   \ldots\\
%   |\end{table}|\\
%   \ldots\\
%   |\begin{table}\ContinuedFloat|\\
%   |\caption{A table (cont.)}|\\
%   \ldots\\
%   |\end{table}|
% \end{quote}
% gives the following result:
% \begin{Example}
%   \makeatletter\def\@captype{table}\makeatother
%   \caption[]{A table}
%   \centerline{\ldots}
%   \ContinuedFloat
%   \captionsetup{aboveskip=0pt}
%   \caption[]{A table (cont.)}
% \end{Example}
% 
% \DescribeMacro{\captionsetup}
% We already know the |\captionsetup| command (see section \ref{usage}:
% \textit{``Using the package''}), but this time we get enlighten about
% the optional argument \meta{float type}.
% 
% Remember, the syntax of this command is
% \begin{quote}
%   |\captionsetup|\oarg{float type}\marg{options}\quad.
% \end{quote}
% 
% If a \meta{float type} gets specified, all the \meta{options} don't
% change anything at this time. Instead they only get marked for a later use,
% when a caption inside of a floating environment of the particular type
% \meta{float type} gets typeset.
% For example
% \begin{quote}
%   |\captionsetup[figure]|\marg{options}
% \end{quote}
% forces captions within a |figure| environment to use the given \meta{options}.
%
% Here comes an example to illustrate this:
% \begin{quote}
%   |\captionsetup{font=small}|\\
%   |\captionsetup[figure]{labelfont=bf}|
% \end{quote}
% gives captions like this:
% \begin{Example}
%   \captionsetup{font=small}
%   \captionsetup[figure]{labelfont=bf}
%   \captionof{figure}[]{A figure}
%   \captionsetup{belowskip=\abovecaptionskip}
%   \captionof{table}[]{A table}
% \end{Example}
% 
% As you see the command |\captionsetup[figure]{labelfont=bf}| only changed
% the font of the figure caption labels, not touching all other ones.
% 
% \DescribeMacro{\clearcaptionsetup}
% If you want to get rid of these parameters marked for an automatic use within
% a particular environment you can use the command
% \begin{quote}
%   |\clearcaptionsetup|\marg{Typ}\quad.
% \end{quote}
%
% For example |\clearcaptionsetup{figure}| would clear the extra handling in the
% example above:
% \begin{Example}
%   \captionsetup{font=small}
%   \captionof{figure}[]{A figure}
%   \captionsetup{belowskip=\abovecaptionskip}
%   \captionof{table}[]{A table}
% \end{Example}
% 
% As \meta{float type} you can usually give one of these only two:
% |figure| and |table|.
% But as we will see later some \LaTeX\ packages exist (like the \package{float}
% package for example) who can define additional floating enviroments and these two
% commands also works with them.
% 
% 
% \pagebreak[3]
% \section{Do it yourself!}
% \label{declare}
% 
% A family of commands is provided to allow users to define their own formats.
% This enables information on separators, justification, fonts, and styles to
% be associated with a name and kept in one place
% (these commands need to appear in the document preamble,
% this is the part between |\documentclass| and |\begin{document}|).
% 
% \pagebreak[2]
% \DescribeMacro{\DeclareCaptionFormat}
% You can define your own caption formats using the command
% \begin{quote}
%   |\DeclareCaptionFormat|\marg{name}\marg{code using \#1, \#2 and \#3}\quad.
% \end{quote}
% At usage the system replaces \#1 with the caption label, \#2 with the
% separator and \#3 with the text. So the standard format |default| is defined
% inside |caption.sty| as
% \begin{quote}
%   |\DeclareCaptionFormat{default}{#1#2#3\par}|
% \end{quote}
% 
% \DescribeMacro{\DeclareCaptionLabelFormat}
% Likewise you can define your own caption label formats:
% \begin{quote}
%   |\DeclareCaptionLabelFormat|\marg{name}\marg{code using \#1 and \#2}
% \end{quote}
% At usage \#1 gets replaced with the name (e.g. ``figure'') and \#2
% gets replaced with the reference number (e.g. ``12'').
% 
% \DescribeMacro{\bothIfFirst}
% \DescribeMacro{\bothIfSecond}
% When you define your own caption label formats and use the \package{subfig}
% package\cite{subfig}, too, you must 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 is empty,
% |\bothIfSecond| tests if the second argument is empty. If it is so
% both arguments get typeset, otherwise none of them.
% 
% For example the standard label format |simple| isn't defined as
% \begin{quote}
%   |\DeclareCaptionLabelFormat{simple}{#1 #2}|\quad,
% \end{quote}
% because this could cause an extra space if \#1 is empty. Instead |simple|
% is defined as
% \begin{quote}
%   |\DeclareCaptionLabelFormat{simple}{\bothIfFirst{#1}{ }#2}|\quad,
% \end{quote}
% causing the space to appear only if the label name is present.
% 
% \pagebreak[3]
% \DescribeMacro{\DeclareCaptionLabelSeparator}
% You can define your own caption label separators with
% \nopagebreak[3]
% \begin{quote}
%   |\DeclareCaptionLabelSeparator|\marg{name}\marg{code}\quad.
% \end{quote}
% \nopagebreak[3]
% Again an easy example taken from |caption.sty| itself:
% \nopagebreak[3]
% \begin{quote}
%   |\DeclareCaptionLabelSeparator{colon}{: }|
% \end{quote}
% \pagebreak[3]
% 
% \DescribeMacro{\DeclareCaptionJustification}
% You can define your own caption justifications with
% \begin{quote}
%   |\DeclareCaptionJustification|\marg{name}\marg{code}\quad.
% \end{quote}
% The \meta{code} simply gets typeset just before the caption.
% E.g.~using the justification |raggedright|, which is defined as
% \begin{quote}
%   |\DeclareCaptionJustification{raggedright}{\raggedright}|\quad,
% \end{quote}
% yields captions with all lines moved to the left margin.
% 
% \DescribeMacro{\DeclareCaptionFont}
% You can define your own caption fonts with
% \begin{quote}
%   |\DeclareCaptionFont|\marg{name}\marg{code}\quad.
% \end{quote}
% For example this package defines the options |small| and |bf| as
% \begin{quote}
%   |\DeclareCaptionFont{small}{\small}|\quad and\\
%   |\DeclareCaptionFont{bf}{\bfseries}|\quad.
% \end{quote}
% 
% \DescribeMacro{\DeclareCaptionStyle}
% The best one comes at last: You can define your own caption styles with
% \begin{quote}
%   |\DeclareCaptionStyle|\marg{name}\oarg{additional options}\marg{options}
% \end{quote}
% Remember, caption styles are just a collection of suitable options, saved
% under a given name. You can wake up these options at any time with the
% option |style=|\meta{style name}.
%
% All caption styles are based on the default set of options. (See section
% \ref{style}: \textit{``Styles''} for a complete list.) So you only need
% to specify options which are different to them.
% 
% If you specify \meta{additional options} they get used in addition when
% the caption fits into a single line and this check was not disabled with
% the option |singlelinecheck=off|.
% 
% Again a very easy example taken from |caption.sty|:
% \begin{quote}
%   |\DeclareCaptionStyle{default}[justification=centering]{}|
% \end{quote}
% 
% 
% \subsection{Examples}
% 
% If you would like to have a colon \emph{and} a line break as caption
% separator you could define it this way:
% \begin{quote}
%   |\DeclareCaptionLabelSeparator{period-newline}{. \newline}|
% \end{quote}
% Selecting this separator with |\captionsetup{labelsep=period-newline}| you
% get captions like this:
% \begin{Example}
%   \captionsetup{labelsep=period-newline,labelfont=bf,margin=10pt}
%   \captionsetup{aboveskip=0pt}
%   \captionof{figure}[]{\figuretext}
% \end{Example}
% 
% For short captions---which fit into one single line---this separator
% may not be satisfying, even when the automatically centering process
% is switched off (with |singlelinecheck=off|):
% \begin{Example}
%   \captionsetup{labelsep=period-newline,labelfont=bf,margin=10pt,singlelinecheck=0}
%   \captionsetup{aboveskip=0pt}
%   \captionof{figure}[]{A figure.}
% \end{Example}
% 
% An own caption style which selects another caption separator automatically
% puts this right:
% \begin{quote}
%   |\DeclareCaptionStyle{period-newline}%|\\
%   |  [labelsep=period]{labelsep=period-newline}|
% \end{quote}
% \begin{Example}
%   \captionsetup{style=period-newline,labelfont=bf,margin=10pt}
%   \captionsetup{aboveskip=0pt}
%   \captionof{figure}[]{A figure.}
% \end{Example}
% If you would like to keep the centering of these captions an appropriate
% definition is
% \begin{quote}
%   |\DeclareCaptionStyle{period-newline}%|\\
%   |  [labelsep=period,justification=centering]%|\\
%   |  {labelsep=period-newline}|
% \end{quote}
% Using this definition short captions look like
% \begin{Example}
%   \captionsetup{style=period-newline2,labelfont=bf,margin=10pt}
%   \captionsetup{aboveskip=0pt}
%   \captionof{figure}[]{A figure.}
% \end{Example}
% while long ones still have a line break after the caption label.
% 
% \pagebreak[3]
% Another example: You want captions to look like this:
% \begin{Example}
%   \captionsetup{format=reverse,labelformat=fullparens,labelsep=fill,font=small,labelfont=it}
%   \captionsetup{aboveskip=0pt}
%  \captionof{figure}[]{\figuretext}
% \end{Example}
% \pagebreak[2]
% You could do it this way:
% \nopagebreak[3]
% {\leftmargini=10pt
%  \begin{quote}
%    |\DeclareCaptionFormat{reverse}{#3#2#1}|\\
%    |\DeclareCaptionLabelFormat{fullparens}{(\bothIfFirst{#1}{ }#2)}|\\
%    |\DeclareCaptionLabelSeparator{fill}{\hfill}|\\
%    |\captionsetup{format=reverse,labelformat=fullparens,|\\
%    |              labelsep=fill,font=small,labelfont=it}|
%  \end{quote}}
% 
% \pagebreak[3]
% Another example: The caption text should go into the left margin; a possible
% solution would be:
% {\leftmargini=10pt
%  \begin{quote}
%    |\DeclareCaptionFormat{llap}{\llap{#1#2}#3\par}|\\
%    |\captionsetup{format=llap,singlelinecheck=no,|\\
%    |              labelsep=quad}|
%  \end{quote}}
% As a result you would get captions like this:
% \begin{Example}
%   \captionsetup{format=llap,singlelinecheck=no,labelsep=quad}
%   \captionsetup{aboveskip=0pt}
%   \captionof{figure}[]{\figuretext}
% \end{Example}
% 
% 
% \pagebreak[3]
% \section{Using non-standard document classes}
% 
% \NEWdescription{v3.0c}
% The \thispackage\ package was developed using the standard document classes
% |article|, |report| and |book|. But it should work with other document
% classes, too. (If there are any difficulties about a special document class
% please don't hesitate to write me an e-mail. Thank you.)
% 
% If you would like to use the \thispackage\ package with the
% \KOMAScript\ classes or with the \package{memoir} class, you have to take
% into consideration that all the possibilities for customization of the
% captions the \KOMAScript\ classes or \package{memoir} class have
% to offer will get lost. (And they have a lot of possibilites to offer!)
% So commands like |\captionabove|, |\captionbelow|, |\captionformat|,
% |\figureformat|, |\tableformat|, |\setcapindent|, |\setcaphanging|,
% |\captionstyle| etc.\ will not work anymore.
% So make a wise decision!
% 
% 
% \section{Using other packages}
% \label{packages}
% 
% The \thispackage\ package contains special adaptions to other packages who
% handle with captions, too, so the captions always should look like you
% have specified them to look like.
%
% These are the packages the \thispackage\ package is adapted to:
% 
% \begin{tabular}{ll}
%   |float|        & Gives you the possibility to define new floating environments\\
%   |listings|     & Typesets source code listings\\
%   |longtable|    & Typesets tables spanned over multiple pages\\
%   |rotating|     & Supports rotated figures and tables\\
%   |sidecap|      & Offers captions \emph{beside} figures or tables\\
%   |supertabular| & Typesets tables spanned over multiple pages\\
% \end{tabular}
% 
% \NEWfeature{v3.0b}
% If you use one of the above packages together with the {\thispackage} package
% you get the additional possibility to set up captions with
% \begin{quote}|\captionsetup|\oarg{environment}\marg{options}\quad.\end{quote}
% These options will apply for captions inside these environments automatically.
% For example
% \begin{quote}|\captionsetup[lstlisting]{labelfont=bf}|\end{quote}
% forces captions inside the |lstlisting| environment to have bold labels.
% (Please note that this do not work with the |sideways| environments offered by
% the \package{rotating} package.)
% 
% If a certain support is not desired you can switch it off using the
% \thispackage\ package option
% \begin{quote}
%   |\usepackage[|\ldots|,|\meta{package}|=no]{caption}|\quad.
% \end{quote}
% For example specifing the option |float=no| means you don't like the
% \thispackage\ package to support the \package{float} package.
% (Note: You can specify these options only within the |\usepackage| command,
%  especially \emph{not} at a later time with |\captionsetup|.)
% 
% For further information about the supported packages please take a look
% at the documentation belonging to it or buy yourself
% The \LaTeX\ Companion\cite{companion}.
% 
% 
% \subsection{The \package{float} package}
% 
% A very useful feature is provided by the \package{float} package\cite{float}:
% It offers the float placement specifier |H| which is much more restrictive
% than the specifier |h| offered by \LaTeX. While the latter one is only a
% recommendation to \LaTeX\ to set the float ``here'', the |H| forces the
% float to appear exactly at the spot where it occurs in your input file
% and nowhere else.
%
% Furthermore it offers different styles for floating environments, these
% styles are |plain|, |plaintop|, |ruled|, and |boxed|.
% You can link one of these styles to either new floating environments or
% to one of the existing environments |figure| and |table|.
% 
% If you are using the \thispackage\ package together with the \package{float}
% package this caption style called |ruled| gets defined automatically:
% \begin{quote}
%   |\DeclareCaptionStyle{ruled}{labelfont=bf,labelsep=space}|
% \end{quote}
% This style represents the caption layout in |ruled| styled floats.
% For you as an end user this means that captions within |ruled| floats will
% always look like this, nevertheless what generic caption options do you
% specify:
% 
% \ifx\floatstyle\undefined
% 
% \begin{Example}
% \hrule height.8pt depth0pt \kern2pt
% \vbox{\strut{\bfseries Program \ref{packages}.1}
%    The first program. This hasn't got anything to do with the package
%    but is included as an example. Note the \texttt{ruled} float style.}
% \kern2pt\hrule\kern2pt
% \begin{verbatim}
% #include <stdio.h>
% 
% int main(int argc, char **argv)
% {
%        for (int i = 0; i < argc; ++i)
%                printf("argv[%d] = %s\n", i, argv[i]);
%        return 0;
% }
% \end{verbatim}
% \kern2pt\hrule\relax
% \end{Example}
% 
% \else
% 
% \floatstyle{ruled}
% \newfloat{Program}{tbp}{lop}[section]
% \floatname{Program}{Program}
% 
% \begin{Program}[H]
% \begin{verbatim}
% #include <stdio.h>
% 
% int main(int argc, char **argv)
% {
%        for (int i = 0; i < argc; ++i)
%                printf("argv[%d] = %s\n", i, argv[i]);
%        return 0;
% }
% \end{verbatim}
% \caption{The first program. This hasn't got anything to do with the package
%    but is included as an example. Note the \texttt{ruled} float style.}
% \end{Program}
% 
% \fi
% 
% If you want a different layout for |ruled| captions you have to define
% your own one using the command
% \begin{quote}
%   |\DeclareCaptionStyle{ruled}|\marg{options}\quad.
% \end{quote}
% 
% This mechanism also works with all other float styles. If you want a special
% caption layout for |plain| or |boxed| floats for example you can simply define
% a suitable caption style with the same name as the float style.
% 
% 
% \subsection{The \package{listings} package}
% 
% \NEWdescription{v3.0b}
% The \package{listings} package\cite{listings} is a source code printer for \LaTeX.
% You can typeset stand alone files as well as listings with an environment
% similar to \texttt{verbatim} as well as you can print code snippets using
% a command similar to |\verb|.
% Many parameters control the output and if your preferred programming
% language isn't already supported, you can make your own definition.
%
% \textbf{Note:} For successful cooperation you need the listings package
% version 1.2 or higher. You'll get an error message when using an
% older version!
%
% 
% \subsection{The \package{longtable} package}
% 
% The \package{longtable} package\cite{longtable} offers the environment
% |longtable| which behaves similar to the |tabular| environment, but
% the table itself can span multiple pages.
% 
% 
% \subsection{The \package{rotating} package}
% 
% The \package{rotating} package\cite{rotating} offers the floating
% environments \texttt{sideways\-figure} and \texttt{sideways\-table}
% which are just like normal figures and tables but rotated by 90 degree.
% Furthermore they always use a full page on their own.
% 
% 
% \subsection{The \package{sidecap} package}
% 
% \NEWdescription{v3.0b}
% The \package{sidecap} package\cite{sidecap} offers the floating
% environments |SCfigure| and |SCtable| which are like normal figures
% and tables but the caption will be put \emph{beside} the contents.
% 
% The \package{sidecap} package offers it's own options for justification.
% If set, they will override the one specified with the caption option
% |justification=| for captions beside their contents.
%
% \DescribeMacro{listof=}
% Using the \package{sidecap} package you will probably notice that
% suppressing the entry in the list of figures or tables with
% |\caption[]{|\ldots|}| won't work inside these environments.
% This is caused by the implementation design of the \package{sidecap}
% package, but you can use |\captionsetup{listof=false}| inside the
% figure or table as an alternative here.
% 
% \ifx\SCfigure\undefined
% 
% \begin{Example}
%   \newsavebox\scbox
%   \begin{lrbox}{\scbox}
%     \setlength{\unitlength}{.75cm}
%     \setlength{\fboxsep}{0pt}
%     \fbox{\begin{picture}(4,4)
%       \put(1,3){\circle{1}}
%       \put(3,3){\circle{1}}
%       \put(2,2){\circle{1}}
%       \put(1,1){\circle{1}}
%       \put(3,1){\circle{1}}
%     \end{picture}}
%   \end{lrbox}
%   \newlength\scboxwidth
%   \setlength\scboxwidth{\wd\scbox}
%   \makebox[\linewidth][c]{
%     \parbox[b]{\scboxwidth}{\unhbox\scbox}
%     \hspace\marginparsep
%     \parbox[b]{1.5\scboxwidth}{
%       \captionsetup{justification=RaggedRight,labelfont=bf}
%       \captionof{figure}[]{A small example with the caption beside the figure.}
%     }
%   }
% \end{Example}
% 
% \else
% 
% \captionsetup{labelfont=bf}
% \begin{SCfigure}[1.5][!ht]
%   \setlength{\unitlength}{.75cm}
%   \setlength{\fboxsep}{0pt}
%   \fbox{\begin{picture}(4,4)
%     \put(1,3){\circle{1}}
%     \put(3,3){\circle{1}}
%     \put(2,2){\circle{1}}
%     \put(1,1){\circle{1}}
%     \put(3,1){\circle{1}}
%   \end{picture}}
% \iffalse
% \captionsetup{labelfont=bf}
% \fi
%   \caption[]{A small example with the caption beside the figure.}
% \end{SCfigure}
% \captionsetup{labelfont=default}
% 
% \fi
% 
% 
% \subsection{The \package{supertabular} package}
% 
% The \package{supertabular} package\cite{supertabular} offers the environment
% |supertabular| which is quite similar to the |longtable| environment provided
% by the \package{longtable} package. Both offers the typesetting of tables
% which can span multiple pages. For a detailed discussion about the
% differences between these powerful packages please take a look at
% The \LaTeX\ Companion\cite{companion}.
% 
% 
% \subsection{Known incompatibilities}
% 
% \NEWdescription{v3.0b}
% Using the \thispackage\ package together with one of the following packages
% is not recommended; usually this would cause unwanted side effects or even
% errors:
% \begin{quote}
% \package{ccaption}, \package{hvfloat}, \package{nonfloat}
% \end{quote}
%
% Furthermore using the \package{hypcap} package will cause major limitations:
% All extensions to the |\caption| command gets lost, the option |labelformat=|
% is not working at all and local settings done with
% |\captionsetup[|\ldots|]{|\ldots|}| lead not to the desired results.
% This is caused by the implementation design of the \package{hypcap} package,
% see section 1.3 ``Limitations'' of the \package{hypcap} documentation for
% details.
% 
% 
% \section{Compatibility to older versions}
% 
% \subsection{\thispackage\ version $1.x$}
% 
% This version of the \thispackage\ package still supports the old options
% and commands provided by the version $1.x$ of this package. So there
% shouldn't occur any problems compiling old documents, but please don't mix
% old options and commands with the new ones. This isn't supported and can
% yield to ugly side effects.
% 
% Here comes a short oversight of the old options and commands and how they
% are replaced within this version of the \thispackage\ package:
% 
% \begin{small}\begin{longtable}{ll}
% \thispackage\ $1.\mathit{x}$ & \thispackage\ $3.\mathit{x}$\\
% \hline
% \endhead
% |normal|                           & |format=default|\\
% |hang|                             & |format=hang|\\
% |isu|                              & |format=hang|\\
% |center|                           & |justification=centering|\\
% |centerlast|                       & |justification=centerlast|\\
% |anne|                             & |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|\\
% |\setlength{\captionmargin}|       & |margin=|\meta{amount}\\
% |\renewcommand{\captionfont}|      & |\DeclareCaptionFont|\\
%                                    & $+$ |\captionsetup{font=|\meta{name}|}|\\
% |\renewcommand{\captionsize}|      & |\DeclareCaptionFont|\\
%                                    & $+$ |\captionsetup{font=|\meta{name}|}|\\
% |\renewcommand{\captionlabelfont}| & |\DeclareCaptionLabelFont|\\
%                                    & $+$ |\captionsetup{labelfont=|\meta{name}|}|\\
% \end{longtable}\end{small}
% 
% 
% \subsection{\package{caption2} version $2.x$}
% 
% Although they do very similar stuff the packages \package{caption} and
% \package{caption2} have a very different implementation design. So this
% version of the \thispackage\ package isn't compatible to the
% \package{caption2} package at all. Of course for compiling old documents
% you can still use the \package{caption2} package, the latest version
% is provided with this package. But newly created documents shouldn't use
% the \package{caption2} package, please use the \thispackage\ package
% instead as described in this manual.
% 
% \iffalse
% TODO: Table like the "caption 1.x => caption 3.x" one
% \fi
% 
% 
% \pagebreak[3]
% \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}\texttt{http://faq.tug.org/}\end{quote}
%
% \item
%   A French FAQ can be found at
%   \begin{quote}\texttt{http://www.grappa.univ-lille3.fr/FAQ-LaTeX/}\end{quote}
% 
% \item
%   \textsf{epslatex} from Keith Reckdahl contains many tips around
%   graphics in \LaTeXe. You will find this document in the directory
%   \begin{quote}\texttt{ftp://ftp.ctan.org/pub/tex/info/}\end{quote}
%   as \texttt{epslatex.ps} and \texttt{epslatex.pdf}.
%
%   There is also a french translation available:
%   \begin{quote}\texttt{ftp://ftp.ctan.org/pub/tex/info/fepslatex.ps}\end{quote}
% \end{itemize}
% 
% 
% \section{Thanks}
% 
% I would like to thank Katja Melzner, Steven D. Cochran,
% Frank Mittelbach, David Carlisle, and Ivor Tiefenbrun.
%
%
% \changes{v1.0}{27 Oct 94}{First release}
% \changes{v1.1}{ 3 Nov 94}{New captiontype \cs{centerlast}}
% \changes{v1.2}{28 Nov 94}{Support of the {\sf float} package}
% \changes{v1.3}{ 8 Jan 95}{Support of \cs{captionlabelfont} in subcaptions}
% \changes{v1.4}{30 Jan 95}{New option \cs{nooneline}}
% \changes{v3.0}{10 Jul 03}{Rewritten; many new commands and features}
% \changes{v3.0a}{22 Jan 04}{Some bugfixes and small design changes}
% \changes{v3.0b}{14 May 04}{Some bugfixes and small improvements}
% \changes{v3.0c}{15 Jul 04}{Bugfix regarding rotating and sidecap package support}
%
% \StopEventually{\begin{thebibliography}{9}
%   \bibitem{companion}
%   Frank Mittelbach and Michel Goossens:
%   \newblock {\em The {\LaTeX} Companion (2nd.~Ed.)},
%   \newblock Addison-Wesley, 2004.
% 
%   \bibitem{float}
%   Anselm Lingnau:
%   \emph{An Improved Environment for Floats},
%   2001/11/08
% 
%   \bibitem{listings}
%   Carsten Heinz:
%   \emph{The Listings Package},
%   2004/02/13
% 
%   \bibitem{longtable}
%   David Carlisle:
%   \emph{The longtable package},
%   2000/10/22
% 
%   \bibitem{rotating}
%   Sebastian Rahtz and Leonor Barroca:
%   \emph{A style option for rotated objects in \LaTeX},
%   1997/09/26
% 
%   \bibitem{sidecap}
%   Rolf Niepraschk und Hubert G\"a\ss lein:
%   \emph{The sidecap package},
%   2003/06/06
% 
%   \bibitem{subfig}
%   Steven D. Cochran:
%   \emph{The subfig package},
%   2004/01/16
% 
%   \bibitem{supertabular}
%   Johannes Braams und Theo Jurriens:
%   \emph{The supertabular environment},
%   2002/07/19
% \end{thebibliography}}
%
% \DoNotIndex{\\,\_,\ ,\@@par}
% \DoNotIndex{\@classoptionslist,\@currext,\@currname}
% \DoNotIndex{\@ehc,\@ehd,\@empty,\@expandtwoargs}
% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
% \DoNotIndex{\@ifnextchar,\@ifstar,\@ifundefined,\@latex@error}
% \DoNotIndex{\@namedef,\@nameuse}
% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setpar}
% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempb,\@tempc}
% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
% \DoNotIndex{\p@,\z@}
% \DoNotIndex{\active,\addtocounter,\addtolength,\advance}
% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
% \DoNotIndex{\fi,\footnotesize,\global}
% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
% \DoNotIndex{\ifx,\ignorespaces,\itshape}
% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
% \DoNotIndex{\next,\nobreakspace,\noexpand,\noindent,\numberline}
% \DoNotIndex{\normalsize,\or,\par,\parbox,\parfillskip}
% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\providecommand}
% \DoNotIndex{\quad}
% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
% \DoNotIndex{\rightskip,\rmfamily}
% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
% \DoNotIndex{\small,\string,\space,\strut}
% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
% \DoNotIndex{\vbox,\vsize,\vskip,\wd,\width,\z@skip}
% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
% \DoNotIndex{\ProcessOptions,\ProvidesPackage}
%
% \clearpage
% \setlength{\parskip}{0pt plus 1pt}
%
% \section{The Implementation}
% \iffalse
%<*package>
% \fi
%
% I'm sorry for the missing code documentation, I will do this ASAP.
%
%    \begin{macrocode}
%
% Identification
%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesPackage{caption}[2004/07/16 v3.0c Customising captions (AS)]
%    \end{macrocode}
%
% \subsection{Kernel}
%
%    \begin{macrocode}
%\NeedsTeXFormat{LaTeX2e}[1994/12/01]
%\ProvidesPackage{caption3}[2004/xx/xx v3.1 caption3 kernel (AS)]
%
% Helpers
%
\providecommand*\@nameundef[1]{%
  \expandafter\let\csname #1\endcsname\@undefined}
%
\providecommand\l@addto@macro[2]{%
  \begingroup
    \toks@\expandafter{#1#2}%
    \edef\@tempa{\endgroup\def\noexpand#1{\the\toks@}}%
  \@tempa}
%
\def\bothIfFirst#1#2{%
  \protected@edef\caption@tempa{#1}%
  \ifx\caption@tempa\@empty\else
    #1#2%
  \fi}
\def\bothIfSecond#1#2{%
  \protected@edef\caption@tempa{#2}%
  \ifx\caption@tempa\@empty\else
    #1#2%
  \fi}
%
\def\caption@ifinlist#1#2{%
  \let\next\@secondoftwo
  \edef\caption@tempa{#1}%
  \@for\caption@tempb:={#2}\do{%
    \ifx\caption@tempa\caption@tempb
      \let\next\@firstoftwo
    \fi}%
  \next}
%
% Setting boolean options:
% \caption@setbool{<name>}{<value> = false/true/no/yes/off/on/0/1}
% \caption@ifbool{<name>}{<if-clause>}{<else-clause>}
%
\def\caption@setbool#1#2{%
  \caption@ifinlist{#2}{1,true,yes,on}{%
    \expandafter\let\csname caption@if#1\endcsname\@firstoftwo
  }{\caption@ifinlist{#2}{0,false,no,off}{%
    \expandafter\let\csname caption@if#1\endcsname\@secondoftwo
  }{%
    \PackageError{caption}{Undefined boolean value `#2'}{\caption@eh}%
  }}}
%
\def\caption@ifbool#1{\@nameuse{caption@if#1}}
%
% Obsolete stuff for compatiblity to caption.sty v1.3
%
% \changes{v3.0a}{16 Jul 04}{Minimum adaption to the memoir class}
\providecommand\captionsize{}%  changed v3.0a+c
%
% Margin resp. width
%
\newdimen\captionmargin
\newdimen\captionwidth
\newif\ifcaption@width
\newcommand\caption@setmargin{%
  \caption@widthfalse
  \setlength\captionmargin}
\newcommand\caption@setwidth{%
  \caption@widthtrue
  \setlength\captionwidth}
%
% Indentions
%
\newdimen\captionindent
\newdimen\captionparindent
\newdimen\captionhangindent
%
% Support of \caption*
%
\newif\ifcaption@star
%
% Vertical spaces before/after captions
%
\@ifundefined{abovecaptionskip}{%
  \newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@}}{}
\@ifundefined{belowcaptionskip}{%
  \newlength\belowcaptionskip\setlength\belowcaptionskip{0\p@}}{}
%
% Error
%
\newcommand\caption@eh{%
  If you do not understand this error, please take a closer look\MessageBreak
  at the documentation of the `caption' package.\MessageBreak
  \@ehc}
%
% Loading the keyval package
% (We need it for option handling)
%
\RequirePackage{keyval}[1997/11/10]
\providecommand*\undefine@key[2]{%
  \@nameundef{KV@#1@#2}\@nameundef{KV@#1@#2@default}}
%
% Reset to default parameters
% (Note that this does not touch the skips and the positioning.)
%
\newcommand\caption@setdefault{\captionsetup{%
  format=default,labelformat=default,labelsep=default,justification=default,%
  font=default,labelfont=default,textfont=default,%
  margin=0pt,indention=0pt,parindent=0pt,hangindent=0pt,singlelinecheck}}
%
% \DeclareCaptionStyle{<name>}[<additional(!) single-line-list-of-KV>]{<list-of-KV>}
% \caption@setstyle{<name>}
%
% (Bugfix v3.0a: We pass through argument #3 so extra spaces between the
%  arguments do make any harm.)
%
\newcommand*\DeclareCaptionStyle[1]{%
  \@ifnextchar[{\caption@declarestyle{#1}}{\caption@declarestyle{#1}[]}}
\def\caption@declarestyle#1[#2]#3{%  bugfixed v3.0a
  \global\@namedef{caption@sls@#1}{#2}%
  \global\@namedef{caption@sty@#1}{#3}}
\@onlypreamble\DeclareCaptionStyle
\@onlypreamble\caption@declarestyle
%
\newcommand*\caption@setstyle[1]{%
  \@ifundefined{caption@sty@#1}%
    {\PackageError{caption}{Undefined caption style `#1'}{\caption@eh}}%
    {\expandafter\let\expandafter\caption@sls\csname caption@sls@#1\endcsname
     \caption@setdefault\caption@esetup{\csname caption@sty@#1\endcsname}}}
%
% Pre-defined styles
%
\DeclareCaptionStyle{default}[justification=centering]{}
%
% \DeclareCaptionFormat{<name>}{<code with #1, #2, and #3>}
% \caption@setformat{<name>}
%
\newcommand\DeclareCaptionFormat[2]{%  bugfixed v3.0a
  \global\long\expandafter\def\csname caption@fmt@#1\endcsname##1##2##3{#2}}
\@onlypreamble\DeclareCaptionFormat
%
\newcommand*\caption@setformat[1]{%
  \@ifundefined{caption@fmt@#1}%
    {\PackageError{caption}{Undefined caption format `#1'}{\caption@eh}}%
    {\expandafter\let\expandafter\caption@fmt\csname caption@fmt@#1\endcsname}}
%
% Pre-defined formats
%
\DeclareCaptionFormat{normal}{#1#2#3\par}
\DeclareCaptionFormat{hang}{%
  \@hangfrom{#1#2}%
  \advance\captionparindent\hangindent
  \advance\captionhangindent\hangindent
  \caption@@par
  #3\par}
\def\caption@fmt@default{\caption@fmt@normal}
%
% \DeclareCaptionLabelFormat{<name>}{<code with #1 and #2>}
% \caption@setlabelformat{<name>}
%
\newcommand*\DeclareCaptionLabelFormat[2]{%  bugfixed v3.0a
  \global\expandafter\def\csname caption@lfmt@#1\endcsname##1##2{#2}}
\@onlypreamble\DeclareCaptionLabelFormat
%
\newcommand*\caption@setlabelformat[1]{%
  \@ifundefined{caption@lfmt@#1}%
    {\PackageError{caption}{Undefined caption label format `#1'}{\caption@eh}}%
    {\expandafter\let\expandafter\caption@lfmt\csname caption@lfmt@#1\endcsname}}
%
% Pre-defined label formats
%
\DeclareCaptionLabelFormat{empty}{}
\DeclareCaptionLabelFormat{simple}{\bothIfFirst{#1}{\nobreakspace}#2}
\DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{\nobreakspace}(#2)}
\def\caption@lfmt@default{\caption@lfmt@simple}
%
% \DeclareCaptionLabelSeparator{<name>}{<code>}
% \caption@setlabelseparator{<name>}
%
\newcommand\DeclareCaptionLabelSeparator[2]{%  bugfixed v3.0a
  \global\long\@namedef{caption@lsep@#1}{#2}}
\@onlypreamble\DeclareCaptionLabelSeparator
%
\newcommand*\caption@setlabelseparator[1]{%
  \@ifundefined{caption@lsep@#1}%
    {\PackageError{caption}{Undefined caption label separator `#1'}{\caption@eh}}%
    {\expandafter\let\expandafter\caption@lsep\csname caption@lsep@#1\endcsname}}
%
% Pre-defined label separators
%
\DeclareCaptionLabelSeparator{none}{}
\DeclareCaptionLabelSeparator{colon}{: }
\DeclareCaptionLabelSeparator{period}{. }
\DeclareCaptionLabelSeparator{space}{ }
\DeclareCaptionLabelSeparator{quad}{\quad}
\DeclareCaptionLabelSeparator{newline}{\newline}
\DeclareCaptionLabelSeparator{widespace}{\hspace{1em plus .3em}}%  obsolete, do not use!
\def\caption@lsep@default{\caption@lsep@colon}
%
% \DeclareCaptionJustification{<name>}{<code>}
% \caption@setjustification{<name>}
%
\newcommand*\DeclareCaptionJustification[2]{%  bugfixed v3.0a
  \global\@namedef{caption@hj@#1}{#2}}
\@onlypreamble\DeclareCaptionJustification
%
\newcommand*\caption@setjustification[1]{%
  \@ifundefined{caption@hj@#1}%
    {\PackageError{caption}{Undefined caption justification `#1'}{\caption@eh}}%
    {\expandafter\let\expandafter\caption@hj\csname caption@hj@#1\endcsname}}
%
% Pre-defined justifications
%
\newcommand\caption@centerfirst{%
  \edef\caption@normaladjust{%
    \leftskip\the\leftskip
    \rightskip\the\rightskip
    \parfillskip\the\parfillskip\relax}%
  \leftskip\z@\@plus -1fil%
  \rightskip\z@\@plus 1fil%
  \parfillskip\z@skip
  \noindent\hskip\z@\@plus 2fil%
  \@setpar{\@@par\@restorepar\caption@normaladjust}}
\newcommand\caption@centerlast{%
  \leftskip\z@\@plus 1fil%
  \rightskip\z@\@plus -1fil%
  \parfillskip\z@\@plus 2fil\relax}
%
\DeclareCaptionJustification{justified}{}
\DeclareCaptionJustification{centering}{\centering}
\DeclareCaptionJustification{centerfirst}{\caption@centerfirst}
\DeclareCaptionJustification{centerlast}{\caption@centerlast}
\DeclareCaptionJustification{raggedleft}{\raggedleft}
\DeclareCaptionJustification{raggedright}{\raggedright}
\def\caption@hj@default{\caption@hj@justified}
%
% ragged2e package support (improved for v3.0b)
% ---------------------------------------------
\DeclareCaptionJustification{Centering}{%
  \caption@ragged\Centering\centering}
\DeclareCaptionJustification{RaggedLeft}{%
  \caption@ragged\RaggedLeft\raggedleft}
\DeclareCaptionJustification{RaggedRight}{%
  \caption@ragged\RaggedRight\raggedright}
%
\newcommand*\caption@ragged[2]{%
  \@ifundefined{caption\string#1}{%
    \PackageWarning{caption}{%
      Cannot locate the `ragged2e' package, therefore\MessageBreak
      substituting \string#2 for \string#1\MessageBreak}%
    \global\@namedef{caption\string#1}}{}%
  #2}
%
\AtBeginDocument{\IfFileExists{ragged2e.sty}{%
  \RequirePackage{ragged2e}\let\caption@ragged\@firstoftwo}{}}
% ---------------------------------------------
%
% \DeclareCaptionFont{<name>}{<code>}
% \caption@setfont{<command>}{<keyval-list of names>}
%
\newcommand\DeclareCaptionFont[2]{%  bugfixed v3.0a
  \define@key{caption@fnt}{#1}[]{\g@addto@macro\caption@tempa{#2}}}
\@onlypreamble\DeclareCaptionFont
%
\newcommand*\caption@setfont[2]{%
  \let\caption@tempa\@empty
  \begingroup
    \setkeys{caption@fnt}{#2}%
  \endgroup
  \expandafter\let\csname caption#1\endcsname\caption@tempa}
%
% Pre-defined fonts
%
\DeclareCaptionFont{default}{}
%
\DeclareCaptionFont{scriptsize}{\scriptsize}
\DeclareCaptionFont{footnotesize}{\footnotesize}
\DeclareCaptionFont{small}{\small}
\DeclareCaptionFont{normalsize}{\normalsize}
\DeclareCaptionFont{large}{\large}
\DeclareCaptionFont{Large}{\Large}
%
\DeclareCaptionFont{up}{\upshape}
\DeclareCaptionFont{it}{\itshape}
\DeclareCaptionFont{sl}{\slshape}
\DeclareCaptionFont{sc}{\scshape}
\DeclareCaptionFont{md}{\mdseries}
\DeclareCaptionFont{bf}{\bfseries}
\DeclareCaptionFont{rm}{\rmfamily}
\DeclareCaptionFont{sf}{\sffamily}
\DeclareCaptionFont{tt}{\ttfamily}
%
% Position (default(=bottom)/bottom/top/auto)
% ONLY DEFAULT, BOTTOM AND TOP ARE DOCUMENTED YET!
%
\newcommand*\caption@setposition[1]{%  improved v3.0a
  \caption@ifinlist{#1}{t,top,above}{%
    \let\caption@position\@firstoftwo
  }{\caption@ifinlist{#1}{b,bottom,below,default}{%
    \let\caption@position\@secondoftwo
  }{\caption@ifinlist{#1}{a,auto}{%
    \let\caption@position\@undefined
  }{%
    \PackageError{caption}{Undefined caption position `#1'}{\caption@eh}%
  }}}}
%
% \captionsetup[<type>]{<keyval-list of options>}
% \caption@settype{<type>}
%
% If `type' is set, we simply save or append the option list,
% otherwise we `execute' it with \setkeys
% \changes{v3.0a}{17 Jan 04}{Missing percent added}
%
\def\captionsetup{\@ifnextchar[\caption@setuptype\caption@setup}
\def\caption@setuptype[#1]#2{%  bugfixed v3.0a
  \@ifundefined{caption@typ@#1}%
    {\@namedef{caption@typ@#1}{#2}}%
    {\expandafter\l@addto@macro\csname caption@typ@#1\endcsname{,#2}}}
\def\caption@setup{\setkeys{caption}}
%
\def\caption@esetup#1{%
  \edef\caption@tempa{\noexpand\caption@setup{#1}}%
  \caption@tempa}
%
% Setting up caption type: Simply execute the saved option list
% (For use inside \@caption, \LT@makecaption etc.)
%
\def\caption@settype#1{%
  \@ifundefined{caption@typ@#1}{}{%
    \caption@esetup{\csname caption@typ@#1\endcsname}}}%
\let\caption@setfloattype\caption@settype%  new v3.0a
%
% \clearcaptionsetup{<type>}
%
\newcommand*\clearcaptionsetup[1]{\@nameundef{caption@typ@#1}}
%
% \showcaptionsetup[<package>]{<type>}
% (Note: The optional argument is not documented!)
%
\newcommand*\showcaptionsetup[2][]{%
  \def\caption@tempa{#1}%
  \ifx\caption@tempa\@empty
    \def\caption@tempa{Caption\space}%
  \else
    \def\caption@tempa{#1 Caption\space}%
  \fi
  \GenericWarning{\caption@tempa}{%
    \caption@tempa Info: KV list on `#2'\MessageBreak
    Data: (%
    \@ifundefined{caption@typ@#2}{%
      % Empty -- print nothing.
    }{%
      \@nameuse{caption@typ@#2}%
    }%
    )}}
%
% Hooks (not documented yet...)
%
\newcommand\caption@beginhook{}
\newcommand\caption@endhook{}
\newcommand\AtBeginCaption{\l@addto@macro\caption@beginhook}
\newcommand\AtEndCaption{\l@addto@macro\caption@endhook}
%
% We declare options using the keyval package...
%
% \DeclareCaptionOption{<option>}{<code>}
% \DeclareCaptionOption*{<option>}{<code>}
%
\newcommand\DeclareCaptionOption{%
  \@ifstar{\caption@declareoption\AtEndOfPackage}{\caption@declareoption\@gobble}}
\newcommand*\caption@declareoption[2]{%
  #1{\undefine@key{caption}{#2}}\define@key{caption}{#2}}
\@onlypreamble\DeclareCaptionOption
\@onlypreamble\caption@declareoption
%
% ...and here comes the options
%
\DeclareCaptionOption{default}[]{%
  \caption@setup{style=default,position=default,aboveskip=10pt,belowskip=0pt}}
%
\DeclareCaptionOption{style}{\caption@setstyle{#1}}
\DeclareCaptionOption{format}{\caption@setformat{#1}}
\DeclareCaptionOption{labelformat}{\caption@setlabelformat{#1}}
\DeclareCaptionOption{labelsep}{\caption@setlabelseparator{#1}}
\DeclareCaptionOption{labelseparator}{\caption@setlabelseparator{#1}}
\DeclareCaptionOption{justification}{\caption@setjustification{#1}}
\DeclareCaptionOption{size}{\caption@setfont{size}{#1}}% changed v3.0a
\DeclareCaptionOption{font}{\caption@setfont{font}{#1}}
\DeclareCaptionOption{labelfont}{\caption@setfont{labelfont}{#1}}
\DeclareCaptionOption{textfont}{\caption@setfont{textfont}{#1}}
\DeclareCaptionOption{margin}{\caption@setmargin{#1}}
\DeclareCaptionOption{width}{\caption@setwidth{#1}}
\DeclareCaptionOption{indent}[\leftmargini]{\setlength\captionindent{#1}}
\DeclareCaptionOption{indention}[\leftmargini]{\setlength\captionindent{#1}}
\DeclareCaptionOption{parindent}[\parindent]{\setlength\captionparindent{#1}}% changed v3.0b
\DeclareCaptionOption{hangindent}[0pt]{\setlength\captionhangindent{#1}}% changed v3.0b
\DeclareCaptionOption{parskip}[5pt]{\AtBeginCaption{\setlength\parskip{#1}}}
%
\DeclareCaptionOption{singlelinecheck}[1]{\caption@setbool{slc}{#1}}
\DeclareCaptionOption{aboveskip}{\setlength\abovecaptionskip{#1}}
\DeclareCaptionOption{belowskip}{\setlength\belowcaptionskip{#1}}
\DeclareCaptionOption{position}{\caption@setposition{#1}}
\DeclareCaptionOption{listof}{\caption@setbool{lof}{#1}}% new v3.0b
%
\DeclareCaptionOption{debug}{\def\caption@debug{#1}}
%
% Initialize options
%
\captionsetup{style=default,position=default,listof=1,debug=0}
%
% \caption@fixposition
% \caption@autoposition (new in 3.0b)
%
\newcommand\caption@fixposition{%
  \ifx\caption@position\@undefined
    \caption@autoposition
  \fi}
\newcommand\caption@autoposition{% bugfixed v3.0a
  \ifvmode
    \ifodd\caption@debug\relax
      \edef\caption@tempa{\the\prevdepth}%
      \PackageInfo{caption}{\protect\prevdepth=\caption@tempa}%
    \fi
%
%   \caption@setposition{\ifdim\prevdepth>-\p@ b\else t\fi}%
    \ifdim\prevdepth>-\p@
      \let\caption@position\@secondoftwo
    \else
      \let\caption@position\@firstoftwo
    \fi
  \else
    \ifodd\caption@debug\relax
      \PackageInfo{caption}{no \protect\prevdepth}%
    \fi
%
%   \caption@setposition{b}%
    \let\caption@position\@secondoftwo
  \fi}
%
% \caption@iftop{<true-code>}{<false-code>}
% (If \caption@position is not set we assume a "bottom" position.)
%
\newcommand\caption@iftop{% bugfixed v3.0a
  \ifx\caption@position\@firstoftwo
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi}
%
% Typeset caption
%
\newcommand\caption@make[2]{%
  \caption@@make{\caption@lfmt{#1}{#2}}}
%
\newcommand\caption@@make[2]{%
  \caption@beginhook
%
  \caption@calcmargin
  \advance\captionmargin by \captionindent
  \advance\captionwidth by -\captionindent
  \hskip\captionmargin
  \vbox{\hsize=\captionwidth
% Bugfix v3.0b
    \ifdim\captionindent=\z@\else
      \hskip-\captionindent
    \fi
%
% Special single-line treatment
%
    \caption@ifslc{%
      \ifx\caption@sls\@empty\else
        \caption@beginslc
        \sbox\@tempboxa{\caption@@@make{#1}{#2}}%
        \ifdim\wd\@tempboxa >\hsize
          \caption@endslc
        \else
          \caption@endslc
          \caption@esetup\caption@sls
        \fi
      \fi}{}%
%
    \captionsize\captionfont\strut
    \caption@@@make{#1}{#2}}%
%
  \caption@endhook
  \global\caption@starfalse}
%
% Calculate \captionmargin & \captionwidth
%
\newcommand\caption@calcmargin{%
  \ifcaption@width
    \captionmargin\hsize
    \advance\captionmargin by -\captionwidth
    \divide\captionmargin by 2
  \else
    \captionwidth\hsize
    \advance\captionwidth by -2\captionmargin
  \fi
%
  \ifodd\caption@debug\relax
    \PackageInfo{caption}{\protect\hsize=\the\hsize,
      \protect\margin=\the\captionmargin,
      \protect\width=\the\captionwidth}%
  \fi}
%
% Re-define anything which would disturb the single line check
% Bugfix v3.0b: re-definition of \label was missing here
% Improvement v3.0b: Better solution
%
\newcommand\caption@beginslc{%
  \begingroup
  \let\label\@gobble\let\@footnotetext\@gobble
  \def\stepcounter##1{\advance\csname c@##1\endcsname\@ne\relax}}
% - or -
% \edef\caption@restore{%
%   \noexpand\setcounter{footnote}{\the\value{footnote}}%
%   \noexpand\setcounter{mpfootnote}{\the\value{mpfootnote}}}
\newcommand\caption@endslc{%
% \caption@restore
  \endgroup}
%
% Typeset caption paragraph
%
\newcommand\caption@@@make[2]{%
%
% |\caption*|? Use no caption label and separator!
%
  \ifcaption@star
    \let\caption@lfmt\@gobbletwo
    \let\caption@lsep\relax
  \fi
%
% Empty text? Use no caption label separator!
%
  \def\caption@tempa{#2}%
  \def\caption@tempb{\ignorespaces}%
  \ifx\caption@tempa\caption@tempb
    \let\caption@tempa\@empty
  \fi
  \ifx\caption@tempa\@empty
    \let\caption@lsep\relax
  \fi
%
% Typeset the caption!
%
  \def\caption@@par{%
    \parindent\captionparindent\hangindent\captionhangindent}%
  \@setpar{\@@par\caption@@par}\caption@@par
%
% (Bugfixed in v3.0b: \allowhyphens added)
  \caption@hj\captionsize\captionfont
  \caption@fmt{{\captionlabelfont#1}}%
              {{\captionlabelfont\caption@lsep}}%
              {{\captiontextfont\nobreak\hskip\z@skip#2\par}}}
%    \end{macrocode}
%
% \subsection{Package}
%
%    \begin{macrocode}
%\NeedsTeXFormat{LaTeX2e}[1994/12/01]
%\ProvidesPackage{caption}[2004/xx/xx v3.1 Customising captions (AS)]
%\RequirePackage{caption3}
%
% Add option for loading configuration file
%
\DeclareCaptionOption{config}[caption]{%
   \InputIfFileExists{#1.cfg}{\typeout{*** Local configuration file
                                       #1.cfg used ***}}%
                             {\PackageWarning{caption}{Configuration
                               file #1.cfg not found}}}
%
% \changes{v3.0a}{9 Jan 04}{Options `figureposition' and `tableposition' added}
\DeclareCaptionOption*{figureposition}{\captionsetup[figure]{position=#1}}%  new v3.0a
\DeclareCaptionOption*{tableposition}{\captionsetup[table]{position=#1}}%    new v3.0a
%
% Simulation of the old (caption v1.x) options:
%
\DeclareCaptionOption*{normal}[]{\caption@setformat{normal}}
\DeclareCaptionOption*{isu}[]{\caption@setformat{hang}}
\DeclareCaptionOption*{hang}[]{\caption@setformat{hang}}
\DeclareCaptionOption*{center}[]{\caption@setjustification{centering}}
\DeclareCaptionOption*{anne}[]{\caption@setjustification{centerlast}}
\DeclareCaptionOption*{centerlast}[]{\caption@setjustification{centerlast}}
%
\DeclareCaptionOption*{nooneline}[]{\caption@setbool{slc}{0}}
%
\DeclareCaptionOption*{scriptsize}[]{\def\captionfont{\scriptsize}}
\DeclareCaptionOption*{footnotesize}[]{\def\captionfont{\footnotesize}}
\DeclareCaptionOption*{small}[]{\def\captionfont{\small}}
\DeclareCaptionOption*{normalsize}[]{\def\captionfont{\normalsize}}
\DeclareCaptionOption*{large}[]{\def\captionfont{\large}}
\DeclareCaptionOption*{Large}[]{\def\captionfont{\Large}}
%
\DeclareCaptionOption*{up}[]{\l@addto@macro\captionlabelfont\upshape}
\DeclareCaptionOption*{it}[]{\l@addto@macro\captionlabelfont\itshape}
\DeclareCaptionOption*{sl}[]{\l@addto@macro\captionlabelfont\slshape}
\DeclareCaptionOption*{sc}[]{\l@addto@macro\captionlabelfont\scshape}
\DeclareCaptionOption*{md}[]{\l@addto@macro\captionlabelfont\mdseries}
\DeclareCaptionOption*{bf}[]{\l@addto@macro\captionlabelfont\bfseries}
\DeclareCaptionOption*{rm}[]{\l@addto@macro\captionlabelfont\rmfamily}
\DeclareCaptionOption*{sf}[]{\l@addto@macro\captionlabelfont\sffamily}
\DeclareCaptionOption*{tt}[]{\l@addto@macro\captionlabelfont\ttfamily}
%
\caption@setbool{ruled}{0}
\DeclareCaptionOption*{ruled}[]{\caption@setbool{ruled}{1}}
%
% Options for foreign package support
%
\newcommand*\DeclareCaptionPackage[1]{%
  \caption@setbool{pkt@#1}{1}%
  \DeclareCaptionOption*{#1}{\caption@setbool{pkt@#1}{##1}}}
%
% Compatible packages
% (new in v3.0b: The listings package)
%
\DeclareCaptionPackage{caption}
\DeclareCaptionPackage{float}
\DeclareCaptionPackage{listings}
\DeclareCaptionPackage{longtable}
\DeclareCaptionPackage{rotating}
\DeclareCaptionPackage{sidecap}
\DeclareCaptionPackage{supertabular}
%
\let\DeclareCaptionPackage\@undefined
%
% We process our options using the keyval package
%
\def\ProcessOptionsWithKV#1{% bugfixed v3.0a
  \let\@tempc\relax
  \let\caption@tempa\@empty
  \@for\CurrentOption:=\@classoptionslist\do{%
    \@ifundefined{KV@#1@\CurrentOption}%
    {}%
    {%
      \edef\caption@tempa{\caption@tempa,\CurrentOption,}%
      \@expandtwoargs\@removeelement\CurrentOption
        \@unusedoptionlist\@unusedoptionlist
    }%
  }%
  \edef\caption@tempa{%
    \noexpand\setkeys{#1}{%
      \caption@tempa\@ptionlist{\@currname.\@currext}%
    }%
  }%
  \caption@tempa
% Bugfix, see <400D360C.9678329F@gmx.net> for details
  \let\CurrentOption\@empty
  \AtEndOfPackage{\let\@unprocessedoptions\relax}}
\ProcessOptionsWithKV{caption}
\let\ProcessOptionsWithKV\@undefined
%
% \captionof(*)
%
\def\captionof{\@ifstar{\caption@of{\caption*}}{\caption@of\caption}}
\newcommand*\caption@of[2]{\def\@captype{#2}#1}
%
% ContinuedFloat
%
\providecommand\ContinuedFloat{%
  \ifx\@captype\@undefined
    \@latex@error{\noexpand\ContinuedFloat outside float}\@ehd
  \else
    \addtocounter{\@captype}{\m@ne}%
  \fi}%
%
% \caption@floatname{<type>}
% \caption@thefloat{<type>}
%
\newcommand*\caption@floatname[1]{\@nameuse{#1name}}
\newcommand*\caption@thefloat[1]{\@nameuse{the#1}}
%
% \caption@letfloattype{<type>}
% (new in caption 3.0b)
%
\def\caption@letfloattype#1{%
  \def\caption@setfloattype##1{%
    \caption@settype{##1}\caption@settype{#1}}}
%
% \caption@begin{<type>} (changed in v3.0b)
% \caption@beginex{<type>}{<list entry>}
% \caption@end
%
\newcommand*\caption@begin[1]{%
  \begingroup
  \caption@setfloattype{#1}%
  \@namedef{fnum@#1}{%
    \caption@lfmt{\caption@floatname{#1}}{\caption@thefloat{#1}}}%
%
  \caption@fixposition
  \global\let\caption@fixedposition\caption@position
%
  \caption@@begin{#1}}
\newcommand*\caption@beginex[1]{%
  \caption@begin{#1}%
  \caption@preparelof}
\newcommand*\caption@end{%
  \caption@@end
  \endgroup
%
  \let\caption@position\caption@fixedposition}
%
% \caption@@begin{<type>}
% \caption@@end
%
\let\caption@@begin\@gobble%  new v3.0a
\let\caption@@end\@empty%     new v3.0a
%
% \caption@preparelof{<list entry>}
%
\newcommand*\caption@preparelof[1]{%  changed v3.0b
  \caption@ifbool{lof}%
    {\def\caption@tempa{#1}}%
    {\let\caption@tempa\@empty}%
  \ifx\caption@tempa\@empty
    \def\addcontentsline##1##2##3{}%
  \fi}
%
% CAPTION SUPPORT
% ===============
%
\caption@ifpkt@caption{
%
% \@makecaption{<label>}{<text>}
% Original code:
% \long\def\@makecaption#1#2{%
%   \vskip\abovecaptionskip
%   \sbox\@tempboxa{#1: #2}%
%   \ifdim \wd\@tempboxa >\hsize
%     #1: #2\par
%   \else
%     \global \@minipagefalse
%     \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
%   \fi
%   \vskip\belowcaptionskip}
%
  \renewcommand\@makecaption[2]{%
    \caption@iftop{\vskip\belowcaptionskip}{\vskip\abovecaptionskip}%
    \ifnum\caption@debug>1 %
      \llap{$\caption@iftop\downarrow\uparrow$ }%
    \fi
    \caption@@make{#1}{#2}%
    \caption@iftop{\vskip\abovecaptionskip}{\vskip\belowcaptionskip}}
%
  \AtBeginDocument{%
    \@ifundefined{cc@caption}{%
%
%     Define \caption* ...
%     (07/18/03: \global added, so this works with sidecap)
%
      \def\caption@caption#1{%
        \@ifstar{\global\caption@startrue\@ifnextchar[{#1}{#1[]}}{#1}}%
%
      \let\caption@old\caption
      \def\caption{\caption@caption\caption@old}%
%
%     Define \caption[]{...} ...
%
      \let\caption@@old\@caption
      \long\def\@caption#1[#2]#3{%
        \caption@beginex{#1}{#2}%
          \caption@@old{#1}[{#2}]{#3}%
        \caption@end}%
    }{%
%     Minimum captcont package support (bugfixed v3.0c)
%     --------------------------------
      \PackageInfo{caption}{captcont package v2.0 detected}%
      \def\caption@caption#1{#1}%  added v3.0c
    }%
  }}{}
\AtEndOfPackage{\let\caption@ifpkt@caption\@undefined}%  bugfixed v3.0a
%
% GENERIC PACKAGE SUPPORT
% =======================
%
\newcommand*\caption@ifpackage[2]{%
  \let\next\@gobble
%
  \caption@ifpkt@caption{%
    \caption@ifbool{pkt@#1}{%
      \@ifundefined{#2}%
        {\let\next\AtBeginDocument}%
        {\let\next\@firstofone}}{}%
%
    \ifodd\caption@debug\relax
      \edef\caption@tempa{%
        \caption@ifbool{pkt@#1}{%
          \@ifundefined{#2}{AtBeginDocument}{firstofone}%
        }{gobble}}%
      \PackageInfo{caption}{#1 = \caption@ifbool{pkt@#1}{1}{0} %
           (\@ifundefined{#2}{not }{}loaded -> \caption@tempa)}%
    \fi
  }{}%
%
  \@nameundef{caption@ifpkt@#1}%  bugfixed v3.0a
  \next}
\AtEndOfPackage{\let\caption@ifpackage\@undefined}
%
% FLOAT PACKAGE SUPPORT
% =====================
%
\def\caption@setfloatposition{%
  \caption@setposition{\@fs@iftopcapt t\else b\fi}}
%
\caption@ifpackage{float}{float@caption}{%
  \ifx\float@caption\relax
  \else
    \PackageInfo{caption}{float package v1.2 (or newer) detected}%
%
% Note that this version of \captionof works only with float 1.3 (or newer)
%
    \let\caption@of@float\@gobble
    \renewcommand*\caption@of[2]{%
      \@ifundefined{fst@#2}{}{%
        \let\caption@of@float\@firstofone
        \@nameuse{fst@#2}\@float@setevery{#2}}%
%
      \def\@captype{#2}#1}%
%
    \renewcommand*\caption@floatname[1]{%
      \@nameuse{\@ifundefined{fname@#1}{#1name}{fname@#1}}}%
%
    \let\caption@@float\float@caption
    \long\def\float@caption#1[#2]#3{%
      \caption@beginex{#1}{#2}%
        \let\@fs@capt\caption@@make
        \caption@@float{#1}[{#2}]{#3}%
%
        \caption@of@float{%
          \def\caption@@make##1##2{\unvbox\@floatcapt}%
          \@makecaption{}{}}%
      \caption@end}%
%
    \renewcommand*\caption@setfloattype[1]{%  improved v3.0a
      \caption@fixfloat@c{#1}%
      \expandafter\ifx\csname @float@c@#1\endcsname\float@caption
%       This float is defined with \newfloat or \restylefloat, not with \restylefloat*
        \expandafter\let\expandafter\caption@fst\csname fst@#1\endcsname
        \edef\caption@fst{\noexpand\string\expandafter\noexpand\caption@fst}%
        \edef\caption@fst{\noexpand\@gobblefour\caption@fst}%
%       \edef\caption@fst{\caption@fst}%
%       |\caption@fst| now contains the float style (e.g. ``ruled'')
        \@ifundefined{caption@sty@\caption@fst}{}{\caption@setstyle\caption@fst}%
        \caption@setfloatposition%  changed v3.0b
      \fi
      \caption@settype{#1}}%
%
% If you think this works fine, you are in a big error!
% The problem is that \newfloat and \restylefloat (of float 1.3) saves the
% *ACTUAL* definition of \@caption and \float@caption with \let, so our own
% \@caption (and of course our own \float@caption) will never been called if
% the \newfloat or \restylefloat takes place in the preamble of the document!
%
% So we have to correct this for ourself:
% We patch \caption again, this time we determine if the user has used
% \restylefloat or \restylefloat*. This is quite easy, if \@float@c@<captype>
% is the same as the original or our own definition of \float@caption, the
% user has used \restylefloat (and \float@caption should be used), otherwise
% we assume he has used \restylefloat* (and \@caption should be used).
% (This test will only fail if some other package re-defines \float@caption,
% too.)
%
    \let\caption@float\caption
    \def\caption{%
      \ifx\@captype\@undefined
        \@latex@error{\noexpand\caption outside float}\@ehd
        \expandafter\@gobble
      \else
%       Let's bring \@float@c@<captype> up-to-date!
        \caption@fixfloat@c\@captype
      \fi
      \caption@float}%
%
    \def\caption@fixfloat@c#1{%
      \expandafter\let\expandafter\caption@tempa\csname @float@c@#1\endcsname
      \ifx\caption@tempa\relax
      \else\ifx\caption@tempa\float@caption
      \else\ifx\caption@tempa\@caption
      \else\ifx\caption@tempa\caption@@float
        \ifodd\caption@debug\relax
          \PackageInfo{caption}{\protect\@float@c@#1\space := \protect\float@caption}%
        \fi
        \expandafter\let\csname @float@c@#1\endcsname\float@caption
      \else
        \ifodd\caption@debug\relax
          \PackageInfo{caption}{\protect\@float@c@#1\space := \protect\@caption}%
        \fi
        \expandafter\let\csname @float@c@#1\endcsname\@caption
      \fi\fi\fi\fi}%
%
  \fi}
%
\caption@ifbool{ruled}{}{%
  \DeclareCaptionStyle{ruled}{labelfont=bf,labelsep=space}}
\let\caption@ifruled\@undefined
%
% LISTINGS PACKAGE SUPPORT (new in 3.0b)
% ========================
%
\caption@ifpackage{listings}{lst@MakeCaption}{%
  \ifx\lst@MakeCaption\relax
  \else
    \PackageInfo{caption}{listings package v1.2 (or newer) detected}%
%
    \let\caption@lst@MakeCaption\lst@MakeCaption
    \def\lst@MakeCaption#1{%
      \let\caption@setfloattype\caption@settype
      \def\caption@autoposition{\caption@setposition{#1}}%
      \caption@begin{lstlisting}%
        \caption@lst@MakeCaption{#1}%
      \caption@end}%
%
  \fi}
%
% LONGTABLE PACKAGE SUPPORT
% =========================
%
\caption@ifpackage{longtable}{LT@makecaption}{%
  \ifx\LT@makecaption\relax
  \else
    \PackageInfo{caption}{longtable package v3.15 (or newer) detected}%
%
% Original code:
% \def\LT@makecaption#1#2#3{%
%   \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{%
%     % Based on article class "\@makecaption", "#1" is "\@gobble" in star
%     % form, and "\@firstofone" otherwise.
%     \sbox\@tempboxa{#1{#2: }#3}%
%     \ifdim\wd\@tempboxa>\hsize
%       #1{#2: }#3%
%     \else
%       \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
%     \fi
%     \endgraf\vskip\baselineskip}%
%   \hss}}}
%
    \def\LT@makecaption#1#2#3{%
       \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\linewidth{%
%
         \caption@letfloattype{longtable}%
         \caption@begin{table}%
           \ifdim\LTcapwidth=4in \else
             \caption@setwidth\LTcapwidth
           \fi
           \caption@startrue#1\caption@starfalse
           \caption@@make{#2}{#3}%
           \endgraf\vskip\baselineskip
%          \endgraf\vskip\abovecaptionskip% always `position=top'
         \caption@end}%
%
       \hss}}}%
%
  \fi}
%
% ROTATING PACKAGE SUPPORT
% ========================
%
\caption@ifpackage{rotating}{@rotcaption}{%
  \ifx\@rotcaption\relax
  \else
    \PackageInfo{caption}{rotating package v2.0 (or newer) detected}%
%
    \let\caption@rot\rotcaption
    \def\rotcaption{\caption@caption\caption@rot}%
%
    \let\caption@@rot\@rotcaption
    \long\def\@rotcaption#1[#2]#3{%
      \caption@beginex{#1}{#2}%
        \caption@@rot{#1}[{#2}]{#3}%
      \caption@end}%
%
% Original code:
% \long\def\@makerotcaption#1#2{%
%   \setbox\@tempboxa\hbox{#1: #2}%
%   \ifdim \wd\@tempboxa > .8\vsize
%     \rotatebox{90}{%
%     \begin{minipage}{.8\textheight}#1: #2\end{minipage}%
%     }\par
%   \else%
%     \rotatebox{90}{\box\@tempboxa}%
%   \fi
%   \hspace{12pt}%
% }
%
    \long\def\@makerotcaption#1#2{%
      \rotatebox{90}{%
        \begin{minipage}{.8\textheight}%
          \caption@@make{#1}{#2}%
        \end{minipage}%
      }\par
      \hspace{12pt}}%
%
  \fi}
%
% SIDECAP PACKAGE SUPPORT
% =======================
%
\caption@ifpackage{sidecap}{endSC@FLOAT}{%
  \ifx\endSC@FLOAT\relax
  \else
    \PackageInfo{caption}{sidecap package v1.4d (or newer) detected}%
%
% First of all, we let sidecap use an actual definition of \caption:
% (This is only required for version 1.5d of the sidecap package.)
%
    \let\SC@caption=\caption
%
% Make \caption* and local settings (\captionsetup) work
%
    \let\caption@SC@zfloat\SC@zfloat
    \def\SC@zfloat#1#2#3[#4]{%
      \caption@SC@zfloat{#1}{#2}{#3}[#4]%
%
      \global\let\SC@CAPsetup\@empty
      \renewcommand\captionsetup[1]{\g@addto@macro\SC@CAPsetup{,##1}}%
%
      \let\caption@old\caption
%     \def\caption{\renewcommand\captionsetup[1]{}\caption@caption\caption@old}%
      \def\caption{\caption@caption\caption@old}%
    }%
%
% Before typesetting the caption, we set the captionmargin to zero
% because the extra margin is only disturbing here.
% (We don't need to take care about the caption position because
%  the sidecap package set both \abovecaptionskip and \belowcaptionskip
%  to a skip of zero anyway.)
% Furthermore \SC@justify will override the caption justification, if set.
%
% Very old version (1.4): \SC@justify is not defined
% Older versions (1.5): \SC@justify is \relax when not set
% Newer versions (1.6): \SC@justify is \@empty when not set
%
    \let\caption@endSC@FLOAT\endSC@FLOAT
    \def\endSC@FLOAT{%
      \caption@setmargin\z@
%
      \@ifundefined{SC@justify}{}{%
        \ifx\SC@justify\@empty\else
          \let\caption@hj\SC@justify
          \let\SC@justify\@empty
        \fi}%
%
      \caption@esetup\SC@CAPsetup
      \caption@letfloattype{SC\@captype}%
%
      \caption@endSC@FLOAT}%
%
  \fi}
%
% SUPERTABULAR PACKAGE SUPPORT
% ============================
%
\def\caption@setSTposition{%
  \caption@setposition{\if@topcaption t\else b\fi}}
%
\caption@ifpackage{supertabular}{ST@caption}{%
  \ifx\ST@caption\relax
  \else
    \PackageInfo{caption}{supertabular package detected}%
%
% Original code:
% \long\def\ST@caption#1[#2]#3{\par%
%   \addcontentsline{\csname ext@#1\endcsname}{#1}%
%                   {\protect\numberline{%
%                       \csname the#1\endcsname}{\ignorespaces #2}}
%   \begingroup
%     \@parboxrestore
%     \normalsize
%     \if@topcaption \vskip -10\p@ \fi
%     \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
%     \if@topcaption \vskip 10\p@ \fi
%   \endgroup}
%
  \let\caption@ST\ST@caption
  \long\def\ST@caption#1[#2]#3{\par%  bugfixed v3.0a
    \caption@letfloattype{supertabular}%
    \let\caption@fixposition\caption@setSTposition
    \caption@beginex{#1}{#2}%
      \addcontentsline{\csname ext@#1\endcsname}{#1}%
                      {\protect\numberline{%
                          \csname the#1\endcsname}{\ignorespaces #2}}%
      \@parboxrestore
      \normalsize
      \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
    \caption@end}%
%
  \fi}
%
% KOMA-SCRIPT CLASSES SUPPORT (new in 3.0a)
% ===========================
%
% \changes{v3.0a}{18 Jan 04}{Minimum adaption to KOMA-Script}
\AtBeginDocument{\let\scr@caption\caption}
%    \end{macrocode}
%
% \iffalse
%</package>
% \fi
%
% \clearpage
% \Finale
%
\endinput
