% \iffalse meta-comment % % This is file `caption.dtx'. % % Copyright (C) 1994-2007 Axel Sommerfeldt (caption@sommerfee.de) % % -------------------------------------------------------------------------- % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 % of this license or (at your option) any later version. % The latest version of this license is in % http://www.latex-project.org/lppl.txt % and version 1.3 or later is part of all distributions of LaTeX % version 2003/12/01 or later. % % This work has the LPPL maintenance status "maintained". % % This Current Maintainer of this work is Axel Sommerfeldt. % % This work consists of the files caption.ins, caption.dtx, caption2.dtx, % and ltcaption.dtx, the derived files caption.sty, caption2.sty, % caption3.sty, and ltcaption.sty, and the user manuals caption-deu.tex, % caption-eng.tex, and caption-rus.tex. % % \fi % \CheckSum{5423} % % \iffalse %<*driver> \NeedsTeXFormat{LaTeX2e}[1994/12/01] \ProvidesFile{caption.drv}[2007/09/22 v3.1b Implementation of the caption package] \hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up. %\errorcontextlines=3 % \documentclass{ltxdoc} \setlength\parindent{0pt} \setlength\parskip{\smallskipamount} % \makeatletter % make room for subsections like 2.16.14 in the TOC %\newcommand*\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}} \renewcommand*\l@subsubsection{\@dottedtocline{3}{3.8em}{3.6em}} \makeatother % \usepackage{ifpdf} \ifpdf \usepackage{mathptmx,courier} \usepackage[scaled=0.90]{helvet} \addtolength\marginparwidth{15pt} \fi % \usepackage{hypdoc} \hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartview={}} % \usepackage[debug]{caption}[2007/09/17] % \DeclareRobustCommand*\eTeX{\texorpdfstring {\leavevmode\hbox{$\varepsilon$}-\TeX}% {e-TeX}} \DeclareRobustCommand*\AmS{\texorpdfstring {{\protect\usefont{OMS}{cmsy}{m}{n}A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}% {AMS}} \DeclareRobustCommand*\KOMAScript{\texorpdfstring {\textsf{K\kern.05em O\kern.05em M\kern.05em A\kern.1em-\kern.1em Script}}% {KOMA-Script}} \DeclareRobustCommand*\NTG{NTG} \DeclareRobustCommand*\SmF{SMF} % \begin{document} \DocInput{caption.dtx} \end{document} % % \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 % \let\env\purett \let\opt\purett % % \def\thispackage{the \package{caption} package} % \def\Thispackage{The \package{caption} package} % \newcommand*\version[2][]{\textit{v#2}} % % \GetFileInfo{caption.drv} % \let\docdate\filedate % \GetFileInfo{caption.sty} % % \title{The Implementation of % \texorpdfstring{\thispackage\thanks{%^^A % This package has version number \fileversion, last revised \filedate.}}%^^A % {the caption package}} % \author{Axel Sommerfeldt\\ % \href{mailto:caption@sommerfee.de}{\texttt{caption@sommerfee.de}}} % \date{\docdate} % \maketitle % % \begin{abstract} % \Thispackage\ consists of two parts -- the kernel % (|caption3.sty|) and the main package (|caption.sty|). % % The kernel provides all the user commands and internal macros which are % necessary for typesetting captions and setting parameters regarding these. % While the standard \LaTeX\ document classes provides an internal command % called |\@makecaption| and no options to control its behavior (except the % vertical skips above and below the caption itself), we provide similar % commands called |\caption@make| and |\caption@@make|, but with a lot of % options which can be selected with |\captionsetup|. % Loading the kernel part do not change the output of a \LaTeX\ document % -- it just provides functionality which can be used by \LaTeXe\ packages % which typesets captions, like \thispackage\ and the \package{subfig} package. % % \Thispackage\ itself redefines the \LaTeX\ commands % |\caption|, |\@caption|, and |\@makecaption| and maps the latter one to % |\caption@@make|, giving the user the possibility to control the 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\ itself or \LaTeXe\ packages, and the caption stuff offered by the % \package{caption3} kernel. % \end{abstract} % % \section*{User manuals} % % This document is describing the code implementation only. The user % documentation can be found in % \nopagebreak\begin{quote} % \begin{tabular}{ll} % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/caption/caption-eng.pdf}% % {\texttt{caption-eng.pdf}} & The English documentation \\ % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/caption/caption-rus.pdf}% % {\texttt{caption-rus.pdf}} & The Russian documentation\footnotemark \\ % \href{ftp://dante.ctan.org/tex-archive/macros/latex/contrib/caption/caption-deu.pdf}% % {\texttt{caption-deu.pdf}} & The German documentation \\ % \end{tabular} % \footnotetext{Thanks a lot to Olga Lapko for this translation} % \end{quote} % % \StopEventually{} % \clearpage % \tableofcontents % % \iffalse % --------------------------------------------------------------------------- % % \fi % % \DoNotIndex{\\,\_,\ ,\@@par} % \DoNotIndex{\@classoptionslist,\@currext,\@currname} % \DoNotIndex{\@ehc,\@ehd,\@empty,\@expandtwoargs} % \DoNotIndex{\@for,\@firstofone,\@firstoftwo} % \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom} % \DoNotIndex{\@ifnextchar,\@ifpackagelater,\@ifpackageloaded} % \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@namedef,\@nameuse} % \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist} % \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setpar} % \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc} % \DoNotIndex{\@testopt} % \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist} % \DoNotIndex{\p@,\z@} % \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup} % \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box} % \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow} % \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter} % \DoNotIndex{\fi,\footnotesize,\global} % \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss} % \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode} % \DoNotIndex{\ifx,\ignorespaces,\itshape} % \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth} % \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message} % \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox} % \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline} % \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip} % \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write} % \DoNotIndex{\providecommand,\quad} % \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage} % \DoNotIndex{\rightskip,\rmfamily} % \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape} % \DoNotIndex{\small,\string,\space,\strut} % \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily} % \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage} % \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip} % \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption} % \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists} % \DoNotIndex{\NeedsTeXFormat,\MessageBreak} % \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine} % \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage} % % \iffalse % --------------------------------------------------------------------------- % % \fi % % \setlength{\parskip}{0pt plus 1pt} % % \changes{v1.0}{1994/10/27}{First release} % \changes{v1.1}{1994/11/03}{New option \cs{centerlast}} % \changes{v1.2}{1994/11/28}{Support of the \package{float} package} % \changes{v1.3}{1995/01/09}{Support of \cs{captionlabelfont} in subcaptions} % \changes{v1.4}{1995/01/30}{New option \cs{nooneline}} % \changes{v1.4b}{1995/04/05}{Bugfix release} % \changes{v3.0}{2003/12/20}{Rewritten; many new commands and features} % \changes{v3.0d}{2004/11/28}{Split into two packages: % \package{caption} \& \package{caption3}} % % \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}} % % \iffalse % --------------------------------------------------------------------------- % % \fi % % \clearpage % \section{Kernel} % \iffalse %<*kernel> % \fi % % \subsection{Identification} % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/12/01] \ProvidesPackage{caption3}[2007/09/22 v3.1b caption3 kernel (AR)] % \end{macrocode} % % \subsection{Generic helpers} % % \begin{macro}{\@nameundef} % This is the opposite to |\@namedef| which is offered by the \LaTeX\ kernel. % We use it to remove the definition of some commands and keyval options after % |\begin{document}| (to save \TeX\ memory) and to remove caption options defined % with |\captionsetup|\oarg{type}. % \begin{macrocode} \providecommand*\@nameundef[1]{% \expandafter\let\csname #1\endcsname\@undefined} % \end{macrocode} % \end{macro} % % \begin{macro}{\l@addto@macro} % The \LaTeXe\ kernel offers the internal helper macro |\g@addto@macro| which % globally adds tokens to existing macros, like in |\AtBeginDocument|. % This is the same but it works local, not global % (using \cs{edef} instead of \cs{xdef}). % \begin{macrocode} \providecommand\l@addto@macro[2]{% \begingroup \toks@\expandafter{#1#2}% \edef\@tempa{\endgroup\def\noexpand#1{\the\toks@}}% \@tempa} % \end{macrocode} % \end{macro} % % \begin{macro}{\bothIfFirst} % \begin{macro}{\bothIfSecond} % |\bothIfFirst| tests if the first argument is not empty, |\bothIfSecond| % tests if the second argument is not empty. If yes both arguments get % typeset, otherwise none of them. % \begin{macrocode} \def\bothIfFirst#1#2{% \protected@edef\caption@tempa{#1}% \ifx\caption@tempa\@empty \else #1#2% \fi} % \end{macrocode} % \begin{macrocode} \def\bothIfSecond#1#2{% \protected@edef\caption@tempa{#2}% \ifx\caption@tempa\@empty \else #1#2% \fi} % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\caption@ifinlist} % \changes{2007/07/29}{Rewritten} % This helper macro checks if the first argument is in the comma separated % list which is offered as second argument. So for example % \begin{quote} % |\caption@ifinlist{frank}{axel,frank,olga,steven}{yes}{no}| % \end{quote} % would expand to |yes|. % \begin{macrocode} \newcommand*\caption@ifinlist{% \@expandtwoargs\caption@@ifinlist} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@@ifinlist[2]{% \begingroup \def\@tempa##1,#1,##2\@nil{% \endgroup \ifx\relax##2\relax \expandafter\@secondoftwo \else \expandafter\@firstoftwo \fi}% \@tempa,#2,#1,\@nil}% % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@ifin@list} % \changes{v3.1}{2007/08/12}{This macro added} % |\caption@ifin@list|\marg{cmd}\marg{list entry}\marg{yes}\marg{no} % \begin{macrocode} \newcommand*\caption@ifin@list[2]{% \caption@ifempty@list#1% {\@secondoftwo}% {\@expandtwoargs\caption@@ifinlist{#2}{#1}}} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@g@addto@list} % \changes{v3.1}{2007/07/29}{This macro added} % |\caption@g@addto@list|\marg{cmd}\marg{list entry} % \begin{macrocode} \newcommand*\caption@g@addto@list[2]{% \caption@ifempty@list#1{\gdef#1{#2}}{\g@addto@macro#1{,#2}}} % \end{macrocode} % \end{macro} % \begin{macro}{\caption@l@addto@list} % \changes{v3.1}{2007/07/29}{This macro added} % |\caption@l@addto@list|\marg{cmd}\marg{list entry} % \begin{macrocode} \newcommand*\caption@l@addto@list[2]{% \caption@ifempty@list#1{\def#1{#2}}{\l@addto@macro#1{,#2}}} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@g@removefrom@list} % \changes{v3.1}{2007/07/29}{This macro added} % |\caption@g@removefrom@list|\marg{cmd}\marg{list entry} % \begin{macrocode} \newcommand*\caption@g@removefrom@list[2]{% \caption@l@removefrom@list#1{#2}% \global\let#1#1} % \end{macrocode} % \end{macro} % \begin{macro}{\caption@l@removefrom@list} % \changes{v3.1}{2007/07/29}{This macro added} % |\caption@l@removefrom@list|\marg{cmd}\marg{list entry}\par % \Note[Caveat]{\meta{cmd} will be expanded during this process since % \cs{@removeelement} is using \cs{edef} to build the new list!} % \begin{macrocode} \newcommand*\caption@l@removefrom@list[2]{% \caption@ifempty@list#1{}{\@expandtwoargs\@removeelement{#2}#1#1}} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@for@list} % \changes{v3.1}{2007/07/29}{This macro added} % |\caption@for@list|\marg{cmd}\marg{code with \#1} % \begin{macrocode} \newcommand*\caption@for@list[2]{% \caption@ifempty@list#1{}{% \def\caption@tempb##1{#2}% \@for\caption@tempa:=#1\do{% \expandafter\caption@tempb\expandafter{\caption@tempa}}}} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@ifempty@list} % \changes{v3.1}{2007/07/29}{This macro added} % |\caption@ifempty@list|\marg{cmd}\marg{true}\marg{false} % \begin{macrocode} \newcommand*\caption@ifempty@list[1]{% \ifx#1\@undefined \expandafter\@firstoftwo \else\ifx#1\relax \expandafter\expandafter\expandafter\@firstoftwo \else\ifx#1\@empty \expandafter\expandafter\expandafter\expandafter \expandafter\expandafter\expandafter\@firstoftwo \else \expandafter\expandafter\expandafter\expandafter \expandafter\expandafter\expandafter\@secondoftwo \fi\fi\fi} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@setbool} % \begin{macro}{\caption@set@bool} % \changes{v3.1}{2007/04/05}{\cs{caption@set@bool}\marg{cmd}\marg{value} added} % \begin{macro}{\caption@ifbool} % \begin{macro}{\caption@undefbool} % For setting and testing boolean options we offer these three helper macros: % \begin{quote} % |\caption@setbool|\marg{name}\marg{value}\\ % | |(with |value = false/true/no/yes/off/on/0/1|)\\ % |\caption@ifbool|\marg{name}\marg{if-clause}\marg{else-clause}\\ % |\caption@undefbool|\marg{name} % \end{quote} % \begin{macrocode} \newcommand*\caption@setbool[1]{% \expandafter\caption@set@bool\csname caption@if#1\endcsname} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@set@bool[2]{% \caption@ifinlist{#2}{1,true,yes,on}{% \let#1\@firstoftwo }{\caption@ifinlist{#2}{0,false,no,off}{% \let#1\@secondoftwo }{% \caption@Error{Undefined boolean value `#2'}% }}} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@ifbool[1]{\@nameuse{caption@if#1}} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@undefbool[1]{\@nameundef{caption@if#1}} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\caption@teststar} % \changes{v3.1}{2007/05/08}{This macro and its usage added} % |\caption@teststar|\marg{cmd}\marg{star arg}\marg{non-star arg} % \begin{macrocode} \newcommand*\caption@teststar[3]{\@ifstar{#1{#2}}{#1{#3}}} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@withoptargs} % \changes{v3.1}{2007/08/12}{This macro added} % |\caption@withoptargs|\marg{cmd} % \begin{macrocode} \newcommand*\caption@withoptargs[1]{% \@ifstar {\def\caption@tempa{*}\caption@@withoptargs#1}% {\def\caption@tempa{}\caption@@withoptargs#1}} % \end{macrocode} % \begin{macrocode} \def\caption@@withoptargs#1{% \@ifnextchar[%] {\caption@@@withoptargs#1}% {\caption@@@@withoptargs#1}} % \end{macrocode} % \begin{macrocode} \def\caption@@@withoptargs#1[#2]{% \l@addto@macro\caption@tempa{[{#2}]}% \caption@@withoptargs#1} % \end{macrocode} % \begin{macrocode} \def\caption@@@@withoptargs#1{% \expandafter#1\expandafter{\caption@tempa}} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@CheckCommand} % \changes{v3.1}{2007/04/10}{This macro added} % \begin{macro}{\caption@IfCheckCommand} % |\caption@CheckCommand|\marg{macro}\marg{definition of macro}\par % checks if a command already exists, with the same definition. % It can be used more-than-once to check if one of multiple definitions will % finally match. % (It redefines itself later on to |\@gobbletwo| if the two commands match % fine, making further checks harmless.)\par % |\caption@IfCheckCommand|\marg{true}\marg{false}\par % will execute the \meta{true} code if one match was finally given, % the \meta{false} code otherwise. % (It simply checks if |\caption@CheckCommand| is |\@gobbletwo| and % restores the starting definition of |\caption@CheckCommand|.) % \begin{macrocode} \newcommand\caption@DoCheckCommand[2]{% \begingroup \let\@tempa#1% #2% \ifx\@tempa#1% \endgroup \let\caption@CheckCommand\@gobbletwo \else \endgroup \fi} \@onlypreamble\caption@DoCheckCommand % \end{macrocode} % \begin{macrocode} \let\caption@CheckCommand\caption@DoCheckCommand \@onlypreamble\caption@CheckCommand % \end{macrocode} % \begin{macrocode} \newcommand*\caption@IfCheckCommand{% \ifx\caption@CheckCommand\@gobbletwo \let\next\@firstoftwo \else \let\next\@secondoftwo \fi \let\caption@CheckCommand\caption@DoCheckCommand \next} \@onlypreamble\caption@IfCheckCommand % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\caption@AtBeginDocument} % \changes{v3.1}{2007/04/13}{This macro and its usage added} % |\caption@AtBeginDocument*|\marg{code}\\ % Same as |\AtBeginDocument| but the execution of code % will be surrounded by two |\PackageInfo|s. % The starred variant causes the code to be executed after all code % specified using the non-starred variant. % \begin{macrocode} \let\caption@begindocumenthook\@empty \let\caption@@begindocumenthook\@empty % \end{macrocode} % \begin{macrocode} \def\caption@AtBeginDocument{% \caption@teststar\g@addto@macro \caption@@begindocumenthook\caption@begindocumenthook} \@onlypreamble\caption@AtBeginDocument % \end{macrocode} % \begin{macrocode} \AtBeginDocument{% \PackageInfo{caption}{Begin \noexpand\AtBeginDocument code\@gobble}% % \end{macrocode} % \begin{macrocode} \def\caption@AtBeginDocument{% \@ifstar{\g@addto@macro\caption@@begindocumenthook}\@firstofone}% \caption@begindocumenthook \let\caption@begindocumenthook\@undefined % \end{macrocode} % \begin{macrocode} \def\caption@AtBeginDocument{% \@ifstar\@firstofone\@firstofone}% \caption@@begindocumenthook \let\caption@@begindocumenthook\@undefined % \end{macrocode} % \begin{macrocode} \PackageInfo{caption}{End \noexpand\AtBeginDocument code\@gobble}} % \end{macrocode} % \end{macro} % % \subsection{Errors} % % \begin{macro}{\caption@Error} % \changes{v3.0l}{2007/01/20}{This macro added, will now be used for errors} % \changes{v3.0q}{2007/04/11}{Renamed from \cs{caption@error} to \cs{caption@Error}} % \changes{v3.1b}{2007/09/18}{Usage of \cs{caption@Package} removed} % \begin{macro}{\caption@KV@err} % |\caption@Error|\marg{message} % \begin{macrocode} \newcommand*\caption@Error[1]{\PackageError{caption}{#1}\caption@eh} \let\caption@KV@err\caption@Error % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\caption@eh} % At the moment we only offer this simple error message as generic helper % for the user. % \begin{macrocode} \newcommand*\caption@eh{% If you do not understand this error, please take a closer look\MessageBreak at the documentation of the `caption' package.\MessageBreak \@ehc} % \end{macrocode} % \end{macro} % % \subsection{Using the keyval package} % % We need the \package{keyval} package for option handling, so we load it here. % \begin{macrocode} \RequirePackage{keyval}[1997/11/10] % \end{macrocode} % % \begin{macro}{\undefine@key} % |\undefine@key|\marg{family}\marg{key}\par % This helper macro is the opposite of |\define@key|, it removes a keyval % definition. % \begin{macrocode} \providecommand*\undefine@key[2]{% \@nameundef{KV@#1@#2}\@nameundef{KV@#1@#2@default}} % \end{macrocode} % \end{macro} % % \begin{macro}{\@onlypreamble@key} % \changes{v3.1}{2007/07/22}{This macro added} % |\onlypreamble@key|\marg{family}\marg{key}\par % Analogous to |\@onlypreamble| from \LaTeXe. % \begin{macrocode} \providecommand*\@onlypreamble@key[2]{% \expandafter\@onlypreamble\csname KV@#1@#2\endcsname} \@onlypreamble\@onlypreamble@key % \end{macrocode} % \end{macro} % % \begin{macro}{\DeclareCaptionOption} % |\DeclareCaptionOption|\marg{option}\marg{code}\\ % |\DeclareCaptionOption*|\marg{option}\marg{code}\par % We declare our options using these commands (instead of using % |\DeclareOption| offered by \LaTeXe), so the keyval package is used. % The starred form makes the option available during the lifetime of the % current package only, so they can be used with |\usepackage|, but % \emph{not} with |\captionsetup| later on. % \begin{macrocode} \newcommand*\DeclareCaptionOption{% \caption@teststar\caption@declareoption\AtEndOfPackage\@gobble} \@onlypreamble\DeclareCaptionOption % \end{macrocode} % \begin{macrocode} \newcommand*\caption@declareoption[2]{% #1{\undefine@key{caption}{#2}}\define@key{caption}{#2}} \@onlypreamble\caption@declareoption % \end{macrocode} % \end{macro} % % \begin{macro}{\captionsetup} % \changes{v3.0a}{2004/01/17}{Bugfix: Missing \% added} % \changes{v3.1}{2007/07/22}{Star-variant added} % |\captionsetup|\oarg{type}\marg{keyval-list of options}\par % If the optional argument `type' is specified, we simply save or append % the option list, otherwise we `execute' it with |\setkeys|. % \begin{macrocode} \newcommand*\captionsetup{% \caption@teststar\@captionsetup\@gobble\@firstofone} % \end{macrocode} % \begin{macrocode} \newcommand*\@captionsetup[1]{% \@ifnextchar[{\caption@setup@options#1}\caption@setup} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@setup{\caption@setkeys{caption}} % \end{macrocode} % \begin{macrocode} \def\caption@setup@options#1[#2]{% % #1 is \@gobble in star form, and \@firstofone otherwise #1{\caption@addtooptlist{#2}}% \expandafter\caption@l@addto@list\csname caption@opt@#2\endcsname} % \end{macrocode} % \end{macro} % % \begin{macro}{\clearcaptionsetup} % \changes{v3.1}{2007/07/29}{Optional argument added} % \changes{v3.1}{2007/08/17}{Starred variant added} % |\clearcaptionsetup|\oarg{option}\marg{type}\\ % |\clearcaptionsetup*|\oarg{option}\marg{type}\par % This removes the saved option list associated with \meta{type}. % If \meta{option} is given, only this option will be removed from the list. % The starred variant does not issue a warning. % \begin{macrocode} \newcommand*\clearcaptionsetup{% \caption@teststar\@clearcaptionsetup\@gobble\@firstofone} % \end{macrocode} % \begin{macrocode} \newcommand*\@clearcaptionsetup[1]{% \let\caption@tempa#1% \@testopt\@@clearcaptionsetup{}} % \end{macrocode} % \begin{macrocode} \def\@@clearcaptionsetup[#1]#2{% \expandafter\caption@ifempty@list\csname caption@opt@#2\endcsname {\caption@tempa{\PackageWarning{caption}{Option list `#2' undefined}}}% {\ifx,#1,% \caption@clearsetup{#2}% \else \caption@@removefromsetup{#1}{#2}% \fi}} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@clearsetup[1]{% \caption@removefromoptlist{#1}% \@nameundef{caption@opt@#1}} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@removefromsetup{% \let\caption@tempa\@gobble \caption@@removefromsetup} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@@removefromsetup[2]{% \expandafter\let\expandafter\@tempa\csname caption@opt@#2\endcsname \expandafter\let\csname caption@opt@#2\endcsname\@undefined \def\@tempb##1=##2\@nil{##1}% \edef\@tempc{#1}% \@for\@tempa:=\@tempa\do{% \edef\@tempd{\expandafter\@tempb\@tempa=\@nil}% \ifx\@tempd\@tempc \let\caption@tempa\@gobble \else \expandafter\expandafter\expandafter\caption@l@addto@list \expandafter\csname caption@opt@#2\expandafter\endcsname \expandafter{\@tempa}% \fi}% \expandafter\caption@ifempty@list\csname caption@opt@#2\endcsname {\caption@removefromoptlist{#2}}{}% \caption@tempa{% \PackageWarning{caption}{% Option `#1' was not in list `#2'\MessageBreak}}} % \end{macrocode} % \end{macro} % % \begin{macro}{\showcaptionsetup} % \changes{v3.0e}{2005/05/03}{Optimized for memory usage} % \changes{v3.1}{2007/07/29}{Bugfix: Does not expand option list anymore} % |\showcaptionsetup|\oarg{package}\marg{type}\par % This comes for debugging issues: It shows the saved option list which % is associated with \meta{type}. % \begin{macrocode} \newcommand*\showcaptionsetup[2][\@firstofone]{% \GenericWarning{}{% #1 Caption Info: KV list on `#2'\MessageBreak #1 Caption Data: \@ifundefined{caption@opt@#2}{% -none-% }{% {\expandafter\expandafter\expandafter\strip@prefix \expandafter\meaning\csname caption@opt@#2\endcsname}% }}} % \end{macrocode} % \end{macro} % % \changes{v3.1}{2007/07/02}{Option \opt{options=} added} % \begin{macrocode} \DeclareCaptionOption{options}{\caption@setoptions{#1}} % \end{macrocode} % % \begin{macro}{\caption@setoptions} % \changes{v3.0i}{2006/01/03}{Optional argument added} % \changes{v3.0j}{2006/01/26}{Revised} % \changes{v3.0l}{2007/01/30}{Optional argument removed} % \changes{v3.1}{2007/04/11}{Usage of \cs{clearcaptionsetup} added} % \changes{v3.1}{2007/05/09}{Renamed from \cs{caption@settype} to \cs{caption@setoptions}} % |\caption@setoptions|\marg{type or environment or\ldots}\par % Caption options which have been saved with |\captionsetup|\oarg{type} can % be executed by using this command. % It simply executes the saved option list (and clears it afterwards), % if there is any. % \begin{macrocode} \newcommand*\caption@setoptions[1]{% \caption@Debug{options=#1}% \expandafter\let\expandafter\@tempa\csname caption@opt@#1\endcsname \ifx\@tempa\relax \else \let\caption@iftypewarning\@firstoftwo % = true \expandafter\caption@setup\expandafter{\@tempa}% \caption@clearsetup{#1}% \fi} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@addtooptlist} % \changes{v3.1}{2007/07/22}{This macro added} % \begin{macro}{\caption@removefromoptlist} % \changes{v3.1}{2007/07/22}{This macro added} % |\caption@addtooptlist|\marg{type}\\ % |\caption@removefromoptlist|\marg{type}\par % Adds or removes an \meta{type} to the list of unused caption options. % Note that the catcodes of \meta{type} are sanitized here so removing % \meta{type} from the list do not fail when the \package{float} package % is used (since |\float@getstyle| gives a result which tokens have catcode % 12 $=$ ``other''). % \begin{macrocode} \newcommand*\caption@addtooptlist[1]{% \@ifundefined{caption@opt@#1@lineno}{% \caption@dooptlist\caption@g@addto@list{#1}% \expandafter\xdef\csname caption@opt@#1@lineno\endcsname{\the\inputlineno}% }{}} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@removefromoptlist[1]{% \caption@dooptlist\caption@g@removefrom@list{#1}% \global\expandafter\let\csname caption@opt@#1@lineno\endcsname\@undefined} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@dooptlist[2]{% \begingroup \edef\@tempa{#2}\@onelevel@sanitize\@tempa \expandafter#1\expandafter\caption@optlist\expandafter{\@tempa}% \endgroup} % \end{macrocode} % \begin{macrocode} \AtEndDocument{% \caption@for@list\caption@optlist{% \PackageWarningNoLine{caption}{% Unused \string\captionsetup[#1] on input line \csname caption@opt@#1@lineno\endcsname}}} % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\caption@setkeys} % \changes{v3.0i}{2006/01/03}{This macro added} % \changes{v3.0l}{2007/01/20}{Bugfix: Usage of \cs{caption@keydepth} added} % \changes{v3.0l}{2007/01/30}{Optional argument added} % \changes{v3.0p}{2007/04/08}{\cs{caption@keydepth} is now a command instead of a counter} % \changes{v3.1b}{2007/09/18}{Usage of \cs{caption@Package} removed, we use \cs{caption@KV@err} instead} % |\caption@setkeys|\oarg{package}\marg{family}\marg{key-values}\par % This one simply calls |\setkeys|\marg{family}\marg{key-values} % but lets the error messages not refer to the \package{keyval} package, % but to the \meta{package} package instead. % \begin{macrocode} \newcommand*\caption@setkeys{\@dblarg\caption@@setkeys} % \end{macrocode} % \begin{macrocode} \long\def\caption@@setkeys[#1]#2#3{% \expandafter\let\csname ORI@KV@err\caption@keydepth\endcsname\KV@err \expandafter\let\csname ORI@KV@errx\caption@keydepth\endcsname\KV@errx \@ifundefined{#1@KV@err}% {\let\KV@err\ORI@KV@err\let\KV@errx\ORI@KV@errx}% {\expandafter\let\expandafter\KV@err\csname #1@KV@err\endcsname \let\KV@errx\KV@err}% \l@addto@macro\caption@keydepth i% % \end{macrocode} % \begin{macrocode} \caption@Debug{\protect\setkeys{#2}{#3}}% \setkeys{#2}{#3}% % \end{macrocode} % \begin{macrocode} \edef\caption@keydepth{\expandafter\@cdr\caption@keydepth\@nil}% \expandafter\let\expandafter\KV@err\csname ORI@KV@err\caption@keydepth\endcsname \expandafter\let\expandafter\KV@errx\csname ORI@KV@errx\caption@keydepth\endcsname} % \end{macrocode} % \begin{macrocode} \let\caption@keydepth\@empty % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@ExecuteOptions} % \changes{v3.1}{2007/07/15}{This macro added} % |\caption@ExecuteOptions|\marg{family}\marg{key-values}\par % We execute our options using the keyval interface, so we use this one % instead of |\ExecuteOptions| offered by \LaTeXe. % \begin{macrocode} \newcommand*\caption@ExecuteOptions[2]{% \@expandtwoargs\caption@setkeys{#1}{#2}}% \@onlypreamble\caption@ExecuteOptions % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@ProcessOptions} % \changes{v3.0a}{2004/01/23}{Bugfix, see % \purett{news:400D360C.9678329F@gmx.net} for details} % \changes{v3.0i}{2006/01/03}{Improvement, uses \cs{caption@setkeys} % instead of \cs{setkeys}} % \changes{v3.0j}{2006/02/23}{Bugfix, now processes only those global % options which have a default value} % \changes{v3.0l}{2007/01/30}{\cs{ProcessOptionsWithKV} renamed to % \cs{caption@ProcessOptions} and moved from the package to the kernel} % \changes{v3.1}{2007/04/17}{Star variant added} % |\caption@ProcessOptions*|\marg{family}\par % We process our options using the keyval package, so we use this one % instead of |\ProcessOptions| offered by \LaTeXe. % The starred variant do not process the global options. % (This code was taken from the \package{hyperref} package\cite{hyperref} % \version{6.74} and improved.) % \begin{macrocode} \newcommand*\caption@ProcessOptions{% \caption@teststar\caption@@ProcessOptions\@gobble\@firstofone} \@onlypreamble\caption@ProcessOptions % \end{macrocode} % \begin{macrocode} \newcommand*\caption@@ProcessOptions[2]{% \let\@tempc\relax \let\caption@tempa\@empty #1{% \@firstofone -or- \@gobble \@for\CurrentOption:=\@classoptionslist\do{% \@ifundefined{KV@#2@\CurrentOption}{}{% \@ifundefined{KV@#2@\CurrentOption @default}{% \PackageInfo{#2}{Global option `\CurrentOption' ignored}% }{% \PackageInfo{#2}{Global option `\CurrentOption' processed}% \edef\caption@tempa{\caption@tempa,\CurrentOption,}% \@expandtwoargs\@removeelement\CurrentOption \@unusedoptionlist\@unusedoptionlist }% }% }% \let\CurrentOption\@empty }% \caption@ExecuteOptions{#2}{\caption@tempa\@ptionlist{\@currname.\@currext}}% \AtEndOfPackage{\let\@unprocessedoptions\relax}} \@onlypreamble\caption@@ProcessOptions % \end{macrocode} % \end{macro} % % \subsection{Margin resp. width} % \changes{v3.0p}{2007/04/01}{\cs{captionmarginx} renamed to \cs{captionmargin@}} % \changes{v3.0p}{2007/04/03}{Option `twoside' added} % \changes{v3.1}{2007/08/11}{Options `margin*', `minmargin', and `maxmargin' added} % % \begin{macro}{\captionmargin} % \begin{macro}{\captionwidth} % |\captionmargin| and |\captionwidth| contain the extra margin % resp. the total width used for captions. Please never set these values in % a direct way, they are just accessible in user documents to provide % compatibility to |caption.sty| \version{1.x}.\par % Note that we can only set one value at a time, `margin' \emph{or} `width'. % If |\captionwidth| is not zero we will take this value afterwards, % otherwise |\captionmargin| and |\captionmargin@|. % \begin{macrocode} \newdimen\captionmargin \newdimen\captionmargin@ \newdimen\captionwidth % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macrocode} \DeclareCaptionOption{margin}{\setcaptionmargin{#1}} \DeclareCaptionOption{margin*}{\setcaptionmargin*{#1}} \DeclareCaptionOption{width}{\setcaptionwidth{#1}} \DeclareCaptionOption{twoside}[1]{\caption@set@bool\caption@iftwoside{#1}} % \end{macrocode} % \begin{macrocode} \DeclareCaptionOption{minmargin}{\caption@setoptcmd\caption@minmargin{#1}} \DeclareCaptionOption{maxmargin}{\caption@setoptcmd\caption@maxmargin{#1}} % \end{macrocode} % % \begin{macro}{\setcaptionmargin} % \changes{v3.0h}{2005/10/24}{Renamed from \cs{caption@setmargin} to \cs{setcaptionmargin}} % \changes{v3.0h}{2005/10/24}{\cs{setcaptionmargin} enhanced so it can take % left+right margin} % \changes{v3.1}{2007/08/11}{Starred variant added} % \changes{v3.1}{2007/08/12}{\cs{setlength}\cs{captionmargin} \& % \cs{setlength}\cs{captionmargin@} swapped so % `\texttt{margin*=}\cs{captionmargin}' works in SingleLine options} % |\setcaptionmargin|\marg{amount}\\ % |\setcaptionmargin*|\marg{amount}\par % Please never use this in user documents, it's just there to % provide compatibility to the \package{caption2} package. % \begin{macrocode} \newcommand*\setcaptionmargin{% \caption@teststar\caption@setmargin\@gobble\@firstofone} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@setmargin[2]{% #1{\captionwidth\z@}% \caption@@setmargin#2,#2,\@nil} % \end{macrocode} % \begin{macrocode} \def\caption@@setmargin#1,#2,#3\@nil{% \setlength\captionmargin@{#2}% \setlength\captionmargin{#1}% \addtolength\captionmargin@{-\captionmargin}} % \end{macrocode} % \end{macro} % % \begin{macro}{\setcaptionwidth} % \changes{v3.0h}{2005/10/24}{Renamed from \cs{caption@setwidth} to \cs{setcaptionwidth}} % |\setcaptionwidth|\marg{amount}\par % Please never use this in user documents, it's just there to % provide compatibility to the \package{caption2} package. % \begin{macrocode} \newcommand*\setcaptionwidth{% \captionmargin\z@ \captionmargin@\z@ \setlength\captionwidth} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@count} % \changes{v3.0p}{2007/04/03}{This counter added} % This counter numbers the captions. At the moment it will be used inside % |\caption@ifoddpage| only. % \begin{macrocode} \newcommand*\caption@count{0} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@newlabel} % \changes{v3.0p}{2007/04/03}{This macro added} % This command is a modified version of |\newlabel| from \LaTeX2e. % It will be written to the \texttt{.aux} file to % pass label information from one run to another. % (We use it inside |\caption@ifoddpage| and |\caption@ragged|.) % \begin{macrocode} \newcommand*\caption@newlabel{\@newl@bel{caption@r}} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@thepage} % \changes{v3.0p}{2007/04/03}{This macro added} % This command is a modified version of |\thepage| from \LaTeX2e. % It will be used inside |\caption@ifoddpage| only. % \begin{macrocode} \newcommand*\caption@thepage{\the\c@page} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@label} % \changes{v3.1}{2007/09/01}{This macro added} % This command is a modified version of |\label| from \LaTeX2e. % It will be used inside |\caption@ifoddpage| and |\FP@helpNote|. % \begin{macrocode} \newcommand*\caption@label[1]{% \protected@write\@auxout{\let\caption@thepage\relax}% {\string\caption@newlabel{#1}{\caption@thepage}}} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@pageref} % \changes{v3.1}{2007/09/01}{This macro added} % This command is a modified version of |\pageref| from \LaTeX2e. % It will be used inside |\caption@ifoddpage| and |\FP@helpNote|. % \begin{macrocode} \newcommand*\caption@pageref[1]{% \expandafter\ifx\csname caption@r@#1\endcsname\relax \G@refundefinedtrue % => 'There are undefined references.' \PackageWarning{caption}{Reference on page \thepage \space undefined}% \else \expandafter\let\expandafter\caption@thepage\csname caption@r@#1\endcsname \fi} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@ifoddpage} % \changes{v3.0p}{2007/04/03}{This macro added} % At the moment this macro uses an own label\ldots ref mechanism, % but an alternative implementation method would be using the % \package{refcount} package\cite{refcount} and |\ifodd\getpagerefnumber{|\ldots|}|. % \Note{This macro re-defines itself so the \texttt{.aux} file will % only be used once per group.} % \begin{macrocode} \newcommand*\caption@ifoddpage{% \caption@iftwoside{% \begingroup \@tempcnta\caption@count \advance\@tempcnta\@ne \xdef\caption@count{\the\@tempcnta}% \endgroup \caption@label\caption@count \caption@pageref\caption@count \ifodd\caption@thepage \let\caption@ifoddpage\@firstoftwo \else \let\caption@ifoddpage\@secondoftwo \fi }{\let\caption@ifoddpage\@firstoftwo}% % \end{macrocode} % \begin{macrocode} \caption@ifoddpage} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@setoptcmd} % \changes{v3.1}{2007/08/11}{This macro added} % |\caption@setoptcmd|\marg{cmd}\marg{off -or- value} % \begin{macrocode} \newcommand*\caption@setoptcmd[2]{% \caption@ifinlist{#2}{0,false,no,off}{\let#1\@undefined}{\def#1{#2}}} % \end{macrocode} % \end{macro} % % \subsection{Indentions} % % \begin{macro}{\caption@indent} % \changes{v3.1}{2007/07/29}{Renamed from \cs{captionindent} to \cs{caption@indent}} % \begin{macro}{\caption@parindent} % \begin{macro}{\caption@hangindent} % These are the indentions we support. % \begin{macrocode} \newdimen\caption@indent \newdimen\caption@parindent \newdimen\caption@hangindent % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % \changes{v3.0b}{2004/05/16}{Defaults added for options \opt{parindent=} % and \opt{hangindent=}} % \changes{v3.0h}{2005/08/22}{Option \opt{parskip=}: \cs{AtBeginCaption} % replaced by \cs{caption@@par}} % \changes{v3.0h}{2005/08/22}{Undocumented defaults for \opt{parindent=}, % \opt{hangindent=}, and \opt{parskip=} removed} % \begin{macrocode} \DeclareCaptionOption{indent}[\leftmargini]{% \setlength\caption@indent{#1}}% obsolete! \DeclareCaptionOption{indention}[\leftmargini]{% \setlength\caption@indent{#1}} \DeclareCaptionOption{parindent}{% \setlength\caption@parindent{#1}} \DeclareCaptionOption{hangindent}{% \setlength\caption@hangindent{#1}} \DeclareCaptionOption{parskip}{% \l@addto@macro\caption@@par{\setlength\parskip{#1}}} % \end{macrocode} % % \changes{v3.0h}{2005/08/22}{Increased compatibility to KOMA-Script: % A special version of options `parindent' and `parskip' added} % \changes{v3.0i}{2006/01/03}{Bugfix 06-01-03: KOMA-Script variants of % `parskip' and `parindent' options revised and moved into caption kernel} % \changes{v3.0j}{2006/02/23}{KOMA-Script variants of `parskip' and % `parindent' are obsolete now, removed} % \changes{v3.0o}{2007/03/30}{KOMA-Script variants of `parskip' and % `parindent' re-added, since they still collide with the current % version of the subfig package (Sigh!)} % % There is an option clash between the \KOMAScript\ document classes % and the \package{caption} kernel, both define the options |parindent| and % |parskip| but with different meaning. % Furthermore the ones defined by the \package{caption} kernel take a % value as parameter but the \KOMAScript\ ones do not. % So we need special versions of the options |parindent| and |parskip| here % which determine if a value is given (and therefore should be treated as % our option) or not (and therefore should be ignored by us).\footnote{%^^A % This problem was completely solved due a change of \cs{caption@ProcessOptions} % in \thispackage\ \version{3.0j}, but we still need this workaround since % these options otherwise would still collide with the current version $1.3$ % of the \package{subfig} package (Sigh!)} % \begin{macrocode} \@ifundefined{scr@caption}{}{% % \end{macrocode} % \begin{macrocode} \let\caption@KV@parindent\KV@caption@parindent \DeclareCaptionOption{parindent}[]{% \ifx,#1,% \caption@Debug{Option `parindent' ignored}% \else \caption@KV@parindent{#1}% \fi}% % \end{macrocode} % \begin{macrocode} \let\caption@KV@parskip\KV@caption@parskip \DeclareCaptionOption{parskip}[]{% \ifx,#1,% \caption@Debug{Option `parskip' ignored}% \else \caption@KV@parskip{#1}% \fi}% % \end{macrocode} % \begin{macrocode} } % \end{macrocode} % % \subsection{Styles} % % \begin{macro}{\DeclareCaptionStyle} % \changes{v3.0a}{2004/01/17}{Pass through argument \#3 so extra spaces % between arguments do make any harm} % |\DeclareCaptionStyle|\marg{name}\oarg{single-line-list-of-KV}\marg{list-of-KV} % \begin{macrocode} \newcommand*\DeclareCaptionStyle[1]{% \@testopt{\caption@declarestyle{#1}}{}} \@onlypreamble\DeclareCaptionStyle % \end{macrocode} % \begin{macrocode} \def\caption@declarestyle#1[#2]#3{% \global\@namedef{caption@sls@#1}{#2}% \global\@namedef{caption@sty@#1}{#3}} \@onlypreamble\caption@declarestyle % \end{macrocode} % \end{macro} % % \begin{macrocode} \DeclareCaptionOption{style}{\caption@setstyle{#1}} \DeclareCaptionOption{singlelinecheck}{\caption@set@bool\caption@ifslc{#1}} % \end{macrocode} % % \begin{macro}{\caption@setstyle} % \changes{v3.0f}{2005/06/01}{Starred variant added} % \changes{v3.1}{2007/07/29}{Recursive style definitions should work now} % |\caption@setstyle|\marg{name}\\ % |\caption@setstyle*|\marg{name}\par % Selecting a caption style means saving the additional % \meta{single-line-list-of-KV} (this will be done by |\caption@sls|), % resetting the caption options to the base ones (this will be done using % |\caption@resetstyle|) and executing the \meta{list-of-KV} options % (this will be done using |\caption@setup|).\par % The starred version will give no error message if the given style is not % defined. % \begin{macrocode} \newcommand*\caption@setstyle{% \caption@teststar\caption@@setstyle\@gobble\@firstofone} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@@setstyle[2]{% \@ifundefined{caption@sty@#2}% {#1{\caption@Error{Undefined style `#2'}}}% {\expandafter\let\expandafter\caption@sty\csname caption@sty@#2\endcsname \ifx\caption@setstyle@flag\@undefined \let\caption@setstyle@flag\caption@setstyle \let\caption@iftypewarning\@firstoftwo % = true \caption@resetstyle \expandafter\caption@setup\expandafter{\caption@sty}% \let\caption@setstyle@flag\@undefined \else \expandafter\caption@setup\expandafter{\caption@sty}% \fi \expandafter\let\expandafter\caption@sls\csname caption@sls@#2\endcsname \expandafter\caption@l@addto@list\expandafter\caption@opt@SingleLine \expandafter{\caption@sls}}} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@resetstyle} % \changes{v3.1}{2007/02/04}{% % This macro renamed from \cs{caption@setdefault} to \cs{caption@resetstyle}} % This resets (nearly) all caption options to the base ones. % \emph{Note that this does not touch the skips and the positioning!} % \begin{macrocode} \newcommand*\caption@resetstyle{% \caption@setup{% format=plain,labelformat=default,labelsep=colon,textformat=simple,% justification=justified,font=,labelfont=,textfont=,% margin=0pt,minmargin=0,maxmargin=0,% indent=0pt,parindent=0pt,hangindent=0pt,% singlelinecheck=1,strut=1}% \caption@clearsetup{SingleLine}} % \end{macrocode} % \end{macro} % % \changes{v3.0d}{2005/02/12}{\opt{indent=0pt} added to caption style \opt{default}} % \changes{v3.1}{2007/02/04}{Caption style `default' renamed to `base', and a new `default' added} % \changes{v3.1}{2007/03/31}{\opt{format=plain} added to caption style \opt{default}} % Currently there are two pre-defined styles, called `base' \& `default'. % The first one is a perfect match to the behavior of |\@makecaption| offered % by the standard \LaTeX\ document classes (and was called `default' in % \thispackage\ \version{3.0}), the second one matches the document % class actually used. % \begin{macrocode} \DeclareCaptionStyle{base}[indent=0pt,justification=centering]{} \DeclareCaptionStyle{default}[indent=0pt,justification=centering,format=plain]{% format=default,labelsep=default,textformat=default,% justification=default,font=default,labelfont=default,textfont=default} % \end{macrocode} % % \subsection{Formats} % % \begin{macro}{\DeclareCaptionFormat} % \changes{v3.0a}{2004/01/17}{Pass through argument \#3 so extra spaces % between arguments do make any harm} % \changes{v3.0d}{2005/02/09}{Starred variant added} % |\DeclareCaptionFormat|\marg{name}\marg{code with \#1, \#2, and \#3}\\ % |\DeclareCaptionFormat*|\marg{name}\marg{code with \#1, \#2, and \#3}\par % The starred form causes the code being typeset in vertical (instead of % horizontal) mode, but does not support the |indention=| option. % \begin{macrocode} \newcommand\DeclareCaptionFormat{% \caption@teststar\caption@declareformat\@gobble\@firstofone} \@onlypreamble\DeclareCaptionFormat % \end{macrocode} % \begin{macrocode} \newcommand\caption@declareformat[3]{% \global\expandafter\let\csname caption@ifh@#2\endcsname#1% \global\long\@namedef{caption@fmt@#2}##1##2##3{#3}} \@onlypreamble\caption@declareformat % \end{macrocode} % \end{macro} % % \begin{macrocode} \DeclareCaptionOption{format}{\caption@setformat{#1}} % \end{macrocode} % % \begin{macro}{\caption@setformat} % |\caption@setformat|\marg{name}\par % Selecting a caption format simply means saving the code (in |\caption@fmt|) % and if the code should be used in horizontal or vertical mode (|\caption@ifh|). % \begin{macrocode} \newcommand*\caption@setformat[1]{% \@ifundefined{caption@fmt@#1}% {\caption@Error{Undefined format `#1'}}% {\expandafter\let\expandafter\caption@ifh\csname caption@ifh@#1\endcsname \expandafter\let\expandafter\caption@fmt\csname caption@fmt@#1\endcsname}} % \end{macrocode} % \end{macro} % % \changes{v3.0a}{2004/01/23}{% % Caption format \opt{default} renamed to \opt{normal}} % \changes{v3.0f}{2005/05/12}{% % Caption format \opt{normal} renamed to \opt{@normal}} % \changes{v3.0h}{2005/08/25}{% % Caption format \opt{@normal} renamed to \opt{plain} and documented} % There are two pre-defined formats, called `plain' and `hang'. % \begin{macrocode} \DeclareCaptionFormat{plain}{#1#2#3\par} % \end{macrocode} % \begin{macrocode} \DeclareCaptionFormat{hang}{% \caption@ifin@list\caption@lsepcrlist\caption@lsepname {\caption@Error{% The option `labelsep=\caption@lsepname' does not work\MessageBreak with `format=hang'}}% {\@hangfrom{#1#2}% \advance\caption@parindent\hangindent \advance\caption@hangindent\hangindent \caption@@par#3\par}} % \end{macrocode} % % \changes{v3.0a}{2004/01/23}{Caption format \opt{default} linked to \opt{normal}} % \changes{v3.0e}{2005/04/28}{Bugfix 05-04-28: Missing \cs{caption@ifh@default} added} % `default' usually maps to `plain'. % \begin{macrocode} \def\caption@fmt@default{\caption@fmt@plain} \def\caption@ifh@default{\caption@ifh@plain} % \end{macrocode} % % \subsection{Label formats} % % \begin{macro}{\DeclareCaptionLabelFormat} % \changes{v3.0a}{2004/01/17}{% % Pass through argument \#2 so extra spaces between arguments do make any harm} % \changes{v3.1}{2007/07/07}{% % Label formats have three arguments now} % |\DeclareCaptionLabelFormat|\marg{name}\marg{code with \#1, \#2, and \#3} % \begin{macrocode} \newcommand*\DeclareCaptionLabelFormat[2]{% \global\@namedef{caption@lfmt@#1}##1##2##3{#2}} \@onlypreamble\DeclareCaptionLabelFormat % \end{macrocode} % \end{macro} % % \begin{macrocode} \DeclareCaptionOption{labelformat}{\caption@setlabelformat{#1}} % \end{macrocode} % % \begin{macro}{\caption@setlabelformat} % |\caption@setlabelformat|\marg{name}\par % Selecting a caption label format simply means saving the code (in |\caption@lfmt|). % \begin{macrocode} \newcommand*\caption@setlabelformat[1]{% \@ifundefined{caption@lfmt@#1}% {\caption@Error{Undefined label format `#1'}}% {\expandafter\let\expandafter\caption@lfmt\csname caption@lfmt@#1\endcsname}} % \end{macrocode} % \end{macro} % % There are three pre-defined label formats, called `empty', `simple', % and `parens'. % \begin{macrocode} \DeclareCaptionLabelFormat{empty}{} \DeclareCaptionLabelFormat{simple}{\bothIfFirst{#1}{\nobreakspace}#2} \DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{\nobreakspace}(#2)} % \end{macrocode} % % `default' usually maps to `simple'. % \begin{macrocode} \def\caption@lfmt@default{\caption@lfmt@simple} % \end{macrocode} % % \subsection{Label separators} % % \begin{macro}{\DeclareCaptionLabelSeparator} % \changes{v3.0a}{2004/01/17}{Pass through argument \#2 so extra spaces % between arguments do make any harm} % \changes{v3.0h}{2005/08/25}{Starred variant added} % \changes{v3.1}{2007/07/13}{Test for CR added} % |\DeclareCaptionLabelSeparator|\marg{name}\marg{code}\\ % |\DeclareCaptionLabelSeparator*|\marg{name}\marg{code}\par % The starred form causes the label separator to be typeset \emph{without} using |\captionlabelfont|. % \begin{macrocode} \newcommand\DeclareCaptionLabelSeparator{% \caption@teststar\caption@declarelabelseparator\@gobble\@firstofone} \@onlypreamble\DeclareCaptionLabelSeparator % \end{macrocode} % \begin{macrocode} \newcommand\caption@declarelabelseparator[3]{% \global\expandafter\let\csname caption@iflf@#2\endcsname#1% \global\long\@namedef{caption@lsep@#2}{#3}% \caption@@declarelabelseparator{#2}#3\\\@nil} \@onlypreamble\caption@declarelabelseparator % \end{macrocode} % \begin{macrocode} \long\def\caption@@declarelabelseparator#1#2\\#3\@nil{% \def\@tempa{#3}\ifx\@tempa\@empty \else \caption@g@addto@list\caption@lsepcrlist{#1}% \fi} \@onlypreamble\caption@@declarelabelseparator % \end{macrocode} % \end{macro} % % \begin{macrocode} \DeclareCaptionOption{labelsep}{\caption@setlabelseparator{#1}} \DeclareCaptionOption{labelseparator}{\caption@setlabelseparator{#1}} % \end{macrocode} % % \begin{macro}{\caption@setlabelseparator} % |\caption@setlabelseparator|\marg{name}\par % Selecting a caption label separator simply means saving the code (in |\caption@lsep|). % \begin{macrocode} \newcommand*\caption@setlabelseparator[1]{% \@ifundefined{caption@lsep@#1}% {\caption@Error{Undefined label separator `#1'}}% {\edef\caption@lsepname{#1}% \expandafter\let\expandafter\caption@iflf\csname caption@iflf@#1\endcsname \expandafter\let\expandafter\caption@lsep\csname caption@lsep@#1\endcsname}} % \end{macrocode} % \end{macro} % % \changes{v3.0f}{2005/06/11}{Bugfix 05-03-23: Caption label separator % \opt{newline} implementation changed from \cs{newline} to \cs{\textbackslash}} % \changes{v3.0h}{2005/08/24}{Caption label separator \opt{endash} added} % There are seven pre-defined label separators, called `none', `colon', `period', `space', % `quad', `newline', and `endash'. % \begin{macrocode} \DeclareCaptionLabelSeparator{none}{} \DeclareCaptionLabelSeparator{colon}{: } \DeclareCaptionLabelSeparator{period}{. } \DeclareCaptionLabelSeparator{space}{ } \DeclareCaptionLabelSeparator*{quad}{\quad} \DeclareCaptionLabelSeparator*{newline}{\\} \DeclareCaptionLabelSeparator*{endash}{\space\textendash\space} % \end{macrocode} % % `default' usually maps to `colon'. % \begin{macrocode} \def\caption@lsep@default{\caption@lsep@colon} \def\caption@iflf@default{\caption@iflf@colon} % \end{macrocode} % % \subsection{Text formats} % % \begin{macro}{\DeclareCaptionTextFormat} % \changes{v3.0l}{2007/02/18}{This macro added} % |\DeclareCaptionTextFormat|\marg{name}\marg{code with \#1} % \begin{macrocode} \newcommand*\DeclareCaptionTextFormat[2]{% \global\long\@namedef{caption@tfmt@#1}##1{#2}} \@onlypreamble\DeclareCaptionTextFormat % \end{macrocode} % \end{macro} % % \changes{v3.0d}{2005/02/12}{Option \opt{strut=} added} % \begin{macrocode} \DeclareCaptionOption{textformat}{\caption@settextformat{#1}} \DeclareCaptionOption{strut}{\caption@set@bool\caption@ifstrut{#1}} % \end{macrocode} % % \begin{macro}{\caption@settextformat} % \changes{v3.0l}{2007/02/18}{This macro added} % |\caption@settextformat|\marg{name}\par % Selecting a caption text format simply means saving the code (in |\caption@tfmt|). % \begin{macrocode} \newcommand*\caption@settextformat[1]{% \@ifundefined{caption@tfmt@#1}% {\caption@Error{Undefined text format `#1'}}% {\expandafter\let\expandafter\caption@tfmt\csname caption@tfmt@#1\endcsname}} % \end{macrocode} % \end{macro} % % There are two pre-defined text formats, called `simple' and `period'. % \begin{macrocode} \DeclareCaptionTextFormat{simple}{#1} \DeclareCaptionTextFormat{period}{#1.} % \end{macrocode} % % `default' usually maps to `simple'. % \begin{macrocode} \def\caption@tfmt@default{\caption@tfmt@simple} % \end{macrocode} % % \subsection{Fonts} % % \begin{macro}{\DeclareCaptionFont} % \changes{v3.0a}{2004/01/22}{% % Bugfix: Multi token arguments are allowed now} % \changes{v3.1}{2007/05/07}{% % Internal: Uses \cs{caption@fnt} instead of \cs{caption@temp} now} % |\DeclareCaptionFont|\marg{name}\marg{code} % \begin{macrocode} \newcommand*\DeclareCaptionFont[2]{% \define@key{caption@fnt}{#1}[]{\l@addto@macro\caption@fnt{#2}}} \@onlypreamble\DeclareCaptionFont % \end{macrocode} % \end{macro} % % \begin{macro}{\DeclareDefaultCaptionFont} % \changes{v3.1}{2006/05/14}{This macro added} % |\DeclareDefaultCaptionFont|\marg{name}\marg{code} % \begin{macrocode} \newcommand*\DeclareDefaultCaptionFont[2]{% \global\@namedef{caption#1@default}{#2}} \@onlypreamble\DeclareDefaultCaptionFont % \end{macrocode} % \end{macro} % % \begin{macrocode} \DeclareCaptionOption{font}{\caption@setfont{font}{#1}} \DeclareDefaultCaptionFont{font}{} % \end{macrocode} % \begin{macrocode} \DeclareCaptionOption{labelfont}{\caption@setfont{labelfont}{#1}} \DeclareDefaultCaptionFont{labelfont}{} % \end{macrocode} % \begin{macrocode} \DeclareCaptionOption{textfont}{\caption@setfont{textfont}{#1}} \DeclareDefaultCaptionFont{textfont}{} % \end{macrocode} % % \begin{macro}{\caption@setfont} % \changes{v3.0l}{2007/01/30}{Usage of \cs{caption@setkeys} with optional argument} % \changes{v3.1}{2006/05/14}{Support of \cs{DeclareDefaultCaptionFont} added} % |\caption@setfont|\marg{name}\marg{keyval-list of names}\par % Selecting a caption font means saving all the code snippets % (in |\caption#1|). % Because we use |\setkeys| recursive here we need to do this inside an % extra group and collect all the code snippets in |\caption@tempa| first. % \begin{macrocode} \newcommand*\caption@setfont[2]{% \begingroup \let\caption@fnt\@empty \define@key{caption@fnt}{default}[]{% \l@addto@macro\caption@fnt{\csname caption#1@default\endcsname}}% \caption@setkeys[caption]{caption@fnt}{#2}% \global\let\caption@tempa\caption@fnt \endgroup \expandafter\let\csname caption#1\endcsname\caption@tempa} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@font} % \changes{v3.1}{2007/05/07}{This macro added} % |\caption@font|\marg{keyval-list of names}\\ % |\caption@font*|\marg{keyval-code}\par % Sets the given font, e.g.~|\caption@font{small,it}| % is equivalent to |\small\itshape|. % \begin{macrocode} \newcommand*\caption@font{% \caption@teststar\caption@@font\@firstofone {\caption@setkeys[caption]{caption@fnt}}} \newcommand*\caption@@font[2]{% \begingroup \def\caption@fnt{\endgroup}% #1{#2}% \caption@fnt} % \end{macrocode} % \end{macro} % % These are the pre-defined font code snippets. % % \changes{v3.1}{2007/05/07}{Color font support added (kernel)} % \begin{macrocode} \DeclareCaptionFont{normalcolor}{\normalcolor} \DeclareCaptionFont{color}{\color{#1}} % \end{macrocode} % % \begin{macrocode} \DeclareCaptionFont{normalfont}{\normalfont} \DeclareCaptionFont{up}{\upshape} \DeclareCaptionFont{it}{\itshape} \DeclareCaptionFont{sl}{\slshape} \DeclareCaptionFont{sc}{\scshape} \DeclareCaptionFont{md}{\mdseries} \DeclareCaptionFont{bf}{\bfseries} \DeclareCaptionFont{rm}{\rmfamily} \DeclareCaptionFont{sf}{\sffamily} \DeclareCaptionFont{tt}{\ttfamily} % \end{macrocode} % % \begin{macrocode} \DeclareCaptionFont{scriptsize}{\scriptsize} \DeclareCaptionFont{footnotesize}{\footnotesize} \DeclareCaptionFont{small}{\small} \DeclareCaptionFont{normalsize}{\normalsize} \DeclareCaptionFont{large}{\large} \DeclareCaptionFont{Large}{\Large} % \end{macrocode} % % \changes{v3.0p}{2007/04/02}{\package{setspace} package support added (kernel)} % \begin{macrocode} \DeclareCaptionFont{singlespacing}{\setstretch\setspace@singlespace}% normally 1 \DeclareCaptionFont{onehalfspacing}{\onehalfspacing} \DeclareCaptionFont{doublespacing}{\doublespacing} \DeclareCaptionFont{stretch}{\setstretch{#1}} \caption@AtBeginDocument{\providecommand*\setstretch[1]{}} % \end{macrocode} % % \begin{macrocode} %\DeclareCaptionFont{normal}{% % \caption@font{normalcolor,normalfont,normalsize,singlespacing} \DeclareCaptionFont{normal}{% \caption@font*{% \KV@caption@fnt@normalcolor\@unused \KV@caption@fnt@normalfont\@unused \KV@caption@fnt@normalsize\@unused \KV@caption@fnt@singlespacing\@unused}} % \end{macrocode} % % \begin{macro}{\captionsize} % \changes{v3.0a}{2004/01/23}{Implementation changed from \cs{captionfont} % to \cs{@empty}} % \changes{v3.0c}{2004/07/16}{Use \cs{providecommand} instead of \cs{newcommand}} % The old versions \version{1.x} of \thispackage\ offered this % command to setup the font size used for captions. We still do % so old documents will work fine. % \begin{macrocode} \providecommand\captionsize{} % \end{macrocode} % \end{macro} % % \changes{v3.0a}{2004/01/23}{Option \opt{size=} now sets \cs{captionsize} instead of \cs{captionfont}} % \begin{macrocode} \DeclareCaptionOption{size}{\caption@setfont{size}{#1}} \DeclareDefaultCaptionFont{size}{} % \end{macrocode} % % \subsection{Justifications} % % \begin{macro}{\DeclareCaptionJustification} % \changes{v3.0a}{2004/01/17}{Pass through argument \#2 so extra spaces % between arguments do make any harm} % \changes{v3.1}{2007/07/03}{Mapped to \cs{DeclareCaptionFont}} % |\DeclareCaptionJustification|\marg{name}\marg{code} % \begin{macrocode} \newcommand*\DeclareCaptionJustification[2]{% \global\@namedef{caption@hj@#1}{#2}% for compatibility to v3.0 \DeclareCaptionFont{#1}{#2}} \@onlypreamble\DeclareCaptionJustification % \end{macrocode} % \end{macro} % % \begin{macro}{\DeclareDefaultCaptionJustification} % \changes{v3.1}{2007/07/03}{This macro added} % |\DeclareDefaultCaptionJustification|\marg{code} % \begin{macrocode} \newcommand*\DeclareDefaultCaptionJustification[1]{% \global\@namedef{caption@hj@default}{#1}% for compatibility to v3.0 \DeclareDefaultCaptionFont{@hj}{#1}} \@onlypreamble\DeclareDefaultCaptionJustification % \end{macrocode} % \end{macro} % % \begin{macrocode} \DeclareCaptionOption{justification}{\caption@setjustification{#1}} \DeclareDefaultCaptionJustification{} % \end{macrocode} % % \begin{macro}{\caption@setjustification} % \changes{v3.1}{2007/07/03}{Mapped to \cs{caption@setfont}} % |\caption@setjustification|\marg{name}\par % Selecting a caption justification simply means saving the code (in |\caption@hj|). % \begin{macrocode} \newcommand*\caption@setjustification{\caption@setfont{@hj}} % \end{macrocode} % \end{macro} % % These are the pre-defined justification code snippets. % \begin{macrocode} \DeclareCaptionJustification{justified}{} \DeclareCaptionJustification{centering}{\centering} \DeclareCaptionJustification{centerfirst}{\centerfirst} \DeclareCaptionJustification{centerlast}{\centerlast} \DeclareCaptionJustification{raggedleft}{\raggedleft} \DeclareCaptionJustification{raggedright}{\raggedright} % \end{macrocode} % % \begin{macro}{\centerfirst} % \changes{v3.0l}{2007/01/21}{Bugfix: Usage of \cs{@centercr} added (Thanks to Olga!)} % \changes{v3.0l}{2007/01/21}{This macro renamed from \cs{caption@centerfirst} to \cs{centerfirst}} % Please blame Frank Mittelbach for the code of |\caption@centerfirst| |:-)| % \begin{macrocode} \providecommand\centerfirst{% \let\\\@centercr \edef\caption@normaladjust{% \leftskip\the\leftskip \rightskip\the\rightskip \parfillskip\the\parfillskip\relax}% \leftskip\z@\@plus -1fil% \rightskip\z@\@plus 1fil% \parfillskip\z@skip \noindent\hskip\z@\@plus 2fil% \@setpar{\@@par\@restorepar\caption@normaladjust}} % \end{macrocode} % \end{macro} % % \begin{macro}{\centerlast} % \changes{v3.0l}{2007/01/21}{Bugfix: Usage of \cs{@centercr} added (Thanks to Olga!)} % \changes{v3.0l}{2007/01/21}{This macro renamed from \cs{caption@centerlast} to \cs{centerlast}} % This is based on code from Anne Br\"uggemann-Klein\cite{Anne} % \begin{macrocode} \providecommand\centerlast{% \let\\\@centercr \leftskip\z@\@plus 1fil% \rightskip\z@\@plus -1fil% \parfillskip\z@\@plus 2fil\relax} % \end{macrocode} % \end{macro} % % \subsubsection{The ragged2e package} % \changes{v3.0b}{2004/05/16}{Improved \package{ragged2e} package support} % % We also support the upper-case commands offered by the \package{ragged2e} % package. % Note that these just map to their lower-case variants if the % \package{ragged2e} package is not available. % \begin{macrocode} \DeclareCaptionJustification{Centering}{% \caption@ragged\Centering\centering} \DeclareCaptionJustification{RaggedLeft}{% \caption@ragged\RaggedLeft\raggedleft} \DeclareCaptionJustification{RaggedRight}{% \caption@ragged\RaggedRight\raggedright} % \end{macrocode} % % \begin{macro}{\caption@ragged} % \changes{v3.0p}{2007/04/07}{The `ragged2e' package will now only been % loaded when needed} % \changes{v3.0q}{2007/04/11}{Bugfix: Usage of \cs{caption@Info} replaced % by \cs{caption@Debug}} % \changes{v3.1}{2007/04/16}{A different warning will be given on first \LaTeX\ run} % |\caption@ragged| will be basically defined as % \begin{quote} % |\AtBeginDocument{\IfFileExists{ragged2e.sty}%|\\ % | {\RequirePackage{ragged2e}\let\caption@ragged\@firstoftwo}%|\\ % | {\let\caption@ragged\@secondoftwo}}| % \end{quote} % but with an additional warning if the ragged2e package is not loaded (yet). % (This warning will be type out only one time per option, that's why % we need the |caption\string#1| stuff.) % Furthermore we load the \package{ragged2e} package, if needed and available. % \begin{macrocode} \newcommand*\caption@ragged{% \caption@Debug{We need ragged2e}% \protected@write\@auxout{}{\string\caption@newlabel{ragged2e}{}}% \global\let\caption@ragged\caption@@ragged \caption@ragged} % \end{macrocode} % \begin{macrocode} \caption@AtBeginDocument{% \@ifundefined{caption@r@ragged2e}{% \newcommand*\caption@@ragged{% \PackageWarning{caption}{% `ragged2e' support has been changed.\MessageBreak Rerun to get captions right}% \global\let\caption@ragged\@secondoftwo % suppress further warnings \caption@ragged}% }{% \caption@Debug{We load ragged2e}% \IfFileExists{ragged2e.sty}{% \RequirePackage{ragged2e}% \let\caption@@ragged\@firstoftwo }{% \newcommand*\caption@@ragged[2]{% \@ifundefined{caption\string#1}{% \PackageWarning{caption}{% `ragged2e' package not loaded, therefore\MessageBreak substituting \string#2 for \string#1\MessageBreak}% \global\@namedef{caption\string#1}}{}% #2}% }% }} % \end{macrocode} % \begin{macrocode} % \end{macrocode} % \end{macro} % % \subsection{Vertical spaces before and after captions} % % \begin{macro}{\abovecaptionskip} % \begin{macro}{\belowcaptionskip} % Usually these skips are defined within the document class, but some % document classes don't do so. % \begin{macrocode} \@ifundefined{abovecaptionskip}{% \newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@}}{} \@ifundefined{belowcaptionskip}{% \newlength\belowcaptionskip\setlength\belowcaptionskip{0\p@}}{} % \end{macrocode} % \end{macro} % \end{macro} % % \changes{v3.0d}{2005/02/12}{Option \opt{skip=} added} % \begin{macrocode} \DeclareCaptionOption{aboveskip}{\setlength\abovecaptionskip{#1}} \DeclareCaptionOption{belowskip}{\setlength\belowcaptionskip{#1}} \DeclareCaptionOption{skip}{\setlength\abovecaptionskip{#1}} % \end{macrocode} % % \subsection{Positioning} % % These macros handle the right position of the caption. % Note that the position is actually \emph{not} controlled by the % \package{caption3} kernel options, but by the user (or a specific package % like the \package{float} package) instead. % The user can put the |\caption| command wherever he likes! So this stuff % is only to give us a \emph{hint} where to put the right skips, the user % usually has to take care for himself that this hint actually matches the % right position. % % \begin{macrocode} \DeclareCaptionOption{position}{\caption@setposition{#1}} % \end{macrocode} % % \begin{macro}{\caption@setposition} % \changes{v3.0a}{2004/01/22}{Now the positions \opt{t}, \opt{above}, \opt{b}, % \opt{below}, and \opt{a} are allowed, too} % \changes{v3.0d}{2004/08/10}{Usage of \cs{caption@defaultpos} added} % |\caption@setposition|\marg{position}\par % Selecting the caption position means that we put |\caption@position| to % the right value. \emph{Please do \textbf{not} use the internal macro % \cs{caption@position} in your own package or document, but use the wrapper % macro \cs{caption@iftop} instead.} % \begin{macrocode} \newcommand*\caption@setposition[1]{% \caption@ifinlist{#1}{d,default}{% \let\caption@position\caption@defaultpos }{\caption@ifinlist{#1}{t,top,above}{% \let\caption@position\@firstoftwo }{\caption@ifinlist{#1}{b,bottom,below}{% \let\caption@position\@secondoftwo }{\caption@ifinlist{#1}{a,auto}{% \let\caption@position\@undefined }{% \caption@Error{Undefined position `#1'}% }}}}} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@defaultpos} % \changes{v3.1}{2007/05/08}{Default position changed from `bottom' to `auto'} % The default `position' is `auto', this means that \thispackage\ will try % to guess the current position of the caption. % (But in many cases, for example in |longtable|s, this is doomed to fail!)\par % The setting `bottom' correspondents to the |\@makecaption| implementation % in the standard \LaTeX\ document classes, but `auto' should give better % results in most cases. % \begin{macrocode} %\caption@setdefaultpos{a}% default = auto \let\caption@defaultpos\@undefined % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@iftop} % \changes{v3.0a}{2004/01/23}{Split into \cs{caption@iftop} \& \cs{caption@fixposition}} % \changes{v3.0d}{2005/02/12}{Adapted to \cs{caption@defaultpos}} % \changes{v3.1}{2007/05/08}{Position will be fixed to `bottom' if `auto'} % |\caption@iftop|\marg{true-code}\marg{false-code}\par % (If the |position=| is set to |auto| we assume a |bottom| position here.) % \begin{macrocode} \newcommand*\caption@iftop{% \ifx\caption@position\@undefined \let\caption@position\@secondoftwo % = \caption@setposition b% \fi \caption@position} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@fixposition} % \changes{v3.0b}{2004/05/16}{% % Split into \cs{caption@fixposition} & \cs{caption@autoposition}} % |\caption@fixposition|\par % This macro checks if the `position' is set to `auto'. % If yes, |\caption@autoposition| will be called to % set |\caption@position| to a proper value we can actually use. % \begin{macrocode} \newcommand*\caption@fixposition{% \ifx\caption@position\@undefined \caption@autoposition \fi} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@autoposition} % \changes{v3.0a}{2004/01/23}{\cs{ifvmode} added} % |\caption@autoposition|\par % We guess the current position of the caption by checking |\prevdepth|.\par % A different solution would be setting the |\spacefactor| to something % not much less than 1000 (for example 994) in |\caption@start| and % checking this value here by |\ifnum\spacefactor=994|. % (It's implemented in the \package{threeparttable} % package\cite{threeparttable} this way.)\par % Another idea would be checking |\@ifminipage|, but since some packages % typeset the caption within a simple |\vbox| this does not seem to be a % good one. % \begin{macrocode} \newcommand*\caption@autoposition{% \ifvmode \edef\caption@tempa{\the\prevdepth}% \caption@Debug{\protect\prevdepth=\caption@tempa}% \ifdim\prevdepth>-\p@ \let\caption@position\@secondoftwo \else \let\caption@position\@firstoftwo \fi % = \caption@setposition{\ifdim\prevdepth>-\p@ b\else t\fi}% \else \caption@Debug{no \protect\prevdepth}% \let\caption@position\@secondoftwo % = \caption@setposition b% \fi} % \end{macrocode} % \end{macro} % \begin{macro}{\caption@setautoposition} % \changes{v3.1}{2007/06/10}{This macro added} % |\caption@setautoposition|\marg{position}\par % replaces the above algorithm by a different one (or a fixed position setting). % \begin{macrocode} \newcommand*\caption@setautoposition[1]{% \def\caption@autoposition{\caption@setposition{#1}}} % \end{macrocode} % \end{macro} % % \subsection{Hooks} % % \begin{macro}{\AtBeginCaption} % \begin{macro}{\AtEndCaption} % |\AtBeginCaption| \marg{code}\\ % |\AtEndCaption| \marg{code}\par % These hooks can be used analogous to |\AtBeginDocument| and |\AtEndDocument|. % \begin{macrocode} \newcommand*\caption@beginhook{} \newcommand*\caption@endhook{} \newcommand*\AtBeginCaption{\l@addto@macro\caption@beginhook} \newcommand*\AtEndCaption{\l@addto@macro\caption@endhook} % \end{macrocode} % \end{macro} % \end{macro} % % \subsection{Lists} % % \changes{v3.0b}{2004/05/16}{Option \opt{listof=} added} % \begin{macrocode} \DeclareCaptionOption{listof}{\caption@set@bool\caption@iflof{#1}} % \end{macrocode} % % \begin{macro}{\DeclareCaptionListOfFormat} % \changes{v3.1}{2004/07/15}{This macro added} % |\DeclareCaptionListOfFormat|\marg{name}\marg{code with \#1 and \#2} % \begin{macrocode} \newcommand*\DeclareCaptionListOfFormat[2]{% \global\@namedef{caption@lstfmt@#1}##1##2{#2}} \@onlypreamble\DeclareCaptionListOfFormat % \end{macrocode} % \end{macro} % % \changes{v3.1}{2007/07/15}{Option \opt{listofformat=} added} % \begin{macrocode} \DeclareCaptionOption{listofformat}{\caption@setlistofformat{#1}} % \end{macrocode} % % \begin{macro}{\caption@setlistofformat} % \changes{v3.1}{2004/07/15}{This macro added} % |\caption@setlistofformat|\marg{name}\par % Selecting a caption list-of format simply means saving the code (in |\caption@lstfmt|). % \begin{macrocode} \newcommand*\caption@setlistofformat[1]{% \@ifundefined{caption@lstfmt@#1}% {\caption@Error{Undefined list-of format `#1'}}% {\expandafter\let\expandafter\caption@lstfmt \csname caption@lstfmt@#1\endcsname}} % \end{macrocode} % \end{macro} % % There are five pre-defined list formats, taken from the \package{subfig} package. % \begin{macrocode} \DeclareCaptionListOfFormat{empty}{} \DeclareCaptionListOfFormat{simple}{#1#2} \DeclareCaptionListOfFormat{parens}{#1(#2)} \DeclareCaptionListOfFormat{subsimple}{#2} \DeclareCaptionListOfFormat{subparens}{(#2)} % \end{macrocode} % \begin{macrocode} \def\caption@lstfmt@default{\caption@lstfmt@subsimple} % \end{macrocode} % % \subsection{Debug option} % \changes{v3.0m}{2007/03/04}{Debug option added (kernel)} % % \begin{macrocode} \DeclareCaptionOption{debug}[1]{% \caption@set@bool\caption@ifdebug{#1}% \let\caption@iftypewarning\caption@ifdebug \caption@ifdebug {\def\caption@Debug{\PackageInfo{caption}}}% {\let\caption@Debug\@gobble}} % \end{macrocode} % \begin{macrocode} \DeclareOption{debug}{\setkeys{caption}{debug}} % \end{macrocode} % \begin{macrocode} \setkeys{caption}{debug=0} % \end{macrocode} % % \subsection{Document classes \& Babel support} % % \begin{macrocode} \caption@CheckCommand\@makecaption{\let\@makecaption\@undefined} % \end{macrocode} % % \subsubsection{The standard \texorpdfstring{\LaTeX{}}{LaTeX} classes} % % \begin{macrocode} \caption@CheckCommand\@makecaption{% % article|report|book [2005/09/16 v1.4f Standard LaTeX document class] \long\def\@makecaption#1#2{% \vskip\abovecaptionskip \sbox\@tempboxa{#1: #2}% \ifdim \wd\@tempboxa >\hsize #1: #2\par \else \global \@minipagefalse \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% \fi \vskip\belowcaptionskip}} % \end{macrocode} % % \subsubsection{The \AmS{} \& \SmF{} classes} % \changes{v3.1}{2007/07/29}{\AmS\ \& \SmF\ classes support added (kernel)} % % \begin{macrocode} \@ifundefined{@captionheadfont}{}{% % \end{macrocode} % \begin{macrocode} \caption@CheckCommand\@makecaption{% % amsart|amsproc|amsbook [2004/08/06 v2.20] \long\def\@makecaption#1#2{% \setbox\@tempboxa\vbox{\color@setgroup \advance\hsize-2\captionindent\noindent \@captionfont\@captionheadfont#1\@xp\@ifnotempty\@xp {\@cdr#2\@nil}{.\@captionfont\upshape\enspace#2}% \unskip\kern-2\captionindent\par \global\setbox\@ne\lastbox\color@endgroup}% \ifhbox\@ne % the normal case \setbox\@ne\hbox{\unhbox\@ne\unskip\unskip\unpenalty\unkern}% \fi \ifdim\wd\@tempboxa=\z@ % this means caption will fit on one line \setbox\@ne\hbox to\columnwidth{\hss\kern-2\captionindent\box\@ne\hss}% \else % tempboxa contained more than one line \setbox\@ne\vbox{\unvbox\@tempboxa\parskip\z@skip \noindent\unhbox\@ne\advance\hsize-2\captionindent\par}% \fi \ifnum\@tempcnta<64 % if the float IS a figure... \addvspace\abovecaptionskip \hbox to\hsize{\kern\captionindent\box\@ne\hss}% \else % if the float IS NOT a figure... \hbox to\hsize{\kern\captionindent\box\@ne\hss}% \nobreak \vskip\belowcaptionskip \fi \relax }} % \end{macrocode} % \begin{macrocode} \caption@CheckCommand\@makecaption{% % smfart|smfbook [1999/11/15 v1.2f Classe LaTeX pour les articles publies par la SMF] \long\def\@makecaption#1#2{% \ifdim\captionindent>.1\hsize \captionindent.1\hsize \fi \setbox\@tempboxa\vbox{\color@setgroup \advance\hsize-2\captionindent\noindent \@captionfont\@captionheadfont#1\@xp\@ifnotempty\@xp {\@cdr#2\@nil}{\@addpunct{.}\@captionfont\upshape\enspace#2}% \unskip\kern-2\captionindent\par \global\setbox\@ne\lastbox\color@endgroup}% \ifhbox\@ne % the normal case \setbox\@ne\hbox{\unhbox\@ne\unskip\unskip\unpenalty\unkern}% \fi \ifdim\wd\@tempboxa=\z@ % this means caption will fit on one line \setbox\@ne\hbox to\columnwidth{\hss\kern-2\captionindent\box\@ne\hss}% \@tempdima\wd\@ne\advance\@tempdima-\captionindent \wd\@ne\@tempdima \else % tempboxa contained more than one line \setbox\@ne\vbox{\rightskip=0pt plus\captionindent\relax \unvbox\@tempboxa\parskip\z@skip \noindent\unhbox\@ne\advance\hsize-2\captionindent\par}% \fi \ifnum\@tempcnta<64 % if the float IS a figure... \addvspace\abovecaptionskip \noindent\kern\captionindent\box\@ne \else % if the float IS NOT a figure... \noindent\kern\captionindent\box\@ne \nobreak \vskip\belowcaptionskip \fi \relax }} % \end{macrocode} % \begin{macrocode} \let\captionmargin\captionindent \begingroup\edef\@tempa{\endgroup \noexpand\caption@g@addto@list\noexpand\caption@sty@default {margin=\the\captionmargin \@ifundefined{smf@makecaption}{}{,maxmargin=.1\linewidth}}} \@tempa \caption@g@addto@list\caption@sls@default{margin*=.5\captionmargin} \DeclareCaptionLabelSeparator{default}{.\enspace} \DeclareDefaultCaptionFont{font}{\@captionfont} \DeclareDefaultCaptionFont{labelfont}{\@captionheadfont} \DeclareDefaultCaptionFont{textfont}{\@captionfont\upshape} \captionsetup*[figure]{position=b} \captionsetup*[table]{position=t} % \end{macrocode} % \begin{macrocode} } % \end{macrocode} % % \subsubsection{The beamer class} % \changes{v3.1}{2007/03/10}{beamer class support added (kernel)} % % \begin{macrocode} \@ifclassloaded{beamer}{% % \end{macrocode} % \begin{macrocode} \caption@CheckCommand\beamer@makecaption{% % beamerbaselocalstructure.sty,v 1.53 2007/01/28 20:48:21 tantau \long\def\beamer@makecaption#1#2{% \def\insertcaptionname{\csname#1name\endcsname}% \def\insertcaptionnumber{\csname the#1\endcsname}% \def\insertcaption{#2}% \nobreak\vskip\abovecaptionskip\nobreak \sbox\@tempboxa{\usebeamertemplate**{caption}}% \ifdim \wd\@tempboxa >\hsize \usebeamertemplate**{caption}\par \else \global \@minipagefalse \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% \fi \nobreak\vskip\belowcaptionskip\nobreak}} % \end{macrocode} % \begin{macrocode} \DeclareCaptionLabelFormat{default}{#1} \DeclareDefaultCaptionJustification{\raggedright} \DeclareDefaultCaptionFont{font}{% \usebeamerfont*{caption}% \usebeamercolor[fg]{caption}} \DeclareDefaultCaptionFont{labelfont}{% \usebeamercolor[fg]{caption name}% \usebeamerfont*{caption name}} % \end{macrocode} % If the \package{beamer} document class is used, we offer a beamer % template called `caption3' which can be used with option `beamer' or % |\setbeamertemplate{caption}[caption3]|.\par % (Note that this is of no use when \thispackage\ is used, too.) % \begin{macrocode} \defbeamertemplate{caption}{caption3}{% \caption@make\insertcaptionname\insertcaptionnumber\insertcaption} % \end{macrocode} % \begin{macrocode} \DeclareOption{beamer}{% % \usebeamertemplate**{caption} will set font \DeclareDefaultCaptionFont{font}{}% \setbeamertemplate{caption}[caption3]} % \end{macrocode} % \begin{macrocode} }{} % \end{macrocode} % % \subsubsection{The \KOMAScript{} classes} % \changes{v3.1}{2007/03/31}{\KOMAScript\ classes support added (kernel)} % % \begin{macrocode} \@ifundefined{scr@caption}{}{% % \end{macrocode} % \begin{macrocode} \caption@CheckCommand\@makecaption{% % scrartcl|scrreprt|scrbook [2007/03/07 v2.97a KOMA-Script document class] \long\def\@makecaption#1#2{% \if@captionabove \vskip\belowcaptionskip \else \vskip\abovecaptionskip \fi \@@makecaption\@firstofone{#1}{#2}% \if@captionabove \vskip\abovecaptionskip \else \vskip\belowcaptionskip \fi}} % \end{macrocode} % \begin{macrocode} \DeclareCaptionFormat{default}{% \ifdofullc@p \caption@ifin@list\caption@lsepcrlist\caption@lsepname {\caption@Error{% The option `labelsep=\caption@lsepname' does not work\MessageBreak with \noexpand\setcaphanging (which is set by default)}}% {\caption@fmt@hang{#1}{#2}{#3}}% \else #1#2% \ifdim\cap@indent<\z@ \par \noindent\hspace*{-\cap@indent}% \else\if@capbreak \par \fi\fi #3\par \fi} \DeclareCaptionLabelSeparator{default}{\captionformat} \DeclareDefaultCaptionFont{font}{\scr@fnt@caption} \DeclareDefaultCaptionFont{labelfont}{\scr@fnt@captionlabel} % \end{macrocode} % \begin{macrocode} } % \end{macrocode} % % \subsubsection{The \NTG{} Dutch classes} % \changes{v3.1}{2007/04/06}{NTG classes support added (kernel)} % % \begin{macrocode} \@ifundefined{CaptionFonts}{}{% % \end{macrocode} % \begin{macrocode} \caption@CheckCommand\@makecaption{% % artikel|rapport|boek [2004/06/07 v2.1a NTG LaTeX document class] \long\def\@makecaption#1#2{% \vskip\abovecaptionskip \sbox\@tempboxa{{\CaptionLabelFont#1:} \CaptionTextFont#2}% \ifdim \wd\@tempboxa >\hsize {\CaptionLabelFont#1:} \CaptionTextFont#2\par \else \global \@minipagefalse \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% \fi \vskip\belowcaptionskip}} % \end{macrocode} % \begin{macrocode} \DeclareDefaultCaptionFont{labelfont}{\CaptionLabelFont} \DeclareDefaultCaptionFont{textfont}{\CaptionTextFont} % \end{macrocode} % \begin{macrocode} } % \end{macrocode} % % \subsubsection{The frenchb Babel option} % \changes{v3.1}{2006/05/14}{\package{frenchb} package support added (kernel)} % % \begin{macrocode} \@ifundefined{FB@makecaption}{}{% % \end{macrocode} % \begin{macrocode} \caption@CheckCommand\@makecaption{% % frenchb.ldf [2005/02/06 v1.6g French support from the babel system] \long\def\@makecaption#1#2{% \vskip\abovecaptionskip \sbox\@tempboxa{#1\CaptionSeparator #2}% \ifdim \wd\@tempboxa >\hsize #1\CaptionSeparator #2\par \else \global \@minipagefalse \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% \fi \vskip\belowcaptionskip}} % \end{macrocode} % \begin{macrocode} \ifx\@makecaption\STD@makecaption \DeclareCaptionLabelSeparator{default}{\CaptionSeparator} \def\caption@frenchb{% supress frenchb warning \let\STD@makecaption\@makecaption \let\FB@makecaption\@makecaption} \else \ifx\@makecaption\@undefined\else \PackageInfo{caption}{% The definition of \protect\@makecaption\space has been changed,\MessageBreak frenchb will NOT customize it}% \fi \fi % \end{macrocode} % \begin{macrocode} } % \end{macrocode} % % \subsubsection{The frenchle/pro package} % \changes{v3.1}{2006/05/14}{\package{frenchle/pro} package support added (kernel)} % % \begin{macrocode} \@ifundefined{frenchTeXmods}{}{% % \end{macrocode} % \begin{macrocode} \caption@CheckCommand\@makecaption{% % french(le).sty [2006/10/03 The french(le) package /V5,9991/] % french(le).sty [2007/06/28 The french(le) package /V5,9994/] \def\@makecaption#1#2{% \ifFTY% \def\@secondofmany##1##2\void{##2}% \def\@tempa{\@secondofmany#2\void}% \ifx\@tempa\empty% \let\captionseparator\empty% \fi% \@mcORI{#1}{\relax\captionfont{#2}}% \else \@mcORI{#1}{#2}% \fi}} % \end{macrocode} % \begin{macrocode} \caption@CheckCommand\@makecaption{% % french(le).sty [2007/02/11 The french(le) package /V5,9993/] \def\@makecaption#1#2{% \ifFTY% \def\@secondofmany##1##2\void{##2}% \protected@edef\@tempa{\@secondofmany#2\void}% \ifx\@tempa\empty% \let\captionseparator\empty% \fi% \@mcORI{#1}{\relax\captionfont{#2}}% \else \@mcORI{#1}{#2}% \fi}} % \end{macrocode} % \begin{macrocode} \DeclareDefaultCaptionFont{textfont}{\itshape}% \DeclareCaptionLabelSeparator{default}{\captionseparator\space}% % \end{macrocode} % \begin{macrocode} } % \end{macrocode} % % \subsection{Execution of options} % % \begin{macrocode} \captionsetup{style=default,position=default,listof=1,listofformat=default,% twoside=\if@twoside 1\else 0\fi} % \end{macrocode} % \begin{macrocode} \ProcessOptions* % \end{macrocode} % % \changes{v3.1}{2007/04/10}{Check of document class added} % \begin{macrocode} \caption@IfCheckCommand{% \caption@setbool{documentclass}{1}% }{% \caption@setbool{documentclass}{0}% \PackageInfo{caption}{% Unknown document class (or package),\MessageBreak standard defaults will be used}% \caption@Debug{\string\@makecaption\space=\space\meaning\@makecaption\@gobble}% } % \end{macrocode} % % \subsection{Typesetting the caption} % % \begin{macro}{\caption@addcontentsline} % \changes{v3.1}{2007/07/01}{This macro added} % |\caption@addcontentsline|\marg{type}\marg{list entry}\par % Makes an entry in the list-of-whatever, if requested, % i.e.~the argument \meta{list entry} is not empty and % |listof=| was set to |true|. % \begin{macrocode} \newcommand*\caption@addcontentsline[2]{% \caption@iflof% {\def\@tempa{#2}}% {\let\@tempa\@empty}% \ifx\@tempa\@empty \else {\let\\\space \addcontentsline{\csname ext@#1\endcsname}{#1}% {\protect\numberline {\caption@lstfmt{\@nameuse{p@#1}}{\@nameuse{the#1}}}% {\ignorespaces #2}}}% \fi} % \end{macrocode} % \end{macro} % % \begin{macro}{\ifcaption@star} % If the starred form of |\caption| is used, this will be set to |true|. % (It will be reset to |false| at the end of |\caption@@make|.) % \begin{macrocode} \newif\ifcaption@star % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@fnum} % \changes{v3.1}{2007/08/21}{This macro added} % |\caption@fnum|\marg{float type}\par % Typesets the caption label; as replacement for |\fnum@|\meta{float type}. % \begin{macrocode} \newcommand*\caption@fnum[1]{% \caption@lfmt{\@nameuse{#1name}}{\@nameuse{the#1}}{\theContinuedFloat}} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@make} % |\caption@make|\marg{float name}\marg{ref.\ number}\marg{text}\par % Typesets the caption. % \begin{macrocode} \newcommand\caption@make[2]{% \caption@@make{\caption@lfmt{#1}{#2}{\theContinuedFloat}}} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@@make} % \changes{v3.0b}{2004/05/16}{Bugfix 04-05-05: \cs{ifdim}\cs{captionindent=}\cs{z@} added} % \changes{v3.0d}{2005/02/12}{Bugfix 04-10-26: Use \cs{@tempdima} instead of % \cs{captionmargin} resp. \cs{captionwidth}; check for \cs{z@} added} % \changes{v3.0d}{2005/02/12}{Bugfix: \cs{hskip}\cs{captionmargin} to the end % of caption added} % \changes{v3.0d}{2005/02/12}{Bugfix: \cs{strut} moved from here to \cs{caption@@@make}} % \changes{v3.0d}{2005/02/12}{Single-line-check moved up so it can affect margins now} % \changes{v3.0d}{2005/02/09}{Improvement: \cs{caption@ifh} added} % \changes{v3.0d}{2005/02/09}{Bugfix: \cs{leavevmode} added} % \changes{v3.0h}{2005/08/24}{Uses \cs{sbox} instead of \cs{setbox} in single-line-check} % \changes{v3.0i}{2005/12/04}{Uses \cs{caption@slc}} % \changes{v3.0i}{2006/01/11}{Bugfix: \cs{caption@calcmargin} inside % single-line-check replaced by \cs{relax}} % \changes{v3.0i}{2006/01/11}{Bugfix: \cs{caption@startbox} will always be % typeset in horizontal mode} % \changes{v3.0k}{2006/05/13}{Uses \cs{captionbox} instead of \cs{caption@start/endbox}} % \changes{v3.0l}{2007/01/04}{Oops, bugfix 04-05-05 got lost in v3.0j, re-added} % \changes{v3.0p}{2007/04/03}{Usage of \cs{caption@ifoddpage} added} % \changes{v3.1}{2007/07/29}{\cs{caption@calcmargin} moved below single-line-check} % |\caption@@make|\marg{caption label}\marg{caption text} % \begin{macrocode} \newcommand\caption@@make[2]{% \begingroup \caption@beginhook % \end{macrocode} % % Check margin, if |\caption@minmargin| or |\caption@maxmargin| is set % \begin{macrocode} \ifx\caption@maxmargin\@undefined \else \ifdim\captionmargin>\caption@maxmargin\relax \captionmargin\caption@maxmargin\relax \fi \fi \ifx\caption@minmargin\@undefined \else \ifdim\captionmargin<\caption@minmargin\relax \captionmargin\caption@minmargin\relax \fi \fi % \end{macrocode} % % Special single-line treatment (option |singlelinecheck=|) % \begin{macrocode} \caption@ifslc{\caption@ifempty@list\caption@opt@SingleLine{}{% \caption@slc{#1}{#2}\captionwidth\relax}}{}% % \end{macrocode} % % Typeset the left margin (option |margin=|) % \begin{macrocode} \caption@calcmargin \@tempdima\captionmargin \ifdim\captionmargin@=\z@ \else \caption@ifoddpage{}{\advance\@tempdima\captionmargin@}% \fi \caption@ifh{\advance\@tempdima\caption@indent}% \hspace\@tempdima % \end{macrocode} % % We actually use a |\vbox| of width |\captionwidth - \caption@indent| % to typeset the caption. % \Note{\cs{captionindent} is \emph{not} supported if the caption format % was defined with \cs{DeclareCaptionFormat*}.} % \begin{macrocode} \@tempdima\captionwidth \caption@ifh{\advance\@tempdima-\caption@indent}% \captionbox\@tempdima{% % \end{macrocode} % % Typeset the indention (option |indention=|)\\ % {\small Bugfix 04-05-05: % |\hskip-\caption@indent| replaced by |\ifdim\caption@indent=\z@|\ldots} % \begin{macrocode} \caption@ifh{% \ifdim\caption@indent=\z@ \leavevmode \else \hskip-\caption@indent \fi}% % \end{macrocode} % % Typeset the caption itself and close the |\captionbox| % \begin{macrocode} \caption@@@make{#1}{#2}}% % \end{macrocode} % % Typeset the right margin (option |margin=|) % \begin{macrocode} \@tempdima\captionmargin \ifdim\captionmargin@=\z@ \else \caption@ifoddpage{\advance\@tempdima\captionmargin@}{}% \fi \hspace\@tempdima % \end{macrocode} % % \begin{macrocode} \caption@endhook \endgroup % \end{macrocode} % % \begin{macrocode} \global\caption@starfalse} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@calcmargin} % \changes{v3.0h}{2005/10/24}{Internal: \cs{ifcaption@width} replaced by % \cs{ifdim}\cs{captionwidth=}\cs{z@}} % \changes{v3.0i}{2006/01/12}{Improvement: Takes care of list environment now} % \changes{v3.1}{2006/05/13}{Check of \cs{@listdepth} removed (not necessary anymore), % use \cs{linewidth} instead of \cs{hsize}} % |\caption@calcmargin|\par % Calculate |\captionmargin| \& |\captionwidth|, so both contain valid % values. % \begin{macrocode} \newcommand*\caption@calcmargin{% \ifdim\captionwidth=\z@ \captionwidth\linewidth \advance\captionwidth by -2\captionmargin \advance\captionwidth by -\captionmargin@ \else \captionmargin\linewidth \advance\captionmargin by -\captionwidth \divide\captionmargin by 2 \captionmargin@\z@ \fi % \end{macrocode} % \begin{macrocode} \caption@Debug{% \string\hsize=\the\hsize, \string\linewidth=\the\linewidth,\MessageBreak \string\leftmargin=\the\leftmargin, \string\rightmargin=\the\rightmargin,\MessageBreak \string\margin=\the\captionmargin, \string\margin@=\the\captionmargin@, \string\width=\the\captionwidth}% % \end{macrocode} % \begin{macrocode} } % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@slc} % \changes{v3.1}{2007/06/13}{\cs{let}\cs{caption@hj}\cs{relax} added} % \changes{v3.1}{2007/07/29}{\cs{caption@setup}\cs{caption@sls} added after \cs{begingroup}} % \changes{v3.1}{2007/07/29}{\cs{caption@calcmargin} added} % |\caption@slc|\marg{label}\marg{text}\marg{width}\marg{extra code}\par % This one does the single-line-check. % \begin{macrocode} \newcommand\caption@slc[4]{% \caption@Debug{Begin SLC}% \begingroup \expandafter\caption@setup\expandafter{\caption@opt@SingleLine}% \let\caption@hj\@empty \caption@calcmargin % calculate #3 if necessary \caption@prepareslc \sbox\@tempboxa{\caption@@@make{#1}{#2}}% \ifdim\wd\@tempboxa>#3% \endgroup \else \endgroup \expandafter\caption@setup\expandafter{\caption@opt@SingleLine}% #4% \fi \caption@Debug{End SLC}} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@prepareslc} % \changes{v3.0b}{2004/05/16}{Bugfix: Redefinition of \cs{label} \& \cs{@footnotetext} added} % \changes{v3.0b}{2004/05/16}{Redefine \cs{stepcounter} instead of \cs{footnote(mark)}} % \changes{v3.0d}{2005/02/12}{\cs{let}\cs{caption@hj}\cs{relax} added} % \changes{v3.0h}{2005/07/09}{Support of \package{endnotes} package added} % \changes{v3.1}{2007/06/13}{\cs{let}\cs{caption@hj}\cs{relax} moved to \cs{caption@slc}} % \changes{v3.1}{2007/06/13}{Redefinition of \cs{(H@)refstepcounter} added} % \changes{v3.1}{2007/08/12}{Redefinition of \cs{label} improved} % |\caption@prepareslc|\par % Re-define anything which would disturb the single-line-check. % \begin{macrocode} \newcommand*\caption@prepareslc{% \let\@footnotetext\@gobble\let\@endnotetext\@gobble \def\label{\caption@withoptargs\@gobbletwo}% \def\stepcounter##1{\advance\csname c@##1\endcsname\@ne\relax}% \let\refstepcounter\stepcounter\let\H@refstepcounter\stepcounter} % \end{macrocode} % \end{macro} % % \begin{macro}{\captionbox} % \changes{v3.0k}{2006/05/13}{We define \cs{captionbox} instead of % \cs{caption@start/endbox}} % \changes{v3.0n}{2006/03/09}{Bugfix 07-03-09: \cs{captionbox} changed from % \cs{parbox-t} to \cs{parbox-b}} % |\captionbox|\marg{width}\marg{contents}\par % This macro defines the box which surrounds the caption paragraph. % \begin{macrocode} \newcommand*\captionbox{\parbox[b]} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@@@make} % \changes{v3.0b}{2004/05/16}{Bugfix 04-05-06: \cs{allowhyphens} added} % \changes{v3.0d}{2005/02/12}{Bugfix 04-12-16: Use some kind of % \cs{@startstrut}\cs{strutbox} instead of \cs{strut}} % \changes{v3.0d}{2005/02/12}{Bugfix 05-01-23: \cs{@finalstrut}\cs{strutbox} added} % \changes{v3.0e}{2005/05/05}{Use \cs{caption@ifempty}; % \cs{let}\cs{caption@ifstrut}\cs{@secondoftwo} added} % \changes{v3.0e}{2005/05/05}{Bugfix: Handling of \cs{ifcaption@star} changed} % \changes{v3.0h}{2005/08/24}{Check for empty label added} % \changes{v3.0h}{2005/08/25}{\cs{caption@iflf} added} % \changes{v3.0l}{2007/02/18}{Usage of \cs{caption@tfmt} added} % \changes{v3.1}{2007/05/07}{Bugfix: \cs{ifhmode} added to \cs{@finalstrut}} % |\caption@@@make|\marg{caption label}\marg{caption text}\par % This one finally typesets the caption paragraph, without margin and indention. % \begin{macrocode} \newcommand\caption@@@make[2]{% % \end{macrocode} % % If the label is empty, we use no caption label separator. % \begin{macrocode} \sbox\@tempboxa{#1}% \ifdim\wd\@tempboxa=\z@ \let\caption@lsep\relax % \@capbreakfalse \fi % \end{macrocode} % % If the text is empty, we use no caption label separator, too. % \begin{macrocode} \caption@ifempty{#2}{% \let\caption@lsep\relax % \@capbreakfalse % \let\caption@ifstrut\@secondoftwo }% % \end{macrocode} % % Take care that |\caption@parindent| and |\caption@hangindent| will be used % to typeset the paragraph. % \begin{macrocode} \@setpar{\@@par\caption@@par}\caption@@par % \end{macrocode} % % Finally typeset the caption. % \begin{macrocode} \caption@hj\captionsize\captionfont\caption@fmt {\ifcaption@star\else{\captionlabelfont#1}\fi}% {\ifcaption@star\else{\caption@iflf\captionlabelfont\caption@lsep}\fi}% {{\captiontextfont \caption@ifstrut{\vrule\@height\ht\strutbox\@width\z@}{}% \nobreak\hskip\z@skip % enable hyphenation \caption@tfmt{#2}% % \caption@ifstrut{\vrule\@height\z@\@depth\dp\strutbox\@width\z@}{}% \caption@ifstrut{\ifhmode\@finalstrut\strutbox\fi}{}% \par}}} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@ifempty} % \changes{v3.0e}{2005/05/05}{This macro added} % \changes{v3.1}{2007/07/04}{Re-defines itself now} % |\caption@ifempty|\marg{text}\marg{true} (\emph{no} \meta{false})\par % This one tests if the \meta{text} is actually empty. % \Note{This will be done without expanding the text, % therefore this is far away from being bullet-proof.} % \Note{This macro is re-defining itself so only % the first test (in a group) will actually be done.} % \begin{macrocode} \newcommand\caption@ifempty[1]{% \def\caption@tempa{#1}% \def\caption@tempb{\ignorespaces}% \ifx\caption@tempa\caption@tempb \let\caption@tempa\@empty \fi \ifx\caption@tempa\@empty \let\caption@ifempty\@secondoftwo \else \let\caption@ifempty\@gobbletwo \fi \caption@ifempty\@unused} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@@par} % \changes{v3.0h}{2005/08/22}{Made this definition global} % |\caption@@par|\par % This command will be executed with every |\par| inside the caption. % \begin{macrocode} \newcommand*\caption@@par{% \parindent\caption@parindent\hangindent\caption@hangindent}% % \end{macrocode} % \end{macro} % % \iffalse\subsection{\cs{DeclareFloatingEnvironment}}\fi % \subsection{Bonus features} % % \begin{macro}{\DeclareFloatingEnvironment} % \changes{v3.1}{2007/08/12}{This macro added} % \changes{v3.1a}{2007/09/07}{Three optional arguments added} % |\DeclareFloatingEnvironment|\oarg{file ext}\marg{environment}\oarg{name}\oarg{list name} % \begin{macrocode} \providecommand*\DeclareFloatingEnvironment{% \@ifnextchar[%] \caption@@DeclareFloatingEnvironment\caption@DeclareFloatingEnvironment} \@onlypreamble\DeclareFloatingEnvironment % \end{macrocode} % \begin{macrocode} \newcommand*\caption@DeclareFloatingEnvironment[1]{% \caption@@DeclareFloatingEnvironment[lo#1]{#1}} \@onlypreamble\caption@DeclareFloatingEnvironment % \end{macrocode} % \begin{macrocode} \def\caption@@DeclareFloatingEnvironment[#1]#2{% \@ifundefined{c@chapter}% {\newcounter{#2}% \@namedef{the#2}{\arabic{#2}}% \@namedef{theH#2}{\arabic{#2}}}% {\newcounter{#2}[chapter]% \@namedef{the#2}{\ifnum\c@chapter>\z@ \thechapter.\fi \arabic{#2}}% \@namedef{theH#2}{\theHchapter.\arabic{#2}}}% \@namedef{fps@#2}{tbp}% \@ifundefined{c@float@type}% {\newcounter{float@type}% \setcounter{float@type}{\@ifundefined{c@figure}14}}% {}% \caption@Debug{float type `#2'=\the\value{float@type}}% \expandafter\xdef\csname ftype@#2\endcsname{\the\value{float@type}}% \addtocounter{float@type}{\value{float@type}}% \@namedef{ext@#2}{#1}% \@namedef{fnum@#2}{\@nameuse{#2name}\nobreakspace\@nameuse{the#2}}% \newenvironment{#2}{\@float{#2}}{\end@float}% \newenvironment{#2*}{\@dblfloat{#2}}{\end@dblfloat}% \expandafter\newcommand\csname listof#2s\endcsname{\begingroup \expandafter\let\expandafter\listfigurename\csname list#2name\endcsname \expandafter\let\expandafter\ext@figure\csname ext@#2\endcsname \let\caption@ORI@starttoc\@starttoc \renewcommand*\@starttoc[1]{% \expandafter\caption@ORI@starttoc\expandafter{\ext@figure}}% \listoffigures \endgroup}% \@ifundefined{l@figure}% {\@namedef{l@#2}{\@dottedtocline{1}{1.5em}{2.3em}}}% {\expandafter\let\csname l@#2\endcsname\l@figure}% \expandafter\newcommand\csname #2name\endcsname{}% \edef\@tempa{% \def\noexpand\@tempa{\expandafter\noexpand\@car#2\@nil}}% \uppercase\expandafter{\@tempa}% \edef\@tempb{% \noexpand\g@addto@macro\noexpand\@tempa{\expandafter\@cdr#2\@nil}}% \@tempb \expandafter\let\csname #2name\endcsname\@tempa \expandafter\newcommand\csname list#2name\endcsname{}% \expandafter\xdef\csname list#2name\endcsname{List of \@tempa s}% \@cons\caption@floatlist{{#2}}% \@ifnextchar[{\caption@@@DeclareFloatingEnvironment{#2}}\relax} \@onlypreamble\caption@@DeclareFloatingEnvironment % \end{macrocode} % \begin{macrocode} \def\caption@@@DeclareFloatingEnvironment#1[#2]{% \@namedef{#1name}{#2}% \@ifnextchar[{\caption@@@@DeclareFloatingEnvironment{#1}}\relax} \@onlypreamble\caption@@@DeclareFloatingEnvironment % \end{macrocode} % \begin{macrocode} \def\caption@@@@DeclareFloatingEnvironment#1[#2]{% \@namedef{list#1name}{#2}} \@onlypreamble\caption@@@@DeclareFloatingEnvironment % \end{macrocode} % \begin{macrocode} \newcommand*\caption@floatlist{} % \end{macrocode} % \end{macro} % % \begin{macro}{\ForFloatingEnvironments} % \changes{v3.1a}{2007/09/07}{This macro added} % |\ForFloatingEnvironments|\marg{code with \#1} % \begin{macrocode} \providecommand\ForFloatingEnvironments[1]{% \caption@AtBeginDocument{% \def\@elt##1{#1}% \caption@floatlist \let\@elt\relax}}% \@onlypreamble\ForFloatingEnvironments % \end{macrocode} % \end{macro} % % \subsection{subfig package adaptions} % \changes{v3.0k}{2007/01/07}{Very small bugfix of \package{subfig} package added} % \changes{v3.0l}{2007/01/31}{Bugfix of subfig package moved from package (kernel)} % \changes{v3.1}{2007/07/07}{Several adaptions to the \package{subfig} package added} % % Unfortunately the author of the \package{subfig} package does not seem to % maintain his package anymore, so we have to make several adaptions here. % \begin{macrocode} \caption@AtBeginDocument{% \def\@tempa{\@ifstar\sf@@subref\sf@subref}% \ifx\subref\@tempa \PackageInfo{caption3}{subfig package 1.2 or 1.3 is loaded\@gobble}% % \end{macrocode} % % \begin{macrocode} \let\caption@setfloattype\@gobble % \end{macrocode} % \begin{macrocode} % \let\sf@ifinlist\caption@ifinlist \let\sf@ifpositiontop\caption@iftop % \end{macrocode} % \begin{macrocode} \def\@dottedxxxline#1#2#3#4#5#6#7{% \begingroup \caption@setfloattype{#1}% \caption@setoptions{subfloat}% \caption@setoptions{sub#1}% \ifnum #3>\@nameuse{c@#2depth}\else \@dottedtocline{\z@}{#4}{#5}{#6}{#7}% \fi \endgroup}% % \end{macrocode} % \begin{macrocode} \let\sf@subfloat\sf@NEW@subfloat % \end{macrocode} % This is a very small bugfix for \version{1.2} and \version{1.3} or the % \package{subfig} package, making \cs{subref} robust, so it works in % captions, too. % \begin{macrocode} \DeclareRobustCommand*\subref{\@ifstar\sf@@subref\sf@subref}% % \end{macrocode} % \begin{macrocode} \caption@removefromoptlist{subfloat}% \caption@removefromoptlist{subfigure}% \caption@removefromoptlist{subtable}% % \end{macrocode} % \begin{macrocode} \fi \let\sf@NEW@subfloat\@undefined} % \end{macrocode} % \begin{macrocode} \def\sf@NEW@subfloat{% \begingroup \caption@setfloattype\@captype \sf@ifpositiontop{% \maincaptiontoptrue }{% \maincaptiontopfalse }% \caption@setoptions{subfloat}% \caption@setoptions{sub\@captype}% \let\sf@oldlabel=\label \let\label=\subfloat@label \ifmaincaptiontop\else \advance\@nameuse{c@\@captype}\@ne \fi \refstepcounter{sub\@captype}% \setcounter{sub\@captype @save}{\value{sub\@captype}}% \@ifnextchar [% %] match left bracket {\sf@@subfloat}% {\sf@@subfloat[\@empty]}}% % \end{macrocode} % % \iffalse % % \fi % % \iffalse % --------------------------------------------------------------------------- % % \fi % % \clearpage % \section{Main package} % \iffalse %<*package> % \fi % % \subsection{Identification} % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/12/01] \ProvidesPackage{caption}[2007/09/22 v3.1b Customising captions (AR)] % \end{macrocode} % % \begin{macro}{\caption@Info} % \Note{The \cs{@gobble} at the end of the 2nd argument of % \cs{PackageInfo} suppresses the line number info. % See TLC2\cite{TLC2}, A.4.7, p885 for details.} % \begin{macrocode} \newcommand*\caption@Info[1]{\PackageInfo{caption}{#1\@gobble}} \@onlypreamble\caption@Info % \end{macrocode} % \end{macro} % % \subsection{Loading the kernel} % % \begin{macrocode} \RequirePackage{caption3}[2007/09/16] % needs v3.1a or newer % \end{macrocode} % % \subsection{Check against incompatible packages} % % \changes{v3.0p}{2007/04/06}{Check against obsolete \package{caption2} package added} % \begin{macrocode} \@ifpackageloaded{caption2}{% \caption@Error{% You can't use both, the (obsolete) caption2 *and*\MessageBreak the (current) caption package}% \endinput }{} % \end{macrocode} % % \changes{v3.1}{2007/06/15}{Check against incompatible \package{ftcap} package added} % \changes{v3.1}{2007/06/15}{Check against incompatible \package{nonfloat} package added} % \changes{v3.1}{2007/06/18}{Check against incompatible \package{topcapt} package added} % \begin{macrocode} \caption@AtBeginDocument{% \@ifpackageloaded{ftcap}{% \caption@IncompatiblePackage{ftcap}{}% }{}% \@ifpackageloaded{nonfloat}{% \caption@IncompatiblePackage{nonfloat}{. % Furthermore you could use \string\captionof\MessageBreak instead of \noexpand\figcaption or \string\tabcaption}% }{}% \@ifpackageloaded{topcapt}{% \caption@IncompatiblePackage{topcapt}{}% }{}% } % \end{macrocode} % % \begin{macro}{\caption@Incompatible} % Issue an `incompatible' warning. % \begin{macrocode} \newcommand*\caption@IncompatiblePackage[2]{% \PackageWarningNoLine{caption}{% Usage of the #1 package together with the\MessageBreak caption package is strongly *not* recommended.\MessageBreak Instead of loading the #1 package you should\MessageBreak use the caption package option\MessageBreak \space\space`tableposition=top'\MessageBreak #2}} % \end{macrocode} % \begin{macrocode} \@onlypreamble\caption@IncompatiblePackage % \end{macrocode} % \end{macro} % % \subsection{Check document class} % % \begin{macrocode} \caption@ifbool{documentclass}{}{% \PackageWarningNoLine{caption}{% Unsupported document class (or package) detected,\MessageBreak usage of the caption package is *not* recommended}% \caption@Info{\string\@makecaption\space=\space\meaning\@makecaption}% } % \end{macrocode} % % \subsection{Adaption to the \AmS{} \& \SmF{} document classes} % \changes{v3.1}{2007/07/29}{\AmS\ \& \SmF\ document classes support added (package)} % % \begin{macrocode} \@ifundefined{@captionheadfont}{}{% \caption@Info{AMS or SMF document class}% % \end{macrocode} % \begin{macrocode} \setlength\belowcaptionskip{0pt}% set to 3pc by AMS class % \end{macrocode} % \begin{macrocode} } % \end{macrocode} % % \subsection{Emulation of the \KOMAScript{} commands} % \changes{v3.0a}{2004/01/18}{Minimum adaptation to \KOMAScript\ added (package)} % \changes{v3.0h}{2005/08/22}{\KOMAScript\ compatibility options added (package)} % \changes{v3.0i}{2005/11/17}{\KOMAScript\ compatibility commands added (package)} % \changes{v3.0l}{2007/02/18}{\KOMAScript\ compatibility revised (package)} % \changes{v3.1}{2007/03/17}{\KOMAScript\ compatibility options removed (package)} % \changes{v3.1}{2007/04/05}{\KOMAScript\ compatibility revised \& enhanced (package)} % % \begin{macrocode} \@ifundefined{scr@caption}{}{% \caption@Info{KOMA-Script document class}% % \end{macrocode} % % Here we emulate the caption related commands and take over the caption % related settings from the \KOMAScript\ classes. % % \begin{macro}{\@tablecaptionabovetrue} % \begin{macro}{\@tablecaptionabovefalse} % \begin{macrocode} \def\@tablecaptionabovetrue{\captionsetup*[table]{position=t}} \def\@tablecaptionabovefalse{\captionsetup*[table]{position=b}} % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macrocode} \if@tablecaptionabove \caption@AtBeginDocument{% \def\caption@tempa#1{% \@ifpackageloaded{#1}{\caption@Error{% You can't use the global option\MessageBreak \space\space`tablecaptionabove'\MessageBreak and use the #1 package, too}}{}}% \caption@tempa{ftcap}% \caption@tempa{nonfloat}% \caption@tempa{topcapt}}% \@tablecaptionabovetrue \else \@tablecaptionabovefalse \fi % \end{macrocode} % % \begin{macro}{\onelinecaptionstrue} % \begin{macro}{\onelinecaptionsfalse} % \changes{v3.1a}{2007/09/14}{Changed so they work with \cs{global}, too} % \begin{macrocode} \def\onelinecaptionstrue{\let\caption@ifslc\@firstoftwo} \def\onelinecaptionsfalse{\let\caption@ifslc\@secondoftwo} % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macrocode} \ifonelinecaptions \onelinecaptionstrue \else \onelinecaptionsfalse \fi % \end{macrocode} % % \begin{macro}{\@captionabovetrue} % \begin{macro}{\@captionabovefalse} % \changes{v3.0j}{2006/03/21}{Bugfix 06-03-21: % \cs{let}\cs{caption@setposition}\cs{@gobble} added} % \changes{v3.0n}{2006/03/09}{Accidentally this got broken in \version{3.0m}, fixed} % \changes{v3.1}{2007/03/31}{We redefine \cs{captionabovetrue/false} now % instead of \cs{captionabove/below}} % \changes{v3.1a}{2007/09/14}{Changed so they work with \cs{global}, too} % \begin{macrocode} \def\@captionabovetrue{\let\caption@position\@firstoftwo} \def\@captionabovefalse{\let\caption@position\@secondoftwo} % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\setcapindent} % \begin{macrocode} \let\caption@KOMA@setcapindent\@setcapindent \renewcommand*\@setcapindent[1]{% \caption@KOMA@setcapindent{#1}\caption@setcapindent} % \end{macrocode} % \begin{macrocode} \let\caption@KOMA@@setcapindent\@@setcapindent \renewcommand*\@@setcapindent[1]{% \caption@KOMA@@setcapindent{#1}\caption@setcapindent} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@setcapindent{% \captionsetup{indent=\ifdim\cap@indent<\z@\z@\else\cap@indent\fi}} % \end{macrocode} % \end{macro} % % \begin{macrocode} \@ifundefined{cap@indent}{}{\caption@setcapindent} % \end{macrocode} % % \begin{macro}{\setcapwidth} % \Note{The optional argument of \cs{setcapwidth} if not supported (yet), % so we issue a warning if used. % (Since this does not seem to have an negative effect when used % by the \texttt{captionbeside} environment, we suppress the warning here.)} % \begin{macrocode} \expandafter\let\expandafter\caption@KOMA@setcapwidth \csname\string\setcapwidth\endcsname \@namedef{\string\setcapwidth}[#1]#2{% \caption@KOMA@setcapwidth[#1]{#2}\caption@setcapwidth{#1}} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@setcapwidth[1]{% \ifx\\#1\\\else \@ifundefined{cap@margin}{}{% \def\@tempa{captionbeside}% \ifx\@tempa\@currenvir\else\PackageWarning{caption}{% Ignoring optional argument [#1] of \string\setcapwidth\MessageBreak}% \fi}% \fi \captionsetup{width=\cap@width}} % \end{macrocode} % \end{macro} % % \begin{macrocode} \def\caption@tempa{\hsize}% \ifx\caption@tempa\cap@width \else \caption@setcapwidth{?} \fi % \end{macrocode} % % \begin{macro}{\setcapmargin} % \begin{macrocode} \expandafter\let\expandafter\caption@KOMA@setcapmargin \csname\string\@setcapmargin\endcsname \@namedef{\string\@setcapmargin}[#1]#2{% \caption@KOMA@setcapmargin[#1]{#2}\caption@setcapmargin} % \end{macrocode} % \begin{macrocode} \expandafter\let\expandafter\caption@KOMA@@setcapmargin \csname\string\@@setcapmargin\endcsname \@namedef{\string\@@setcapmargin}[#1]#2{% \caption@KOMA@@setcapmargin[#1]{#2}\caption@setcapmargin} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@setcapmargin{% \begingroup \let\onelinecaptionsfalse\relax \def\@twoside{0}% \def\if@twoside{\def\@twoside{1}\iffalse}% \cap@margin \def\@tempa{\endgroup}% \ifx\cap@left\hfill\else\ifx\cap@right\hfill\else \def\hspace##1##{\@firstofone}% \edef\@tempa{\endgroup \noexpand\captionsetup{% twoside=\@twoside,singlelinecheck=0,% margin={\cap@left,\cap@right}}}% \fi\fi \@tempa} % \end{macrocode} % \end{macro} % % \begin{macrocode} \ifx\cap@margin\relax \else \caption@setcapmargin \fi % \end{macrocode} % % \begin{macrocode} } % \end{macrocode} % % \subsection{Option for configuration files} % % \begin{macrocode} \DeclareCaptionOption*{config}[caption]{% \InputIfFileExists{#1.cfg}% {\typeout{*** Local configuration file #1.cfg used ***}}% {\PackageWarning{caption}{Configuration file #1.cfg not found}}} % \end{macrocode} % % \subsection{Options for figure and table} % % \changes{v3.0a}{2004/01/09}{Options \opt{figureposition} and \opt{tableposition} added} % \begin{macrocode} \DeclareCaptionOption{figureposition}{% \captionsetup*[figure]{position=#1}} \@onlypreamble@key{caption}{figureposition} % \end{macrocode} % \begin{macrocode} \DeclareCaptionOption{tableposition}{% \caption@AtBeginDocument{% \def\caption@tempa##1{% \@ifpackageloaded{##1}{\caption@Error{% You can't use the caption package option\MessageBreak \space\space`tableposition=#1'\MessageBreak and use the ##1 package, too}}{}}% \caption@tempa{ftcap}% \caption@tempa{nonfloat}% \caption@tempa{topcapt}}% \captionsetup*[table]{position=#1}} \@onlypreamble@key{caption}{tableposition} % \end{macrocode} % % \changes{v3.0d}{2004/08/03}{Options \opt{figurename} and \opt{tablename} added} % \changes{v3.1}{2007/07/04}{Options \opt{figurename} and \opt{tablename} re-written} % \begin{macrocode} \DeclareCaptionOption{figurename}{\caption@SetFloatName{figure}{#1}} \@onlypreamble@key{caption}{figurename} \DeclareCaptionOption{tablename}{\caption@SetFloatName{table}{#1}} \@onlypreamble@key{caption}{tablename} % \end{macrocode} % % \begin{macro}{\caption@SetFloatName} % \changes{v3.1}{2007/07/04}{This macro added} % |\caption@SetFloatName|\marg{cmd}\marg{value} % \begin{macrocode} \newcommand*\caption@SetFloatName[2]{% \begingroup \def\@tempa{\endgroup\@firstofone}% \@ifundefined{languagename}{}{% \@ifundefined{captions\languagename}{}{% \def\@tempa{\endgroup \expandafter\addto\csname captions\languagename\endcsname}}}% \@tempa{\@namedef{#1name}{#2}}} \@onlypreamble\caption@SetFloatName % \end{macrocode} % \end{macro} % % \subsection{caption v1.x compatibility options} % % \changes{v3.1}{2005/07/21}{Option `compatibility' added} % \begin{macrocode} \DeclareCaptionOption{compatibility}[1]{\caption@setbool{compatibility}{#1}} \@onlypreamble@key{caption}{compatibility} % \end{macrocode} % % \changes{v3.1}{2007/09/01}{caption v1.x compatibility options revised} % \begin{macrocode} \DeclareCaptionOption*{normal}[]{% \caption@setformat{normal}% \caption@setjustification{justified}} \DeclareCaptionOption*{isu}[]{% \caption@setformat{hang}% \caption@setjustification{justified}} \DeclareCaptionOption*{hang}[]{% \caption@setformat{hang}% \caption@setjustification{justified}} \DeclareCaptionOption*{center}[]{% \caption@setformat{normal}% \caption@setjustification{centering}} \DeclareCaptionOption*{anne}[]{% \caption@setformat{normal}% \caption@setjustification{centerlast}} \DeclareCaptionOption*{centerlast}[]{% \caption@setformat{normal}% \caption@setjustification{centerlast}} % \end{macrocode} % % \begin{macrocode} \DeclareCaptionOption*{scriptsize}[]{\def\captionfont{\scriptsize}} \DeclareCaptionOption*{footnotesize}[]{\def\captionfont{\footnotesize}} \DeclareCaptionOption*{small}[]{\def\captionfont{\small}} \DeclareCaptionOption*{normalsize}[]{\def\captionfont{\normalsize}} \DeclareCaptionOption*{large}[]{\def\captionfont{\large}} \DeclareCaptionOption*{Large}[]{\def\captionfont{\Large}} % \end{macrocode} % % \begin{macrocode} \DeclareCaptionOption*{up}[]{\l@addto@macro\captionlabelfont\upshape} \DeclareCaptionOption*{it}[]{\l@addto@macro\captionlabelfont\itshape} \DeclareCaptionOption*{sl}[]{\l@addto@macro\captionlabelfont\slshape} \DeclareCaptionOption*{sc}[]{\l@addto@macro\captionlabelfont\scshape} \DeclareCaptionOption*{md}[]{\l@addto@macro\captionlabelfont\mdseries} \DeclareCaptionOption*{bf}[]{\l@addto@macro\captionlabelfont\bfseries} \DeclareCaptionOption*{rm}[]{\l@addto@macro\captionlabelfont\rmfamily} \DeclareCaptionOption*{sf}[]{\l@addto@macro\captionlabelfont\sffamily} \DeclareCaptionOption*{tt}[]{\l@addto@macro\captionlabelfont\ttfamily} % \end{macrocode} % % \begin{macrocode} \DeclareCaptionOption*{nooneline}[]{\caption@setbool{slc}{0}} % \end{macrocode} % % \begin{macrocode} \caption@setbool{ruled}{0} \DeclareCaptionOption*{ruled}[]{\caption@setbool{ruled}{1}} % \end{macrocode} % % \subsection{caption2 v2.x compatibility options} % \changes{v3.0h}{2005/07/08}{caption2 \version{2.x} compatibility options added} % % \changes{v3.1}{2007/09/01}{caption2 v2.x compatibility options revised} % \begin{macrocode} \DeclareCaptionOption*{flushleft}[]{% \caption@setformat{normal}% \caption@setjustification{raggedright}} \DeclareCaptionOption*{flushright}[]{% \caption@setformat{normal}% \caption@setjustification{raggedleft}} % \end{macrocode} % \begin{macrocode} \DeclareCaptionOption*{oneline}[]{\caption@setbool{slc}{1}} % \end{macrocode} % \begin{macrocode} \DeclareCaptionOption*{ignoreLTcapwidth}[]{% \PackageWarning{caption}{Obsolete option `ignoreLTcapwidth' ignored}} % \end{macrocode} % % \subsection{Obsolete caption v3.0 options} % \changes{v3.1}{2007/05/07}{Package option \opt{caption} marked as obsolete, % gives error now} % % \begin{macrocode} \DeclareCaptionOption*{caption}{% \caption@setbool{temp}{#1}% \caption@ifbool{temp}{}{% \caption@Error{% The package option `caption=#1' is obsolete.\MessageBreak Please pass this option to the subfig package instead\MessageBreak and do *not* load the caption package anymore}}} % \end{macrocode} % % \subsection{fltpage package support options} % % \changes{v3.1}{2007/09/01}{Options `FPlist' \& `FPref' added} % With these options is controlled where the list-of entry and |\ref| resp. % |\pageref| or |\autoref| will link to. % Defaults are |FPlist=caption| and |FPref=figure| which is inconsistent, % but compatible to the usual behaviour of the \package{fltpage} package. % \begin{macrocode} \DeclareCaptionOption{FPlist}[1]{\caption@setFPoption{list}{#1}} \DeclareCaptionOption{FPref}[1]{\caption@setFPoption{ref}{#1}} \@onlypreamble@key{caption}{FPlist} \@onlypreamble@key{caption}{FPref} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@setFPoption[2]{% \edef\@tempa{\@car#2\@nil}% \caption@setbool{FP#1cap}{\if c\@tempa 1\else 0\fi}} \@onlypreamble\caption@setFPoption % \end{macrocode} % \begin{macrocode} \captionsetup{FPlist=caption,FPref=figure} % \end{macrocode} % % \subsection{hyperref package support options} % % \changes{v3.1}{2007/06/21}{Options `hypcap' \& `hypcapspace' added} % With |hypcap=off| one can turn the \package{hypcap} support off % (default is |on|). % \begin{macrocode} \DeclareCaptionOption{hypcap}[1]{\caption@setbool{hypcap}{#1}} \DeclareCaptionOption{hypcapspace}{\def\caption@hypcapspace{#1}} % \end{macrocode} % \begin{macrocode} \captionsetup{hypcap=1,hypcapspace=.5\baselineskip} % \end{macrocode} % % \subsection{Processing of options} % % \changes{v3.0m}{2007/03/04}{Verbose option added (package)} % \changes{v3.1}{2007/07/02}{Verbose option removed from package} % % \changes{v3.1}{2007/03/17}{We do not process global options anymore} % \begin{macrocode} \caption@ProcessOptions*{caption} % \end{macrocode} % % \subsection{Option `type', \cs{captionof} and \cs{ContinuedFloat}} % % \changes{v3.0d}{2004/08/03}{Option \opt{type=} added} % \changes{v3.1}{2007/06/25}{Option \opt{type*=} added} % \begin{macrocode} \caption@AtBeginDocument{% \DeclareCaptionOption{type}{\caption@settype{#1}} \DeclareCaptionOption{type*}{\caption@settype*{#1}}} % \end{macrocode} % % \emph{Important Note:} % Like |\captionof| the option |type=| should only be used inside a % group, box, or environment and does not check if the argument is a valid % floating environment or not. % % \begin{macro}{\caption@settype} % \changes{v3.1}{2007/05/09}{This macro added} % \changes{v3.1b}{2007/09/22}{Usage of \cs{caption@xlabel} added} % |\caption@settype*|\marg{type}\par % sets |\@captype| and executes the options associated with it % (using |\caption@setoptions|). % Furthermore we check |\currentgrouplevel| (if avail), % redefine |\@currentlabel| so a |\label| before |\caption| will result % in a hint instead of a wrong reference, and % use the macro |\caption@settypehook| (which will be used by our % \package{float} package support).\par % The non-starred version sets a \package{hyperref} anchor additionally % (if |hypcap=true| and the \package{hypcap} package is not loaded). % \begin{macrocode} \newcommand*\caption@settype{% \caption@@settype{}} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@@settype[1]{% \caption@teststar{\caption@@@settype{#1}}\@gobble\@firstofone} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@@@settype[3]{% % #1 = "" or "sub" % #2 = \@gobble in star form, \@firstofone otherwise % #3 = , e.g. "figure" or "table" \caption@Debug{type=#3}% \caption@checkgrouplevel{#1}{\captionsetup{#1type#2\@gobble*=#3}}% % \end{macrocode} % \begin{macrocode} \@ifundefined{@#1captype}{}{% \edef\@tempa{#3}% \expandafter\ifx\csname @#1captype\endcsname\@tempa \else \caption@iftypewarning{% \PackageWarning{caption}{% Caption type was already set to `#3'\MessageBreak}}{}% \fi}% \expandafter\edef\csname @#1captype\endcsname{#3}% \let\caption@iftypewarning\caption@ifdebug % \end{macrocode} % \begin{macrocode} \@nameuse{#1caption@settypehook}% \expandafter\caption@setoptions\csname @#1captype\endcsname % \end{macrocode} % \begin{macrocode} \let\caption@ifrefstepcounter\@secondoftwo #2{% \@gobble or \@firstofone \let\@currentlabel\caption@undefinedlabel % \let\@currentHlabel\@undefined \ifx\caption@ORI@label\@undefined \let\caption@ORI@label\label \def\label{\caption@withoptargs\caption@xlabel}% \fi \caption@start}} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@settypehook} % Hook, will be extended by our \package{float} package support. % \begin{macrocode} \newcommand*\caption@settypehook{} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@iftype} % \changes{v3.1}{2007/04/11}{This macro and its usage added} % Since we often need to check if |\@captype| is defined (means: we % are inside a floating environment) this helper macro was introduced. % \begin{macrocode} \newcommand*\caption@iftype{% \@ifundefined{@captype}{\let\@captype\@undefined\@secondoftwo}\@firstoftwo} % \end{macrocode} % \iffalse % \newcommand*\caption@iftype{% % \begingroup % \@ifundefined{@captype}% % {\aftergroup\@secondoftwo}% % {\aftergroup\@firstoftwo}% % \endgroup} % \fi % \end{macro} % % \begin{macro}{\caption@checkgrouplevel} % \changes{v3.1}{2007/07/15}{This macro and its usage added} % Checks if |\captionsetup{type=|\ldots|}| or |\caption| is done % inside a group or not -- in the latter case an error will be issued. % (needs \eTeX) % \begin{macrocode} \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname currentgrouplevel\endcsname\relax \caption@Debug{TeX engine: TeX} \let\caption@checkgrouplevel\@gobbletwo \else \caption@Debug{TeX engine: e-TeX} \newcommand*\caption@checkgrouplevel[2]{% \@ifundefined{#1caption@grouplevel}{% \@ifundefined{caption@grouplevel}{\let\caption@grouplevel\z@}{}% \ifnum\currentgrouplevel>\caption@grouplevel\relax \expandafter\edef\csname #1caption@grouplevel\endcsname{% \the\currentgrouplevel}% \else \caption@Error{\string#2 outside group or environment}% \fi }{}} \fi % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@undefinedlabel} % \changes{v3.1}{2007/07/03}{This macro and its usage added} % \changes{v3.1b}{2007/09/22}{Contents changed to \texttt{??}} % This label will be used for |\currentlabel| inside (floating) environments % as default. (see above) % \Note{All commands used have to be robust here.} % \begin{macrocode} \newcommand*\caption@undefinedlabel{??} % \end{macrocode} % \end{macro} % \begin{macro}{\caption@xlabel} % \changes{v3.1b}{2007/09/22}{This macro and its usage added} % \begin{macrocode} \newcommand*\caption@xlabel[2]{% \ifx\@currentlabel\caption@undefinedlabel \PackageWarning{caption}{\noexpand\label before \noexpand\caption ignored}% \else \caption@ORI@label#1{#2}% \fi} % \end{macrocode} % \end{macro} % % \begin{macro}{\captionof} % \changes{v3.1}{2007/05/09}{Uses \cs{caption@settype} instead of \cs{def}\cs{@captype}} % |\captionof|\marg{type}\oarg{lst\_entry}\marg{heading}\\ % |\captionof*|\oarg{lst\_entry}\marg{heading} % \begin{macrocode} \def\captionof{\caption@teststar\caption@of{\caption*}\caption} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@of[2]{% \let\caption@setfloatcapt\@firstofone \caption@settype*{#2}#1} % \end{macrocode} % \end{macro} % % \begin{macro}{\captionlistentry} % \changes{v3.1}{2007/07/28}{This macro added} % |\captionlistentry|\oarg{float type}\marg{list entry} % \begin{macrocode} \newcommand*\captionlistentry{% \@testopt\caption@listentry\@captype} % \end{macrocode} % \begin{macrocode} \def\caption@listentry[#1]#2{% \caption@refstepcounter{#1}% \caption@makecurrent{#1}{#2}% \caption@addcontentsline{#1}{#2}} % \end{macrocode} % \end{macro} % % \begin{macro}{\ContinuedFloat} % \changes{v3.0f}{2005/06/11}{% % Call of \cs{caption@ContinuedFloat} added} % \changes{v3.0i}{2005/11/12}{% % Optional argument and call of \cs{caption@@ContinuedFloat} added} % \changes{v3.0g}{2005/06/28}{% % Bugfix: \cs{newcounter} replaced by \cs{newcount}} % \changes{v3.1}{2007/07/07}{% % Optional argument temporarily removed, since it makes trouble} % \changes{v3.1}{2007/07/07}{% % \cs{caption@setoptions} added} % |\ContinuedFloat|\par % This mainly decrements the appropriate counter and increments the % continuation counter instead. % Furthermore we set |\caption@resetContinuedFloat| to |\@gobble| so the % continuation counter will not be reset to zero inside |\caption@refstepcounter|. % \Note{The definition of \cs{ContinuedFloat} itself is compatible % to the one inside the \package{subfig} package.} % \begin{macrocode} \def\ContinuedFloat{% \caption@iftype {\addtocounter\@captype\m@ne \caption@ContinuedFloat\@captype}% {\caption@Error{\noexpand\ContinuedFloat outside float}}} % \end{macrocode} % \begin{macrocode} \def\caption@ContinuedFloat#1{% \edef\@tempa{#1}% \ifx\@tempa\caption@CFtype \else \caption@Error{Continued `#1' after `\caption@CFtype'}% \fi \stepcounter{ContinuedFloat}% \caption@@ContinuedFloat{#1}% \caption@setoptions{ContinuedFloat}% \caption@setoptions{continued#1}% \let\caption@resetContinuedFloat\@gobble} % \end{macrocode} % \begin{macrocode} \newcounter{ContinuedFloat} \newcommand*\caption@CFtype{??} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@@ContinuedFloat} % |\caption@@ContinuedFloat|\marg{type}\par % Usually this do nothing but this changes if the \package{hyperref} package % is loaded. (See \package{hyperref} package support for details.) % \begin{macrocode} \newcommand*\caption@@ContinuedFloat[1]{} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@resetContinuedFloat} % |\caption@resetContinuedFloat|\marg{type}\par % If a continuation counter is defined, we reset it. % (This one will be called inside |\@caption|.) % \begin{macrocode} \newcommand*\caption@resetContinuedFloat[1]{% \@stpelt{ContinuedFloat}\xdef\caption@CFtype{#1}} % \end{macrocode} % \end{macro} % % \subsection{Internal helpers} % % \begin{macro}{\caption@refstepcounter} % \changes{v3.1}{2007/07/28}{This macro added} % Resets the continuation counter, increments the float (i.e. |figure| or % |table|) counter, and sets the |refstepcounter| flag. % \begin{macrocode} \newcommand*\caption@refstepcounter[1]{% \caption@resetContinuedFloat{#1}% \caption@@refstepcounter{#1}% \let\caption@ifrefstepcounter\@firstoftwo} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@@refstepcounter{\refstepcounter} \let\caption@ifrefstepcounter\@secondoftwo % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@dblarg} % \changes{v3.1}{2007/02/05}{This macro added} % A |\relax| was added compared to |\@dblarg| so |\caption{}| will be % expanded to |\caption[\relax]{}| (and not to |\caption[]{}|). % \begin{macrocode} \newcommand\caption@dblarg[1]{\kernel@ifnextchar[{#1}{\caption@xdblarg{#1}}}% \newcommand\caption@xdblarg[2]{#1[{#2\relax}]{#2}}% % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@begin} % \changes{v3.0a}{2004/01/23}{\cs{caption@settype} changed to \cs{caption@setfloattype}} % \changes{v3.0e}{2005/04/12}{Check for default label format added} % \changes{v3.0f}{2005/06/11}{Usage of \cs{caption@resetContinuedFloat} added} % \changes{v3.1}{2007/05/09}{Usage of \cs{caption@setfloattype} \& % \cs{caption@resetContinuedFloat} removed} % Our handling of |\caption| will always be surrounded by % |\caption@begin| (or |\caption@beginex|) and |\caption@end|.\par % |\caption@begin|\marg{type} performs these tasks: % \begin{enumerate} % \item[1.] Start a new group. % \item[2.] Define |\fnum@|\meta{type} if the caption label format is set % to non-default. % \item[3.] Override the |position=| setting, if necessary. % (for example if set to |auto| or used inside a |supertabular|) % \end{enumerate} % \begin{macrocode} \newcommand*\caption@begin[1]{% \begingroup \caption@setfnum{#1}% \caption@fixposition \global\let\caption@fixedposition\caption@position} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@beginex} % \changes{v3.0b}{2004/05/16}{Support of \opt{listof=} added} % \changes{v3.0l}{2007/02/04}{Takes now 3 args instead of 2, check for empty heading added} % \changes{v3.1}{2007/07/01}{Makes lst-entry now instead of redefining \cs{addcontentsline}} % |\caption@beginex|\marg{type}\marg{list entry}\marg{heading}\par % performs the same tasks as |\caption@begin| and additionally: % \begin{enumerate} % \item[5.] Make an entry in the list-of-whatever. % \item[6.] Set |\caption@ifempty| according argument \meta{heading}. % \end{enumerate} % \begin{macrocode} \newcommand\caption@beginex[3]{% \caption@begin{#1}% \caption@addcontentsline{#1}{#2}% \caption@ifempty{#3}{}} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@end} % |\caption@end| closes the group. % \begin{macrocode} \newcommand*\caption@end{% \endgroup \let\caption@position\caption@fixedposition} % \end{macrocode} % \end{macro} % % \changes{v3.0a}{2004/01/23}{% % Internal hooks \cs{caption@@begin} \& \cs{caption@@end} added} % \changes{v3.0h}{2005/10/06}{% % Internal hooks \cs{caption@@begin} \& \cs{caption@@end} removed} % % \begin{macro}{\caption@setfnum} % \changes{v3.1}{2007/03/10}{This macro added} % |\caption@setfnum|\marg{type}\\ % redefines |\fnum@|\meta{type} according the caption label format % set with |labelformat=|. But if |labelformat=default| is set, % |\fnum@|\meta{type} will not be overwritten by us. % \begin{macrocode} \newcommand*\caption@setfnum[1]{% \@ifundefined{fnum@#1}{\iftrue}{\ifx\caption@lfmt\caption@lfmt@default\else}% \@namedef{fnum@#1}{\caption@fnum{#1}}% \fi} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@addcontentsline} % If |\sf@ifpositiontop| is defined, we extend |\caption@addcontentsline| % so it handles sub-captions, too. % \begin{macrocode} \caption@AtBeginDocument*{% \@ifundefined{sf@ifpositiontop}{}{% \let\caption@kernel@addcontentsline\caption@addcontentsline \renewcommand*\caption@addcontentsline[2]{% \sf@ifpositiontop{\@listsubcaptions{#1}}{}% \caption@kernel@addcontentsline{#1}{#2}% \sf@ifpositiontop{}{\@listsubcaptions{#1}}}% }} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@boxrestore} % \changes{v3.1}{2007/03/03}{This macro and its usage added} % \changes{v3.1b}{2007/09/17}{Bugfix: Redefinition of CR added} % The original code (from |latex/base/ltboxes.dtx|): % \begin{verbatim} % \def\@parboxrestore{\@arrayparboxrestore\let\\\@normalcr} % \def\@arrayparboxrestore{% % \let\if@nobreak\iffalse % \let\if@noskipsec\iffalse % \let\par\@@par % \let\-\@dischyph % \let\'\@acci\let\`\@accii\let\=\@acciii % \parindent\z@ \parskip\z@skip % \everypar{}% % \linewidth\hsize % \@totalleftmargin\z@ % \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip % \parfillskip\@flushglue \lineskip\normallineskip % \baselineskip\normalbaselineskip % \sloppy} % \end{verbatim}%^^A % This one will be used by |\@caption| instead of |\@parboxrestore|. % \begin{macrocode} \newcommand*\caption@boxrestore{% \let\if@nobreak\iffalse \let\if@noskipsec\iffalse \let\par\@@par % \let\-\@dischyph % \let\'\@acci\let\`\@accii\let\=\@acciii \parindent\z@ \parskip\z@skip \everypar{}% % \linewidth\hsize % \@totalleftmargin\z@ \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip \parfillskip\@flushglue \lineskip\normallineskip \baselineskip\normalbaselineskip \sloppy \let\\\@normalcr } % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@normalsize} % \changes{v3.1}{2007/05/05}{This macro and its usage added} % This one will be used by |\@caption| instead of |\normalsize|.\par % Its code is equivalent to % \begin{quote} % |\caption@font{normal}%| % \end{quote} % but executes faster (since the starred form of |\caption@font| % does not use |\setkeys| internally). % \begin{macrocode} \newcommand*\caption@normalsize{% \caption@font*{\KV@caption@fnt@normal\@unused}} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@setfloatcapt} % Needed for support of the \package{float} package, where the caption will % not be typeset directly, but catched in a |\vbox| called |\@floatcapt| % instead. % \begin{macrocode} \let\caption@setfloatcapt\@firstofone % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@makecurrent} % \begin{macro}{\caption@makestart} % \begin{macro}{\caption@@anchor} % \begin{macro}{\caption@start} % \begin{macro}{\caption@@start} % \begin{macro}{\caption@freezeHref} % \begin{macro}{\caption@defrostHref} % All these are needed for support of the \package{hyperref} package. % \begin{macrocode} \newcommand*\caption@makecurrent[2]{} \let\caption@makestart\@gobble \let\caption@@anchor\@firstofone \let\caption@start\relax \let\caption@@start\relax \let\caption@freezeHref\relax \let\caption@defrostHref\relax % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % \subsection{\cs{caption}, \cs{@caption}, and \cs{@makecaption}} % % We only redefine |\caption| and |\@caption| if the current definitions % are well known, so documents written in the old (\package{caption} % package \version{1.x}) days (where |\caption| \& |\@caption| were not % redefined by us) will still compile fine. % For example the usage of the \package{captcont} package, which brings % it's own definition of |\caption*|, was quite common these days. % % Some packages (like the \package{hyperref} package for example) redefines % |\caption| and |\@caption|, too. % So we have to use |\AtBeginDocument| here, so we can make sure % our definition is the one which will be valid at last. % \begin{macrocode} \caption@AtBeginDocument{% % \end{macrocode} % \begin{macrocode} \caption@setbool{incompatible}{0}% % \end{macrocode} % % \begin{macrocode} \caption@CheckCommand\caption{% % ltfloat.dtx [2002/10/01 v1.1v LaTeX Kernel (Floats)] \def\caption{% \ifx\@captype\@undefined \@latex@error{\noexpand\caption outside float}\@ehd \expandafter\@gobble \else \refstepcounter\@captype \expandafter\@firstofone \fi {\@dblarg{\@caption\@captype}}% }}% % \end{macrocode} % % \begin{macrocode} \caption@CheckCommand\caption{% % beamerbaselocalstructure.sty,v 1.53 2007/01/28 20:48:21 tantau \def\caption{ \ifx\@captype\@undefined \@latex@error{\noexpand\caption outside figure or table}\@ehd \expandafter\@gobble \else \refstepcounter\@captype \expandafter\@firstofone \fi {\@dblarg{\@caption\@captype}}% }}% % \end{macrocode} % % \begin{macrocode} \caption@CheckCommand\caption{% % float.sty [2001/11/08 v1.3d Float enhancements (AL)] \renewcommand\caption{% \ifx\@captype\@undefined \@latex@error{\noexpand\caption outside float}\@ehd \expandafter\@gobble \else \refstepcounter\@captype \let\@tempf\@caption \expandafter\ifx\csname @float@c@\@captype\endcsname\relax\else \expandafter\expandafter\let \expandafter\@tempf\csname @float@c@\@captype\endcsname \fi \fi \@dblarg{\@tempf\@captype}}}% % \end{macrocode} % % \begin{macrocode} \caption@CheckCommand\caption{% % hyperref.sty [2007/02/27 v6.75t Hypertext links for LaTeX] % hyperref.sty [2007/04/09 v6.76a Hypertext links for LaTeX] % hyperref.sty [2007/06/12 v6.76h Hypertext links for LaTeX] \def\caption{% \ifx\@captype\@undefined \@latex@error{\noexpand\caption outside float}\@ehd \expandafter\@gobble \else \H@refstepcounter\@captype \@ifundefined{fst@\@captype}{% \let\Hy@tempa\@caption }{% \let\Hy@tempa\Hy@float@caption }% \expandafter\@firstofone \fi {\@dblarg{\Hy@tempa\@captype}}% }}% % \end{macrocode} % % \begin{macrocode} \caption@CheckCommand\caption{% % hyperref.sty [2007/08/05 v6.76j Hypertext links for LaTeX] \def\caption{% \ifx\@captype\@undefined \@latex@error{\noexpand\caption outside float}\@ehd \expandafter\@gobble \else \H@refstepcounter\@captype \let\Hy@tempa\@caption \@ifundefined{float@caption}{% }{% \expandafter\ifx\csname @float@c@\@captype\endcsname\float@caption \let\Hy@tempa\Hy@float@caption \fi }% \expandafter\@firstofone \fi {\@dblarg{\Hy@tempa\@captype}}% }}% % \end{macrocode} % % \begin{macrocode} \caption@IfCheckCommand{}{% \caption@Info{% Incompatible package detected (regarding \string\caption).\MessageBreak \string\caption\space=\space\meaning\caption}% \caption@setbool{incompatible}{1}}% % \end{macrocode} % % \begin{macrocode} \caption@CheckCommand\@caption{% % ltfloat.dtx [2002/10/01 v1.1v LaTeX Kernel (Floats)] \long\def\@caption#1[#2]#3{% \par \addcontentsline{\csname ext@#1\endcsname}{#1}% {\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}% \begingroup \@parboxrestore \if@minipage \@setminipage \fi \normalsize \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par \endgroup}}% % \end{macrocode} % % \begin{macrocode} \caption@CheckCommand\@caption{% % beamerbaselocalstructure.sty,v 1.53 2007/01/28 20:48:21 tantau \long\def\@caption#1[#2]#3{% second argument ignored \par\nobreak \begingroup \@parboxrestore \if@minipage \@setminipage \fi \beamer@makecaption{#1}{\ignorespaces #3}\par\nobreak \endgroup}}% % \end{macrocode} % % \begin{macrocode} % \caption@CheckCommand\float@caption{% % % float.sty [2001/11/08 v1.3d Float enhancements (AL)] % \long\def\float@caption#1[#2]#3{% % \addcontentsline{\@nameuse{ext@#1}}{#1}% % {\protect\numberline{\@nameuse{the#1}}{\ignorespaces #2}} % \global\setbox\@floatcapt\vbox\bgroup\@parboxrestore % \normalsize\@fs@capt{\@nameuse{fnum@#1}}{\ignorespaces #3}% % \@ifnextchar[{\float@ccon}{\egroup}}% % \long\def\float@ccon[#1]{#1\par\egroup}}% % \end{macrocode} % % \begin{macrocode} \caption@CheckCommand\@caption{% % hyperref.sty [2007/02/27 v6.75t Hypertext links for LaTeX] \long\def\@caption#1[#2]#3{% \hyper@makecurrent{\@captype}% \def\@currentlabelname{#2}% \par\addcontentsline{\csname ext@#1\endcsname}{#1}{% \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}% }% \begingroup \@parboxrestore \if@minipage \@setminipage \fi \normalsize \@makecaption{\csname fnum@#1\endcsname}{% \ignorespaces \ifHy@nesting \hyper@@anchor{\@currentHref}{#3}% \else \Hy@raisedlink{\hyper@@anchor{\@currentHref}{\relax}}#3% \fi }% \par \endgroup }}% % \end{macrocode} % \begin{macrocode} \caption@CheckCommand\@caption{% % hyperref.sty [2007/04/09 v6.76a Hypertext links for LaTeX] % hyperref.sty [2007/06/12 v6.76h Hypertext links for LaTeX] % hyperref.sty [2007/08/05 v6.76j Hypertext links for LaTeX] \long\def\@caption#1[#2]#3{% \expandafter\ifx\csname if@capstart\expandafter\endcsname \csname iftrue\endcsname \global\let\@currentHref\hc@currentHref \else \hyper@makecurrent{\@captype}% \fi \def\@currentlabelname{#2}% \par\addcontentsline{\csname ext@#1\endcsname}{#1}{% \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}% }% \begingroup \@parboxrestore \if@minipage \@setminipage \fi \normalsize \expandafter\ifx\csname if@capstart\expandafter\endcsname \csname iftrue\endcsname \global\@capstartfalse \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces#3}% \else \@makecaption{\csname fnum@#1\endcsname}{% \ignorespaces \ifHy@nesting \hyper@@anchor{\@currentHref}{#3}% \else \Hy@raisedlink{\hyper@@anchor{\@currentHref}{\relax}}#3% \fi }% \fi \par \endgroup }}% % \end{macrocode} % \begin{macrocode} \caption@CheckCommand\@caption{% % nameref.sty [2006/12/27 v2.28 Cross-referencing by name of section] \long\def\@caption#1[#2]{% \def\@currentlabelname{#2}% \NR@@caption{#1}[{#2}]% }}% % \end{macrocode} % % \begin{macrocode} \caption@CheckCommand\@caption{% % subfigure.sty [2002/07/30 v2.1.4 subfigure package] \long\def\@caption#1[#2]#3{% \@ifundefined{if#1topcap}% {\subfig@oldcaption{#1}[{#2}]{#3}}% {\@nameuse{if#1topcap}% \@listsubcaptions{#1}% \subfig@oldcaption{#1}[{#2}]{#3}% \else \subfig@oldcaption{#1}[{#2}]{#3}% \@listsubcaptions{#1}% \fi}}}% % \end{macrocode} % % \begin{macrocode} \caption@CheckCommand\@caption{% % subfig.sty [2005/06/28 ver: 1.3 subfig package] \def\@caption{\caption@}% % \long\def\caption@#1[#2]#3{% % \@ifundefined{caption@setfloattype}% % \caption@settype % \caption@setfloattype % \@captype % \sf@ifpositiontop{% % \@listsubcaptions{#1}% % \sf@old@caption{#1}[{#2}]{#3}% % }{% % \sf@old@caption{#1}[{#2}]{#3}% % \@listsubcaptions{#1}% % }}% }% % \end{macrocode} % % \begin{macrocode} \caption@IfCheckCommand{}{% \caption@Info{% Incompatible package detected (regarding \string\@caption).\MessageBreak \string\@caption\space=\space\meaning\@caption}% \caption@setbool{incompatible}{1}}% % \end{macrocode} % % The option |compatibility=| will override the compatibility mode. % \begin{macrocode} \@ifundefined{caption@ifcompatibility}% {\let\caption@ifcompatibility\caption@ifincompatible \let\@tempa\@firstofone}% {\let\@tempa\@gobble}% suppress warning % \end{macrocode} % % \begin{macrocode} \caption@ifcompatibility{% % \end{macrocode} % % \begin{macrocode} \@tempa{% \PackageWarningNoLine{caption}{% \noexpand\caption will not be redefined since it's already\MessageBreak redefined by a document class or package which is\MessageBreak unknown to the caption package.\MessageBreak As a result some new features of the caption\MessageBreak package will not work as expected}% }% % \end{macrocode} % % |\ContinuedFloat| is not supported in compatibility mode. % \begin{macrocode} \renewcommand*\caption@ContinuedFloat[1]{% \caption@Error{Not available in compatibility mode}}% % \end{macrocode} % % |\caption@start| is not supported in compatibility mode. % \begin{macrocode} \caption@AtBeginDocument*{% \let\caption@start\relax \@ifundefined{caption@ORI@capstart}{}{% \caption@Debug{% Undo redefinition of \string\capstart\@gobble}% \let\capstart\caption@ORI@capstart \let\caption@ORI@capstart\@undefined}% \@ifundefined{Hy@float@makebox}{}{% \caption@Debug{% Restore hyperref redefinition of \string\float@makebox\@gobble}% \let\float@makebox\Hy@float@makebox \let\Hy@float@makebox\@undefined}% }% % \end{macrocode} % % \begin{macro}{\caption@star} % We define |\caption@star| here, too, so it's defined but does not make any harm. % \begin{macrocode} \newcommand*\caption@star[2]{#1#2}% % \end{macrocode} % \end{macro} % % \begin{macrocode} }{% % \end{macrocode} % % \begin{macrocode} \caption@ifincompatible{% \PackageWarning{caption}{% Forced redefinition of \noexpand\caption since the\MessageBreak unsupported(!) package option `compatibility=false'\MessageBreak was given. Please fasten your seat belts, as we may\MessageBreak experience turbulence!\@gobbletwo}% }{}% % \end{macrocode} % % \begin{macro}{\caption} % \changes{v3.0f}{2005/05/22}{Bugfix: \cs{ContinuedFloat} added} % \changes{v3.0f}{2005/06/13}{Support of \cs{caption*[]} removed} % \changes{v3.0l}{2007/01/19}{Minimal support of \textsf{combine} package added} % \changes{v3.1}{2007/02/04}{Re-written, does not save\&use original definition anymore} % Here comes our definition of |\caption| and |\caption*|. % Beside the support of the starred variant this code was adapted to the % various packages we support. % We are using |\caption@dblarg| instead of |\@dblarg| so |\caption{}| % (with an empty arg.) will produce a list-of entry, but |\caption[]{}| % won't. % \begin{macrocode} \def\caption{% \caption@iftype {\caption@checkgrouplevel\@empty\caption \caption@star {\caption@refstepcounter\@captype}% {\caption@dblarg{\@caption\@captype}}}% {\caption@Error{\noexpand\caption outside float}}}% % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@star} % \changes{v3.1}{2007/06/24}{Renamed from \cs{caption@caption} to \cs{caption@star}} % A helper macro which processes the optional |*| after |\caption|. % \Note{We set \cs{caption@startrue} globally so it works with the % \package{sidecap} package, too.} % \begin{macrocode} \newcommand*\caption@star[2]{% \@ifstar{\global\caption@startrue#2[]}{#1#2}}% % \end{macrocode} % \end{macro} % % \begin{macro}{\@caption} % \changes{v3.1}{2007/02/04}{Re-written, does not save\&use original definition anymore} % As above, our version has been adapted to the packages we support. % Additionally our code is nested by |\caption@beginex| \& % |\caption@end| instead of |\begingroup| \& |\endgroup|. % Furthermore we use |\caption@boxrestore| instead of |\@parboxrestore| % so this code also works correctly inside list-based environments % like |wide| \& |addmargin|. (This, and the fact that we use % |\linewidth| instead of |\hsize| inside |\@makecaption|, solves % \href{http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=latex/2472}%^^A % {\LaTeX\ PR \texttt{latex/2472}}.) % \begin{macrocode} \long\def\@caption#1[#2]#3{% % \end{macrocode} % \begin{macrocode} \ifcaption@star \else \caption@makecurrent{#1}{#2}% \caption@ifhypcap{\caption@@start}{}% \fi % \end{macrocode} % \begin{macrocode} \par \caption@beginex{#1}{#2}{#3}% \caption@setfloatcapt{% \caption@boxrestore \caption@normalsize \ifcaption@star \let\caption@@anchor\@firstofone \fi \@makecaption{\csname fnum@#1\endcsname}% {\ignorespaces\caption@@anchor{#3}}\par}% \caption@end}% % \end{macrocode} % \end{macro} % % \begin{macrocode} }% % \end{macrocode} % % \begin{macro}{\@xfloat} % \changes{v3.1}{2007/05/09}{This re-definition added} % \changes{v3.1b}{2007/09/22}{Will now be redefined in compatibility mode, too} % We redefine |\@xfloat| so inside floating environments our % type-specific options will be used, a \package{hyperref} % anchor will be set etc. % \begin{macrocode} \let\caption@ORI@xfloat\@xfloat \def\@xfloat#1[#2]{% \caption@ORI@xfloat{#1}[#2]% \caption@settype{#1}}% % \end{macrocode} % \end{macro} % % \begin{macrocode} } % \end{macrocode} % % \begin{macro}{\@makecaption} % \changes{v3.1}{2007/03/10}{\cs{nobreak}s added, needed for beamer class} % |\@makecaption|\marg{label}\marg{text}\par % We do basically the same as the original code (from the standard % \LaTeX\ document classes), but take care of the |position=| setting % and use |\caption@@make| from the \package{caption} kernel to finally % typeset the caption. % \begin{macrocode} \long\def\@makecaption#1#2{% \caption@iftop{\vskip\belowcaptionskip}{\vskip\abovecaptionskip}% \caption@@make{#1}{#2}% \caption@iftop{\vskip\abovecaptionskip}{\vskip\belowcaptionskip}} % \end{macrocode} % \end{macro} % % \subsection{Document class \& Babel package support} % % \subsubsection{The \AmS{} \& \SmF{} classes} % \changes{v3.1}{2007/07/29}{\AmS\ \& \SmF\ classes support added (package)} % % \begin{macrocode} \@ifundefined{smf@makecaption}{}{\let\smf@makecaption\@makecaption} % \end{macrocode} % % \subsubsection{The beamer class} % \changes{v3.1}{2007/03/10}{beamer class support added (package)} % % \begin{macrocode} \@ifclassloaded{beamer}{% \caption@Info{beamer document class}% % \end{macrocode} % % Since the beamer class do not offer a `list of figures' we switch % this support in \thispackage\ off. % \begin{macrocode} \captionsetup{listof=false} \undefine@key{caption}{listof} \undefine@key{caption}{listofformat} % \end{macrocode} % % \begin{macrocode} }{} % \end{macrocode} % % \subsubsection{The \KOMAScript{} classes} % % \KOMAScript\ contains the code % |\AtBeginDocument{\let\scr@caption\caption}| % so we need to update |\scr@caption| here, too. % % \begin{macrocode} \@ifundefined{scr@caption}{}{% \caption@AtBeginDocument{\let\scr@caption\caption}} % \end{macrocode} % % \subsubsection{The frenchb Babel option} % \changes{v3.1}{2006/05/14}{Adaptation to \package{frenchb} added (package)} % % Suppress % ``Package |frenchb.ldf| Warning: The definition of |\@makecaption| has been % changed, frenchb will NOT customize it.'' % (but only if we emulate this customization) % \begin{macrocode} \@ifundefined{caption@frenchb}{}{\caption@frenchb} % \end{macrocode} % % \subsubsection{The frenchle/pro package} % \changes{v3.0h}{2005/10/03}{Adaptation to \package{frenchle/pro} added (package)} % % \begin{macrocode} \caption@AtBeginDocument{\@ifundefined{frenchTeXmods}{}{% \caption@Info{frenchle/pro package is loaded}% % \end{macrocode} % % \begin{macrocode} \let\captionfont@ORI\captionfont \let\captionlabelfont@ORI\captionlabelfont \let\@makecaption@ORI\@makecaption % \end{macrocode} % If |\GOfrench| is defined as |\relax| all the re-definitions regarding % captions have already been done, so we can do our patches immediately. % Otherwise we must add our stuff to |\GOfrench|. % \begin{macrocode} \@ifundefined{GOfrench}% {\let\@tempa\@firstofone}% {\def\@tempa{\g@addto@macro\GOfrench}}% \@tempa{% % \end{macrocode} % % \begin{macrocode} \let\captionfont\captionfont@ORI \let\captionfont@ORI\@undefined \let\captionlabelfont\captionlabelfont@ORI \let\captionlabelfont@ORI\@undefined \let\@makecaption\@makecaption@ORI \let\@makecaption@ORI\@undefined % \end{macrocode} % % \begin{macro}{\@cnORI} % We update the definition of |\@cnORI| so it actually reflects % our definition of |\caption|. % \begin{macrocode} \let\@cnORI\caption % \end{macrocode} % \end{macro} % % \begin{macro}{\@tablescaption} % The \package{frenchle/pro} package sets |\caption| to |\@tablescaption| at % |\begin{table}| for special treatment of footnotes. % Therefore we have to patch |\@tablescaption| so |\caption*| will work % inside the |table| environment. % \begin{macrocode} \let\caption@tcORI\@tablescaption \def\@tablescaption{\caption@star\relax\caption@tcORI}% % \end{macrocode} % \end{macro} % % \begin{macro}{\f@ffrench} % \begin{macro}{\f@tfrench} % |\f@ffrench| and |\f@tfrench| reflect |\fnum@figure| and |\fnum@table| % when used in French mode. These contain additional code which typesets % the caption separator |\captionseparator| instead of the usual colon. % Because this breaks with our |\@makecaption| code we have to remove % this additional code here. % \begin{macrocode} \let\@eatDP\@undefined \let\@tempa\@empty \ifx\f@ffrench\fnum@figure \l@addto@macro\@tempa{\let\fnum@figure\f@ffrench}% \fi \ifx\f@tfrench\fnum@table \l@addto@macro\@tempa{\let\fnum@table\f@tfrench}% \fi \def\f@ffrench{\ifx\listoffigures\relax\else\figurename~\thefigure\fi}% \def\f@tfrench{\ifx\listoftables\relax\else\tablename~\thetable\fi}% \@tempa % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macrocode} }% }} % \end{macrocode} % % \subsection{Package support} % \changes{v3.1}{2007/04/11}{Package options `float', `longtable' etc. % are not supported anymore, removed} % % \begin{macro}{\caption@IfPackageLoaded} % \changes{v3.0f}{2005/05/29}{3rd argument \meta{code} added, % so no extra check is needed} % \changes{v3.1}{2007/07/04}{Re-written \& renamed from \cs{caption@ifpackage} % to \cs{caption@IfPackageLoaded}} % |\caption@IfPackageLoaded|\marg{package}\oarg{version}\marg{true}\marg{false}\par % Some kind of combination of |\@ifpackageloaded| and |\@ifpackagelater|. % If the \meta{package} is not loaded yet, the check will be (re-)done % |\AtBeginDocument|, so the \meta{package} could be loaded later on, too. % \begin{macrocode} \newcommand\caption@IfPackageLoaded[1]{% \@testopt{\caption@@IfPackageLoaded{#1}}{}} \@onlypreamble\caption@IfPackageLoaded % \end{macrocode} % \begin{macrocode} \long\def\caption@@IfPackageLoaded#1[#2]#3#4{% \@ifpackageloaded{#1}\@firstofone{% \caption@Debug{#1 package is not loaded (yet)\@gobble}% \caption@AtBeginDocument}{% \caption@@ifpackageloaded{#1}[#2]{#3}{#4}}} \@onlypreamble\caption@@IfPackageLoaded % \end{macrocode} % \begin{macrocode} \newcommand\caption@ifpackageloaded[1]{% \@testopt{\caption@@ifpackageloaded{#1}}{}} \@onlypreamble\caption@ifpackageloaded % \end{macrocode} % \begin{macrocode} \long\def\caption@@ifpackageloaded#1[#2]{% \@ifpackageloaded{#1}{% \caption@Info{#1 package is loaded}% \@ifpackagelater{#1}{#2}\@firstoftwo{% \caption@Error{% For a successful cooperation we need at least version\MessageBreak `#2' of package #1,\MessageBreak but only version\MessageBreak `\csname ver@#1.\@pkgextension\endcsname'\MessageBreak is available}% \@secondoftwo}% }{\@secondoftwo}} \@onlypreamble\caption@@ifpackageloaded % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@clearmargin} % \changes{v3.1}{2007/05/05}{This macro and its usage added} % This macro will be used by some package support stuff where the usual % margin setting is not welcome, e.g. in the \package{sidecap} package. % \begin{macrocode} \newcommand*\caption@clearmargin{% \setcaptionmargin\z@ \let\caption@minmargin\@undefined} % \end{macrocode} % \end{macro} % % \begin{macrocode} \caption@setbool{needfreeze}{0} \caption@AtBeginDocument*{% \caption@ifneedfreeze{% % \end{macrocode} % % \begin{macro}{\caption@freeze} % \changes{v3.1}{2007/07/22}{This macro added} % |\caption@freeze*|\par % Used by the \package{fltpage} \& \package{sidecap} package support. % \begin{macrocode} \newcommand*\caption@freeze{% \caption@teststar\caption@@freeze\@gobble\@firstofone}% % \end{macrocode} % \begin{macrocode} \newcommand*\caption@@freeze[1]{% \global\let\caption@SCcontinued\relax \global\let\caption@SCsetup\@undefined \global\let\caption@SClentry\@undefined \global\let\caption@SCtext\@undefined \global\let\caption@SClabel\@undefined % \end{macrocode} % \begin{macrocode} \let\caption@ORI@ContinuedFloat\ContinuedFloat \def\ContinuedFloat{% \let\caption@ORI@setcounter\setcounter \let\caption@ORI@addtocounter\addtocounter \def\setcounter####1####2{\csname c@####1\endcsname####2\relax}% \def\addtocounter####1####2{\advance\csname c@####1\endcsname ####2\relax}% \caption@ORI@ContinuedFloat \global\let\caption@SCcontinued\caption@ORI@ContinuedFloat \let\setcounter\caption@ORI@setcounter \let\addtocounter\caption@ORI@addtocounter}% \def\captionsetup##1{% \caption@g@addto@list\caption@SCsetup{##1}% \caption@setup{##1}}% \def\caption{% \let\captionsetup\@gobble \caption@star {\let\caption@ORI@refstepcounter\caption@@refstepcounter \def\caption@@refstepcounter########1{% \advance\csname c@########1\endcsname\@ne\relax}% \caption@refstepcounter\@captype \let\caption@@refstepcounter\caption@ORI@refstepcounter}% {\caption@dblarg\@caption@SC}}% \def\@caption@SC[##1]##2{% \gdef\caption@SClentry{##1}\gdef\caption@SCtext{##2}% \ignorespaces}% #1{% is \@gobble in star form, and \@firstofone otherwise \def\label##1{\gdef\caption@SClabel{##1}\ignorespaces}}% % \end{macrocode} % \begin{macrocode} }% % \end{macrocode} % \end{macro} % \begin{macro}{\caption@defrost} % \changes{v3.1}{2007/07/22}{This macro added} % |\caption@defrost| % \begin{macrocode} \newcommand*\caption@defrost{% \ifx\caption@ORI@ContinuedFloat\@undefined \caption@SCcontinued \ifx\caption@SCsetup\@undefined \else \expandafter\captionsetup\expandafter{\caption@SCsetup}% \fi \ifx\caption@SCtext\@undefined \else \expandafter\expandafter\expandafter\caption \expandafter\expandafter\expandafter[% \expandafter\expandafter\expandafter{% \expandafter\caption@SClentry\expandafter}\expandafter]% \expandafter{\caption@SCtext}% \fi \ifx\caption@SClabel\@undefined \else \expandafter\label\expandafter{\caption@SClabel}% \fi \else \caption@Error{Internal Error:\MessageBreak \noexpand\caption@defrost in same group as \string\caption@freeze}% \fi}% % \end{macrocode} % \end{macro} % % \begin{macrocode} }{}% \caption@undefbool{needfreeze}} % \end{macrocode} % % \subsubsection{The float package} % \changes{v3.0f}{2005/05/31}{\package{float} package support rewritten and improved} % \iffalse % (This is a more straight-ahead implementation, but it only works with v1.3 % now, so v1.2 is no longer supported. The old code including documentation % can be found in caption-30f-050530.zip) % \fi % % The \package{float} package usually do not use the \LaTeX\ kernel command % |\@caption| to typeset the caption but |\float@caption| instead. % (|\@caption| will only be used if the float is re-styled with % |\restylefloat*|.) % % The main two things |\float@caption| is doing different are: % \begin{itemize} % \item The caption will be typeset inside a |\savebox| called |\@floatcapt| % so it can be placed above or below the float contents afterwards. % \item |\@makecaption| will not be used to finally typeset the caption. % Instead |\@fs@capt| will be used which definition is part of the float % style. % (Note that |\@fs@capt| will not typeset any vertical space above or below % the caption; instead this space will be typeset by the float style code % itself.) % \end{itemize} % % \begin{macrocode} \caption@IfPackageLoaded{float}[2001/11/08 v1.3d]{% \@ifpackageloaded{floatrow}{% \caption@ifpackageloaded{floatrow}[2007/08/24 v0.2a]{}{}% }{% % \end{macrocode} % % \iffalse % \begin{macro}{\caption@of} % If the float is defined by the float package (which means |\fst@|\meta{type} % is defined) we `execute' this float style, so |\@fs@iftopcapt| is set to its % proper value. % Furthermore we undo the re-definition of |\caption@setfloatcapt| which was % done by |\float@dostyle|. % \begin{macrocode} % \renewcommand*\caption@of[2]{% % \float@ifstyle{#2}{% % \float@dostyle{#2}% % \let\caption@setfloatcapt\@firstofone}{}% % \caption@settype*{#2}#1}% % \end{macrocode} % \end{macro} % \fi % % \begin{macro}{\@float@setevery} % |\@float@setevery|\marg{float type} is provided by the \package{float} % package; it's called every time a floating environment defined with % |\newfloat| or |\restylefloat| begins. % We use this hook to do some adaptations and to setup the proper caption % style (if defined) and additional settings declared with % |\captionsetup|\oarg{float style}. % \begin{macrocode} \let\caption@ORI@float@setevery\@float@setevery \def\@float@setevery#1{% \float@ifcaption{#1}{% % \end{macrocode} % % First of all we set the caption position to it's proper value by % converting |\@fs@iftopcapt| (which is part of a float style and % controls where the caption will be typeset, above or below the float % contents) to our |position=| setting. % Since the spacing above and below the caption will be done by the float % style and \emph{not} by us this sounds quite useless. But in fact it isn't, % since some packages based on \thispackage\ (like the \package{subfig} % package) could have an interest for this information and therefore use the % |\caption@iftop| macro we provide in our kernel. Furthermore we need this % information for ourself in |\captionof| which uses |\@makecaption| to % finally typeset the caption with skips. % \begin{macrocode} \caption@setposition{\@fs@iftopcapt t\else b\fi}% % \end{macrocode} % % Afterward we redefine |\caption@setfloatcapt| (which will be used inside % |\@caption|) so the caption will be set inside the box |\@floatcapt|, % without extra vertical space. % \begin{macrocode} \renewcommand\caption@setfloatcapt{% \let\@makecaption\caption@@make \global\setbox\@floatcapt\vbox}% % \end{macrocode} % % To allow different caption styles for different float styles we also % determine the current float style (e.g. `ruled') and select % a caption style (and additional settings) with the same name, if defined. % \begin{macrocode} \float@getstyle\float@style{#1}% \caption@setstyle*\float@style \caption@setoptions\float@style % \end{macrocode} % % \begin{macrocode} }{}% \caption@freezeHref % will be defrosted in \float@makebox \caption@ORI@float@setevery{#1}}% % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@setfloatcapt} % \changes{v3.1}{2007/06/23}{This check added} % \changes{v3.1b}{2007/09/22}{This check removed, so \cs{captionsetup(type=Example)} works} % Here we do a consistency check: If the caption to handle is a one from % the \package{float} package (|\newfloat| or |\restylefloat|), % |\setfloatcapt| should be redefined, so actually this error should never % occur. % \begin{macrocode} % \renewcommand*\caption@setfloatcapt{% % \float@ifcaption\@captype{% % \caption@Error{Something is going wrong here...\MessageBreak % For a removal of this problem please consult the\MessageBreak % caption package documentation, especially the sections\MessageBreak % about the `float' and the `wrapfig' package}% % \@gobble % }{% % \@firstofone % }}% % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@settypehook} % \changes{v3.1}{2007/07/08}{float package hook added} % \LaTeX\ and almost every other packages use % |\|\meta{type}|name| % to provide a macro for the type resp.~environment name -- for example % the command |\figurename| will usually contain the name of the floating % environment |figure|: % \begin{quote} % |\newcommand\figurename{Figure}| % \end{quote} % But the \package{float} package doesn't follow this common naming % convention: % For floats defined with |\newfloat| it uses |\fname@|\meta{type} instead, % which breaks with our code (and with |\autoref| and some other things as % well). % So we have to map the \package{float} package name to the common one here.\par % \Note{If the float was not defined with \cs{newfloat} but with % \cs{restylefloat} instead, \cs{fname@}\meta{type} is not defined.} % \begin{macrocode} \g@addto@macro\caption@settypehook{% \expandafter\ifx\csname #1name\endcsname\relax \expandafter\let\csname #1name\expandafter\endcsname \csname fname@#1\endcsname \fi}% % \end{macrocode} % \end{macro} % % \changes{v3.0f}{2005/06/26}{Skips of \env{plaintop} and \env{boxed} floats corrected} % \begin{macro}{\fs@plaintop} % \begin{macro}{\fs@boxed} % Since the float styles |plaintop| and |boxed| don't use |\abovecaptionskip| % which could be set with |skip=| (|plaintop| uses |\belowcaptionskip| instead of % |\abovecaptionskip|, and |boxed| uses a fixed space of |2pt|) % we patch the according float style macros here to change this. % \begin{macrocode} \g@addto@macro\fs@plaintop{\def\@fs@mid{\vspace\abovecaptionskip\relax}}% \g@addto@macro\fs@boxed{\def\@fs@mid{\kern\abovecaptionskip\relax}}% % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\float@ifstyle} % \changes{v3.1}{2007/06/10}{This macro added} % |\float@ifstyle|\marg{type}\marg{if-clause}\marg{else-clause}\par % Checks if the given \meta{type} (e.g.~|figure|) is associated with a % float style (e.g.~|boxed|). % \begin{macrocode} \providecommand*\float@ifstyle[1]{% \expandafter\ifx\csname fst@#1\endcsname\relax \expandafter\@secondoftwo \else \expandafter\@firstoftwo \fi}% % \end{macrocode} % \end{macro} % % \begin{macro}{\float@getstyle} % \changes{v3.1}{2007/06/10}{This macro added} % |\float@getstyle|\marg{cmd}\marg{type}\par % Determining the float style is not so easy because the only hint % provided by the \package{float} package is the macro % |\fst@|\meta{float type} which points to the macro which represents the % float style. So for example after % \begin{quote} % |\floatstyle{ruled}|\\ % |\newfloat{Program}{tbp}{lop}| % \end{quote} % |\fst@Program| will be defined as % \begin{quote} % |\def\fst@Program{\fs@ruled}|\quad. % \end{quote}\par % So here is what we do: We make the first level expansion of % |\fst@|\meta{float type} a string so we can gobble the first four tokens % (= |\fs@|), so only the the name of the float style is left.\par % \emph{TODO:} We need to convert the catcodes here. % \begin{macrocode} \providecommand*\float@getstyle[2]{% \edef#1{% \noexpand\expandafter\noexpand\@gobblefour\noexpand\string \expandafter\expandafter\expandafter\noexpand \csname fst@#2\endcsname}% \edef#1{#1}% \caption@Debug{floatstyle{#2} = `#1'}}% % \end{macrocode} % \end{macro} % % \begin{macro}{\float@setstyle} % \changes{v3.1}{2007/06/10}{This macro added} % |\float@setstyle|\marg{type}\marg{style}\par % Sets or changes the float style associated with \meta{type}. % \begin{macrocode} \providecommand*\float@setstyle[2]{% \expandafter\edef\csname fst@#1\endcsname{% \expandafter\noexpand\csname fs@#2\endcsname}}% % \end{macrocode} % \end{macro} % % \begin{macro}{\float@dostyle} % \changes{v3.1}{2007/07/23}{This macro added} % |\float@dostyle|\marg{type} % \begin{macrocode} \providecommand*\float@dostyle[1]{% \@nameuse{fst@#1}\@float@setevery{#1}}% % \end{macrocode} % \end{macro} % % \begin{macro}{\float@ifcaption} % \changes{v3.1}{2007/06/23}{This macro added} % |\float@ifcaption|\marg{type}\marg{if-clause}\marg{else-clause}\par % Here we determine if the user has used |\newfloat| resp.~|\restylefloat|, % or |\restylefloat*|. % This is quite easy: If |\@float@c@|\meta{captype} is the same as % |\float@caption|, the user has used |\newfloat| or |\restylefloat|, % otherwise we assume he has used |\restylefloat*|. % (This test will fail if some package re-defines |\float@caption|, % so we have to assume that there is no one.) % \begin{macrocode} \providecommand*\float@ifcaption[1]{% \expandafter\ifx\csname @float@c@#1\endcsname\float@caption \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi}% % \end{macrocode} % \end{macro} % % \begin{macrocode} }}{% \providecommand*\float@ifstyle[1]{\@secondoftwo}% \providecommand*\float@ifcaption[1]{\@secondoftwo}% % \clearcaptionsetup{boxed}% used by the floatrow package? } % \end{macrocode} % % The skip between `boxed' floats and their caption defaults to |2pt|. % % \begin{macrocode} \captionsetup*[boxed]{skip=2pt} % do not issue a warning when not used % \end{macrocode} % % \changes{v3.0f}{2005/05/26}{\opt{strut=0} added to caption style \opt{ruled}} % \changes{v3.0f}{2005/05/27}{Option \opt{ruled} fixed} % To emulate the `ruled' definition of |\@fs@capt| we provide a caption style % `ruled' with appropriate options. But if the package option |ruled| was % specified, we setup some caption parameters to emulate the behavior % of \thispackage\ \version{1.x} option |ruled| instead, i.e., % the current caption settings will be used, but without margin and without % `single-line-check'. % \begin{macrocode} \caption@ifbool{ruled}{% \captionsetup[ruled]{margin=0pt,minmargin=0,singlelinecheck=0}% }{% \DeclareCaptionStyle{ruled}{labelfont=bf,labelsep=space,strut=0}% } \caption@undefbool{ruled} % \end{macrocode} % % \subsubsection{The floatflt package} % \changes{v3.1}{2007/06/10}{Support of the \package{floatflt} package added} % % \begin{macrocode} \caption@IfPackageLoaded{floatflt}[1996/02/27 v1.3]{% % \end{macrocode} % % \begin{macro}{\floatingfigure} % We patch |\floatingfigure| so |\caption@floatflt| will be used. % \begin{macrocode} \let\caption@ORI@floatingfigure\floatingfigure \def\floatingfigure{% \caption@floatflt{figure}% \caption@ORI@floatingfigure}% % \end{macrocode} % \end{macro} % % \begin{macro}{\floatingtable} % Same with |\floatingtable|\ldots % \begin{macrocode} \let\caption@ORI@floatingtable\floatingtable \def\floatingtable{% \caption@floatflt{table}% % \caption@setautoposition b% \caption@ORI@floatingtable}% % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@floatflt} % Here we do two things: % \begin{enumerate} % \item We use |\caption@setoptions{floating|\meta{type}|}| so % |\captionsetup[floating|\meta{type}|]{|\ldots|}| is supported. % \item |\linewidth| must be set correctly. % Usually this is done by |\@parboxrestore| inside |\@caption|, % but since we use |\@caption@boxrestore| we have to map this to % |\@parboxrestore| instead. % \end{enumerate} % \begin{macrocode} \newcommand*\caption@floatflt[1]{% \caption@settype{#1}% \caption@setoptions{floating#1}% \let\caption@boxrestore\@parboxrestore}% % \end{macrocode} % \end{macro} % % \begin{macrocode} }{} % \end{macrocode} % % \iffalse % \subsubsection{The floatrow package} % \changes{v3.0f}{2005/06/01}{Support of the \package{floatrow} package added} % % \begin{macrocode} %\caption@IfPackageLoaded{floatrow}[2007/07/01 v0.1p]{% % \end{macrocode} % % The \package{floatrow} package is already adapted for usage with % \thispackage. So the main work has already been done by % Mrs.~Lapko, there is only one little thing we have to take care about: % % \begin{macro}{\caption@of} % Captions typeset with |\captionof| should have the correct layout, % therefore we have to `activate' this layout here with |\flrow@setlist|. % \begin{macrocode} % \renewcommand*\caption@of[2]{% % \flrow@setlist{{#2}}% TODO: always do this? % \caption@settype*{#2}#1}% % \end{macrocode} % \end{macro} % % \begin{macrocode} %}{} % \end{macrocode} % \fi % % \subsubsection{The fltpage package} % \changes{v3.1}{2007/07/22}{Support of the \package{fltpage} package added} % % \begin{macrocode} \caption@IfPackageLoaded{fltpage}[1998/10/29 v.0.3]{% \caption@setbool{needfreeze}{1}% % \end{macrocode} % % \begin{macro}{\FP@helpNote} % Original code: % \begin{verbatim} % \newcommand{\FP@helpNote}[2]{% % \typeout{FP#1 is inserted on page \pageref{#2}!}}% % \end{verbatim}%^^A % \begin{macrocode} \renewcommand\FP@helpNote[2]{% \begingroup % save \caption@thepage \caption@pageref{#2}% \typeout{FP#1 is inserted on page \caption@thepage!}% \endgroup}% % \end{macrocode} % \end{macro} % % \begin{macro}{\FP@floatBegin} % Original code: % \begin{verbatim} % \newcommand{\FP@floatBegin}[1]{% % \gdef\@captype{#1}% % \global\let\FP@savedCaptionCommand\caption% % \global\let\FP@savedLabelCommand\label% % \ifthenelse{\equal{\@captype}{figure}} % {\global\let\old@Fnum\fnum@figure}% % {\global\let\old@Fnum\fnum@table}% % \let\FP@LabelText\@empty% % \let\FP@CaptionText\@empty% % \let\FP@optionalCaptionText\@empty% % \renewcommand\label[1]{\gdef\FP@LabelText{##1}}% % \renewcommand\caption[2][]{% % \gdef\FP@optionalCaptionText{##1}\gdef\FP@CaptionText{##2}}% % \begin{lrbox}{\FP@floatCorpusBOX}% % }% % \end{verbatim}%^^A % \begin{macrocode} \renewcommand*\FP@floatBegin[1]{% \def\@captype{#1}% \let\FP@LabelText\@empty \begin{lrbox}{\FP@floatCorpusBOX}% \caption@ifFPrefcap\caption@freeze{% \def\label##1{\gdef\FP@LabelText{##1}\ignorespaces}% \caption@freeze*}}% % \end{macrocode} % \end{macro} % % \begin{macro}{\FP@floatEnd} % Original code: % \begin{verbatim} % \newcommand{\FP@floatEnd}{% % \end{lrbox}% % \global\setbox\FP@floatCorpusBOX=\box\FP@floatCorpusBOX % \stepcounter{FP@\@captype C}% % \FP@savedLabelCommand{\FP@positionLabel}% % \FP@helpNote{\@captype}{\FP@positionLabel}% % \FP@float % {\FP@positionLabel}% location label test % {\begin{\@captype}[p!] % \usebox{\FP@floatCorpusBOX}% % \refstepcounter{\@captype}% % \ifthenelse{\equal{\FP@LabelText}{\@empty}} % {}{\FP@savedLabelCommand{\expandafter\protect\FP@LabelText}}% % \end{\@captype}} % {\addtocounter{\@captype}{-1}} % {\begin{\@captype}[b!]% % \ifthenelse{\equal{\FP@guide}{\@empty}}% % {}{\ifthenelse{\equal{\@captype}{figure}}% % {\renewcommand{\fnum@figure}{\old@Fnum\ {\FP@guide}}}% % {\renewcommand{\fnum@table}{\old@Fnum\ {\FP@guide}}}}% % \setlength{\abovecaptionskip}{2pt plus2pt minus 1pt} % length above caption % \setlength{\belowcaptionskip}{2pt plus2pt minus 1pt} % length above caption % \FP@separatorCaption% % \ifthenelse{\equal{\FP@optionalCaptionText}{\@empty}}% % {\FP@savedCaptionCommand{\expandafter\protect\FP@CaptionText}}% % {\FP@savedCaptionCommand[\expandafter\protect\FP@optionalCaptionText]% % {\expandafter\protect\FP@CaptionText}}% % \end{\@captype}}% % }% % \end{verbatim}%^^A % \begin{macrocode} \renewcommand*\FP@floatEnd{% \end{lrbox}% % \end{macrocode} % \begin{macrocode} \stepcounter{FP@\@captype C}% \caption@label\FP@positionLabel \FP@helpNote\@captype\FP@positionLabel % \end{macrocode} % \begin{macrocode} \let\FP@ContinuedFloat\relax \FP@float {\FP@positionLabel}% location label test {\begin\@captype[p!]% \FP@ContinuedFloat \usebox\FP@floatCorpusBOX \caption@ifFPlistcap {\caption@refstepcounter\@captype \expandafter\caption@makecurrent\expandafter\@captype \expandafter{\caption@SClentry}}% {\expandafter\captionlistentry\expandafter{\caption@SClentry}}% \caption@@anchor\relax \ifx\FP@LabelText\@empty \else \expandafter\label\expandafter{\FP@LabelText}% \fi \end\@captype}% {\let\FP@ContinuedFloat\ContinuedFloat \caption@ifcompatibility {\let\caption@ContinuedFloat\@gobble}% {\caption@clearsetup{ContinuedFloat}% \caption@clearsetup{continued\@captype}}}% {\begin\@captype[b!]% \FP@ContinuedFloat \let\FP@savedSetfnumCommand\caption@setfnum \def\caption@setfnum##1{% \FP@savedSetfnumCommand{##1}% \ifx\FP@guide\@empty \else \expandafter\l@addto@macro\csname fnum@##1\endcsname{\ {\FP@guide}}% \fi}% \setlength\abovecaptionskip{2pt plus 2pt minus 1pt}% length above caption \setlength\belowcaptionskip{2pt plus 2pt minus 1pt}% length below caption \caption@setoptions{FP\@captype}% \FP@separatorCaption \caption@ifFPlistcap{}{\caption@set@bool\caption@iflof0}% \caption@defrost \end\@captype}% }% % \end{macrocode} % \end{macro} % % \changes{v3.1a}{2007/09/07}{\cs{DeclareFloatingEnvironment} defines FP-variant, too} % \begin{macrocode} \ForFloatingEnvironments{% \newenvironment{FP#1}{\FP@floatBegin{#1}}{\FP@floatEnd}}% % \end{macrocode} % % \begin{macrocode} }{% \let\caption@ifFPlistcap\@undefined \let\caption@ifFPrefcap\@undefined } % \end{macrocode} % % \subsubsection{The hyperref package} % \changes{v3.0f}{2005/06/11}{Support of the \package{hyperref} package added} % \changes{v3.1}{2007/03/09}{Usage of \cs{hyper@makecurrent} instead of % \cs{theHfigure} as indicator for \package{hyperref} package} % % \begin{macrocode} \caption@IfPackageLoaded{hyperref}[2003/11/30 v6.74m]{% \@ifundefined{hyper@makecurrent}{% hyperref has stopped early \PackageWarningNoLine{caption}{% Hyperref support is turned off\MessageBreak because hyperref has stopped early}% }{% \g@addto@macro\caption@prepareslc{\measuring@true}% % \end{macrocode} % % \begin{macro}{\caption@@refstepcounter} % We redefine |\caption@@refstepcounter| so |\H@refstepcounter| will be used % instead of |\refstepcounter| inside |\caption| \& |\captionlistentry|. % \begin{macrocode} \renewcommand*\caption@@refstepcounter{\H@refstepcounter}% % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@makecurrent} % We redefine |\caption@makecurrent| so a \package{hyperref} label % will be defined inside |\@caption|. % \begin{macrocode} \renewcommand*\caption@makecurrent[2]{% \caption@makecurrentHref{#1}% \caption@Debug{hyper current=\@currentHref}% \def\@currentlabelname{#2}}% % \end{macrocode} % \begin{macrocode} \newcommand*\caption@makecurrentHref{\hyper@makecurrent}% % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@makestart} % We redefine |\caption@makestart| so a \package{hyperref} label % will be defined inside |\caption@start|.\par % Since we offer |\ContinuedFloat| the float counter can be change between % `now' and |\caption|, i.e., we simply don't know the figure or table counter % yet and therefore we are not able to generate the `right' \package{hyperref} % label. % Two different solutions of this problem came into my mind: % \begin{enumerate} % \item I could use the aux file for this purpose.\par % -or- % \item I set |hypertexnames=false| locally. % Furthermore I use |#1.xxx.|\meta{counter} (instead of |#1.|\meta{counter}) % as naming scheme for |\@currentHref| to avoid conflicts with other hyper % links which are generated with |hypertexnames=true|. % \end{enumerate} % The first idea has the advantage that the `right' anchor name will be % generated, but one needs an additional \LaTeX\ run if figures or tables % will be inserted or removed.\par % The second idea has the advantage that it's very easy to implement, but % has some side-effects, e.g. the anchor names don't follow the figure or % table label names anymore.\par % Since I'm lazy I implemented the second idea, maybe I will revise this % later on. % \begin{macrocode} \renewcommand*\caption@makestart[1]{% \begingroup \Hy@hypertexnamesfalse % \gdef\@currentHlabel{}% \hyper@makecurrent{#1.xxx}% \endgroup \caption@Debug{hyper start=\@currentHref}}% % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@@anchor} % We redefine |\caption@@anchor| so a \package{hyperref} anchor % will be set inside |\@caption|. % \begin{macrocode} \renewcommand\caption@@anchor[1]{% \caption@Debug{hyper anchor: \@currentHref}% % If we cannot have nesting, the anchor is empty. \ifHy@nesting \hyper@@anchor{\@currentHref}{#1}% \else \Hy@raisedlink{\hyper@@anchor{\@currentHref}{\relax}}#1% \fi}% % \end{macrocode} % \begin{macrocode} \g@addto@macro\caption@prepareslc{\let\caption@@anchor\@firstofone}% % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@startanchor} % \changes{v3.1b}{2007/09/17}{Bugfix 06-09-17: We use \cs{caption@anchor} instead of \cs{hyper@@anchor}} % We redefine |\caption@@anchor| so a \package{hyperref} anchor % will be set inside |\caption@start|. This code was taken from the % \package{hypcap} package\cite{hypcap} and adapted. % \Note{Since \cs{hyper@@anchor} can cause a change from vertical mode to % horizontal mode (Bug in \package{hyperref} package!?), and since the % workaround \cs{let}\cs{leavevmode}\cs{relax} which can be found in the % \package{hypcap} package is not always sufficient % (for example with ``Direct pdfmark support'' and \texttt{breaklinks=true}), % we use \cs{caption@anchor} instead of \cs{hyper@@anchor} here.} % \begin{macrocode} \newcommand*\caption@startanchor[1]{% \caption@Debug{hyper anchor: #1}% \ifvmode\begingroup \@tempdima\prevdepth \nointerlineskip \vspace*{-\caption@hypcapspace}% \caption@anchor{#1}% \vspace*{\caption@hypcapspace}% \prevdepth\@tempdima \endgroup\else \PackageWarning{caption}{Internal Warning: Vertical TeX mode expected}% \caption@anchor{#1}% \fi}% % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@anchor} % Sets a \package{hyperref} anchor. % \begin{macrocode} \newcommand*\caption@anchor[1]{% \ifmeasuring@ \else \Hy@raisedlink{\hyper@anchorstart{#1}\hyper@anchorend}% \fi}% % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@@ContinuedFloat} % \changes{v3.1}{2007/07/02}{Format of \package{hyperref} extension changed} % When the \package{hyperref} package is used we have the problem % that the usage of |\ContinuedFloat| will create duplicate % hyper links -- |\@currentHref| will be the same for the main float and % the continued ones. So we have to make sure unique labels and references % will be created each time. We do this by extending |\theHfigure| and % |\theHtable|, so for continued floats the scheme % \begin{quote}\meta{type}|.|\meta{type \#}|\alph{|\meta{continued \#}|}|\end{quote} % will be used instead of % \begin{quote}\meta{type}|.|\meta{type \#}\quad\quad.\end{quote} % \par{\small(This implementation follows an idea from Steven Douglas Cochran.)} % \Note{This does not help if the \package{hyperref} package option % \texttt{naturalnames=true} is set.} % \begin{macrocode} \renewcommand*\caption@@ContinuedFloat[1]{% \@ifundefined{theH#1}{}{% \expandafter\l@addto@macro\csname theH#1\endcsname{% \@alph\c@ContinuedFloat}}}% % \end{macrocode} % \end{macro} % % \begin{macrocode} \newif\if@capstart % \end{macrocode} % % \begin{macro}{\caption@start} % \changes{v3.0l}{2007/02/20}{% % \cs{caption@currentHref} renamed to \cs{hc@currentHref}} % \changes{v3.1}{2007/06/21}{% % This macro renamed from \cs{capstart} to \cs{caption@start} and revised} % This one emulates the \package{hypcap} package (if |hypcap=true|). % \begin{macrocode} \def\caption@start{\caption@ifhypcap{% % \end{macrocode} % % Generate the \package{hyperref} label and set the \package{hyperref} anchor, % usually both is done inside |\@caption|. % \begin{macrocode} \caption@makestart\@captype \caption@startanchor\@currentHref % \end{macrocode} % % Prevent |\@caption| from generating a new \package{hyperref} label, % use the label we save in |\hc@currentHref| instead. % (We also support the |\@capstart| flag from the \package{hypcap} package.) % \begin{macrocode} \global\@capstarttrue \let\hc@currentHref\@currentHref \def\caption@makecurrentHref##1{% \global\@capstartfalse \global\let\@currentHref\hc@currentHref}% % \end{macrocode} % % Prevent |\@caption| from generating a \package{hyperref} anchor since this % has already been done. % \begin{macrocode} \let\caption@@anchor\@firstofone %%% \let\caption@startanchor\@gobble % \end{macrocode} % \begin{macrocode} }{}}% % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@@start} % Will be used by |\caption@freezeHref|. Apart from that we issue a warning % if we expect a saved \package{hyperref} label coming from |\caption@start|, % but there isn't any. % \begin{macrocode} \def\caption@@start{% \@ifundefined{hc@currentHref}{% \PackageWarning{caption}{% The option `hypcap=true' will be ignored for this\MessageBreak particular \string\caption}}{}}% % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@freezeHref} % Suppress |\caption@start| from generating a \package{hyperref} label and % setting a \package{hyperref} anchor. Instead if |\@caption| generates a % \package{hyperref} label, it will be stored in |\caption@currentHref|. % Furthermore we need to redefine |\caption@setfloatcapt| so no % \package{hyperref} anchor will be set in |\@caption|. % \iffalse % (Since |\caption@setfloatcapt| will be set to |\@firstofone| inside % |\subcaption| there is no need to add its restauration to % |\subcaption@settypehook|.) % \fi % \begin{macrocode} \def\caption@freezeHref{% \let\caption@ORI@start\caption@start \def\caption@start{\let\caption@start\caption@ORI@start}% % \end{macrocode} % \begin{macrocode} \let\caption@ORI@@start\caption@@start % \l@addto@macro\subcaption@settypehook{% % \let\caption@@start\caption@ORI@@start}% \global\let\caption@currentHref\@undefined \def\caption@@start{\global\let\caption@currentHref\@currentHref}% % \end{macrocode} % \begin{macrocode} \let\caption@ORI@setfloatcapt\caption@setfloatcapt \renewcommand*\caption@setfloatcapt{% \ifx\caption@currentHref\@undefined \else \let\caption@@anchor\@firstofone \fi \caption@ORI@setfloatcapt}}% % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@defrostHref} % If there is a freezed |\@currentHref|, we set the \package{hyperref} % anchor here. % \begin{macrocode} \def\caption@defrostHref{% \ifx\caption@currentHref\@undefined \else \caption@startanchor\caption@currentHref \global\let\caption@currentHref\@undefined \fi}% % \end{macrocode} % \end{macro} % % \begin{macro}{\float@makebox} % Do our own redefinition of |\float@makebox|, if it was redefined by % the \package{hyperref} package. % \begin{macrocode} \@ifundefined{HyOrg@float@makebox}{}{% \caption@Debug{% Redefining \noexpand\float@makebox (again)\@gobble}% \let\Hy@float@makebox\float@makebox \renewcommand\float@makebox[1]{% \HyOrg@float@makebox{#1\relax \caption@defrostHref}}% }% % \end{macrocode} % \end{macro} % % \begin{macrocode} }}{} % \end{macrocode} % % \subsubsection{The hypcap package} % \changes{v3.0f}{2005/06/22}{Support of the \package{hypcap} package added} % \changes{v3.0l}{2007/02/20}{Adapted to \package{hypcap} v1.6} % % \begin{macrocode} \caption@IfPackageLoaded{hypcap}{% v1.0 \ifx\caption@start\relax \else % hyperref hasn't stopped early % \end{macrocode} % % If the \package{hypcap} package was loaded, we give up our own % \package{hypcap} emulation and give the control to the \package{hypcap} % package instead. % % \begin{macro}{\capstart} % We do this simply by mapping |\capstart| to |\caption@start|, % although our code does not behave exactly like the original one: % The original |\capstart| has an effect on the next |\caption| % only but our version affects \emph{all} |\caption|s in the same % environment, at least unless a new |\capstart| will be placed. % \begin{macrocode} \let\caption@ORI@capstart\capstart \let\capstart\caption@start \let\caption@start\relax \let\caption@@start\relax % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@hypcapspace} % Furthermore we map our |\caption@hypcapspace| to |\hypcapspace| % offered by the \package{hypcap} package. % \begin{macrocode} \renewcommand*\caption@hypcapspace{\hypcapspace}% % \end{macrocode} % \end{macro} % % \begin{macro}{\float@makebox} % Redo the redefinition of |\float@makebox|, if necessary. % \begin{macrocode} \@ifundefined{Hy@float@makebox}{}{% \caption@Debug{% Restore hyperref redefinition of \string\float@makebox\@gobble}% \let\float@makebox\Hy@float@makebox \let\Hy@float@makebox\@undefined}% % \end{macrocode} % \end{macro} % % \begin{macrocode} \fi}{} % \end{macrocode} % % \subsubsection{The listings package} % \changes{v3.0b}{2004/05/16}{Support of the \package{listings} package added} % % \begin{macrocode} \caption@IfPackageLoaded{listings}[2004/02/13 v1.2]{% % \end{macrocode} % % \begin{macro}{\lst@MakeCaption} % To support the \package{listings} package we need to redefine % |\lst@MakeCaption| so the original stuff is nested with % |\caption@begin| and |\caption@end|. % \begin{macrocode} \let\caption@ORI@lst@MakeCaption\lst@MakeCaption \def\lst@MakeCaption#1{% \caption@setoptions{lstlisting}% % \end{macrocode} % % If the |position=| is set to |auto|, we take over the |captionpos=| setting % from the \package{listings} package. % Note that we won't do this otherwise, so \package{listings} settings like % |abovecaptionskip=0pt,belowcaptionskip=10pt,captionpos=t| will \emph{not} % cause different outputs with or without \thispackage\ loaded. % \begin{macrocode} \caption@setautoposition{#1}% % \end{macrocode} % % \begin{macrocode} \caption@begin{lstlisting}% \caption@ORI@lst@MakeCaption{#1}% \caption@end}% % \end{macrocode} % \end{macro} % % \begin{macro}{\ext@lstlisting} % Since the \package{listings} package do not define |\ext@lstlisting|, % but we needed it when |\captionof{lstlisting}| will be done by the end user, % we define it here. % \begin{macrocode} \providecommand*\ext@lstlisting{lol}% % \end{macrocode} % \end{macro} % % \changes{v3.1a}{2007/07/13}{Bugfix 07-09-13: \cs{lst@@caption} will not be re-defined anymore} % % \begin{macrocode} }{} % \end{macrocode} % % \subsubsection{The longtable package} % % \begin{macro}{\LTcaptype} % \changes{v3.1}{2007/07/06}{This macro and its support added} % |\LTcaptype| is preset to |table|. % \begin{macrocode} \providecommand*\LTcaptype{table} % \end{macrocode} % \end{macro} % % \begin{macrocode} \caption@IfPackageLoaded{longtable}[1995/05/24 v3.14]{% % \end{macrocode} % \begin{macrocode} \RequirePackage{ltcaption}[2007/09/01]% \let\LT@@makecaption\@undefined % \end{macrocode} % % \begin{macro}{\LT@array} % \changes{v3.1}{2007/07/22}{This redefinition added} % \changes{v3.1a}{2007/09/14}{Bugfix 07-09-14: Redefinition of \cs{@captionabovetrue} \& \cs{@captionabovefalse} added} % \changes{v3.1a}{2007/09/16}{Bugfix: This redefinition will always be done \cs{AtBeginDocument}} % We redefine |\LT@array| here to get |\captionsetup|\marg{options} % working inside |longtable|s. % \Note{Since the \package{hyperref} package patches \cs{LT@array} as well % and since this only works with the original definition of \cs{LT@array}, % we have to do this after the \package{hyperref} package, % i.e.~\cs{AtBeginDocument}.} % \begin{macrocode} \caption@AtBeginDocument{% \let\caption@ORI@LT@array\LT@array \renewcommand*\LT@array{% % \end{macrocode} % |\captionsetup| for longtable: % \begin{macrocode} \global\let\caption@opt@@longtable\@undefined \def\captionsetup##1{\noalign{\LT@captionsetup{##1}}}% \def\LT@captionsetup##1{% \@captionsetup\@gobble[@longtable]{##1}% \global\let\caption@opt@@longtable\caption@opt@@longtable}% % \end{macrocode} % |\captionabove| \& |\captionbelow| for longtable: (\KOMAScript\ document class) % \begin{macrocode} \def\@captionabovetrue{\LT@captionsetup{position=t}}% \def\@captionabovefalse{\LT@captionsetup{position=b}}% % \end{macrocode} % |\captionlistentry| for longtable: % \begin{macrocode} \def\captionlistentry##1{\noalign{% \caption@listentry[\LTcaptype]{##1}}}% % \end{macrocode} % |\ContinuedFloat| for longtable:\\ % {\small(Commented out, since it's not deeply tested and quite useless anyway)} % \Note{\package{hyperref} versions $<$ v6.76j uses $2\times$ \cs{hyper@makecurrent}} % \begin{macrocode} % \caption@ifhypcap{% % \let\caption@ORI@hyper@makecurrent\hyper@makecurrent % \def\hyper@makecurrent##1{% % \let\hyper@makecurrent\caption@ORI@hyper@makecurrent % \caption@makestart{##1}% %% \let\Hy@LT@currentHlabel\@currentHlabel % \let\Hy@LT@currentHref\@currentHref % \def\hyper@makecurrent####1{% %% \let\@currentHlabel\Hy@LT@currentHlabel % \let\@currentHref\Hy@LT@currentHref}}% % \let\caption@ORI@ContinuedFloat\ContinuedFloat % \def\ContinuedFloat{\noalign{% % \gdef\caption@setContinuedFloat{% % \let\caption@resetContinuedFloat\@gobble}% % \def\caption@setoptions####1{% % \g@addto@macro\caption@setContinuedFloat{% % \caption@setoptions{####1}}}% % \let\@captype\LTcaptype % \caption@ORI@ContinuedFloat}}% % }{% % \def\ContinuedFloat{\noalign{% % \caption@Error{% % \noexpand\ContinuedFloat inside longtables\MessageBreak % is only available with `hypcap=true'}}}% % }% % \global\let\caption@setContinuedFloat\@empty \def\ContinuedFloat{\noalign{% \caption@Error{\noexpand\ContinuedFloat outside float}}}% % \end{macrocode} % \begin{macrocode} \caption@ORI@LT@array}}% % \end{macrocode} % \end{macro} % % \begin{macro}{\LT@c@ption} % The original implementation: % \begin{verbatim} % \def\LT@c@ption#1[#2]#3{% % \LT@makecaption#1\fnum@table{#3}% % \def\@tempa{#2}% % \ifx\@tempa\@empty\else % {\let\\\space % \addcontentsline{lot}{table}{\protect\numberline{\thetable}{#2}}}% % \fi} % \end{verbatim}%^^A % Our implementation uses |\LTcaptype| instead of |{table}|: % \begin{macrocode} \def\LT@c@ption#1[#2]#3{% \LT@makecaption#1{\csname fnum@\LTcaptype\endcsname}{#3}% \def\@currentlabelname{#2}% \caption@addcontentsline\LTcaptype{#2}}% % \end{macrocode} % \end{macro} % % \begin{macro}{\LT@makecaption} % \changes{v3.0d}{2004/08/10}{% % Bugfix 04-08-04: \cs{abovecaptionskip} \& \cs{belowcaptionskip} will be used now} % \changes{v3.0e}{2005/05/05}{% % Bugfix: \cs{captionsetup[longtable]} overrides \cs{LTcapwidth} now} % \changes{v3.0h}{2005/10/07}{\cs{caption@LT@make} introduced} % |\LT@makecaption|\marg{cmd}\marg{label}\marg{text}\par % \smallskip % The original definition: % \begin{verbatim} % \def\LT@makecaption#1#2#3{% % \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{% % % Based on article class "\@makecaption", "#1" is "\@gobble" in star % % form, and "\@firstofone" otherwise. % \sbox\@tempboxa{#1{#2: }#3}% % \ifdim\wd\@tempboxa>\hsize % #1{#2: }#3% % \else % \hbox to\hsize{\hfil\box\@tempboxa\hfil}% % \fi % \endgraf\vskip\baselineskip}% % \hss}}} % \end{verbatim}%^^A % Our definition: % \begin{macrocode} \renewcommand\LT@makecaption[3]{% \caption@LT@make{% % \end{macrocode} % % We set |\ifcaption@star| according the 1st argument. % \begin{macrocode} \caption@startrue#1\caption@starfalse % \end{macrocode} % % If |\LTcapwidth| is not set to its default value |4in| we assume % that it shall overwrite our own setting. % (But |\captionsetup[longtable]{width=|\ldots|}| will overwrite |\LTcapwidth|.) % \begin{macrocode} \caption@settype*\LTcaptype \ifdim\LTcapwidth=4in \else \setcaptionwidth\LTcapwidth \fi \caption@setoptions{longtable}% % \caption@setContinuedFloat \caption@setoptions{@longtable}% % \end{macrocode} % % \iffalse % The default |position=| setting for longtables is |top|. % (This emulates the standard behavior of the \package{longtable} package % which has no skip above the caption but a skip below it.) % \fi % % |position=auto| is a bad idea for longtables, but we do our very best. % This works quite well for captions inside the longtable contents, but % not for captions inside the longtable (end)foot. % \Note{This should be `top' if unclear!} % \begin{macrocode} \caption@setautoposition{\ifcase\LT@rows t\else b\fi}% % \end{macrocode} % % \changes{v3.1}{2007/05/05}{\cs{caption@normalsize} added} % \begin{macrocode} \caption@resetContinuedFloat\LTcaptype \caption@begin\LTcaptype \caption@normalsize % \end{macrocode} % % The following skip has the purpose to correct the height of the % |\parbox[t]|. Usually it's the height of the very first line, but % because of our extra skips (|\abovecaptionskip| and |\belowcaptionskip|) % it's always |0pt|.\par % (A different idea would be typesetting the first skip outside the longtable % column with |\noalign{\vskip|\ldots|}|, but this means we have to move % |\caption@begin| to some other place because it does not work in tabular % mode. And at the moment I have no idea on how to do this in an elegant % way\ldots) % \begin{macrocode} \vskip-\ht\strutbox % \end{macrocode} % % The following code should look familiar. We do our skips and use % |\caption@@make| to typeset the caption itself. % \begin{macrocode} \caption@iftop{\vskip\belowcaptionskip}{\vskip\abovecaptionskip}% \caption@@make{#2}{#3}\endgraf \caption@iftop{\vskip\abovecaptionskip}{\vskip\belowcaptionskip}% \caption@end}}% % \end{macrocode} % \end{macro} % % \begin{macrocode} }{} % \end{macrocode} % % \subsubsection{The picinpar package} % \changes{v3.1}{2007/06/13}{Support of the \package{picinpar} package added} % % \begin{macrocode} \caption@IfPackageLoaded{picinpar}{% % \end{macrocode} % % \begin{macro}{\figwindow} % \begin{macro}{\tabwindow} % The \package{picinpar} package comes with its own caption code % (|\wincaption|, |\@wincaption|, |\@makewincaption|, \ldots) % so we redefine |\figwindow| \& |\tabwindow| to use |\caption| instead. % \begin{macrocode} \long\def\figwindow[#1,#2,#3,#4] {% \caption@window{figure}% \caption@setoptions{figwindow}% \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }% % \end{macrocode} % \begin{macrocode} \long\def\tabwindow[#1,#2,#3,#4] {% \caption@window{table}% \caption@setoptions{tabwindow}% \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }% % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\caption@window} % Beside calling |\caption@settype| we redefine |\caption@boxrestore| % (as in \package{floatflt} \& \package{picins} package support) % and |\@makecaption| (as in \package{float} package support) here. % \begin{macrocode} \newcommand*\caption@window{% \let\caption@boxrestore\@parboxrestore \let\@makecaption\caption@@make \caption@setautoposition b% \caption@settype}% % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@wincaption} % This one finally typesets the caption using |\caption|. % \begin{macrocode} \newcommand\caption@wincaption[1]{% % \end{macrocode} % This will be done twice for every |figwindow| \& |tabwindow| caption -- % on the first run |\picwd| is |0pt|, on the second run |\picwd| is |\hsize|. % \begin{macrocode} \ifdim\picwd=\z@ \let\caption@makecurrent\@gobbletwo \let\caption@@start\relax \caption@prepareslc \fi % \end{macrocode} % The argument |#1| could contain simply the caption text % (e.g.~|A figure caption|), but it could also contain an optional argument, % the \meta{lst\_entry} % (e.g.~|[An| |entry| |to| |the| |LOF]||{A| |figure| |caption}|). % Therefore we have to test if |#1| begins with~|[| or not; furthermore we % support a starred variant -- as in |\caption*| -- so we test for~|*|, too. % \begin{macrocode} \edef\@tempa{\expandafter\noexpand\@car#1\@nil}% \if\@tempa* \let\@tempa\@firstofone \else\if\@tempa[%] \let\@tempa\@firstofone \else \let\@tempa\@empty \fi\fi \expandafter\caption\@tempa{#1}}% % \end{macrocode} % \end{macro} % % \begin{macrocode} }{} % \end{macrocode} % % \subsubsection{The picins package} % \changes{v3.0j}{2006/01/26}{Support of the \package{picins} package added} % % \begin{macro}{\piccaptiontype} % |\piccaptiontype|\marg{type}\par % We offer this macro for changing the \meta{type} of the caption, so the user % doesn't have to redefine |\@captype|, as proposed in the \package{picins} % documentation. % \Note{We define this macro here so it can be used in the % preamble of the document, even when \thispackage\ was loaded prior to the % \package{picins} package.} % \begin{macrocode} \newcommand*\piccaptiontype[1]{\def\@piccaptype{#1}} % \end{macrocode} % \end{macro} % % \begin{macrocode} \caption@IfPackageLoaded{picins}{% % \end{macrocode} % % Initial set |\@piccaptype| and undefine |\@captype| which was set to % |figure| by the \package{picins} package. % \begin{macrocode} \@ifundefined{@piccaptype}{% \caption@iftype{% \let\@piccaptype\@captype }{% \def\@piccaptype{figure}% }% }{}% \let\@captype\@undefined % \end{macrocode} % % \begin{macro}{\piccaption} % The original code: % \begin{verbatim} % \def\piccaption{\@ifnextchar [{\@piccaption}{\@piccaption[]}} % \end{verbatim}%^^A % Our code uses |\caption@star| so |\piccaption*| works, % and |\caption@dblarg| so |\piccaption{}| works correctly. % \begin{macrocode} \def\piccaption{\caption@star\relax{\caption@dblarg\@piccaption}}% % \end{macrocode} % \end{macro} % % \begin{macro}{\make@piccaption} % The original code: % \begin{verbatim} % \def\make@piccaption{% % [...] % \setbox\@TEXT=\vbox{\hsize\hsiz@\caption[\sh@rtf@rm]{\capti@nt@xt}}% % } % \end{verbatim}%^^A % In our code we have to correct several things: % \begin{enumerate} % \item |\@captype| must be defined, since we have removed the global % definition. % \item We use |\caption@setoptions{parpic}| so % |\captionsetup[parpic]{|\ldots|}| is supported. % \item |\linewidth| must be set correctly. % Usually this is done by |\@parboxrestore| inside |\@caption|, % but since we use |\@caption@boxrestore| we have to map this to % |\@parboxrestore| instead. % \item The two arguments of |\caption| (|\sh@rtf@rm| \& |\capti@nt@xt|) % should be expanded on first level so |\caption[]{|\ldots|}| and % |\caption[|\ldots|]{}| work correctly. % \end{enumerate} % \begin{macrocode} \let\caption@ORI@make@piccaption\make@piccaption \def\make@piccaption{% \let\caption@ORI\caption % \end{macrocode} % \begin{macrocode} \long\def\caption[##1]##2{% \caption@freezeHref % will be defrosted in \ivparpic \caption@settype\@piccaptype \ifnum\c@piccaptionpos>2\relax \caption@clearmargin \else \captionwidth\z@ % do not use "width=" setting \fi \caption@setoptions{parpic}% \let\caption@boxrestore\@parboxrestore \caption@setautoposition b% % \end{macrocode} % \begin{macrocode} \expandafter\expandafter\expandafter\caption@ORI \expandafter\expandafter\expandafter[% \expandafter\expandafter\expandafter{% \expandafter##1\expandafter}\expandafter]\expandafter{##2}}% % \end{macrocode} % {\footnotesize\begin{quote} % \leavevmode\llap{-or-\quad}%^^A % |\begingroup|\\ % | \toks0\expandafter{##1}| |\toks2\expandafter{##2}|\\ % | \edef\x{\endgroup|\\ % | \noexpand\caption@ORI[{\the\toks0}]{\the\toks2}}|\\ % | \x| % \end{quote} % \begin{quote} % \leavevmode\llap{-or-\quad}%^^A % |\edef\x{%|\\ % | \noexpand\caption@ORI[{\unexpanded\expandafter{##1}}]%|\\ % | {\unexpanded\expandafter{##2}}}|\\ % |\x| % \end{quote}} % \begin{macrocode} \caption@ORI@make@piccaption \let\caption\caption@ORI}% % \end{macrocode} % \end{macro} % % \begin{macro}{\ivparpic} % We need to set our \package{hyperref} anchor here. % Not bullet-proof since we have to redefine |\noindent| here! % \begin{macrocode} \let\caption@ORI@ivparpic\ivparpic \def\ivparpic(#1,#2)(#3,#4)[#5][#6]#7{% \let\caption@ORI@noindent\noindent \def\noindent{% \caption@defrostHref \let\noindent\caption@ORI@noindent \noindent}% \caption@ORI@ivparpic(#1,#2)(#3,#4)[#5][#6]{#7}% \let\noindent\caption@ORI@noindent}% % \end{macrocode} % \end{macro} % % \begin{macrocode} }{% \let\piccaptiontype\@undefined } % \end{macrocode} % % \subsubsection{The rotating package} % % \begin{macrocode} \caption@IfPackageLoaded{rotating}[1995/08/22 v2.10]{% % \end{macrocode} % % \begin{macro}{\rotcaption} % \changes{v3.0c}{2004/07/16}{Bugfix: Check for \cs{caption@star} removed} % \changes{v3.0i}{2005/12/07}{Rewritten, works with \package{hyperref} now} % Make |\rotcaption*| work. % \begin{macrocode} \def\rotcaption{\let\@makecaption\@makerotcaption\caption}% % \let\@rotcaption\@undefined % \end{macrocode} % \end{macro} % % \begin{macro}{\rotcaptionof} % \changes{v3.0i}{2005/12/07}{New} % Make |\rotcaptionof(*)| work. % \begin{macrocode} \def\rotcaptionof{% \caption@teststar\caption@of{\rotcaption*}\rotcaption}% % \end{macrocode} % \end{macro} % % \begin{macro}{\@makerotcaption} % \changes{v3.0i}{2005/12/06}{Rewritten, should finally work proper now} % \changes{v3.0m}{2007/03/04}{Uses \cs{captionbox} instead of \cs{caption@start/endbox} now} % Original (bugfixed) code: % \begin{verbatim} % \long\def\@makerotcaption#1#2{% % \setbox\@tempboxa\hbox{#1: #2}% % \ifdim \wd\@tempboxa > .8\vsize % \rotatebox{90}{% % \begin{minipage}{.8\textheight}#1: #2\end{minipage}% % }%\par % <== \par removed (AR) % \else% % \rotatebox{90}{\box\@tempboxa}% % \fi % \nobreak\hspace{12pt}% <== \nobreak added (AR) % } % \end{verbatim}%^^A % Our version emulates this behavior, but if |width=| is set, % the rotated caption is always typeset as |minipage|. % (Note that |margin=| is not supported here.) % \begin{macrocode} \long\def\@makerotcaption#1#2{% % \end{macrocode} % % \begin{macrocode} \ifdim\captionwidth=\z@ \setcaptionwidth{.8\textheight}% \caption@slc{#1}{#2}{.8\vsize}{% \let\caption@makerot\caption@@make \caption@clearmargin % \long\def\captionbox##1##2{\hbox{\hsize=.8\textheight\relax##2}}% % (not needed because \rotatebox uses an \hbox anyway) \let\captionbox\@secondoftwo}% \caption@set@bool\caption@ifslc0% been there, done that \fi % \end{macrocode} % % \begin{macrocode} \rotatebox{90}{\caption@makerot{#1}{#2}}% \nobreak\hspace{12pt}}% % \end{macrocode} % % \begin{macrocode} \newcommand\caption@makerot[2]{% \begin{minipage}\captionwidth\caption@@make{#1}{#2}\end{minipage}}% % \end{macrocode} % \end{macro} % % \changes{v3.1a}{2007/09/07}{\cs{DeclareFloatingEnvironment} defines sideways-variant, too} % \begin{macrocode} \ForFloatingEnvironments{% \newenvironment{sideways#1}{\@rotfloat{#1}}{\end@rotfloat}% \newenvironment{sideways#1*}{\@rotdblfloat{#1}}{\end@rotdblfloat}}% % \end{macrocode} % % \begin{macrocode} }{} % \end{macrocode} % % \subsubsection{The sidecap package} % % \begin{macrocode} \caption@IfPackageLoaded{sidecap}[1999/05/11 v1.4d]{% \caption@setbool{needfreeze}{1}% % \end{macrocode} % % \begin{macro}{\SC@caption} % \changes{v3.0d}{2004/11/28}{Bugfix: Definition of \cs{@captype} added} % \changes{v3.0e}{2005/05/05}{Bugfix: Empty captions are handled correctly now} % \changes{v3.0e}{2005/05/05}{Priority of options fixed} % \changes{v3.0h}{2005/10/03}{Bugfix: Always use \cs{AtBeginDocument} to set \cs{SC@caption}} % First of all, we let \package{sidecap} use a current definition of |\caption|.\\ % (This is only required for version 1.5d of the \package{sidecap} package.) % \begin{macrocode} \caption@AtBeginDocument{\let\SC@caption=\caption}% % \end{macrocode} % \end{macro} % % \begin{macro}{\SC@zfloat} % \changes{v3.0b}{2004/05/16}{Local definition of \cs{captionsetup} added} % \changes{v3.0c}{2004/07/16}{Bugfix 04-07-15: Check for \cs{caption@star} removed} % This macro will be called at the start of the environment, here is a good % opportunity to do some adaptations to |\caption| and |\captionsetup|. % \begin{macrocode} \let\caption@ORI@SC@zfloat\SC@zfloat \def\SC@zfloat#1#2#3[#4]{% \caption@ORI@SC@zfloat{#1}{#2}{#3}[#4]% % \end{macrocode} % % Since the sidecap package uses our |\caption| code outside the % environment the regular |\captionsetup| will not work. % So we need a special version here which saves the given argument list % which will be executed later on. % Furthermore we need to make |\caption*| work. % \begin{macrocode} \caption@settype*{#2}% \caption@freeze*}% % \end{macrocode} % \end{macro} % % \begin{macro}{\endSC@FLOAT} % \changes{v3.0i}{2006/01/12}{\cs{@listdepth}\cs{z@} added} % \changes{v3.1}{2007/05/05}{Call of \cs{caption@setoptions}\arg{SCfloat} added} % This macro will be called at the end of the environment, here we need to % setup our stuff before the \package{sidecap} package actually typesets % its caption. % \begin{macrocode} \let\caption@ORI@endSC@FLOAT\endSC@FLOAT \def\endSC@FLOAT{% % \end{macrocode} % % \Note{\cs{@captype} isn't defined here, this will be done inside % the original definition of \cs{endSC@FLOAT}. But \cs{SC@captype} is % defined and can be used here, if needed.} % % \begin{macrocode} \let\caption@ORI@settype\caption@settype \def\caption@settype##1{% will be done in \@xfloat \caption@ORI@settype*{##1}% do not change \@currentlabel \caption@setSC@justify \caption@setoptions{SCfloat}% \caption@setoptions{SC\@captype}% \caption@start}% % \end{macrocode} % % Before we can typeset the caption we need to set the margin to zero % because any extra margin would only be disturbing here.\par % (We don't need to take care about the caption position because % the sidecap package set both |\abovecaptionskip| and |\belowcaptionskip| % to a skip of zero anyway.)\par % Furthermore |\SC@justify| will override the caption justification, if set. % The usage of |\SC@justify| differs from version to version of the % \package{sidecap} package:\par % \begin{tabular}{ll} % Version 1.4: & |\SC@justify| is not defined\\ % Version 1.5: & |\SC@justify| is |\relax| when not set\\ % Version 1.6: & |\SC@justify| is |\@empty| when not set\\ % \end{tabular} % \begin{macrocode} \def\caption@setSC@justify{% \caption@clearmargin \@ifundefined{SC@justify}{}{% \ifx\SC@justify\@empty \else \let\caption@hj\SC@justify \let\SC@justify\@empty \fi}}% % \end{macrocode} % % Make the original definition of |\endSC@FLOAT| to use our caption % stuff instead of its own. % \Note{At this point the \package{sidecap} definition of \cs{caption} is valid, % not the regular one!} % \begin{macrocode} \let\caption\SC@orig@caption \def\SC@orig@caption[##1]##2{\caption@defrost}% % \end{macrocode} % % Finally we call the original definition of |\endSC@FLOAT|. % \begin{macrocode} \caption@setSC@justify % for compatibility mode \caption@ORI@endSC@FLOAT}% % \end{macrocode} % \end{macro} % % \changes{v3.1a}{2007/09/07}{\cs{DeclareFloatingEnvironment} defines SC-variant, too} % \begin{macrocode} \ForFloatingEnvironments{% \newenvironment{SC#1}% {\SC@float[\@nameuse{SC@#1@vpos}]{#1}}{\endSC@float}% \newenvironment{SC#1*}% {\SC@dblfloat[\@nameuse{SC@#1@vpos}]{#1}}{\endSC@dblfloat}}% % \end{macrocode} % % \begin{macrocode} }{} % \end{macrocode} % % \subsubsection{The subfigure package} % \changes{v3.1}{2007/04/06}{subfigure package support added (package)} % % \begin{macrocode} \caption@IfPackageLoaded{subfigure}[2002/01/23 v2.1]{% % \end{macrocode} % % \begin{macro}{\sf@ifpositiontop} % \changes{v3.1a}{2007/09/15}{Bugfix 07-09-15: Check for \cs{@captype} added} % If the \package{subfigure} package is loaded, we map |\sf@ifpositiontop| % to |\iffiguretopcap| resp. |\iftabletopcap|, so the \package{subfigure} % \version{2.1} options \opt{figbotcap} etc. will still work. % \begin{macrocode} \def\sf@ifpositiontop{% \ifx\@captype\@undefined \expandafter\@gobbletwo \else\ifx\@captype\relax \expandafter\expandafter\expandafter\@gobbletwo \else \expandafter\expandafter\expandafter\sf@if@position@top \fi\fi} % \end{macrocode} % \begin{macrocode} \def\sf@if@position@top{% \@ifundefined{if\@captype topcap}% {\@gobbletwo}% {\@nameuse{if\@captype topcap}% \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi}} % \end{macrocode} % \end{macro} % % \begin{macrocode} }{} % \end{macrocode} % % \subsubsection{The supertabular package} % % \begin{macrocode} \caption@IfPackageLoaded{supertabular}[2002/07/19 v4.1e]{% % \end{macrocode} % % \begin{macro}{\tablecaption} % \changes{v3.0e}{2005/05/05}{Made \cs{topcaption*} and \cs{bottomcaption*} work} % Make |\topcaption*| and |\bottomcaption*| work. % \begin{macrocode} \let\caption@ORI@tablecaption\tablecaption \def\tablecaption{\caption@star\relax\caption@ORI@tablecaption}% % \end{macrocode} % \end{macro} % % \begin{macro}{\ST@caption} % \changes{v3.0a}{2004/01/23}{Bugfix: Missing \cs{par} added} % The original code: % \begin{verbatim} % \long\def\ST@caption#1[#2]#3{\par% % \addcontentsline{\csname ext@#1\endcsname}{#1}% % {\protect\numberline{% % \csname the#1\endcsname}{\ignorespaces #2}} % \begingroup % \@parboxrestore % \normalsize % \if@topcaption \vskip -10\p@ \fi % \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par % \if@topcaption \vskip 10\p@ \fi % \endgroup} % \end{verbatim}%^^A % \begin{macrocode} \long\def\ST@caption#1[#2]#3{\par% \caption@settype*{#1}% \caption@setoptions{supertabular}% % \end{macrocode} % The |position=| setting will be overwritten by the % \package{supertabular} package: If |\topcaption| was used, % the position will be |top| automatically, |bottom| otherwise. % \begin{macrocode} \def\caption@fixposition{% \caption@setposition{\if@topcaption t\else b\fi}}% % \end{macrocode} % \begin{macrocode} \caption@beginex{#1}{#2}{#3}% \caption@boxrestore \caption@normalsize \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par \caption@end}% % \end{macrocode} % \end{macro} % % \begin{macrocode} }{% \let\caption@setSTposition\@undefined } % \end{macrocode} % % \subsubsection{The threeparttable package} % \changes{v3.1}{2007/05/08}{Support of the \package{threeparttable} package added} % % \begin{macrocode} \caption@IfPackageLoaded{threeparttable}[2003/06/13 v3.0]{% % \end{macrocode} % % \begin{macro}{\threeparttable} % Unfortunately |\@captype| is not set when |\TPT@common| will be used, % so we have to redefine |\threeparttable| and |\measuredfigure| instead. % \begin{macrocode} \let\caption@ORI@threeparttable\threeparttable \renewcommand*\threeparttable{% \caption@settype{table}% \caption@setposition a% ? \caption@clearmargin \caption@setoptions{threeparttable}% \caption@ORI@threeparttable}% % \end{macrocode} % \end{macro} % \begin{macro}{\measuredfigure} % Same here\ldots % \begin{macrocode} \let\caption@ORI@measuredfigure\measuredfigure \renewcommand*\measuredfigure{% \caption@settype{figure}% \caption@setposition a% ? \caption@clearmargin \caption@setoptions{measuredfigure}% \caption@ORI@measuredfigure}% % \end{macrocode} % \end{macro} % % \begin{macro}{\TPT@caption} % The original code: % \begin{verbatim} % \def\TPT@caption#1[#2]#3{\gdef\TPT@docapt % {\par\global\let\TPT@docapt\@undefined \TPT@LA@caption{#1}[{#2}]% % {\strut\ignorespaces#3\ifhmode\unskip\@finalstrut\strutbox\fi}}% % \ifx\TPT@hsize\@empty \let\label\TPT@gatherlabel \abovecaptionskip\z@skip % \else \TPT@docapt \fi \ignorespaces} % \end{verbatim}%^^A % \begin{macrocode} \def\TPT@caption#1[#2]#3{% \gdef\TPT@docapt{% \global\let\TPT@docapt\@undefined \caption@setautoposition\caption@TPT@position \TPT@LA@caption{#1}[{#2}]{#3}}% \ifx\TPT@hsize\@empty \let\label\TPT@gatherlabel % Bug: does not work for measuredfigures \gdef\caption@TPT@position{t}% \g@addto@macro\TPT@docapt\caption@TPT@eatvskip \else \def\caption@TPT@position{b}% \TPT@docapt \fi \ignorespaces}% % \end{macrocode} % \begin{macrocode} %\newcommand*\caption@TPT@eatvskip{\vskip-.2\baselineskip}% \def\caption@TPT@eatvskip#1\vskip{#1\@tempdima=}% % \end{macrocode} % \end{macro} % % \begin{macrocode} }{} % \end{macrocode} % % \subsubsection{The wrapfig package} % \changes{v3.1}{2007/05/05}{Support of the \package{wrapfig} package added} % % \begin{macrocode} \caption@IfPackageLoaded{wrapfig}{% ver 3.3 (Oct 12, 1999) % \end{macrocode} % % \begin{macro}{\float@ifstyle} % \changes{v3.1}{2007/06/10}{This macro added} % |\float@ifstyle|\marg{type}\marg{if-clause}\marg{else-clause}\par % (see \package{float} package support for details) % \begin{macrocode} \providecommand*\float@ifstyle[1]{% \expandafter\ifx\csname fst@#1\endcsname\relax \expandafter\@secondoftwo \else \expandafter\@firstoftwo \fi}% % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@restylewrapfloat} % This one redefines the |wrap#1| environment, e.g.~|wrapfigure|. % Our code uses |\caption@setoptions{wrapfigure}| so % |\captionsetup[wrapfigure]{|\ldots|}| will work.\par % But first we check if our redefinition was already done, this could % happen inside |\float@restyle| when the \package{wrapfig} support of % the \package{float} package was not installed successfully, so it has % not redefined |\wrap#1| there. % \begin{macrocode} \newcommand*\caption@restylewrapfloat[1]{% \expandafter\ifx\csname caption@OUR@wrap#1\expandafter\endcsname \csname wrap#1\endcsname \caption@Error{% For a successful cooperation of the `wrapfig' package\MessageBreak with the `float' package you should load the `wrapfig'\MessageBreak package *after* the `float' package}% \else \expandafter\let\csname caption@ORI@wrap#1\expandafter\endcsname \csname wrap#1\endcsname \@namedef{wrap#1}{\caption@wrapfloat{#1}}% \expandafter\let\csname caption@OUR@wrap#1\expandafter\endcsname \csname wrap#1\endcsname \fi}% % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@wrapfloat} % \begin{macrocode} \newcommand*\caption@wrapfloat[1]{% \caption@settype*{#1}% \float@ifstyle{#1}{% \ifx\WF@floatstyhook\@undefined \caption@Error{% For a successful cooperation of the `wrapfig' package\MessageBreak with the `float' package you should use at least\MessageBreak `wrapfig' version 3.6}% \else \float@dostyle{#1}% \fi}{}% \caption@clearmargin \caption@setoptions{wrapfloat}% \caption@setoptions{wrap#1}% \@nameuse{caption@ORI@wrap#1}}% % \end{macrocode} % \end{macro} % % Now we redefine the \package{wrapfig} environments we know about.\par % If someone has placed a |\newfloat| right between |\usepackage{wrapfig}| % and |\usepackage{caption}| (or loads \thispackage\ first, so all these % patches will be done with |\AtBeginDocument|) we have bad luck since the % \package{float} package do not offer a list of (re)styled floats. % (This would finally lead to an error in |\caption@setfloatcapt|.) % % \begin{macrocode} \caption@restylewrapfloat{figure}% \caption@restylewrapfloat{table}% % \end{macrocode} % % \changes{v3.1a}{2007/09/07}{\cs{DeclareFloatingEnvironment} defines wrap-variant, too} % \begin{macrocode} \ForFloatingEnvironments{% \newenvironment{wrap#1}{\wrapfloat{#1}}{\endwrapfloat}% \caption@restylewrapfloat{#1}}% % \end{macrocode} % % \begin{macrocode} \ifx\WF@floatstyhook\@undefined \else % wrapfig v3.6 % \end{macrocode} % % \begin{macro}{\float@restyle} % If the \package{wrapfig} package \version{3.6} is used, we patch % |\float@restyle| (if defined), too, so new or restyled floats will be % handled correctly, too. % \begin{macrocode} \@ifundefined{float@restyle}{}{% \toks@=\expandafter{\float@restyle{#1}% (env may or may not be defined) \caption@restylewrapfloat{#1}}% \edef\@tempa{\def\noexpand\float@restyle##1{\the\toks@}}% \@tempa}% perform redefinitions % \end{macrocode} % \end{macro} % % \begin{macro}{\wrapfloat} % An additional check of the package load order: % If both, neither the \package{wrapfig} package nor \thispackage\ haven't % catch |\float@restyle|, we finally splash down at |\wrapfloat|. % \begin{macrocode} \let\caption@ORI@wrapfloat\wrapfloat \def\wrapfloat#1{% \float@ifstyle{#1}{% \caption@Error{% For a successful cooperation of the `wrapfig' package\MessageBreak with the `float' package you should load the `wrapfig'\MessageBreak package *right after* the `float' package}}{}% \caption@ORI@wrapfloat{#1}}% % \end{macrocode} % \end{macro} % % \begin{macrocode} \fi % wrapfig v3.6 % \end{macrocode} % % \begin{macro}{\WF@rapt} % We place our \package{hyperref} anchor here.\par % Original code: % \begin{verbatim} % \def\WF@rapt[#1]#2{% final two args: #1 = overhang, #2 = width, % \gdef\WF@ovh{#1}% hold overhang for later, when \width is known % \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}% % \ifdim\hsize>\z@ \@parboxrestore \else % \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption % \ignorespaces \fi} % \end{verbatim}%^^A % Our code: % \begin{macrocode} \def\WF@rapt[#1]#2{% final two args: #1 = overhang, #2 = width, \gdef\WF@ovh{#1}% hold overhang for later, when \width is known \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}% \caption@start \ifdim\hsize>\z@ \@parboxrestore \else \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption \ignorespaces \fi}% % \end{macrocode} % \end{macro} % % \begin{macrocode} }{} % \end{macrocode} % % \iffalse % % \fi % % \iffalse % --------------------------------------------------------------------------- % % \fi % % \clearpage % \begin{thebibliography}{99} % \bibitem{TLC2} % Frank Mittelbach and Michel Goossens:\\ % \newblock {\em The {\LaTeX} Companion (2nd.~Ed.)},\\ % \newblock Addison-Wesley, 2004. % % \bibitem{beamer} % Till Tantau:\\ % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/beamer/doc/beameruserguide.pdf}% % {\emph{User Guide to the Beamer Class, Version 3.07}},\\ % March 11, 2007 % % \bibitem{KOMAScript} % Markus Kohm \& Jens-Uwe-Morawski:\\ % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/koma-script/scrguien.pdf}% % {\emph{KOMA-Script -- a versatile \LaTeXe\ bundle}},\\ % 2007-01-09 % % \bibitem{NTG} % Victor Eijkhout:\\ % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/ntgclass/classdoc.pdf}% % {\emph{An introduction to the Dutch \LaTeX\ document classes}},\\ % 3 September 1989 % % \bibitem{float} % Anselm Lingnau:\\ % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/float/float.pdf}% % {\emph{An Improved Environment for Floats}},\\ % 2001/11/08 % % \bibitem{floatflt} % Mats Dahlgren:\\ % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/floatflt/floatflt.pdf}% % {\emph{Welcome to the floatflt package}},\\ % 1998/06/05 % % \bibitem{floatrow} % Olga Lapko:\\ % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/floatrow/floatrow.pdf}% % {\emph{The floatrow package documentation}},\\ % 2006/07/24 % % \bibitem{fltpage} % Sebastian Gross:\\ % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/fltpage/fltpage.pdf}% % {\emph{Welcome to the beta test of fltpage package!}},\\ % 1998/11/13 % % \bibitem{hyperref} % Sebastian Rahtz \& Heiko Oberdiek:\\ % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/hyperref/hyperref.pdf}% % {\emph{Hypertext marks in \LaTeX}},\\ % June 14, 2007 % % \bibitem{hypcap} % Heiko Oberdiek:\\ % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/oberdiek/hypcap.pdf}% % {\emph{The hypcap package -- Adjusting anchors of captions}},\\ % 2007/04/09 % % \bibitem{listings} % Carsten Heinz \& Brooks Moses:\\ % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/listings/listings.pdf}% % {\emph{The Listings Package}},\\ % 2007/02/22 % % \bibitem{longtable} % David Carlisle:\\ % \href{ftp://ctan.tug.org/tex-archive/macros/latex/required/tools/longtable.pdf}% % {\emph{The longtable package}},\\ % 2004/02/01 % % \bibitem{picinpar} % Friedhelm Sowa:\\ % \href{ftp://ctan.tug.org/tex-archive/macros/latex209/contrib/picinpar/}% % {\emph{Pictures in Paragraphs}},\\ % July 13, 1993 % % \bibitem{picins} % Joachim Bleser and Edmund Lang:\\ % \href{ftp://ctan.tug.org/tex-archive/macros/latex209/contrib/picins/mpic.dvi}% % {\emph{PicIns-Benutzerhandbuch Version 3.0}},\\ % September~1992 % % \bibitem{rotating} % Sebastian Rahtz and Leonor Barroca:\\ % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/rotating/}% % {\emph{A style option for rotated objects in \LaTeX}},\\ % 1997/09/26 % % \bibitem{sidecap} % Rolf Niepraschk \& Hubert G\"a\ss lein:\\ % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/sidecap/sidecap.pdf}% % {\emph{The sidecap package}},\\ % 2003/06/06 % % \bibitem{subfigure} % Steven D. Cochran:\\ % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/subfigure/subfigure.pdf}% % {\emph{The subfigure package}},\\ % 2002/07/02 % % \bibitem{subfig} % Steven D. Cochran:\\ % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/subfig/subfig.pdf}% % {\emph{The subfig package}},\\ % 2005/07/05 % % \bibitem{supertabular} % Johannes Braams and Theo Jurriens:\\ % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/supertabular/supertabular.pdf}% % {\emph{The supertabular environment}},\\ % 2002/07/19 % % \bibitem{threeparttable} % Donald Arseneau:\\ % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/misc/threeparttable.sty}% % {\emph{Three part tables: title, tabular environment, notes}},\\ % 2003/06/13 % % \bibitem{wrapfig} % Donald Arseneau:\\ % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/wrapfig/wrapfig.sty}% % {\emph{WRAPFIG.STY ver 3.6}},\\ % 2003/01/31 % % \bibitem{Anne} % Anne Br\"uggemann-Klein:\\ % \emph{Einf\"uhrung in die Dokumentverarbeitung},\\ % B.G. Teubner, Stuttgart, 1989 % % \bibitem{refcount} % Heiko Oberdiek:\\ % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/oberdiek/refcount.pdf}% % {\emph{The refcount package}},\\ % 2006/02/20 % \end{thebibliography} % % \iffalse % --------------------------------------------------------------------------- % % \fi % % \clearpage % \Finale % \endinput