Debian Codegraph @

texmf-dist/source/latex/caption/fallback/v3.1/caption.dtx

raw
1 % \iffalse meta-comment
2 %
3 % This is file `caption.dtx'.
4 %
5 % Copyright (C) 1994-2023 Axel Sommerfeldt ([email protected])
6 %
7 % --------------------------------------------------------------------------
8 %
9 % This work may be distributed and/or modified under the
10 % conditions of the LaTeX Project Public License, either version 1.3
11 % of this license or (at your option) any later version.
12 % The latest version of this license is in
13 % http://www.latex-project.org/lppl.txt
14 % and version 1.3 or later is part of all distributions of LaTeX
15 % version 2003/12/01 or later.
16 %
17 % This work has the LPPL maintenance status "maintained".
18 %
19 % This Current Maintainer of this work is Axel Sommerfeldt.
20 %
21 % This work consists of the files caption.ins, caption.dtx, caption2.dtx,
22 % ltcaption.dtx, and subcaption.dtx, the derived files caption.sty,
23 % caption2.sty, caption3.sty, ltcaption.sty, and subcaption.sty, and the
24 % user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex.
25 %
26 % \fi
27 % \CheckSum{7220}
28 %
29 % \iffalse
30 %<*driver>
31 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
32 \ProvidesFile{caption.drv}[2010/01/14 v3.1m Implementation of the caption package]
33 \hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
34 %\errorcontextlines=3
35 %
36 \documentclass{ltxdoc}
37 \setlength\parindent{0pt}
38 \setlength\parskip{\smallskipamount}
39 %
40 %\let\ORIsubsection\subsection
41 %\def\subsection{\clearpage\ORIsubsection}
42 %
43 \makeatletter % make room for subsections like 2.16.14 in the TOC
44 %\newcommand*\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
45 \renewcommand*\l@subsubsection{\@dottedtocline{3}{3.8em}{3.6em}}
46 \makeatother
47 %
48 \usepackage{ifpdf}
49 \ifpdf
50 \usepackage{mathptmx,courier}
51 \usepackage[scaled=0.90]{helvet}
52 \addtolength\marginparwidth{15pt}
53 \fi
54 %
55 \usepackage{hypdoc}
56 \ifpdf\usepackage{hypdestopt}\fi
57 \hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}}
58 %
59 \usepackage[debug]{caption}[2009/10/09]
60 %
61 \DeclareRobustCommand*\eTeX{\texorpdfstring
62 {\leavevmode\hbox{$\varepsilon$}-\TeX}%
63 {e-TeX}}
64 \DeclareRobustCommand*\AmS{\texorpdfstring
65 {{\protect\usefont{OMS}{cmsy}{m}{n}A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}%
66 {AMS}}
67 \DeclareRobustCommand*\KOMAScript{\texorpdfstring
68 {\textsf{K\kern.05em O\kern.05em M\kern.05em A\kern.1em-\kern.1em Script}}%
69 {KOMA-Script}}
70 \DeclareRobustCommand*\NTG{NTG}
71 \DeclareRobustCommand*\SmF{SMF}
72 %
73 \begin{document}
74 \DocInput{caption.dtx}
75 \end{document}
76 %</driver>
77 % \fi
78 %
79 % \newcommand*\purerm[1]{{\upshape\mdseries\rmfamily #1}}
80 % \newcommand*\puresf[1]{{\upshape\mdseries\sffamily #1}}
81 % \newcommand*\purett[1]{{\upshape\mdseries\ttfamily #1}}
82 % \let\class\puresf \let\package\puresf
83 % \let\env\purett \let\opt\purett
84 %
85 % \def\thispackage{the \package{caption} package}
86 % \def\Thispackage{The \package{caption} package}
87 %
88 % \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
89 % \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
90 % \newcommand*\version[2][]{\textit{v#2}}
91 % \newcommand*\x{\discretionary{-}{}{}}
92 % \newcommand*\xx{\discretionary{}{}{}}
93 %
94 % \GetFileInfo{caption.drv}
95 % \let\docdate\filedate
96 % \GetFileInfo{caption.sty}
97 %
98 % \title{The Implementation of
99 % \texorpdfstring{\thispackage\thanks{%^^A
100 % This package has version number \fileversion, last revised \filedate.}}%^^A
101 % {the caption package}}
102 % \author{Axel Sommerfeldt\\
103 % \href{mailto:[email protected]}{\texttt{[email protected]}}}
104 % \date{\docdate}
105 % \maketitle
106 %
107 % \begin{abstract}
108 % \Thispackage\ consists of two parts -- the kernel
109 % (|caption3.sty|) and the main package (|caption.sty|).
110 %
111 % The kernel provides all the user commands and internal macros which are
112 % necessary for typesetting captions and setting parameters regarding these.
113 % While the standard \LaTeX\ document classes provide an internal command
114 % called |\@makecaption| and no options to control its behavior (except the
115 % vertical skips above and below the caption itself), we provide similar
116 % commands called |\caption@make| and |\caption@@make|, but with a lot of
117 % options which can be selected with |\captionsetup|.
118 % Loading the kernel part do not change the output of a \LaTeX\ document
119 % -- it just provides functionality which can be used by \LaTeXe\ packages
120 % which typesets captions, for example the \package{caption} and
121 % \package{subfig} packages.
122 %
123 % \Thispackage\ redefines the \LaTeX\ commands
124 % |\caption|, |\@caption|, and |\@makecaption| and maps the latter one to
125 % |\caption@@make|, giving the user the possibility to control the look \& feel
126 % of the captions from floating environments like |figure| and |table|.
127 % Furthermore it does similar to the caption stuff coming from other packages
128 % (like the \package{longtable} or \package{supertabular} package):
129 % Mapping the appropriate internal commands (like |\LT@makecaption| or
130 % |\ST@caption|) to the ones offered by the \package{caption3} kernel.
131 % So you can think of \thispackage\ as a layer package, it
132 % simply provides adaptation layers between the caption stuff coming from
133 % \LaTeXe\ or packages, and the caption stuff offered by the
134 % \package{caption3} kernel.
135 % \end{abstract}
136 %
137 % \section*{User manuals}
138 %
139 % This document is describing the code implementation only. The user
140 % documentation can be found in
141 % \nopagebreak\begin{quote}
142 % \begin{tabular}{ll}
143 % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/caption/caption-eng.pdf}%
144 % {\texttt{caption-eng.pdf}} & The English documentation \\
145 % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/caption/caption-rus.pdf}%
146 % {\texttt{caption-rus.pdf}} & The Russian documentation\footnotemark \\
147 % \href{ftp://dante.ctan.org/tex-archive/macros/latex/contrib/caption/caption-deu.pdf}%
148 % {\texttt{caption-deu.pdf}} & The German documentation \\
149 % \end{tabular}
150 % \footnotetext{Thanks a lot to Olga Lapko for this translation}
151 % \end{quote}
152 %
153 % \StopEventually{}
154 % \clearpage
155 % \tableofcontents
156 %
157 % \iffalse
158 % --------------------------------------------------------------------------- %
159 % \fi
160 %
161 % \DoNotIndex{\\,\_,\ ,\@@par}
162 % \DoNotIndex{\@bsphack}
163 % \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
164 % \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
165 % \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
166 % \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
167 % \DoNotIndex{\if@minipage,\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
168 % \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@minipagefalse,\@minipagetrue}
169 % \DoNotIndex{\@namedef,\@nameuse}
170 % \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
171 % \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setminipage,\@setpar}
172 % \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
173 % \DoNotIndex{\@testopt}
174 % \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
175 % \DoNotIndex{\p@,\z@}
176 % \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
177 % \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
178 % \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
179 % \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
180 % \DoNotIndex{\fi,\footnotesize,\global}
181 % \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
182 % \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
183 % \DoNotIndex{\ifx,\ignorespaces,\itshape}
184 % \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
185 % \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
186 % \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
187 % \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
188 % \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
189 % \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
190 % \DoNotIndex{\providecommand,\quad}
191 % \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
192 % \DoNotIndex{\rightskip,\rmfamily}
193 % \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
194 % \DoNotIndex{\small,\string,\space,\strut}
195 % \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
196 % \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
197 % \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
198 % \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
199 % \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
200 % \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
201 % \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
202 % \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
203 %
204 % \iffalse
205 % --------------------------------------------------------------------------- %
206 % \fi
207 %
208 % \setlength{\parskip}{0pt plus 1pt}
209 %
210 % \changes{v1.0}{1994/10/27}{First release}
211 % \changes{v1.1}{1994/11/03}{New option \cs{centerlast}}
212 % \changes{v1.2}{1994/11/28}{Support of the \package{float} package}
213 % \changes{v1.3}{1995/01/09}{Support of \cs{captionlabelfont} in subcaptions}
214 % \changes{v1.4}{1995/01/30}{New option \cs{nooneline}}
215 % \changes{v1.4b}{1995/04/05}{Bugfix release}
216 % \changes{v3.0}{2003/12/20}{Rewritten; many new commands and features}
217 % \changes{v3.0d}{2004/11/28}{Split into two packages:
218 % \package{caption} \& \package{caption3}}
219 %
220 % \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
221 %
222 % \iffalse
223 % --------------------------------------------------------------------------- %
224 % \fi
225 %
226 % \clearpage
227 % \section{Kernel}
228 % \iffalse
229 %<*kernel>
230 % \fi
231 %
232 % \subsection{Identification}
233 %
234 % \begin{macrocode}
235 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
236 \ProvidesPackage{caption3}[2010/01/14 v1.1m caption3 kernel (AR)]
237 % \end{macrocode}
238 %
239 % \subsection{Generic helpers}
240 %
241 % \begin{macro}{\@nameundef}
242 % This is the opposite to |\@namedef| which is offered by the \LaTeX\ kernel.
243 % We use it to remove the definition of some commands and keyval options after
244 % |\begin{document}| (to save \TeX\ memory) and to remove caption options defined
245 % with |\captionsetup|\oarg{type}.
246 % \begin{macrocode}
247 \providecommand*\@nameundef[1]{%
248 \expandafter\let\csname #1\endcsname\@undefined}
249 % \end{macrocode}
250 % \end{macro}
251 %
252 % \begin{macro}{\l@addto@macro}
253 % The \LaTeXe\ kernel offers the internal helper macro |\g@addto@macro| which
254 % globally adds tokens to existing macros, like in |\AtBeginDocument|.
255 % This is the same but it works local, not global
256 % (using \cs{edef} instead of \cs{xdef}).
257 % \begin{macrocode}
258 \providecommand\l@addto@macro[2]{%
259 \begingroup
260 \toks@\expandafter{#1#2}%
261 \edef\@tempa{\endgroup\def\noexpand#1{\the\toks@}}%
262 \@tempa}
263 % \end{macrocode}
264 % \end{macro}
265 %
266 % \begin{macro}{\bothIfFirst}
267 % \begin{macro}{\bothIfSecond}
268 % |\bothIfFirst| tests if the first argument is not empty, |\bothIfSecond|
269 % tests if the second argument is not empty. If yes both arguments get
270 % typeset, otherwise none of them.
271 % \begin{macrocode}
272 \def\bothIfFirst#1#2{%
273 \protected@edef\caption@tempa{#1}%
274 \ifx\caption@tempa\@empty \else
275 #1#2%
276 \fi}
277 % \end{macrocode}
278 % \begin{macrocode}
279 \def\bothIfSecond#1#2{%
280 \protected@edef\caption@tempa{#2}%
281 \ifx\caption@tempa\@empty \else
282 #1#2%
283 \fi}
284 % \end{macrocode}
285 % \end{macro}
286 % \end{macro}
287 %
288 % \begin{macro}{\caption@ifinlist}
289 % \changes{v3.1}{2007/07/29}{Rewritten}
290 % This helper macro checks if the first argument is in the comma separated
291 % list which is offered as second argument. So for example
292 % \begin{quote}
293 % |\caption@ifinlist{frank}{axel,frank,olga,steven}{yes}{no}|
294 % \end{quote}
295 % would expand to |yes|.
296 % \begin{macrocode}
297 \newcommand*\caption@ifinlist{%
298 \@expandtwoargs\caption@@ifinlist}
299 % \end{macrocode}
300 % \begin{macrocode}
301 \newcommand*\caption@@ifinlist[2]{%
302 \begingroup
303 \def\@tempa##1,#1,##2\@nil{%
304 \endgroup
305 \ifx\relax##2\relax
306 \expandafter\@secondoftwo
307 \else
308 \expandafter\@firstoftwo
309 \fi}%
310 \@tempa,#2,#1,\@nil}%
311 % \end{macrocode}
312 % \end{macro}
313 %
314 % \begin{macro}{\caption@ifin@list}
315 % \changes{v3.1}{2007/08/12}{This macro added}
316 % |\caption@ifin@list|\marg{cmd}\marg{list entry}\marg{yes}\marg{no}
317 % \begin{macrocode}
318 \newcommand*\caption@ifin@list[2]{%
319 \caption@ifempty@list#1%
320 {\@secondoftwo}%
321 {\@expandtwoargs\caption@@ifinlist{#2}{#1}}}
322 % \end{macrocode}
323 % \end{macro}
324 %
325 % \begin{macro}{\caption@g@addto@list}
326 % \changes{v3.1}{2007/07/29}{This macro added}
327 % |\caption@g@addto@list|\marg{cmd}\marg{list entry}
328 % \begin{macrocode}
329 \newcommand*\caption@g@addto@list[2]{%
330 \caption@ifempty@list#1{\gdef#1{#2}}{\g@addto@macro#1{,#2}}}
331 % \end{macrocode}
332 % \end{macro}
333 % \begin{macro}{\caption@l@addto@list}
334 % \changes{v3.1}{2007/07/29}{This macro added}
335 % |\caption@l@addto@list|\marg{cmd}\marg{list entry}
336 % \begin{macrocode}
337 \newcommand*\caption@l@addto@list[2]{%
338 \caption@ifempty@list#1{\def#1{#2}}{\l@addto@macro#1{,#2}}}
339 % \end{macrocode}
340 % \end{macro}
341 %
342 % \begin{macro}{\caption@g@removefrom@list}
343 % \changes{v3.1}{2007/07/29}{This macro added}
344 % |\caption@g@removefrom@list|\marg{cmd}\marg{list entry}
345 % \begin{macrocode}
346 \newcommand*\caption@g@removefrom@list[2]{%
347 \caption@l@removefrom@list#1{#2}%
348 \global\let#1#1}
349 % \end{macrocode}
350 % \end{macro}
351 % \begin{macro}{\caption@l@removefrom@list}
352 % \changes{v3.1}{2007/07/29}{This macro added}
353 % |\caption@l@removefrom@list|\marg{cmd}\marg{list entry}\par
354 % \Note[Caveat]{\meta{cmd} will be expanded during this process since
355 % \cs{@removeelement} is using \cs{edef} to build the new list!}
356 % \begin{macrocode}
357 \newcommand*\caption@l@removefrom@list[2]{%
358 \caption@ifempty@list#1{}{\@expandtwoargs\@removeelement{#2}#1#1}}
359 % \end{macrocode}
360 % \end{macro}
361 %
362 % \begin{macro}{\caption@for@list}
363 % \changes{v3.1}{2007/07/29}{This macro added}
364 % |\caption@for@list|\marg{cmd}\marg{code with \#1}
365 % \begin{macrocode}
366 \newcommand*\caption@for@list[2]{%
367 \caption@ifempty@list#1{}{%
368 \def\caption@tempb##1{#2}%
369 \@for\caption@tempa:=#1\do{%
370 \expandafter\caption@tempb\expandafter{\caption@tempa}}}}
371 % \end{macrocode}
372 % \end{macro}
373 %
374 % \begin{macro}{\caption@ifempty@list}
375 % \changes{v3.1}{2007/07/29}{This macro added}
376 % |\caption@ifempty@list|\marg{cmd}\marg{true}\marg{false}
377 % \begin{macrocode}
378 \newcommand*\caption@ifempty@list[1]{%
379 \ifx#1\@undefined
380 \expandafter\@firstoftwo
381 \else\ifx#1\relax
382 \expandafter\expandafter\expandafter\@firstoftwo
383 \else\ifx#1\@empty
384 \expandafter\expandafter\expandafter\expandafter
385 \expandafter\expandafter\expandafter\@firstoftwo
386 \else
387 \expandafter\expandafter\expandafter\expandafter
388 \expandafter\expandafter\expandafter\@secondoftwo
389 \fi\fi\fi}
390 % \end{macrocode}
391 % \end{macro}
392 %
393 % \pagebreak[3]
394 % \begin{macro}{\caption@setbool}
395 % \begin{macro}{\caption@set@bool}
396 % \changes{v3.1}{2007/04/05}{\cs{caption@set@bool}\marg{cmd}\marg{value} added}
397 % \begin{macro}{\caption@ifbool}
398 % \begin{macro}{\caption@undefbool}
399 % For setting and testing boolean options we offer these three helper macros:
400 % \begin{quote}
401 % |\caption@setbool|\marg{name}\marg{value}\\
402 % | |(with |value = false/true/no/yes/off/on/0/1|)\\
403 % |\caption@ifbool|\marg{name}\marg{if-clause}\marg{else-clause}\\
404 % |\caption@undefbool|\marg{name}
405 % \end{quote}
406 % \begin{macrocode}
407 \newcommand*\caption@setbool[1]{%
408 \expandafter\caption@set@bool\csname caption@if#1\endcsname}
409 % \end{macrocode}
410 % \begin{macrocode}
411 \newcommand*\caption@set@bool[2]{%
412 \caption@ifinlist{#2}{1,true,yes,on}{%
413 \let#1\@firstoftwo
414 }{\caption@ifinlist{#2}{0,false,no,off}{%
415 \let#1\@secondoftwo
416 }{%
417 \caption@Error{Undefined boolean value `#2'}%
418 }}}
419 % \end{macrocode}
420 % \begin{macrocode}
421 \newcommand*\caption@ifbool[1]{\@nameuse{caption@if#1}}
422 % \end{macrocode}
423 % \begin{macrocode}
424 \newcommand*\caption@undefbool[1]{\@nameundef{caption@if#1}}
425 % \end{macrocode}
426 % \end{macro}
427 % \end{macro}
428 % \end{macro}
429 % \end{macro}
430 %
431 % \begin{macro}{\caption@teststar}
432 % \changes{v3.1}{2007/05/08}{This macro and its usage added}
433 % \changes{v3.1e}{2007/10/28}{\cs{caption@teststar@} added}
434 % |\caption@teststar|\marg{cmd}\marg{star arg}\marg{non-star arg}\\
435 % |\caption@teststar@|\marg{cmd}\marg{star arg}\marg{non-star arg}
436 % \begin{macrocode}
437 \newcommand*\caption@teststar[3]{\@ifstar{#1{#2}}{#1{#3}}}
438 % \end{macrocode}
439 % \begin{macrocode}
440 \newcommand*\caption@teststar@[3]{%
441 \@ifstar{#1{#2}}{\caption@ifatletter{#1{#2}}{#1{#3}}}}
442 \AtBeginDocument{\let\caption@teststar@\caption@teststar}
443 % \end{macrocode}
444 % \begin{macrocode}
445 \newcommand*\caption@ifatletter{%
446 \ifnum\the\catcode`\@=11
447 \expandafter\@firstoftwo
448 \else
449 \expandafter\@secondoftwo
450 \fi}
451 \AtBeginDocument{\let\caption@ifatletter\@secondoftwo}
452 % \end{macrocode}
453 % \end{macro}
454 %
455 % \begin{macro}{\caption@withoptargs}
456 % \changes{v3.1}{2007/08/12}{This macro added}
457 % |\caption@withoptargs|\marg{cmd}
458 % \begin{macrocode}
459 \newcommand*\caption@withoptargs[1]{%
460 \@ifstar
461 {\def\caption@tempa{*}\caption@@withoptargs#1}%
462 {\def\caption@tempa{}\caption@@withoptargs#1}}
463 % \end{macrocode}
464 % \begin{macrocode}
465 \def\caption@@withoptargs#1{%
466 \@ifnextchar[%]
467 {\caption@@@withoptargs#1}%
468 {\caption@@@@withoptargs#1}}
469 % \end{macrocode}
470 % \begin{macrocode}
471 \def\caption@@@withoptargs#1[#2]{%
472 \l@addto@macro\caption@tempa{[{#2}]}%
473 \caption@@withoptargs#1}
474 % \end{macrocode}
475 % \begin{macrocode}
476 \def\caption@@@@withoptargs#1{%
477 \expandafter#1\expandafter{\caption@tempa}}
478 % \end{macrocode}
479 % \end{macro}
480 %
481 % \begin{macro}{\caption@CheckCommand}
482 % \changes{v3.1}{2007/04/10}{This macro added}
483 % \begin{macro}{\caption@IfCheckCommand}
484 % \changes{v3.1}{2007/04/10}{This macro added}
485 % \changes{v3.1i}{2008/08/02}{Revised so \cs{next} is no longer used}
486 % |\caption@CheckCommand|\marg{macro}\marg{definition of macro}\par
487 % checks if a command already exists, with the same definition.
488 % It can be used more-than-once to check if one of multiple definitions will
489 % finally match.
490 % (It redefines itself later on to |\@gobbletwo| if the two commands match
491 % fine, making further checks harmless.)\par
492 % |\caption@IfCheckCommand|\marg{true}\marg{false}\par
493 % will execute the \meta{true} code if one match was finally given,
494 % the \meta{false} code otherwise.
495 % (It simply checks if |\caption@CheckCommand| is |\@gobbletwo| and
496 % restores the starting definition of |\caption@CheckCommand|.)
497 % \begin{macrocode}
498 \newcommand\caption@DoCheckCommand[2]{%
499 \begingroup
500 \let\@tempa#1%
501 #2%
502 \ifx\@tempa#1%
503 \endgroup
504 \let\caption@CheckCommand\@gobbletwo
505 \else
506 \endgroup
507 \fi}
508 \@onlypreamble\caption@DoCheckCommand
509 % \end{macrocode}
510 % \begin{macrocode}
511 \let\caption@CheckCommand\caption@DoCheckCommand
512 \@onlypreamble\caption@CheckCommand
513 % \end{macrocode}
514 % \begin{macrocode}
515 \newcommand*\caption@IfCheckCommand{%
516 \ifx\caption@CheckCommand\@gobbletwo
517 \let\caption@CheckCommand\caption@DoCheckCommand
518 \expandafter\@firstoftwo
519 \else
520 \expandafter\@secondoftwo
521 \fi}
522 \@onlypreamble\caption@IfCheckCommand
523 % \end{macrocode}
524 % \end{macro}
525 % \end{macro}
526 %
527 % \begin{macro}{\caption@AtBeginDocument}
528 % \changes{v3.1}{2007/04/13}{This macro and its usage added}
529 % \changes{v3.1l}{2010/01/09}{Adapted to the combine document class}
530 % |\caption@AtBeginDocument*|\marg{code}\\
531 % Same as |\AtBeginDocument| but the execution of code
532 % will be surrounded by two |\PackageInfo|s.
533 % The starred variant causes the code to be executed after all code
534 % specified using the non-starred variant.
535 % \begin{macrocode}
536 \let\caption@begindocumenthook\@empty
537 \let\caption@@begindocumenthook\@empty
538 % \end{macrocode}
539 % \begin{macrocode}
540 \def\caption@AtBeginDocument{%
541 \caption@teststar\g@addto@macro
542 \caption@@begindocumenthook\caption@begindocumenthook}
543 %\@onlypreamble\caption@AtBeginDocument
544 % \end{macrocode}
545 % \begin{macrocode}
546 \AtBeginDocument{%
547 \PackageInfo{caption}{Begin \noexpand\AtBeginDocument code\@gobble}%
548 % \end{macrocode}
549 % \begin{macrocode}
550 \def\caption@AtBeginDocument{%
551 \@ifstar{\g@addto@macro\caption@@begindocumenthook}\@firstofone}%
552 \caption@begindocumenthook
553 \let\caption@begindocumenthook\relax
554 % \end{macrocode}
555 % \begin{macrocode}
556 \def\caption@AtBeginDocument{%
557 \@ifstar\@firstofone\@firstofone}%
558 \caption@@begindocumenthook
559 \let\caption@@begindocumenthook\relax
560 % \end{macrocode}
561 % \begin{macrocode}
562 \PackageInfo{caption}{End \noexpand\AtBeginDocument code\@gobble}}
563 % \end{macrocode}
564 % \end{macro}
565 %
566 % \subsection{Errors}
567 %
568 % \begin{macro}{\caption@Warning}
569 % \changes{v3.1c}{2007/10/14}{This macro added, will now be used for warnings}
570 % \begin{macro}{\caption@WarningNoLine}
571 % \changes{v3.1c}{2007/10/14}{This macro added, will now be used for warnings}
572 % \begin{macro}{\caption@Error}
573 % \changes{v3.0l}{2007/01/20}{This macro added, will now be used for errors}
574 % \changes{v3.0q}{2007/04/11}{Renamed from \cs{caption@error} to \cs{caption@Error}}
575 % \changes{v3.1b}{2007/09/18}{Usage of \cs{caption@Package} removed}
576 % \begin{macro}{\caption@KV@err}
577 % \changes{v3.1b}{2007/09/18}{This macro added}
578 % |\caption@Error|\marg{message}
579 % \begin{macrocode}
580 \newcommand*\caption@Warning[1]{%
581 \caption@WarningNoLine{#1\on@line}}
582 \newcommand*\caption@WarningNoLine[1]{%
583 \PackageWarning{caption}{#1.^^J\caption@wh\@gobbletwo}}
584 \newcommand*\caption@Error[1]{%
585 \PackageError{caption}{#1}\caption@eh}
586 \let\caption@KV@err\caption@Error
587 % \end{macrocode}
588 % \end{macro}
589 % \end{macro}
590 % \end{macro}
591 % \end{macro}
592 %
593 % \begin{macro}{\caption@wh}
594 % \begin{macro}{\caption@eh}
595 % At the moment we only offer these two simple warning resp. error helpers.
596 % \begin{macrocode}
597 \newcommand*\caption@wh{%
598 See the caption package documentation for explanation.}
599 \newcommand*\caption@eh{%
600 If you do not understand this error, please take a closer look\MessageBreak
601 at the documentation of the `caption' package, especially the\MessageBreak
602 section about errors.\MessageBreak\@ehc}
603 % \end{macrocode}
604 % \end{macro}
605 % \end{macro}
606 %
607 % \subsection{Using the keyval package}
608 %
609 % We need the \package{keyval} package for option handling, so we load it here.
610 % \begin{macrocode}
611 \RequirePackage{keyval}[1997/11/10]
612 % \end{macrocode}
613 %
614 % \begin{macro}{\undefine@key}
615 % |\undefine@key|\marg{family}\marg{key}\par
616 % This helper macro is the opposite of |\define@key|, it removes a keyval
617 % definition.
618 % \begin{macrocode}
619 \providecommand*\undefine@key[2]{%
620 \@nameundef{KV@#1@#2}\@nameundef{KV@#1@#2@default}}
621 % \end{macrocode}
622 % \end{macro}
623 %
624 % \begin{macro}{\@onlypreamble@key}
625 % \changes{v3.1}{2007/07/22}{This macro added}
626 % \changes{v3.1e}{2007/11/01}{\cs{KV@err} will be used now instead of \cs{@notprerr}}
627 % |\onlypreamble@key|\marg{family}\marg{key}\par
628 % Analogous to |\@onlypreamble| from \LaTeXe.
629 % \begin{macrocode}
630 \providecommand*\@preamble@keys{}
631 \providecommand*\@onlypreamble@key[2]{\@cons\@preamble@keys{{#1}{#2}}}
632 \@onlypreamble\@onlypreamble@key
633 \@onlypreamble\@preamble@keys
634 % \end{macrocode}
635 % \begin{macrocode}
636 \providecommand*\@notprerr@key[1]{\KV@err{Can be used only in preamble}}
637 % \end{macrocode}
638 % \begin{macrocode}
639 \caption@AtBeginDocument*{%
640 \def\@elt#1#2{\expandafter\let\csname KV@#1@#2\endcsname\@notprerr@key}%
641 \@preamble@keys
642 \let\@elt\relax}
643 % \end{macrocode}
644 % \end{macro}
645 %
646 % \begin{macro}{\DeclareCaptionOption}
647 % |\DeclareCaptionOption|\marg{option}\oarg{default value}\marg{code}\\
648 % |\DeclareCaptionOption*|\marg{option}\oarg{default value}\marg{code}\par
649 % We declare our options using these commands (instead of using
650 % |\DeclareOption| offered by \LaTeXe), so the keyval package is used.
651 % The starred form makes the option available during the lifetime of the
652 % current package only, so they can be used with |\usepackage|, but
653 % \emph{not} with |\captionsetup| later on.
654 % \begin{macrocode}
655 \newcommand*\DeclareCaptionOption{%
656 \caption@teststar\caption@declareoption\AtEndOfPackage\@gobble}
657 \@onlypreamble\DeclareCaptionOption
658 % \end{macrocode}
659 % \begin{macrocode}
660 \newcommand*\caption@declareoption[2]{%
661 #1{\undefine@key{caption}{#2}}\define@key{caption}{#2}}
662 \@onlypreamble\caption@declareoption
663 % \end{macrocode}
664 % \end{macro}
665 %
666 % \begin{macro}{\DeclareCaptionOptionNoValue}
667 % \changes{v3.1c}{2007/10/06}{This macro added}
668 % |\DeclareCaptionOptionNoValue|\marg{option}\marg{code}\\
669 % |\DeclareCaptionOptionNoValue*|\marg{option}\marg{code}\par
670 % Same as \cs{DeclareCaptionOption} but issues an error if a value is given.
671 % \begin{macrocode}
672 \newcommand*\DeclareCaptionOptionNoValue{%
673 \caption@teststar\caption@declareoption@novalue\AtEndOfPackage\@gobble}
674 \@onlypreamble\DeclareCaptionOptionNoValue
675 % \end{macrocode}
676 % \begin{macrocode}
677 \newcommand\caption@declareoption@novalue[3]{%
678 \caption@declareoption{#1}{#2}[\KV@err]{%
679 \caption@option@novalue{#2}{##1}{#3}}}
680 \@onlypreamble\caption@declareoption@novalue
681 % \end{macrocode}
682 % \begin{macrocode}
683 \newcommand*\caption@option@novalue[2]{%
684 \ifx\KV@err#2%
685 \expandafter\@firstofone
686 \else
687 \KV@err{No value allowed for #1}%
688 \expandafter\@gobble
689 \fi}
690 % \end{macrocode}
691 % \end{macro}
692 %
693 % \begin{macro}{\ifcaptionsetup@star}
694 % \changes{v3.1g}{2008/01/12}{This macro added}
695 % If the starred form of |\captionsetup| is used, this will be set to |true|.
696 % (It will be reset to |false| at the end of |\caption@setkeys|.)
697 % \begin{macrocode}
698 \newif\ifcaptionsetup@star
699 % \end{macrocode}
700 % \end{macro}
701 %
702 % \begin{macro}{\captionsetup}
703 % \changes{v3.0a}{2004/01/17}{Bugfix: Missing \% added}
704 % \changes{v3.1}{2007/07/22}{Starred-variant added}
705 % \changes{v3.1e}{2007/07/27}{Inside packages the starred variant will be used automatically}
706 % \changes{v3.1f}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
707 % \changes{v3.1g}{2008/01/12}{\cs{ifcaptionsetup@star} will be set now}
708 % |\captionsetup|\oarg{type}\marg{keyval-list of options}\\
709 % |\captionsetup*|\oarg{type}\marg{keyval-list of options}\par
710 % If the optional argument `type' is specified, we simply save or append
711 % the option list, otherwise we `execute' it with |\setkeys|.
712 % (The non-starred variant issues a warning if \meta{keyval-list of options}
713 % is not used later on.)
714 % \Note{The starred variant will be used inside packages automatically.}
715 % \begin{macrocode}
716 \newcommand*\captionsetup{%
717 \caption@teststar@\@captionsetup\@gobble\@firstofone}
718 % \end{macrocode}
719 % \begin{macrocode}
720 \newcommand*\@captionsetup[1]{%
721 \captionsetup@startrue#1\captionsetup@starfalse
722 \@ifnextchar[\caption@setup@options\caption@setup}
723 % \end{macrocode}
724 % \begin{macrocode}
725 \newcommand*\caption@setup{\caption@setkeys{caption}}
726 % \end{macrocode}
727 % \begin{macrocode}
728 \def\caption@setup@options[#1]#2{%
729 \@bsphack
730 \ifcaptionsetup@star\captionsetup@starfalse\else\caption@addtooptlist{#1}\fi
731 \expandafter\caption@l@addto@list\csname caption@opt@#1\endcsname{#2}%
732 \@esphack}
733 % \end{macrocode}
734 % \end{macro}
735 %
736 % \begin{macro}{\clearcaptionsetup}
737 % \changes{v3.1}{2007/07/29}{Optional argument added}
738 % \changes{v3.1}{2007/08/17}{Starred variant added}
739 % \changes{v3.1e}{2007/07/27}{Inside packages the starred variant will be used automatically}
740 % \changes{v3.1f}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
741 % |\clearcaptionsetup|\oarg{option}\marg{type}\\
742 % |\clearcaptionsetup*|\oarg{option}\marg{type}\par
743 % This removes the saved option list associated with \meta{type}.
744 % If \meta{option} is given, only this option will be removed from the list.
745 % (The starred variant does not issue warnings.)
746 % \Note{The starred variant will be used inside packages automatically.}
747 % \begin{macrocode}
748 \newcommand*\clearcaptionsetup{%
749 \caption@teststar@\@clearcaptionsetup\@gobble\@firstofone}
750 % \end{macrocode}
751 % \begin{macrocode}
752 \newcommand*\@clearcaptionsetup[1]{%
753 \let\caption@tempa#1%
754 \@testopt\@@clearcaptionsetup{}}
755 % \end{macrocode}
756 % \begin{macrocode}
757 \def\@@clearcaptionsetup[#1]#2{%
758 \@bsphack
759 \expandafter\caption@ifempty@list\csname caption@opt@#2\endcsname
760 {\caption@tempa{\caption@Warning{Option list `#2' undefined}}}%
761 {\ifx,#1,%
762 \caption@clearsetup{#2}%
763 \else
764 \caption@@removefromsetup{#1}{#2}%
765 \fi}%
766 \@esphack}
767 % \end{macrocode}
768 % \begin{macrocode}
769 \newcommand*\caption@clearsetup[1]{%
770 \caption@removefromoptlist{#1}%
771 \@nameundef{caption@opt@#1}}
772 % \end{macrocode}
773 % \begin{macrocode}
774 \newcommand*\caption@removefromsetup{%
775 \let\caption@tempa\@gobble
776 \caption@@removefromsetup}
777 % \end{macrocode}
778 % \begin{macrocode}
779 \newcommand*\caption@@removefromsetup[2]{%
780 \expandafter\let\expandafter\@tempa\csname caption@opt@#2\endcsname
781 \expandafter\let\csname caption@opt@#2\endcsname\@undefined
782 \def\@tempb##1=##2\@nil{##1}%
783 \edef\@tempc{#1}%
784 \@for\@tempa:=\@tempa\do{%
785 \edef\@tempd{\expandafter\@tempb\@tempa=\@nil}%
786 \ifx\@tempd\@tempc
787 \let\caption@tempa\@gobble
788 \else
789 \expandafter\expandafter\expandafter\caption@l@addto@list
790 \expandafter\csname caption@opt@#2\expandafter\endcsname
791 \expandafter{\@tempa}%
792 \fi}%
793 \expandafter\caption@ifempty@list\csname caption@opt@#2\endcsname
794 {\caption@removefromoptlist{#2}}{}%
795 \caption@tempa{\caption@Warning{%
796 Option `#1' was not in list `#2'\MessageBreak}}}
797 % \end{macrocode}
798 % \end{macro}
799 %
800 % \begin{macro}{\showcaptionsetup}
801 % \changes{v3.0e}{2005/05/03}{Optimized for memory usage}
802 % \changes{v3.1}{2007/07/29}{Bugfix: Does not expand option list anymore}
803 % \changes{v3.1f}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
804 % |\showcaptionsetup|\oarg{package}\marg{type}\par
805 % This comes for debugging issues: It shows the saved option list which
806 % is associated with \meta{type}.
807 % \begin{macrocode}
808 \newcommand*\showcaptionsetup[2][\@firstofone]{%
809 \@bsphack
810 \GenericWarning{}{%
811 #1 Caption Info: Option list on `#2'\MessageBreak
812 #1 Caption Data: \@ifundefined{caption@opt@#2}{%
813 -none-%
814 }{%
815 {\expandafter\expandafter\expandafter\strip@prefix
816 \expandafter\meaning\csname caption@opt@#2\endcsname}%
817 }}%
818 \@esphack}
819 % \end{macrocode}
820 % \end{macro}
821 %
822 % \changes{v3.1}{2007/07/02}{Option \opt{options=} added}
823 % \begin{macrocode}
824 \DeclareCaptionOption{options}{\caption@setoptions{#1}}
825 % \end{macrocode}
826 %
827 % \begin{macro}{\caption@setoptions}
828 % \changes{v3.0i}{2006/01/03}{Optional argument added}
829 % \changes{v3.0j}{2006/01/26}{Revised}
830 % \changes{v3.0l}{2007/01/30}{Optional argument removed}
831 % \changes{v3.1}{2007/04/11}{Usage of \cs{clearcaptionsetup} added}
832 % \changes{v3.1}{2007/05/09}{Renamed from \cs{caption@settype} to \cs{caption@setoptions}}
833 % \changes{v3.1f}{2007/12/03}{Definition of \cs{caption@iftypewarning} removed}
834 % |\caption@setoptions|\marg{type or environment or\ldots}\par
835 % Caption options which have been saved with |\captionsetup|\oarg{type} can
836 % be executed by using this command.
837 % It simply executes the saved option list (and clears it afterwards),
838 % if there is any.
839 % \begin{macrocode}
840 \newcommand*\caption@setoptions[1]{%
841 \caption@Debug{options=#1}%
842 \expandafter\let\expandafter\caption@opt\csname caption@opt@#1\endcsname
843 \ifx\caption@opt\relax \else
844 \caption@xsetup\caption@opt
845 \caption@clearsetup{#1}%
846 \fi}
847 % \end{macrocode}
848 % \begin{macrocode}
849 \newcommand*\caption@xsetup[1]{\expandafter\caption@setup\expandafter{#1}}
850 % \end{macrocode}
851 % \end{macro}
852 %
853 % \begin{macro}{\caption@addtooptlist}
854 % \changes{v3.1}{2007/07/22}{This macro added}
855 % \begin{macro}{\caption@removefromoptlist}
856 % \changes{v3.1}{2007/07/22}{This macro added}
857 % \changes{v3.1j}{2008/08/24}{Fatal typo corrected}
858 % |\caption@addtooptlist|\marg{type}\\
859 % |\caption@removefromoptlist|\marg{type}\par
860 % Adds or removes an \meta{type} to the list of unused caption options.
861 % Note that the catcodes of \meta{type} are sanitized here so removing
862 % \meta{type} from the list do not fail when the \package{float} package
863 % is used (since |\float@getstyle| gives a result which tokens have catcode
864 % 12 $=$ ``other'').
865 % \begin{macrocode}
866 \newcommand*\caption@addtooptlist[1]{%
867 \@ifundefined{caption@opt@#1@lineno}{%
868 \caption@dooptlist\caption@g@addto@list{#1}%
869 \expandafter\xdef\csname caption@opt@#1@lineno\endcsname{\the\inputlineno}%
870 }{}}
871 % \end{macrocode}
872 % \begin{macrocode}
873 \newcommand*\caption@removefromoptlist[1]{%
874 \caption@dooptlist\caption@g@removefrom@list{#1}%
875 \global\expandafter\let\csname caption@opt@#1@lineno\endcsname\@undefined}
876 % \end{macrocode}
877 % \begin{macrocode}
878 \newcommand*\caption@dooptlist[2]{%
879 \begingroup
880 \edef\@tempa{#2}\@onelevel@sanitize\@tempa
881 \expandafter#1\expandafter\caption@optlist\expandafter{\@tempa}%
882 \endgroup}
883 % \end{macrocode}
884 % \begin{macrocode}
885 \AtEndDocument{%
886 \caption@for@list\caption@optlist{%
887 \caption@WarningNoLine{%
888 Unused \string\captionsetup[#1]
889 on input line \csname caption@opt@#1@lineno\endcsname}}}
890 % \end{macrocode}
891 % \end{macro}
892 % \end{macro}
893 %
894 % \begin{macro}{\caption@setkeys}
895 % \changes{v3.0i}{2006/01/03}{This macro added}
896 % \changes{v3.0l}{2007/01/20}{Bugfix: Usage of \cs{caption@keydepth} added}
897 % \changes{v3.0l}{2007/01/30}{Optional argument added}
898 % \changes{v3.0p}{2007/04/08}{\cs{caption@keydepth} is now a command instead of a counter}
899 % \changes{v3.1b}{2007/09/18}{Usage of \cs{caption@Package} removed, we use \cs{caption@KV@err} instead}
900 % \changes{v3.1f}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
901 % \changes{v3.1g}{2008/01/12}{\cs{captionsetup@starfalse} added}
902 % \changes{v3.1k}{2009/09/30}{Bugfix 09-09-29: Missing error handler will be defined automatically}
903 % |\caption@setkeys|\oarg{package}\marg{family}\marg{key-values}\par
904 % This one simply calls |\setkeys|\marg{family}\marg{key-values}
905 % but lets the error messages not refer to the \package{keyval} package,
906 % but to the \meta{package} package instead.
907 % \begin{macrocode}
908 \newcommand*\caption@setkeys{\@dblarg\caption@@setkeys}
909 % \end{macrocode}
910 % \begin{macrocode}
911 \long\def\caption@@setkeys[#1]#2#3{%
912 \@bsphack
913 % \end{macrocode}
914 % \begin{macrocode}
915 \expandafter\let\csname ORI@KV@err\caption@keydepth\endcsname\KV@err
916 \expandafter\let\csname ORI@KV@errx\caption@keydepth\endcsname\KV@errx
917 \expandafter\let\expandafter\KV@err\csname #1@KV@err\endcsname
918 \ifx\KV@err\relax
919 \def\KV@err##1{\PackageError{#1}{##1}{%
920 See the #1 package documentation for explanation.}}%
921 \fi
922 \let\KV@errx\KV@err
923 \edef\caption@keydepth{\caption@keydepth i}%
924 % \end{macrocode}
925 % \begin{macrocode}
926 \caption@Debug{\protect\setkeys{#2}{#3}}%
927 \setkeys{#2}{#3}%
928 % \end{macrocode}
929 % \begin{macrocode}
930 \edef\caption@keydepth{\expandafter\@gobble\caption@keydepth}%
931 \expandafter\let\expandafter\KV@err\csname ORI@KV@err\caption@keydepth\endcsname
932 \expandafter\let\expandafter\KV@errx\csname ORI@KV@errx\caption@keydepth\endcsname
933 % \end{macrocode}
934 % \begin{macrocode}
935 \ifx\caption@keydepth\@empty \captionsetup@starfalse \fi
936 % \end{macrocode}
937 % \begin{macrocode}
938 \@esphack}
939 % \end{macrocode}
940 % \begin{macrocode}
941 \let\caption@keydepth\@empty
942 % \end{macrocode}
943 % \end{macro}
944 %
945 % \begin{macro}{\caption@ExecuteOptions}
946 % \changes{v3.1}{2007/07/15}{This macro added}
947 % |\caption@ExecuteOptions|\marg{family}\marg{key-values}\par
948 % We execute our options using the keyval interface, so we use this one
949 % instead of |\ExecuteOptions| offered by \LaTeXe.
950 % \begin{macrocode}
951 \newcommand*\caption@ExecuteOptions[2]{%
952 \@expandtwoargs\caption@setkeys{#1}{#2}}%
953 \@onlypreamble\caption@ExecuteOptions
954 % \end{macrocode}
955 % \end{macro}
956 %
957 % \begin{macro}{\caption@ProcessOptions}
958 % \changes{v3.0a}{2004/01/23}{Bugfix, see
959 % \purett{news:[email protected]} for details}
960 % \changes{v3.0i}{2006/01/03}{Improvement, uses \cs{caption@setkeys}
961 % instead of \cs{setkeys}}
962 % \changes{v3.0j}{2006/02/23}{Bugfix, now processes only those global
963 % options which have a default value}
964 % \changes{v3.0l}{2007/01/30}{\cs{ProcessOptionsWithKV} renamed to
965 % \cs{caption@ProcessOptions} and moved from the package to the kernel}
966 % \changes{v3.1}{2007/04/17}{Star variant added}
967 % |\caption@ProcessOptions*|\marg{family}\par
968 % We process our options using the keyval package, so we use this one
969 % instead of |\ProcessOptions| offered by \LaTeXe.
970 % The starred variant do not process the global options.
971 % (This code was taken from the \package{hyperref} package\cite{hyperref}
972 % \version{6.74} and improved.)
973 % \begin{macrocode}
974 \newcommand*\caption@ProcessOptions{%
975 \caption@teststar\caption@@ProcessOptions\@gobble\@firstofone}
976 \@onlypreamble\caption@ProcessOptions
977 % \end{macrocode}
978 % \begin{macrocode}
979 \newcommand*\caption@@ProcessOptions[2]{%
980 \let\@tempc\relax
981 \let\caption@tempa\@empty
982 #1{% \@firstofone -or- \@gobble
983 \@for\CurrentOption:=\@classoptionslist\do{%
984 \@ifundefined{KV@#2@\CurrentOption}{}{%
985 \@ifundefined{KV@#2@\CurrentOption @default}{%
986 \PackageInfo{#2}{Global option `\CurrentOption' ignored}%
987 }{%
988 \PackageInfo{#2}{Global option `\CurrentOption' processed}%
989 \edef\caption@tempa{\caption@tempa,\CurrentOption,}%
990 \@expandtwoargs\@removeelement\CurrentOption
991 \@unusedoptionlist\@unusedoptionlist
992 }%
993 }%
994 }%
995 \let\CurrentOption\@empty
996 }%
997 \caption@ExecuteOptions{#2}{\caption@tempa\@ptionlist{\@currname.\@currext}}%
998 \AtEndOfPackage{\let\@unprocessedoptions\relax}}
999 \@onlypreamble\caption@@ProcessOptions
1000 % \end{macrocode}
1001 % \end{macro}
1002 %
1003 % \subsection{Margin resp. width}
1004 % \changes{v3.0p}{2007/04/01}{\cs{captionmarginx} renamed to \cs{captionmargin@}}
1005 % \changes{v3.0p}{2007/04/03}{Option `twoside' added}
1006 % \changes{v3.1}{2007/08/11}{Options `margin*', `minmargin', and `maxmargin' added}
1007 % \changes{v3.1f}{2007/11/10}{Option `oneside' added}
1008 %
1009 % \begin{macro}{\captionmargin}
1010 % \begin{macro}{\captionwidth}
1011 % |\captionmargin| and |\captionwidth| contain the extra margin
1012 % resp. the total width used for captions. Please never set these values in
1013 % a direct way, they are just accessible in user documents to provide
1014 % compatibility to \version{1.x}.\par
1015 % Note that we can only set one value at a time, `margin' \emph{or} `width'.
1016 % If |\captionwidth| is not zero we will take this value afterwards,
1017 % otherwise |\captionmargin| and |\captionmargin@|.
1018 % \begin{macrocode}
1019 \newdimen\captionmargin
1020 \newdimen\captionmargin@
1021 \newdimen\captionwidth
1022 % \end{macrocode}
1023 % \end{macro}
1024 % \end{macro}
1025 %
1026 % \begin{macrocode}
1027 \DeclareCaptionOption{margin}{\setcaptionmargin{#1}}
1028 \DeclareCaptionOption{margin*}{\setcaptionmargin*{#1}}
1029 \DeclareCaptionOption{width}{\setcaptionwidth{#1}}
1030 \DeclareCaptionOption{twoside}[1]{\caption@set@bool\caption@iftwoside{#1}}
1031 \DeclareCaptionOptionNoValue{oneside}{\caption@set@bool\caption@iftwoside0}
1032 % \end{macrocode}
1033 % \begin{macrocode}
1034 \DeclareCaptionOption{minmargin}{\caption@setoptcmd\caption@minmargin{#1}}
1035 \DeclareCaptionOption{maxmargin}{\caption@setoptcmd\caption@maxmargin{#1}}
1036 % \end{macrocode}
1037 %
1038 % \begin{macro}{\setcaptionmargin}
1039 % \changes{v3.0h}{2005/10/24}{Renamed from \cs{caption@setmargin} to \cs{setcaptionmargin}}
1040 % \changes{v3.0h}{2005/10/24}{\cs{setcaptionmargin} enhanced so it can take
1041 % left+right margin}
1042 % \changes{v3.1}{2007/08/11}{Starred variant added}
1043 % \changes{v3.1}{2007/08/12}{\cs{setlength}\cs{captionmargin} \&
1044 % \cs{setlength}\cs{captionmargin@} swapped so
1045 % `\texttt{margin*=}\cs{captionmargin}' works in singleline options}
1046 % |\setcaptionmargin|\marg{amount}\\
1047 % |\setcaptionmargin*|\marg{amount}\par
1048 % Please never use them in user documents, it's just there to
1049 % provide compatibility to the \package{caption2} package.
1050 % \begin{macrocode}
1051 \newcommand*\setcaptionmargin{%
1052 \caption@teststar\caption@setmargin\@gobble\@firstofone}
1053 % \end{macrocode}
1054 % \begin{macrocode}
1055 \newcommand*\caption@setmargin[2]{%
1056 #1{\captionwidth\z@}%
1057 \caption@@setmargin#2,#2,\@nil}
1058 % \end{macrocode}
1059 % \begin{macrocode}
1060 \def\caption@@setmargin#1,#2,#3\@nil{%
1061 \setlength\captionmargin@{#2}%
1062 \setlength\captionmargin{#1}%
1063 \addtolength\captionmargin@{-\captionmargin}}
1064 % \end{macrocode}
1065 % \end{macro}
1066 %
1067 % \begin{macro}{\setcaptionwidth}
1068 % \changes{v3.0h}{2005/10/24}{Renamed from \cs{caption@setwidth} to \cs{setcaptionwidth}}
1069 % |\setcaptionwidth|\marg{amount}\par
1070 % Please never use this in user documents, it's just there to
1071 % provide compatibility to the \package{caption2} package.
1072 % \begin{macrocode}
1073 \newcommand*\setcaptionwidth{%
1074 \captionmargin\z@
1075 \captionmargin@\z@
1076 \setlength\captionwidth}
1077 % \end{macrocode}
1078 % \end{macro}
1079 %
1080 % \begin{macro}{\caption@counter}
1081 % \changes{v3.0p}{2007/04/03}{This counter added}
1082 % \changes{v3.1e}{2007/10/28}{Renamed to \cs{caption@thecounter}; \cs{caption@stepcounter} added}
1083 % This counter numbers the captions. At the moment it will be used inside
1084 % |\caption@ifoddpage| only.
1085 % \begin{macrocode}
1086 \newcommand*\caption@thecounter{0}
1087 % \end{macrocode}
1088 % \begin{macrocode}
1089 \newcommand*\caption@stepcounter{%
1090 \@tempcnta\caption@thecounter
1091 \advance\@tempcnta\@ne
1092 \xdef\caption@thecounter{\the\@tempcnta}}
1093 % \end{macrocode}
1094 % \end{macro}
1095 %
1096 % \begin{macro}{\caption@newlabel}
1097 % \changes{v3.0p}{2007/04/03}{This macro added}
1098 % This command is a modified version of |\newlabel| from \LaTeX2e.
1099 % It will be written to the \texttt{.aux} file to
1100 % pass label information from one run to another.
1101 % (We use it inside |\caption@ifoddpage| and |\caption@ragged|.)
1102 % \begin{macrocode}
1103 \newcommand*\caption@newlabel{\@newl@bel{caption@r}}
1104 % \end{macrocode}
1105 % \end{macro}
1106 %
1107 % \begin{macro}{\caption@thepage}
1108 % \changes{v3.0p}{2007/04/03}{This macro added}
1109 % This command is a modified version of |\thepage| from \LaTeX2e.
1110 % It will be used inside |\caption@ifoddpage| only.
1111 % \begin{macrocode}
1112 \newcommand*\caption@thepage{\the\c@page}
1113 % \end{macrocode}
1114 % \end{macro}
1115 %
1116 % \begin{macro}{\caption@label}
1117 % \changes{v3.1}{2007/09/01}{This macro added}
1118 % \changes{v3.1f}{2007/12/03}{Definition of \cs{caption@newlabel} in AUX file added}
1119 % This command is a modified version of |\label| from \LaTeX2e.
1120 % It will be used inside |\caption@ifoddpage| and |\FP@helpNote|.
1121 % \begin{macrocode}
1122 \newcommand*\caption@label[1]{%
1123 \caption@@label
1124 \protected@write\@auxout{\let\caption@thepage\relax}%
1125 {\string\caption@newlabel{#1}{\caption@thepage}}}
1126 % \end{macrocode}
1127 % \begin{macrocode}
1128 \newcommand*\caption@@label{%
1129 \global\let\caption@@label\relax
1130 \protected@write\@auxout{}%
1131 {\string\providecommand*\string\caption@newlabel[2]{}}}
1132 % \end{macrocode}
1133 % \end{macro}
1134 %
1135 % \begin{macro}{\caption@pageref}
1136 % \changes{v3.1}{2007/09/01}{This macro added}
1137 % \changes{v3.1k}{2009/10/09}{Uses \cs{@latex@warning} instead of \cs{caption@Warning} now}
1138 % This command is a modified version of |\pageref| from \LaTeX2e.
1139 % It will be used inside |\caption@ifoddpage| and |\FP@helpNote|.
1140 % \begin{macrocode}
1141 \newcommand*\caption@pageref[1]{%
1142 \expandafter\ifx\csname caption@r@#1\endcsname\relax
1143 \G@refundefinedtrue % => 'There are undefined references.'
1144 \@latex@warning{Reference `#1' on page \thepage \space undefined}%
1145 \else
1146 \expandafter\let\expandafter\caption@thepage\csname caption@r@#1\endcsname
1147 \fi}
1148 % \end{macrocode}
1149 % \end{macro}
1150 %
1151 % \begin{macro}{\caption@ifoddpage}
1152 % \changes{v3.0p}{2007/04/03}{This macro added}
1153 % \changes{v3.1e}{2007/10/28}{Incrementation of counter moved to \cs{caption@@make}}
1154 % At the moment this macro uses an own label\ldots ref mechanism,
1155 % but an alternative implementation method would be using the
1156 % \package{refcount} package\cite{refcount} and |\ifodd\getpagerefnumber{|\ldots|}|.
1157 % \Note{This macro re-defines itself so the \texttt{.aux} file will
1158 % only be used once per group.}
1159 % \begin{macrocode}
1160 \newcommand*\caption@ifoddpage{%
1161 \caption@iftwoside{%
1162 \caption@label\caption@thecounter
1163 \caption@pageref\caption@thecounter
1164 \ifodd\caption@thepage
1165 \let\caption@ifoddpage\@firstoftwo
1166 \else
1167 \let\caption@ifoddpage\@secondoftwo
1168 \fi
1169 }{\let\caption@ifoddpage\@firstoftwo}%
1170 % \end{macrocode}
1171 % \begin{macrocode}
1172 \caption@ifoddpage}
1173 % \end{macrocode}
1174 % \end{macro}
1175 %
1176 % \begin{macro}{\caption@setoptcmd}
1177 % \changes{v3.1}{2007/08/11}{This macro added}
1178 % |\caption@setoptcmd|\marg{cmd}\marg{off -or- value}
1179 % \begin{macrocode}
1180 \newcommand*\caption@setoptcmd[2]{%
1181 \caption@ifinlist{#2}{0,false,no,off}{\let#1\@undefined}{\def#1{#2}}}
1182 % \end{macrocode}
1183 % \end{macro}
1184 %
1185 % \subsection{Indentions}
1186 %
1187 % \begin{macro}{\caption@indent}
1188 % \changes{v3.1}{2007/07/29}{Renamed from \cs{captionindent} to \cs{caption@indent}}
1189 % \begin{macro}{\caption@parindent}
1190 % \begin{macro}{\caption@hangindent}
1191 % These are the indentions we support.
1192 % \begin{macrocode}
1193 \newdimen\caption@indent
1194 \newdimen\caption@parindent
1195 \newdimen\caption@hangindent
1196 % \end{macrocode}
1197 % \end{macro}
1198 % \end{macro}
1199 % \end{macro}
1200 %
1201 % \changes{v3.0b}{2004/05/16}{Defaults added for options \opt{parindent=}
1202 % and \opt{hangindent=}}
1203 % \changes{v3.0h}{2005/08/22}{Option \opt{parskip=}: \cs{AtBeginCaption}
1204 % replaced by \cs{caption@@par}}
1205 % \changes{v3.0h}{2005/08/22}{Undocumented defaults for \opt{parindent=},
1206 % \opt{hangindent=}, and \opt{parskip=} removed}
1207 % \begin{macrocode}
1208 \DeclareCaptionOption{indent}[\leftmargini]{% obsolete!
1209 \setlength\caption@indent{#1}}
1210 \DeclareCaptionOption{indention}[\leftmargini]{%
1211 \setlength\caption@indent{#1}}
1212 \DeclareCaptionOption{parindent}{%
1213 \setlength\caption@parindent{#1}}
1214 \DeclareCaptionOption{hangindent}{%
1215 \setlength\caption@hangindent{#1}}
1216 \DeclareCaptionOption{parskip}{%
1217 \l@addto@macro\caption@@par{\setlength\parskip{#1}}}
1218 % \end{macrocode}
1219 %
1220 % \changes{v3.0h}{2005/08/22}{Increased compatibility to KOMA-Script:
1221 % A special version of options `parindent' and `parskip' added}
1222 % \changes{v3.0i}{2006/01/03}{Bugfix 06-01-03: KOMA-Script variants of
1223 % `parskip' and `parindent' options revised and moved into caption kernel}
1224 % \changes{v3.0j}{2006/02/23}{KOMA-Script variants of `parskip' and
1225 % `parindent' are obsolete now, removed}
1226 % \changes{v3.0o}{2007/03/30}{KOMA-Script variants of `parskip' and
1227 % `parindent' re-added, since they still collide with the current
1228 % version of the subfig package (Sigh!)}
1229 %
1230 % There is an option clash between the \KOMAScript\ document classes
1231 % and the \package{caption} kernel, both define the options |parindent| and
1232 % |parskip| but with different meaning.
1233 % Furthermore the ones defined by the \package{caption} kernel take a
1234 % value as parameter but the \KOMAScript\ ones do not.
1235 % So we need special versions of the options |parindent| and |parskip| here
1236 % which determine if a value is given (and therefore should be treated as
1237 % our option) or not (and therefore should be ignored by us).\footnote{%^^A
1238 % This problem was completely solved due a change of \cs{caption@ProcessOptions}
1239 % in \thispackage\ \version{3.0j}, but we still need this workaround since
1240 % these options would otherwise still collide with the current version $1.3$
1241 % of the \package{subfig} package (Sigh!)}
1242 % \begin{macrocode}
1243 \providecommand*\caption@ifkomaclass{%
1244 \@ifundefined{scr@caption}\@gobble\@firstofone}
1245 \@onlypreamble\caption@ifkomaclass
1246 % \end{macrocode}
1247 % \begin{macrocode}
1248 \caption@ifkomaclass{%
1249 % \end{macrocode}
1250 % \begin{macrocode}
1251 \let\caption@KV@parindent\KV@caption@parindent
1252 \DeclareCaptionOption{parindent}[]{%
1253 \ifx,#1,%
1254 \caption@Debug{Option `parindent' ignored}%
1255 \else
1256 \caption@KV@parindent{#1}%
1257 \fi}%
1258 % \end{macrocode}
1259 % \begin{macrocode}
1260 \let\caption@KV@parskip\KV@caption@parskip
1261 \DeclareCaptionOption{parskip}[]{%
1262 \ifx,#1,%
1263 \caption@Debug{Option `parskip' ignored}%
1264 \else
1265 \caption@KV@parskip{#1}%
1266 \fi}%
1267 % \end{macrocode}
1268 % \begin{macrocode}
1269 }
1270 % \end{macrocode}
1271 %
1272 % \subsection{Styles}
1273 %
1274 % \begin{macro}{\DeclareCaptionStyle}
1275 % \changes{v3.0a}{2004/01/17}{Pass through argument \#3 so extra spaces
1276 % between arguments do make any harm}
1277 % |\DeclareCaptionStyle|\marg{name}\oarg{single-line-list-of-KV}\marg{list-of-KV}
1278 % \begin{macrocode}
1279 \newcommand*\DeclareCaptionStyle[1]{%
1280 \@testopt{\caption@declarestyle{#1}}{}}
1281 \@onlypreamble\DeclareCaptionStyle
1282 % \end{macrocode}
1283 % \begin{macrocode}
1284 \def\caption@declarestyle#1[#2]#3{%
1285 \global\@namedef{caption@sls@#1}{#2}%
1286 \global\@namedef{caption@sty@#1}{#3}}
1287 \@onlypreamble\caption@declarestyle
1288 % \end{macrocode}
1289 % \end{macro}
1290 %
1291 % \changes{v3.1g}{2008/01/20}{Option \opt{style*=} added}
1292 % \changes{v3.1i}{2008/05/06}{Option \opt{slc=} added}
1293 % \begin{macrocode}
1294 \DeclareCaptionOption{style}{\caption@setstyle{#1}}
1295 \DeclareCaptionOption{style*}{\caption@setstyle*{#1}}
1296 \DeclareCaptionOption{singlelinecheck}[1]{\caption@set@bool\caption@ifslc{#1}}
1297 \DeclareCaptionOption{slc}[1]{\KV@caption@singlelinecheck{#1}}
1298 % \end{macrocode}
1299 %
1300 % \begin{macro}{\caption@setstyle}
1301 % \changes{v3.0f}{2005/06/01}{Starred variant added}
1302 % \changes{v3.1}{2007/07/29}{Recursive style definitions should work now}
1303 % \changes{v3.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency}
1304 % \changes{v3.1f}{2007/12/03}{Definition of \cs{caption@iftypewarning} removed}
1305 % |\caption@setstyle|\marg{name}\\
1306 % |\caption@setstyle*|\marg{name}\par
1307 % Selecting a caption style means saving the additional
1308 % \meta{single-line-list-of-KV} (this will be done by |\caption@sls|),
1309 % resetting the caption options to the base ones (this will be done using
1310 % |\caption@resetstyle|) and executing the \meta{list-of-KV} options
1311 % (this will be done using |\caption@setup|).\par
1312 % The starred version will give no error message if the given style is not
1313 % defined.
1314 % \begin{macrocode}
1315 \newcommand*\caption@setstyle{%
1316 \caption@teststar\caption@@setstyle\@gobble\@firstofone}
1317 % \end{macrocode}
1318 % \begin{macrocode}
1319 \newcommand*\caption@@setstyle[2]{%
1320 \@ifundefined{caption@sty@#2}%
1321 {#1{\caption@Error{Undefined style `#2'}}}%
1322 {\expandafter\let\expandafter\caption@sty\csname caption@sty@#2\endcsname
1323 \ifx\caption@setstyle@flag\@undefined
1324 \let\caption@setstyle@flag\relax
1325 \caption@resetstyle
1326 \caption@xsetup\caption@sty
1327 \let\caption@setstyle@flag\@undefined
1328 \else
1329 \caption@xsetup\caption@sty
1330 \fi
1331 \expandafter\let\expandafter\caption@sls\csname caption@sls@#2\endcsname
1332 \expandafter\caption@l@addto@list\expandafter\caption@opt@singleline
1333 \expandafter{\caption@sls}}}
1334 % \end{macrocode}
1335 % \end{macro}
1336 %
1337 % \begin{macro}{\caption@resetstyle}
1338 % \changes{v3.1}{2007/02/04}{%
1339 % This macro renamed from \cs{caption@setdefault} to \cs{caption@resetstyle}}
1340 % \changes{v3.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency}
1341 % \changes{v3.1f}{2007/11/17}{Usage of \texttt{size=} added}
1342 % \changes{v3.1i}{2008/05/06}{Usage of \texttt{rule} added}
1343 % This resets (nearly) all caption options to the base ones.
1344 % \emph{Note that this does not touch the skips and the positioning!}
1345 % \begin{macrocode}
1346 \newcommand*\caption@resetstyle{%
1347 \caption@setup{%
1348 format=plain,labelformat=default,labelsep=colon,textformat=simple,%
1349 justification=justified,font=,size=,labelfont=,textfont=,%
1350 margin=0pt,minmargin=0,maxmargin=0,%
1351 indent=0pt,parindent=0pt,hangindent=0pt,%
1352 slc,rule,strut}%
1353 \caption@clearsetup{singleline}}
1354 % \end{macrocode}
1355 % \end{macro}
1356 %
1357 % \changes{v3.0d}{2005/02/12}{\opt{indent=0pt} added to caption style \opt{default}}
1358 % \changes{v3.1}{2007/02/04}{Caption style `default' renamed to `base', and a new `default' added}
1359 % \changes{v3.1}{2007/03/31}{\opt{format=plain} added to caption style \opt{default}}
1360 % \changes{v3.1c}{2007/10/14}{\opt{format=plain} removed from caption style \opt{default}}
1361 % Currently there are two pre-defined styles, called `base' \& `default'.
1362 % The first one is a perfect match to the behavior of |\@makecaption| offered
1363 % by the standard \LaTeX\ document classes (and was called `default' in
1364 % \thispackage\ \version{3.0}), the second one matches the document
1365 % class actually used.
1366 % \begin{macrocode}
1367 \DeclareCaptionStyle{base}[indent=0pt,justification=centering]{}
1368 \DeclareCaptionStyle{default}[indent=0pt,justification=centering]{%
1369 format=default,labelsep=default,textformat=default,%
1370 justification=default,font=default,labelfont=default,textfont=default}
1371 % \end{macrocode}
1372 %
1373 % \subsection{Formats}
1374 %
1375 % \begin{macro}{\DeclareCaptionFormat}
1376 % \changes{v3.0a}{2004/01/17}{Pass through argument \#3 so extra spaces
1377 % between arguments do make any harm}
1378 % \changes{v3.0d}{2005/02/09}{Starred variant added}
1379 % \changes{v3.1c}{2007/10/15}{Optional argument added}
1380 % |\DeclareCaptionFormat|\marg{name}\marg{code with \#1, \#2, and \#3}\\
1381 % |\DeclareCaptionFormat*|\marg{name}\marg{code with \#1, \#2, and \#3}\par
1382 % The starred form causes the code being typeset in vertical (instead of
1383 % horizontal) mode, but does not support the |indention=| option.
1384 % \begin{macrocode}
1385 \newcommand*\DeclareCaptionFormat{%
1386 \caption@teststar\caption@declareformat\@gobble\@firstofone}
1387 \@onlypreamble\DeclareCaptionFormat
1388 % \end{macrocode}
1389 % \begin{macrocode}
1390 \newcommand*\caption@declareformat[2]{%
1391 \@dblarg{\caption@@declareformat#1{#2}}}
1392 \@onlypreamble\caption@declareformat
1393 % \end{macrocode}
1394 % \begin{macrocode}
1395 \long\def\caption@@declareformat#1#2[#3]#4{%
1396 \global\expandafter\let\csname caption@ifh@#2\endcsname#1%
1397 \global\long\@namedef{caption@slfmt@#2}##1##2##3{#3}%
1398 \global\long\@namedef{caption@fmt@#2}##1##2##3{#4}}
1399 \@onlypreamble\caption@@declareformat
1400 % \end{macrocode}
1401 % \end{macro}
1402 %
1403 % \begin{macrocode}
1404 \DeclareCaptionOption{format}{\caption@setformat{#1}}
1405 % \end{macrocode}
1406 %
1407 % \begin{macro}{\caption@setformat}
1408 % |\caption@setformat|\marg{name}\par
1409 % Selecting a caption format simply means saving the code (in |\caption@fmt|)
1410 % and if the code should be used in horizontal or vertical mode (|\caption@ifh|).
1411 % \begin{macrocode}
1412 \newcommand*\caption@setformat[1]{%
1413 \@ifundefined{caption@fmt@#1}%
1414 {\caption@Error{Undefined format `#1'}}%
1415 {\expandafter\let\expandafter\caption@ifh\csname caption@ifh@#1\endcsname
1416 \expandafter\let\expandafter\caption@slfmt\csname caption@slfmt@#1\endcsname
1417 \expandafter\let\expandafter\caption@fmt\csname caption@fmt@#1\endcsname}}
1418 % \end{macrocode}
1419 % \end{macro}
1420 %
1421 % \begin{macro}{\DeclareCaptionDefaultFormat}
1422 % \changes{v3.1g}{2008/01/31}{This macro added}
1423 % \begin{macrocode}
1424 \newcommand*\DeclareCaptionDefaultFormat[1]{%
1425 \expandafter\def\expandafter\caption@fmt@default\expandafter
1426 {\csname caption@fmt@#1\endcsname}%
1427 \expandafter\def\expandafter\caption@slfmt@default\expandafter
1428 {\csname caption@slfmt@#1\endcsname}%
1429 \expandafter\def\expandafter\caption@ifh@default\expandafter
1430 {\csname caption@ifh@#1\endcsname}}
1431 \@onlypreamble\DeclareCaptionDefaultFormat
1432 % \end{macrocode}
1433 % \end{macro}
1434 %
1435 % \changes{v3.0a}{2004/01/23}{%
1436 % Caption format \opt{default} renamed to \opt{normal}}
1437 % \changes{v3.0f}{2005/05/12}{%
1438 % Caption format \opt{normal} renamed to \opt{@normal}}
1439 % \changes{v3.0h}{2005/08/25}{%
1440 % Caption format \opt{@normal} renamed to \opt{plain} and documented}
1441 % \changes{v3.1c}{2007/10/14}{%
1442 % Single-line variant of caption format \opt{hang} added}
1443 % There are two pre-defined formats, called `plain' and `hang'.
1444 % \begin{macrocode}
1445 \DeclareCaptionFormat{plain}{#1#2#3\par}
1446 % \end{macrocode}
1447 % \begin{macrocode}
1448 \DeclareCaptionFormat{hang}[#1#2#3\par]{%
1449 \caption@ifin@list\caption@lsepcrlist\caption@lsepname
1450 {\caption@Error{%
1451 The option `labelsep=\caption@lsepname' does not work\MessageBreak
1452 with `format=hang'}}%
1453 {\@hangfrom{#1#2}%
1454 \advance\caption@parindent\hangindent
1455 \advance\caption@hangindent\hangindent
1456 \caption@@par#3\par}}
1457 % \end{macrocode}
1458 %
1459 % \changes{v3.0a}{2004/01/23}{Caption format \opt{default} linked to \opt{plain}}
1460 % \changes{v3.0e}{2005/04/28}{Bugfix 05-04-28: Missing \cs{caption@ifh@default} added}
1461 % `default' usually maps to `plain'.
1462 % \begin{macrocode}
1463 \DeclareCaptionDefaultFormat{plain}
1464 % \end{macrocode}
1465 %
1466 % \subsection{Label formats}
1467 %
1468 % \begin{macro}{\DeclareCaptionLabelFormat}
1469 % \changes{v3.0a}{2004/01/17}{%
1470 % Pass through argument \#2 so extra spaces between arguments do make any harm}
1471 % |\DeclareCaptionLabelFormat|\marg{name}\marg{code with \#1 and \#2}
1472 % \begin{macrocode}
1473 \newcommand*\DeclareCaptionLabelFormat[2]{%
1474 \global\@namedef{caption@lfmt@#1}##1##2{#2}}
1475 \@onlypreamble\DeclareCaptionLabelFormat
1476 % \end{macrocode}
1477 % \end{macro}
1478 %
1479 % \begin{macrocode}
1480 \DeclareCaptionOption{labelformat}{\caption@setlabelformat{#1}}
1481 % \end{macrocode}
1482 %
1483 % \begin{macro}{\caption@setlabelformat}
1484 % |\caption@setlabelformat|\marg{name}\par
1485 % Selecting a caption label format simply means saving the code (in |\caption@lfmt|).
1486 % \begin{macrocode}
1487 \newcommand*\caption@setlabelformat[1]{%
1488 \@ifundefined{caption@lfmt@#1}%
1489 {\caption@Error{Undefined label format `#1'}}%
1490 {\expandafter\let\expandafter\caption@lfmt\csname caption@lfmt@#1\endcsname}}
1491 % \end{macrocode}
1492 % \end{macro}
1493 %
1494 % \changes{v3.1f}{2007/12/16}{Caption label format \opt{brace} added}
1495 % There are four pre-defined label formats, called `empty', `simple',
1496 % `parens', and `brace'.
1497 % \begin{macrocode}
1498 \DeclareCaptionLabelFormat{empty}{}
1499 \DeclareCaptionLabelFormat{simple}{\bothIfFirst{#1}{\nobreakspace}#2}
1500 \DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{\nobreakspace}(#2)}
1501 \DeclareCaptionLabelFormat{brace}{\bothIfFirst{#1}{\nobreakspace}#2)}
1502 % \end{macrocode}
1503 %
1504 % `default' usually maps to `simple'.
1505 % \begin{macrocode}
1506 \def\caption@lfmt@default{\caption@lfmt@simple}
1507 % \end{macrocode}
1508 %
1509 % \subsection{Label separators}
1510 %
1511 % \begin{macro}{\DeclareCaptionLabelSeparator}
1512 % \changes{v3.0a}{2004/01/17}{Pass through argument \#2 so extra spaces
1513 % between arguments do make any harm}
1514 % \changes{v3.0h}{2005/08/25}{Starred variant added}
1515 % \changes{v3.1}{2007/07/13}{Test for CR added}
1516 % |\DeclareCaptionLabelSeparator|\marg{name}\marg{code}\\
1517 % |\DeclareCaptionLabelSeparator*|\marg{name}\marg{code}\par
1518 % The starred form causes the label separator to be typeset \emph{without} using |\captionlabelfont|.
1519 % \begin{macrocode}
1520 \newcommand\DeclareCaptionLabelSeparator{%
1521 \caption@teststar\caption@declarelabelseparator\@gobble\@firstofone}
1522 \@onlypreamble\DeclareCaptionLabelSeparator
1523 % \end{macrocode}
1524 % \begin{macrocode}
1525 \newcommand\caption@declarelabelseparator[3]{%
1526 \global\expandafter\let\csname caption@iflf@#2\endcsname#1%
1527 \global\long\@namedef{caption@lsep@#2}{#3}%
1528 \caption@@declarelabelseparator{#2}#3\\\@nil}
1529 \@onlypreamble\caption@declarelabelseparator
1530 % \end{macrocode}
1531 % \begin{macrocode}
1532 \long\def\caption@@declarelabelseparator#1#2\\#3\@nil{%
1533 \def\@tempa{#3}\ifx\@tempa\@empty \else
1534 \caption@g@addto@list\caption@lsepcrlist{#1}%
1535 \fi}
1536 \@onlypreamble\caption@@declarelabelseparator
1537 % \end{macrocode}
1538 % \end{macro}
1539 %
1540 % \begin{macrocode}
1541 \DeclareCaptionOption{labelsep}{\caption@setlabelseparator{#1}}
1542 \DeclareCaptionOption{labelseparator}{\caption@setlabelseparator{#1}}
1543 % \end{macrocode}
1544 %
1545 % \begin{macro}{\caption@setlabelseparator}
1546 % |\caption@setlabelseparator|\marg{name}\par
1547 % Selecting a caption label separator simply means saving the code (in |\caption@lsep|).
1548 % \begin{macrocode}
1549 \newcommand*\caption@setlabelseparator[1]{%
1550 \@ifundefined{caption@lsep@#1}%
1551 {\caption@Error{Undefined label separator `#1'}}%
1552 {\edef\caption@lsepname{#1}%
1553 \expandafter\let\expandafter\caption@iflf\csname caption@iflf@#1\endcsname
1554 \expandafter\let\expandafter\caption@lsep\csname caption@lsep@#1\endcsname}}
1555 % \end{macrocode}
1556 % \end{macro}
1557 %
1558 % \changes{v3.0f}{2005/06/11}{Bugfix 05-03-23: Caption label separator
1559 % \opt{newline} implementation changed from \cs{newline} to \cs{\textbackslash}}
1560 % \changes{v3.0h}{2005/08/24}{Caption label separator \opt{endash} added}
1561 % There are seven pre-defined label separators, called `none', `colon', `period', `space',
1562 % `quad', `newline', and `endash'.
1563 % \begin{macrocode}
1564 \DeclareCaptionLabelSeparator{none}{}
1565 \DeclareCaptionLabelSeparator{colon}{: }
1566 \DeclareCaptionLabelSeparator{period}{. }
1567 \DeclareCaptionLabelSeparator{space}{ }
1568 \DeclareCaptionLabelSeparator*{quad}{\quad}
1569 \DeclareCaptionLabelSeparator*{newline}{\\}
1570 \DeclareCaptionLabelSeparator*{endash}{\space\textendash\space}
1571 % \end{macrocode}
1572 %
1573 % \begin{macro}{\caption@setdefaultlabelsep}
1574 % \changes{v3.1k}{2009/03/29}{This macro added}
1575 % \begin{macrocode}
1576 \newcommand*\caption@setdefaultlabelsep[1]{%
1577 \ifx\caption@lsep\caption@lsep@default
1578 \caption@set@default@labelsep{#1}%
1579 \caption@setlabelseparator{default}%
1580 \else
1581 \caption@set@default@labelsep{#1}%
1582 \fi}
1583 % \end{macrocode}
1584 % \begin{macrocode}
1585 \newcommand*\caption@set@default@labelsep[1]{%
1586 \def\caption@lsep@default{\@nameuse{caption@lsep@#1}}%
1587 \def\caption@iflf@default{\@nameuse{caption@iflf@#1}}}
1588 % \end{macrocode}
1589 % \end{macro}
1590 %
1591 % `default' usually maps to `colon'.
1592 % \begin{macrocode}
1593 \caption@set@default@labelsep{colon}
1594 % \end{macrocode}
1595 %
1596 % \subsection{Text formats}
1597 %
1598 % \begin{macro}{\DeclareCaptionTextFormat}
1599 % \changes{v3.0l}{2007/02/18}{This macro added}
1600 % |\DeclareCaptionTextFormat|\marg{name}\marg{code with \#1}
1601 % \begin{macrocode}
1602 \newcommand*\DeclareCaptionTextFormat[2]{%
1603 \global\long\@namedef{caption@tfmt@#1}##1{#2}}
1604 \@onlypreamble\DeclareCaptionTextFormat
1605 % \end{macrocode}
1606 % \end{macro}
1607 %
1608 % \changes{v3.0d}{2005/02/12}{Option \opt{strut=} added}
1609 % \begin{macrocode}
1610 \DeclareCaptionOption{textformat}{\caption@settextformat{#1}}
1611 \DeclareCaptionOption{strut}[1]{\caption@set@bool\caption@ifstrut{#1}}
1612 % \end{macrocode}
1613 %
1614 % \begin{macro}{\caption@settextformat}
1615 % \changes{v3.0l}{2007/02/18}{This macro added}
1616 % |\caption@settextformat|\marg{name}\par
1617 % Selecting a caption text format simply means saving the code (in |\caption@tfmt|).
1618 % \begin{macrocode}
1619 \newcommand*\caption@settextformat[1]{%
1620 \@ifundefined{caption@tfmt@#1}%
1621 {\caption@Error{Undefined text format `#1'}}%
1622 {\expandafter\let\expandafter\caption@tfmt\csname caption@tfmt@#1\endcsname}}
1623 % \end{macrocode}
1624 % \end{macro}
1625 %
1626 % There are two pre-defined text formats, called `simple' and `period'.
1627 % \begin{macrocode}
1628 \DeclareCaptionTextFormat{simple}{#1}
1629 \DeclareCaptionTextFormat{period}{#1.}
1630 % \end{macrocode}
1631 %
1632 % `default' usually maps to `simple'.
1633 % \begin{macrocode}
1634 \def\caption@tfmt@default{\caption@tfmt@simple}
1635 % \end{macrocode}
1636 %
1637 % \subsection{Fonts}
1638 %
1639 % \begin{macro}{\DeclareCaptionFont}
1640 % \changes{v3.0a}{2004/01/22}{%
1641 % Bugfix: Multi token arguments are allowed now}
1642 % \changes{v3.1}{2007/05/07}{%
1643 % Internal: Uses \cs{caption@fnt} instead of \cs{caption@temp} now}
1644 % |\DeclareCaptionFont|\marg{name}\marg{code}
1645 % \begin{macrocode}
1646 \newcommand*\DeclareCaptionFont[2]{%
1647 \define@key{caption@fnt}{#1}[]{\l@addto@macro\caption@fnt{#2}}}
1648 \@onlypreamble\DeclareCaptionFont
1649 % \end{macrocode}
1650 % \end{macro}
1651 %
1652 % \begin{macro}{\DeclareCaptionDefaultFont}
1653 % \changes{v3.1}{2006/05/14}{This macro added}
1654 % \changes{v3.1g}{2008/01/31}{Renamed from \cs{DeclareDefaultCaptionFont} to \cs{DeclareCaptionDefaultFont}}
1655 % |\DeclareCaptionDefaultFont|\marg{name}\marg{code}
1656 % \begin{macrocode}
1657 \newcommand*\DeclareCaptionDefaultFont[2]{%
1658 \global\@namedef{caption#1@default}{#2}}
1659 \@onlypreamble\DeclareCaptionDefaultFont
1660 % \end{macrocode}
1661 % \end{macro}
1662 %
1663 % \begin{macrocode}
1664 \DeclareCaptionOption{font}{\caption@setfont{font}{#1}}
1665 \DeclareCaptionOption{font+}{\caption@addtofont{font}{#1}}
1666 \DeclareCaptionDefaultFont{font}{}
1667 % \end{macrocode}
1668 % \begin{macrocode}
1669 \DeclareCaptionOption{labelfont}{\caption@setfont{labelfont}{#1}}
1670 \DeclareCaptionOption{labelfont+}{\caption@addtofont{labelfont}{#1}}
1671 \DeclareCaptionDefaultFont{labelfont}{}
1672 % \end{macrocode}
1673 % \begin{macrocode}
1674 \DeclareCaptionOption{textfont}{\caption@setfont{textfont}{#1}}
1675 \DeclareCaptionOption{textfont+}{\caption@addtofont{textfont}{#1}}
1676 \DeclareCaptionDefaultFont{textfont}{}
1677 % \end{macrocode}
1678 %
1679 % \begin{macro}{\caption@setfont}
1680 % \changes{v3.0l}{2007/01/30}{Usage of \cs{caption@setkeys} with optional argument}
1681 % \changes{v3.1}{2006/05/14}{Support of \cs{DeclareDefaultCaptionFont} added}
1682 % |\caption@setfont|\marg{name}\marg{keyval-list of names}\par
1683 % Selecting a caption font means saving all the code snippets
1684 % in |\caption|\meta{name}.
1685 % \begin{macrocode}
1686 \newcommand*\caption@setfont[1]{%
1687 \expandafter\let\csname caption#1\endcsname\@empty
1688 \caption@addtofont{#1}}
1689 % \end{macrocode}
1690 % \end{macro}
1691 %
1692 % \begin{macro}{\caption@addtofont}
1693 % \changes{v3.1f}{2007/11/17}{This macro added}
1694 % |\caption@addtofont|\marg{name}\marg{keyval-list of names}\par
1695 % Like |\caption@setfont|, but adds the code snippets to |\caption|\meta{name}.\par
1696 % Because we use |\setkeys| recursive here we need to do this inside an
1697 % extra group.
1698 % \begin{macrocode}
1699 \newcommand*\caption@addtofont[2]{%
1700 \begingroup
1701 \expandafter\let\expandafter\caption@fnt\csname caption#1\endcsname
1702 \define@key{caption@fnt}{default}[]{%
1703 \l@addto@macro\caption@fnt{\csname caption#1@default\endcsname}}%
1704 \caption@setkeys[caption]{caption@fnt}{#2}%
1705 \global\let\caption@tempa\caption@fnt
1706 \endgroup
1707 \expandafter\let\csname caption#1\endcsname\caption@tempa}
1708 % \end{macrocode}
1709 % \end{macro}
1710 %
1711 % \begin{macro}{\caption@font}
1712 % \changes{v3.1}{2007/05/07}{This macro added}
1713 % |\caption@font|\marg{keyval-list of names}\\
1714 % |\caption@font*|\marg{keyval-code}\par
1715 % Sets the given font, e.g.~|\caption@font{small,it}|
1716 % is equivalent to |\small\itshape|.
1717 % \begin{macrocode}
1718 \newcommand*\caption@font{%
1719 \caption@teststar\caption@@font\@firstofone
1720 {\caption@setkeys[caption]{caption@fnt}}}
1721 \newcommand*\caption@@font[2]{%
1722 \begingroup
1723 \def\caption@fnt{\endgroup}%
1724 #1{#2}%
1725 \caption@fnt}
1726 % \end{macrocode}
1727 % \end{macro}
1728 %
1729 % These are the pre-defined font code snippets.
1730 %
1731 % \changes{v3.1}{2007/05/07}{Color font support added (kernel)}
1732 % \begin{macrocode}
1733 \DeclareCaptionFont{normalcolor}{\normalcolor}
1734 \DeclareCaptionFont{color}{\color{#1}}
1735 % \end{macrocode}
1736 %
1737 % \begin{macrocode}
1738 \DeclareCaptionFont{normalfont}{\normalfont}
1739 \DeclareCaptionFont{up}{\upshape}
1740 \DeclareCaptionFont{it}{\itshape}
1741 \DeclareCaptionFont{sl}{\slshape}
1742 \DeclareCaptionFont{sc}{\scshape}
1743 \DeclareCaptionFont{md}{\mdseries}
1744 \DeclareCaptionFont{bf}{\bfseries}
1745 \DeclareCaptionFont{rm}{\rmfamily}
1746 \DeclareCaptionFont{sf}{\sffamily}
1747 \DeclareCaptionFont{tt}{\ttfamily}
1748 % \end{macrocode}
1749 %
1750 % \begin{macrocode}
1751 \DeclareCaptionFont{scriptsize}{\scriptsize}
1752 \DeclareCaptionFont{footnotesize}{\footnotesize}
1753 \DeclareCaptionFont{small}{\small}
1754 \DeclareCaptionFont{normalsize}{\normalsize}
1755 \DeclareCaptionFont{large}{\large}
1756 \DeclareCaptionFont{Large}{\Large}
1757 % \end{macrocode}
1758 %
1759 % \changes{v3.0p}{2007/04/02}{\package{setspace} package support added (kernel)}
1760 % \changes{v3.1k}{2009/10/09}{Bugfix 09-05-18: \package{setspace} package support revised (kernel)}
1761 % \begin{macrocode}
1762 \DeclareCaptionFont{singlespacing}{%
1763 \@ifundefined{setspace@singlespace}{}{%
1764 \setstretch\setspace@singlespace}}% normally 1
1765 \DeclareCaptionFont{onehalfspacing}{\onehalfspacing}
1766 \DeclareCaptionFont{doublespacing}{\doublespacing}
1767 \DeclareCaptionFont{stretch}{\setstretch{#1}}
1768 % \end{macrocode}
1769 %
1770 % \begin{macrocode}
1771 %\DeclareCaptionFont{normal}{%
1772 % \caption@font{normalcolor,normalfont,normalsize,singlespacing}
1773 \DeclareCaptionFont{normal}{%
1774 \caption@font*{%
1775 \KV@caption@fnt@normalcolor\@unused
1776 \KV@caption@fnt@normalfont\@unused
1777 \KV@caption@fnt@normalsize\@unused
1778 \KV@caption@fnt@singlespacing\@unused}}
1779 % \end{macrocode}
1780 %
1781 % \changes{v3.0a}{2004/01/23}{Option \opt{size=} now sets \cs{captionsize} instead of \cs{captionfont}}
1782 % The old versions \version{1.x} of \thispackage\ offered this
1783 % command to setup the font size used for captions. We still do
1784 % so old documents will work fine.
1785 % \begin{macrocode}
1786 \DeclareCaptionOption{size}{\caption@setfont{size}{#1}}
1787 \DeclareCaptionDefaultFont{size}{}
1788 % \end{macrocode}
1789 %
1790 % \subsection{Justifications}
1791 %
1792 % \begin{macro}{\DeclareCaptionJustification}
1793 % \changes{v3.0a}{2004/01/17}{Pass through argument \#2 so extra spaces
1794 % between arguments do make any harm}
1795 % \changes{v3.1}{2007/07/03}{Mapped to \cs{DeclareCaptionFont}}
1796 % |\DeclareCaptionJustification|\marg{name}\marg{code}
1797 % \begin{macrocode}
1798 \newcommand*\DeclareCaptionJustification[2]{%
1799 \global\@namedef{caption@hj@#1}{#2}% for compatibility to v3.0
1800 \DeclareCaptionFont{#1}{#2}}
1801 \@onlypreamble\DeclareCaptionJustification
1802 % \end{macrocode}
1803 % \end{macro}
1804 %
1805 % \begin{macro}{\DeclareCaptionDefaultJustification}
1806 % \changes{v3.1}{2007/07/03}{This macro added}
1807 % \changes{v3.1g}{2008/01/31}{Renamed from \cs{DeclareDefaultCaptionJustification} to \cs{DeclareCaptionDefaultJustification}}
1808 % |\DeclareCaptionDefaultJustification|\marg{code}
1809 % \begin{macrocode}
1810 \newcommand*\DeclareCaptionDefaultJustification[1]{%
1811 \global\@namedef{caption@hj@default}{#1}% for compatibility to v3.0
1812 \DeclareCaptionDefaultFont{@hj}{#1}}
1813 \@onlypreamble\DeclareCaptionDefaultJustification
1814 % \end{macrocode}
1815 % \end{macro}
1816 %
1817 % \begin{macrocode}
1818 \DeclareCaptionOption{justification}{\caption@setjustification{#1}}
1819 \DeclareCaptionDefaultJustification{}
1820 % \end{macrocode}
1821 %
1822 % \begin{macro}{\caption@setjustification}
1823 % \changes{v3.1}{2007/07/03}{Mapped to \cs{caption@setfont}}
1824 % |\caption@setjustification|\marg{name}\par
1825 % Selecting a caption justification simply means saving the code (in |\caption@hj|).
1826 % \begin{macrocode}
1827 \newcommand*\caption@setjustification{\caption@setfont{@hj}}
1828 % \end{macrocode}
1829 % \end{macro}
1830 %
1831 % These are the pre-defined justification code snippets.
1832 % \begin{macrocode}
1833 \DeclareCaptionJustification{justified}{}
1834 \DeclareCaptionJustification{centering}{\centering}
1835 \DeclareCaptionJustification{centerfirst}{\centerfirst}
1836 \DeclareCaptionJustification{centerlast}{\centerlast}
1837 \DeclareCaptionJustification{raggedleft}{\raggedleft}
1838 \DeclareCaptionJustification{raggedright}{\raggedright}
1839 % \end{macrocode}
1840 %
1841 % \begin{macro}{\centerfirst}
1842 % \changes{v3.0l}{2007/01/21}{Bugfix: Usage of \cs{@centercr} added (Thanks to Olga!)}
1843 % \changes{v3.0l}{2007/01/21}{This macro renamed from \cs{caption@centerfirst} to \cs{centerfirst}}
1844 % Please blame Frank Mittelbach for the code of |\centerfirst| |:-)|
1845 % \begin{macrocode}
1846 \providecommand\centerfirst{%
1847 \let\\\@centercr
1848 \edef\caption@normaladjust{%
1849 \leftskip\the\leftskip
1850 \rightskip\the\rightskip
1851 \parfillskip\the\parfillskip\relax}%
1852 \leftskip\z@\@plus -1fil%
1853 \rightskip\z@\@plus 1fil%
1854 \parfillskip\z@skip
1855 \noindent\hskip\z@\@plus 2fil%
1856 \@setpar{\@@par\@restorepar\caption@normaladjust}}
1857 % \end{macrocode}
1858 % \end{macro}
1859 %
1860 % \begin{macro}{\centerlast}
1861 % \changes{v3.0l}{2007/01/21}{Bugfix: Usage of \cs{@centercr} added (Thanks to Olga!)}
1862 % \changes{v3.0l}{2007/01/21}{This macro renamed from \cs{caption@centerlast} to \cs{centerlast}}
1863 % This is based on code from Anne Br\"uggemann-Klein\cite{Anne}
1864 % \begin{macrocode}
1865 \providecommand\centerlast{%
1866 \let\\\@centercr
1867 \leftskip\z@\@plus 1fil%
1868 \rightskip\z@\@plus -1fil%
1869 \parfillskip\z@\@plus 2fil\relax}
1870 % \end{macrocode}
1871 % \end{macro}
1872 %
1873 % \subsubsection{The ragged2e package}
1874 % \changes{v3.0b}{2004/05/16}{Improved \package{ragged2e} package support}
1875 %
1876 % We also support the upper-case commands offered by the \package{ragged2e}
1877 % package.
1878 % Note that these just map to their lower-case variants if the
1879 % \package{ragged2e} package is not available.
1880 % \begin{macrocode}
1881 \DeclareCaptionJustification{Centering}{%
1882 \caption@ragged\Centering\centering}
1883 \DeclareCaptionJustification{RaggedLeft}{%
1884 \caption@ragged\RaggedLeft\raggedleft}
1885 \DeclareCaptionJustification{RaggedRight}{%
1886 \caption@ragged\RaggedRight\raggedright}
1887 % \end{macrocode}
1888 %
1889 % \begin{macro}{\caption@ragged}
1890 % \changes{v3.0p}{2007/04/07}{The `ragged2e' package will now only been
1891 % loaded when needed}
1892 % \changes{v3.0q}{2007/04/11}{Bugfix: Usage of \cs{caption@Info} replaced
1893 % by \cs{caption@Debug}}
1894 % \changes{v3.1}{2007/04/16}{A different warning will be given on first \LaTeX\ run}
1895 % |\caption@ragged| will be basically defined as
1896 % \begin{quote}
1897 % |\AtBeginDocument{\IfFileExists{ragged2e.sty}%|\\
1898 % | {\RequirePackage{ragged2e}\let\caption@ragged\@firstoftwo}%|\\
1899 % | {\let\caption@ragged\@secondoftwo}}|
1900 % \end{quote}
1901 % but with an additional warning if the ragged2e package is not loaded (yet).
1902 % (This warning will be type out only one time per option, that's why
1903 % we need the |caption\string#1| stuff.)
1904 % Furthermore we load the \package{ragged2e} package, if needed and available.
1905 % \begin{macrocode}
1906 \newcommand*\caption@ragged{%
1907 \caption@Debug{We need ragged2e}%
1908 \protected@write\@auxout{}{\string\caption@newlabel{ragged2e}{}}%
1909 \global\let\caption@ragged\caption@@ragged
1910 \caption@ragged}
1911 % \end{macrocode}
1912 % \begin{macrocode}
1913 \caption@AtBeginDocument{%
1914 \@ifundefined{caption@r@ragged2e}{%
1915 \newcommand*\caption@@ragged{%
1916 \caption@Warning{%
1917 `ragged2e' support has been changed.\MessageBreak
1918 Rerun to get captions right}%
1919 \global\let\caption@ragged\@secondoftwo % suppress further warnings
1920 \caption@ragged}%
1921 }{%
1922 \caption@Debug{We load ragged2e}%
1923 \IfFileExists{ragged2e.sty}{%
1924 \RequirePackage{ragged2e}%
1925 \let\caption@@ragged\@firstoftwo
1926 }{%
1927 \newcommand*\caption@@ragged[2]{%
1928 \@ifundefined{caption\string#1}{%
1929 \caption@Warning{%
1930 `ragged2e' package not loaded, therefore\MessageBreak
1931 substituting \string#2 for \string#1\MessageBreak}%
1932 \global\@namedef{caption\string#1}}{}%
1933 #2}%
1934 }%
1935 }}
1936 % \end{macrocode}
1937 % \begin{macrocode}
1938 % \end{macrocode}
1939 % \end{macro}
1940 %
1941 % \subsection{Vertical spaces before and after captions}
1942 %
1943 % \begin{macro}{\abovecaptionskip}
1944 % \begin{macro}{\belowcaptionskip}
1945 % Usually these skips are defined within the document class, but some
1946 % document classes don't do so.
1947 % \begin{macrocode}
1948 \@ifundefined{abovecaptionskip}{%
1949 \newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@}}{}
1950 \@ifundefined{belowcaptionskip}{%
1951 \newlength\belowcaptionskip\setlength\belowcaptionskip{0\p@}}{}
1952 % \end{macrocode}
1953 % \end{macro}
1954 % \end{macro}
1955 %
1956 % \changes{v3.0d}{2005/02/12}{Option \opt{skip=} added}
1957 % \begin{macrocode}
1958 \DeclareCaptionOption{aboveskip}{\setlength\abovecaptionskip{#1}}
1959 \DeclareCaptionOption{belowskip}{\setlength\belowcaptionskip{#1}}
1960 \DeclareCaptionOption{skip}{\setlength\abovecaptionskip{#1}}
1961 % \end{macrocode}
1962 %
1963 % \begin{macro}{\caption@rule}
1964 % \changes{v3.1i}{2008/05/06}{This macro added}
1965 % |\caption@rule|\par
1966 % Draws an invisible rule to adjust the ``skip'' setting.
1967 % \begin{macrocode}
1968 \newcommand*\caption@rule{\caption@ifrule\caption@hrule\relax}
1969 % \end{macrocode}
1970 % \begin{macrocode}
1971 \newcommand*\caption@hrule{\hrule\@height\z@}
1972 % \end{macrocode}
1973 % \end{macro}
1974 %
1975 % \changes{v3.1i}{2008/05/06}{Option \opt{rule=} added}
1976 % \begin{macrocode}
1977 \DeclareCaptionOption{rule}[1]{\caption@set@bool\caption@ifrule{#1}}
1978 % \end{macrocode}
1979 %
1980 % \subsection{Positioning}
1981 %
1982 % These macros handle the right position of the caption.
1983 % Note that the position is actually \emph{not} controlled by the
1984 % \package{caption3} kernel options, but by the user (or a specific package
1985 % like the \package{float} package) instead.
1986 % The user can put the |\caption| command wherever he likes! So this stuff
1987 % is only to give us a \emph{hint} where to put the right skips, the user
1988 % usually has to take care for himself that this hint actually matches the
1989 % right position.
1990 %
1991 % \begin{macrocode}
1992 \DeclareCaptionOption{position}{\caption@setposition{#1}}
1993 % \end{macrocode}
1994 %
1995 % \begin{macro}{\caption@setposition}
1996 % \changes{v3.0a}{2004/01/22}{Now the positions \opt{t}, \opt{above}, \opt{b},
1997 % \opt{below}, and \opt{a} are allowed, too}
1998 % \changes{v3.0d}{2004/08/10}{Usage of \cs{caption@defaultpos} added}
1999 % |\caption@setposition|\marg{position}\par
2000 % Selecting the caption position means that we put |\caption@position| to
2001 % the right value. \emph{Please do \textbf{not} use the internal macro
2002 % \cs{caption@position} in your own package or document, but use the wrapper
2003 % macro \cs{caption@iftop} instead.}
2004 % \begin{macrocode}
2005 \newcommand*\caption@setposition[1]{%
2006 \caption@ifinlist{#1}{d,default}{%
2007 \let\caption@position\caption@defaultpos
2008 }{\caption@ifinlist{#1}{t,top,above}{%
2009 \let\caption@position\@firstoftwo
2010 }{\caption@ifinlist{#1}{b,bottom,below}{%
2011 \let\caption@position\@secondoftwo
2012 }{\caption@ifinlist{#1}{a,auto}{%
2013 \let\caption@position\@undefined
2014 }{%
2015 \caption@Error{Undefined position `#1'}%
2016 }}}}}
2017 % \end{macrocode}
2018 % \end{macro}
2019 %
2020 % \begin{macro}{\caption@defaultpos}
2021 % \changes{v3.1}{2007/05/08}{Default position changed from `bottom' to `auto'}
2022 % The default `position' is `auto', this means that \thispackage\ will try
2023 % to guess the current position of the caption.
2024 % (But in many cases, for example in |longtable|s, this is doomed to fail!)\par
2025 % The setting `bottom' correspondents to the |\@makecaption| implementation
2026 % in the standard \LaTeX\ document classes, but `auto' should give better
2027 % results in most cases.
2028 % \begin{macrocode}
2029 %\caption@setdefaultpos{a}% default = auto
2030 \let\caption@defaultpos\@undefined
2031 % \end{macrocode}
2032 % \end{macro}
2033 %
2034 % \begin{macro}{\caption@iftop}
2035 % \changes{v3.0a}{2004/01/23}{Split into \cs{caption@iftop} \& \cs{caption@fixposition}}
2036 % \changes{v3.0d}{2005/02/12}{Adapted to \cs{caption@defaultpos}}
2037 % \changes{v3.1}{2007/05/08}{Position will be fixed to `bottom' if `auto'}
2038 % |\caption@iftop|\marg{true-code}\marg{false-code}\par
2039 % (If the |position=| is set to |auto| we assume a |bottom| position here.)
2040 % \begin{macrocode}
2041 \newcommand*\caption@iftop{%
2042 \ifx\caption@position\@undefined
2043 \let\caption@position\@secondoftwo
2044 % = \caption@setposition b%
2045 \fi
2046 \caption@position}
2047 % \end{macrocode}
2048 % \end{macro}
2049 %
2050 % \begin{macro}{\caption@fixposition}
2051 % \changes{v3.0b}{2004/05/16}{%
2052 % Split into \cs{caption@fixposition} & \cs{caption@autoposition}}
2053 % |\caption@fixposition|\par
2054 % This macro checks if the `position' is set to `auto'.
2055 % If yes, |\caption@autoposition| will be called to
2056 % set |\caption@position| to a proper value we can actually use.
2057 % \begin{macrocode}
2058 \newcommand*\caption@fixposition{%
2059 \ifx\caption@position\@undefined
2060 \caption@autoposition
2061 \fi}
2062 % \end{macrocode}
2063 % \end{macro}
2064 %
2065 % \begin{macro}{\caption@autoposition}
2066 % \changes{v3.0a}{2004/01/23}{\cs{ifvmode} added}
2067 % |\caption@autoposition|\par
2068 % We guess the current position of the caption by checking |\prevdepth|.\par
2069 % A different solution would be setting the |\spacefactor| to something
2070 % not much less than 1000 (for example 994) in |\caption@start| and
2071 % checking this value here by |\ifnum\spacefactor=994|.
2072 % (It's implemented in the \package{threeparttable}
2073 % package\cite{threeparttable} this way.)\par
2074 % Another idea would be checking |\@ifminipage|, but since some packages
2075 % typeset the caption within a simple |\vbox| this does not seem to be a
2076 % good one.
2077 % \begin{macrocode}
2078 \newcommand*\caption@autoposition{%
2079 \ifvmode
2080 \edef\caption@tempa{\the\prevdepth}%
2081 \caption@Debug{\protect\prevdepth=\caption@tempa}%
2082 \ifdim\prevdepth>-\p@
2083 \let\caption@position\@secondoftwo
2084 \else
2085 \let\caption@position\@firstoftwo
2086 \fi
2087 % = \caption@setposition{\ifdim\prevdepth>-\p@ b\else t\fi}%
2088 \else
2089 \caption@Debug{no \protect\prevdepth}%
2090 \let\caption@position\@secondoftwo
2091 % = \caption@setposition b%
2092 \fi}
2093 % \end{macrocode}
2094 % \end{macro}
2095 % \begin{macro}{\caption@setautoposition}
2096 % \changes{v3.1}{2007/06/10}{This macro added}
2097 % |\caption@setautoposition|\marg{position}\par
2098 % replaces the above algorithm by a different one (or a fixed position setting).
2099 % \begin{macrocode}
2100 \newcommand*\caption@setautoposition[1]{%
2101 \def\caption@autoposition{\caption@setposition{#1}}}
2102 % \end{macrocode}
2103 % \end{macro}
2104 %
2105 % \subsection{Hooks}
2106 %
2107 % \begin{macro}{\AtBeginCaption}
2108 % \begin{macro}{\AtEndCaption}
2109 % |\AtBeginCaption| \marg{code}\\
2110 % |\AtEndCaption| \marg{code}\par
2111 % These hooks can be used analogous to |\AtBeginDocument| and |\AtEndDocument|.
2112 % \begin{macrocode}
2113 \newcommand*\caption@beginhook{}
2114 \newcommand*\caption@endhook{}
2115 \newcommand*\AtBeginCaption{\l@addto@macro\caption@beginhook}
2116 \newcommand*\AtEndCaption{\l@addto@macro\caption@endhook}
2117 % \end{macrocode}
2118 % \end{macro}
2119 % \end{macro}
2120 %
2121 % \subsection{Lists}
2122 %
2123 % \changes{v3.0b}{2004/05/16}{Option \opt{listof=} added}
2124 % \changes{v3.1f}{2007/11/17}{Option \opt{list=} added}
2125 % \begin{macrocode}
2126 \DeclareCaptionOption{list}[1]{\caption@setlist{#1}}
2127 \DeclareCaptionOption{listof}[1]{\caption@setlist{#1}}
2128 % \end{macrocode}
2129 %
2130 % \begin{macro}{\caption@setlist}
2131 % \changes{v3.1g}{2008/03/20}{This macro added}
2132 % |\caption@setlist|\marg{boolean}
2133 % \begin{macrocode}
2134 \newcommand*\caption@setlist{\caption@set@bool\caption@iflist}
2135 % \end{macrocode}
2136 % \end{macro}
2137 %
2138 % \begin{macro}{\DeclareCaptionListFormat}
2139 % \changes{v3.1}{2004/07/15}{This macro added}
2140 % \changes{v3.1f}{2007/11/17}{Renamed from \cs{DeclareCaptionListOfFormat} to \cs{DeclareCaptionListFormat}}
2141 % |\DeclareCaptionListFormat|\marg{name}\marg{code with \#1 and \#2}
2142 % \begin{macrocode}
2143 \newcommand*\DeclareCaptionListFormat[2]{%
2144 \global\@namedef{caption@lstfmt@#1}##1##2{#2}}
2145 \@onlypreamble\DeclareCaptionListFormat
2146 % \end{macrocode}
2147 % \end{macro}
2148 %
2149 % \changes{v3.1}{2007/07/15}{Option \opt{listofformat=} added}
2150 % \changes{v3.1f}{2007/11/17}{Option \opt{listofformat=} renamed to \opt{listformat=}}
2151 % \begin{macrocode}
2152 \DeclareCaptionOption{listformat}{\caption@setlistformat{#1}}
2153 % \end{macrocode}
2154 %
2155 % \begin{macro}{\caption@setlistformat}
2156 % \changes{v3.1}{2004/07/15}{This macro added}
2157 % \changes{v3.1f}{2007/11/17}{Renamed from \cs{caption@setlistofformat} to \cs{caption@setlistformat}}
2158 % |\caption@setlistformat|\marg{name}\par
2159 % Selecting a caption list format simply means saving the code (in |\caption@lstfmt|).
2160 % \begin{macrocode}
2161 \newcommand*\caption@setlistformat[1]{%
2162 \@ifundefined{caption@lstfmt@#1}%
2163 {\caption@Error{Undefined list format `#1'}}%
2164 {\expandafter\let\expandafter\caption@lstfmt
2165 \csname caption@lstfmt@#1\endcsname}}
2166 % \end{macrocode}
2167 % \end{macro}
2168 %
2169 % There are five pre-defined list formats, taken from the \package{subfig} package.
2170 % \begin{macrocode}
2171 \DeclareCaptionListFormat{empty}{}
2172 \DeclareCaptionListFormat{simple}{#1#2}
2173 \DeclareCaptionListFormat{parens}{#1(#2)}
2174 \DeclareCaptionListFormat{subsimple}{#2}
2175 \DeclareCaptionListFormat{subparens}{(#2)}
2176 % \end{macrocode}
2177 %
2178 % \begin{macro}{\caption@setdefaultlistformat}
2179 % \changes{v3.1k}{2009/03/29}{This macro added}
2180 % \begin{macrocode}
2181 \newcommand*\caption@setdefaultlistformat[1]{%
2182 \ifx\caption@lstfmt\caption@lstfmt@default
2183 \caption@set@default@listformat{#1}%
2184 \caption@setlistformat{default}%
2185 \else
2186 \caption@set@default@listformat{#1}%
2187 \fi}
2188 % \end{macrocode}
2189 % \begin{macrocode}
2190 \newcommand*\caption@set@default@listformat[1]{%
2191 \def\caption@lstfmt@default{\@nameuse{caption@lstfmt@#1}}}
2192 % \end{macrocode}
2193 % \end{macro}
2194 %
2195 % `default' usually maps to `subsimple'.
2196 % \begin{macrocode}
2197 \caption@set@default@listformat{subsimple}
2198 % \end{macrocode}
2199 %
2200 % \subsection{Debug option}
2201 % \changes{v3.0m}{2007/03/04}{Debug option added (kernel)}
2202 %
2203 % \begin{macrocode}
2204 \DeclareCaptionOption{debug}[1]{%
2205 \caption@set@bool\caption@ifdebug{#1}%
2206 \caption@ifdebug
2207 {\def\caption@Debug{\PackageInfo{caption}}}%
2208 {\let\caption@Debug\@gobble}}
2209 % \end{macrocode}
2210 % \begin{macrocode}
2211 \DeclareOption{debug}{\setkeys{caption}{debug}}
2212 % \end{macrocode}
2213 % \begin{macrocode}
2214 \setkeys{caption}{debug=0}
2215 % \end{macrocode}
2216 %
2217 % \subsection{Document classes \& Babel support}
2218 %
2219 % \subsubsection{The standard \texorpdfstring{\LaTeX{}}{LaTeX} classes}
2220 %
2221 % \begin{macrocode}
2222 \caption@CheckCommand\@makecaption{%
2223 % article|report|book [2005/09/16 v1.4f Standard LaTeX document class]
2224 \long\def\@makecaption#1#2{%
2225 \vskip\abovecaptionskip
2226 \sbox\@tempboxa{#1: #2}%
2227 \ifdim \wd\@tempboxa >\hsize
2228 #1: #2\par
2229 \else
2230 \global \@minipagefalse
2231 \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
2232 \fi
2233 \vskip\belowcaptionskip}}
2234 % \end{macrocode}
2235 %
2236 % \subsubsection{The \AmS{} \& \SmF{} classes}
2237 % \changes{v3.1}{2007/07/29}{\AmS\ \& \SmF\ classes support added (kernel)}
2238 %
2239 % \begin{macrocode}
2240 \providecommand*\caption@ifamsclass{%
2241 \@ifundefined{@captionheadfont}\@gobble\@firstofone}
2242 \@onlypreamble\caption@ifamsclass
2243 % \end{macrocode}
2244 % \begin{macrocode}
2245 \caption@ifamsclass{%
2246 % \end{macrocode}
2247 % \begin{macrocode}
2248 \caption@CheckCommand\@makecaption{%
2249 % amsart|amsproc|amsbook [2004/08/06 v2.20]
2250 \long\def\@makecaption#1#2{%
2251 \setbox\@tempboxa\vbox{\color@setgroup
2252 \advance\hsize-2\captionindent\noindent
2253 \@captionfont\@captionheadfont#1\@xp\@ifnotempty\@xp
2254 {\@cdr#2\@nil}{.\@captionfont\upshape\enspace#2}%
2255 \unskip\kern-2\captionindent\par
2256 \global\setbox\@ne\lastbox\color@endgroup}%
2257 \ifhbox\@ne % the normal case
2258 \setbox\@ne\hbox{\unhbox\@ne\unskip\unskip\unpenalty\unkern}%
2259 \fi
2260 \ifdim\wd\@tempboxa=\z@ % this means caption will fit on one line
2261 \setbox\@ne\hbox to\columnwidth{\hss\kern-2\captionindent\box\@ne\hss}%
2262 \else % tempboxa contained more than one line
2263 \setbox\@ne\vbox{\unvbox\@tempboxa\parskip\z@skip
2264 \noindent\unhbox\@ne\advance\hsize-2\captionindent\par}%
2265 \fi
2266 \ifnum\@tempcnta<64 % if the float IS a figure...
2267 \addvspace\abovecaptionskip
2268 \hbox to\hsize{\kern\captionindent\box\@ne\hss}%
2269 \else % if the float IS NOT a figure...
2270 \hbox to\hsize{\kern\captionindent\box\@ne\hss}%
2271 \nobreak
2272 \vskip\belowcaptionskip
2273 \fi
2274 \relax
2275 }}
2276 % \end{macrocode}
2277 % \begin{macrocode}
2278 \caption@CheckCommand\@makecaption{%
2279 % smfart|smfbook [1999/11/15 v1.2f Classe LaTeX pour les articles publies par la SMF]
2280 \long\def\@makecaption#1#2{%
2281 \ifdim\captionindent>.1\hsize \captionindent.1\hsize \fi
2282 \setbox\@tempboxa\vbox{\color@setgroup
2283 \advance\hsize-2\captionindent\noindent
2284 \@captionfont\@captionheadfont#1\@xp\@ifnotempty\@xp
2285 {\@cdr#2\@nil}{\@addpunct{.}\@captionfont\upshape\enspace#2}%
2286 \unskip\kern-2\captionindent\par
2287 \global\setbox\@ne\lastbox\color@endgroup}%
2288 \ifhbox\@ne % the normal case
2289 \setbox\@ne\hbox{\unhbox\@ne\unskip\unskip\unpenalty\unkern}%
2290 \fi
2291 \ifdim\wd\@tempboxa=\z@ % this means caption will fit on one line
2292 \setbox\@ne\hbox to\columnwidth{\hss\kern-2\captionindent\box\@ne\hss}%
2293 \@tempdima\wd\@ne\advance\@tempdima-\captionindent
2294 \wd\@ne\@tempdima
2295 \else % tempboxa contained more than one line
2296 \setbox\@ne\vbox{\rightskip=0pt plus\captionindent\relax
2297 \unvbox\@tempboxa\parskip\z@skip
2298 \noindent\unhbox\@ne\advance\hsize-2\captionindent\par}%
2299 \fi
2300 \ifnum\@tempcnta<64 % if the float IS a figure...
2301 \addvspace\abovecaptionskip
2302 \noindent\kern\captionindent\box\@ne
2303 \else % if the float IS NOT a figure...
2304 \noindent\kern\captionindent\box\@ne
2305 \nobreak
2306 \vskip\belowcaptionskip
2307 \fi
2308 \relax
2309 }}
2310 % \end{macrocode}
2311 % \begin{macrocode}
2312 \let\captionmargin\captionindent % set to 3pc by AMS class
2313 \begingroup\edef\@tempa{\endgroup
2314 \noexpand\caption@g@addto@list\noexpand\caption@sty@default
2315 {margin=\the\captionmargin
2316 \@ifundefined{smf@makecaption}{}{,maxmargin=.1\linewidth}}}
2317 \@tempa
2318 \caption@g@addto@list\caption@sls@default{margin*=.5\captionmargin}
2319 \DeclareCaptionLabelSeparator{default}{.\enspace}
2320 \DeclareCaptionDefaultFont{font}{\@captionfont}
2321 \DeclareCaptionDefaultFont{labelfont}{\@captionheadfont}
2322 \DeclareCaptionDefaultFont{textfont}{\@captionfont\upshape}
2323 \captionsetup[figure]{position=b}
2324 \captionsetup[table]{position=t}
2325 % \end{macrocode}
2326 % \begin{macrocode}
2327 }
2328 % \end{macrocode}
2329 %
2330 % \subsubsection{The beamer class}
2331 % \changes{v3.1}{2007/03/10}{beamer class support added (kernel)}
2332 %
2333 % \begin{macrocode}
2334 \providecommand*\caption@ifbeamerclass{%
2335 \@ifclassloaded{beamer}\@firstofone\@gobble}
2336 \@onlypreamble\caption@ifbeamerclass
2337 % \end{macrocode}
2338 % \begin{macrocode}
2339 \caption@ifbeamerclass{%
2340 % \end{macrocode}
2341 % \begin{macrocode}
2342 \caption@CheckCommand\beamer@makecaption{%
2343 % beamerbaselocalstructure.sty,v 1.53 2007/01/28 20:48:21 tantau
2344 \long\def\beamer@makecaption#1#2{%
2345 \def\insertcaptionname{\csname#1name\endcsname}%
2346 \def\insertcaptionnumber{\csname the#1\endcsname}%
2347 \def\insertcaption{#2}%
2348 \nobreak\vskip\abovecaptionskip\nobreak
2349 \sbox\@tempboxa{\usebeamertemplate**{caption}}%
2350 \ifdim \wd\@tempboxa >\hsize
2351 \usebeamertemplate**{caption}\par
2352 \else
2353 \global \@minipagefalse
2354 \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
2355 \fi
2356 \nobreak\vskip\belowcaptionskip\nobreak}}
2357 % \end{macrocode}
2358 % \begin{macrocode}
2359 \DeclareCaptionLabelFormat{default}{#1}
2360 \DeclareCaptionDefaultJustification{\raggedright}
2361 \DeclareCaptionDefaultFont{font}{%
2362 \usebeamerfont*{caption}%
2363 \usebeamercolor[fg]{caption}}
2364 \DeclareCaptionDefaultFont{labelfont}{%
2365 \usebeamercolor[fg]{caption name}%
2366 \usebeamerfont*{caption name}}
2367 % \end{macrocode}
2368 % If the \package{beamer} document class is used, we offer a beamer
2369 % template called `caption3' which can be used with option `beamer' or
2370 % |\setbeamertemplate{caption}[caption3]|.\par
2371 % (Note that this is of no use when \thispackage\ is used, too.)
2372 % \begin{macrocode}
2373 \defbeamertemplate{caption}{caption3}{%
2374 \caption@make\insertcaptionname\insertcaptionnumber\insertcaption}
2375 % \end{macrocode}
2376 % \begin{macrocode}
2377 \DeclareOption{beamer}{%
2378 % \usebeamertemplate**{caption} will set font
2379 \DeclareCaptionDefaultFont{font}{}%
2380 \setbeamertemplate{caption}[caption3]}
2381 % \end{macrocode}
2382 % \begin{macrocode}
2383 }
2384 % \end{macrocode}
2385 %
2386 % \subsubsection{The \KOMAScript{} classes}
2387 % \changes{v3.1}{2007/03/31}{\KOMAScript\ classes support added (kernel)}
2388 %
2389 % \begin{macrocode}
2390 \providecommand*\caption@ifkomaclass{%
2391 \@ifundefined{scr@caption}\@gobble\@firstofone}
2392 \@onlypreamble\caption@ifkomaclass
2393 % \end{macrocode}
2394 % \begin{macrocode}
2395 \caption@ifkomaclass{%
2396 % \end{macrocode}
2397 % \begin{macrocode}
2398 \caption@CheckCommand\@makecaption{%
2399 % scrartcl|scrreprt|scrbook [2007/03/07 v2.97a KOMA-Script document class]
2400 \long\def\@makecaption#1#2{%
2401 \if@captionabove
2402 \vskip\belowcaptionskip
2403 \else
2404 \vskip\abovecaptionskip
2405 \fi
2406 \@@makecaption\@firstofone{#1}{#2}%
2407 \if@captionabove
2408 \vskip\abovecaptionskip
2409 \else
2410 \vskip\belowcaptionskip
2411 \fi}}
2412 % \end{macrocode}
2413 % \begin{macrocode}
2414 \DeclareCaptionFormat{default}[#1#2#3\par]{%
2415 \ifdofullc@p
2416 \caption@ifin@list\caption@lsepcrlist\caption@lsepname
2417 {\caption@Error{%
2418 The option `labelsep=\caption@lsepname' does not work\MessageBreak
2419 with \noexpand\setcaphanging (which is set by default)}}%
2420 {\caption@fmt@hang{#1}{#2}{#3}}%
2421 \else
2422 #1#2%
2423 \ifdim\cap@indent<\z@
2424 \par
2425 \noindent\hspace*{-\cap@indent}%
2426 \else\if@capbreak
2427 \par
2428 \fi\fi
2429 #3\par
2430 \fi}
2431 \DeclareCaptionLabelSeparator{default}{\captionformat}
2432 \DeclareCaptionDefaultFont{font}{\scr@fnt@caption}
2433 \DeclareCaptionDefaultFont{labelfont}{\scr@fnt@captionlabel}
2434 % \end{macrocode}
2435 % \begin{macrocode}
2436 }
2437 % \end{macrocode}
2438 %
2439 % \subsubsection{The \NTG{} Dutch classes}
2440 % \changes{v3.1}{2007/04/06}{NTG classes support added (kernel)}
2441 %
2442 % \begin{macrocode}
2443 \providecommand*\caption@ifntgclass{%
2444 \@ifundefined{CaptionFonts}\@gobble\@firstofone}
2445 \@onlypreamble\caption@ifntgclass
2446 % \end{macrocode}
2447 % \begin{macrocode}
2448 \caption@ifntgclass{%
2449 % \end{macrocode}
2450 % \begin{macrocode}
2451 \caption@CheckCommand\@makecaption{%
2452 % artikel|rapport|boek [2004/06/07 v2.1a NTG LaTeX document class]
2453 \long\def\@makecaption#1#2{%
2454 \vskip\abovecaptionskip
2455 \sbox\@tempboxa{{\CaptionLabelFont#1:} \CaptionTextFont#2}%
2456 \ifdim \wd\@tempboxa >\hsize
2457 {\CaptionLabelFont#1:} \CaptionTextFont#2\par
2458 \else
2459 \global \@minipagefalse
2460 \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
2461 \fi
2462 \vskip\belowcaptionskip}}
2463 % \end{macrocode}
2464 % \begin{macrocode}
2465 \DeclareCaptionDefaultFont{labelfont}{\CaptionLabelFont}
2466 \DeclareCaptionDefaultFont{textfont}{\CaptionTextFont}
2467 % \end{macrocode}
2468 % \begin{macrocode}
2469 }
2470 % \end{macrocode}
2471 %
2472 % \subsubsection{The thesis class}
2473 % \changes{v3.1g}{2008/01/31}{thesis class support added (kernel)}
2474 % \changes{v3.1l}{2009/11/15}{Bugfix 09-11-14: thesis class support revised (kernel)}
2475 %
2476 % \begin{macrocode}
2477 \providecommand*\caption@ifthesisclass{%
2478 \@ifundefined{cph@font}{\@gobble}{\@ifundefined{cpb@font}\@gobble\@firstofone}}
2479 % \end{macrocode}
2480 % \begin{macrocode}
2481 \caption@ifthesisclass{%
2482 % \end{macrocode}
2483 % \begin{macrocode}
2484 \caption@CheckCommand\@makecaption{%
2485 % thesis.cls 1996/25/01 1.0g LaTeX document class (wm).
2486 \long\def\@makecaption#1#2{%
2487 \vskip\abovecaptionskip
2488 \setbox\@tempboxa\hbox{{\cph@font #1:} {\cpb@font #2}}%
2489 \ifdim \wd\@tempboxa >\hsize
2490 \@hangfrom{\cph@font #1: }{\cpb@font #2\par}%
2491 \else
2492 \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
2493 \fi
2494 \vskip\belowcaptionskip}}
2495 % \end{macrocode}
2496 % \begin{macrocode}
2497 \DeclareCaptionDefaultFormat{hang}
2498 \DeclareCaptionDefaultFont{labelfont}{\cph@font}
2499 \DeclareCaptionDefaultFont{textfont}{\cpb@font}
2500 % \end{macrocode}
2501 % \begin{macrocode}
2502 }
2503 % \end{macrocode}
2504 %
2505 % \subsubsection{The frenchb Babel option}
2506 % \changes{v3.1}{2006/05/14}{\package{frenchb} package support added (kernel)}
2507 %
2508 % \begin{macrocode}
2509 \@ifundefined{FB@makecaption}{}{%
2510 % \end{macrocode}
2511 % \begin{macrocode}
2512 \caption@CheckCommand\@makecaption{%
2513 % frenchb.ldf [2005/02/06 v1.6g French support from the babel system]
2514 % frenchb.ldf [2007/10/05 v2.0e French support from the babel system]
2515 \long\def\@makecaption#1#2{%
2516 \vskip\abovecaptionskip
2517 \sbox\@tempboxa{#1\CaptionSeparator #2}%
2518 \ifdim \wd\@tempboxa >\hsize
2519 #1\CaptionSeparator #2\par
2520 \else
2521 \global \@minipagefalse
2522 \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
2523 \fi
2524 \vskip\belowcaptionskip}}
2525 % \end{macrocode}
2526 % \begin{macrocode}
2527 \ifx\@makecaption\STD@makecaption
2528 \DeclareCaptionLabelSeparator{default}{\CaptionSeparator}
2529 \def\caption@frenchb{% supress frenchb warning
2530 \let\STD@makecaption\@makecaption
2531 \let\FB@makecaption\@makecaption}
2532 \else
2533 \ifx\@makecaption\@undefined\else
2534 \PackageInfo{caption}{%
2535 The definition of \protect\@makecaption\space
2536 has been changed,\MessageBreak
2537 frenchb will NOT customize it}%
2538 \fi
2539 \fi
2540 % \end{macrocode}
2541 % \begin{macrocode}
2542 }
2543 % \end{macrocode}
2544 %
2545 % \subsubsection{The frenchle/pro package}
2546 % \changes{v3.1}{2006/05/14}{\package{frenchle/pro} package support added (kernel)}
2547 %
2548 % \begin{macrocode}
2549 \@ifundefined{frenchTeXmods}{}{%
2550 % \end{macrocode}
2551 % \begin{macrocode}
2552 \caption@CheckCommand\@makecaption{%
2553 % french(le).sty [2006/10/03 The french(le) package /V5,9991/]
2554 % french(le).sty [2007/06/28 The french(le) package /V5,9994/]
2555 \def\@makecaption#1#2{%
2556 \ifFTY%
2557 \def\@secondofmany##1##2\void{##2}%
2558 \def\@tempa{\@secondofmany#2\void}%
2559 \ifx\@tempa\empty%
2560 \let\captionseparator\empty%
2561 \fi%
2562 \@mcORI{#1}{\relax\captionfont{#2}}%
2563 \else
2564 \@mcORI{#1}{#2}%
2565 \fi}}
2566 % \end{macrocode}
2567 % \begin{macrocode}
2568 \caption@CheckCommand\@makecaption{%
2569 % french(le).sty [2007/02/11 The french(le) package /V5,9993/]
2570 \def\@makecaption#1#2{%
2571 \ifFTY%
2572 \def\@secondofmany##1##2\void{##2}%
2573 \protected@edef\@tempa{\@secondofmany#2\void}%
2574 \ifx\@tempa\empty%
2575 \let\captionseparator\empty%
2576 \fi%
2577 \@mcORI{#1}{\relax\captionfont{#2}}%
2578 \else
2579 \@mcORI{#1}{#2}%
2580 \fi}}
2581 % \end{macrocode}
2582 % \begin{macrocode}
2583 \DeclareCaptionDefaultFont{textfont}{\itshape}%
2584 \DeclareCaptionLabelSeparator{default}{\captionseparator\space}%
2585 % \end{macrocode}
2586 % \begin{macrocode}
2587 }
2588 % \end{macrocode}
2589 %
2590 % \iffalse
2591 % \subsubsection{The hungarian and magyar Babel option}
2592 % \changes{v3.2}{2009/03/29}{\package{magyar} package support added (kernel)}
2593 %
2594 % \begin{macrocode}
2595 \DeclareCaptionListFormat{subperiod}{#2.}
2596 % \end{macrocode}
2597 %
2598 % \begin{macrocode}
2599 %%% \def\caption@tempa#1{\@ifundefined{extras#1}{}{%
2600 %%% \expandafter\addto\csname extras#1\endcsname{%
2601 %%% % reverse changes made by magyar.ldf
2602 %%% \let\@makecaption\caption@makecaption
2603 %%% \babel@save\@makecaption
2604 %%% \caption@redefine
2605 %%% \babel@save\@caption
2606 %%% % change default labelsep and listformat
2607 %%% \caption@setdefaultlabelsep{period}%
2608 %%% \caption@setdefaultlistformat{subperiod}}%
2609 %%% \expandafter\addto\csname noextras#1\endcsname{%
2610 %%% % change default labelsep and listformat
2611 %%% \caption@setdefaultlabelsep{colon}%
2612 %%% \caption@setdefaultlistformat{subsimple}}%
2613 %%% }}
2614 % \end{macrocode}
2615 % \begin{macrocode}
2616 %%% \caption@tempa{hungarian}
2617 %%% \caption@tempa{magyar}
2618 % \end{macrocode}
2619 % \fi
2620 %
2621 % \subsection{Execution of options}
2622 %
2623 % \begin{macrocode}
2624 \captionsetup{style=default,position=default,%
2625 list,listformat=default,twoside=\if@twoside 1\else 0\fi}
2626 % \end{macrocode}
2627 % \begin{macrocode}
2628 \ProcessOptions*
2629 % \end{macrocode}
2630 %
2631 % \changes{v3.1}{2007/04/10}{Check of document class added}
2632 % \begin{macrocode}
2633 \caption@IfCheckCommand{%
2634 \caption@setbool{documentclass}{1}%
2635 }{%
2636 \caption@setbool{documentclass}{0}%
2637 \PackageInfo{caption}{%
2638 Unknown document class (or package),\MessageBreak
2639 standard defaults will be used}%
2640 \caption@Debug{\string\@makecaption\space=\space\meaning\@makecaption\@gobble}%
2641 }
2642 % \end{macrocode}
2643 %
2644 % \subsection{Making an `List of' entry}
2645 %
2646 % \begin{macro}{\caption@addcontentsline}
2647 % \changes{v3.1}{2007/07/01}{This macro added}
2648 % |\caption@addcontentsline|\marg{type}\marg{list entry}\par
2649 % Makes an entry in the list-of-whatever, if requested,
2650 % i.e.~the argument \meta{list entry} is not empty and
2651 % |listof=| was set to |true|.
2652 % \begin{macrocode}
2653 \newcommand*\caption@addcontentsline[2]{%
2654 \caption@iflist
2655 {\def\@tempa{#2}}%
2656 {\let\@tempa\@empty}%
2657 \ifx\@tempa\@empty \else
2658 {\let\\\space
2659 \addcontentsline{\csname ext@#1\endcsname}{#1}%
2660 {\protect\numberline
2661 {\caption@lstfmt{\@nameuse{p@#1}}{\@nameuse{the#1}}}%
2662 {\ignorespaces #2}}}%
2663 \fi}
2664 % \end{macrocode}
2665 % \end{macro}
2666 %
2667 % \subsection{Typesetting the caption}
2668 %
2669 % \begin{macro}{\ifcaption@star}
2670 % If the starred form of |\caption| is used, this will be set to |true|.
2671 % (It will be reset to |false| at the end of |\caption@@make|.)
2672 % \begin{macrocode}
2673 \newif\ifcaption@star
2674 % \end{macrocode}
2675 % \end{macro}
2676 %
2677 % \begin{macro}{\caption@fnum}
2678 % \changes{v3.1}{2007/08/21}{This macro added}
2679 % |\caption@fnum|\marg{float type}\par
2680 % Typesets the caption label; as replacement for |\fnum@|\meta{float type}.
2681 % \begin{macrocode}
2682 \newcommand*\caption@fnum[1]{\caption@lfmt{\@nameuse{#1name}}{\@nameuse{the#1}}}
2683 % \end{macrocode}
2684 % \end{macro}
2685 %
2686 % \begin{macro}{\caption@make}
2687 % |\caption@make|\marg{float name}\marg{ref.\ number}\marg{text}\par
2688 % Typesets the caption.
2689 % \begin{macrocode}
2690 \newcommand\caption@make[2]{\caption@@make{\caption@lfmt{#1}{#2}}}
2691 % \end{macrocode}
2692 % \end{macro}
2693 %
2694 % \begin{macro}{\caption@@make}
2695 % \changes{v3.0b}{2004/05/16}{Bugfix 04-05-05: \cs{ifdim}\cs{captionindent=}\cs{z@} added}
2696 % \changes{v3.0d}{2005/02/12}{Bugfix 04-10-26: Use \cs{@tempdima} instead of
2697 % \cs{captionmargin} resp. \cs{captionwidth}; check for \cs{z@} added}
2698 % \changes{v3.0d}{2005/02/12}{Bugfix: \cs{hskip}\cs{captionmargin} to the end
2699 % of caption added}
2700 % \changes{v3.0d}{2005/02/12}{Bugfix: \cs{strut} moved from here to \cs{caption@@@make}}
2701 % \changes{v3.0d}{2005/02/12}{Single-line-check moved up so it can affect margins now}
2702 % \changes{v3.0d}{2005/02/09}{Improvement: \cs{caption@ifh} added}
2703 % \changes{v3.0d}{2005/02/09}{Bugfix: \cs{leavevmode} added}
2704 % \changes{v3.0h}{2005/08/24}{Uses \cs{sbox} instead of \cs{setbox} in single-line-check}
2705 % \changes{v3.0i}{2005/12/04}{Uses \cs{caption@slc} now}
2706 % \changes{v3.0i}{2006/01/11}{Bugfix: \cs{caption@calcmargin} inside
2707 % single-line-check replaced by \cs{relax}}
2708 % \changes{v3.0i}{2006/01/11}{Bugfix: \cs{caption@startbox} will always be
2709 % typeset in horizontal mode}
2710 % \changes{v3.0k}{2006/05/13}{Uses \cs{caption@parbox} instead of \cs{caption@start/endbox}}
2711 % \changes{v3.0l}{2007/01/04}{Oops, bugfix 04-05-05 got lost in v3.0j, re-added}
2712 % \changes{v3.0p}{2007/04/03}{Usage of \cs{caption@ifoddpage} added}
2713 % \changes{v3.1}{2007/07/29}{\cs{caption@calcmargin} moved below single-line-check}
2714 % \changes{v3.1e}{2007/10/28}{\cs{caption@stepcounter} added}
2715 % |\caption@@make|\marg{caption label}\marg{caption text}
2716 % \begin{macrocode}
2717 \newcommand\caption@@make[2]{%
2718 \begingroup
2719 \caption@stepcounter
2720 \caption@beginhook
2721 % \end{macrocode}
2722 %
2723 % Check margin, if |\caption@minmargin| or |\caption@maxmargin| is set
2724 % \begin{macrocode}
2725 \ifx\caption@maxmargin\@undefined \else
2726 \ifdim\captionmargin>\caption@maxmargin\relax
2727 \captionmargin\caption@maxmargin\relax
2728 \fi
2729 \fi
2730 \ifx\caption@minmargin\@undefined \else
2731 \ifdim\captionmargin<\caption@minmargin\relax
2732 \captionmargin\caption@minmargin\relax
2733 \fi
2734 \fi
2735 % \end{macrocode}
2736 %
2737 % Special single-line treatment (option |singlelinecheck=|)
2738 % \begin{macrocode}
2739 \caption@ifslc{\caption@slc{#1}{#2}\captionwidth\relax}{}%
2740 % \end{macrocode}
2741 %
2742 % Typeset the left margin (option |margin=|)
2743 % \begin{macrocode}
2744 \caption@calcmargin
2745 \@tempdima\captionmargin
2746 \ifdim\captionmargin@=\z@ \else
2747 \caption@ifoddpage{}{\advance\@tempdima\captionmargin@}%
2748 \fi
2749 \caption@ifh{\advance\@tempdima\caption@indent}%
2750 \hspace\@tempdima
2751 % \end{macrocode}
2752 %
2753 % We actually use a |\vbox| of width |\captionwidth - \caption@indent|
2754 % to typeset the caption.
2755 % \Note{\cs{captionindent} is \emph{not} supported if the caption format
2756 % was defined with \cs{DeclareCaptionFormat*}.}
2757 % \begin{macrocode}
2758 \@tempdima\captionwidth
2759 \caption@ifh{\advance\@tempdima-\caption@indent}%
2760 \caption@parbox\@tempdima{%
2761 % \end{macrocode}
2762 %
2763 % Typeset the indention (option |indention=|)\\
2764 % {\small Bugfix 04-05-05:
2765 % |\hskip-\caption@indent| replaced by |\ifdim\caption@indent=\z@|\ldots}
2766 % \begin{macrocode}
2767 \caption@ifh{%
2768 \ifdim\caption@indent=\z@
2769 \leavevmode
2770 \else
2771 \hskip-\caption@indent
2772 \fi}%
2773 % \end{macrocode}
2774 %
2775 % Typeset the caption itself and close the |\caption@parbox|
2776 % \begin{macrocode}
2777 \caption@@@make{#1}{#2}}%
2778 % \end{macrocode}
2779 %
2780 % Typeset the right margin (option |margin=|)
2781 % \begin{macrocode}
2782 \@tempdima\captionmargin
2783 \ifdim\captionmargin@=\z@ \else
2784 \caption@ifoddpage{\advance\@tempdima\captionmargin@}{}%
2785 \fi
2786 \hspace\@tempdima
2787 % \end{macrocode}
2788 %
2789 % \begin{macrocode}
2790 \caption@endhook
2791 \endgroup
2792 % \end{macrocode}
2793 %
2794 % \begin{macrocode}
2795 \global\caption@starfalse}
2796 % \end{macrocode}
2797 % \end{macro}
2798 %
2799 % \begin{macro}{\caption@calcmargin}
2800 % \changes{v3.0h}{2005/10/24}{Internal: \cs{ifcaption@width} replaced by
2801 % \cs{ifdim}\cs{captionwidth=}\cs{z@}}
2802 % \changes{v3.0i}{2006/01/12}{Improvement: Takes care of list environment now}
2803 % \changes{v3.1}{2006/05/13}{Check of \cs{@listdepth} removed (not necessary anymore),
2804 % use \cs{linewidth} instead of \cs{hsize}}
2805 % |\caption@calcmargin|\par
2806 % Calculate |\captionmargin| \& |\captionwidth|, so both contain valid
2807 % values.
2808 % \begin{macrocode}
2809 \newcommand*\caption@calcmargin{%
2810 \ifdim\captionwidth=\z@
2811 \captionwidth\linewidth
2812 \advance\captionwidth by -2\captionmargin
2813 \advance\captionwidth by -\captionmargin@
2814 \else
2815 \captionmargin\linewidth
2816 \advance\captionmargin by -\captionwidth
2817 \divide\captionmargin by 2
2818 \captionmargin@\z@
2819 \fi
2820 % \end{macrocode}
2821 % \begin{macrocode}
2822 \caption@Debug{%
2823 \string\hsize=\the\hsize,
2824 \string\linewidth=\the\linewidth,\MessageBreak
2825 \string\leftmargin=\the\leftmargin,
2826 \string\rightmargin=\the\rightmargin,\MessageBreak
2827 \string\margin=\the\captionmargin,
2828 \string\margin@=\the\captionmargin@,
2829 \string\width=\the\captionwidth}%
2830 % \end{macrocode}
2831 % \begin{macrocode}
2832 }
2833 % \end{macrocode}
2834 % \end{macro}
2835 %
2836 % \begin{macro}{\caption@slc}
2837 % \changes{v3.1}{2007/06/13}{\cs{let}\cs{caption@hj}\cs{relax} added}
2838 % \changes{v3.1}{2007/07/29}{\cs{caption@setup}\cs{caption@sls} added after \cs{begingroup}}
2839 % \changes{v3.1}{2007/07/29}{\cs{caption@calcmargin} added}
2840 % \changes{v3.1c}{2007/10/14}{Support of \cs{caption@slfmt} added}
2841 % \changes{v3.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency}
2842 % |\caption@slc|\marg{label}\marg{text}\marg{width}\marg{extra code}\par
2843 % This one does the single-line-check.
2844 % \begin{macrocode}
2845 \newcommand\caption@slc[4]{%
2846 \caption@Debug{Begin SLC}%
2847 \begingroup
2848 \caption@singleline
2849 \let\caption@hj\@empty
2850 \caption@calcmargin % calculate #3 if necessary
2851 \caption@prepareslc
2852 \sbox\@tempboxa{\caption@@@make{#1}{#2}}%
2853 \ifdim\wd\@tempboxa>#3%
2854 \endgroup
2855 \else
2856 \endgroup
2857 \caption@singleline
2858 #4%
2859 \fi
2860 \caption@Debug{End SLC}}
2861 % \end{macrocode}
2862 % \begin{macrocode}
2863 \newcommand*\caption@singleline{%
2864 \caption@xsetup\caption@opt@singleline
2865 \let\caption@fmt\caption@slfmt}
2866 % \end{macrocode}
2867 % \end{macro}
2868 %
2869 % \begin{macro}{\caption@prepareslc}
2870 % \changes{v3.0b}{2004/05/16}{Bugfix: Redefinition of \cs{label} \& \cs{@footnotetext} added}
2871 % \changes{v3.0b}{2004/05/16}{Redefine \cs{stepcounter} instead of \cs{footnote(mark)}}
2872 % \changes{v3.0d}{2005/02/12}{\cs{let}\cs{caption@hj}\cs{relax} added}
2873 % \changes{v3.0h}{2005/07/09}{Support of \package{endnotes} package added}
2874 % \changes{v3.1}{2007/06/13}{\cs{let}\cs{caption@hj}\cs{relax} moved to \cs{caption@slc}}
2875 % \changes{v3.1}{2007/06/13}{Redefinition of \cs{(H@)refstepcounter} added}
2876 % \changes{v3.1}{2007/08/12}{Redefinition of \cs{label} improved}
2877 % \changes{v3.1c}{2007/10/06}{Definition of \cs{caption@l@stepcounter} added}
2878 % |\caption@prepareslc|\par
2879 % Re-define anything which would disturb the single-line-check.
2880 % \begin{macrocode}
2881 \newcommand*\caption@prepareslc{%
2882 \let\@footnotetext\@gobble\let\@endnotetext\@gobble
2883 \def\label{\caption@withoptargs\@gobbletwo}%
2884 \let\stepcounter\caption@l@stepcounter
2885 \let\refstepcounter\stepcounter\let\H@refstepcounter\stepcounter}
2886 % \end{macrocode}
2887 % \begin{macrocode}
2888 \newcommand*\caption@l@stepcounter[1]{\advance\csname c@#1\endcsname\@ne\relax}
2889 % \end{macrocode}
2890 % \end{macro}
2891 %
2892 % \begin{macro}{\caption@parbox}
2893 % \changes{v3.0k}{2006/05/13}{We define \cs{caption@parbox} instead of
2894 % \cs{caption@start/endbox}}
2895 % \changes{v3.0n}{2006/03/09}{Bugfix 07-03-09: \cs{caption@parbox} changed from
2896 % \cs{parbox-t} to \cs{parbox-b}}
2897 % \changes{v3.1f}{2007/11/11}{Renamed from \cs{captionbox} to \cs{caption@parbox}}
2898 % |\caption@parbox|\marg{width}\marg{contents}\par
2899 % This macro defines the box which surrounds the caption paragraph.
2900 % \begin{macrocode}
2901 \newcommand*\caption@parbox{\parbox[b]}
2902 % \end{macrocode}
2903 % \end{macro}
2904 %
2905 % \begin{macro}{\caption@@@make}
2906 % \changes{v3.0b}{2004/05/16}{Bugfix 04-05-06: \cs{allowhyphens} added}
2907 % \changes{v3.0d}{2005/02/12}{Bugfix 04-12-16: Use some kind of
2908 % \cs{@startstrut}\cs{strutbox} instead of \cs{strut}}
2909 % \changes{v3.0d}{2005/02/12}{Bugfix 05-01-23: \cs{@finalstrut}\cs{strutbox} added}
2910 % \changes{v3.0e}{2005/05/05}{Use \cs{caption@ifempty};
2911 % \cs{let}\cs{caption@ifstrut}\cs{@secondoftwo} added}
2912 % \changes{v3.0e}{2005/05/05}{Bugfix: Handling of \cs{ifcaption@star} changed}
2913 % \changes{v3.0h}{2005/08/24}{Check for empty label added}
2914 % \changes{v3.0h}{2005/08/25}{\cs{caption@iflf} added}
2915 % \changes{v3.0l}{2007/02/18}{Usage of \cs{caption@tfmt} added}
2916 % \changes{v3.1}{2007/05/07}{Bugfix: \cs{ifhmode} added to \cs{@finalstrut}}
2917 % \changes{v3.1f}{2007/11/17}{Made option \opt{size=} stronger than \opt{font=}}
2918 % |\caption@@@make|\marg{caption label}\marg{caption text}\par
2919 % This one finally typesets the caption paragraph, without margin and indention.
2920 % \begin{macrocode}
2921 \newcommand\caption@@@make[2]{%
2922 % \end{macrocode}
2923 %
2924 % If the label is empty, we use no caption label separator.
2925 % \begin{macrocode}
2926 \sbox\@tempboxa{#1}%
2927 \ifdim\wd\@tempboxa=\z@
2928 \let\caption@lsep\relax
2929 % \@capbreakfalse
2930 \fi
2931 % \end{macrocode}
2932 %
2933 % If the text is empty, we use no caption label separator, too.
2934 % \begin{macrocode}
2935 \caption@ifempty{#2}{%
2936 \let\caption@lsep\relax
2937 % \@capbreakfalse
2938 % \let\caption@ifstrut\@secondoftwo
2939 }%
2940 % \end{macrocode}
2941 %
2942 % Take care that |\caption@parindent| and |\caption@hangindent| will be used
2943 % to typeset the paragraph.
2944 % \begin{macrocode}
2945 \@setpar{\@@par\caption@@par}\caption@@par
2946 % \end{macrocode}
2947 %
2948 % Finally typeset the caption.
2949 % \begin{macrocode}
2950 \caption@hj\captionfont\captionsize\caption@fmt
2951 {\ifcaption@star\else{\captionlabelfont#1}\fi}%
2952 {\ifcaption@star\else{\caption@iflf\captionlabelfont\caption@lsep}\fi}%
2953 {{\captiontextfont
2954 \caption@ifstrut{\vrule\@height\ht\strutbox\@width\z@}{}%
2955 \nobreak\hskip\z@skip % enable hyphenation
2956 \caption@tfmt{#2}%
2957 % \caption@ifstrut{\vrule\@height\z@\@depth\dp\strutbox\@width\z@}{}%
2958 \caption@ifstrut{\ifhmode\@finalstrut\strutbox\fi}{}%
2959 \par}}}
2960 % \end{macrocode}
2961 % \end{macro}
2962 %
2963 % \begin{macro}{\caption@ifempty}
2964 % \changes{v3.0e}{2005/05/05}{This macro added}
2965 % \changes{v3.1}{2007/07/04}{Re-defines itself now}
2966 % \changes{v3.1g}{2007/01/22}{Revised so \cs{label} will be detected, too}
2967 % \changes{v3.1i}{2008/08/02}{Revised so \cs{index} and \cs{glossary} will be detected, too}
2968 % |\caption@ifempty|\marg{text}\marg{true} (\emph{no} \meta{false})\par
2969 % This one tests if the \meta{text} is actually empty.
2970 % \Note{This will be done without expanding the text,
2971 % therefore this is far away from being bullet-proof.}
2972 % \Note{This macro is re-defining itself so only
2973 % the first test (in a group) will actually be done.}
2974 % \begin{macrocode}
2975 \newcommand\caption@ifempty[1]{%
2976 \caption@if@empty{#1}%
2977 \caption@ifempty\@unused}
2978 % \end{macrocode}
2979 % \begin{macrocode}
2980 \newcommand\caption@if@empty[1]{%
2981 \def\caption@tempa{#1}%
2982 \ifx\caption@tempa\@empty
2983 \let\caption@ifempty\@secondoftwo
2984 \else
2985 \expandafter\def\expandafter\caption@tempa\expandafter{%
2986 \caption@car#1\caption@if@empty\caption@nil}%
2987 \def\caption@tempb{\caption@if@empty}%
2988 \ifx\caption@tempa\caption@tempb
2989 \let\caption@ifempty\@secondoftwo
2990 \else
2991 \def\caption@tempb{\ignorespaces}%
2992 \ifx\caption@tempa\caption@tempb
2993 \expandafter\caption@if@empty\expandafter{\@gobble#1}%
2994 \else
2995 \def\caption@tempb{\label}%
2996 \ifx\caption@tempa\caption@tempb
2997 \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
2998 \else
2999 \def\caption@tempb{\index}%
3000 \ifx\caption@tempa\caption@tempb
3001 \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
3002 \else
3003 \def\caption@tempb{\glossary}%
3004 \ifx\caption@tempa\caption@tempb
3005 \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
3006 \else
3007 \let\caption@ifempty\@gobbletwo
3008 \fi
3009 \fi
3010 \fi
3011 \fi
3012 \fi
3013 \fi}
3014 % \end{macrocode}
3015 % \begin{macrocode}
3016 \long\def\caption@car#1#2\caption@nil{#1}% same as \@car, but \long
3017 % \end{macrocode}
3018 % \end{macro}
3019 %
3020 % \begin{macro}{\caption@@par}
3021 % \changes{v3.0h}{2005/08/22}{Made this definition global}
3022 % |\caption@@par|\par
3023 % This command will be executed with every |\par| inside the caption.
3024 % \begin{macrocode}
3025 \newcommand*\caption@@par{%
3026 \parindent\caption@parindent\hangindent\caption@hangindent}%
3027 % \end{macrocode}
3028 % \end{macro}
3029 %
3030 % \subsection{Types \& sub-types}
3031 %
3032 % \begin{macro}{\DeclareCaptionType}
3033 % \changes{v3.1}{2007/08/12}{This macro added}
3034 % \changes{v3.1a}{2007/09/07}{Three optional arguments added}
3035 % \changes{v3.1f}{2007/12/06}{Renamed from \cs{DeclareFloatingEnvironment} to \cs{DeclareCaptionType}}
3036 % \changes{v3.1f}{2007/12/21}{Optional argument revised, uses key-value syntax now}
3037 % \changes{v3.1i}{2008/04/13}{Uses \cs{caption@within@default} now}
3038 % \changes{v3.1i}{2008/08/02}{Support of \cs{float@exts} and \cs{float@addtolists} added}
3039 % \changes{v3.1l}{2010/01/09}{Usage of \cs{caption@DeclareWithinOption} added}
3040 % |\DeclareCaptionType|\oarg{options}\marg{environment}\oarg{name}\oarg{list name}
3041 % \begin{macrocode}
3042 \newcommand*\DeclareCaptionType{%
3043 \@testopt\@DeclareCaptionType{}}
3044 \@onlypreamble\DeclareCaptionType
3045 % \end{macrocode}
3046 % \begin{macrocode}
3047 \def\@DeclareCaptionType[#1]#2{%
3048 \def\caption@type{#2}%
3049 \caption@Debug{New type `#2'}%
3050 \newcounter{#2}\@namedef{theH#2}{}%
3051 \KV@caption@DCT@within\caption@within@default
3052 \caption@DeclareWithinOption{#2}%
3053 \KV@caption@DCT@placement{tbp}%
3054 \@ifundefined{c@float@type}%
3055 {\newcounter{float@type}%
3056 \setcounter{float@type}{\@ifundefined{c@figure}14}}%
3057 {}%
3058 \caption@Debug{float type `#2'=\the\value{float@type}}%
3059 \expandafter\xdef\csname ftype@#2\endcsname{\the\value{float@type}}%
3060 \addtocounter{float@type}{\value{float@type}}%
3061 \KV@caption@DCT@fileext{lo#2}%
3062 \@namedef{fnum@#2}{\@nameuse{#2name}\nobreakspace\@nameuse{the#2}}%
3063 \newenvironment{#2}{\@float{#2}}{\end@float}%
3064 \newenvironment{#2*}{\@dblfloat{#2}}{\end@dblfloat}%
3065 \expandafter\newcommand\csname listof#2s\endcsname{\caption@listof{#2}}%
3066 \@ifundefined{l@figure}%
3067 {\@namedef{l@#2}{\@dottedtocline{1}{1.5em}{2.3em}}}%
3068 {\expandafter\let\csname l@#2\endcsname\l@figure}%
3069 % \end{macrocode}
3070 % \begin{macrocode}
3071 \expandafter\newcommand\csname #2name\endcsname{}%
3072 \edef\@tempa{\def\noexpand\@tempa{\@car#2\@nil}}%
3073 \uppercase\expandafter{\@tempa}%
3074 \edef\@tempb{\noexpand\g@addto@macro\noexpand\@tempa{\@cdr#2\@nil}}%
3075 \@tempb
3076 \expandafter\let\csname #2name\endcsname\@tempa
3077 \expandafter\newcommand\csname list#2name\endcsname{}%
3078 \expandafter\xdef\csname list#2name\endcsname{List of \@tempa s}%
3079 % \end{macrocode}
3080 % \begin{macrocode}
3081 \@cons\caption@typelist{{#2}}%
3082 \caption@setkeys[caption]{caption@DCT}{#1}%
3083 % \end{macrocode}
3084 % \begin{macrocode}
3085 \@ifundefined{float@exts}{\newtoks\float@exts}{}%
3086 \let\float@do=\relax
3087 \edef\@tempa{\noexpand\float@exts{\the\float@exts\float@do{\@nameuse{ext@#2}}}}%
3088 \@tempa
3089 \@ifundefined{float@addtolists}{%
3090 \newcommand\float@addtolists[1]{%
3091 \def\float@do####1{\addtocontents{####1}{##1}}\the\float@exts}%
3092 \@ifundefined{@chapter}{}{\caption@PatchChapter}}{}%
3093 % \end{macrocode}
3094 % \begin{macrocode}
3095 \@ifnextchar[\@@DeclareCaptionType\relax}
3096 \@onlypreamble\@DeclareCaptionType
3097 % \end{macrocode}
3098 % \begin{macrocode}
3099 \def\@@DeclareCaptionType[#1]{%
3100 \KV@caption@DCT@name{#1}%
3101 \@ifnextchar[\@@@DeclareCaptionType\relax}
3102 \@onlypreamble\@@DeclareCaptionType
3103 % \end{macrocode}
3104 % \begin{macrocode}
3105 \def\@@@DeclareCaptionType[#1]{%
3106 \KV@caption@DCT@listname{#1}}
3107 \@onlypreamble\@@@DeclareCaptionType
3108 % \end{macrocode}
3109 % \begin{macrocode}
3110 \let\DeclareFloatingEnvironment\DeclareCaptionType % old command name
3111 \@onlypreamble\DeclareFloatingEnvironment
3112 % \end{macrocode}
3113 % \end{macro}
3114 %
3115 % \begin{macro}{\caption@within@default}
3116 % \changes{v3.1i}{2008/04/13}{This macro added}
3117 % The default `within' value.
3118 % \begin{macrocode}
3119 \newcommand*\caption@within@default{\@ifundefined{c@chapter}{none}{chapter}}
3120 \@onlypreamble\caption@within@default
3121 % \end{macrocode}
3122 % \end{macro}
3123 %
3124 % \begin{macro}{\caption@listof}
3125 % \changes{v3.1f}{2007/12/21}{This macro added}
3126 % |\caption@listof|\marg{float type}
3127 % \begin{macrocode}
3128 \newcommand*\caption@listof[1]{%
3129 \begingroup
3130 \expandafter\let\expandafter\listfigurename\csname list#1name\endcsname
3131 \expandafter\let\expandafter\ext@figure\csname ext@#1\endcsname
3132 \let\caption@ORI@starttoc\@starttoc
3133 \renewcommand*\@starttoc[1]{%
3134 \expandafter\caption@ORI@starttoc\expandafter{\ext@figure}}%
3135 \listoffigures
3136 \endgroup}
3137 % \end{macrocode}
3138 % \end{macro}
3139 %
3140 % \begin{macro}{\caption@typelist}
3141 % An \cs{@elt}-list containing the caption types defined
3142 % with |\Declare|\x|Caption|\x|Type|.
3143 % \begin{macrocode}
3144 \newcommand*\caption@typelist{}
3145 % \end{macrocode}
3146 % \end{macro}
3147 %
3148 % The available \meta{options} are:
3149 % |fileext=|\meta{file extension},
3150 % |listname=|\meta{list name},
3151 % |name=|\meta{prosa name},
3152 % |placement=|\meta{htbp},
3153 % |within=|\meta{none,chapter,section}, and
3154 % |without|.
3155 % \begin{macrocode}
3156 \define@key{caption@DCT}{fileext}{\@namedef{ext@\caption@type}{#1}}
3157 \@onlypreamble@key{caption@DCT}{fileext}
3158 \define@key{caption@DCT}{listname}{\@namedef{list\caption@type name}{#1}}
3159 \@onlypreamble@key{caption@DCT}{listname}
3160 \define@key{caption@DCT}{name}{\@namedef{\caption@type name}{#1}}
3161 \@onlypreamble@key{caption@DCT}{name}
3162 \define@key{caption@DCT}{placement}{\@namedef{fps@\caption@type}{#1}}
3163 \@onlypreamble@key{caption@DCT}{placement}
3164 \define@key{caption@DCT}{within}{%
3165 \@ifundefined{c@chapter}{}{\@removefromreset\caption@type{chapter}}%
3166 \@removefromreset\caption@type{section}%
3167 \begingroup
3168 \caption@setkeys[caption]{caption@within}{#1}%
3169 \endgroup}
3170 %\@onlypreamble@key{caption@DCT}{within}
3171 \define@key{caption@DCT}{without}{\KV@caption@DCT@within{none}}
3172 %\@onlypreamble@key{caption@DCT}{without}
3173 % \end{macrocode}
3174 % \changes{v3.1k}{2009/03/29}{Bugfix 08-09-25: \texttt{within=section} fixed}
3175 % \begin{macrocode}
3176 \define@key{caption@within}{none}[]{%
3177 \caption@within{}{}}
3178 %\@onlypreamble@key{caption@within}{none}
3179 \define@key{caption@within}{section}[]{%
3180 \@addtoreset\caption@type{section}%
3181 \caption@within{\ifnum\c@section>\z@ \thesection.\fi}{\theHsection.}}
3182 %\@onlypreamble@key{caption@within}{section}
3183 \@ifundefined{c@chapter}{}{%
3184 \define@key{caption@within}{chapter}[]{%
3185 \@addtoreset\caption@type{chapter}%
3186 \caption@within{\ifnum\c@chapter>\z@ \thechapter.\fi}{\theHchapter.}}
3187 }% \@onlypreamble@key{caption@within}{chapter}}
3188 % \end{macrocode}
3189 % \begin{macro}{\caption@within}
3190 % \changes{v3.1f}{2007/12/21}{This macro added}
3191 % |\caption@within|\marg{thecode}\marg{theHcode}
3192 % \begin{macrocode}
3193 \newcommand*\caption@within{%
3194 \expandafter\caption@within@\expandafter{\caption@type}}
3195 %\@onlypreamble\caption@within
3196 \newcommand*\caption@within@[3]{%
3197 \global\@namedef{the#1}{#2\arabic{#1}}%
3198 \@ifundefined{theH#1}\caption@AtBeginDocument\@firstofone
3199 {\global\@namedef{theH#1}{#3\arabic{#1}}}}
3200 %\@onlypreamble\caption@within@
3201 % \end{macrocode}
3202 % \end{macro}
3203 %
3204 % \begin{macro}{\@removefromreset}
3205 % \changes{v3.1f}{2007/12/21}{This macro added}
3206 % This code was taken from the \package{remreset} package
3207 % which is part of the `carlisle' package bundle.
3208 % (Copyright 1997 David Carlisle)
3209 % \begin{macrocode}
3210 \providecommand*\@removefromreset[2]{{%
3211 \expandafter\let\csname c@#1\endcsname\@removefromreset
3212 \def\@elt##1{%
3213 \expandafter\ifx\csname c@##1\endcsname\@removefromreset
3214 \else
3215 \noexpand\@elt{##1}%
3216 \fi}%
3217 \expandafter\xdef\csname cl@#2\endcsname{%
3218 \csname cl@#2\endcsname}}}
3219 % \end{macrocode}
3220 % \end{macro}
3221 %
3222 % \begin{macro}{\caption@PatchChapter}
3223 % \changes{v3.1i}{2008/08/02}{This macro added}
3224 % We try to patch \cs{@chapter} so \cs{float@addtolists} will be supported.
3225 % (Note: The \KOMAScript\ classes already support \cs{float@addtolists}.)
3226 % \begin{macrocode}
3227 \newcommand*\caption@PatchChapter{%
3228 \providecommand*\@chapterlistsgap{10\p@}%
3229 % \end{macrocode}
3230 % \begin{macrocode}
3231 % report.cls [2005/09/16 v1.4f Standard LaTeX document class]
3232 \caption@patch@chapter{report}{%
3233 \ifnum \c@secnumdepth >\m@ne
3234 \refstepcounter{chapter}%
3235 \typeout{\@chapapp\space\thechapter.}%
3236 \addcontentsline{toc}{chapter}%
3237 {\protect\numberline{\thechapter}##1}%
3238 \else
3239 \addcontentsline{toc}{chapter}{##1}%
3240 \fi
3241 \chaptermark{##1}%
3242 \addtocontents{lof}{\protect\addvspace{10\p@}}%
3243 \addtocontents{lot}{\protect\addvspace{10\p@}}%
3244 \if@twocolumn
3245 \@topnewpage[\@makechapterhead{##2}]%
3246 \else
3247 \@makechapterhead{##2}%
3248 \@afterheading
3249 \fi
3250 }{%
3251 \ifnum \c@secnumdepth >\m@ne
3252 \refstepcounter{chapter}%
3253 \typeout{\@chapapp\space\thechapter.}%
3254 \addcontentsline{toc}{chapter}%
3255 {\protect\numberline{\thechapter}##1}%
3256 \else
3257 \addcontentsline{toc}{chapter}{##1}%
3258 \fi
3259 \chaptermark{##1}%
3260 \ifdim \@chapterlistsgap>\z@
3261 \addtocontents{lof}{\protect\addvspace{\@chapterlistsgap}}%
3262 \addtocontents{lot}{\protect\addvspace{\@chapterlistsgap}}%
3263 \float@addtolists{\protect\addvspace{\@chapterlistsgap}}%
3264 \fi
3265 \if@twocolumn
3266 \@topnewpage[\@makechapterhead{##2}]%
3267 \else
3268 \@makechapterhead{##2}%
3269 \@afterheading
3270 \fi}%
3271 % \end{macrocode}
3272 % \begin{macrocode}
3273 % book.cls [2005/09/16 v1.4f Standard LaTeX document class]
3274 \caption@patch@chapter{book}{%
3275 \ifnum \c@secnumdepth >\m@ne
3276 \if@mainmatter
3277 \refstepcounter{chapter}%
3278 \typeout{\@chapapp\space\thechapter.}%
3279 \addcontentsline{toc}{chapter}%
3280 {\protect\numberline{\thechapter}##1}%
3281 \else
3282 \addcontentsline{toc}{chapter}{##1}%
3283 \fi
3284 \else
3285 \addcontentsline{toc}{chapter}{##1}%
3286 \fi
3287 \chaptermark{##1}%
3288 \addtocontents{lof}{\protect\addvspace{10\p@}}%
3289 \addtocontents{lot}{\protect\addvspace{10\p@}}%
3290 \if@twocolumn
3291 \@topnewpage[\@makechapterhead{##2}]%
3292 \else
3293 \@makechapterhead{##2}%
3294 \@afterheading
3295 \fi
3296 }{%
3297 \ifnum \c@secnumdepth >\m@ne
3298 \if@mainmatter
3299 \refstepcounter{chapter}%
3300 \typeout{\@chapapp\space\thechapter.}%
3301 \addcontentsline{toc}{chapter}%
3302 {\protect\numberline{\thechapter}##1}%
3303 \else
3304 \addcontentsline{toc}{chapter}{##1}%
3305 \fi
3306 \else
3307 \addcontentsline{toc}{chapter}{##1}%
3308 \fi
3309 \chaptermark{##1}%
3310 \ifdim \@chapterlistsgap>\z@
3311 \addtocontents{lof}{\protect\addvspace{\@chapterlistsgap}}%
3312 \addtocontents{lot}{\protect\addvspace{\@chapterlistsgap}}%
3313 \float@addtolists{\protect\addvspace{\@chapterlistsgap}}%
3314 \fi
3315 \if@twocolumn
3316 \@topnewpage[\@makechapterhead{##2}]%
3317 \else
3318 \@makechapterhead{##2}%
3319 \@afterheading
3320 \fi}%
3321 % \end{macrocode}
3322 % \begin{macrocode}
3323 % amsbook.cls [2004/08/06 v2.20]
3324 % smfbook.cls [1999/11/15 v1.2f Classe LaTeX pour les monographies editees par la SMF]
3325 \caption@patch@chapter{ams/smfbook}{%
3326 \refstepcounter{chapter}%
3327 \ifnum\c@secnumdepth<\z@ \let\@secnumber\@empty
3328 \else \let\@secnumber\thechapter \fi
3329 \typeout{\chaptername\space\@secnumber}%
3330 \def\@toclevel{0}%
3331 \ifx\chaptername\appendixname \@tocwriteb\tocappendix{chapter}{##2}%
3332 \else \@tocwriteb\tocchapter{chapter}{##2}\fi
3333 \chaptermark{##1}%
3334 \addtocontents{lof}{\protect\addvspace{10\p@}}%
3335 \addtocontents{lot}{\protect\addvspace{10\p@}}%
3336 \@makechapterhead{##2}\@afterheading
3337 }{%
3338 \refstepcounter{chapter}%
3339 \ifnum\c@secnumdepth<\z@ \let\@secnumber\@empty
3340 \else \let\@secnumber\thechapter \fi
3341 \typeout{\chaptername\space\@secnumber}%
3342 \def\@toclevel{0}%
3343 \ifx\chaptername\appendixname \@tocwriteb\tocappendix{chapter}{##2}%
3344 \else \@tocwriteb\tocchapter{chapter}{##2}\fi
3345 \chaptermark{##1}%
3346 \ifdim \@chapterlistsgap>\z@
3347 \addtocontents{lof}{\protect\addvspace{\@chapterlistsgap}}%
3348 \addtocontents{lot}{\protect\addvspace{\@chapterlistsgap}}%
3349 \float@addtolists{\protect\addvspace{\@chapterlistsgap}}%
3350 \fi
3351 \@makechapterhead{##2}\@afterheading}%
3352 % \end{macrocode}
3353 % \begin{macrocode}
3354 % scrreprt/scrbook.cls
3355 \@ifundefined{KOMAClassName}{}{%
3356 \caption@Debug{document class `\KOMAClassName' detected}%
3357 \let\caption@patch@chapter\@gobblethree}%
3358 % \end{macrocode}
3359 % \begin{macrocode}
3360 % rapport1/3.cls [2004/06/07 v2.1a NTG LaTeX document class]
3361 \caption@patch@chapter{rapport}{%
3362 \ifnum \c@secnumdepth >\m@ne
3363 \refstepcounter{chapter}%
3364 \typeout{\@chapapp\space\thechapter.}%
3365 \addcontentsline{toc}{chapter}%
3366 {\protect\numberline{\thechapter}\toc@font0 ##1}%
3367 \else
3368 \addcontentsline{toc}{chapter}{\toc@font0 ##1}%
3369 \fi
3370 \chaptermark{##1}%
3371 \addtocontents{lof}{\protect\addvspace{10\p@}}%
3372 \addtocontents{lot}{\protect\addvspace{10\p@}}%
3373 \if@twocolumn
3374 \@topnewpage[\@makechapterhead{##2}]%
3375 \else
3376 \@makechapterhead{##2}%
3377 \@afterheading
3378 \fi
3379 }{%
3380 \ifnum \c@secnumdepth >\m@ne
3381 \refstepcounter{chapter}%
3382 \typeout{\@chapapp\space\thechapter.}%
3383 \addcontentsline{toc}{chapter}%
3384 {\protect\numberline{\thechapter}\toc@font0 ##1}%
3385 \else
3386 \addcontentsline{toc}{chapter}{\toc@font0 ##1}%
3387 \fi
3388 \chaptermark{##1}%
3389 \ifdim \@chapterlistsgap>\z@
3390 \addtocontents{lof}{\protect\addvspace{\@chapterlistsgap}}%
3391 \addtocontents{lot}{\protect\addvspace{\@chapterlistsgap}}%
3392 \float@addtolists{\protect\addvspace{\@chapterlistsgap}}%
3393 \fi
3394 \if@twocolumn
3395 \@topnewpage[\@makechapterhead{##2}]%
3396 \else
3397 \@makechapterhead{##2}%
3398 \@afterheading
3399 \fi}%
3400 % \end{macrocode}
3401 % \begin{macrocode}
3402 % boek(3).cls [2004/06/07 v2.1a NTG LaTeX document class]
3403 \caption@patch@chapter{boek}{%
3404 \ifnum \c@secnumdepth >\m@ne
3405 \if@mainmatter
3406 \refstepcounter{chapter}%
3407 \typeout{\@chapapp\space\thechapter.}%
3408 \addcontentsline{toc}{chapter}%
3409 {\protect\numberline{\thechapter}\toc@font0 ##1}%
3410 \else
3411 \addcontentsline{toc}{chapter}{\toc@font0 ##1}%
3412 \fi
3413 \else
3414 \addcontentsline{toc}{chapter}{\toc@font0 ##1}%
3415 \fi
3416 \chaptermark{##1}%
3417 \addtocontents{lof}{\protect\addvspace{10\p@}}%
3418 \addtocontents{lot}{\protect\addvspace{10\p@}}%
3419 \if@twocolumn
3420 \@topnewpage[\@makechapterhead{##2}]%
3421 \else
3422 \@makechapterhead{##2}%
3423 \@afterheading
3424 \fi
3425 }{%
3426 \ifnum \c@secnumdepth >\m@ne
3427 \if@mainmatter
3428 \refstepcounter{chapter}%
3429 \typeout{\@chapapp\space\thechapter.}%
3430 \addcontentsline{toc}{chapter}%
3431 {\protect\numberline{\thechapter}\toc@font0 ##1}%
3432 \else
3433 \addcontentsline{toc}{chapter}{\toc@font0 ##1}%
3434 \fi
3435 \else
3436 \addcontentsline{toc}{chapter}{\toc@font0 ##1}%
3437 \fi
3438 \chaptermark{##1}%
3439 \ifdim \@chapterlistsgap>\z@
3440 \addtocontents{lof}{\protect\addvspace{\@chapterlistsgap}}%
3441 \addtocontents{lot}{\protect\addvspace{\@chapterlistsgap}}%
3442 \float@addtolists{\protect\addvspace{\@chapterlistsgap}}%
3443 \fi
3444 \if@twocolumn
3445 \@topnewpage[\@makechapterhead{##2}]%
3446 \else
3447 \@makechapterhead{##2}%
3448 \@afterheading
3449 \fi}%
3450 % \end{macrocode}
3451 % \begin{macrocode}
3452 % thesis.cls [1996/25/01 1.0g LaTeX document class (wm).]
3453 \caption@patch@chapter{thesis}{%
3454 \ifnum \c@secnumdepth >\m@ne
3455 \if@mainmatter
3456 \refstepcounter{chapter}%
3457 \typeout{\chaptername\space\thechapter.}
3458 \if@thema
3459 \ifx\@shortauthor\@empty
3460 \addcontentsline{toc}{chapter}{%
3461 \protect\numberline{\thechapter.}##1}%
3462 \else
3463 \addcontentsline{toc}{chapter}{%
3464 \protect\numberline{\thechapter.}%
3465 \@shortauthor\hfill\mbox{}\vskip\normallineskip ##1}%
3466 \fi
3467 \else
3468 \addcontentsline{toc}{chapter}{%
3469 \protect\numberline{\thechapter.}##1}%
3470 \fi
3471 \else
3472 \addcontentsline{toc}{chapter}{##1}
3473 \fi
3474 \else
3475 \addcontentsline{toc}{chapter}{##1}
3476 \fi
3477 \chaptermark{##1}
3478 \addtocontents{lof}{\protect\addvspace{10pt}}
3479 \addtocontents{lot}{\protect\addvspace{10pt}}
3480 \if@twocolumn
3481 \@topnewpage[\@makechapterhead{##2}]
3482 \else
3483 \@makechapterhead{##2}
3484 \@afterheading
3485 \fi
3486 }{%
3487 \ifnum \c@secnumdepth >\m@ne
3488 \if@mainmatter
3489 \refstepcounter{chapter}%
3490 \typeout{\chaptername\space\thechapter.}%
3491 \if@thema
3492 \ifx\@shortauthor\@empty
3493 \addcontentsline{toc}{chapter}{%
3494 \protect\numberline{\thechapter.}##1}%
3495 \else
3496 \addcontentsline{toc}{chapter}{%
3497 \protect\numberline{\thechapter.}%
3498 \@shortauthor\hfill\mbox{}\vskip\normallineskip ##1}%
3499 \fi
3500 \else
3501 \addcontentsline{toc}{chapter}{%
3502 \protect\numberline{\thechapter.}##1}%
3503 \fi
3504 \else
3505 \addcontentsline{toc}{chapter}{##1}%
3506 \fi
3507 \else
3508 \addcontentsline{toc}{chapter}{##1}%
3509 \fi
3510 \chaptermark{##1}%
3511 \ifdim \@chapterlistsgap>\z@
3512 \addtocontents{lof}{\protect\addvspace{\@chapterlistsgap}}%
3513 \addtocontents{lot}{\protect\addvspace{\@chapterlistsgap}}%
3514 \float@addtolists{\protect\addvspace{\@chapterlistsgap}}%
3515 \fi
3516 \if@twocolumn
3517 \@topnewpage[\@makechapterhead{##2}]%
3518 \else
3519 \@makechapterhead{##2}%
3520 \@afterheading
3521 \fi}%
3522 % \end{macrocode}
3523 % \begin{macrocode}
3524 \ifx\caption@patch@chapter\@gobblethree \else
3525 \caption@Debug{%
3526 Unsupported document class detected,\MessageBreak
3527 or \noexpand\@chapter was redefined by another package}%
3528 \fi
3529 \let\caption@PatchChapter\@undefined}
3530 %\@onlypreamble\caption@PatchChapter
3531 % \end{macrocode}
3532 % \begin{macrocode}
3533 \newcommand\caption@patch@chapter[3]{%
3534 \begingroup
3535 % \let\if@twocolumn\iffalse
3536 \let\if@mainmatter\iffalse
3537 \let\if@thema\iffalse
3538 \def\@tempa[##1]##2{#2}%
3539 \ifx\@tempa\@chapter
3540 \caption@Debug{document class `#1' detected}%
3541 \gdef\@chapter[##1]##2{#3}%
3542 \global\let\caption@patch@chapter\@gobblethree
3543 \fi
3544 \endgroup}
3545 %\@onlypreamble\caption@patch@chapter
3546 % \end{macrocode}
3547 % \begin{macrocode}
3548 \long\def \@gobblethree #1#2#3{}
3549 % \end{macrocode}
3550 % \end{macro}
3551 %
3552 % \begin{macro}{\@stpelt}
3553 % We patch \cs{@stpelt} so a list of `connected' counters will be reset, too.
3554 % (Like \cs{stepcounter} does in |ltcounts.dtx|.)
3555 % \begin{macrocode}
3556 \newcommand*\caption@patch@stpelt{%
3557 \let\caption@stpelt\@stpelt
3558 \def\@stpelt##1{%
3559 \caption@stpelt{##1}%
3560 \begingroup
3561 \let\@elt\caption@stpelt
3562 \csname caption@cl@##1\endcsname
3563 \endgroup}%
3564 \let\caption@patch@stpelt\relax}
3565 \@onlypreamble\caption@patch@stpelt
3566 % \end{macrocode}
3567 % \end{macro}
3568 %
3569 % \begin{macro}{\caption@addtoreset}
3570 % \changes{v3.1k}{2009/10/09}{This macro added}
3571 % Like \cs{@addtoreset} from |ltcounts.dtx|
3572 % \begin{macrocode}
3573 \newcommand*\caption@addtoreset[2]{%
3574 \caption@patch@stpelt
3575 \@ifundefined{caption@cl@#2}{\@namedef{caption@cl@#2}{}}{}%
3576 \expandafter\@cons\csname caption@cl@#2\endcsname{{#1}}}
3577 \@onlypreamble\caption@addtoreset
3578 % \end{macrocode}
3579 % \end{macro}
3580 %
3581 % \begin{macro}{\caption@addtoreset}
3582 % \changes{v3.1k}{2009/10/09}{This macro added}
3583 % Like \cs{@removefromreset} from |remreset.sty|
3584 % \begin{macrocode}
3585 \newcommand*\caption@removefromreset[2]{%
3586 \begingroup
3587 \expandafter\let\csname c@#1\endcsname\caption@removefromreset
3588 \def\@elt##1{%
3589 \expandafter\ifx\csname c@##1\endcsname\caption@removefromreset
3590 \else
3591 \noexpand\@elt{##1}%
3592 \fi}%
3593 \expandafter\xdef\csname caption@cl@#2\endcsname{%
3594 \csname caption@cl@#2\endcsname}%
3595 \endgroup}
3596 \@onlypreamble\caption@removefromreset
3597 % \end{macrocode}
3598 % \end{macro}
3599 %
3600 % \begin{macro}{\DeclareCaptionSubType}
3601 % \changes{v3.1f}{2007/11/16}{This macro added}
3602 % \changes{v3.1g}{2008/03/11}{Bugfix: \cs{subfigurename} will be defined now}
3603 % \changes{v3.1k}{2009/10/09}{Bugfix 08-10-01: Usage of \cs{caption@addtoreset} added}
3604 % |\DeclareCaptionSubType|\oarg{numbering scheme}\marg{type}\\
3605 % |\DeclareCaptionSubType*|\oarg{numbering scheme}\marg{type}\par
3606 % The starred variant provides the numbering format
3607 % \meta{type}|.|\meta{subtype} while the non-starred variant simply
3608 % uses \meta{subtype}.
3609 % \begin{macrocode}
3610 \newcommand*\DeclareCaptionSubType{%
3611 \caption@teststar\@DeclareCaptionSubType\@firstoftwo\@secondoftwo}
3612 \@onlypreamble\DeclareCaptionSubType
3613 % \end{macrocode}
3614 % \begin{macrocode}
3615 \newcommand*\@DeclareCaptionSubType[1]{%
3616 \@testopt{\@@DeclareCaptionSubType{#1}}{alph}}
3617 \@onlypreamble\@DeclareCaptionSubType
3618 % \end{macrocode}
3619 % \begin{macrocode}
3620 \def\@@DeclareCaptionSubType#1[#2]#3{%
3621 \@ifundefined{c@#3}%
3622 {\caption@Error{No float type '#3' defined}}%
3623 % \end{macrocode}
3624 % \begin{macrocode}
3625 {\@ifundefined{c@sub#3}%
3626 {\caption@Debug{New subtype `sub#3'}%
3627 \newcounter{sub#3}%
3628 \caption@addtoreset{sub#3}{#3}%
3629 \@namedef{ext@sub#3}{\csname ext@#3\endcsname}%
3630 \@ifundefined{l@chapter}%
3631 {\edef\@tempa{\expandafter\expandafter\expandafter\noexpand
3632 \expandafter\@car\l@subsubsection\@nil}%
3633 \def\@tempb{\@dottedtocline}%
3634 \ifx\@tempa\@tempb % \l@subsubsection starts with \@dottedtocline
3635 \expandafter\edef\csname l@sub#3\endcsname{%
3636 \noexpand\@dottedtocline{2}%
3637 \expandafter\expandafter\expandafter\noexpand
3638 \expandafter\@gobbletwo\l@subsubsection}%
3639 \else
3640 \@namedef{l@sub#3}{\@dottedtocline{2}{3.8em}{3.2em}}%
3641 \fi}%
3642 {\expandafter\let\csname l@sub#3\endcsname\l@subsection}%
3643 \@cons\caption@subtypelist{{#3}}}%
3644 {\caption@Debug{Modify caption `sub#3'}}%
3645 % \end{macrocode}
3646 % \begin{macrocode}
3647 \@namedef{sub#3name}{}%
3648 \@namedef{sub#3autorefname}{\csname #3name\endcsname}%
3649 #1% is \@firstoftwo in star form, and \@secondoftwo otherwise
3650 {\@namedef{p@sub#3}{}%
3651 \@namedef{thesub#3}{\csname the#3\endcsname.\@nameuse{#2}{sub#3}}}%
3652 {\@namedef{p@sub#3}{\csname the#3\endcsname}%
3653 \@namedef{thesub#3}{\@nameuse{#2}{sub#3}}}%
3654 \@namedef{theHsub#3}{\csname theH#3\endcsname.\arabic{sub#3}}%
3655 }}
3656 % \end{macrocode}
3657 % \begin{macrocode}
3658 \@onlypreamble\@@DeclareCaptionSubType
3659 % \end{macrocode}
3660 % \end{macro}
3661 % \begin{macro}{\caption@subtypelist}
3662 % An \cs{@elt}-list containing the subtypes defined
3663 % with |\Declare|\x|Caption|\x|Sub|\x|Type|.
3664 % \begin{macrocode}
3665 \newcommand*\caption@subtypelist{}
3666 % \end{macrocode}
3667 % \end{macro}
3668 %
3669 % \begin{macro}{\caption@For}
3670 % \changes{v3.1a}{2007/09/07}{This macro added}
3671 % \changes{v3.1f}{2007/11/16}{Renamed from \cs{ForFloatingEnvironments} to \cs{caption@For}}
3672 % |\caption@For|\marg{elt-list}\marg{code with \#1}\\
3673 % |\caption@For*|\marg{elt-list}\marg{code with \#1}
3674 % \begin{macrocode}
3675 \newcommand*\caption@For{\caption@withoptargs\caption@@For}
3676 %\@onlypreamble\caption@For
3677 % \end{macrocode}
3678 % \begin{macrocode}
3679 \newcommand\caption@@For[3]{%
3680 \caption@AtBeginDocument#1{%
3681 \def\@elt##1{#3}%
3682 \@nameuse{caption@#2}%
3683 \let\@elt\relax}}%
3684 %\@onlypreamble\caption@@For
3685 % \end{macrocode}
3686 % \end{macro}
3687 %
3688 % \subsection{subfig package adaptions}
3689 % \changes{v3.1}{2007/07/07}{Several adaptions to the \package{subfig} package added}
3690 %
3691 % We have to make several adaptions to \thispackage~\version{3.1} here.
3692 % \begin{macrocode}
3693 \caption@AtBeginDocument{%
3694 \def\@tempa{\@ifstar\sf@@subref\sf@subref}%
3695 \ifx\subref\@tempa
3696 \PackageInfo{caption3}{subfig package 1.2 or 1.3 is loaded\@gobble}%
3697 % \end{macrocode}
3698 % \begin{macrocode}
3699 \let\caption@setfloattype\@gobble
3700 \let\@dottedxxxline\sf@NEW@dottedxxxline
3701 \let\sf@subfloat\sf@NEW@subfloat
3702 % \end{macrocode}
3703 % \begin{macrocode}
3704 \fi
3705 \let\sf@NEW@dottedxxxline\@undefined
3706 \let\sf@NEW@subfloat\@undefined}
3707 % \end{macrocode}
3708 % \begin{macrocode}
3709 \def\sf@NEW@dottedxxxline#1#2#3#4#5#6#7{%
3710 \begingroup
3711 \caption@setfloattype{#1}%
3712 \caption@setoptions{subfloat}%
3713 \caption@setoptions{sub#1}%
3714 \ifnum #3>\@nameuse{c@#2depth}\else
3715 \@dottedtocline{\z@}{#4}{#5}{#6}{#7}%
3716 \fi
3717 \endgroup}
3718 % \end{macrocode}
3719 % \begin{macrocode}
3720 \def\sf@NEW@subfloat{%
3721 \begingroup
3722 \caption@setfloattype\@captype
3723 \sf@ifpositiontop{%
3724 \maincaptiontoptrue
3725 }{%
3726 \maincaptiontopfalse
3727 }%
3728 \caption@setoptions{subfloat}%
3729 \caption@setoptions{sub\@captype}%
3730 \let\sf@oldlabel=\label
3731 \let\label=\subfloat@label
3732 \ifmaincaptiontop\else
3733 \advance\@nameuse{c@\@captype}\@ne
3734 \fi
3735 \refstepcounter{sub\@captype}%
3736 \setcounter{sub\@captype @save}{\value{sub\@captype}}%
3737 \@ifnextchar [% %] match left bracket
3738 {\sf@@subfloat}%
3739 {\sf@@subfloat[\@empty]}}
3740 % \end{macrocode}
3741 %
3742 % \iffalse
3743 %</kernel>
3744 % \fi
3745 %
3746 % \iffalse
3747 % --------------------------------------------------------------------------- %
3748 % \fi
3749 %
3750 % \clearpage
3751 % \section{Main package}
3752 % \iffalse
3753 %<*package>
3754 % \fi
3755 %
3756 % \subsection{Identification}
3757 %
3758 % \begin{macrocode}
3759 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
3760 \ProvidesPackage{caption}[2023/08/05 v3.1o Customizing captions (AR)]
3761 %\@ifundefined{PackageRedefines}{}{\PackageRedefines{caption}{caption}}
3762 % \end{macrocode}
3763 %
3764 % \begin{macro}{\caption@Info}
3765 % \Note{The \cs{@gobble} at the end of the 2nd argument of
3766 % \cs{PackageInfo} suppresses the line number info.
3767 % See TLC2\cite{TLC2}, A.4.7, p885 for details.}
3768 % \begin{macrocode}
3769 \newcommand*\caption@Info[1]{\PackageInfo{caption}{#1\@gobble}}
3770 \@onlypreamble\caption@Info
3771 % \end{macrocode}
3772 % \end{macro}
3773 %
3774 % \subsection{Loading the kernel}
3775 %
3776 % \begin{macrocode}
3777 \RequirePackage{caption3}[=2008/08/24] % needs v1.1j or newer
3778 % \end{macrocode}
3779 %
3780 % \subsection{Check against incompatible document classes}
3781 %
3782 % \begin{macrocode}
3783 \caption@ifbool{documentclass}{}{%
3784 \caption@WarningNoLine{%
3785 Unsupported document class (or package) detected,\MessageBreak
3786 usage of the caption package is not recommended}%
3787 \caption@Info{\string\@makecaption\space=\space\meaning\@makecaption}%
3788 }
3789 % \end{macrocode}
3790 %
3791 % \subsection{Check against incompatible packages}
3792 %
3793 % \changes{v3.0p}{2007/04/06}{Check against obsolete \package{caption2} package added}
3794 % \begin{macrocode}
3795 \@ifpackageloaded{caption2}{%
3796 \caption@Error{%
3797 You can't use both, the (obsolete) caption2 *and*\MessageBreak
3798 the (current) caption package}%
3799 \endinput
3800 }{}
3801 % \end{macrocode}
3802 %
3803 % \changes{v3.1}{2007/06/15}{Check against incompatible \package{ftcap} package added}
3804 % \changes{v3.1}{2007/06/15}{Check against incompatible \package{nonfloat} package added}
3805 % \changes{v3.1}{2007/06/18}{Check against incompatible \package{topcapt} package added}
3806 % \begin{macrocode}
3807 \caption@AtBeginDocument{%
3808 \@ifpackageloaded{ftcap}{\caption@DisablePositionOption{ftcap}}{}%
3809 \@ifpackageloaded{nonfloat}{\caption@DisablePositionOption{nonfloat}}{}%
3810 \@ifpackageloaded{topcapt}{\caption@DisablePositionOption{topcapt}}{}}
3811 % \end{macrocode}
3812 % \begin{macro}{\caption@DisablePositionOption}
3813 % \changes{v3.1g}{2008/03/20}{\texttt{position=b} added}
3814 % \changes{v3.1h}{2008/03/29}{%
3815 % Name changed from \cs{caption@IncompatiblePackage} to \cs{caption@DisablePositionOption};
3816 % moved from package to kernel; disables the `position' option now instead of issuing a warning}
3817 % |\caption@DisablePositionOption|\marg{package}\par
3818 % disables the `position' option.
3819 % \begin{macrocode}
3820 \newcommand*\caption@DisablePositionOption[1]{%
3821 \caption@Info{%
3822 `#1' package detected; setting `position=b' for compatibility reasons}%
3823 \caption@setposition b%
3824 % \end{macrocode}
3825 % \begin{macrocode}
3826 \DeclareCaptionOption{position}{%
3827 \caption@Error{Usage of the `position' option is incompatible\MessageBreak
3828 to the `#1' package}}}
3829 % \end{macrocode}
3830 % \begin{macrocode}
3831 \@onlypreamble\caption@DisablePositionOption
3832 % \end{macrocode}
3833 % \end{macro}
3834 %
3835 % \subsection{Declaration of options}
3836 %
3837 % \subsubsection{Options for figure and table}
3838 %
3839 % \changes{v3.0a}{2004/01/09}{Options \opt{figureposition} and \opt{tableposition} added}
3840 % \begin{macrocode}
3841 \DeclareCaptionOption{figureposition}{%
3842 \captionsetup*[figure]{position=#1}}
3843 \@onlypreamble@key{caption}{figureposition}
3844 % \end{macrocode}
3845 % \begin{macrocode}
3846 \DeclareCaptionOption{tableposition}{%
3847 \captionsetup*[table]{position=#1}}
3848 \@onlypreamble@key{caption}{tableposition}
3849 % \end{macrocode}
3850 %
3851 % \changes{v3.0d}{2004/08/03}{Options \opt{figurename} and \opt{tablename} added}
3852 % \changes{v3.1}{2007/07/04}{Options \opt{figurename} and \opt{tablename} re-written}
3853 % \changes{v3.1f}{2007/11/18}{Options \opt{figurename} and \opt{tablename} are now
3854 % available after the document preamble, too.}
3855 % \changes{v3.1f}{2007/11/18}{Option \opt{name} added}
3856 % \begin{macrocode}
3857 \DeclareCaptionOption{figurename}{\caption@SetName{figure}{#1}}
3858 \DeclareCaptionOption{tablename}{\caption@SetName{table}{#1}}
3859 \DeclareCaptionOption{name}{\caption@setname\@captype{#1}}
3860 % \end{macrocode}
3861 %
3862 % \changes{v3.1g}{2008/02/28}{Options \opt{listfigurename} and \opt{listtablename} added}
3863 % \begin{macrocode}
3864 \DeclareCaptionOption{listfigurename}{\caption@SetName{listfigure}{#1}}
3865 \DeclareCaptionOption{listtablename}{\caption@SetName{listtable}{#1}}
3866 % \end{macrocode}
3867 %
3868 % \begin{macro}{\caption@SetName}
3869 % \changes{v3.1}{2007/07/04}{This macro added}
3870 % \changes{v3.1f}{2007/11/18}{After-preamble variant added}
3871 % \changes{v3.1g}{2008/02/28}{Renamed from \cs{caption@SetFloatName} to \cs{caption@SetName}}
3872 % \changes{v3.1i}{2008/08/02}{Bugfix: Works now without \cs{addto}, too}
3873 % |\caption@SetName|\marg{cmd}\marg{value}
3874 % \begin{macrocode}
3875 \newcommand*\caption@SetName[2]{%
3876 \caption@setname{#1}{#2}%
3877 \begingroup
3878 \@ifundefined{languagename}{}{%
3879 \@ifundefined{captions\languagename}{}{%
3880 \expandafter\g@addto@macro\csname captions\languagename\endcsname
3881 {\caption@setname{#1}{#2}}}}%
3882 \endgroup}
3883 % \end{macrocode}
3884 % \begin{macrocode}
3885 \newcommand*\caption@setname[2]{\@namedef{#1name}{#2}}
3886 % \end{macrocode}
3887 % \begin{macrocode}
3888 \caption@AtBeginDocument{\let\caption@SetName\caption@setname}
3889 % \end{macrocode}
3890 % \end{macro}
3891 %
3892 % \changes{v3.1f}{2007/12/21}{Options \opt{figurewithin} and \opt{tablewithin} added}
3893 % \changes{v3.1i}{2008/04/13}{Option \opt{within} added}
3894 % \changes{v3.1l}{2010/01/09}{The \opt{within} options are now available within the document, too}
3895 % \changes{v3.1l}{2010/01/09}{The global \opt{within} option will now affect user-defined floats
3896 % declared with \cs{DeclareCaptionType}, too}
3897 %
3898 % \begin{macro}{\caption@DeclareWithinOption}
3899 % \changes{v3.1l}{2010/01/09}{This macro and its usage added}
3900 % \begin{macrocode}
3901 \newcommand*\caption@DeclareWithinOption[1]{%
3902 \DeclareCaptionOption{#1within}{\caption@Within{#1}{##1}}%
3903 \DeclareCaptionOption{#1without}{\caption@Within{#1}{none}}}
3904 % \end{macrocode}
3905 % \end{macro}
3906 % \begin{macrocode}
3907 \caption@DeclareWithinOption{figure}
3908 \caption@DeclareWithinOption{table}
3909 % \end{macrocode}
3910 % \begin{macrocode}
3911 \DeclareCaptionOption{within}{%
3912 \@ifundefined{c@figure}{}{\caption@Within{figure}{#1}}%
3913 \@ifundefined{c@table}{}{\caption@Within{table}{#1}}%
3914 \caption@For{typelist}{\caption@Within{##1}{#1}}%
3915 \def\caption@within@default{#1}}
3916 \DeclareCaptionOption{without}{\KV@caption@within{none}}
3917 % \end{macrocode}
3918 % \begin{macro}{\caption@within}
3919 % \changes{v3.1}{2007/12/21}{This macro added}
3920 % \begin{macrocode}
3921 \newcommand*\caption@Within[1]{\def\caption@type{#1}\KV@caption@DCT@within}
3922 % \end{macrocode}
3923 % \end{macro}
3924 %
3925 % \subsubsection{Miscellaneous options}
3926 %
3927 % \begin{macrocode}
3928 \DeclareCaptionOption*{config}[caption]{%
3929 \InputIfFileExists{#1.cfg}%
3930 {\typeout{*** Local configuration file #1.cfg used ***}}%
3931 {\caption@Warning{Configuration file #1.cfg not found}}}
3932 % \end{macrocode}
3933 %
3934 % \changes{v3.1f}{2007/11/28}{Option \opt{@minipage=} added}
3935 % \begin{macrocode}
3936 \DeclareCaptionOption{@minipage}{%
3937 \caption@ifinlist{#1}{auto,default}%
3938 {\let\caption@if@minipage\@gobbletwo}%
3939 {\caption@set@bool\caption@if@minipage{#1}}}
3940 \captionsetup{@minipage=default}
3941 % \end{macrocode}
3942 %
3943 % \subsubsection{caption v1.x compatibility options}
3944 % \changes{v3.1}{2007/07/21}{Option `compatibility' added}
3945 % \changes{v3.1}{2007/09/01}{caption v1.x compatibility options revised}
3946 % \changes{v3.1d}{2007/10/24}{Bugfix 07-10-24 in caption v1.x$ compatibility options}
3947 %
3948 % \begin{macrocode}
3949 \DeclareCaptionOption{compatibility}[1]{\caption@setbool{compatibility}{#1}}
3950 \@onlypreamble@key{caption}{compatibility}
3951 % \end{macrocode}
3952 %
3953 % \begin{macrocode}
3954 \DeclareCaptionOptionNoValue*{normal}{%
3955 \caption@setformat{plain}%
3956 \caption@setjustification{justified}}
3957 \DeclareCaptionOptionNoValue*{isu}{%
3958 \caption@setformat{hang}%
3959 \caption@setjustification{justified}}
3960 \DeclareCaptionOptionNoValue*{hang}{%
3961 \caption@setformat{hang}%
3962 \caption@setjustification{justified}}
3963 \DeclareCaptionOptionNoValue*{center}{%
3964 \caption@setformat{plain}%
3965 \caption@setjustification{centering}}
3966 \DeclareCaptionOptionNoValue*{anne}{%
3967 \caption@setformat{plain}%
3968 \caption@setjustification{centerlast}}
3969 \DeclareCaptionOptionNoValue*{centerlast}{%
3970 \caption@setformat{plain}%
3971 \caption@setjustification{centerlast}}
3972 % \end{macrocode}
3973 %
3974 % \begin{macrocode}
3975 \DeclareCaptionOptionNoValue*{scriptsize}{\def\captionfont{\scriptsize}}
3976 \DeclareCaptionOptionNoValue*{footnotesize}{\def\captionfont{\footnotesize}}
3977 \DeclareCaptionOptionNoValue*{small}{\def\captionfont{\small}}
3978 \DeclareCaptionOptionNoValue*{normalsize}{\def\captionfont{\normalsize}}
3979 \DeclareCaptionOptionNoValue*{large}{\def\captionfont{\large}}
3980 \DeclareCaptionOptionNoValue*{Large}{\def\captionfont{\Large}}
3981 % \end{macrocode}
3982 %
3983 % \begin{macrocode}
3984 \DeclareCaptionOptionNoValue*{up}{\l@addto@macro\captionlabelfont\upshape}
3985 \DeclareCaptionOptionNoValue*{it}{\l@addto@macro\captionlabelfont\itshape}
3986 \DeclareCaptionOptionNoValue*{sl}{\l@addto@macro\captionlabelfont\slshape}
3987 \DeclareCaptionOptionNoValue*{sc}{\l@addto@macro\captionlabelfont\scshape}
3988 \DeclareCaptionOptionNoValue*{md}{\l@addto@macro\captionlabelfont\mdseries}
3989 \DeclareCaptionOptionNoValue*{bf}{\l@addto@macro\captionlabelfont\bfseries}
3990 \DeclareCaptionOptionNoValue*{rm}{\l@addto@macro\captionlabelfont\rmfamily}
3991 \DeclareCaptionOptionNoValue*{sf}{\l@addto@macro\captionlabelfont\sffamily}
3992 \DeclareCaptionOptionNoValue*{tt}{\l@addto@macro\captionlabelfont\ttfamily}
3993 % \end{macrocode}
3994 %
3995 % \begin{macrocode}
3996 \DeclareCaptionOptionNoValue*{nooneline}{\caption@setbool{slc}{0}}
3997 % \end{macrocode}
3998 %
3999 % \begin{macrocode}
4000 \caption@setbool{ruled}{0}
4001 \DeclareCaptionOptionNoValue*{ruled}{\caption@setbool{ruled}{1}}
4002 % \end{macrocode}
4003 %
4004 % \subsubsection{caption2 v2.x compatibility options}
4005 % \changes{v3.0h}{2005/07/08}{caption2 \version{2.x} compatibility options added}
4006 % \changes{v3.1}{2007/09/01}{caption2 v2.x compatibility options revised}
4007 % \changes{v3.1d}{2007/10/24}{Bugfix 07-10-24 in caption v2.x$ compatibility options}
4008 %
4009 % \begin{macrocode}
4010 \DeclareCaptionOptionNoValue*{flushleft}{%
4011 \caption@setformat{plain}%
4012 \caption@setjustification{raggedright}}
4013 \DeclareCaptionOptionNoValue*{flushright}{%
4014 \caption@setformat{plain}%
4015 \caption@setjustification{raggedleft}}
4016 % \end{macrocode}
4017 % \begin{macrocode}
4018 \DeclareCaptionOptionNoValue*{oneline}{\caption@setbool{slc}{1}}
4019 % \end{macrocode}
4020 % \begin{macrocode}
4021 \DeclareCaptionOptionNoValue*{ignoreLTcapwidth}{%
4022 \caption@WarningNoLine{Obsolete option `ignoreLTcapwidth' ignored}}
4023 % \end{macrocode}
4024 %
4025 % \subsubsection{Obsolete caption v3.0 options}
4026 % \changes{v3.1}{2007/05/07}{Package option \opt{caption} marked as obsolete,
4027 % gives error now}
4028 %
4029 % \begin{macrocode}
4030 \DeclareCaptionOption*{caption}{%
4031 \caption@setbool{temp}{#1}%
4032 \caption@ifbool{temp}{}{%
4033 \caption@Error{%
4034 The package option `caption=#1' is obsolete.\MessageBreak
4035 Please pass this option to the subfig package instead\MessageBreak
4036 and do *not* load the caption package anymore}}}
4037 % \end{macrocode}
4038 %
4039 % \subsubsection{fltpage package support options}
4040 %
4041 % \changes{v3.1}{2007/09/01}{Options `FPlist' \& `FPref' added}
4042 % With these options is controlled where the list-of entry and |\ref| resp.
4043 % |\pageref| or |\autoref| will link to.
4044 % Defaults are |FPlist=caption| and |FPref=figure| which is inconsistent,
4045 % but compatible to the usual behaviour of the \package{fltpage} package.
4046 % \begin{macrocode}
4047 \DeclareCaptionOption{FPlist}[1]{\caption@setFPoption{list}{#1}}
4048 \DeclareCaptionOption{FPref}[1]{\caption@setFPoption{ref}{#1}}
4049 \@onlypreamble@key{caption}{FPlist}
4050 \@onlypreamble@key{caption}{FPref}
4051 % \end{macrocode}
4052 % \begin{macrocode}
4053 \newcommand*\caption@setFPoption[2]{%
4054 \edef\caption@tempa{\@car#2\@nil}%
4055 \caption@setbool{FP#1cap}{\if c\caption@tempa 1\else 0\fi}}
4056 \@onlypreamble\caption@setFPoption
4057 % \end{macrocode}
4058 % \begin{macrocode}
4059 \captionsetup{FPlist=caption,FPref=figure}
4060 % \end{macrocode}
4061 %
4062 % \subsubsection{hyperref package support options}
4063 %
4064 % \changes{v3.1}{2007/06/21}{Options `hypcap' \& `hypcapspace' added}
4065 % With |hypcap=off| one can turn the \package{hypcap} support off
4066 % (default is |on|).
4067 % \begin{macrocode}
4068 \DeclareCaptionOption{hypcap}[1]{\caption@setbool{hypcap}{#1}}
4069 \DeclareCaptionOption{hypcapspace}{\def\caption@hypcapspace{#1}}
4070 % \end{macrocode}
4071 % \begin{macrocode}
4072 \captionsetup{hypcap=1,hypcapspace=.5\baselineskip}
4073 % \end{macrocode}
4074 %
4075 % \subsection{\AmS{} \& \SmF{} document classes support}
4076 % \changes{v3.1}{2007/07/29}{\AmS\ \& \SmF\ document classes support added (package)}
4077 %
4078 % \begin{macrocode}
4079 \caption@ifamsclass{%
4080 \caption@Info{AMS or SMF document class}%
4081 % \end{macrocode}
4082 % \begin{macrocode}
4083 \setlength\belowcaptionskip{0pt}% set to 12pt by AMS class
4084 % \end{macrocode}
4085 % \begin{macrocode}
4086 }
4087 % \end{macrocode}
4088 %
4089 % \subsection{\KOMAScript{} document classes support}
4090 % \changes{v3.0a}{2004/01/18}{Minimum adaptation to \KOMAScript\ added (package)}
4091 % \changes{v3.0h}{2005/08/22}{\KOMAScript\ compatibility options added (package)}
4092 % \changes{v3.0i}{2005/11/17}{\KOMAScript\ compatibility commands added (package)}
4093 % \changes{v3.0l}{2007/02/18}{\KOMAScript\ compatibility revised (package)}
4094 % \changes{v3.1}{2007/03/17}{\KOMAScript\ compatibility options removed (package)}
4095 % \changes{v3.1}{2007/04/05}{\KOMAScript\ compatibility revised \& enhanced (package)}
4096 %
4097 % \begin{macrocode}
4098 \caption@ifkomaclass{%
4099 \caption@Info{KOMA-Script document class}%
4100 % \end{macrocode}
4101 %
4102 % Here we emulate the caption related commands and take over the caption
4103 % related settings from the \KOMAScript\ classes.
4104 %
4105 % \begin{macro}{\@tablecaptionabovetrue}
4106 % \begin{macro}{\@tablecaptionabovefalse}
4107 % \changes{v3.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
4108 % \begin{macrocode}
4109 \g@addto@macro\@tablecaptionabovetrue{\captionsetup*[table]{position=t}}
4110 \g@addto@macro\@tablecaptionabovefalse{\captionsetup*[table]{position=b}}
4111 % \end{macrocode}
4112 % \end{macro}
4113 % \end{macro}
4114 %
4115 % \begin{macrocode}
4116 \if@tablecaptionabove
4117 \@tablecaptionabovetrue
4118 \else
4119 \@tablecaptionabovefalse
4120 \fi
4121 % \end{macrocode}
4122 %
4123 % \begin{macro}{\onelinecaptionstrue}
4124 % \begin{macro}{\onelinecaptionsfalse}
4125 % \changes{v3.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
4126 % \begin{macrocode}
4127 \g@addto@macro\onelinecaptionstrue{\let\caption@ifslc\@firstoftwo}
4128 \g@addto@macro\onelinecaptionsfalse{\let\caption@ifslc\@secondoftwo}
4129 % \end{macrocode}
4130 % \end{macro}
4131 % \end{macro}
4132 %
4133 % \begin{macrocode}
4134 \ifonelinecaptions
4135 \onelinecaptionstrue
4136 \else
4137 \onelinecaptionsfalse
4138 \fi
4139 % \end{macrocode}
4140 %
4141 % \begin{macro}{\@captionabovetrue}
4142 % \begin{macro}{\@captionabovefalse}
4143 % \changes{v3.0j}{2006/03/21}{Bugfix 06-03-21:
4144 % \cs{let}\cs{caption@setposition}\cs{@gobble} added}
4145 % \changes{v3.0n}{2006/03/09}{Accidentally this got broken in \version{3.0m}, fixed}
4146 % \changes{v3.1}{2007/03/31}{We redefine \cs{captionabovetrue/false} now
4147 % instead of \cs{captionabove/below}}
4148 % \changes{v3.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
4149 % \changes{v3.1k}{2009/10/09}{\opt{figureposition} and \opt{tableposition} will issue a warning now}
4150 % Please note that these are stronger than the \opt{position} setting, therefore we
4151 % override the options \opt{figureposition} and \opt{tableposition} to typeout a warning.
4152 % \begin{macrocode}
4153 \g@addto@macro\@captionabovetrue{\let\caption@position\@firstoftwo}
4154 \g@addto@macro\@captionabovefalse{\let\caption@position\@secondoftwo}
4155 % \end{macrocode}
4156 % \begin{macrocode}
4157 \DeclareCaptionOption{figureposition}{%
4158 \caption@WarningNoLine{Option `figureposition=#1' has no effect\MessageBreak
4159 when used with a KOMA script document class}}
4160 \DeclareCaptionOption{tableposition}{%
4161 \caption@WarningNoLine{Option `tableposition=#1' has no effect\MessageBreak
4162 when used with a KOMA script document class}}
4163 % \end{macrocode}
4164 % \end{macro}
4165 % \end{macro}
4166 %
4167 % \begin{macro}{\setcapindent}
4168 % \begin{macrocode}
4169 \let\caption@KOMA@setcapindent\@setcapindent
4170 \renewcommand*\@setcapindent[1]{%
4171 \caption@KOMA@setcapindent{#1}\caption@setcapindent}
4172 % \end{macrocode}
4173 % \begin{macrocode}
4174 \let\caption@KOMA@@setcapindent\@@setcapindent
4175 \renewcommand*\@@setcapindent[1]{%
4176 \caption@KOMA@@setcapindent{#1}\caption@setcapindent}
4177 % \end{macrocode}
4178 % \begin{macrocode}
4179 \newcommand*\caption@setcapindent{%
4180 \captionsetup{indent=\ifdim\cap@indent<\z@\z@\else\cap@indent\fi}}
4181 % \end{macrocode}
4182 % \end{macro}
4183 %
4184 % \begin{macrocode}
4185 \@ifundefined{cap@indent}{}{\caption@setcapindent}
4186 % \end{macrocode}
4187 %
4188 % \begin{macro}{\setcapwidth}
4189 % \Note{The optional argument of \cs{setcapwidth} if not supported (yet),
4190 % so we issue a warning if used.
4191 % (Since this does not seem to have an negative effect when used
4192 % by the \texttt{captionbeside} environment, we suppress the warning here.)}
4193 % \begin{macrocode}
4194 \expandafter\let\expandafter\caption@KOMA@setcapwidth
4195 \csname\string\setcapwidth\endcsname
4196 \@namedef{\string\setcapwidth}[#1]#2{%
4197 \caption@KOMA@setcapwidth[#1]{#2}\caption@setcapwidth{#1}}
4198 % \end{macrocode}
4199 % \begin{macrocode}
4200 \newcommand*\caption@setcapwidth[1]{%
4201 \ifx\\#1\\\else
4202 \@ifundefined{cap@margin}{}{%
4203 \def\@tempa{captionbeside}%
4204 \ifx\@tempa\@currenvir\else\caption@Warning{%
4205 Ignoring optional argument [#1] of \string\setcapwidth\MessageBreak}%
4206 \fi}%
4207 \fi
4208 \captionsetup{width=\cap@width}}
4209 % \end{macrocode}
4210 % \end{macro}
4211 %
4212 % \begin{macrocode}
4213 \def\caption@tempa{\hsize}%
4214 \ifx\caption@tempa\cap@width \else
4215 \caption@setcapwidth{?}
4216 \fi
4217 % \end{macrocode}
4218 %
4219 % \begin{macro}{\setcapmargin}
4220 % \begin{macrocode}
4221 \expandafter\let\expandafter\caption@KOMA@setcapmargin
4222 \csname\string\@setcapmargin\endcsname
4223 \@namedef{\string\@setcapmargin}[#1]#2{%
4224 \caption@KOMA@setcapmargin[#1]{#2}\caption@setcapmargin}
4225 % \end{macrocode}
4226 % \begin{macrocode}
4227 \expandafter\let\expandafter\caption@KOMA@@setcapmargin
4228 \csname\string\@@setcapmargin\endcsname
4229 \@namedef{\string\@@setcapmargin}[#1]#2{%
4230 \caption@KOMA@@setcapmargin[#1]{#2}\caption@setcapmargin}
4231 % \end{macrocode}
4232 % \begin{macrocode}
4233 \newcommand*\caption@setcapmargin{%
4234 \begingroup
4235 \let\onelinecaptionsfalse\relax
4236 \def\@twoside{0}%
4237 \def\if@twoside{\def\@twoside{1}\iffalse}%
4238 \cap@margin
4239 \def\@tempa{\endgroup}%
4240 \ifx\cap@left\hfill\else\ifx\cap@right\hfill\else
4241 \def\hspace##1##{\@firstofone}%
4242 \edef\@tempa{\endgroup
4243 \noexpand\captionsetup{%
4244 twoside=\@twoside,slc=0,%
4245 margin={\cap@left,\cap@right}}}%
4246 \fi\fi
4247 \@tempa}
4248 % \end{macrocode}
4249 % \end{macro}
4250 %
4251 % \begin{macrocode}
4252 \ifx\cap@margin\relax \else
4253 \caption@setcapmargin
4254 \fi
4255 % \end{macrocode}
4256 %
4257 % \begin{macrocode}
4258 }
4259 % \end{macrocode}
4260 %
4261 % \subsection{Processing of options}
4262 %
4263 % \changes{v3.0m}{2007/03/04}{Verbose option added (package)}
4264 % \changes{v3.1}{2007/07/02}{Verbose option removed from package}
4265 %
4266 % \changes{v3.1}{2007/03/17}{We do not process global options anymore}
4267 % \begin{macrocode}
4268 \caption@ProcessOptions*{caption}
4269 % \end{macrocode}
4270 %
4271 % \subsection{\cs{captionof} and \cs{captionlistentry}}
4272 %
4273 % \changes{v3.0d}{2004/08/03}{Option \opt{type=} added}
4274 % \changes{v3.1}{2007/06/25}{Option \opt{type*=} added}
4275 % \changes{v3.1f}{2007/11/16}{Option \opt{subtype} \& \opt{subtype*} added}
4276 %
4277 % \begin{macrocode}
4278 \caption@AtBeginDocument{%
4279 % \end{macrocode}
4280 % \begin{macrocode}
4281 \DeclareCaptionOption{type}{\caption@settype{#1}}%
4282 \DeclareCaptionOption{type*}{\caption@settype*{#1}}%
4283 % \end{macrocode}
4284 % \begin{macrocode}
4285 \DeclareCaptionOption{subtype}[sub\@captype]{\caption@setsubtype{#1}}%
4286 \DeclareCaptionOption{subtype*}[sub\@captype]{\caption@setsubtype*{#1}}%
4287 % \end{macrocode}
4288 % \begin{macrocode}
4289 }
4290 % \end{macrocode}
4291 %
4292 % \emph{Important Note:}
4293 % Like |\captionof| the option |type=| should only be used inside a
4294 % group, box, or environment and does not check if the argument is a valid
4295 % floating environment or not.
4296 %
4297 % \begin{macro}{\caption@settype}
4298 % \changes{v3.1}{2007/05/09}{This macro added}
4299 % \changes{v3.1b}{2007/09/22}{Usage of \cs{caption@xlabel} added}
4300 % \changes{v3.1d}{2007/10/23}{Error message for \cs{caption@checkgrouplevel} revised}
4301 % \changes{v3.1f}{2007/11/16}{\cs{caption@setsubtype} added}
4302 % \changes{v3.1f}{2007/12/03}{Crappy \cs{caption@iftypewarning} replaced}
4303 % \changes{v3.1g}{2008/01/12}{Usage of \cs{ifcaptionsetup@star} added}
4304 % |\caption@settype*|\marg{type}\par
4305 % sets |\@captype| and executes the options associated with it
4306 % (using |\caption@setoptions|).
4307 % Furthermore we check |\currentgrouplevel| (if avail),
4308 % redefine |\@currentlabel| so a |\label| before |\caption| will result
4309 % in a hint instead of a wrong reference, and
4310 % use the macro |\caption@|(|sub|)|typehook| (which will be used by our
4311 % \package{float} package support).\par
4312 % The non-starred version sets a \package{hyperref} anchor additionally
4313 % (if |hypcap=true| and the \package{hypcap} package is not loaded).
4314 % \begin{macrocode}
4315 \newcommand*\caption@settype{%
4316 \caption@@settype{}}
4317 % \end{macrocode}
4318 % \begin{macrocode}
4319 \newcommand*\caption@setsubtype{%
4320 \caption@iftype
4321 {\caption@@settype{sub}}%
4322 {\caption@Error{Option `subtype=' outside float}}}%
4323 % \end{macrocode}
4324 % \begin{macrocode}
4325 \newcommand*\caption@@settype[1]{%
4326 \caption@teststar{\caption@@@settype{#1}}\@firstoftwo\@secondoftwo}
4327 % \end{macrocode}
4328 % \begin{macrocode}
4329 \newcommand*\caption@@@settype[3]{%
4330 % #1 = "" or "sub"
4331 % #2 = \@firstoftwo in star form, \@secondoftwo otherwise
4332 % #3 = <type>, e.g. "figure" or "table"
4333 \@ifundefined{c@#3}%
4334 {\caption@Error{No float type '#3' defined}}%
4335 {\caption@Debug{#1type=#3}%
4336 \caption@checkgrouplevel{#1}{%
4337 \captionsetup{#1type#2*\@empty=...}#2{ or
4338 \@backslashchar#1captionof}{}}%
4339 % \end{macrocode}
4340 % \begin{macrocode}
4341 \edef\caption@tempa{#3}%
4342 \expandafter\ifx\csname @#1captype\endcsname\caption@tempa \else
4343 \ifcaptionsetup@star\else\@nameuse{caption@#1type@warning}\fi
4344 \fi
4345 \expandafter\let\csname @#1captype\endcsname\caption@tempa
4346 % \end{macrocode}
4347 % \begin{macrocode}
4348 \@nameuse{caption@#1typehook}%
4349 % \end{macrocode}
4350 % \begin{macrocode}
4351 \caption@setoptions{#3}%
4352 \ifx\caption@opt\relax
4353 \@nameundef{caption@#1type@warning}%
4354 \else
4355 \@namedef{caption@#1type@warning}{\caption@Warning{%
4356 The #1caption type was already set to
4357 `\csname @#1captype\endcsname'\MessageBreak}}%
4358 \fi
4359 % \end{macrocode}
4360 % \begin{macrocode}
4361 \let\caption@ifrefstepcounter\@secondoftwo
4362 #2{}{%
4363 \let\@currentlabel\caption@undefinedlabel
4364 % \let\@currentHlabel\@undefined
4365 \ifx\caption@ORI@label\@undefined
4366 \let\caption@ORI@label\label
4367 \let\label\caption@xlabel
4368 \fi
4369 \caption@start}}}
4370 % \end{macrocode}
4371 % \end{macro}
4372 %
4373 % \begin{macro}{\caption@typehook}
4374 % Hook, will be extended later on, e.g.~by our \package{float} package
4375 % support.
4376 % \begin{macrocode}
4377 \newcommand*\caption@typehook{}
4378 % \end{macrocode}
4379 % \end{macro}
4380 %
4381 % \begin{macro}{\caption@iftype}
4382 % \changes{v3.1}{2007/04/11}{This macro and its usage added}
4383 % Since we often need to check if |\@captype| is defined (means: we
4384 % are inside a floating environment) this helper macro was introduced.
4385 % \begin{macrocode}
4386 \newcommand*\caption@iftype{%
4387 \@ifundefined{@captype}{\let\@captype\@undefined\@secondoftwo}\@firstoftwo}
4388 % \end{macrocode}
4389 % \iffalse
4390 % \newcommand*\caption@iftype{%
4391 % \begingroup
4392 % \@ifundefined{@captype}%
4393 % {\aftergroup\@secondoftwo}%
4394 % {\aftergroup\@firstoftwo}%
4395 % \endgroup}
4396 % \fi
4397 % \end{macro}
4398 %
4399 % \begin{macro}{\caption@checkgrouplevel}
4400 % \changes{v3.1}{2007/07/15}{This macro and its usage added}
4401 % \changes{v3.1f}{2007/11/28}{Error changed to warning (compatibility)}
4402 % Checks if |\captionsetup{type=|\ldots|}| or |\caption| is done
4403 % inside a group or not -- in the latter case a warning message will
4404 % be issued. (needs \eTeX)
4405 % \begin{macrocode}
4406 \begingroup\expandafter\expandafter\expandafter\endgroup
4407 \expandafter\ifx\csname currentgrouplevel\endcsname\relax
4408 \caption@Debug{TeX engine: TeX}
4409 \let\caption@checkgrouplevel\@gobbletwo
4410 \else
4411 \caption@Debug{TeX engine: e-TeX}
4412 \newcommand*\caption@checkgrouplevel[2]{%
4413 \@ifundefined{#1caption@grouplevel}{%
4414 \@ifundefined{caption@grouplevel}{\let\caption@grouplevel\z@}{}%
4415 \ifnum\currentgrouplevel>\caption@grouplevel\relax
4416 \expandafter\edef\csname #1caption@grouplevel\endcsname{%
4417 \the\currentgrouplevel}%
4418 \else
4419 \caption@Warning{\string#2\MessageBreak outside box or environment}%
4420 \fi
4421 }{}}
4422 \fi
4423 % \end{macrocode}
4424 % \end{macro}
4425 %
4426 % \begin{macro}{\caption@undefinedlabel}
4427 % \changes{v3.1}{2007/07/03}{This macro and its usage added}
4428 % \changes{v3.1b}{2007/09/22}{Contents changed to \texttt{??}}
4429 % \changes{v3.1i}{2008/04/13}{Contents changed to \cs{caption@xref}(\ldots)}
4430 % \changes{v3.1k}{2009/03/30}{Bugfix 08-12-08: \cs{caption@xref} is robust now}
4431 % This label will be used for |\currentlabel| inside (floating) environments
4432 % as default. (see above)
4433 % \iffalse\Note{All commands used have to be robust here.}\fi
4434 % \begin{macrocode}
4435 \newcommand*\caption@undefinedlabel{%
4436 \protect\caption@xref{\caption@labelname}{\on@line}}
4437 % \end{macrocode}
4438 % \begin{macrocode}
4439 \DeclareRobustCommand*\caption@xref[2]{%
4440 \caption@WarningNoLine{\noexpand\label before \string\caption#2}%
4441 \@setref\relax\@undefined{#1}}
4442 % \end{macrocode}
4443 % \begin{macrocode}
4444 \newcommand*\caption@labelname{??}
4445 % \end{macrocode}
4446 % \end{macro}
4447 % \begin{macro}{\caption@xlabel}
4448 % \changes{v3.1b}{2007/09/22}{This macro and its usage added}
4449 % \changes{v3.1f}{2007/11/11}{Revised}
4450 % \changes{v3.1i}{2008/04/13}{Bugfix: \cs{pageref} should always work now}
4451 % The new code of |\label| inside floating environments.
4452 % |\label| will be redefined using |\caption@withoptargs|, so
4453 % |#1| are the optional arguments (if any), and
4454 % |#2| is the mandatory argument here.
4455 % \begin{macrocode}
4456 \newcommand*\caption@xlabel[1]{%
4457 \caption@@xlabel
4458 \def\caption@labelname{#1}%
4459 \caption@ORI@label{#1}}
4460 % \end{macrocode}
4461 % \begin{macrocode}
4462 \newcommand*\caption@@xlabel{%
4463 \global\let\caption@@xlabel\@empty
4464 \@bsphack
4465 \protected@write\@auxout{}%
4466 {\string\providecommand*\string\caption@xref[2]{%
4467 \string\@setref\string\relax\string\@undefined{\string##1}}}%
4468 \@esphack}
4469 % \end{macrocode}
4470 % \end{macro}
4471 %
4472 % \begin{macro}{\captionof}
4473 % \changes{v3.1}{2007/05/09}{Uses \cs{caption@settype} instead of \cs{def}\cs{@captype}}
4474 % \changes{v3.1c}{2007/09/22}{Bugfix: Redefinition of \cs{caption@setfloatcapt} removed}
4475 % \changes{v3.1e}{2007/10/30}{Better compatibility: Will be defined with \cs{AtBeginDocument} now}
4476 % |\captionof|\marg{type}\oarg{lst\_entry}\marg{heading}\\
4477 % |\captionof*|\oarg{lst\_entry}\marg{heading}\par
4478 % \Note{This will be defined with \cs{AtBeginDocument} so
4479 % \cs{usepackage}\csmarg{caption,capt-of} will still work.
4480 % (Compatibility to \version{1.x})}
4481 % \begin{macrocode}
4482 \caption@AtBeginDocument{%
4483 \def\captionof{\caption@teststar\caption@of{\caption*}\caption}}
4484 % \end{macrocode}
4485 % \begin{macrocode}
4486 \newcommand*\caption@of[2]{\caption@settype*{#2}#1}
4487 % \end{macrocode}
4488 % \end{macro}
4489 %
4490 % \begin{macro}{\captionlistentry}
4491 % \changes{v3.1}{2007/07/28}{This macro added}
4492 % \changes{v3.1f}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
4493 % \changes{v3.1g}{2008/01/20}{Starred variant added}
4494 % \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
4495 % |\captionlistentry|\oarg{float type}\marg{list entry}\\
4496 % |\captionlistentry*|\oarg{float type}\marg{list entry}
4497 % \begin{macrocode}
4498 \newcommand*\captionlistentry{%
4499 \caption@teststar\@captionlistentry\@firstoftwo\@secondoftwo}
4500 % \end{macrocode}
4501 % \begin{macrocode}
4502 \newcommand*\@captionlistentry[1]{%
4503 \@testopt{\caption@listentry{#1}}\@captype}
4504 % \end{macrocode}
4505 % \begin{macrocode}
4506 \def\caption@listentry#1[#2]#3{%
4507 \@bsphack
4508 #1{\caption@gettitle{#3}}%
4509 {\caption@refstepcounter{#2}%
4510 \caption@makecurrent{#2}{#3}}%
4511 \caption@addcontentsline{#2}{#3}%
4512 \@esphack}
4513 % \end{macrocode}
4514 % \end{macro}
4515 %
4516 % \subsection{\cs{ContinuedFloat}}
4517 %
4518 % \begin{macro}{\ContinuedFloat}
4519 % \changes{v3.0f}{2005/06/11}{%
4520 % Call of \cs{caption@ContinuedFloat} added}
4521 % \changes{v3.0i}{2005/11/12}{%
4522 % Optional argument and call of \cs{caption@@ContinuedFloat} added}
4523 % \changes{v3.0g}{2005/06/28}{%
4524 % Bugfix: \cs{newcounter} replaced by \cs{newcount}}
4525 % \changes{v3.1}{2007/07/02}{Format of \package{hyperref} extension changed}
4526 % \changes{v3.1}{2007/07/07}{\cs{caption@setoptions} added}
4527 % \changes{v3.1g}{2008/01/29}{Starred variant and hook \cs{sf@ContinuedFloat} added}
4528 % |\ContinuedFloat|\\
4529 % |\ContinuedFloat*|\par
4530 % This mainly decrements the appropriate counter and increments the
4531 % continuation counter instead.
4532 % Furthermore we set |\caption@resetContinuedFloat| to |\@gobble| so the
4533 % continuation counter will not be reset to zero inside |\caption@refstepcounter|.
4534 % Please forget about the optional argument, it was never working well, is
4535 % incompatible to the \package{subfig} package, but is still there for
4536 % compatibility reasons.
4537 % \Note{The definition of \cs{ContinuedFloat} itself is compatible
4538 % to the one inside the \package{subfig} package, except for the
4539 % starred variant and the optional argument.}
4540 % When the \package{hyperref} package is used we have the problem
4541 % that the usage of |\ContinuedFloat| will create duplicate
4542 % hyper links -- |\@currentHref| will be the same for the main float and
4543 % the continued ones. So we have to make sure unique labels and references
4544 % will be created each time. We do this by extending |\theHfigure| and
4545 % |\theHtable|, so for continued floats the scheme
4546 % \begin{quote}\meta{type}|.|\meta{type \#}|\alph{|\meta{continued \#}|}|\end{quote}
4547 % will be used instead of
4548 % \begin{quote}\meta{type}|.|\meta{type \#}\quad\quad.\end{quote}
4549 % \par{\small(This implementation follows an idea from Steven Douglas Cochran.)}
4550 % \Note{This does not help if the \package{hyperref} package option
4551 % \texttt{naturalnames=true} is set.}
4552 % \begin{macrocode}
4553 \def\ContinuedFloat{%
4554 \@ifnextchar[\@Continued@Float\@ContinuedFloat}
4555 % \end{macrocode}
4556 % \begin{macrocode}
4557 \def\@Continued@Float[#1]{\addtocounter{#1}\m@ne}
4558 % \end{macrocode}
4559 % \begin{macrocode}
4560 \def\@ContinuedFloat{%
4561 \caption@iftype
4562 {\addtocounter\@captype\m@ne
4563 \caption@ContinuedFloat\@captype}%
4564 {\caption@Error{\noexpand\ContinuedFloat outside float}}}
4565 % \end{macrocode}
4566 % \begin{macrocode}
4567 \def\caption@ContinuedFloat#1{%
4568 \@ifstar{\caption@Continued@Float@{#1}}{\caption@Continued@Float{#1}}}
4569 % \end{macrocode}
4570 % \begin{macrocode}
4571 \def\caption@Continued@Float@{%
4572 \addtocounter\@captype\@ne
4573 \@stpelt{ContinuedFloat}\stepcounter{ContinuedFloat}%
4574 \def\caption@resetContinuedFloat##1{\xdef\caption@CFtype{##1}}%
4575 \caption@@ContinuedFloat}
4576 % \end{macrocode}
4577 % \begin{macrocode}
4578 \def\caption@Continued@Float#1{%
4579 \edef\caption@tempa{#1}%
4580 \ifx\caption@tempa\caption@CFtype
4581 \stepcounter{ContinuedFloat}%
4582 \let\caption@resetContinuedFloat\@gobble
4583 \caption@@ContinuedFloat{#1}%
4584 \sf@ContinuedFloat{#1}%
4585 \else
4586 \caption@Error{Continued `#1' after `\caption@CFtype'}%
4587 \fi}
4588 % \end{macrocode}
4589 % \begin{macrocode}
4590 \def\caption@@ContinuedFloat#1{%
4591 \expandafter\l@addto@macro\csname the#1\endcsname\theContinuedFloat
4592 \@ifundefined{theH#1}{}{%
4593 \expandafter\l@addto@macro\csname theH#1\endcsname{%
4594 \@alph\c@ContinuedFloat}}%
4595 \caption@setoptions{ContinuedFloat}%
4596 \caption@setoptions{continued#1}}
4597 % \end{macrocode}
4598 % \begin{macrocode}
4599 \providecommand*\sf@ContinuedFloat[1]{}
4600 % \end{macrocode}
4601 % \begin{macrocode}
4602 \newcommand*\caption@CFtype{??}
4603 % \end{macrocode}
4604 % \end{macro}
4605 %
4606 % \begin{macro}{\theContinuedFloat}
4607 % Its preset to \cs{@empty}, so usually the continuation counter is not
4608 % included in the caption label or references.
4609 % \begin{macrocode}
4610 \newcounter{ContinuedFloat}
4611 \let\theContinuedFloat\@empty
4612 % \end{macrocode}
4613 % \end{macro}
4614 %
4615 % \begin{macro}{\caption@resetContinuedFloat}
4616 % |\caption@resetContinuedFloat|\marg{type}\par
4617 % If a continuation counter is defined, we reset it.
4618 % (This one will be called inside |\@caption|.)
4619 % \begin{macrocode}
4620 \newcommand*\caption@resetContinuedFloat[1]{%
4621 \@stpelt{ContinuedFloat}\xdef\caption@CFtype{#1}}
4622 % \end{macrocode}
4623 % \end{macro}
4624 %
4625 % \subsection{Internal helpers}
4626 %
4627 % \begin{macro}{\caption@refstepcounter}
4628 % \changes{v3.1}{2007/07/28}{This macro added}
4629 % Resets the continuation counter, increments the float (i.e. |figure| or
4630 % |table|) counter, and sets the |refstepcounter| flag.
4631 % \begin{macrocode}
4632 \newcommand*\caption@refstepcounter[1]{%
4633 \caption@resetContinuedFloat{#1}%
4634 \caption@@refstepcounter{#1}%
4635 \let\caption@ifrefstepcounter\@firstoftwo}
4636 % \end{macrocode}
4637 % \begin{macrocode}
4638 \newcommand*\caption@@refstepcounter{\refstepcounter}
4639 \let\caption@ifrefstepcounter\@secondoftwo
4640 % \end{macrocode}
4641 % \end{macro}
4642 %
4643 % \begin{macro}{\caption@dblarg}
4644 % \changes{v3.1}{2007/02/05}{This macro added}
4645 % \changes{v3.1f}{2007/12/06}{Bugfix 07-12-06: Changed so it works without \cs{kernel@ifnextchar}
4646 % (which was introduced in \LaTeXe\ 2004/01/23), too}
4647 % A |\relax| was added compared to |\@dblarg| so |\caption{}| will be
4648 % expanded to |\caption[\relax]{}| (and not to |\caption[]{}|).
4649 % \begin{macrocode}
4650 \@ifundefined{kernel@ifnextchar}%
4651 {\newcommand\caption@dblarg[1]{\@ifnextchar[{#1}{\caption@xdblarg{#1}}}}%
4652 {\newcommand\caption@dblarg[1]{\kernel@ifnextchar[{#1}{\caption@xdblarg{#1}}}}%
4653 \newcommand\caption@xdblarg[2]{#1[{#2\relax}]{#2}}%
4654 % \end{macrocode}
4655 % \end{macro}
4656 %
4657 % \begin{macro}{\caption@begin}
4658 % \changes{v3.0a}{2004/01/23}{\cs{caption@settype} changed to \cs{caption@setfloattype}}
4659 % \changes{v3.0e}{2005/04/12}{Check for default label format added}
4660 % \changes{v3.0f}{2005/06/11}{Usage of \cs{caption@resetContinuedFloat} added}
4661 % \changes{v3.1}{2007/05/09}{Usage of \cs{caption@setfloattype} \&
4662 % \cs{caption@resetContinuedFloat} removed}
4663 % Our handling of |\caption| will always be surrounded by
4664 % |\caption@begin| (or |\caption@beginex|) and |\caption@end|.\par
4665 % |\caption@begin|\marg{type} performs these tasks:
4666 % \begin{enumerate}
4667 % \item[1.] Start a new group.
4668 % \item[2.] Define |\fnum@|\meta{type} if the caption label format is set
4669 % to non-default.
4670 % \item[3.] Override the |position=| setting, if necessary.
4671 % (for example if set to |auto| or used inside a |supertabular|)
4672 % \end{enumerate}
4673 % \begin{macrocode}
4674 \newcommand*\caption@begin[1]{%
4675 \begingroup
4676 \caption@setfnum{#1}%
4677 \caption@fixposition
4678 \global\let\caption@fixedposition\caption@position}
4679 % \end{macrocode}
4680 % \end{macro}
4681 %
4682 % \begin{macro}{\caption@beginex}
4683 % \changes{v3.0b}{2004/05/16}{Support of \opt{listof=} added}
4684 % \changes{v3.0l}{2007/02/04}{Takes now 3 args instead of 2, check for empty heading added}
4685 % \changes{v3.1}{2007/07/01}{Makes lst-entry now instead of redefining \cs{addcontentsline}}
4686 % |\caption@beginex|\marg{type}\marg{list entry}\marg{heading}\par
4687 % performs the same tasks as |\caption@begin| and additionally:
4688 % \begin{enumerate}
4689 % \item[4.] Make an entry in the list-of-whatever.
4690 % \item[5.] Set |\caption@ifempty| according argument \meta{heading}.
4691 % \end{enumerate}
4692 % \begin{macrocode}
4693 \newcommand\caption@beginex[3]{%
4694 \caption@begin{#1}%
4695 \caption@addcontentsline{#1}{#2}%
4696 \caption@ifempty{#3}{}}
4697 % \end{macrocode}
4698 % \end{macro}
4699 %
4700 % \begin{macro}{\caption@end}
4701 % |\caption@end| closes the group.
4702 % \begin{macrocode}
4703 \newcommand*\caption@end{%
4704 \endgroup
4705 \let\caption@position\caption@fixedposition}
4706 % \end{macrocode}
4707 % \end{macro}
4708 %
4709 % \changes{v3.0a}{2004/01/23}{%
4710 % Internal hooks \cs{caption@@begin} \& \cs{caption@@end} added}
4711 % \changes{v3.0h}{2005/10/06}{%
4712 % Internal hooks \cs{caption@@begin} \& \cs{caption@@end} removed}
4713 %
4714 % \begin{macro}{\caption@setfnum}
4715 % \changes{v3.1}{2007/03/10}{This macro added}
4716 % |\caption@setfnum|\marg{type}\\
4717 % redefines |\fnum@|\meta{type} according the caption label format
4718 % set with |labelformat=|. But if |labelformat=default| is set,
4719 % |\fnum@|\meta{type} will not be overwritten by us.
4720 % \begin{macrocode}
4721 \newcommand*\caption@setfnum[1]{%
4722 \@ifundefined{fnum@#1}{\iftrue}{\ifx\caption@lfmt\caption@lfmt@default\else}%
4723 \@namedef{fnum@#1}{\caption@fnum{#1}}%
4724 \fi}
4725 % \end{macrocode}
4726 % \end{macro}
4727 %
4728 % \begin{macro}{\caption@boxrestore}
4729 % \changes{v3.1}{2007/03/03}{This macro and its usage added}
4730 % \changes{v3.1b}{2007/09/17}{Bugfix: Redefinition of CR added}
4731 % The original code (from |latex/base/ltboxes.dtx|):
4732 % \begin{verbatim}
4733 % \def\@parboxrestore{\@arrayparboxrestore\let\\\@normalcr}
4734 % \def\@arrayparboxrestore{%
4735 % \let\if@nobreak\iffalse
4736 % \let\if@noskipsec\iffalse
4737 % \let\par\@@par
4738 % \let\-\@dischyph
4739 % \let\'\@acci\let\`\@accii\let\=\@acciii
4740 % \parindent\z@ \parskip\z@skip
4741 % \everypar{}%
4742 % \linewidth\hsize
4743 % \@totalleftmargin\z@
4744 % \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
4745 % \parfillskip\@flushglue \lineskip\normallineskip
4746 % \baselineskip\normalbaselineskip
4747 % \sloppy}
4748 % \end{verbatim}%^^A
4749 % This one will be used by |\@caption| instead of |\@parboxrestore|.
4750 % \begin{macrocode}
4751 \newcommand*\caption@boxrestore{%
4752 \let\if@nobreak\iffalse
4753 \let\if@noskipsec\iffalse
4754 \let\par\@@par
4755 % \let\-\@dischyph
4756 % \let\'\@acci\let\`\@accii\let\=\@acciii
4757 \parindent\z@ \parskip\z@skip
4758 \everypar{}%
4759 % \linewidth\hsize
4760 % \@totalleftmargin\z@
4761 \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
4762 \parfillskip\@flushglue \lineskip\normallineskip
4763 \baselineskip\normalbaselineskip
4764 \sloppy
4765 \let\\\@normalcr
4766 }
4767 % \end{macrocode}
4768 % \end{macro}
4769 %
4770 % \begin{macro}{\caption@normalsize}
4771 % \changes{v3.1}{2007/05/05}{This macro and its usage added}
4772 % This one will be used by |\@caption| instead of |\normalsize|.\par
4773 % Its code is equivalent to
4774 % \begin{quote}
4775 % |\caption@font{normal}%|
4776 % \end{quote}
4777 % but executes faster (since the starred form of |\caption@font|
4778 % does not use |\setkeys| internally).
4779 % \begin{macrocode}
4780 \newcommand*\caption@normalsize{%
4781 \caption@font*{\KV@caption@fnt@normal\@unused}}
4782 % \end{macrocode}
4783 % \end{macro}
4784 %
4785 % \begin{macro}{\caption@setfloatcapt}
4786 % Needed for support of the \package{float} package, where the caption will
4787 % not be typeset directly, but catched in a |\vbox| called |\@floatcapt|
4788 % instead.
4789 % \begin{macrocode}
4790 \let\caption@setfloatcapt\@firstofone
4791 % \end{macrocode}
4792 % \end{macro}
4793 %
4794 % \begin{macro}{\caption@makecurrent}
4795 % \begin{macro}{\caption@makeanchor}
4796 % \begin{macro}{\caption@start}
4797 % \begin{macro}{\caption@@start}
4798 % \begin{macro}{\caption@freezeHref}
4799 % \begin{macro}{\caption@defrostHref}
4800 % All these are needed for support of the \package{hyperref} package.
4801 % \begin{macrocode}
4802 \newcommand*\caption@makecurrent[2]{}
4803 \let\caption@makeanchor\@firstofone
4804 \let\caption@start\relax
4805 \let\caption@@start\relax
4806 \let\caption@freezeHref\relax
4807 \let\caption@defrostHref\relax
4808 % \end{macrocode}
4809 % \end{macro}
4810 % \end{macro}
4811 % \end{macro}
4812 % \end{macro}
4813 % \end{macro}
4814 % \end{macro}
4815 %
4816 % \begin{macro}{\caption@gettitle}
4817 % \changes{v3.1l}{2010/01/09}{This macro and its usage added to adapt the definition of \cs{@currentlabelname} to recent versions of \package{nameref}}
4818 % \changes{v3.1o}{2023/08/05}{Support for older versions of \package{nameref} revised to make it compatible with \LaTeX\ 2023-06-01}
4819 % This one is needed for support of the \package{nameref} package.
4820 % \begin{macrocode}
4821 \newcommand\caption@gettitle[1]{%
4822 \@ifundefined{NR@gettitle}%
4823 {\@ifundefined{NR@sect}{}{\def\@currentlabelname{#1}}}% support for older versions of nameref package
4824 {\NR@gettitle{#1}}} % support for recent versions of nameref package
4825 % \end{macrocode}
4826 % \end{macro}
4827 %
4828 % \subsection{\cs{caption}, \cs{@caption}, and \cs{@makecaption}}
4829 %
4830 % \begin{macro}{\caption@caption}
4831 % \changes{v3.0f}{2005/05/22}{Bugfix: \cs{ContinuedFloat} added}
4832 % \changes{v3.0f}{2005/06/13}{Support of \cs{caption*[]} removed}
4833 % \changes{v3.0l}{2007/01/19}{Minimal support of \textsf{combine} package added}
4834 % \changes{v3.1}{2007/02/04}{Re-written, does not save\&use original definition anymore}
4835 % Here comes our definition of |\caption| and |\caption*|.
4836 % Beside the support of the starred variant this code was adapted to the
4837 % various packages we support.
4838 % We are using |\caption@dblarg| instead of |\@dblarg| so |\caption{}|
4839 % (with an empty arg.) will produce a list-of entry, but |\caption[]{}|
4840 % won't.
4841 % \begin{macrocode}
4842 \def\caption@caption{%
4843 \caption@iftype
4844 {\caption@checkgrouplevel\@empty\caption
4845 \caption@star
4846 {\caption@refstepcounter\@captype}%
4847 {\caption@dblarg{\@caption\@captype}}}%
4848 {\caption@Error{\noexpand\caption outside float}}}%
4849 % \end{macrocode}
4850 % \end{macro}
4851 %
4852 % \begin{macro}{\caption@star}
4853 % \changes{v3.1}{2007/06/24}{Renamed from \cs{caption@caption} to \cs{caption@star}}
4854 % A helper macro which processes the optional |*| after |\caption|.
4855 % \Note{We set \cs{caption@startrue} globally so it works with the
4856 % \package{sidecap} package, too.}
4857 % \begin{macrocode}
4858 \newcommand*\caption@star[2]{%
4859 \@ifstar{\global\caption@startrue#2[]}{#1#2}}%
4860 % \end{macrocode}
4861 % \end{macro}
4862 %
4863 % \begin{macro}{\caption@@caption}
4864 % \changes{v3.1}{2007/02/04}{Re-written, does not save\&use original definition anymore}
4865 % \changes{v3.1f}{2007/11/28}{Bugfix: Handling of \texttt{@minipage} flag added}
4866 % \changes{v3.1f}{2007/11/28}{Support of option \opt{@minipage} added}
4867 % \changes{v3.1g}{2008/03/16}{Internal: Uses \cs{caption@prepareanchor} now}
4868 % As above, our version has been adapted to the packages we support.
4869 % Additionally our code is nested by |\caption@beginex| \&
4870 % |\caption@end| instead of |\begingroup| \& |\endgroup|.
4871 % Furthermore we use |\caption@boxrestore| instead of |\@parboxrestore|
4872 % so this code also works correctly inside list-based environments
4873 % like |wide| \& |addmargin|. (This, and the fact that we use
4874 % |\linewidth| instead of |\hsize| inside |\@makecaption|, solves
4875 % \href{http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=latex/2472}%^^A
4876 % {\LaTeX\ PR \texttt{latex/2472}}.)
4877 % \begin{macrocode}
4878 \long\def\caption@@caption#1[#2]#3{%
4879 % \end{macrocode}
4880 % \begin{macrocode}
4881 \ifcaption@star \else
4882 \caption@prepareanchor{#1}{#2}%
4883 \fi
4884 % \end{macrocode}
4885 % \begin{macrocode}
4886 \par
4887 \caption@beginex{#1}{#2}{#3}%
4888 \caption@setfloatcapt{%
4889 \caption@boxrestore
4890 \if@minipage
4891 \@setminipage
4892 \fi
4893 \caption@normalsize
4894 \ifcaption@star
4895 \let\caption@makeanchor\@firstofone
4896 \fi
4897 \@makecaption{\csname fnum@#1\endcsname}%
4898 {\ignorespaces\caption@makeanchor{#3}}\par
4899 \caption@if@minipage\@minipagetrue\@minipagefalse}%
4900 \caption@end}%
4901 % \end{macrocode}
4902 % \end{macro}
4903 %
4904 % \begin{macro}{\caption@prepareanchor}
4905 % \changes{v3.1g}{2008/03/16}{This macro added}
4906 % \begin{macrocode}
4907 \newcommand*\caption@prepareanchor[2]{%
4908 \caption@makecurrent{#1}{#2}%
4909 \caption@ifhypcap\caption@@start{}}
4910 % \end{macrocode}
4911 % \end{macro}
4912 %
4913 % \begin{macro}{\caption@makecaption}
4914 % \changes{v3.1i}{2008/05/06}{Usage of \cs{caption@rule} added}
4915 % |\@makecaption|\marg{label}\marg{text}\par
4916 % We do basically the same as the original code (from the standard
4917 % \LaTeX\ document classes), but take care of the |position=| setting
4918 % and use |\caption@@make| from the \package{caption} kernel to finally
4919 % typeset the caption.
4920 % \begin{macrocode}
4921 \long\def\caption@makecaption#1#2{%
4922 \caption@iftop
4923 {\vskip\belowcaptionskip}%
4924 {\caption@rule\vskip\abovecaptionskip}%
4925 \caption@@make{#1}{#2}%
4926 \caption@iftop
4927 {\vskip\abovecaptionskip\caption@rule}%
4928 {\vskip\belowcaptionskip}}
4929 % \end{macrocode}
4930 % \end{macro}
4931 %
4932 % \begin{macro}{\caption@redefine}
4933 % \changes{v3.1k}{2009/03/30}{This macro added, it contains the patching code now}
4934 % We only redefine |\caption| and |\@caption| if the current definitions
4935 % are well known, so documents written in the old (\package{caption}
4936 % package \version{1.x}) days (where |\caption| \& |\@caption| were not
4937 % redefined by us) will still compile fine.
4938 % For example the usage of the \package{captcont} package, which brings
4939 % it's own definition of |\caption*|, was quite common these days.
4940 % \begin{macrocode}
4941 \newcommand*\caption@redefine{}
4942 \g@addto@macro\caption@redefine{%
4943 % \end{macrocode}
4944 %
4945 % \begin{macrocode}
4946 \caption@setbool{incompatible}{0}%
4947 % \end{macrocode}
4948 %
4949 % \begin{macrocode}
4950 \caption@CheckCommand\caption{%
4951 % ltfloat.dtx [2002/10/01 v1.1v LaTeX Kernel (Floats)]
4952 \def\caption{%
4953 \ifx\@captype\@undefined
4954 \@latex@error{\noexpand\caption outside float}\@ehd
4955 \expandafter\@gobble
4956 \else
4957 \refstepcounter\@captype
4958 \expandafter\@firstofone
4959 \fi
4960 {\@dblarg{\@caption\@captype}}%
4961 }}%
4962 % \end{macrocode}
4963 %
4964 % \begin{macrocode}
4965 \caption@CheckCommand\caption{%
4966 % beamerbaselocalstructure.sty,v 1.53 2007/01/28 20:48:21 tantau
4967 \def\caption{
4968 \ifx\@captype\@undefined
4969 \@latex@error{\noexpand\caption outside figure or table}\@ehd
4970 \expandafter\@gobble
4971 \else
4972 \refstepcounter\@captype
4973 \expandafter\@firstofone
4974 \fi
4975 {\@dblarg{\@caption\@captype}}%
4976 }}%
4977 % \end{macrocode}
4978 %
4979 % \begin{macrocode}
4980 \caption@CheckCommand\caption{%
4981 % float.sty [2001/11/08 v1.3d Float enhancements (AL)]
4982 \renewcommand\caption{%
4983 \ifx\@captype\@undefined
4984 \@latex@error{\noexpand\caption outside float}\@ehd
4985 \expandafter\@gobble
4986 \else
4987 \refstepcounter\@captype
4988 \let\@tempf\@caption
4989 \expandafter\ifx\csname @float@c@\@captype\endcsname\relax\else
4990 \expandafter\expandafter\let
4991 \expandafter\@tempf\csname @float@c@\@captype\endcsname
4992 \fi
4993 \fi
4994 \@dblarg{\@tempf\@captype}}}%
4995 % \end{macrocode}
4996 %
4997 % \begin{macrocode}
4998 \caption@CheckCommand\caption{%
4999 % hyperref.sty [2007/02/27 v6.75t Hypertext links for LaTeX]
5000 % hyperref.sty [2007/04/09 v6.76a Hypertext links for LaTeX]
5001 % hyperref.sty [2007/06/12 v6.76h Hypertext links for LaTeX]
5002 \def\caption{%
5003 \ifx\@captype\@undefined
5004 \@latex@error{\noexpand\caption outside float}\@ehd
5005 \expandafter\@gobble
5006 \else
5007 \H@refstepcounter\@captype
5008 \@ifundefined{fst@\@captype}{%
5009 \let\Hy@tempa\@caption
5010 }{%
5011 \let\Hy@tempa\Hy@float@caption
5012 }%
5013 \expandafter\@firstofone
5014 \fi
5015 {\@dblarg{\Hy@tempa\@captype}}%
5016 }}%
5017 % \end{macrocode}
5018 % \begin{macrocode}
5019 \caption@CheckCommand\caption{%
5020 % hyperref.sty [2007/08/05 v6.76j Hypertext links for LaTeX]
5021 \def\caption{%
5022 \ifx\@captype\@undefined
5023 \@latex@error{\noexpand\caption outside float}\@ehd
5024 \expandafter\@gobble
5025 \else
5026 \H@refstepcounter\@captype
5027 \let\Hy@tempa\@caption
5028 \@ifundefined{float@caption}{%
5029 }{%
5030 \expandafter\ifx\csname @float@c@\@captype\endcsname\float@caption
5031 \let\Hy@tempa\Hy@float@caption
5032 \fi
5033 }%
5034 \expandafter\@firstofone
5035 \fi
5036 {\@dblarg{\Hy@tempa\@captype}}%
5037 }}%
5038 % \end{macrocode}
5039 %
5040 % \begin{macrocode}
5041 \caption@IfCheckCommand{}{%
5042 \caption@Info{%
5043 Incompatible package detected (regarding \string\caption).\MessageBreak
5044 \string\caption\space=\space\meaning\caption}%
5045 \caption@setbool{incompatible}{1}}%
5046 % \end{macrocode}
5047 %
5048 % \begin{macrocode}
5049 \caption@CheckCommand\@caption{%
5050 % ltfloat.dtx [2002/10/01 v1.1v LaTeX Kernel (Floats)]
5051 \long\def\@caption#1[#2]#3{%
5052 \par
5053 \addcontentsline{\csname ext@#1\endcsname}{#1}%
5054 {\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}%
5055 \begingroup
5056 \@parboxrestore
5057 \if@minipage
5058 \@setminipage
5059 \fi
5060 \normalsize
5061 \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
5062 \endgroup}}%
5063 % \end{macrocode}
5064 %
5065 % \begin{macrocode}
5066 \caption@CheckCommand\@caption{%
5067 % beamerbaselocalstructure.sty,v 1.53 2007/01/28 20:48:21 tantau
5068 \long\def\@caption#1[#2]#3{% second argument ignored
5069 \par\nobreak
5070 \begingroup
5071 \@parboxrestore
5072 \if@minipage
5073 \@setminipage
5074 \fi
5075 \beamer@makecaption{#1}{\ignorespaces #3}\par\nobreak
5076 \endgroup}}%
5077 % \end{macrocode}
5078 %
5079 % \begin{macrocode}
5080 % \caption@CheckCommand\float@caption{%
5081 % % float.sty [2001/11/08 v1.3d Float enhancements (AL)]
5082 % \long\def\float@caption#1[#2]#3{%
5083 % \addcontentsline{\@nameuse{ext@#1}}{#1}%
5084 % {\protect\numberline{\@nameuse{the#1}}{\ignorespaces #2}}
5085 % \global\setbox\@floatcapt\vbox\bgroup\@parboxrestore
5086 % \normalsize\@fs@capt{\@nameuse{fnum@#1}}{\ignorespaces #3}%
5087 % \@ifnextchar[{\float@ccon}{\egroup}}%
5088 % \long\def\float@ccon[#1]{#1\par\egroup}}%
5089 % \end{macrocode}
5090 %
5091 % \begin{macrocode}
5092 \caption@CheckCommand\@caption{%
5093 % hyperref.sty [2007/02/27 v6.75t Hypertext links for LaTeX]
5094 \long\def\@caption#1[#2]#3{%
5095 \hyper@makecurrent{\@captype}%
5096 \def\@currentlabelname{#2}%
5097 \par\addcontentsline{\csname ext@#1\endcsname}{#1}{%
5098 \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}%
5099 }%
5100 \begingroup
5101 \@parboxrestore
5102 \if@minipage
5103 \@setminipage
5104 \fi
5105 \normalsize
5106 \@makecaption{\csname fnum@#1\endcsname}{%
5107 \ignorespaces
5108 \ifHy@nesting
5109 \hyper@@anchor{\@currentHref}{#3}%
5110 \else
5111 \Hy@raisedlink{\hyper@@anchor{\@currentHref}{\relax}}#3%
5112 \fi
5113 }%
5114 \par
5115 \endgroup
5116 }}%
5117 % \end{macrocode}
5118 % \begin{macrocode}
5119 \caption@CheckCommand\@caption{%
5120 % hyperref.sty [2007/04/09 v6.76a Hypertext links for LaTeX]
5121 % hyperref.sty [2007/06/12 v6.76h Hypertext links for LaTeX]
5122 % hyperref.sty [2007/08/05 v6.76j Hypertext links for LaTeX]
5123 \long\def\@caption#1[#2]#3{%
5124 \expandafter\ifx\csname if@capstart\expandafter\endcsname
5125 \csname iftrue\endcsname
5126 \global\let\@currentHref\hc@currentHref
5127 \else
5128 \hyper@makecurrent{\@captype}%
5129 \fi
5130 \def\@currentlabelname{#2}%
5131 \par\addcontentsline{\csname ext@#1\endcsname}{#1}{%
5132 \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}%
5133 }%
5134 \begingroup
5135 \@parboxrestore
5136 \if@minipage
5137 \@setminipage
5138 \fi
5139 \normalsize
5140 \expandafter\ifx\csname if@capstart\expandafter\endcsname
5141 \csname iftrue\endcsname
5142 \global\@capstartfalse
5143 \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces#3}%
5144 \else
5145 \@makecaption{\csname fnum@#1\endcsname}{%
5146 \ignorespaces
5147 \ifHy@nesting
5148 \hyper@@anchor{\@currentHref}{#3}%
5149 \else
5150 \Hy@raisedlink{\hyper@@anchor{\@currentHref}{\relax}}#3%
5151 \fi
5152 }%
5153 \fi
5154 \par
5155 \endgroup
5156 }}%
5157 % \end{macrocode}
5158 % \begin{macrocode}
5159 \caption@CheckCommand\@caption{%
5160 % hyperref.sty [2009/11/27 v6.79k Hypertext links for LaTeX]
5161 \long\def\@caption#1[#2]#3{%
5162 \expandafter\ifx\csname if@capstart\expandafter\endcsname
5163 \csname iftrue\endcsname
5164 \global\let\@currentHref\hc@currentHref
5165 \else
5166 \hyper@makecurrent{\@captype}%
5167 \fi
5168 \def\@currentlabelname{#2}%
5169 \par\addcontentsline{\csname ext@#1\endcsname}{#1}{%
5170 \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}%
5171 }%
5172 \begingroup
5173 \@parboxrestore
5174 \if@minipage
5175 \@setminipage
5176 \fi
5177 \normalsize
5178 \expandafter\ifx\csname if@capstart\expandafter\endcsname
5179 \csname iftrue\endcsname
5180 \global\@capstartfalse
5181 \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces#3}%
5182 \else
5183 \@makecaption{\csname fnum@#1\endcsname}{%
5184 \ignorespaces
5185 \ifHy@nesting
5186 \expandafter\hyper@@anchor\expandafter{\@currentHref}{#3}%
5187 \else
5188 \Hy@raisedlink{%
5189 \expandafter\hyper@@anchor\expandafter{\@currentHref}{\relax}%
5190 }%
5191 #3%
5192 \fi
5193 }%
5194 \fi
5195 \par
5196 \endgroup
5197 }}%
5198 % \end{macrocode}
5199 % \begin{macrocode}
5200 \caption@CheckCommand\@caption{%
5201 % hyperref.sty [2009/12/09 v6.79m Hypertext links for LaTeX]
5202 % hyperref.sty [2009/12/28 v6.79z Hypertext links for LaTeX]
5203 \long\def\@caption#1[#2]#3{%
5204 \expandafter\ifx\csname if@capstart\expandafter\endcsname
5205 \csname iftrue\endcsname
5206 \global\let\@currentHref\hc@currentHref
5207 \else
5208 \hyper@makecurrent{\@captype}%
5209 \fi
5210 \@ifundefined{NR@gettitle}{%
5211 \def\@currentlabelname{#2}%
5212 }{%
5213 \NR@gettitle{#2}%
5214 }%
5215 \par\addcontentsline{\csname ext@#1\endcsname}{#1}{%
5216 \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}%
5217 }%
5218 \begingroup
5219 \@parboxrestore
5220 \if@minipage
5221 \@setminipage
5222 \fi
5223 \normalsize
5224 \expandafter\ifx\csname if@capstart\expandafter\endcsname
5225 \csname iftrue\endcsname
5226 \global\@capstartfalse
5227 \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces#3}%
5228 \else
5229 \@makecaption{\csname fnum@#1\endcsname}{%
5230 \ignorespaces
5231 \ifHy@nesting
5232 \expandafter\hyper@@anchor\expandafter{\@currentHref}{#3}%
5233 \else
5234 \Hy@raisedlink{%
5235 \expandafter\hyper@@anchor\expandafter{%
5236 \@currentHref
5237 }{\relax}%
5238 }%
5239 #3%
5240 \fi
5241 }%
5242 \fi
5243 \par
5244 \endgroup
5245 }}%
5246 % \end{macrocode}
5247 %
5248 % \begin{macrocode}
5249 \caption@CheckCommand\@caption{%
5250 % nameref.sty [2006/12/27 v2.28 Cross-referencing by name of section]
5251 \long\def\@caption#1[#2]{%
5252 \def\@currentlabelname{#2}%
5253 \NR@@caption{#1}[{#2}]%
5254 }}%
5255 % \end{macrocode}
5256 % \begin{macrocode}
5257 \caption@CheckCommand\@caption{%
5258 % nameref.sty [2009/11/27 v2.32 Cross-referencing by name of section]
5259 \long\def\@caption#1[#2]{%
5260 \NR@gettitle{#2}%
5261 \NR@@caption{#1}[{#2}]%
5262 }}%
5263 % \end{macrocode}
5264 %
5265 % \begin{macrocode}
5266 \caption@CheckCommand\@caption{%
5267 % subfigure.sty [2002/07/30 v2.1.4 subfigure package]
5268 \long\def\@caption#1[#2]#3{%
5269 \@ifundefined{if#1topcap}%
5270 {\subfig@oldcaption{#1}[{#2}]{#3}}%
5271 {\@nameuse{if#1topcap}%
5272 \@listsubcaptions{#1}%
5273 \subfig@oldcaption{#1}[{#2}]{#3}%
5274 \else
5275 \subfig@oldcaption{#1}[{#2}]{#3}%
5276 \@listsubcaptions{#1}%
5277 \fi}}}%
5278 % \end{macrocode}
5279 %
5280 % \begin{macrocode}
5281 \caption@CheckCommand\@caption{%
5282 % subfig.sty [2005/06/28 ver: 1.3 subfig package]
5283 \def\@caption{\caption@}%
5284 % \long\def\caption@#1[#2]#3{%
5285 % \@ifundefined{caption@setfloattype}%
5286 % \caption@settype
5287 % \caption@setfloattype
5288 % \@captype
5289 % \sf@ifpositiontop{%
5290 % \@listsubcaptions{#1}%
5291 % \sf@old@caption{#1}[{#2}]{#3}%
5292 % }{%
5293 % \sf@old@caption{#1}[{#2}]{#3}%
5294 % \@listsubcaptions{#1}%
5295 % }}%
5296 }%
5297 % \end{macrocode}
5298 %
5299 % \begin{macrocode}
5300 \caption@IfCheckCommand{}{%
5301 \caption@Info{%
5302 Incompatible package detected (regarding \string\@caption).\MessageBreak
5303 \string\@caption\space=\space\meaning\@caption}%
5304 \caption@setbool{incompatible}{1}}%
5305 % \end{macrocode}
5306 %
5307 % The option |compatibility=| will override the compatibility mode.
5308 % \begin{macrocode}
5309 \@ifundefined{caption@ifcompatibility}%
5310 {\let\caption@ifcompatibility\caption@ifincompatible
5311 \let\caption@tempa\caption@WarningNoLine}%
5312 {\let\caption@tempa\@gobble}% suppress warning
5313 % \end{macrocode}
5314 %
5315 % \begin{macrocode}
5316 \caption@ifcompatibility{%
5317 % \end{macrocode}
5318 %
5319 % \begin{macrocode}
5320 \caption@tempa{%
5321 \noexpand\caption will not be redefined since it's already\MessageBreak
5322 redefined by a document class or package which is\MessageBreak
5323 unknown to the caption package}%
5324 % \end{macrocode}
5325 %
5326 % \begin{macrocode}
5327 \renewcommand*\caption@redefine{}%
5328 % \end{macrocode}
5329 %
5330 % |\ContinuedFloat| is not supported in compatibility mode.
5331 % \begin{macrocode}
5332 \renewcommand*\caption@ContinuedFloat[1]{%
5333 \caption@Error{Not available in compatibility mode}}%
5334 % \end{macrocode}
5335 %
5336 % |\caption@start| is not supported in compatibility mode.
5337 % \begin{macrocode}
5338 \caption@AtBeginDocument*{%
5339 \let\caption@start\relax
5340 \@ifundefined{caption@ORI@capstart}{}{%
5341 \caption@Debug{%
5342 Restore hypcap definition of \string\capstart\@gobble}%
5343 \let\capstart\caption@ORI@capstart}%
5344 \@ifundefined{caption@ORI@float@makebox}{}{%
5345 \caption@Debug{%
5346 Restore hyperref redefinition of \string\float@makebox\@gobble}%
5347 \let\float@makebox\caption@ORI@float@makebox}%
5348 }%
5349 % \end{macrocode}
5350 %
5351 % \begin{macro}{\caption@star}
5352 % We redefine |\caption@star| here so it does not make any harm.
5353 % \begin{macrocode}
5354 \renewcommand*\caption@star[2]{#1#2}%
5355 % \end{macrocode}
5356 % \end{macro}
5357 %
5358 % \begin{macrocode}
5359 }{%
5360 % \end{macrocode}
5361 %
5362 % \begin{macrocode}
5363 \caption@ifincompatible{%
5364 \caption@WarningNoLine{%
5365 Forced redefinition of \noexpand\caption since the\MessageBreak
5366 unsupported(!) package option `compatibility=false'\MessageBreak
5367 was given}%
5368 }{}%
5369 % \end{macrocode}
5370 %
5371 % \begin{macro}{\caption}
5372 % \begin{macro}{\@caption}
5373 % \begin{macrocode}
5374 \renewcommand*\caption@redefine{%
5375 \let\caption\caption@caption
5376 \let\@caption\caption@@caption}%
5377 \caption@redefine
5378 % \end{macrocode}
5379 % \end{macro}
5380 % \end{macro}
5381 %
5382 % \begin{macrocode}
5383 }%
5384 % \end{macrocode}
5385 % \begin{macrocode}
5386 \caption@AtBeginDocument*{%
5387 \let\caption@ORI@capstart\@undefined
5388 \let\caption@ORI@float@makebox\@undefined}%
5389 % \end{macrocode}
5390 %
5391 % \begin{macro}{\@xfloat}
5392 % \changes{v3.1}{2007/05/09}{This re-definition added}
5393 % \changes{v3.1b}{2007/09/22}{Will now be redefined in compatibility mode, too}
5394 % We redefine |\@xfloat| so inside floating environments our
5395 % type-specific options will be used, a \package{hyperref}
5396 % anchor will be set etc.
5397 % \begin{macrocode}
5398 \let\caption@ORI@xfloat\@xfloat
5399 \def\@xfloat#1[#2]{%
5400 \caption@ORI@xfloat{#1}[#2]%
5401 \caption@settype{#1}}%
5402 % \end{macrocode}
5403 % \end{macro}
5404 %
5405 % \begin{macrocode}
5406 }
5407 % \end{macrocode}
5408 % \end{macro}
5409 %
5410 % Some packages (like the \package{hyperref} package for example) redefines
5411 % |\caption| and |\@caption|, too.
5412 % So we have to use |\AtBeginDocument| here, so we can make sure
5413 % our definition is the one which will be valid at last.
5414 % \begin{macrocode}
5415 \caption@AtBeginDocument{\caption@redefine}
5416 % \end{macrocode}
5417 %
5418 % \begin{macro}{\@makecaption}
5419 % \begin{macrocode}
5420 \let\@makecaption\caption@makecaption
5421 % \end{macrocode}
5422 % \end{macro}
5423 %
5424 % \subsection{Support for sub-captions}
5425 % \changes{v3.1f}{2007/11/16}{Support for sub-captions added}
5426 %
5427 % \begin{macro}{\caption@DeclareSubType}
5428 % |\caption@DeclareSub| initializes the usage of \cs{caption}
5429 % in sub-floats.
5430 % \begin{macrocode}
5431 \def\caption@DeclareSubType sub#1\@nil{%
5432 \caption@Debug{Initializing subtype for `#1'\@gobble}%
5433 \@namedef{caption@c@#1}{0}%
5434 \@namedef{caption@beginsub#1}{\caption@beginsubfloat{#1}}}
5435 \@onlypreamble\caption@DeclareSubType
5436 % \end{macrocode}
5437 % \end{macro}
5438 %
5439 % Initialize the sub-captions defined with \cs{DeclareCaptionSubType}\ldots
5440 % \begin{macrocode}
5441 \caption@For*{subtypelist}{\caption@DeclareSubType sub#1\@nil}
5442 % \end{macrocode}
5443 %
5444 % Initialize the sub-captions defined with \cs{newsubfloat}\cite{subfig}\ldots
5445 % \begin{macrocode}
5446 \caption@AtBeginDocument*{%
5447 \@ifundefined{sf@counterlist}{}{%
5448 \@for\sf@temp:=\sf@counterlist\do{%
5449 \expandafter\caption@DeclareSubType\sf@temp\@nil}}}
5450 % \end{macrocode}
5451 %
5452 % \begin{macro}{\caption@subtypehook}
5453 % \changes{v3.1g}{2008/03/20}{Redefinition of \cs{caption@setlist} added}
5454 % \changes{v3.1k}{2009/10/09}{Bugfix 09-08-12b: \cs{@makecaption} will now be restored here, too}
5455 % Hook, will be used inside \cs{caption@setsubtype}.
5456 % \begin{macrocode}
5457 \newcommand*\caption@subtypehook{%
5458 \ifx\caption\caption@subcaption \else
5459 % \end{macrocode}
5460 % \begin{macrocode}
5461 \caption@ifrefstepcounter{}{%
5462 % no \caption or \subcaption in this (floating) environment yet
5463 \caption@Debug{Increment \@captype\ counter =\the\value\@captype}%
5464 \caption@l@stepcounter\@captype
5465 \let\addcontentsline\caption@addsubcontentsline}%
5466 % \end{macrocode}
5467 % \begin{macrocode}
5468 \ifnum\csname caption@c@\@captype\endcsname=\value\@captype \else
5469 \caption@Debug{Reset sub\@captype\ counter}%
5470 \expandafter\xdef\csname caption@c@\@captype\endcsname{%
5471 \the\value\@captype}%
5472 \@stpelt\@subcaptype
5473 \fi
5474 % \end{macrocode}
5475 % \begin{macrocode}
5476 \c@ContinuedFloat=0\relax
5477 \let\caption@resetContinuedFloat\@gobble
5478 \let\caption@addcontentsline\caption@kernel@addcontentsline
5479 \let\caption@setfloatcapt\@firstofone
5480 % \end{macrocode}
5481 % \begin{macrocode}
5482 \caption@clearmargin
5483 \caption@iflist{}{\let\caption@setlist\@gobble}%
5484 \caption@setoptions{sub}%
5485 \caption@setoptions{subfloat}% for subfig-package compatibility
5486 % \end{macrocode}
5487 % \begin{macrocode}
5488 \let\caption\caption@subcaption
5489 \let\@makecaption\caption@makecaption
5490 \fi}%
5491 % \end{macrocode}
5492 % \end{macro}
5493 %
5494 % \begin{macro}{\caption@subcaption}
5495 % Makes a sub-caption.
5496 % \begin{macrocode}
5497 \newcommand*\caption@subcaption{%
5498 \caption@iftype
5499 {\caption@checkgrouplevel{sub}\subcaption
5500 \caption@star
5501 {\caption@refstepcounter\@subcaptype}%
5502 {\caption@dblarg{\@caption\@subcaptype}}}%
5503 {\caption@Error{\noexpand\subcaption outside float}}}
5504 % \end{macrocode}
5505 % \end{macro}
5506 %
5507 % \begin{macro}{\caption@addcontentsline}
5508 % \changes{v3.1g}{2008/01/12}{Argument of \cs{caption@addsubcontentslines} removed}
5509 % \changes{v3.1i}{2008/08/02}{Argument of \cs{caption@addsubcontentslines} re-added}
5510 % We extend |\caption@addcontentsline| so it handles sub-captions, too.
5511 % \Note{\cs{sf@ifpositiontop} \& \cs{@listsubcaptions} are defined by the
5512 % \package{subfigure} \& \package{subfig} packages.}
5513 % \begin{macrocode}
5514 \let\caption@kernel@addcontentsline\caption@addcontentsline
5515 \renewcommand*\caption@addcontentsline[2]{%
5516 \sf@ifpositiontop{\@listsubcaptions{#1}}{}%
5517 \caption@kernel@addcontentsline{#1}{#2}%
5518 \sf@ifpositiontop{}{\@listsubcaptions{#1}}%
5519 \caption@addsubcontentslines{#1}}
5520 % \end{macrocode}
5521 % \begin{macrocode}
5522 \newcommand*\caption@addsubcontentslines[1]{%
5523 \begingroup
5524 \caption@subcontentslines
5525 \endgroup
5526 \caption@clearsubcontentslines}%
5527 % \end{macrocode}
5528 % \end{macro}
5529 %
5530 % \begin{macrocode}
5531 \caption@AtBeginDocument*{%
5532 \@ifundefined{sf@ifpositiontop}{\let\sf@ifpositiontop\@gobbletwo}{}%
5533 \caption@clearsubcontentslines
5534 \g@addto@macro\caption@typehook{\caption@checksubcontentslines}%
5535 \AtEndDocument{\caption@checksubcontentslines}}%
5536 % \end{macrocode}
5537 %
5538 % \begin{macro}{\caption@addsubcontentsline}
5539 % \changes{v3.1i}{2008/08/02}{Bugfix 08-07-28:
5540 % \cs{label}, \cs{index}, and \cs{glossary} are allowed inside the list entry now}
5541 % Add a pending sub-caption list entry.
5542 % \begin{macrocode}
5543 \newcommand*\caption@addsubcontentsline[3]{%
5544 \begingroup
5545 \let\label\@gobble \let\index\@gobble \let\glossary\@gobble
5546 \protected@edef\@tempa{\endgroup
5547 \noexpand\g@addto@macro\noexpand\caption@subcontentslines{%
5548 \noexpand\@namedef{the#2}{\csname the#2\endcsname}%
5549 \ifx\@currentHref\@undefined \else
5550 \noexpand\def\noexpand\@currentHref{\@currentHref}%
5551 \fi
5552 \protect\addcontentsline{#1}{#2}{#3}}}%
5553 \@tempa}
5554 % \end{macrocode}
5555 % \end{macro}
5556 %
5557 % \begin{macro}{\caption@checksubcontentslines}
5558 % \changes{v3.1g}{2008/01/07}{Bugfix: Uses \cs{caption@Error} instead of \cs{subcaption@Error} now}
5559 % Checks if the list of pending sub-captions is empty, if not,
5560 % a warning will be issued.
5561 % \begin{macrocode}
5562 \newcommand*\caption@checksubcontentslines{%
5563 \ifx\caption@subcontentslines\@empty \else
5564 \caption@Error{%
5565 Something's wrong--perhaps a missing \protect\caption\MessageBreak
5566 in the last figure or table}%
5567 \caption@clearsubcontentslines
5568 \fi}
5569 % \end{macrocode}
5570 % \end{macro}
5571 %
5572 % \begin{macro}{\caption@clearsubcontentslines}
5573 % Clear pending sub-caption list entries.
5574 % \begin{macrocode}
5575 \newcommand*\caption@clearsubcontentslines{%
5576 \global\let\caption@subcontentslines\@empty}
5577 % \end{macrocode}
5578 % \end{macro}
5579 %
5580 % \subsection{Document class \& Babel package support}
5581 %
5582 % \subsubsection{The \AmS{} \& \SmF{} classes}
5583 % \changes{v3.1}{2007/07/29}{\AmS\ \& \SmF\ classes support added (package)}
5584 %
5585 % \begin{macrocode}
5586 \@ifundefined{smf@makecaption}{}{\let\smf@makecaption\@makecaption}
5587 % \end{macrocode}
5588 %
5589 % \subsubsection{The beamer class}
5590 % \changes{v3.1}{2007/03/10}{beamer class support added (package)}
5591 %
5592 % \begin{macrocode}
5593 \@ifclassloaded{beamer}{%
5594 \caption@Info{beamer document class}%
5595 % \end{macrocode}
5596 %
5597 % Since the beamer class do not offer a `list of figures' we switch
5598 % this support in \thispackage\ off.
5599 % \begin{macrocode}
5600 \captionsetup{list=false}
5601 \DeclareCaptionOption{list}[1]{}
5602 \DeclareCaptionOption{listof}[1]{}
5603 % \end{macrocode}
5604 %
5605 % \begin{macro}{\figure}
5606 % \changes{v3.1f}{2007/12/17}{This re-definition for \class{beamer} document class added}
5607 % \begin{macro}{\table}
5608 % \changes{v3.1f}{2007/12/17}{This re-definition for \class{beamer} document class added}
5609 % We redefine |figure| \& |table| so our type-specific options will be used,
5610 % a \package{hyperref} anchor will be set etc.
5611 % \begin{macrocode}
5612 \expandafter\let\expandafter\caption@ORI@figure
5613 \csname\string\figure\endcsname
5614 \@namedef{\string\figure}[#1]{%
5615 \caption@ORI@figure[#1]%
5616 \caption@settype{figure}}
5617 % \end{macrocode}
5618 % \begin{macrocode}
5619 \expandafter\let\expandafter\caption@ORI@table
5620 \csname\string\table\endcsname
5621 \@namedef{\string\table}[#1]{%
5622 \caption@ORI@table[#1]%
5623 \caption@settype{table}}
5624 % \end{macrocode}
5625 % \end{macro}
5626 % \end{macro}
5627 %
5628 % \begin{macrocode}
5629 }{}
5630 % \end{macrocode}
5631 %
5632 % \subsubsection{The \KOMAScript{} classes}
5633 %
5634 % \KOMAScript\ contains the code
5635 % |\AtBeginDocument{\let\scr@caption\caption}|
5636 % so we need to update |\scr@caption| here, too.
5637 %
5638 % \begin{macrocode}
5639 \@ifundefined{scr@caption}{}{%
5640 \caption@AtBeginDocument{\let\scr@caption\caption}}
5641 % \end{macrocode}
5642 %
5643 % \subsubsection{The frenchb Babel option}
5644 % \changes{v3.1}{2006/05/14}{Adaptation to \package{frenchb} added (package)}
5645 %
5646 % Suppress
5647 % ``Package |frenchb.ldf| Warning: The definition of |\@makecaption| has been
5648 % changed, frenchb will NOT customize it.''
5649 % (but only if we emulate this customization)
5650 % \begin{macrocode}
5651 \@nameuse{caption@frenchb}\@nameundef{caption@frenchb}
5652 % \end{macrocode}
5653 %
5654 % \subsubsection{The frenchle/pro package}
5655 % \changes{v3.0h}{2005/10/03}{Adaptation to \package{frenchle/pro} added (package)}
5656 %
5657 % \begin{macrocode}
5658 \caption@AtBeginDocument{\@ifundefined{frenchTeXmods}{}{%
5659 \caption@Info{frenchle/pro package is loaded}%
5660 % \end{macrocode}
5661 %
5662 % \begin{macrocode}
5663 \let\captionfont@ORI\captionfont
5664 \let\captionlabelfont@ORI\captionlabelfont
5665 \let\@makecaption@ORI\@makecaption
5666 % \end{macrocode}
5667
5668 % If |\GOfrench| is defined as |\relax| all the re-definitions regarding
5669 % captions have already been done, so we can do our patches immediately.
5670 % Otherwise we must add our stuff to |\GOfrench|.
5671 % \begin{macrocode}
5672 \@ifundefined{GOfrench}%
5673 {\let\caption@tempa\@firstofone}%
5674 {\def\caption@tempa{\g@addto@macro\GOfrench}}%
5675 \caption@tempa{%
5676 % \end{macrocode}
5677 %
5678 % \begin{macrocode}
5679 \let\captionfont\captionfont@ORI
5680 \let\captionfont@ORI\@undefined
5681 \let\captionlabelfont\captionlabelfont@ORI
5682 \let\captionlabelfont@ORI\@undefined
5683 \let\@makecaption\@makecaption@ORI
5684 \let\@makecaption@ORI\@undefined
5685 % \end{macrocode}
5686 %
5687 % \begin{macro}{\@cnORI}
5688 % We update the definition of |\@cnORI| so it actually reflects
5689 % our definition of |\caption|.
5690 % \begin{macrocode}
5691 \let\@cnORI\caption
5692 % \end{macrocode}
5693 % \end{macro}
5694 %
5695 % \begin{macro}{\@tablescaption}
5696 % The \package{frenchle/pro} package sets |\caption| to |\@tablescaption| at
5697 % |\begin{table}| for special treatment of footnotes.
5698 % Therefore we have to patch |\@tablescaption| so |\caption*| will work
5699 % inside the |table| environment.
5700 % \begin{macrocode}
5701 \let\caption@tcORI\@tablescaption
5702 \def\@tablescaption{\caption@star\relax\caption@tcORI}%
5703 % \end{macrocode}
5704 % \end{macro}
5705 %
5706 % \begin{macro}{\f@ffrench}
5707 % \begin{macro}{\f@tfrench}
5708 % |\f@ffrench| and |\f@tfrench| reflect |\fnum@figure| and |\fnum@table|
5709 % when used in French mode. These contain additional code which typesets
5710 % the caption separator |\captionseparator| instead of the usual colon.
5711 % Because this breaks with our |\@makecaption| code we have to remove
5712 % this additional code here.
5713 % \begin{macrocode}
5714 \let\@eatDP\@undefined
5715 \let\caption@tempa\@empty
5716 \ifx\f@ffrench\fnum@figure
5717 \l@addto@macro\caption@tempa{\let\fnum@figure\f@ffrench}%
5718 \fi
5719 \ifx\f@tfrench\fnum@table
5720 \l@addto@macro\caption@tempa{\let\fnum@table\f@tfrench}%
5721 \fi
5722 \def\f@ffrench{\ifx\listoffigures\relax\else\figurename~\thefigure\fi}%
5723 \def\f@tfrench{\ifx\listoftables\relax\else\tablename~\thetable\fi}%
5724 \caption@tempa
5725 % \end{macrocode}
5726 % \end{macro}
5727 % \end{macro}
5728 %
5729 % \begin{macrocode}
5730 }%
5731 }}
5732 % \end{macrocode}
5733 %
5734 % \subsection{Package support}
5735 % \changes{v3.1}{2007/04/11}{Package options `float', `longtable' etc.
5736 % are not supported anymore, removed}
5737 %
5738 % \begin{macro}{\caption@IfPackageLoaded}
5739 % \changes{v3.0f}{2005/05/29}{3rd argument \meta{code} added,
5740 % so no extra check is needed}
5741 % \changes{v3.1}{2007/07/04}{Re-written \& renamed from \cs{caption@ifpackage}
5742 % to \cs{caption@IfPackageLoaded}}
5743 % |\caption@IfPackageLoaded|\marg{package}\oarg{version}\marg{true}\marg{false}\par
5744 % Some kind of combination of |\@ifpackageloaded| and |\@ifpackagelater|.
5745 % If the \meta{package} is not loaded yet, the check will be (re-)done
5746 % |\AtBeginDocument|, so the \meta{package} could be loaded later on, too.
5747 % \begin{macrocode}
5748 \newcommand\caption@IfPackageLoaded[1]{%
5749 \@testopt{\caption@@IfPackageLoaded{#1}}{}}
5750 \@onlypreamble\caption@IfPackageLoaded
5751 % \end{macrocode}
5752 % \begin{macrocode}
5753 \long\def\caption@@IfPackageLoaded#1[#2]#3#4{%
5754 \@ifpackageloaded{#1}\@firstofone{%
5755 \caption@Debug{#1 package is not loaded (yet)\@gobble}%
5756 \caption@AtBeginDocument}{%
5757 \caption@@ifpackageloaded{#1}[#2]{#3}{#4}}}
5758 \@onlypreamble\caption@@IfPackageLoaded
5759 % \end{macrocode}
5760 % \begin{macrocode}
5761 \newcommand\caption@ifpackageloaded[1]{%
5762 \@testopt{\caption@@ifpackageloaded{#1}}{}}
5763 \@onlypreamble\caption@ifpackageloaded
5764 % \end{macrocode}
5765 % \begin{macrocode}
5766 \long\def\caption@@ifpackageloaded#1[#2]{%
5767 \@ifpackageloaded{#1}{%
5768 \caption@Info{#1 package is loaded}%
5769 \@ifpackagelater{#1}{#2}\@firstoftwo{%
5770 \caption@Error{%
5771 For a successful cooperation we need at least version\MessageBreak
5772 `#2' of package #1,\MessageBreak
5773 but only version\MessageBreak
5774 `\csname ver@#1.\@pkgextension\endcsname'\MessageBreak
5775 is available}%
5776 \@secondoftwo}%
5777 }{\@secondoftwo}}
5778 \@onlypreamble\caption@@ifpackageloaded
5779 % \end{macrocode}
5780 % \end{macro}
5781 %
5782 % \begin{macro}{\caption@clearmargin}
5783 % \changes{v3.1}{2007/05/05}{This macro and its usage added}
5784 % This macro will be used by some package support stuff where the usual
5785 % margin setting is not welcome, e.g. in the \package{sidecap} package.
5786 % \begin{macrocode}
5787 \newcommand*\caption@clearmargin{%
5788 \setcaptionmargin\z@
5789 \let\caption@minmargin\@undefined}
5790 % \end{macrocode}
5791 % \end{macro}
5792 %
5793 % \begin{macrocode}
5794 \caption@setbool{needfreeze}{0}
5795 \caption@AtBeginDocument*{%
5796 \caption@ifneedfreeze{%
5797 % \end{macrocode}
5798 %
5799 % \begin{macro}{\caption@freeze}
5800 % \changes{v3.1}{2007/07/22}{This macro added}
5801 % \changes{v3.1c}{2007/10/06}{\cs{caption} \& \cs{@caption} revised for enhanced compatibility}
5802 % \changes{v3.1c}{2007/10/06}{Bugfix: Made \cs{@caption} long}
5803 % \changes{v3.1f}{2007/11/16}{Uses `space hack' instead of \cs{ignorespaces} now}
5804 % \changes{v3.1g}{2008/01/29}{Starred variants of \cs{ContinuedFloat} and \cs{captionsetup} added}
5805 % |\caption@freeze*|\par
5806 % Used by the \package{fltpage} \& \package{sidecap} package support.
5807 % \begin{macrocode}
5808 \newcommand*\caption@freeze{%
5809 \caption@teststar\caption@@freeze\@gobble\@firstofone}%
5810 % \end{macrocode}
5811 % \begin{macrocode}
5812 \newcommand*\caption@@freeze[1]{%
5813 \global\let\caption@SCcontinued\relax
5814 \global\let\caption@SCsetup\@undefined
5815 \global\let\caption@SClentry\@undefined
5816 \global\let\caption@SCtext\@undefined
5817 \global\let\caption@SClabel\@undefined
5818 % \end{macrocode}
5819 % \begin{macrocode}
5820 \let\caption@ORI@ContinuedFloat\ContinuedFloat
5821 \def\ContinuedFloat{%
5822 \caption@withoptargs\caption@SC@ContinuedFloat}%
5823 \def\caption@SC@ContinuedFloat##1{%
5824 \let\caption@ORI@setcounter\setcounter
5825 \let\caption@ORI@addtocounter\addtocounter
5826 \def\setcounter####1####2{\csname c@####1\endcsname####2\relax}%
5827 \def\addtocounter####1####2{\advance\csname c@####1\endcsname ####2\relax}%
5828 \caption@ORI@ContinuedFloat##1%
5829 \global\let\caption@SCcontinued\caption@ORI@ContinuedFloat
5830 \let\setcounter\caption@ORI@setcounter
5831 \let\addtocounter\caption@ORI@addtocounter}%
5832 \let\caption@ORI@setup\captionsetup
5833 \def\captionsetup{%
5834 \caption@withoptargs\caption@SC@setup}%
5835 \def\caption@SC@setup##1##2{%
5836 \caption@g@addto@list\caption@SCsetup{##2}%
5837 \caption@ORI@setup##1{##2}}%
5838 \let\caption@ORI\caption
5839 \def\caption{%
5840 \def\caption{\caption@Error{%
5841 Only one \noexpand\caption can be placed in this environment}}%
5842 \let\captionsetup\caption@setup
5843 \let\caption@@refstepcounter\caption@l@stepcounter
5844 \caption@ORI}%
5845 \long\def\@caption##1[##2]##3{%
5846 \@bsphack
5847 \gdef\caption@SClentry{##2}%
5848 \gdef\caption@SCtext{##3}%
5849 \@esphack}%
5850 #1{% is \@gobble in star form, and \@firstofone otherwise
5851 \def\label##1{\@bsphack\gdef\caption@SClabel{##1}\@esphack}}%
5852 % \end{macrocode}
5853 % \begin{macrocode}
5854 }%
5855 % \end{macrocode}
5856 % \end{macro}
5857 %
5858 % \begin{macro}{\caption@defrost}
5859 % \changes{v3.1}{2007/07/22}{This macro added}
5860 % \changes{v3.1g}{2008/01/30}{\cs{caption@defrost@setup} added}
5861 % |\caption@defrost|
5862 % \begin{macrocode}
5863 \newcommand*\caption@defrost{%
5864 \ifx\caption@ORI@ContinuedFloat\@undefined
5865 \caption@defrost@setup
5866 \ifx\caption@SCtext\@undefined \else
5867 \expandafter\expandafter\expandafter\caption
5868 \expandafter\expandafter\expandafter[%
5869 \expandafter\expandafter\expandafter{%
5870 \expandafter\caption@SClentry\expandafter}\expandafter]%
5871 \expandafter{\caption@SCtext}%
5872 \fi
5873 \ifx\caption@SClabel\@undefined \else
5874 \expandafter\label\expandafter{\caption@SClabel}%
5875 \fi
5876 \else
5877 \caption@Error{Internal Error:\MessageBreak
5878 \noexpand\caption@defrost in same group as \string\caption@freeze}%
5879 \fi}%
5880 % \end{macrocode}
5881 % \begin{macrocode}
5882 \newcommand*\caption@defrost@setup{%
5883 \caption@SCcontinued
5884 \ifx\caption@SCsetup\@undefined \else
5885 \expandafter\captionsetup\expandafter{\caption@SCsetup}%
5886 \fi}%
5887 % \end{macrocode}
5888 % \end{macro}
5889 %
5890 % \begin{macrocode}
5891 }{}%
5892 \caption@undefbool{needfreeze}}
5893 % \end{macrocode}
5894 %
5895 % \subsubsection{The float package}
5896 % \changes{v3.0f}{2005/05/31}{\package{float} package support rewritten and improved}
5897 % \iffalse
5898 % (This is a more straight-ahead implementation, but it only works with v1.3
5899 % now, so v1.2 is no longer supported. The old code including documentation
5900 % can be found in caption-30f-050530.zip)
5901 % \fi
5902 %
5903 % The \package{float} package usually do not use the \LaTeX\ kernel command
5904 % |\@caption| to typeset the caption but |\float@caption| instead.
5905 % (|\@caption| will only be used if the float is re-styled with
5906 % |\restylefloat*|.)
5907 %
5908 % The main two things |\float@caption| is doing different are:
5909 % \begin{itemize}
5910 % \item The caption will be typeset inside a |\savebox| called |\@floatcapt|
5911 % so it can be placed above or below the float contents afterwards.
5912 % \item |\@makecaption| will not be used to finally typeset the caption.
5913 % Instead |\@fs@capt| will be used which definition is part of the float
5914 % style.
5915 % (Note that |\@fs@capt| will not typeset any vertical space above or below
5916 % the caption; instead this space will be typeset by the float style code
5917 % itself.)
5918 % \end{itemize}
5919 %
5920 % \begin{macrocode}
5921 \caption@IfPackageLoaded{float}[2001/11/08 v1.3d]{%
5922 \@ifpackageloaded{floatrow}{%
5923 \caption@ifpackageloaded{floatrow}[2007/08/24 v0.2a]{}{}%
5924 }{%
5925 % \end{macrocode}
5926 %
5927 % \iffalse
5928 % \begin{macro}{\caption@of}
5929 % If the float is defined by the float package (which means |\fst@|\meta{type}
5930 % is defined) we `execute' this float style, so |\@fs@iftopcapt| is set to its
5931 % proper value.
5932 % Furthermore we undo the re-definition of |\caption@setfloatcapt| which was
5933 % done by |\float@dostyle|.
5934 % \begin{macrocode}
5935 % \renewcommand*\caption@of[2]{%
5936 % \float@ifstyle{#2}{%
5937 % \float@dostyle{#2}%
5938 % \let\caption@setfloatcapt\@firstofone}{}%
5939 % \caption@settype*{#2}#1}%
5940 % \end{macrocode}
5941 % \end{macro}
5942 % \fi
5943 %
5944 % \begin{macro}{\@float@setevery}
5945 % \changes{v3.1k}{2009/10/09}{Bugfix 08-12-05: \cs{color@begin/endgroup} added
5946 % to redefinition of \cs{caption@setfloatcapt}}
5947 % |\@float@setevery|\marg{float type} is provided by the \package{float}
5948 % package; it's called every time a floating environment defined with
5949 % |\newfloat| or |\restylefloat| begins.
5950 % We use this hook to do some adaptations and to setup the proper caption
5951 % style (if defined) and additional settings declared with
5952 % |\captionsetup|\oarg{float style}.
5953 % \begin{macrocode}
5954 \let\caption@ORI@float@setevery\@float@setevery
5955 \def\@float@setevery#1{%
5956 \float@ifcaption{#1}{%
5957 % \end{macrocode}
5958 %
5959 % First of all we set the caption position to it's proper value by
5960 % converting |\@fs@iftopcapt| (which is part of a float style and
5961 % controls where the caption will be typeset, above or below the float
5962 % contents) to our |position=| setting.
5963 % Since the spacing above and below the caption will be done by the float
5964 % style and \emph{not} by us this sounds quite useless. But in fact it isn't,
5965 % since some packages based on \thispackage\ (like the \package{subfig}
5966 % package) could have an interest for this information and therefore use the
5967 % |\caption@iftop| macro we provide in our kernel. Furthermore we need this
5968 % information for ourself in |\captionof| which uses |\@makecaption| to
5969 % finally typeset the caption with skips.
5970 % \begin{macrocode}
5971 \caption@setposition{\@fs@iftopcapt t\else b\fi}%
5972 % \end{macrocode}
5973 %
5974 % Afterward we redefine |\caption@setfloatcapt| (which will be used inside
5975 % |\@caption|) so the caption will be set inside the box |\@floatcapt|,
5976 % without extra vertical space.
5977 % \begin{macrocode}
5978 \renewcommand\caption@setfloatcapt[1]{%
5979 \let\@makecaption\caption@@make
5980 \global\setbox\@floatcapt\vbox{%
5981 \color@begingroup ##1\color@endgroup}}%
5982 % \end{macrocode}
5983 %
5984 % To allow different caption styles for different float styles we also
5985 % determine the current float style (e.g. `ruled') and select
5986 % a caption style (and additional settings) with the same name, if defined.
5987 % \begin{macrocode}
5988 \float@getstyle\float@style{#1}%
5989 \caption@setstyle*\float@style
5990 \caption@setoptions\float@style
5991 % \end{macrocode}
5992 %
5993 % \begin{macrocode}
5994 }{}%
5995 \caption@freezeHref % will be defrosted in \float@makebox
5996 \caption@ORI@float@setevery{#1}}%
5997 % \end{macrocode}
5998 % \end{macro}
5999 %
6000 % \begin{macro}{\caption@typehook}
6001 % \changes{v3.1}{2007/07/08}{float package hook added}
6002 % \LaTeX\ and almost every other packages use
6003 % |\|\meta{type}|name|
6004 % to provide a macro for the type resp.~environment name -- for example
6005 % the command |\figurename| will usually contain the name of the floating
6006 % environment |figure|:
6007 % \begin{quote}
6008 % |\newcommand\figurename{Figure}|
6009 % \end{quote}
6010 % But the \package{float} package doesn't follow this common naming
6011 % convention:
6012 % For floats defined with |\newfloat| it uses |\fname@|\meta{type} instead,
6013 % which breaks with our code (and with |\autoref| and some other things as
6014 % well).
6015 % So we have to map the \package{float} package name to the common one here.\par
6016 % \Note{If the float was not defined with \cs{newfloat} but with
6017 % \cs{restylefloat} instead, \cs{fname@}\meta{type} is not defined.}
6018 % \begin{macrocode}
6019 \g@addto@macro\caption@typehook{%
6020 \expandafter\ifx\csname #1name\endcsname\relax
6021 \expandafter\let\csname #1name\expandafter\endcsname
6022 \csname fname@#1\endcsname
6023 \fi}%
6024 % \end{macrocode}
6025 % \end{macro}
6026 %
6027 % \changes{v3.0f}{2005/06/26}{Skips of \env{plaintop} and \env{boxed} floats corrected}
6028 % \begin{macro}{\fs@plaintop}
6029 % \begin{macro}{\fs@boxed}
6030 % Since the float styles |plaintop| and |boxed| don't use |\abovecaptionskip|
6031 % which could be set with |skip=| (|plaintop| uses |\belowcaptionskip| instead of
6032 % |\abovecaptionskip|, and |boxed| uses a fixed space of |2pt|)
6033 % we patch the according float style macros here to change this.
6034 % \begin{macrocode}
6035 \g@addto@macro\fs@plaintop{\def\@fs@mid{\vspace\abovecaptionskip\relax}}%
6036 \g@addto@macro\fs@boxed{\def\@fs@mid{\kern\abovecaptionskip\relax}}%
6037 % \end{macrocode}
6038 % \end{macro}
6039 % \end{macro}
6040 %
6041 % \begin{macro}{\float@ifstyle}
6042 % \changes{v3.1}{2007/06/10}{This macro added}
6043 % |\float@ifstyle|\marg{type}\marg{if-clause}\marg{else-clause}\par
6044 % Checks if the given \meta{type} (e.g.~|figure|) is associated with a
6045 % float style (e.g.~|boxed|).
6046 % \begin{macrocode}
6047 \providecommand*\float@ifstyle[1]{%
6048 \expandafter\ifx\csname fst@#1\endcsname\relax
6049 \expandafter\@secondoftwo
6050 \else
6051 \expandafter\@firstoftwo
6052 \fi}%
6053 % \end{macrocode}
6054 % \end{macro}
6055 %
6056 % \begin{macro}{\float@getstyle}
6057 % \changes{v3.1}{2007/06/10}{This macro added}
6058 % |\float@getstyle|\marg{cmd}\marg{type}\par
6059 % Determining the float style is not so easy because the only hint
6060 % provided by the \package{float} package is the macro
6061 % |\fst@|\meta{float type} which points to the macro which represents the
6062 % float style. So for example after
6063 % \begin{quote}
6064 % |\floatstyle{ruled}|\\
6065 % |\newfloat{Program}{tbp}{lop}|
6066 % \end{quote}
6067 % |\fst@Program| will be defined as
6068 % \begin{quote}
6069 % |\def\fst@Program{\fs@ruled}|\quad.
6070 % \end{quote}\par
6071 % So here is what we do: We make the first level expansion of
6072 % |\fst@|\meta{float type} a string so we can gobble the first four tokens
6073 % (= |\fs@|), so only the the name of the float style is left.\par
6074 % \emph{TODO:} We need to convert the catcodes here.
6075 % \begin{macrocode}
6076 \providecommand*\float@getstyle[2]{%
6077 \edef#1{%
6078 \noexpand\expandafter\noexpand\@gobblefour\noexpand\string
6079 \expandafter\expandafter\expandafter\noexpand
6080 \csname fst@#2\endcsname}%
6081 \edef#1{#1}%
6082 \caption@Debug{floatstyle{#2} = `#1'}}%
6083 % \end{macrocode}
6084 % \end{macro}
6085 %
6086 % \begin{macro}{\float@setstyle}
6087 % \changes{v3.1}{2007/06/10}{This macro added}
6088 % |\float@setstyle|\marg{type}\marg{style}\par
6089 % Sets or changes the float style associated with \meta{type}.
6090 % \begin{macrocode}
6091 \providecommand*\float@setstyle[2]{%
6092 \expandafter\edef\csname fst@#1\endcsname{%
6093 \expandafter\noexpand\csname fs@#2\endcsname}}%
6094 % \end{macrocode}
6095 % \end{macro}
6096 %
6097 % \begin{macro}{\float@dostyle}
6098 % \changes{v3.1}{2007/07/23}{This macro added}
6099 % |\float@dostyle|\marg{type}
6100 % \begin{macrocode}
6101 \providecommand*\float@dostyle[1]{%
6102 \@nameuse{fst@#1}\@float@setevery{#1}}%
6103 % \end{macrocode}
6104 % \end{macro}
6105 %
6106 % \begin{macro}{\float@ifcaption}
6107 % \changes{v3.1}{2007/06/23}{This macro added}
6108 % |\float@ifcaption|\marg{type}\marg{if-clause}\marg{else-clause}\par
6109 % Here we determine if the user has used |\newfloat| resp.~|\restylefloat|,
6110 % or |\restylefloat*|.
6111 % This is quite easy: If |\@float@c@|\meta{captype} is the same as
6112 % |\float@caption|, the user has used |\newfloat| or |\restylefloat|,
6113 % otherwise we assume he has used |\restylefloat*|.
6114 % (This test will fail if some package re-defines |\float@caption|,
6115 % so we have to assume that there is no one.)
6116 % \begin{macrocode}
6117 \providecommand*\float@ifcaption[1]{%
6118 \expandafter\ifx\csname @float@c@#1\endcsname\float@caption
6119 \expandafter\@firstoftwo
6120 \else
6121 \expandafter\@secondoftwo
6122 \fi}%
6123 % \end{macrocode}
6124 % \end{macro}
6125 %
6126 % \begin{macrocode}
6127 }}{%
6128 \providecommand*\float@ifstyle[1]{\@secondoftwo}%
6129 \providecommand*\float@ifcaption[1]{\@secondoftwo}%
6130 % \clearcaptionsetup{boxed}% used by the floatrow package?
6131 }
6132 % \end{macrocode}
6133 %
6134 % The skip between `boxed' floats and their caption defaults to |2pt|.
6135 %
6136 % \begin{macrocode}
6137 \captionsetup[boxed]{skip=2pt} % do not issue a warning when not used
6138 % \end{macrocode}
6139 %
6140 % \changes{v3.0f}{2005/05/26}{\opt{strut=0} added to caption style \opt{ruled}}
6141 % \changes{v3.0f}{2005/05/27}{Option \opt{ruled} fixed}
6142 % To emulate the `ruled' definition of |\@fs@capt| we provide a caption style
6143 % `ruled' with appropriate options. But if the package option |ruled| was
6144 % specified, we setup some caption parameters to emulate the behavior
6145 % of \thispackage\ \version{1.x} option |ruled| instead, i.e.,
6146 % the current caption settings will be used, but without margin and without
6147 % `single-line-check'.
6148 % \begin{macrocode}
6149 \caption@ifbool{ruled}{%
6150 \captionsetup[ruled]{margin=0pt,minmargin=0,slc=0}%
6151 }{%
6152 \DeclareCaptionStyle{ruled}{labelfont=bf,labelsep=space,strut=0}%
6153 }
6154 \caption@undefbool{ruled}
6155 % \end{macrocode}
6156 %
6157 % \subsubsection{The floatflt package}
6158 % \changes{v3.1}{2007/06/10}{Support of the \package{floatflt} package added}
6159 %
6160 % \begin{macrocode}
6161 \caption@IfPackageLoaded{floatflt}[1996/02/27 v1.3]{%
6162 % \end{macrocode}
6163 %
6164 % \begin{macro}{\floatingfigure}
6165 % We patch |\floatingfigure| so |\caption@floatflt| will be used.
6166 % \begin{macrocode}
6167 \let\caption@ORI@floatingfigure\floatingfigure
6168 \def\floatingfigure{%
6169 \caption@floatflt{figure}%
6170 \caption@ORI@floatingfigure}%
6171 % \end{macrocode}
6172 % \end{macro}
6173 %
6174 % \begin{macro}{\floatingtable}
6175 % Same with |\floatingtable|\ldots
6176 % \begin{macrocode}
6177 \let\caption@ORI@floatingtable\floatingtable
6178 \def\floatingtable{%
6179 \caption@floatflt{table}%
6180 % \caption@setautoposition b%
6181 \caption@ORI@floatingtable}%
6182 % \end{macrocode}
6183 % \end{macro}
6184 %
6185 % \begin{macro}{\caption@floatflt}
6186 % \changes{v3.1c}{2007/10/06}{Bugfix: \cs{caption@clearmargin} added}
6187 % Here we do two things:
6188 % \begin{enumerate}
6189 % \item We use |\caption@setoptions{floating|\meta{type}|}| so
6190 % |\captionsetup[floating|\meta{type}|]{|\ldots|}| is supported.
6191 % \item |\linewidth| must be set correctly.
6192 % Usually this is done by |\@parboxrestore| inside |\@caption|,
6193 % but since we use |\@caption@boxrestore| we have to map this to
6194 % |\@parboxrestore| instead.
6195 % \end{enumerate}
6196 % \begin{macrocode}
6197 \newcommand*\caption@floatflt[1]{%
6198 \caption@settype{#1}%
6199 \caption@clearmargin
6200 \caption@setoptions{floating#1}%
6201 \let\caption@boxrestore\@parboxrestore}%
6202 % \end{macrocode}
6203 % \end{macro}
6204 %
6205 % \begin{macrocode}
6206 }{}
6207 % \end{macrocode}
6208 %
6209 % \iffalse
6210 % \subsubsection{The floatrow package}
6211 % \changes{v3.0f}{2005/06/01}{Support of the \package{floatrow} package added}
6212 %
6213 % \begin{macrocode}
6214 %\caption@IfPackageLoaded{floatrow}[2007/07/01 v0.1p]{%
6215 % \end{macrocode}
6216 %
6217 % The \package{floatrow} package is already adapted for usage with
6218 % \thispackage. So the main work has already been done by
6219 % Mrs.~Lapko, there is only one little thing we have to take care about:
6220 %
6221 % \begin{macro}{\caption@of}
6222 % Captions typeset with |\captionof| should have the correct layout,
6223 % therefore we have to `activate' this layout here with |\flrow@setlist|.
6224 % \begin{macrocode}
6225 % \renewcommand*\caption@of[2]{%
6226 % \flrow@setlist{{#2}}% TODO: always do this?
6227 % \caption@settype*{#2}#1}%
6228 % \end{macrocode}
6229 % \end{macro}
6230 %
6231 % \begin{macrocode}
6232 %}{}
6233 % \end{macrocode}
6234 % \fi
6235 %
6236 % \subsubsection{The fltpage package}
6237 % \changes{v3.1}{2007/07/22}{Support of the \package{fltpage} package added}
6238 %
6239 % \begin{macrocode}
6240 \caption@IfPackageLoaded{fltpage}[1998/10/29 v.0.3]{%
6241 \caption@setbool{needfreeze}{1}%
6242 % \end{macrocode}
6243 %
6244 % \begin{macro}{\FP@helpNote}
6245 % Original code:
6246 % \begin{verbatim}
6247 % \newcommand{\FP@helpNote}[2]{%
6248 % \typeout{FP#1 is inserted on page \pageref{#2}!}}%
6249 % \end{verbatim}%^^A
6250 % \begin{macrocode}
6251 \renewcommand\FP@helpNote[2]{%
6252 \begingroup % save \caption@thepage
6253 \caption@pageref{#2}%
6254 \typeout{FP#1 is inserted on page \caption@thepage!}%
6255 \endgroup}%
6256 % \end{macrocode}
6257 % \end{macro}
6258 %
6259 % \begin{macro}{\FP@floatBegin}
6260 % \changes{v3.1f}{2007/11/16}{Uses `space hack' instead of \cs{ignorespaces} now}
6261 % \changes{v3.1k}{2009/10/09}{Bugfix 09-09-11: Missing \cs{ignorespaces} added}
6262 % Original code:
6263 % \begin{verbatim}
6264 % \newcommand{\FP@floatBegin}[1]{%
6265 % \gdef\@captype{#1}%
6266 % \global\let\FP@savedCaptionCommand\caption%
6267 % \global\let\FP@savedLabelCommand\label%
6268 % \ifthenelse{\equal{\@captype}{figure}}
6269 % {\global\let\old@Fnum\fnum@figure}%
6270 % {\global\let\old@Fnum\fnum@table}%
6271 % \let\FP@LabelText\@empty%
6272 % \let\FP@CaptionText\@empty%
6273 % \let\FP@optionalCaptionText\@empty%
6274 % \renewcommand\label[1]{\gdef\FP@LabelText{##1}}%
6275 % \renewcommand\caption[2][]{%
6276 % \gdef\FP@optionalCaptionText{##1}\gdef\FP@CaptionText{##2}}%
6277 % \begin{lrbox}{\FP@floatCorpusBOX}%
6278 % }%
6279 % \end{verbatim}%^^A
6280 % \begin{macrocode}
6281 \renewcommand*\FP@floatBegin[1]{%
6282 \def\@captype{#1}%
6283 \let\FP@LabelText\@empty
6284 \begin{lrbox}{\FP@floatCorpusBOX}%
6285 \caption@ifFPrefcap
6286 {\caption@freeze\relax}%
6287 {\def\label##1{\@bsphack\gdef\FP@LabelText{##1}\@esphack}%
6288 \caption@freeze*}%
6289 \ignorespaces}%
6290 % \end{macrocode}
6291 % \end{macro}
6292 %
6293 % \begin{macro}{\FP@floatEnd}
6294 % \changes{v3.1g}{2008/01/30}{Some minor bugfixes}
6295 % Original code:
6296 % \begin{verbatim}
6297 % \newcommand{\FP@floatEnd}{%
6298 % \end{lrbox}%
6299 % \global\setbox\FP@floatCorpusBOX=\box\FP@floatCorpusBOX
6300 % \stepcounter{FP@\@captype C}%
6301 % \FP@savedLabelCommand{\FP@positionLabel}%
6302 % \FP@helpNote{\@captype}{\FP@positionLabel}%
6303 % \FP@float
6304 % {\FP@positionLabel}% location label test
6305 % {\begin{\@captype}[p!]
6306 % \usebox{\FP@floatCorpusBOX}%
6307 % \refstepcounter{\@captype}%
6308 % \ifthenelse{\equal{\FP@LabelText}{\@empty}}
6309 % {}{\FP@savedLabelCommand{\expandafter\protect\FP@LabelText}}%
6310 % \end{\@captype}}
6311 % {\addtocounter{\@captype}{-1}}
6312 % {\begin{\@captype}[b!]%
6313 % \ifthenelse{\equal{\FP@guide}{\@empty}}%
6314 % {}{\ifthenelse{\equal{\@captype}{figure}}%
6315 % {\renewcommand{\fnum@figure}{\old@Fnum\ {\FP@guide}}}%
6316 % {\renewcommand{\fnum@table}{\old@Fnum\ {\FP@guide}}}}%
6317 % \setlength{\abovecaptionskip}{2pt plus2pt minus 1pt} % length above caption
6318 % \setlength{\belowcaptionskip}{2pt plus2pt minus 1pt} % length above caption
6319 % \FP@separatorCaption%
6320 % \ifthenelse{\equal{\FP@optionalCaptionText}{\@empty}}%
6321 % {\FP@savedCaptionCommand{\expandafter\protect\FP@CaptionText}}%
6322 % {\FP@savedCaptionCommand[\expandafter\protect\FP@optionalCaptionText]%
6323 % {\expandafter\protect\FP@CaptionText}}%
6324 % \end{\@captype}}%
6325 % }%
6326 % \end{verbatim}%^^A
6327 % \begin{macrocode}
6328 \renewcommand*\FP@floatEnd{%
6329 \end{lrbox}%
6330 % \end{macrocode}
6331 % \begin{macrocode}
6332 \stepcounter{FP@\@captype C}%
6333 \caption@label\FP@positionLabel
6334 \FP@helpNote\@captype\FP@positionLabel
6335 % \end{macrocode}
6336 % \begin{macrocode}
6337 \edef\FP@RestoreCounter{%
6338 \noexpand\setcounter{\@captype}{\the\value\@captype}%
6339 \noexpand\setcounter{ContinuedFloat}{\the\value{ContinuedFloat}}}%
6340 % \end{macrocode}
6341 % \begin{macrocode}
6342 \FP@float
6343 {\FP@positionLabel}% location label test
6344 {\begin\@captype[p!]%
6345 \usebox\FP@floatCorpusBOX
6346 \caption@defrost@setup
6347 \caption@ifFPlistcap
6348 {\caption@refstepcounter\@captype
6349 \expandafter\caption@makecurrent\expandafter\@captype
6350 \expandafter{\caption@SClentry}}%
6351 {\expandafter\captionlistentry\expandafter{\caption@SClentry}}%
6352 \caption@makeanchor\relax
6353 \ifx\FP@LabelText\@empty \else
6354 \expandafter\label\expandafter{\FP@LabelText}%
6355 \fi
6356 \end\@captype}%
6357 {\FP@RestoreCounter
6358 \@ifundefined{theH\@captype}{}{%
6359 \expandafter\l@addto@macro\csname theH\@captype\endcsname{.FP}}}%
6360 {\begin\@captype[b!]%
6361 \let\FP@savedSetfnumCommand\caption@setfnum
6362 \def\caption@setfnum##1{%
6363 \FP@savedSetfnumCommand{##1}%
6364 \ifx\FP@guide\@empty \else
6365 \expandafter\l@addto@macro\csname fnum@##1\endcsname{\ {\FP@guide}}%
6366 \fi}%
6367 \setlength\abovecaptionskip{2pt plus 2pt minus 1pt}% length above caption
6368 \setlength\belowcaptionskip{2pt plus 2pt minus 1pt}% length below caption
6369 \caption@setoptions{FP\@captype}%
6370 \FP@separatorCaption
6371 \caption@ifFPlistcap{}{\let\caption@addcontentsline\@gobbletwo}%
6372 \caption@defrost
6373 \end\@captype}%
6374 }%
6375 % \end{macrocode}
6376 % \end{macro}
6377 %
6378 % \changes{v3.1a}{2007/09/07}{\cs{DeclareFloatingEnvironment} defines FP-variant, too}
6379 % \changes{v3.1k}{2009/09/28}{Bugfix regarding newly defined \package{fltpage} environments}
6380 % \begin{macrocode}
6381 \caption@For{typelist}{%
6382 \newcounter{FP@#1C}%
6383 \newenvironment{FP#1}{\FP@floatBegin{#1}}{\FP@floatEnd}}%
6384 % \end{macrocode}
6385 %
6386 % \begin{macrocode}
6387 }{%
6388 \let\caption@ifFPlistcap\@undefined
6389 \let\caption@ifFPrefcap\@undefined
6390 }
6391 % \end{macrocode}
6392 %
6393 % \subsubsection{The hyperref package}
6394 % \changes{v3.0f}{2005/06/11}{Support of the \package{hyperref} package added}
6395 % \changes{v3.1}{2007/03/09}{Usage of \cs{hyper@makecurrent} instead of
6396 % \cs{theHfigure} as indicator for \package{hyperref} package}
6397 %
6398 % \begin{macrocode}
6399 \caption@IfPackageLoaded{hyperref}[2003/11/30 v6.74m]{%
6400 \@ifundefined{hyper@makecurrent}{% hyperref has stopped early
6401 \caption@WarningNoLine{%
6402 Hyperref support is turned off\MessageBreak
6403 because hyperref has stopped early}%
6404 }{%
6405 \g@addto@macro\caption@prepareslc{\measuring@true}%
6406 % \end{macrocode}
6407 %
6408 % \begin{macro}{\caption@@refstepcounter}
6409 % We redefine |\caption@@refstepcounter| so |\H@refstepcounter| will be used
6410 % instead of |\refstepcounter| inside |\caption| \& |\captionlistentry|.
6411 % \begin{macrocode}
6412 \renewcommand*\caption@@refstepcounter{\H@refstepcounter}%
6413 % \end{macrocode}
6414 % \end{macro}
6415 %
6416 % \begin{macro}{\caption@makecurrent}
6417 % \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
6418 % We redefine |\caption@makecurrent| so a \package{hyperref} label
6419 % will be defined inside |\@caption|.
6420 % \Note{Will be redefined by \cs{caption@start}.}
6421 % \begin{macrocode}
6422 \renewcommand*\caption@makecurrent[2]{%
6423 \caption@makecurrentHref{#1}%
6424 \caption@Debug{hyperref current=\@currentHref}%
6425 \caption@gettitle{#2}}%
6426 % \end{macrocode}
6427 % \begin{macrocode}
6428 \newcommand*\caption@makecurrentHref{\hyper@makecurrent}%
6429 % \end{macrocode}
6430 % \end{macro}
6431 %
6432 % \begin{macro}{\caption@makeanchor}
6433 % \changes{v3.1l}{2010/01/09}{Adapted to the current hyperref package}
6434 % We redefine |\caption@makeanchor| so a \package{hyperref} anchor
6435 % will be set inside |\@caption|.
6436 % \Note{Will be redefined by \cs{caption@start}.}
6437 % \begin{macrocode}
6438 \renewcommand\caption@makeanchor[1]{%
6439 \caption@Debug{hyperref anchor: \@currentHref}%
6440 % If we cannot have nesting, the anchor is empty.
6441 \ifHy@nesting
6442 \expandafter\hyper@@anchor\expandafter{\@currentHref}{#1}%
6443 \else
6444 \Hy@raisedlink{%
6445 \expandafter\hyper@@anchor\expandafter{\@currentHref}{\relax}%
6446 }#1%
6447 \fi}%
6448 % \end{macrocode}
6449 % \begin{macrocode}
6450 \g@addto@macro\caption@prepareslc{\let\caption@makeanchor\@firstofone}%
6451 % \end{macrocode}
6452 % \end{macro}
6453 %
6454 % \paragraph{The hypcap option}
6455 %
6456 % \begin{macro}{\if@capstart}
6457 % Like the \package{hypcap} package we define the switch |\if@capstart|, too.
6458 % \begin{macrocode}
6459 \newif\if@capstart
6460 % \end{macrocode}
6461 % \end{macro}
6462 %
6463 % \begin{macro}{\caption@start}
6464 % \changes{v3.0l}{2007/02/20}{%
6465 % \cs{caption@currentHref} renamed to \cs{hc@currentHref}}
6466 % \changes{v3.1}{2007/06/21}{%
6467 % This macro renamed from \cs{capstart} to \cs{caption@start} and revised}
6468 % While the \package{hypcap} package defines a macro called |\capstart|
6469 % our variant is called |\caption@start| and is controlled by the option
6470 % |hypcap=||false|/|true|.
6471 % \begin{macrocode}
6472 \def\caption@start{\caption@ifhypcap\caption@start@\relax}%
6473 \def\caption@start@{%
6474 % \end{macrocode}
6475 % Generate the \package{hyperref} label and set the \package{hyperref} anchor,
6476 % usually (if |hypcap=false|) both is done inside |\@caption|.
6477 % \begin{macrocode}
6478 \caption@makestart\@captype
6479 \caption@startanchor\@currentHref
6480 % \end{macrocode}
6481 % Prevent |\@caption| from generating a new \package{hyperref} label,
6482 % use the label we save in |\hc@currentHref| instead.
6483 % (We also support the |@capstart| flag from the \package{hypcap} package.)
6484 % \begin{macrocode}
6485 \global\@capstarttrue
6486 \let\hc@currentHref\@currentHref
6487 \def\caption@makecurrentHref##1{%
6488 \global\@capstartfalse
6489 \global\let\@currentHref\hc@currentHref}%
6490 % \end{macrocode}
6491 % Prevent |\@caption| from generating a \package{hyperref} anchor since this
6492 % has already been done.
6493 % \begin{macrocode}
6494 \let\caption@makeanchor\@firstofone
6495 % \end{macrocode}
6496 % \begin{macrocode}
6497 }%
6498 % \end{macrocode}
6499 % \end{macro}
6500 %
6501 % \begin{macro}{\caption@makestart}
6502 % \changes{v3.1c}{2007/09/30}{\cs{@currentHref} will be extended by \texttt{caption}
6503 % instead of \texttt{xxx} now}
6504 % |\caption@makestart|\marg{type}
6505 % defines a \package{hyperref} anchor inside |\caption@start|.\par
6506 % Since we offer |\ContinuedFloat| the float counter can change between
6507 % `now' and |\caption|, i.e., we simply don't know the figure or table counter
6508 % yet and therefore we are not able to generate the `right' \package{hyperref}
6509 % label.
6510 % Two different solutions of this problem came into my mind:
6511 % \begin{enumerate}
6512 % \item I could use the aux file for this purpose.\par
6513 % -or-
6514 % \item I set |hypertexnames=false| locally.
6515 % Furthermore I use |#1.caption.|\meta{counter} (instead of |#1.|\meta{counter})
6516 % as naming scheme for |\@currentHref| to avoid conflicts with other hyper
6517 % links which are generated with |hypertexnames=true|.
6518 % \end{enumerate}
6519 % The first idea has the advantage that the `right' anchor name will be
6520 % generated, but one needs an additional \LaTeX\ run if figures or tables
6521 % will be inserted or removed.\par
6522 % The second idea has the advantage that it's very easy to implement, but
6523 % has some side-effects, e.g. the anchor names don't follow the figure or
6524 % table label names anymore.\par
6525 % Since I'm lazy I implemented the second idea, maybe I will revise this
6526 % later on.
6527 % \begin{macrocode}
6528 \newcommand*\caption@makestart[1]{%
6529 \begingroup
6530 \Hy@hypertexnamesfalse
6531 % \gdef\@currentHlabel{}%
6532 \hyper@makecurrent{#1.caption}%
6533 \endgroup
6534 \caption@Debug{hypcap start=\@currentHref}}%
6535 % \end{macrocode}
6536 % \end{macro}
6537 %
6538 % \begin{macro}{\caption@startanchor}
6539 % \changes{v3.1b}{2007/09/17}{Bugfix 06-09-17: We use \cs{caption@anchor} instead of \cs{hyper@@anchor}}
6540 % \changes{v3.1g}{2008/03/16}{Warning about TeX mode replaced with debug info}
6541 % |\caption@startanchor|\marg{Href}
6542 % sets a \package{hyperref} anchor inside |\caption@start|.\par
6543 % This code was taken from the \package{hypcap} package\cite{hypcap} and adapted.
6544 % \Note{Since \cs{hyper@@anchor}\marg{Href}\csmarg{\string\relax} can cause
6545 % a change from vertical mode to horizontal mode (design flaw in
6546 % \package{hyperref} package!?), and since the workaround
6547 % \cs{let}\cs{leavevmode}\cs{relax} which can be found in the
6548 % \package{hypcap} package is not always sufficient
6549 % (for example with ``Direct pdfmark support'' and \texttt{breaklinks=true}),
6550 % we use \cs{caption@anchor} instead of \cs{hyper@@anchor} here.}
6551 % \begin{macrocode}
6552 \newcommand*\caption@startanchor[1]{%
6553 \ifvmode\begingroup
6554 \caption@Debug{hypcap anchor: #1 (vertical mode)}%
6555 \@tempdima\prevdepth
6556 \nointerlineskip
6557 \vspace*{-\caption@hypcapspace}%
6558 \caption@anchor{#1}%
6559 \vspace*{\caption@hypcapspace}%
6560 \prevdepth\@tempdima
6561 \endgroup\else
6562 \caption@Debug{hypcap anchor: #1 (horizontal mode)}%
6563 \caption@anchor{#1}%
6564 \fi}%
6565 % \end{macrocode}
6566 % \end{macro}
6567 %
6568 % \begin{macro}{\caption@anchor}
6569 % \changes{v3.1c}{2007/10/17}{Workaround 07-10-17: We use \cs{caption@raisedlink} instead of \cs{Hy@raisedlink} now}
6570 % |\caption@anchor|\marg{Href} sets a \package{hyperref} anchor.
6571 % \begin{macrocode}
6572 \newcommand*\caption@anchor[1]{%
6573 \ifmeasuring@ \else
6574 \caption@raisedlink{\hyper@anchorstart{#1}\hyper@anchorend}%
6575 \fi}%
6576 % \end{macrocode}
6577 % \Note{Since \cs{Hy@raisedlink} change \cs{@tempdima} we surrounded it by \cs{ifvmode},
6578 % suppressing ``\texttt{LaTeX Warning: Float too large for page by 1.0pt}'' in \texttt{sideways} floats.
6579 % (This is not necessary since \package{hyperref} \version{6.77}.)}
6580 % \begin{macrocode}
6581 \ifx\HyperRaiseLinkLength\@tempdima
6582 \def\caption@raisedlink#1{\ifvmode#1\else\Hy@raisedlink{#1}\fi}%
6583 \else
6584 \let\caption@raisedlink\Hy@raisedlink
6585 \fi
6586 % \end{macrocode}
6587 % \end{macro}
6588 %
6589 % \begin{macro}{\caption@@start}
6590 % Will be used by |\caption@freezeHref|. Apart from that we issue a warning
6591 % if we expect a saved \package{hyperref} label coming from |\caption@start|,
6592 % but there isn't any.
6593 % \begin{macrocode}
6594 \def\caption@@start{%
6595 \@ifundefined{hc@currentHref}{%
6596 \caption@Warning{%
6597 The option `hypcap=true' will be ignored for this\MessageBreak
6598 particular \string\caption}}{}}%
6599 % \end{macrocode}
6600 % \end{macro}
6601 %
6602 % \begin{macro}{\caption@freezeHref}
6603 % Suppress |\caption@start| from generating a \package{hyperref} label and
6604 % setting a \package{hyperref} anchor. Instead if |\@caption| generates a
6605 % \package{hyperref} label, it will be stored in |\caption@currentHref|.
6606 % Furthermore we need to redefine |\caption@setfloatcapt| so no
6607 % \package{hyperref} anchor will be placed in |\@caption|.
6608 % \iffalse
6609 % (Since |\caption@setfloatcapt| will be set to |\@firstofone| inside
6610 % |\subcaption| there is no need to add its restauration to
6611 % |\caption@subtypehook|.)
6612 % \fi
6613 % \begin{macrocode}
6614 \def\caption@freezeHref{%
6615 \let\caption@ORI@start\caption@start
6616 \def\caption@start{\let\caption@start\caption@ORI@start}%
6617 % \end{macrocode}
6618 % \begin{macrocode}
6619 % \let\caption@ORI@@start\caption@@start
6620 % \l@addto@macro\caption@subtypehook{%
6621 % \let\caption@@start\caption@ORI@@start}%
6622 % \end{macrocode}
6623 % \begin{macrocode}
6624 \global\let\caption@currentHref\@undefined
6625 \def\caption@@start{\global\let\caption@currentHref\@currentHref}%
6626 % \end{macrocode}
6627 % \begin{macrocode}
6628 \let\caption@ORI@setfloatcapt\caption@setfloatcapt
6629 \renewcommand*\caption@setfloatcapt{%
6630 \ifx\caption@currentHref\@undefined \else
6631 \let\caption@makeanchor\@firstofone
6632 \fi
6633 \caption@ORI@setfloatcapt}}%
6634 % \end{macrocode}
6635 % \end{macro}
6636 %
6637 % \begin{macro}{\caption@defrostHref}
6638 % If there is a freezed |\@currentHref|, we set the \package{hyperref}
6639 % anchor here.
6640 % \begin{macrocode}
6641 \def\caption@defrostHref{%
6642 \ifx\caption@currentHref\@undefined \else
6643 \caption@startanchor\caption@currentHref
6644 \global\let\caption@currentHref\@undefined
6645 \fi}%
6646 % \end{macrocode}
6647 % \end{macro}
6648 %
6649 % \begin{macro}{\float@makebox}
6650 % Do our own redefinition of |\float@makebox|, if it was redefined by
6651 % the \package{hyperref} package.
6652 % \begin{macrocode}
6653 \@ifundefined{HyOrg@float@makebox}{}{%
6654 \caption@Debug{%
6655 Redefining \noexpand\float@makebox (again)\@gobble}%
6656 \let\caption@ORI@float@makebox\float@makebox % save for compatibility mode
6657 \renewcommand\float@makebox[1]{%
6658 \HyOrg@float@makebox{#1\relax \caption@defrostHref}}%
6659 }%
6660 % \end{macrocode}
6661 % \end{macro}
6662 %
6663 % \begin{macrocode}
6664 }}{}
6665 % \end{macrocode}
6666 %
6667 % \subsubsection{The hypcap package}
6668 % \changes{v3.0f}{2005/06/22}{Support of the \package{hypcap} package added}
6669 % \changes{v3.0l}{2007/02/20}{Adapted to \package{hypcap} \version{1.6}}
6670 % \changes{v3.1e}{2007/11/04}{\package{hypcap} support adapted to \package{hyperref} \version{6.77}}
6671 %
6672 % \begin{macrocode}
6673 \caption@IfPackageLoaded{hypcap}{% v1.0
6674 \ifx\caption@start\relax \else % hyperref hasn't stopped early
6675 % \end{macrocode}
6676 %
6677 % If the \package{hypcap} package was loaded, we give up our own
6678 % hyperlink placement algorithm and give the control over the placement
6679 % to the \package{hypcap} package instead.
6680 %
6681 % \begin{macro}{\capstart}
6682 % \changes{v3.1k}{2009/10/09}{Support of \cs{ifcapstart} (\package{hypcap} package \version{1.10}) added}
6683 % We do this simply by mapping |\capstart| to |\caption@start@|,
6684 % although our code does not behave exactly like the original one:
6685 % The original |\capstart| has an effect on the next |\caption|
6686 % only but our version affects \emph{all} |\caption|s in the same
6687 % environment, at least unless a new |\capstart| will be placed.
6688 % \begin{macrocode}
6689 \let\caption@ORI@capstart\capstart % save for compatibility mode
6690 \@ifundefined{capstarttrue}% check for v1.10 of hypcap package
6691 {\def\capstart{\caption@start@}}%
6692 {\def\capstart{\ifcapstart\caption@start@\fi}}%
6693 \let\caption@start\relax
6694 \let\caption@@start\relax
6695 % \end{macrocode}
6696 % \end{macro}
6697 %
6698 % \begin{macro}{\caption@hypcapspace}
6699 % Furthermore we map our |\caption@hypcapspace| to |\hypcapspace|
6700 % offered by the \package{hypcap} package.
6701 % \begin{macrocode}
6702 \caption@set@bool\caption@ifhypcap 1%
6703 \renewcommand*\caption@hypcapspace{\hypcapspace}%
6704 % \end{macrocode}
6705 % \end{macro}
6706 %
6707 % \begin{macrocode}
6708 \fi}{}
6709 % \end{macrocode}
6710 %
6711 % \subsubsection{The listings package}
6712 % \changes{v3.0b}{2004/05/16}{Support of the \package{listings} package added}
6713 %
6714 % \begin{macrocode}
6715 \caption@IfPackageLoaded{listings}[2004/02/13 v1.2]{%
6716 % \end{macrocode}
6717 %
6718 % \begin{macro}{\lst@MakeCaption}
6719 % \changes{v3.1g}{2008/01/20}{Bugfix: Skips are handled correctly now}
6720 % \changes{v3.1k}{2008/03/29}{Bugfix 08-10-16-dctt: \texttt{rule=0} added}
6721 % To support the \package{listings} package we need to redefine
6722 % |\lst@MakeCaption| so the original stuff is nested with
6723 % |\caption@begin| and |\caption@end| etc.
6724 % \Note{This macro is always called twice (with `t' resp. `b' as
6725 % parameter), therefore we need an extra group here.}
6726 % \begin{macrocode}
6727 \let\caption@ORI@lst@MakeCaption\lst@MakeCaption
6728 \def\lst@MakeCaption#1{% #1 is `t' or `b'
6729 \begingroup
6730 % \end{macrocode}
6731 % First of all, we set |position=#1| and if it was set to `top',
6732 % we swap the skips so the default behavior of the \package{listings} package
6733 % will not be changed. (Note that the \package{listings} package has set its
6734 % own |\abovecaptionskip| \& |\belowcaptionskip| values prior to calling
6735 % \cs{lst@MakeCaption}.)
6736 % \begin{macrocode}
6737 \caption@setposition{#1}%
6738 \caption@iftop{%
6739 \@tempdima\belowcaptionskip
6740 \belowcaptionskip\abovecaptionskip
6741 \abovecaptionskip\@tempdima}{}%
6742 % \end{macrocode}
6743 % Workaround for issue with wrong skips (should be examined further)
6744 % \begin{macrocode}
6745 \caption@setup{rule=0}%
6746 % \end{macrocode}
6747 % Afterwards we set the local `lstlisting' options.
6748 % \begin{macrocode}
6749 \caption@setoptions{lstlisting}%
6750 % \end{macrocode}
6751 % If the |position=| is now set to |auto|, we take over the |captionpos=|
6752 % setting from the \package{listings} package.
6753 % \begin{macrocode}
6754 \caption@setautoposition{#1}%
6755 % \end{macrocode}
6756 % At the end we do similar stuff as in our \cs{@caption} code.
6757 % \begin{macrocode}
6758 \caption@begin{lstlisting}%
6759 \caption@ORI@lst@MakeCaption{#1}%
6760 \caption@end
6761 % \end{macrocode}
6762 % \begin{macrocode}
6763 \endgroup}%
6764 % \end{macrocode}
6765 % \end{macro}
6766 %
6767 % \begin{macro}{\lst@makecaption}
6768 % \begin{macro}{\lst@maketitle}
6769 % Wrapper macros for typesetting the |caption=| resp. |title=| value.
6770 % \begin{macrocode}
6771 \def\lst@makecaption{\caption@starfalse\@makecaption}%
6772 \def\lst@maketitle{\caption@startrue\@makecaption\@empty}%
6773 % \end{macrocode}
6774 % \end{macro}
6775 % \end{macro}
6776 %
6777 % \begin{macro}{\ext@lstlisting}
6778 % \changes{v3.1}{2007/03/03}{This macro added}
6779 % Since the \package{listings} package do not define |\ext@lstlisting|,
6780 % but we needed it when |\captionof{lstlisting}| will be done by the end user,
6781 % we define it here.
6782 % \begin{macrocode}
6783 \providecommand*\ext@lstlisting{lol}%
6784 % \end{macrocode}
6785 % \end{macro}
6786 %
6787 % \changes{v3.1a}{2007/07/13}{Bugfix 07-09-13: \cs{lst@@caption} will not be re-defined anymore}
6788 %
6789 % \begin{macrocode}
6790 }{}
6791 % \end{macrocode}
6792 %
6793 % \subsubsection{The longtable package}
6794 %
6795 % \begin{macro}{\LTcaptype}
6796 % \changes{v3.1}{2007/07/06}{This macro and its support added}
6797 % |\LTcaptype| is preset to |table|.
6798 % \begin{macrocode}
6799 \providecommand*\LTcaptype{table}
6800 % \end{macrocode}
6801 % \end{macro}
6802 %
6803 % \begin{macrocode}
6804 \caption@IfPackageLoaded{longtable}[1995/05/24 v3.14]{%
6805 % \end{macrocode}
6806 % \begin{macrocode}
6807 \RequirePackage{ltcaption}[=2007/09/01]%
6808 \let\LT@@makecaption\@undefined
6809 % \end{macrocode}
6810 %
6811 % \begin{macro}{\LT@array}
6812 % \changes{v3.1}{2007/07/22}{This redefinition added}
6813 % \changes{v3.1a}{2007/09/14}{Bugfix 07-09-14: Redefinition of \cs{@captionabovetrue} \& \cs{@captionabovefalse} added}
6814 % \changes{v3.1a}{2007/09/16}{Bugfix: This redefinition will always be done \cs{AtBeginDocument}}
6815 % \changes{v3.1g}{2008/01/20}{Bugfix in \cs{captionlistentry}: Table counter will not be incremented anymore, \cs{nameref} works}
6816 % We redefine |\LT@array| here to get |\captionsetup|\marg{options}
6817 % working inside |longtable|s.
6818 % \Note{Since the \package{hyperref} package patches \cs{LT@array} as well
6819 % and since this only works with the original definition of \cs{LT@array},
6820 % we have to do this after the \package{hyperref} package,
6821 % i.e.~\cs{AtBeginDocument}.}
6822 % \begin{macrocode}
6823 \caption@AtBeginDocument{%
6824 \let\caption@ORI@LT@array\LT@array
6825 \renewcommand*\LT@array{%
6826 % \end{macrocode}
6827 % |\captionsetup| for longtable:
6828 % \begin{macrocode}
6829 \global\let\caption@opt@@longtable\@undefined
6830 \def\captionsetup{%
6831 \noalign\bgroup
6832 \@ifstar\@captionsetup\@captionsetup}% gobble *
6833 \def\@captionsetup##1{\LT@captionsetup{##1}\egroup}%
6834 \def\LT@captionsetup##1{%
6835 \captionsetup@startrue\caption@setup@options[@longtable]{##1}%
6836 \global\let\caption@opt@@longtable\caption@opt@@longtable}%
6837 % \end{macrocode}
6838 % |\captionabove| \& |\captionbelow| for longtable: (\KOMAScript\ document class)
6839 % \begin{macrocode}
6840 \def\@captionabovetrue{\LT@captionsetup{position=t}}%
6841 \def\@captionabovefalse{\LT@captionsetup{position=b}}%
6842 % \end{macrocode}
6843 % |\captionlistentry| for longtable:
6844 % \begin{macrocode}
6845 \def\captionlistentry{%
6846 \noalign\bgroup
6847 \@ifstar{\egroup\LT@captionlistentry}% gobble *
6848 {\egroup\LT@captionlistentry}}%
6849 \def\LT@captionlistentry##1{%
6850 \caption@listentry\@firstoftwo[\LTcaptype]{##1}}%
6851 % \end{macrocode}
6852 % |\ContinuedFloat| for longtable:\\
6853 % {\small(Commented out, since it's not deeply tested and quite useless anyway)}
6854 % \Note{\package{hyperref} versions $<$ v6.76j uses $2\times$ \cs{hyper@makecurrent}}
6855 % \begin{macrocode}
6856 % \caption@ifhypcap{%
6857 % \let\caption@ORI@hyper@makecurrent\hyper@makecurrent
6858 % \def\hyper@makecurrent##1{%
6859 % \let\hyper@makecurrent\caption@ORI@hyper@makecurrent
6860 % \caption@makestart{##1}%
6861 %% \let\Hy@LT@currentHlabel\@currentHlabel
6862 % \let\Hy@LT@currentHref\@currentHref
6863 % \def\hyper@makecurrent####1{%
6864 %% \let\@currentHlabel\Hy@LT@currentHlabel
6865 % \let\@currentHref\Hy@LT@currentHref}}%
6866 % \let\caption@ORI@ContinuedFloat\ContinuedFloat
6867 % \def\ContinuedFloat{\noalign{%
6868 % \gdef\caption@setContinuedFloat{%
6869 % \let\caption@resetContinuedFloat\@gobble}%
6870 % \def\caption@setoptions####1{%
6871 % \g@addto@macro\caption@setContinuedFloat{%
6872 % \caption@setoptions{####1}}}%
6873 % \let\@captype\LTcaptype
6874 % \caption@ORI@ContinuedFloat}}%
6875 % }{%
6876 % \def\ContinuedFloat{\noalign{%
6877 % \caption@Error{%
6878 % \noexpand\ContinuedFloat inside longtables\MessageBreak
6879 % is only available with `hypcap=true'}}}%
6880 % }%
6881 % \global\let\caption@setContinuedFloat\@empty
6882 \def\ContinuedFloat{\noalign{%
6883 \caption@Error{\noexpand\ContinuedFloat outside float}}}%
6884 % \end{macrocode}
6885 % \begin{macrocode}
6886 \caption@ORI@LT@array}}%
6887 % \end{macrocode}
6888 % \end{macro}
6889 %
6890 % \begin{macro}{\LT@c@ption}
6891 % \changes{v3.1g}{2008/01/22}{Made it \cs{long}}
6892 % The original implementation:
6893 % \begin{verbatim}
6894 % \def\LT@c@ption#1[#2]#3{%
6895 % \LT@makecaption#1\fnum@table{#3}%
6896 % \def\@tempa{#2}%
6897 % \ifx\@tempa\@empty\else
6898 % {\let\\\space
6899 % \addcontentsline{lot}{table}{\protect\numberline{\thetable}{#2}}}%
6900 % \fi}
6901 % \end{verbatim}%^^A
6902 % Our implementation uses |\LTcaptype| instead of |{table}|:
6903 % \begin{macrocode}
6904 \long\def\LT@c@ption#1[#2]#3{%
6905 \LT@makecaption#1{\csname fnum@\LTcaptype\endcsname}{#3}%
6906 \LT@captionlistentry{#2}}%
6907 % \end{macrocode}
6908 % \end{macro}
6909 %
6910 % \begin{macro}{\LT@makecaption}
6911 % \changes{v3.0d}{2004/08/10}{%
6912 % Bugfix 04-08-04: \cs{abovecaptionskip} \& \cs{belowcaptionskip} will be used now}
6913 % \changes{v3.0e}{2005/05/05}{%
6914 % Bugfix: \cs{captionsetup[longtable]} overrides \cs{LTcapwidth} now}
6915 % \changes{v3.0h}{2005/10/07}{\cs{caption@LT@make} introduced}
6916 % |\LT@makecaption|\marg{cmd}\marg{label}\marg{text}\par
6917 % \smallskip
6918 % The original definition:
6919 % \begin{verbatim}
6920 % \def\LT@makecaption#1#2#3{%
6921 % \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{%
6922 % % Based on article class "\@makecaption", "#1" is "\@gobble" in star
6923 % % form, and "\@firstofone" otherwise.
6924 % \sbox\@tempboxa{#1{#2: }#3}%
6925 % \ifdim\wd\@tempboxa>\hsize
6926 % #1{#2: }#3%
6927 % \else
6928 % \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
6929 % \fi
6930 % \endgraf\vskip\baselineskip}%
6931 % \hss}}}
6932 % \end{verbatim}%^^A
6933 % Our definition:
6934 % \begin{macrocode}
6935 \renewcommand\LT@makecaption[3]{%
6936 \caption@LT@make{%
6937 % \end{macrocode}
6938 %
6939 % If |\LTcapwidth| is not set to its default value |4in| we assume
6940 % that it shall overwrite our own setting.
6941 % (But |\captionsetup[longtable]{width=|\ldots|}| will overwrite |\LTcapwidth|.)
6942 % \begin{macrocode}
6943 \caption@settype*\LTcaptype
6944 \ifdim\LTcapwidth=4in \else
6945 \setcaptionwidth\LTcapwidth
6946 \fi
6947 \caption@setoptions{longtable}%
6948 % \caption@setContinuedFloat
6949 \caption@setoptions{@longtable}%
6950 % \end{macrocode}
6951 %
6952 % \iffalse
6953 % The default |position=| setting for longtables is |top|.
6954 % (This emulates the standard behavior of the \package{longtable} package
6955 % which has no skip above the caption but a skip below it.)
6956 % \fi
6957 %
6958 % |position=auto| is a bad idea for longtables, but we do our very best.
6959 % This works quite well for captions inside the longtable contents, but
6960 % not for captions inside the longtable (end)foot.
6961 % \Note{This should be `top' if unclear!}
6962 % \begin{macrocode}
6963 \caption@setautoposition{\ifcase\LT@rows t\else b\fi}%
6964 % \end{macrocode}
6965 %
6966 % We set |\ifcaption@star| according the 1st argument.
6967 % \begin{macrocode}
6968 \caption@startrue#1\caption@starfalse
6969 % \end{macrocode}
6970 %
6971 % \changes{v3.1}{2007/05/05}{\cs{caption@normalsize} added}
6972 % \begin{macrocode}
6973 \caption@resetContinuedFloat\LTcaptype
6974 \caption@begin\LTcaptype
6975 \caption@normalsize
6976 % \end{macrocode}
6977 %
6978 % The following skip has the purpose to correct the height of the
6979 % |\parbox[t]|. Usually it's the height of the very first line, but
6980 % because of our extra skips (|\abovecaptionskip| and |\belowcaptionskip|)
6981 % it's always |0pt|.\par
6982 % (A different idea would be typesetting the first skip outside the longtable
6983 % column with |\noalign{\vskip|\ldots|}|, but this means we have to move
6984 % |\caption@begin| to some other place because it does not work in tabular
6985 % mode. And at the moment I have no idea on how to do this in an elegant
6986 % way\ldots)
6987 % \begin{macrocode}
6988 \vskip-\ht\strutbox
6989 % \end{macrocode}
6990 %
6991 % The following code should look familiar. We do our skips and use
6992 % |\caption@@make| to typeset the caption itself.
6993 % \begin{macrocode}
6994 \caption@iftop{\vskip\belowcaptionskip}{\vskip\abovecaptionskip}%
6995 \caption@@make{#2}{#3}\endgraf
6996 \caption@iftop{\vskip\abovecaptionskip}{\vskip\belowcaptionskip}%
6997 \caption@end}}%
6998 % \end{macrocode}
6999 % \end{macro}
7000 %
7001 % \begin{macrocode}
7002 }{}
7003 % \end{macrocode}
7004 %
7005 % \subsubsection{The picinpar package}
7006 % \changes{v3.1}{2007/06/13}{Support of the \package{picinpar} package added}
7007 %
7008 % \begin{macrocode}
7009 \caption@IfPackageLoaded{picinpar}{%
7010 % \end{macrocode}
7011 %
7012 % \begin{macro}{\figwindow}
7013 % \begin{macro}{\tabwindow}
7014 % The \package{picinpar} package comes with its own caption code
7015 % (|\wincaption|, |\@wincaption|, |\@makewincaption|, \ldots)
7016 % so we redefine |\figwindow| \& |\tabwindow| to use |\caption| instead.
7017 % \begin{macrocode}
7018 \long\def\figwindow[#1,#2,#3,#4] {%
7019 \caption@window{figure}%
7020 \caption@setoptions{figwindow}%
7021 \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }%
7022 % \end{macrocode}
7023 % \begin{macrocode}
7024 \long\def\tabwindow[#1,#2,#3,#4] {%
7025 \caption@window{table}%
7026 \caption@setoptions{tabwindow}%
7027 \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }%
7028 % \end{macrocode}
7029 % \end{macro}
7030 % \end{macro}
7031 %
7032 % \begin{macro}{\caption@window}
7033 % \changes{v3.1c}{2007/10/06}{Bugfix: \cs{caption@clearmargin} added}
7034 % Beside calling |\caption@settype| we redefine |\caption@boxrestore|
7035 % (as in \package{floatflt} \& \package{picins} package support)
7036 % and |\@makecaption| (as in \package{float} package support) here.
7037 % \begin{macrocode}
7038 \newcommand*\caption@window[1]{%
7039 \let\caption@boxrestore\@parboxrestore
7040 \let\@makecaption\caption@@make
7041 \caption@setautoposition b%
7042 \caption@settype{#1}%
7043 \caption@clearmargin}%
7044 % \end{macrocode}
7045 % \end{macro}
7046 %
7047 % \begin{macro}{\caption@wincaption}
7048 % \changes{v3.1d}{2007/10/25}{Missing \% added}
7049 % This one finally typesets the caption using |\caption|.
7050 % \begin{macrocode}
7051 \newcommand\caption@wincaption[1]{%
7052 % \end{macrocode}
7053 % This will be done twice for every |figwindow| \& |tabwindow| caption --
7054 % on the first run |\picwd| is |0pt|, on the second run |\picwd| is |\hsize|.
7055 % \begin{macrocode}
7056 \ifdim\picwd=\z@
7057 \let\caption@makecurrent\@gobbletwo
7058 \let\caption@@start\relax
7059 \caption@prepareslc
7060 \fi
7061 % \end{macrocode}
7062 % The argument |#1| could contain simply the caption text
7063 % (e.g.~|A figure caption|), but it could also contain an optional argument,
7064 % the \meta{lst\_entry}
7065 % (e.g.~|[An| |entry| |to| |the| |LOF]||{A| |figure| |caption}|).
7066 % Therefore we have to test if |#1| begins with~|[| or not; furthermore we
7067 % support a starred variant -- as in |\caption*| -- so we test for~|*|, too.
7068 % \begin{macrocode}
7069 \edef\@tempa{\expandafter\noexpand\@car#1\@nil}%
7070 \if\@tempa*%
7071 \let\@tempa\@firstofone
7072 \else\if\@tempa[%]
7073 \let\@tempa\@firstofone
7074 \else
7075 \let\@tempa\@empty
7076 \fi\fi
7077 \expandafter\caption\@tempa{#1}}%
7078 % \end{macrocode}
7079 % \end{macro}
7080 %
7081 % \begin{macrocode}
7082 }{}
7083 % \end{macrocode}
7084 %
7085 % \subsubsection{The picins package}
7086 % \changes{v3.0j}{2006/01/26}{Support of the \package{picins} package added}
7087 %
7088 % \begin{macro}{\piccaptiontype}
7089 % |\piccaptiontype|\marg{type}\par
7090 % We offer this macro for changing the \meta{type} of the caption, so the user
7091 % doesn't have to redefine |\@captype|, as proposed in the \package{picins}
7092 % documentation.
7093 % \Note{We define this macro here so it can be used in the
7094 % preamble of the document, even when \thispackage\ was loaded prior to the
7095 % \package{picins} package.}
7096 % \begin{macrocode}
7097 \newcommand*\piccaptiontype[1]{\def\@piccaptype{#1}}
7098 % \end{macrocode}
7099 % \end{macro}
7100 %
7101 % \begin{macrocode}
7102 \caption@IfPackageLoaded{picins}{%
7103 % \end{macrocode}
7104 %
7105 % Initial set |\@piccaptype| and undefine |\@captype| which was set to
7106 % |figure| by the \package{picins} package.
7107 % \begin{macrocode}
7108 \@ifundefined{@piccaptype}{%
7109 \caption@iftype{%
7110 \let\@piccaptype\@captype
7111 }{%
7112 \def\@piccaptype{figure}%
7113 }%
7114 }{}%
7115 \let\@captype\@undefined
7116 % \end{macrocode}
7117 %
7118 % \begin{macro}{\piccaption}
7119 % The original code:
7120 % \begin{verbatim}
7121 % \def\piccaption{\@ifnextchar [{\@piccaption}{\@piccaption[]}}
7122 % \end{verbatim}%^^A
7123 % Our code uses |\caption@star| so |\piccaption*| works,
7124 % and |\caption@dblarg| so |\piccaption{}| works correctly.
7125 % \begin{macrocode}
7126 \def\piccaption{\caption@star\relax{\caption@dblarg\@piccaption}}%
7127 % \end{macrocode}
7128 % \end{macro}
7129 %
7130 % \begin{macro}{\make@piccaption}
7131 % \changes{v3.1}{2007/12/06}{Bugfix: \cs{caption@clearmargin} will always be used now}
7132 % The original code:
7133 % \begin{verbatim}
7134 % \def\make@piccaption{%
7135 % [...]
7136 % \setbox\@TEXT=\vbox{\hsize\hsiz@\caption[\sh@rtf@rm]{\capti@nt@xt}}%
7137 % }
7138 % \end{verbatim}%^^A
7139 % In our code we have to correct several things:
7140 % \begin{enumerate}
7141 % \item |\@captype| must be defined, since we have removed the global
7142 % definition.
7143 % \item We use |\caption@setoptions{parpic}| so
7144 % |\captionsetup[parpic]{|\ldots|}| is supported.
7145 % \item |\linewidth| must be set correctly.
7146 % Usually this is done by |\@parboxrestore| inside |\@caption|,
7147 % but since we use |\@caption@boxrestore| we have to map this to
7148 % |\@parboxrestore| instead.
7149 % \item The two arguments of |\caption| (|\sh@rtf@rm| \& |\capti@nt@xt|)
7150 % should be expanded on first level so |\caption[]{|\ldots|}| and
7151 % |\caption[|\ldots|]{}| work correctly.
7152 % \end{enumerate}
7153 % \begin{macrocode}
7154 \let\caption@ORI@make@piccaption\make@piccaption
7155 \def\make@piccaption{%
7156 \let\caption@ORI\caption
7157 % \end{macrocode}
7158 % \begin{macrocode}
7159 \long\def\caption[##1]##2{%
7160 \caption@freezeHref % will be defrosted in \ivparpic
7161 \caption@settype\@piccaptype
7162 % \ifnum\c@piccaptionpos>2\relax
7163 \caption@clearmargin
7164 % \else
7165 % \captionwidth\z@ % do not use "width=" setting
7166 % \fi
7167 \caption@setoptions{parpic}%
7168 \let\caption@boxrestore\@parboxrestore
7169 \caption@setautoposition b%
7170 % \end{macrocode}
7171 % \begin{macrocode}
7172 \expandafter\expandafter\expandafter\caption@ORI
7173 \expandafter\expandafter\expandafter[%
7174 \expandafter\expandafter\expandafter{%
7175 \expandafter##1\expandafter}\expandafter]\expandafter{##2}}%
7176 % \end{macrocode}
7177 % {\footnotesize\begin{quote}
7178 % \leavevmode\llap{-or-\quad}%^^A
7179 % |\begingroup|\\
7180 % | \toks0\expandafter{##1}| |\toks2\expandafter{##2}|\\
7181 % | \edef\x{\endgroup|\\
7182 % | \noexpand\caption@ORI[{\the\toks0}]{\the\toks2}}|\\
7183 % | \x|
7184 % \end{quote}
7185 % \begin{quote}
7186 % \leavevmode\llap{-or-\quad}%^^A
7187 % |\edef\x{%|\\
7188 % | \noexpand\caption@ORI[{\unexpanded\expandafter{##1}}]%|\\
7189 % | {\unexpanded\expandafter{##2}}}|\\
7190 % |\x|
7191 % \end{quote}}
7192 % \begin{macrocode}
7193 \caption@ORI@make@piccaption
7194 \let\caption\caption@ORI}%
7195 % \end{macrocode}
7196 % \end{macro}
7197 %
7198
7199 % \begin{macro}{\ivparpic}
7200 % We need to set our \package{hyperref} anchor here.
7201 % Not bullet-proof since we have to redefine |\noindent| here!
7202 % \begin{macrocode}
7203 \let\caption@ORI@ivparpic\ivparpic
7204 \def\ivparpic(#1,#2)(#3,#4)[#5][#6]#7{%
7205 \let\caption@ORI@noindent\noindent
7206 \def\noindent{%
7207 \caption@defrostHref
7208 \let\noindent\caption@ORI@noindent
7209 \noindent}%
7210 \caption@ORI@ivparpic(#1,#2)(#3,#4)[#5][#6]{#7}%
7211 \let\noindent\caption@ORI@noindent}%
7212 % \end{macrocode}
7213 % \end{macro}
7214 %
7215 % \begin{macrocode}
7216 }{%
7217 \let\piccaptiontype\@undefined
7218 }
7219 % \end{macrocode}
7220 %
7221 % \subsubsection{The rotating package}
7222 %
7223 % \begin{macrocode}
7224 \caption@IfPackageLoaded{rotating}[1995/08/22 v2.10]{%
7225 % \end{macrocode}
7226 %
7227 % \begin{macro}{\rotcaption}
7228 % \changes{v3.0c}{2004/07/16}{Bugfix: Check for \cs{caption@star} removed}
7229 % \changes{v3.0i}{2005/12/07}{Rewritten, works with \package{hyperref} now}
7230 % Make |\rotcaption*| work.
7231 % \begin{macrocode}
7232 \def\rotcaption{\let\@makecaption\@makerotcaption\caption}%
7233 % \let\@rotcaption\@undefined
7234 % \end{macrocode}
7235 % \end{macro}
7236 %
7237 % \begin{macro}{\rotcaptionof}
7238 % \changes{v3.0i}{2005/12/07}{New}
7239 % Make |\rotcaptionof(*)| work.
7240 % \begin{macrocode}
7241 \def\rotcaptionof{%
7242 \caption@teststar\caption@of{\rotcaption*}\rotcaption}%
7243 % \end{macrocode}
7244 % \end{macro}
7245 %
7246 % \begin{macro}{\@makerotcaption}
7247 % \changes{v3.0i}{2005/12/06}{Rewritten, should finally work proper now}
7248 % \changes{v3.0m}{2007/03/04}{Uses \cs{caption@parbox} instead of \cs{caption@start/endbox} now}
7249 % Original (bugfixed) code:
7250 % \begin{verbatim}
7251 % \long\def\@makerotcaption#1#2{%
7252 % \setbox\@tempboxa\hbox{#1: #2}%
7253 % \ifdim \wd\@tempboxa > .8\vsize
7254 % \rotatebox{90}{%
7255 % \begin{minipage}{.8\textheight}#1: #2\end{minipage}%
7256 % }%\par % <== \par removed (AR)
7257 % \else%
7258 % \rotatebox{90}{\box\@tempboxa}%
7259 % \fi
7260 % \nobreak\hspace{12pt}% <== \nobreak added (AR)
7261 % }
7262 % \end{verbatim}%^^A
7263 % Our version emulates this behavior, but if |width=| is set,
7264 % the rotated caption is always typeset as |minipage|.
7265 % (Note that |margin=| is not supported here.)
7266 % \begin{macrocode}
7267 \long\def\@makerotcaption#1#2{%
7268 % \end{macrocode}
7269 %
7270 % \begin{macrocode}
7271 \ifdim\captionwidth=\z@
7272 \setcaptionwidth{.8\textheight}%
7273 \caption@slc{#1}{#2}{.8\vsize}{%
7274 \let\caption@makerot\caption@@make
7275 \caption@clearmargin
7276 % \long\def\caption@parbox##1##2{\hbox{\hsize=.8\textheight\relax##2}}%
7277 % (not needed because \rotatebox uses an \hbox anyway)
7278 \let\caption@parbox\@secondoftwo}%
7279 \caption@set@bool\caption@ifslc0% been there, done that
7280 \fi
7281 % \end{macrocode}
7282 %
7283 % \begin{macrocode}
7284 \rotatebox{90}{\caption@makerot{#1}{#2}}%
7285 \nobreak\hspace{12pt}}%
7286 % \end{macrocode}
7287 %
7288 % \begin{macrocode}
7289 \newcommand\caption@makerot[2]{%
7290 \begin{minipage}\captionwidth\caption@@make{#1}{#2}\end{minipage}}%
7291 % \end{macrocode}
7292 % \end{macro}
7293 %
7294 % \changes{v3.1a}{2007/09/07}{\cs{DeclareFloatingEnvironment} defines sideways-variant, too}
7295 % \begin{macrocode}
7296 \caption@For{typelist}{%
7297 \newenvironment{sideways#1}{\@rotfloat{#1}}{\end@rotfloat}%
7298 \newenvironment{sideways#1*}{\@rotdblfloat{#1}}{\end@rotdblfloat}}%
7299 % \end{macrocode}
7300 %
7301 % \begin{macrocode}
7302 }{}
7303 % \end{macrocode}
7304 %
7305 % \subsubsection{The sidecap package}
7306 %
7307 % \begin{macrocode}
7308 \caption@IfPackageLoaded{sidecap}[1999/05/11 v1.4d]{%
7309 \caption@setbool{needfreeze}{1}%
7310 % \end{macrocode}
7311 %
7312 % \begin{macro}{\SC@caption}
7313 % \changes{v3.0d}{2004/11/28}{Bugfix: Definition of \cs{@captype} added}
7314 % \changes{v3.0e}{2005/05/05}{Bugfix: Empty captions are handled correctly now}
7315 % \changes{v3.0e}{2005/05/05}{Priority of options fixed}
7316 % \changes{v3.0h}{2005/10/03}{Bugfix: Always use \cs{AtBeginDocument} to set \cs{SC@caption}}
7317 % First of all, we let \package{sidecap} use a current definition of |\caption|.\\
7318 % (This is only required for version 1.5d of the \package{sidecap} package.)
7319 % \begin{macrocode}
7320 \caption@AtBeginDocument{\let\SC@caption=\caption}%
7321 % \end{macrocode}
7322 % \end{macro}
7323 %
7324 % \begin{macro}{\SC@zfloat}
7325 % \changes{v3.0b}{2004/05/16}{Local definition of \cs{captionsetup} added}
7326 % \changes{v3.0c}{2004/07/16}{Bugfix 04-07-15: Check for \cs{caption@star} removed}
7327 % \changes{v3.1c}{2007/10/06}{\cs{caption} will be saved \& restored now}
7328 % \changes{v3.1n}{2022/07/10}{\cs{ignorespaces} appended}
7329 % This macro will be called at the start of the environment, here is a good
7330 % opportunity to do some adaptations to |\caption| and |\captionsetup|.
7331 % \begin{macrocode}
7332 \let\caption@ORI@SC@zfloat\SC@zfloat
7333 \def\SC@zfloat#1#2#3[#4]{%
7334 % \end{macrocode}
7335 % First we use the original definition, but save \& restore \cs{caption}
7336 % so \cs{caption@freeze} will work correctly.
7337 % \begin{macrocode}
7338 \let\caption@ORI\caption
7339 \caption@ORI@SC@zfloat{#1}{#2}{#3}[#4]%
7340 \let\caption\caption@ORI
7341 % \end{macrocode}
7342 % Since the sidecap package uses our |\caption| code outside the
7343 % environment the regular |\caption|\-|setup| will not work.
7344 % So we need a special version here which saves the given argument list
7345 % which will be executed later on.
7346 % Furthermore we need to make |\caption*| work.
7347 % \begin{macrocode}
7348 \caption@settype*{#2}%
7349 \caption@freeze*%
7350 % \end{macrocode}
7351 % Since the original definition of |\SC@zfloat| ends with |\begin{lrbox}| which ends with |\ignore|\-|spaces|,
7352 % we do have to end our re-definition of |\SC@zfloat| with |\ignore|\-|spaces| as well.
7353 % \begin{macrocode}
7354 \ignorespaces}%
7355 % \end{macrocode}
7356 % \end{macro}
7357 %
7358 % \begin{macro}{\endSC@FLOAT}
7359 % \changes{v3.0i}{2006/01/12}{\cs{@listdepth}\cs{z@} added}
7360 % \changes{v3.1}{2007/05/05}{Call of \cs{caption@setoptions}\arg{SCfloat} added}
7361 % This macro will be called at the end of the environment, here we need to
7362 % setup our stuff before the \package{sidecap} package actually typesets
7363 % its caption.
7364 % \begin{macrocode}
7365 \let\caption@ORI@endSC@FLOAT\endSC@FLOAT
7366 \def\endSC@FLOAT{%
7367 % \end{macrocode}
7368 % \Note{\cs{@captype} isn't defined here, this will be done inside
7369 % the original definition of \cs{endSC@FLOAT}. But \cs{SC@captype} is
7370 % defined and can be used here, if needed.}
7371 % \begin{macrocode}
7372 \let\caption@ORI@settype\caption@settype
7373 \def\caption@settype##1{% will be done in \@xfloat
7374 \caption@ORI@settype*{##1}% do not change \@currentlabel
7375 \caption@setSC@justify
7376 %%% \caption@setoptions{SCfloat}%
7377 \caption@setoptions{SC\@captype}%
7378 \caption@start}%
7379 % \end{macrocode}
7380 % Before we can typeset the caption we need to set the margin to zero
7381 % because any extra margin would only be disturbing here.\par
7382 % (We don't need to take care about the caption position because
7383 % the sidecap package set both |\abovecaptionskip| and |\belowcaptionskip|
7384 % to a skip of zero anyway.)\par
7385 % Furthermore |\SC@justify| will override the caption justification, if set.
7386 % The usage of |\SC@justify| differs from version to version of the
7387 % \package{sidecap} package:\par
7388 % \begin{tabular}{ll}
7389 % Version 1.4: & |\SC@justify| is not defined\\
7390 % Version 1.5: & |\SC@justify| is |\relax| when not set\\
7391 % Version 1.6: & |\SC@justify| is |\@empty| when not set\\
7392 % \end{tabular}
7393 % \begin{macrocode}
7394 \def\caption@setSC@justify{%
7395 \caption@clearmargin
7396 \@ifundefined{SC@justify}{}{%
7397 \ifx\SC@justify\@empty \else
7398 \let\caption@hj\SC@justify
7399 \let\SC@justify\@empty
7400 \fi}}%
7401 % \end{macrocode}
7402 % Make the original definition of |\endSC@FLOAT| to use our caption
7403 % stuff instead of its own.
7404 % \Note{At this point the \package{sidecap} definition of \cs{caption} is valid,
7405 % not the regular one!}
7406 % \begin{macrocode}
7407 \let\caption\SC@orig@caption
7408 \def\SC@orig@caption[##1]##2{\caption@defrost}%
7409 % \end{macrocode}
7410 % Finally we call the original definition of |\endSC@FLOAT|.
7411 % \begin{macrocode}
7412 \caption@setSC@justify % for compatibility mode
7413 \caption@ORI@endSC@FLOAT}%
7414 % \end{macrocode}
7415 % \end{macro}
7416 %
7417 % \changes{v3.1a}{2007/09/07}{\cs{DeclareFloatingEnvironment} defines SC-variant, too}
7418 % \changes{v3.1f}{2007/12/23}{Bugfix in definition of SC-variant}
7419 % \begin{macrocode}
7420 \newcommand*\caption@For@SC[2]{%
7421 \def#1{b}% = \sidecaptionvpos{#2}{b} (v1.6)
7422 \newenvironment{SC#2}%
7423 {\SC@float[#1]{#2}}{\endSC@float}%
7424 \newenvironment{SC#2*}%
7425 {\SC@dblfloat[#1]{#2}}{\endSC@dblfloat}}%
7426 \@onlypreamble\caption@For@SC
7427 \caption@For{typelist}{%
7428 \expandafter\caption@For@SC\csname SC@#1@vpos\endcsname{#1}}%
7429 % \end{macrocode}
7430 %
7431 % \begin{macrocode}
7432 }{}
7433 % \end{macrocode}
7434 %
7435 % \subsubsection{The subfigure package}
7436 % \changes{v3.1}{2007/04/06}{subfigure package support added (package)}
7437 %
7438 % \begin{macrocode}
7439 \caption@IfPackageLoaded{subfigure}[2002/01/23 v2.1]{%
7440 % \end{macrocode}
7441 %
7442 % \begin{macro}{\sf@ifpositiontop}
7443 % \changes{v3.1a}{2007/09/15}{Bugfix 07-09-15: Check for \cs{@captype} added}
7444 % If the \package{subfigure} package is loaded, we map |\sf@ifpositiontop|
7445 % to |\iffiguretopcap| resp. |\iftabletopcap|, so the \package{subfigure}
7446 % \version{2.1} options \opt{figbotcap} etc. will still work.
7447 % \begin{macrocode}
7448 \def\sf@ifpositiontop{%
7449 \ifx\@captype\@undefined
7450 \expandafter\@gobbletwo
7451 \else\ifx\@captype\relax
7452 \expandafter\expandafter\expandafter\@gobbletwo
7453 \else
7454 \expandafter\expandafter\expandafter\sf@if@position@top
7455 \fi\fi}
7456 % \end{macrocode}
7457 % \begin{macrocode}
7458 \def\sf@if@position@top{%
7459 \@ifundefined{if\@captype topcap}%
7460 {\@gobbletwo}%
7461 {\@nameuse{if\@captype topcap}%
7462 \expandafter\@firstoftwo
7463 \else
7464 \expandafter\@secondoftwo
7465 \fi}}
7466 % \end{macrocode}
7467 % \end{macro}
7468 %
7469 % \begin{macrocode}
7470 }{}
7471 % \end{macrocode}
7472 %
7473 % \subsubsection{The supertabular and xtab packages}
7474 %
7475 % \begin{macrocode}
7476 \caption@IfPackageLoaded{supertabular}[2002/07/19 v4.1e]{%
7477 % \end{macrocode}
7478 %
7479 % \begin{macro}{\tablecaption}
7480 % \changes{v3.0e}{2005/05/05}{Made \cs{topcaption*} and \cs{bottomcaption*} work}
7481 % \changes{v3.1h}{2008/04/01}{Bugfix: Star variant does not increment table counter anymore}
7482 % Make |\topcaption*| and |\bottomcaption*| work.
7483 % \begin{macrocode}
7484 \renewcommand*\tablecaption{%
7485 \caption@star
7486 {\refstepcounter{table}}%
7487 {\caption@dblarg{\@xtablecaption}}}%
7488 % \end{macrocode}
7489 % \end{macro}
7490 %
7491 % \begin{macro}{\@xtablecaption}
7492 % \changes{v3.1h}{2008/04/01}{Made \cs{nameref} \& \cs{autoref} work}
7493 % \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
7494 % Make |\nameref| and |\autoref| work.
7495 % \begin{macrocode}
7496 \let\caption@ORI@xtablecaption\@xtablecaption
7497 \long\def\@xtablecaption[#1]#2{%
7498 \caption@gettitle{#2}%
7499 \caption@ORI@xtablecaption[#1]{#2}}%
7500 % \end{macrocode}
7501 % \end{macro}
7502 %
7503 % \begin{macro}{\ST@caption}
7504 % \changes{v3.0a}{2004/01/23}{Bugfix: Missing \cs{par} added}
7505 % \changes{v3.1h}{2008/04/01}{Bugfix: \cs{@currentlabelname} will be set now}
7506 % The original code:
7507 % \begin{verbatim}
7508 % \long\def\ST@caption#1[#2]#3{\par%
7509 % \addcontentsline{\csname ext@#1\endcsname}{#1}%
7510 % {\protect\numberline{%
7511 % \csname the#1\endcsname}{\ignorespaces #2}}
7512 % \begingroup
7513 % \@parboxrestore
7514 % \normalsize
7515 % \if@topcaption \vskip -10\p@ \fi
7516 % \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
7517 % \if@topcaption \vskip 10\p@ \fi
7518 % \endgroup}
7519 % \end{verbatim}%^^A
7520 % \begin{macrocode}
7521 \long\def\ST@caption#1[#2]#3{\par%
7522 \caption@settype*{#1}%
7523 \caption@setoptions{supertabular}%
7524 % \end{macrocode}
7525 % The |position=| setting will be overwritten by the
7526 % \package{supertabular} package: If |\topcaption| was used,
7527 % the position will be |top| automatically, |bottom| otherwise.
7528 % \begin{macrocode}
7529 \def\caption@fixposition{%
7530 \caption@setposition{\if@topcaption t\else b\fi}}%
7531 % \end{macrocode}
7532 % \begin{macrocode}
7533 \caption@beginex{#1}{#2}{#3}%
7534 \caption@boxrestore
7535 \caption@normalsize
7536 \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
7537 \caption@end}%
7538 % \end{macrocode}
7539 % \end{macro}
7540 %
7541 % \begin{macrocode}
7542 }{}
7543 % \end{macrocode}
7544 %
7545 % \changes{v3.1h}{2008/04/01}{Support of the xtab package added}
7546 % \begin{macrocode}
7547 \caption@IfPackageLoaded{xtab}[2000/04/09 v2.3]{%
7548 % \end{macrocode}
7549 %
7550 % \begin{macro}{\tablecaption}
7551 % Make |\topcaption*| and |\bottomcaption*| work.
7552 % \begin{macrocode}
7553 \renewcommand*\tablecaption{%
7554 \caption@star
7555 {\refstepcounter{table}}%
7556 {\caption@dblarg{\@xtablecaption}}}%
7557 % \end{macrocode}
7558 % \end{macro}
7559 %
7560 % \begin{macro}{\@xtablecaption}
7561 % \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
7562 % Make |\nameref| and |\autoref| work.
7563 % \begin{macrocode}
7564 \let\caption@ORI@xtablecaption\@xtablecaption
7565 \long\def\@xtablecaption[#1]#2{%
7566 \caption@gettitle{#2}%
7567 \caption@ORI@xtablecaption[#1]{#2}}%
7568 % \end{macrocode}
7569 % \end{macro}
7570 %
7571 % \begin{macro}{\ST@caption}
7572 % The original code:
7573 % \begin{verbatim}
7574 % \long\def\ST@caption#1[#2]#3{\par%
7575 % \@initisotab
7576 % \addcontentsline{\csname ext@#1\endcsname}{#1}%
7577 % {\protect\numberline{%
7578 % \csname the#1\endcsname}{\ignorespaces #2}}%
7579 % \begingroup
7580 % \@parboxrestore
7581 % \normalsize
7582 % %% \if@topcaption \vskip -10\p@ \fi
7583 % \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
7584 % %% \if@topcaption \vskip 10\p@ \fi
7585 % \endgroup
7586 % \global\advance\ST@pageleft -\PWSTcapht
7587 % \ST@trace\tw@{Added caption. Space left for xtabular: \the\ST@pageleft}}
7588 % \end{verbatim}%^^A
7589 % \begin{macrocode}
7590 \long\def\ST@caption#1[#2]#3{\par%
7591 \caption@settype*{#1}%
7592 \caption@setoptions{xtabular}%
7593 % \end{macrocode}
7594 % \begin{macrocode}
7595 \def\caption@fixposition{%
7596 \caption@setposition{\if@topcaption t\else b\fi}}%
7597 % \end{macrocode}
7598 % \begin{macrocode}
7599 \@initisotab
7600 \caption@beginex{#1}{#2}{#3}%
7601 \caption@boxrestore
7602 \caption@normalsize
7603 \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
7604 \caption@end
7605 \global\advance\ST@pageleft -\PWSTcapht
7606 \ST@trace\tw@{Added caption. Space left for xtabular: \the\ST@pageleft}}%
7607 % \end{macrocode}
7608 % \end{macro}
7609 %
7610 % \begin{macrocode}
7611 }{}
7612 % \end{macrocode}
7613 %
7614 % \subsubsection{The threeparttable package}
7615 % \changes{v3.1}{2007/05/08}{Support of the \package{threeparttable} package added}
7616 %
7617 % \begin{macrocode}
7618 \caption@IfPackageLoaded{threeparttable}[2003/06/13 v3.0]{%
7619 % \end{macrocode}
7620 %
7621 % \begin{macro}{\threeparttable}
7622 % Unfortunately |\@captype| is not set when |\TPT@common| will be used,
7623 % so we have to redefine |\threeparttable| and |\measuredfigure| instead.
7624 % \begin{macrocode}
7625 \let\caption@ORI@threeparttable\threeparttable
7626 \renewcommand*\threeparttable{%
7627 \caption@settype{table}%
7628 \caption@setposition a% ?
7629 \caption@clearmargin
7630 \caption@setoptions{threeparttable}%
7631 \caption@ORI@threeparttable}%
7632 % \end{macrocode}
7633 % \end{macro}
7634 % \begin{macro}{\measuredfigure}
7635 % Same here\ldots
7636 % \begin{macrocode}
7637 \let\caption@ORI@measuredfigure\measuredfigure
7638 \renewcommand*\measuredfigure{%
7639 \caption@settype{figure}%
7640 \caption@setposition a% ?
7641 \caption@clearmargin
7642 \caption@setoptions{measuredfigure}%
7643 \caption@ORI@measuredfigure}%
7644 % \end{macrocode}
7645 % \end{macro}
7646 %
7647 % \begin{macro}{\TPT@caption}
7648 % The original code:
7649 % \begin{verbatim}
7650 % \def\TPT@caption#1[#2]#3{\gdef\TPT@docapt
7651 % {\par\global\let\TPT@docapt\@undefined \TPT@LA@caption{#1}[{#2}]%
7652 % {\strut\ignorespaces#3\ifhmode\unskip\@finalstrut\strutbox\fi}}%
7653 % \ifx\TPT@hsize\@empty \let\label\TPT@gatherlabel \abovecaptionskip\z@skip
7654 % \else \TPT@docapt \fi \ignorespaces}
7655 % \end{verbatim}%^^A
7656 % \begin{macrocode}
7657 \def\TPT@caption#1[#2]#3{%
7658 \gdef\TPT@docapt{%
7659 \global\let\TPT@docapt\@undefined
7660 \caption@setautoposition\caption@TPT@position
7661 \TPT@LA@caption{#1}[{#2}]{#3}}%
7662 \ifx\TPT@hsize\@empty
7663 \let\label\TPT@gatherlabel % Bug: does not work for measuredfigures
7664 \gdef\caption@TPT@position{t}%
7665 \g@addto@macro\TPT@docapt\caption@TPT@eatvskip
7666 \else
7667 \def\caption@TPT@position{b}%
7668 \TPT@docapt
7669 \fi
7670 \ignorespaces}%
7671 % \end{macrocode}
7672 % \begin{macrocode}
7673 %\newcommand*\caption@TPT@eatvskip{\vskip-.2\baselineskip}%
7674 \def\caption@TPT@eatvskip#1\vskip{#1\@tempdima=}%
7675 % \end{macrocode}
7676 % \end{macro}
7677 %
7678 % \begin{macrocode}
7679 }{}
7680 % \end{macrocode}
7681 %
7682 % \subsubsection{The wrapfig package}
7683 % \changes{v3.1}{2007/05/05}{Support of the \package{wrapfig} package added}
7684 %
7685 % \begin{macrocode}
7686 \caption@IfPackageLoaded{wrapfig}{% ver 3.3 (Oct 12, 1999)
7687 % \end{macrocode}
7688 %
7689 % \begin{macro}{\float@ifstyle}
7690 % \changes{v3.1}{2007/06/10}{This macro added}
7691 % |\float@ifstyle|\marg{type}\marg{if-clause}\marg{else-clause}\par
7692 % (see \package{float} package support for details)
7693 % \begin{macrocode}
7694 \providecommand*\float@ifstyle[1]{%
7695 \expandafter\ifx\csname fst@#1\endcsname\relax
7696 \expandafter\@secondoftwo
7697 \else
7698 \expandafter\@firstoftwo
7699 \fi}%
7700 % \end{macrocode}
7701 % \end{macro}
7702 %
7703 % \begin{macro}{\caption@restylewrapfloat}
7704 % This one redefines the |wrap#1| environment, e.g.~|wrapfigure|.
7705 % Our code uses |\caption@setoptions{wrapfigure}| so
7706 % |\captionsetup[wrapfigure]{|\ldots|}| will work.\par
7707 % But first we check if our redefinition was already done, this could
7708 % happen inside |\float@restyle| when the \package{wrapfig} support of
7709 % the \package{float} package was not installed successfully, so it has
7710 % not redefined |\wrap#1| there.
7711 % \begin{macrocode}
7712 \newcommand*\caption@restylewrapfloat[1]{%
7713 \expandafter\ifx\csname caption@OUR@wrap#1\expandafter\endcsname
7714 \csname wrap#1\endcsname
7715 \caption@Error{%
7716 For a successful cooperation of the `wrapfig' package\MessageBreak
7717 with the `float' package you should load the `wrapfig'\MessageBreak
7718 package *after* the `float' package}%
7719 \else
7720 \expandafter\let\csname caption@ORI@wrap#1\expandafter\endcsname
7721 \csname wrap#1\endcsname
7722 \@namedef{wrap#1}{\caption@wrapfloat{#1}}%
7723 \expandafter\let\csname caption@OUR@wrap#1\expandafter\endcsname
7724 \csname wrap#1\endcsname
7725 \fi}%
7726 % \end{macrocode}
7727 % \end{macro}
7728 %
7729 % \begin{macro}{\caption@wrapfloat}
7730 % \begin{macrocode}
7731 \newcommand*\caption@wrapfloat[1]{%
7732 \caption@settype*{#1}%
7733 \float@ifstyle{#1}{%
7734 \ifx\WF@floatstyhook\@undefined
7735 \caption@Error{%
7736 For a successful cooperation of the `wrapfig' package\MessageBreak
7737 with the `float' package you should use at least\MessageBreak
7738 `wrapfig' version 3.6}%
7739 \else
7740 \float@dostyle{#1}%
7741 \fi}{}%
7742 \caption@clearmargin
7743 %%% \caption@setoptions{wrapfloat}%
7744 \caption@setoptions{wrap#1}%
7745 \@nameuse{caption@ORI@wrap#1}}%
7746 % \end{macrocode}
7747 % \end{macro}
7748 %
7749 % Now we redefine the \package{wrapfig} environments we know about.\par
7750 % If someone has placed a |\newfloat| right between |\usepackage{wrapfig}|
7751 % and |\usepackage{caption}| (or loads \thispackage\ first, so all these
7752 % patches will be done with |\AtBeginDocument|) we have bad luck since the
7753 % \package{float} package do not offer a list of (re)styled floats.
7754 % (This would finally lead to an error in |\caption@setfloatcapt|.)
7755 %
7756 % \begin{macrocode}
7757 \caption@restylewrapfloat{figure}%
7758 \caption@restylewrapfloat{table}%
7759 % \end{macrocode}
7760 %
7761 % \changes{v3.1a}{2007/09/07}{\cs{DeclareFloatingEnvironment} defines wrap-variant, too}
7762 % \begin{macrocode}
7763 \caption@For{typelist}{%
7764 \newenvironment{wrap#1}{\wrapfloat{#1}}{\endwrapfloat}%
7765 \caption@restylewrapfloat{#1}}%
7766 % \end{macrocode}
7767 %
7768 % \begin{macrocode}
7769 \ifx\WF@floatstyhook\@undefined \else % wrapfig v3.6
7770 % \end{macrocode}
7771 %
7772 % \begin{macro}{\float@restyle}
7773 % If the \package{wrapfig} package \version{3.6} is used, we patch
7774 % |\float@restyle| (if defined), too, so new or restyled floats will be
7775 % handled correctly, too.
7776 % \begin{macrocode}
7777 \@ifundefined{float@restyle}{}{%
7778 \toks@=\expandafter{\float@restyle{#1}% (env may or may not be defined)
7779 \caption@restylewrapfloat{#1}}%
7780 \edef\@tempa{\def\noexpand\float@restyle##1{\the\toks@}}%
7781 \@tempa}% perform redefinitions
7782 % \end{macrocode}
7783 % \end{macro}
7784 %
7785 % \begin{macro}{\wrapfloat}
7786 % An additional check of the package load order:
7787 % If both, neither the \package{wrapfig} package nor \thispackage\ haven't
7788 % catch |\float@restyle|, we finally splash down at |\wrapfloat|.
7789 % \begin{macrocode}
7790 \let\caption@ORI@wrapfloat\wrapfloat
7791 \def\wrapfloat#1{%
7792 \float@ifstyle{#1}{%
7793 \caption@Error{%
7794 For a successful cooperation of the `wrapfig' package\MessageBreak
7795 with the `float' package you should load the `wrapfig'\MessageBreak
7796 package *right after* the `float' package}}{}%
7797 \caption@ORI@wrapfloat{#1}}%
7798 % \end{macrocode}
7799 % \end{macro}
7800 %
7801 % \begin{macrocode}
7802 \fi % wrapfig v3.6
7803 % \end{macrocode}
7804 %
7805 % \begin{macro}{\WF@rapt}
7806 % We place our \package{hyperref} anchor here.\par
7807 % Original code:
7808 % \begin{verbatim}
7809 % \def\WF@rapt[#1]#2{% final two args: #1 = overhang, #2 = width,
7810 % \gdef\WF@ovh{#1}% hold overhang for later, when \width is known
7811 % \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}%
7812 % \ifdim\hsize>\z@ \@parboxrestore \else
7813 % \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption
7814 % \ignorespaces \fi}
7815 % \end{verbatim}%^^A
7816 % Our code:
7817 % \begin{macrocode}
7818 \def\WF@rapt[#1]#2{% final two args: #1 = overhang, #2 = width,
7819 \gdef\WF@ovh{#1}% hold overhang for later, when \width is known
7820 \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}%
7821 \caption@start
7822 \ifdim\hsize>\z@ \@parboxrestore \else
7823 \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption
7824 \ignorespaces \fi}%
7825 % \end{macrocode}
7826 % \end{macro}
7827 %
7828 % \begin{macrocode}
7829 }{}
7830 % \end{macrocode}
7831 %
7832 % \iffalse
7833 %</package>
7834 % \fi
7835 %
7836 % \iffalse
7837 % --------------------------------------------------------------------------- %
7838 % \fi
7839 %
7840 % \clearpage
7841 % \begin{thebibliography}{99}
7842 % \bibitem{TLC2}
7843 % Frank Mittelbach and Michel Goossens:\\
7844 % \newblock {\em The {\LaTeX} Companion (2nd.~Ed.)},\\
7845 % \newblock Addison-Wesley, 2004.
7846 %
7847 % \bibitem{beamer}
7848 % Till Tantau:\\
7849 % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/beamer/}%
7850 % {\emph{User Guide to the Beamer Class, Version 3.07}},\\
7851 % March 11, 2007
7852 %
7853 % \bibitem{KOMAScript}
7854 % Markus Kohm \& Jens-Uwe-Morawski:\\
7855 % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/koma-script/}%
7856 % {\emph{KOMA-Script -- a versatile \LaTeXe\ bundle}},\\
7857 % 2007-01-09
7858 %
7859 % \bibitem{NTG}
7860 % Victor Eijkhout:\\
7861 % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/ntgclass/}%
7862 % {\emph{An introduction to the Dutch \LaTeX\ document classes}},\\
7863 % 3 September 1989
7864 %
7865 % \bibitem{float}
7866 % Anselm Lingnau:\\
7867 % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/float/}%
7868 % {\emph{An Improved Environment for Floats}},\\
7869 % 2001/11/08
7870 %
7871 % \bibitem{floatflt}
7872 % Mats Dahlgren:\\
7873 % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/floatflt/}%
7874 % {\emph{Welcome to the floatflt package}},\\
7875 % 1998/06/05
7876 %
7877 % \bibitem{floatrow}
7878 % Olga Lapko:\\
7879 % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/floatrow/}%
7880 % {\emph{The floatrow package documentation}},\\
7881 % 2007/08/24
7882 %
7883 % \bibitem{fltpage}
7884 % Sebastian Gross:\\
7885 % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/fltpage/}%
7886 % {\emph{Welcome to the beta test of fltpage package!}},\\
7887 % 1998/11/13
7888 %
7889 % \bibitem{hyperref}
7890 % Sebastian Rahtz \& Heiko Oberdiek:\\
7891 % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/hyperref/}%
7892 % {\emph{Hypertext marks in \LaTeX}},\\
7893 % November 12, 2007
7894 %
7895 % \bibitem{hypcap}
7896 % Heiko Oberdiek:\\
7897 % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/oberdiek/}%
7898 % {\emph{The hypcap package -- Adjusting anchors of captions}},\\
7899 % 2007/04/09
7900 %
7901 % \bibitem{listings}
7902 % Carsten Heinz \& Brooks Moses:\\
7903 % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/listings/}%
7904 % {\emph{The Listings Package}},\\
7905 % 2007/02/22
7906 %
7907 % \bibitem{longtable}
7908 % David Carlisle:\\
7909 % \href{http://tug.ctan.org/tex-archive/macros/latex/required/tools/}%
7910 % {\emph{The longtable package}},\\
7911 % 2004/02/01
7912 %
7913 % \bibitem{picinpar}
7914 % Friedhelm Sowa:\\
7915 % \href{http://tug.ctan.org/tex-archive/macros/latex209/contrib/picinpar/}%
7916 % {\emph{Pictures in Paragraphs}},\\
7917 % July 13, 1993
7918 %
7919 % \bibitem{picins}
7920 % Joachim Bleser and Edmund Lang:\\
7921 % \href{http://tug.ctan.org/tex-archive/macros/latex209/contrib/picins/}%
7922 % {\emph{PicIns-Benutzerhandbuch Version 3.0}},\\
7923 % September~1992
7924 %
7925 % \bibitem{rotating}
7926 % Sebastian Rahtz and Leonor Barroca:\\
7927 % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/rotating/}%
7928 % {\emph{A style option for rotated objects in \LaTeX}},\\
7929 % 1997/09/26
7930 %
7931 % \bibitem{sidecap}
7932 % Rolf Niepraschk \& Hubert G\"a\ss lein:\\
7933 % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/sidecap/}%
7934 % {\emph{The sidecap package}},\\
7935 % 2003/06/06
7936 %
7937 % \bibitem{subfigure}
7938 % Steven D. Cochran:\\
7939 % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/subfigure/}%
7940 % {\emph{The subfigure package}},\\
7941 % 2002/07/02
7942 %
7943 % \bibitem{subfig}
7944 % Steven D. Cochran:\\
7945 % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/subfig/}%
7946 % {\emph{The subfig package}},\\
7947 % 2005/07/05
7948 %
7949 % \bibitem{supertabular}
7950 % Johannes Braams and Theo Jurriens:\\
7951 % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/supertabular/}%
7952 % {\emph{The supertabular environment}},\\
7953 % 2002/07/19
7954 %
7955 % \bibitem{threeparttable}
7956 % Donald Arseneau:\\
7957 % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/misc/}%
7958 % {\emph{Three part tables: title, tabular environment, notes}},\\
7959 % 2003/06/13
7960 %
7961 % \bibitem{wrapfig}
7962 % Donald Arseneau:\\
7963 % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/wrapfig/}%
7964 % {\emph{WRAPFIG.STY ver 3.6}},\\
7965 % 2003/01/31
7966 %
7967 % \bibitem{xtab}
7968 % Peter Wilson:\\
7969 % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/xtab/}%
7970 % {\emph{The xtab package}},\\
7971 % 2004/05/24
7972 %
7973 % \bibitem{Anne}
7974 % Anne Br\"uggemann-Klein:\\
7975 % \emph{Einf\"uhrung in die Dokumentverarbeitung},\\
7976 % B.G. Teubner, Stuttgart, 1989
7977 %
7978 % \bibitem{refcount}
7979 % Heiko Oberdiek:\\
7980 % \href{ftp://ctan.tug.org/tex-archive/macros/latex/contrib/oberdiek/refcount.pdf}%
7981 % {\emph{The refcount package}},\\
7982 % 2006/02/20
7983 % \end{thebibliography}
7984 %
7985 % \iffalse
7986 % --------------------------------------------------------------------------- %
7987 % \fi
7988 %
7989 % \clearpage
7990 % \Finale
7991 %
7992 \endinput