Debian Codegraph @

texmf-dist/source/latex/caption/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
22 % caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
23 % caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
24 % caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
25 % caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
26 % the derived files
27 % caption.sty, caption-light.sty, caption2.sty, caption3.sty,
28 % caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
29 % caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
30 % caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty.
31 %
32 % \fi
33 %
34 % \CheckSum{2925}
35 %
36 % \iffalse
37 %<*driver>
38 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
39 \ProvidesFile{caption.drv}[2023/09/07 v3.6 The caption package]
40 %\errorcontextlines=3
41 %
42 \documentclass{captiondoc}
43 \hypersetup{pdfkeywords={LaTeX, package, caption}}
44 %
45 \usepackage[listof=false,hypcap=false]{caption}[2022/01/06]
46 %
47 \usepackage{graphicx,longtable}
48 %
49 % \ContinuedFloat
50 \DeclareCaptionLabelFormat{continued1}{Continued #1~#2}
51 \DeclareCaptionLabelFormat{continued2}{#1~#2\alph{ContinuedFloat}}
52 % \DeclareCaptionLabelFormat
53 \DeclareCaptionLabelFormat{bf-parens}{(\textbf{#2})}
54 % \DeclareCaptionStyle
55 \DeclareCaptionStyle{mystyle}[margin=5mm,justification=centering]%
56 {font=footnotesize,labelfont=sc,margin={10mm,0mm}}
57 % Example 1
58 \DeclareCaptionFormat{myformat1}{#1#2\\#3}
59 \newlength\myindention
60 \DeclareCaptionFormat{myformat2}{#1#2\\\hspace*\myindention#3}
61 \DeclareCaptionOption{myindention}{\setlength\myindention{#1}}
62 % Example 2
63 \DeclareCaptionFormat{reverse}{#3#2#1}
64 \DeclareCaptionLabelFormat{fullparens}{(\bothIfFirst{#1}{~}#2)}
65 \DeclareCaptionLabelSeparator{fill}{\hfill}
66 % Example 3
67 \DeclareCaptionFormat{llap}{\llap{#1#2}#3\par}
68 \DeclareCaptionFormat{llapx}{\llap{\makebox[5em][l]{#1}}#3\par}
69 % Example 4
70 \DeclareCaptionLabelFormat{andtable}{#1~#2 \& \tablename~\thetable}
71 %
72 \begin{document}
73 \DocInput{caption.dtx}
74 \end{document}
75 %</driver>
76 % \fi
77 %
78 % \iffalse
79 % ----------------------------------------------------------------------------------------------- %
80 % \fi
81 %
82 % \def\thispackage{the \pkg{caption} package}
83 % \def\Thispackage{The \pkg{caption} package}
84 %
85 % \def\x{\-}
86 %
87 % \newenvironment{Annotation}%
88 % {\ifvmode\else\unskip\par\fi\pagebreak[2]%
89 % \smallskip
90 % \small(\ignorespaces}{\unskip)\par}
91 % \newenvironment{Annotation*}%
92 % {\ifvmode\else\unskip\par\fi\pagebreak[2]%
93 % \small(\ignorespaces}{\unskip)\par}
94 %
95 % \newenvironment{Example}%
96 % {\ifvmode\else\unskip\par\fi\pagebreak[2]%
97 % \minipage{\linewidth}\smallskip}%
98 % {\smallskip\endminipage\par}
99 %
100 % \makeatletter
101 % \newcommand\example{\@ifstar
102 % {\@example{belowskip=\abovecaptionskip}}%
103 % {\@example{}}}
104 % \def\@example#1{%
105 % \@testopt{\@@example{#1}}{figure}}
106 % \long\def\@@example#1[#2]#3#4{%
107 % \begingroup
108 % \captionsetup{#1,size=small,margin={\leftmargini,10pt},#3}%
109 % \captionof{#2}[]{#4}%
110 % \endgroup}
111 % \makeatother
112 %
113 % \newenvironment{Expert}%
114 % {\ifvmode\else\unskip\par\fi\pagebreak[3]%
115 % \smallskip
116 % \footnotesize\ignorespaces}{\par}
117 % \newenvironment{Expert*}%
118 % {\ifvmode\else\unskip\par\fi\pagebreak[3]%
119 % \footnotesize\ignorespaces}{\par}
120 %
121 % \newenvironment{Note}[1][\DefaultNoteText]%
122 % {\ifvmode\else\unskip\par\fi
123 % \smallskip
124 % \small\emph{#1:}~\ignorespaces}{\par}
125 % \newenvironment{Note*}[1][\DefaultNoteText]%
126 % {\ifvmode\else\unskip\par\fi
127 % \small\emph{#1:}~\ignorespaces}{\par}
128 % \newcommand*\DefaultNoteText{Note}
129 %
130 % \makeatletter
131 % \def\see{\@ifstar{\SEE\relax{see}}{\SEE\small{see}}}
132 % \def\See{\@ifstar{\SEE\relax{See}}{\SEE\small{See}}}
133 % \newcommand*\SEE[3]{\nopagebreak{#1(#2 #3)}}
134 % \newcommand*\SeeUserDefined[1][]{\See{\longref{declare}#1}}
135 % \makeatother
136 %
137 % \iffalse
138 % ----------------------------------------------------------------------------------------------- %
139 % \fi
140 %
141 % \GetFileInfo{caption.drv}
142 % \let\docdate\filedate
143 % \let\docversion\fileversion
144 % \GetFileInfo{caption.sty}
145 %
146 % \title{Customizing captions of floating environments%^^A
147 % \texorpdfstring{\thanks{%^^A
148 % This package has version number \docversion.}}%^^A
149 % {}}
150 % \author{Axel Sommerfeldt\\
151 % \url{https://gitlab.com/axelsommerfeldt/caption}}
152 % \date{\docdate}
153 % \maketitle
154 %
155 % \begin{abstract}
156 % \Thispackage\ offers customization of captions
157 % in floating environments such |figure| and |table| and cooperates with
158 % many other packages.
159 % \par\smallskip
160 % \textit{Please note:} Many document classes already have build-in options and
161 % commands for customizing captions.
162 % If these possibilities are sufficient for you, there is usually no need for
163 % you to use the \pkg{caption} package at all.
164 % And if you are only interested in using the command \cs{captionof}, loading of
165 % the very small \pkg{capt-of} package is usually sufficient.
166 % \end{abstract}
167 %
168 % \newcommand\shortexampletext{%
169 % White sand beaches. The pink smoothness of the conch shell. A sea abundant
170 % with possibilities. Duty-free shops filled with Europe's finest gifts and
171 % perfumes.}
172 % \newcommand\exampletext{\shortexampletext\space
173 % Play your favorite game of golf amidst the tropical greens on one
174 % of the many championship courses.}
175 %
176 % \iffalse
177 % --------------------------------------------------------------------------- %
178 % \fi
179 %
180 % \section*{Introduction}
181 %
182 % Within the standard \LaTeX\ document classes captions haven't received the
183 % attention they deserve. Simply typeset as an ordinary paragraph there is no
184 % remarkable visual difference from the rest of the text, like here:
185 %
186 % \example*{size=normalsize,margin=0pt}{\shortexampletext}
187 %
188 % There should be possibilities to change this; for example, it would be nice
189 % to make the text of the caption a little bit smaller as the normal
190 % text, add an extra margin, typeset the caption label with the same font
191 % family and shape as your headings etc. Just like this one:
192 %
193 % \example*{size=small,margin=10pt,labelfont=bf,labelsep=endash}{\shortexampletext}
194 %
195 % You can do this easily with this package as there are many ready-to-use
196 % caption formatting options, but you are free to define your very own stuff, too.
197 %
198 % \bigskip
199 %
200 % \INFO\begin{minipage}[t]{\textwidth}
201 % \small
202 % Please note that \thispackage\ is only controlling the look \& feel of the
203 % captions. It does \emph{not} control the placement of the captions.
204 % (But you could do so by using other packages like the \pkg{floatrow}
205 % package\cite{floatrow}.)
206 % \end{minipage}
207 %
208 % \medskip
209 %
210 % \INFO\begin{minipage}[t]{\textwidth}
211 % \small
212 % This documentation is outdated and is currently under revision.
213 % Progress could be tracked here:
214 % \url{https://gitlab.com/axelsommerfeldt/caption/-/commits/doc/caption}
215 % \end{minipage}
216 %
217 % \iffalse
218 % --------------------------------------------------------------------------- %
219 % \fi
220 %
221 % \clearpage
222 % \tableofcontents
223 %
224 % \iffalse
225 % --------------------------------------------------------------------------- %
226 % \fi
227 %
228 % \clearpage
229 % \section{Using this package}
230 % \label{usage}
231 %
232 % Insert
233 % \begin{quote}
234 % |\usepackage|\oarg{options}|{caption}[|\texttt{\filedate}|]|
235 % \end{quote}
236 % into the preamble of your document, i.e.~the part of your document
237 % between |\document|\-|class| and |\begin{doc|\-|u|\-|ment}|.
238 % The options control how your captions will look like; e.g.,
239 % \begin{quote}
240 % |\usepackage[margin=10pt,font=small,labelfont=bf,|\\
241 % | labelsep=endash]{caption}|%
242 % %|[|\texttt{\filedate}|]|
243 % \end{quote}
244 % would result in captions looking like the second one in the introduction.
245 %
246 % \DescribeMacro{\captionsetup}
247 % For a later change of options \thispackage\ provides the command
248 % \begin{quote}
249 % |\captionsetup|\oarg{float type}\marg{options}\quad.
250 % \end{quote}
251 % So
252 % \begin{quote}
253 % |\usepackage[margin=10pt,font=small,labelfont=bf]{caption}|
254 % \end{quote}
255 % and
256 % \begin{quote}
257 % |\usepackage{caption}|\\
258 % |\captionsetup{margin=10pt,font=small,labelfont=bf}|
259 % \end{quote}
260 % are equal in their results.
261 %
262 % It's good to know that |\caption|\-|setup| has an effect on the current
263 % environment only. So if you want to change settings for the
264 % current |figure| or |table| only, just place the |\caption|\-|setup| command
265 % inside the |figure| or |table| right before the |\caption| command.
266 % For example
267 % \begin{quote}
268 % |\begin{figure}|\\
269 % | |\ldots\\
270 % | \captionsetup{singlelinecheck=off}|\\
271 % | \caption{|\ldots|}|\\
272 % |\end{figure}|
273 % \end{quote}
274 % switches the single-line-check off, but only for this |figure|,
275 % so all the other captions remain untouched.
276 %
277 % \begin{Annotation}
278 % For a detailed description of |\caption|\-|setup| see \longref{captionsetup}.
279 % \end{Annotation}
280 %
281 % \iffalse
282 % --------------------------------------------------------------------------- %
283 % \fi
284 %
285 % \clearpage
286 % \section{Options}
287 % \label{options}
288 %
289 % \def\OptionLabel{RaggedRight}
290 % \def\UserDefined{\ldots}
291 %
292 % \iffalse
293 % --------------------------------------------------------------------------- %
294 % \fi
295 %
296 % \subsection{Formatting}
297 % \label{formats}
298 %
299 % \DescribeMacro{format=}
300 % A figure or table caption mainly consists of three parts: the caption label,
301 % which says if this object is a `Figure' or `Table' and what number is
302 % associated with it, the caption text itself, which is normally a short
303 % description of contents, and the caption separator which separates the text
304 % from the label.
305 %
306 % The \textit{caption format} determines how this information will be presented;
307 % it is specified with the option
308 % \begin{quote}
309 % |format=|\meta{format name}\quad,
310 % \end{quote}
311 % having the name of the caption format as its argument.
312 %
313 % There are two standard caption formats:
314 % \begin{Options}{\OptionLabel}
315 % \item[plain]%\NEWdescription{v3.0h}
316 % Typesets the captions as a normal paragraph.
317 %
318 % \item[hang]
319 % Indents the caption text, so it will `hang' under the first line of the text.
320 %
321 % \item[\UserDefined]
322 % Own formats can be defined using |\Declare|\-|Caption|\-|Format|.\LineBreak
323 % \SeeUserDefined
324 % \end{Options}
325 %
326 % \begin{Example}
327 % An example: Specifying the option
328 % \begin{quote}
329 % |format=hang|
330 % \end{quote}
331 % yields captions like this:
332 % \example{format=hang}{\exampletext}
333 % \end{Example}
334 %
335 % \pagebreak[3]
336 % \DescribeMacro{indention=}
337 % For both formats (\texttt{plain} and \texttt{hang}) you can setup an extra
338 % indention starting at the second line of the caption. You do this with the
339 % option
340 % \begin{quote}
341 % |indention=|\meta{amount}\quad.
342 % \end{quote}
343 %
344 % Two examples:
345 %
346 % \begin{Example}
347 % \begin{quote}
348 % |format=plain,indention=.5cm|
349 % \end{quote}
350 % \captionsetup{skip=0pt}
351 % \example{format=plain,indention=.5cm}{\exampletext}
352 % \end{Example}
353 %
354 % \begin{Example}
355 % \begin{quote}
356 % |format=hang,indention=-0.5cm|
357 % \end{quote}
358 % \captionsetup{skip=0pt}
359 % \example{format=hang,indention=-0.5cm}{\exampletext}
360 % \end{Example}
361 %
362 % \bigskip
363 %
364 % \pagebreak[3]
365 % \DescribeMacro{labelformat=}
366 % With the option
367 % \nopagebreak[3]
368 % \begin{quote}
369 % |labelformat=|\meta{label format name}
370 % \end{quote}
371 % \nopagebreak[3]
372 % you specify how the caption label will be typeset.
373 % There are five standard caption label formats:
374 %
375 % \begin{Options}{\OptionLabel}
376 % \item[original]
377 % The caption label will be typeset as specified by the document class,
378 % usually this means the name and the number (like \texttt{simple}).
379 %
380 % Until \version{3.4} of \thispackage\ this label format was called `default'.
381 % Since \version{3.5} it is called `original' and usually is the default label
382 % format, so |label|\-|format=|\-|default| will still select this label format,
383 % unless the default was changed by either a document class or babel language package.
384 %
385 % \item[empty]
386 % The caption label will be empty.
387 % \iffalse
388 % (This option makes sense when used together with other options like
389 % \texttt{labelsep=none}.)
390 % \fi
391 %
392 % \item[simple]
393 % The caption label will be typeset as a name and a number.
394 %
395 % \item[brace]\NEWfeature{v3.1f}
396 % The caption label will be closed with a single (right) brace.
397 %
398 % \item[parens]
399 % The number of the caption label will be typeset in parentheses.
400 %
401 % \item[\UserDefined]
402 % Own label formats can be defined using |\Declare|\-|Caption|\-|Label|\-|Format|.
403 % \SeeUserDefined
404 % \end{Options}
405 %
406 % \begin{Example}
407 % An example: Using the options
408 % \begin{quote}
409 % |format=plain,labelformat=parens,labelsep=quad|
410 % \end{quote}
411 % gives captions like this one:
412 % \example{format=plain,labelformat=parens,labelsep=quad}{\exampletext}
413 % \end{Example}
414 %
415 % \medskip
416 %
417 % \begin{Note*}
418 % Some environments, e.g.~the |algorithm| environment offered by the
419 % \pkg{algorithm2e} package, might react allergic to a change of the
420 % caption label format.
421 % \end{Note*}
422 %
423 % \bigskip
424 %
425 % \pagebreak[3]
426 % \DescribeMacro{labelsep=}
427 % With the option
428 % \begin{quote}
429 % |labelsep=|\meta{label separator name}
430 % \end{quote}
431 % you specify what caption separator will be used.\footnote{%
432 % If the caption label or the caption text is empty,
433 % no separator will be used.}
434 % You can choose one of the following:
435 %
436 % \begin{Options}{\OptionLabel}
437 % \item[none]
438 % There is no caption separator.
439 % \iffalse
440 % (This option makes sense when used together with other options like
441 % \texttt{labelformat=empty}.)
442 % \fi
443 %
444 % \item[colon]
445 % The caption label and text will be separated by a colon and a space.
446 %
447 % \item[period]
448 % The caption label and text will be separated by a period and a space.
449 %
450 % \item[space]
451 % The caption label and text will be separated by a single space.
452 %
453 % \item[quad]
454 % The caption label and text will be separated by a |\quad|.
455 %
456 % \item[newline]
457 % The caption label and text will be separated by a line break (|\\|).
458 % Please note that this separator does not work with all caption
459 % formats (e.g.~|format=|\x|hang|), and you'll get an error message
460 % trying such combination of options.
461 %
462 % \item[endash]\NEWfeature{v3.0h}
463 % The caption label and text will be separated by an en-dash,
464 % surrounded by spaces (\verb*| -- |).
465 %
466 % \item[\UserDefined]
467 % Own separators can be defined using |\Declare|\-|Caption|\-|Label|\-|Sep|\-|a|\-|ra|\-|tor|.
468 % \SeeUserDefined
469 % \end{Options}
470 %
471 % Three examples:
472 % \begin{Example}
473 % \begin{quote}
474 % |format=plain,labelsep=period|
475 % \end{quote}
476 % \captionsetup{skip=0pt}
477 % \example{format=plain,labelsep=period}{\exampletext}
478 % \end{Example}
479 %
480 % \begin{Example}
481 % \begin{quote}
482 % |format=plain,labelsep=newline,singlelinecheck=false|
483 % \end{quote}
484 % \captionsetup{skip=0pt}
485 % \example{format=plain,labelsep=newline,singlelinecheck=false}{\exampletext}
486 % \end{Example}
487 %
488 % \begin{Example}
489 % \begin{quote}
490 % |format=plain,labelsep=endash|
491 % \end{quote}
492 % \captionsetup{skip=0pt}
493 % \example{format=plain,labelsep=endash}{\exampletext}
494 % \end{Example}
495 %
496 % \bigskip
497 %
498 % \pagebreak[3]
499 % \DescribeMacro{textformat=}
500 % \NEWfeature*{v3.1}
501 % With the option
502 % \nopagebreak[3]
503 % \begin{quote}
504 % |textformat=|\meta{text format name}
505 % \end{quote}
506 % \nopagebreak[3]
507 % you specify how the caption text will be typeset.
508 % There are two standard caption text formats:
509 %
510 % \begin{Options}{\OptionLabel}
511 % \item[empty]
512 % The caption text will be suppressed.
513 %
514 % \item[simple]
515 % The caption text will be typeset as it is.
516 %
517 % \item[period]
518 % The caption text will be followed by a period.
519 %
520 % \item[\UserDefined]
521 % Own text formats can be defined using |\Declare|\-|Caption|\-|Text|\-|Format|.
522 % \SeeUserDefined
523 % \end{Options}
524 %
525 % \iffalse
526 % --------------------------------------------------------------------------- %
527 % \fi
528 %
529 % \PageBreak
530 % \subsection{Justification}
531 % \label{justification}
532 %
533 % \DescribeMacro{justification=}
534 % As addition to the caption format you could also specify a
535 % \emph{caption justification}; it is specified with the option
536 % \begin{quote}
537 % |justification=|\meta{justification name}\quad.
538 % \end{quote}
539 %
540 % You can choose one of the following:
541 %
542 % \begin{Options}{\OptionLabel}
543 % \item[justified]
544 % Typesets the caption as a normal paragraph.
545 %
546 % \item[centering]
547 % Each line of the caption will be centered.
548 %
549 % \iffalse
550 % \item[Centering]
551 % \fi
552 %
553 % \item[centerlast]
554 % The last line of each paragraph of the caption text will be centered.
555 %
556 % \item[centerfirst]
557 % Only the first line of the caption will be centered.
558 %
559 % \item[raggedright]
560 % Each line of the caption will be moved to the left margin.
561 %
562 % \iffalse
563 % \item[RaggedRight]
564 % Each line of the caption will be moved to the left margin using
565 % the command |\RaggedRight| from the \pkg{ragged2e} package.
566 % \else
567 % \item[RaggedRight]
568 % Each line of the caption will be moved to the left margin, too.
569 % But this time the command |\RaggedRight| of the \pkg{ragged2e}
570 % package will be used to achieve this.
571 % The main difference to |raggedright| is that the word breaking
572 % algorithm of \TeX\ will work inside captions.\footnote{%
573 % The need for the \pkg{ragged2e} package will be detected at
574 % run-time, therefore you maybe need a second \LaTeX\ run if this
575 % option is used for the first time.}
576 % \fi
577 %
578 % \item[raggedleft]
579 % Each line of the caption will be moved to the right margin.
580 %
581 % \iffalse
582 % \item[RaggedLeft]
583 % Each line of the caption will be moved to the right margin using
584 % the command |\RaggedLeft| from the \pkg{ragged2e} package.
585 % \fi
586 %
587 % \item[\UserDefined]
588 % Own justifications can be defined using |\Declare|\-|Caption|\-|Jus|\-|ti|\-|fi|\-|ca|\-|tion|.
589 % \SeeUserDefined
590 % \end{Options}
591 %
592 % Three examples:
593 % \begin{Example}
594 % \begin{quote}
595 % |format=hang,justification=raggedright|
596 % \end{quote}
597 % \captionsetup{skip=0pt}
598 % \example{format=hang,justification=raggedright}{\exampletext}
599 % \end{Example}
600 %
601 % \begin{Example}
602 % \begin{quote}
603 % |format=hang,justification=centerlast|
604 % \end{quote}
605 % \captionsetup{skip=0pt}
606 % \example{format=hang,justification=centerlast}{\exampletext}
607 % \end{Example}
608 %
609 % \begin{Example}
610 % \begin{quote}
611 % |format=plain,labelsep=newline,justification=centering|
612 % \end{quote}
613 % \captionsetup{skip=0pt}
614 % \example*{format=plain,labelsep=newline,justification=centering}{\exampletext}
615 % \end{Example}
616 %
617 % \smallskip
618 %
619 % \PageBreak
620 % \DescribeMacro{singlelinecheck=}
621 % The standard \LaTeX\ document classes (\cls{article}, \cls{report}, and
622 % \cls{book}) automatically center a caption if it fits in one single line:
623 %
624 % \example*{}{A short caption.}
625 %
626 % \INFO
627 % \Thispackage\ adapts this behavior and therefore usually ignores the
628 % justification \& indention you have set with |justification=| \&
629 % |indention=| in such case.
630 % But you can switch this special treatment of such short captions off
631 % with the option
632 % \begin{quote}
633 % |singlelinecheck=|\meta{bool}\quad.
634 % \end{quote}
635 % Using |false|, |no|, |off| or |0| for \meta{bool} switches the
636 % extra centering off:
637 % \begin{quote}
638 % |singlelinecheck=false|
639 % \end{quote}
640 % Doing so the above short caption would look like
641 %
642 % \begingroup
643 % \captionsetup{type=figure}
644 % \ContinuedFloat
645 % \example*{singlelinecheck=false}{A short caption.}
646 % \endgroup
647 %
648 % You switch the extra centering on again by using |true|, |yes|, |on| or |1|
649 % for \meta{bool}. (The default is on.)
650 %
651 % \iffalse
652 % --------------------------------------------------------------------------- %
653 % \fi
654 %
655 % \subsection{Fonts}
656 % \label{fonts}
657 %
658 % \DescribeMacro{font=}
659 % \DescribeMacro{labelfont=}
660 % \DescribeMacro{textfont=}
661 % There are three font options which affects different parts of the caption:
662 % One affecting the whole caption (|font|), one which only affects the caption
663 % label and separator (|label|\-|font|) and at least one which only affects the
664 % caption text (|text|\-|font|).
665 % You set them up using the options
666 % \begin{quote}\begin{tabular}{@{}r@{}ll}
667 % |font=| & \marg{font options} & ,\\
668 % |labelfont=| & \marg{font options} & , and\\
669 % |textfont=| & \marg{font options} & ,\\
670 % \end{tabular}\end{quote}
671 % where \meta{font options} is a list of comma separated font options.
672 %
673 % And these are the available font options:
674 %
675 % \begin{Options}{stretch=\meta{amount}}
676 % \item[scriptsize] {\scriptsize Very small size}
677 % \item[footnotesize] {\footnotesize The size usually used for footnotes}
678 % \item[small] {\small Small size}
679 % \item[normalsize] {\normalsize Normal size}
680 % \item[large] {\large Large size}
681 % \item[Large] {\Large Even larger size}
682 % \end{Options}
683 % \vspace{0pt}\pagebreak[3]
684 % \begin{Options}{stretch=\meta{amount}}
685 % \item[normalfont] {\normalfont Normal shape \& series \& family}
686 %
687 % \item[up] {\upshape Upright shape}
688 % \item[it] {\itshape Italic shape}
689 % \item[sl] {\slshape Slanted shape}
690 % \item[sc] {\scshape Small Caps shape}
691 %
692 % \item[md] {\mdseries Medium series}
693 % \item[bf] {\bfseries Bold series}
694 %
695 % \item[rm] {\rmfamily Roman family}
696 % \item[sf] {\sffamily Sans Serif family}
697 % \item[tt] {\ttfamily Typewriter family}
698 % \end{Options}
699 % \vspace{0pt}\pagebreak[3]
700 % \begin{Options}{stretch=\meta{amount}}
701 % \item[singlespacing] Single spacing \See{\longref{setspace}}
702 % \item[onehalfspacing] One-and-a-half spacing \See{\longref{setspace}}
703 % \item[doublespacing] Double spacing \See{\longref{setspace}}
704 % \item[stretch=\meta{amount}] |\setstretch|\marg{amount} \See{\longref{setspace}}
705 % \end{Options}
706 % \vspace{0pt}\pagebreak[3]
707 % \begin{Options}{stretch=\meta{amount}}
708 % \item[normalcolor] |\normalcolor|
709 % \item[color=\meta{colour}] |\color|\marg{colour}
710 % {\small(If the \pkg{color} or \pkg{xcolor} package is loaded,
711 % see \longref{declare} for an example)}
712 % \end{Options}
713 % \vspace{0pt}\pagebreak[3]
714 % \begin{Options}{stretch=\meta{amount}}
715 % \item[normal] The combination of the options |normal|\-|color|,
716 % |normal|\-|font|, |normal|\-|size|, and |single|\-|spacing|
717 %
718 % \item[\UserDefined]
719 % Own font options can be defined using |\Declare|\-|Caption|\-|Font|.
720 % \SeeUserDefined
721 % \end{Options}
722 %
723 % If you use only one of these options you can omit the braces;
724 % e.g., the options
725 % |font={small}|
726 % and
727 % |font=small|
728 % will give the same result.
729 %
730 % Three examples:
731 % \begin{Example}
732 % \begin{quote}
733 % |font=it,labelfont=bf|
734 % \end{quote}
735 % \captionsetup{skip=0pt}
736 % \example{font=it,labelfont=bf}{\exampletext}
737 % \end{Example}
738 %
739 % \begin{Example}
740 % \begin{quote}
741 % |labelfont=sc,textfont=it|
742 % \end{quote}
743 % \captionsetup{skip=0pt}
744 % \example{labelfont=sc,textfont=it}{\exampletext}
745 % \end{Example}
746 %
747 % \begin{Example}
748 % \begin{quote}
749 % |font={small,stretch=0.80}|
750 % \end{quote}
751 % \captionsetup{skip=0pt}
752 % \example{font={small,stretch=0.80}}{\exampletext}
753 % \end{Example}
754 %
755 % \medskip
756 %
757 % \pagebreak[3]
758 % \DescribeMacro{font+=}
759 % \DescribeMacro{labelfont+=}
760 % \DescribeMacro{textfont+=}
761 % \NEWfeature*{v3.1}
762 % You can also add font options to the current ones, so for example
763 % \begin{quote}
764 % |\captionsetup{font=small}|\\
765 % |\captionsetup{font+=it}|
766 % \end{quote}
767 % is identical to
768 % \begin{quote}
769 % |\captionsetup{font={small,it}}|
770 % \end{quote}
771 %
772 % \iffalse
773 % --------------------------------------------------------------------------- %
774 % \fi
775 %
776 % \subsection{Margins and further paragraph options}
777 % \label{margins}
778 %
779 % \DescribeMacro{margin=}
780 % \DescribeMacro{width=}
781 % For all captions you can specify \emph{either} an extra margin \emph{or}
782 % a fixed width:~\footnote{Only fixed widths are supported here; if you are
783 % looking for a way to limit the width of the caption to the width of the
784 % figure or table, please take a look at the \pkg{floatrow}\cite{floatrow}
785 % or \pkg{threeparttable}\cite{threeparttable} package.}
786 % \begin{quote}\begin{tabular}{@{}r@{}ll}
787 % |margin=| & \meta{amount} & \emph{--or--}\\
788 % |margin=| & |{|\meta{left amount}|,|\meta{right amount}|}| & \emph{--or--}\\
789 % |width=| & \meta{amount} & \\
790 % \end{tabular}\end{quote}
791 % \NEWfeature{v3.1}
792 % If you specify just one \meta{amount} for the margin, it will be used for
793 % both, the left and right margin, e.g.~|margin=|\x|10pt| is equivalent to
794 % |margin=|\x|{10pt,10pt}|.
795 % In two-side documents the left and right margin will be swapped on even pages.
796 % \DescribeMacro{oneside}
797 % \DescribeMacro{twoside}
798 % To prevent this you can specify the option |oneside| additionally,
799 % e.g.~|\caption|\-|setup{margin=|\x|{0pt,10pt},|\x|oneside}|.\par
800 % But if you are specifying a width, then both, the left and the right margin,
801 % will have the same amount.
802 %
803 % Three examples will illustrating this:
804 % \begin{Example}
805 % \begin{quote}
806 % |margin=10pt|
807 % \end{quote}
808 % \captionsetup{skip=0pt}
809 % \example{margin=10pt}{\exampletext}
810 % \end{Example}
811 %
812 % \begin{Example}
813 % \begin{quote}
814 % |margin={1cm,0cm}|
815 % \end{quote}
816 % \captionsetup{skip=0pt}
817 % \example{margin={1cm,0cm}}{\exampletext}
818 % \end{Example}
819 %
820 % \begin{Example}
821 % \begin{quote}
822 % |width=.75\textwidth|
823 % \end{quote}
824 % \captionsetup{skip=0pt}
825 % \example{width=.75\textwidth}{\exampletext}
826 % \end{Example}
827 %
828 % \begin{Note}
829 % When the caption is placed beside the contents (for example in a |SC|\-|figure|
830 % environment offered by the \pkg{sidecap} package\cite{sidecap}) or the
831 % figure is an in-text figure (for example in a |wrap|\-|figure| environment
832 % offered by the \pkg{wrapfig} package\cite{wrapfig}), the margin setting
833 % will be automatically reset to |0pt| at the very beginning of the environment.
834 % But if you really want to setup an extra margin for these environments, you can
835 % do so by setting this margin either inside the environment itself, of by
836 % specifying a margin for this particular environment,
837 % e.g.~|\caption|\-|setup[SC|\-|figure]{margin=|\x|10pt}|.
838 % \end{Note}
839 %
840 % \begin{Expert}
841 % \DescribeMacro{margin*=}
842 % \NEWfeature*{v3.1}
843 % There is also a starred variant of the |margin=| option, |margin*=|, which only
844 % changes the margin if no width was set.
845 % \end{Expert}
846 %
847 % \begin{Expert}
848 % \DescribeMacro{minmargin=}
849 % \DescribeMacro{maxmargin=}
850 % \NEWfeature*{v3.1}
851 % You can also set a minimum or maximum margin amount. This can be useful for
852 % limiting the margin amount in smaller environments, e.g.~|minipage|s.
853 % For example the \SmF\ document classes limit the margin amount to
854 % |maxmargin=|\x|0.1\linewidth|. (See \longref{SMF})
855 % \end{Expert}
856 %
857 % \medskip
858 %
859 % \pagebreak[3]
860 % \DescribeMacro{parskip=}
861 % This option is useful for captions containing more than one paragraph.
862 % It specifies the extra vertical space inserted between them:
863 % \begin{quote}
864 % |parskip=|\meta{amount}
865 % \end{quote}
866 % One example:
867 % \begin{Example}
868 % \begin{quote}
869 % |margin=10pt,parskip=5pt|
870 % \end{quote}
871 % \captionsetup{skip=0pt}
872 % \example{margin=10pt,parskip=5pt}{%
873 % First paragraph of the caption. This one contains some test, just to
874 % show how these options affect the layout of the caption.\par
875 % Second paragraph of the caption. This one contains some text, too, to
876 % show how these options affect the layout of the caption.}
877 % \end{Example}
878 %
879 % \pagebreak[3]
880 % \DescribeMacro{hangindent=}
881 % The option
882 % \begin{quote}
883 % |hangindent=|\meta{amount}
884 % \end{quote}
885 % is for setting up a hanging indention starting from the second line of each
886 % paragraph. If the caption contains just a single paragraph, using this option
887 % leads to the same result as the option |indention=|\meta{amount} you already
888 % know about.
889 % But if the caption contains multiple paragraphs you will notice the difference:
890 %
891 % \begin{Example}
892 % \begin{quote}
893 % |format=hang,indention=-.5cm|
894 % \end{quote}
895 % \captionsetup{skip=0pt}
896 % \example{format=hang,indention=-.5cm}{%
897 % First paragraph of the caption. This one contains some test, just to
898 % show how these options affect the layout of the caption.\par
899 % Second paragraph of the caption. This one contains some text, too, to
900 % show how these options affect the layout of the caption.}
901 % \end{Example}
902 %
903 % \begin{Example}
904 % \begin{quote}
905 % |format=hang,hangindent=-.5cm|
906 % \end{quote}
907 % \captionsetup{skip=0pt}
908 % \example{format=hang,hangindent=-.5cm}{%
909 % First paragraph of the caption. This one contains some test, just to
910 % show how these options affect the layout of the caption.\par
911 % Second paragraph of the caption. This one contains some text, too, to
912 % show how these options affect the layout of the caption.}
913 % \end{Example}
914 %
915 % \begin{Note}
916 % If your caption contains more than one paragraph, you have
917 % to specify an alternative caption for the list-of-figures using the
918 % optional argument of |\caption| or |\caption|\-|of|, otherwise you will
919 % get an error message.
920 % \end{Note}
921 %
922 % \iffalse
923 % --------------------------------------------------------------------------- %
924 % \fi
925 %
926 % \PageBreak
927 % \subsection{Styles}
928 % \label{style}
929 %
930 % \DescribeMacro{style=}
931 % A suitable combination of caption options is called \emph{caption style}.
932 % You can compare them more or less to page styles which you set up with
933 % |\page|\-|style|;
934 % the caption style provides all settings for a whole caption layout.
935 %
936 % You switch to an already defined caption style with the option
937 % \begin{quote}
938 % |style=|\meta{style name}\quad.
939 % \end{quote}
940 % \Thispackage\ pre-defines two styles: |base| and |default|.
941 %
942 % \NEWfeature{v3.1}
943 % The |base| style puts all options you already know about to values reflecting
944 % the look of the captions when using one of the base \LaTeX\ document classes
945 % \cls{article}, \cls{report}, and \cls{book}.
946 % This means that specifying the option
947 % \begin{quote}
948 % |style=base|
949 % \end{quote}
950 % has the same effect as specifying all these options:
951 % \begin{quote}
952 % |format=plain,labelformat=default,labelsep=colon,|\\
953 % |justification=justified,font={},labelfont={},|\\
954 % |textfont={},margin=0pt,indention=0pt|\\
955 % |parindent=0pt,hangindent=0pt,singlelinecheck=true|
956 % \end{quote}
957 % \begin{Annotation*}
958 % But |justification=centering,indention=0pt| will be set if
959 % the caption fits into a single line.
960 % \end{Annotation*}
961 %
962 % In contrast the |default| style follows the default values, reflecting
963 % the look of the captions given by the document class you actually use.
964 % This style is selected by default and represents these options:
965 % \begin{quote}
966 % |format=default,labelformat=default,labelsep=default,|\\
967 % |justification=default,font=default,labelfont=default,|\\
968 % |textfont=default,margin=0pt,indention=0pt|\\
969 % |parindent=0pt,hangindent=0pt,singlelinecheck=true|
970 % \end{quote}
971 % \begin{Annotation*}
972 % But again |justification=centering,indention=0pt| will be set if
973 % the caption fits into a single line.
974 % \end{Annotation*}
975 %
976 % So if you use one of the base \LaTeX\ document classes \cls{article},
977 % \cls{report}, or \cls{book}, both caption styles, |base| and |default|,
978 % point to (nearly) the same settings.
979 %
980 % \begin{Note}
981 % Own caption styles can be defined using |\Declare|\-|Caption|\-|Style|.\LineBreak
982 % \SeeUserDefined
983 % \end{Note}
984 %
985 % \iffalse
986 % --------------------------------------------------------------------------- %
987 % \fi
988 %
989 % \subsection{Skips}
990 % \label{skips}
991 %
992 % \DescribeMacro{skip=}
993 % The vertical space between the caption and the figure or table contents is
994 % controlled by the option
995 % \begin{quote}
996 % |skip=|\meta{amount}\quad.
997 % \end{quote}
998 % The standard \LaTeX\ document classes \cls{article}, \cls{report} and
999 % \cls{book} preset it to |skip=|\x|10pt|, but other document classes may
1000 % use a different amount.
1001 %
1002 % \bigskip
1003 %
1004 % \pagebreak[3]
1005 % \DescribeMacro{position=}
1006 % The |\caption| command offered by \LaTeX{} has a design flaw:
1007 % The command does not know if it stands on the beginning of the figure or
1008 % table, or at the end. Therefore it does not know where to put the space
1009 % separating the caption from the content of the figure or table.
1010 % While the standard implementation always puts the space above the caption
1011 % in floating environments (and inconsistently below the caption in
1012 % |long|\-|table|s), the implementation offered by this package is more
1013 % flexible:
1014 % By giving the option
1015 % \begin{quote}
1016 % |position=top|\quad or\quad |position=above|
1017 % \end{quote}
1018 % it's assumed that the caption is standing at the \emph{top} of the
1019 % environment and therefore the space setup with |skip=|\x\meta{amount}
1020 % is placed below the caption.
1021 % (Please note that |position=|\x|top| does \emph{NOT} mean that the
1022 % caption is actually placed at the top of the figure or table.
1023 % Instead the caption is usually placed where you place the |\caption|
1024 % command.)
1025 % But with
1026 % \begin{quote}
1027 % |position=bottom|\quad or\quad |position=below|
1028 % \end{quote}
1029 % it's assumed that the caption is standing at the \emph{bottom} of the
1030 % environment and therefore the space is placed above the caption.
1031 % And finally with
1032 % \begin{quote}
1033 % |position=auto|\quad {\small(which is the default setting)}
1034 % \end{quote}
1035 % \thispackage\ tries its best to determine the actual position of
1036 % the caption on its own. Please note that while this is successfully in
1037 % most cases, it could give wrong results under rare circumstances.
1038 %
1039 % \medskip
1040 %
1041 % \pagebreak[3]
1042 % \DescribeMacro{figureposition=}
1043 % \DescribeMacro{tableposition=}
1044 % The |position| option is especially useful when used together with the
1045 % optional argument of the |\caption|\-|setup| command.
1046 % \See{also \longref{captionsetup}}\par
1047 % For example
1048 % \begin{quote}
1049 % |\captionsetup[table]{position=above}|
1050 % \end{quote}
1051 % causes all captions within tables to be treated as captions \emph{above}
1052 % the table (regarding spacing around it).
1053 % Because this is a very common setting, \thispackage\ offers
1054 % the abbreviating options |figure|\-|position=|\x\meta{pos} and
1055 % |table|\-|position=|\x\meta{pos}, e.g.
1056 % \begin{quote}
1057 % |\usepackage[|\ldots|,tableposition=top]{caption}|
1058 % \end{quote}
1059 % is equivalent to
1060 % \begin{quote}
1061 % |\usepackage[|\ldots|]{caption}|\\
1062 % |\captionsetup[table]{position=top}|
1063 % \end{quote}
1064 %
1065 % \medskip
1066 %
1067 % \INFO
1068 % Please note that the options |skip=|, |position=|, |figure|\-|position=|,
1069 % and |table|\-|position=| do not always have an effect.
1070 % Since it's a matter of the document class to supply the environments
1071 % |figure| and |table|, it could use its very own spacing, and could
1072 % decide for itself if the caption will be typeset as ``top'' or ``bottom''
1073 % caption.
1074 % For example the \KOMAScript\ document classes support the |skip=|
1075 % setting, but will always typeset |figure| captions as ``bottom'' captions,
1076 % and |table| captions are dependent on the global option
1077 % |table|\-|captions|\-|above| or |table|\-|captions|\-|below|.
1078 % \See{\longref{KOMA}}
1079 %
1080 % Furthermore some packages control the behavior of the spacing above and
1081 % below the caption for themself, e.g.~the \pkg{float}, the
1082 % \pkg{floatrow}, and the \pkg{supertabular} package.
1083 %
1084 % \bigskip
1085 %
1086 % \begin{Expert*}
1087 % Internally the skip between caption and contents is represented by
1088 % |\above|\-|caption|\-|skip| (which is always set above the caption in
1089 % \LaTeX{}s implementation).
1090 % But there is a second value |\below|\-|caption|\-|skip| (usually set to
1091 % |0pt| by default) which is set below the caption in \LaTeX{}s implementation,
1092 % but on the other side than |\above|\-|caption|\-|skip| by this package.
1093 % So technically speaking, this package swaps the meaning of these two skips
1094 % when |position=|\x|top| is set.
1095 % Please note that there are several packages around which do the same trick
1096 % (like the \pkg{ftcap}, the \pkg{nonfloat}, and the \pkg{topcap}
1097 % package), so the usage of the \pkg{caption} option |position=| is not
1098 % supported if one of these packages will be used, too.
1099 % \end{Expert*}
1100 %
1101 % \iffalse
1102 % --------------------------------------------------------------------------- %
1103 % \fi
1104 %
1105 % \subsection{Lists}
1106 % \label{lists}
1107 %
1108 % \DescribeMacro{list=}
1109 % \NEWfeature*{v3.1}
1110 % The |\caption| command usually places an entry in the List of Figures
1111 % or List of Tables. You can either suppress that individually by giving an
1112 % empty optional argument to |\caption| {\small(see \longref{caption})}, or
1113 % programmatically by saying
1114 % \begin{quote}
1115 % |list=no|\quad(or any other boolean value instead of |no|)\quad.~\footnote{%
1116 % Please note that the \pkg{subfig} package\cite{subfig} is not supporting
1117 % this option, it uses the counters \texttt{lofdepth} \& \texttt{lotdepth} for
1118 % this purpose instead.}
1119 % \end{quote}
1120 %
1121 % \pagebreak[3]
1122 % \DescribeMacro{listformat=}
1123 % \NEWfeature*{v3.1}
1124 % With the option
1125 % \nopagebreak[3]
1126 % \begin{quote}
1127 % |listformat=|\meta{list format name}
1128 % \end{quote}
1129 % \nopagebreak[3]
1130 % you can specify how the |figure| or |table| number will be typeset within
1131 % the List of Figures or List of Tables.
1132 % There are five standard caption list formats:
1133 %
1134 % \begin{Options}{\OptionLabel}
1135 % \item[empty]
1136 % No number will be typeset.
1137 %
1138 % \item[simple]
1139 % The number will be typeset with label prefix.
1140 %
1141 % \item[parens]
1142 % The number will be typeset in parentheses, with label prefix.
1143 %
1144 % \item[subsimple]
1145 % Same as |simple|, but without label prefix. (default)
1146 %
1147 % \item[subparens]
1148 % Same as |parens|, but without label prefix.
1149 %
1150 % \item[\UserDefined]
1151 % Own list formats can be defined using |\Declare|\-|Caption|\-|List|\-|Format|.
1152 % \SeeUserDefined
1153 % \end{Options}
1154 %
1155 % The prefix ($=$|\p@figure| or |\p@table|), which runs ahead of the
1156 % number ($=$|\the|\-|figure| or |\the|\-|table|) in lists (e.g.~List of
1157 % Figure/Table) and references, is usually empty,
1158 % so the list formats |simple| and |subsimple| gives equal results;
1159 % same with |parens| and |subparens|.
1160 % But this can be different for sub-figures or sub-tables listed in the List of
1161 % Figures or List of Tables, or when the label prefix is redefined for a
1162 % different purpose.\footnote{%
1163 % Sub-figures and sub-tables can be typeset using the \pkg{subcaption}
1164 % or \pkg{subfig} package.}
1165 %
1166 % \iffalse
1167 % --------------------------------------------------------------------------- %
1168 % \fi
1169 %
1170 % \subsection{Names}
1171 % \label{names}
1172 %
1173 % \DescribeMacro{name=}
1174 % \NEWfeature*{v3.1}
1175 % The option
1176 % \begin{quote}
1177 % |name=|\meta{name}
1178 % \end{quote}
1179 % changes the name of the \emph{current} environment.
1180 % This could be useful in conjunction with the optional argument of
1181 % |\caption|\-|setup|, e.g.
1182 % \begin{quote}
1183 % |\captionsetup[wrapfigure]{name=Fig.}|
1184 % \end{quote}
1185 % changes the name to ``Fig.'' for all |wrap|\-|figure|s (while all the other
1186 % figure captions will still have ``Figure'' as name).
1187 %
1188 % \iffalse
1189 % --------------------------------------------------------------------------- %
1190 % \fi
1191 %
1192 % \subsection{Types}
1193 % \label{types}
1194 %
1195 % \DescribeMacro{type=}
1196 % The |\caption| command can typeset captions for different types,
1197 % e.g.~|figure| and |table|. If you try to use the |\caption| command outside
1198 % these environments you will get an error message, because it does not know what
1199 % kind of caption do you want to have here. But in such situations you can set
1200 % the caption type manually with
1201 % \begin{quote}
1202 % |type=|\meta{float type}
1203 % \end{quote}
1204 % prior to the usage of the |\caption| command (and other commands like
1205 % |\Continued|\-|Float|, or |\sub|\-|caption|\-|box| offered by the
1206 % \pkg{subcaption} package, or |\sub|\-|float| offered by the
1207 % \pkg{subfig} package\cite{subfig}),
1208 % for example within an non-floating environment like |minipage|:
1209 % \begin{quote}
1210 % |\noindent\begin{minipage}{\textwidth}|\\
1211 % | \captionsetup{type=figure}|\\
1212 % | \subfloat{|\ldots|}|\\
1213 % | |\ldots\\
1214 % | \caption{|\ldots|}|\\
1215 % |\end{minipage}|
1216 % \end{quote}
1217 %
1218 % \begin{Expert}
1219 % There is also a starred variant of this option, |type*=|\meta{float type},
1220 % which behaves different than |type=|\meta{float type} if the
1221 % \pkg{hyperref} package\cite{hyperref} is loaded: While |type=| sets an
1222 % hyperlink anchor (if |hypcap=|\x|true| is set), |type*=| does not.
1223 % (See also \longref{hyperref}\,)
1224 % \end{Expert}
1225 % \begin{Expert}
1226 % \emph{\DefaultNoteText:} Please don't re-define the internal macro |\@captype|
1227 % for yourself, like suggested by some documentations, always use
1228 % |\caption|\-|setup{type=|\x\ldots|}| instead.
1229 % \end{Expert}
1230 %
1231 % \medskip
1232 %
1233 % Own float types can be defined with
1234 % |\Declare|\-|Floating|\-|Environment| offered by the \pkg{newfloat} package,
1235 % |\new|\-|float| offered by the \pkg{float} package\cite{float}, or
1236 % |\Declare|\-|New|\-|Float|\-|Type| offered by the \pkg{floatrow} package\cite{float}.
1237 %
1238 % \medskip
1239 %
1240 % \INFO % \NEWdescription{v3.1}
1241 % Please note that you should use the option |type=| only
1242 % \emph{inside} boxes or environments (like |\par|\-|box| or |mini|\-|page|),
1243 % at best one where no page break could happen between contents and caption.
1244 % Furthermore some visual side-effects (e.g.~mixed-up figure and table settings
1245 % regarding captions) could occur without using a box or environment,
1246 % therefore a warning message will be issued if you try to do so.\footnote{%
1247 % You only get this warning message if you use \eTeX\ as underlying \TeX\ engine.}
1248 %
1249 % \iffalse
1250 % --------------------------------------------------------------------------- %
1251 % \fi
1252 %
1253 % \clearpage
1254 % \section{Commands}
1255 %
1256 % \subsection{Typesetting captions}
1257 % \label{caption}
1258 % \label{captionlistentry}
1259 %
1260 % \DescribeMacro{\caption}
1261 % The command
1262 % \begin{quote}
1263 % |\caption|\oarg{list entry}\marg{heading}
1264 % \end{quote}
1265 % typesets the caption inside a floating environment like |figure| or |table|.
1266 % Well, you already know this, but \thispackage\ offers an extension:
1267 % If you leave the argument \meta{list entry} empty, no entry in the list of
1268 % figures or tables will be made. For example:
1269 % \begin{quote}
1270 % |\caption[]{A figure without list entry.}|
1271 % \end{quote}
1272 %
1273 % \begin{Expert}
1274 % Please remember that the \meta{heading} is a so-called \emph{moving} argument,
1275 % if no \meta{list entry} has been given. But if a \meta{list entry} is given,
1276 % this argument is moving instead.
1277 % ``\emph{Moving} argument'' means that the argument will be written to the
1278 % list-of file, make it appearing in the ``List of Figures'' or
1279 % ``List of Tables'', too.
1280 % \emph{Moving} arguments are not allowed to contain \emph{fragile} commands,
1281 % everything must be \emph{robust}, otherwise the argument could get
1282 % \emph{broken}, resulting in strange errors at the next \LaTeX\ run.
1283 % Some \emph{fragile} commands could be \emph{protected} by a leading |\protect|,
1284 % own definitions could get defined with |\Declare|\-|Robust|\-|Command| instead of
1285 % |\new|\-|command| to make them \emph{robust}.
1286 %
1287 % An example: |\caption{${}^{137}_{\phantom{1}55}$Cs}| will cause errors since
1288 % |\phantom| is \emph{fragile}.
1289 % So we have either have to use the optional argument \meta{list entry}
1290 % (e.g.~|\caption[${}^|\x|{137}_|\x|{55}$|\x|Cs]|\x|{${}^|\x|{137}_|\x|{\phantom{1}55}$|\x|Cs}|)
1291 % or add |\protect| to prevent the |\phantom| command from getting \emph{broken}:
1292 % |\caption{${}^|\x|{137}_|\x|{|\textcolor{blue}{\cs{protect}}|\phantom{1}55}$|\x|Cs}|.
1293 %
1294 % But sometimes even this is not sufficient. The reason behind is the so-called
1295 % single-line-check: It puts the \meta{heading} into a horizontal box to determine
1296 % the width of the caption, and this could cause error messages, too.
1297 % An example:
1298 % |\caption{A| |scheme.| |\[V_{C}| |\sim| |\left| |\{| |\begin{array}{cc}|
1299 % |E_{g}| |&| |\textrm{p-n}| |\\| |e\phi_{B}| |&| |\textrm{M-S}| |\end{array}|
1300 % |\right.| |\]}|.
1301 % Using |\caption[A| |scheme]{|\ldots|}| is not sufficient here, it's still
1302 % leading to errors. (``\texttt{Missing \$ inserted.}'')
1303 % So we have to put a |\caption|\-|setup{single|\-|line|\-|check=|\x|off}|
1304 % just in front of the |\caption| command additionally.
1305 %
1306 % For more information about \emph{moving} arguments and \emph{fragile} \&
1307 % \emph{robust} commands, take a closer look at your \LaTeX\ manual or visit
1308 % \url{http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/teTeX/latex/latex2e-html/fragile.html}.
1309 % \end{Expert}
1310 %
1311 % \medskip
1312 %
1313 % \pagebreak[3]
1314 % \DescribeMacro{\caption*}
1315 % The \pkg{longtable} package defines the command |\caption*| which
1316 % typesets the caption without label and without entry in the list of tables.
1317 % An example:
1318 % \begin{quote}
1319 % |\begin{longtable}{|\ldots|}|\\
1320 % | \caption*{A table}\\|\\
1321 % | |\ldots\\
1322 % |\end{longtable}|
1323 % \end{quote}
1324 % looks like
1325 % \DeleteShortVerb{\|}
1326 % \vskip\intextsep
1327 % \begin{minipage}{\linewidth}
1328 % \captionsetup{type=table,position=t}
1329 % \caption*{A table}
1330 % \centering
1331 % \begin{tabular}{r|rr}
1332 % & x & y \\\hline
1333 % a & 1 & 2 \\
1334 % b & 3 & 4 \\
1335 % \end{tabular}
1336 % \end{minipage}
1337 % \vskip\intextsep
1338 % \MakeShortVerb{\|}
1339 % \Thispackage\ offers this feature, too, so you can use this command now within
1340 % every floating environment like |figure| or |table|, like:
1341 % \begin{quote}
1342 % |\begin{table}|\\
1343 % | \caption*{A table}|\\
1344 % | |\ldots\\
1345 % |\end{table}|
1346 % \end{quote}
1347 %
1348 % \pagebreak[3]
1349 % \DescribeMacro{\captionof}
1350 % \DescribeMacro{\captionof*}
1351 % Sometimes you want to typeset a caption \emph{outside} a floating environment,
1352 % putting a figure within a non-floating |mini|\-|page| for instance.
1353 % For this purpose \thispackage\ offers the command
1354 % \begin{quote}
1355 % |\captionof|\marg{float type}\oarg{list entry}\marg{heading}\quad.
1356 % \end{quote}
1357 % Note that the first argument, the \meta{float type}, is mandatory here, because
1358 % the |\captionof| command needs to know which name to put into the caption label
1359 % (e.g. ``Figure'' or ``Table'') and in which list to put the contents entry.
1360 % An example:
1361 % \begin{quote}
1362 % |\captionof{table}{A table}|
1363 % \end{quote}
1364 % typesets captions like this:
1365 % \begin{Example}
1366 % \captionsetup{position=top}
1367 % \captionof{table}{A table}
1368 % \end{Example}
1369 %
1370 % The star variant |\caption|\-|of*| has the same behavior as the |\caption*|
1371 % command:
1372 % It typesets the caption without label and without entry to the list of figures
1373 % or tables.
1374 %
1375 % \INFO % \NEWdescription{v3.1}
1376 % Since |\caption|\-|of| uses the option |type| internally, the same
1377 % restrictions as for the |type| option apply here, so you should use both
1378 % |\caption|\-|of| and |\caption|\-|of*| only \emph{inside} boxes or
1379 % environments, too.
1380 % \See{\longref{types}}
1381 %
1382 % \bigskip
1383 %
1384 % \pagebreak[3]
1385 % \DescribeMacro{\captionlistentry}
1386 % \NEWfeature*{v3.1}
1387 % Under certain circumstances it could be useful to make a list-of-figure
1388 % (or table) entry on its own.
1389 % This could be achieved with
1390 % \begin{quote}
1391 % |\captionlistentry|\oarg{float type}\marg{list entry}\quad.
1392 % \end{quote}
1393 %
1394 % One example: It's quite easy to have a |long|\-|table| with captions above the
1395 % contents and a single list entry which points to the first page of the table:
1396 % \begin{quote}
1397 % |\begin{longtable}{|\ldots|}|\\
1398 % | \caption{|\ldots|}\\|\\
1399 % |\endfirsthead|\\
1400 % | \caption[]{|\ldots|}\\|\\
1401 % |\endhead|\\
1402 % | |\ldots
1403 % \end{quote}
1404 % But since the \pkg{longtable} package does not offer an
1405 % |\end|\-|first|\-|foot| command, you cannot easily have captions \emph{below}
1406 % the table contents and a single list entry which points to the first page of
1407 % the table.
1408 % Here is were the |\caption|\-|list|\-|entry| command could be used:
1409 % \begin{quote}
1410 % |\begin{longtable}{|\ldots|}|\\
1411 % | \caption[]{|\ldots|}\\|\\
1412 % |\endfoot|\\
1413 % | \captionlistentry{|\ldots|}|\\
1414 % | |\ldots
1415 % \end{quote}
1416 %
1417 % \begin{Annotation*}
1418 % Another example can be found in \longref{examples}.
1419 % \end{Annotation*}
1420 %
1421 % \begin{Expert}
1422 % There is also a starred variant, |\caption|\-|list|\-|entry*|, which does not
1423 % increment the \meta{float type} counter.
1424 % (Note that inside |long|\-|table| environments |\caption|\-|list|\-|entry|
1425 % never increments the |table| counter. See also \longref{longtable}.)
1426 % \end{Expert}
1427 %
1428 % \begin{Expert}
1429 % Please note that \meta{list entry} is a \emph{moving} argument, so everything
1430 % it contains must be \emph{robust}. (See also explanation of |\caption|)
1431 % \end{Expert}
1432 %
1433 % \subsection{Setting options}
1434 % \label{captionsetup}
1435 %
1436 % \DescribeMacro{\captionsetup}
1437 % We already know the |\caption|\-|setup| command (see \longref{usage}),
1438 % but this time we get enlighten about its optional argument
1439 % \meta{float type}.
1440 %
1441 % Remember, the syntax of this command is
1442 % \begin{quote}
1443 % |\captionsetup|\oarg{float type}\marg{options}\quad.
1444 % \end{quote}
1445 % If a \meta{float type} gets specified, all the \meta{options} don't
1446 % change anything at this time. Instead they only get marked for a later use,
1447 % when a caption inside of a floating environment of the particular type
1448 % \meta{float type} gets typeset.
1449 % For example
1450 % \begin{quote}
1451 % |\captionsetup[figure]|\marg{options}
1452 % \end{quote}
1453 % forces captions within a |figure| environment to use the given \meta{options}.
1454 %
1455 % Here comes an example to illustrate this:
1456 % \begin{quote}
1457 % |\captionsetup{font=small}|\\
1458 % |\captionsetup[figure]{labelfont=bf,textfont=it}|
1459 % \end{quote}
1460 % gives captions like this:
1461 % \begin{Example}
1462 % \captionsetup{font=small}
1463 % \captionsetup[figure]{labelfont=bf,textfont=it}
1464 % \begingroup
1465 % \captionof{figure}{A figure}
1466 % \endgroup
1467 % \captionsetup{position=top}
1468 % \begingroup
1469 % \captionof{table}{A table}
1470 % \endgroup
1471 % \end{Example}
1472 % As you see the command |\caption|\-|setup[figure]{|\ldots|}| only changes
1473 % the look of the |figure| caption labels, not touching the other ones.
1474 %
1475 % As \meta{float type} you can usually give one of these two only:
1476 % |figure| or |table|.
1477 % But as we will see later some \LaTeX\ packages (like the \pkg{floatrow},
1478 % \pkg{longtable}, and \pkg{sidecap} package for example) and also
1479 % this package offer additional environments with captions and these two
1480 % commands can also be used with them.
1481 % \See{\longref{declare} and \longref{packages}}
1482 %
1483 % \begin{Expert}
1484 % \NEWfeature{v3.1}
1485 % There is also a starred variant of |\caption|\-|setup|:
1486 % \begin{quote}
1487 % |\captionsetup*|\oarg{float type}\marg{options}
1488 % \end{quote}
1489 % While the non-starred variant can give you warnings---for example if the
1490 % \meta{options} are actually not used throughout the document
1491 % (e.g.~a |\caption|\-|setup[table]{font=|\x|sf}| without a |table|)---the
1492 % starred variant will not.
1493 % \iffalse
1494 % This can get quite useful when setting generic options which are independent
1495 % of a specific document.
1496 % \fi
1497 % \end{Expert}
1498 %
1499 % \medskip
1500 %
1501 % \pagebreak[3]
1502 % \DescribeMacro{\clearcaptionsetup}
1503 % If you want to get rid of these parameters marked for an automatic use within
1504 % a particular environment you can use the command
1505 % \begin{quote}
1506 % |\clearcaptionsetup|\oarg{option}\marg{float type}\quad.
1507 % \end{quote}
1508 %
1509 % For example |\clearcaptionsetup{figure}| would clear all the extra handling
1510 % for figures in the example above:
1511 % \begin{quote}
1512 % |\captionsetup{font=small}|\\
1513 % |\captionsetup[figure]{labelfont=bf,textfont=it}|\\
1514 % \ldots\\
1515 % | \caption{A figure}|\\
1516 % \ldots\\
1517 % |\clearcaptionsetup{figure}|\\
1518 % \ldots\\
1519 % | \caption{A figure}|\\
1520 % \ldots
1521 % \end{quote}
1522 % \begin{Example}
1523 % \captionsetup{font=small}
1524 % \captionsetup[figure]{labelfont=bf,textfont=it}
1525 % \begingroup
1526 % \captionof{figure}{A figure}
1527 % \endgroup
1528 % \captionsetup{position=top}
1529 % \clearcaptionsetup{figure}
1530 % \begingroup
1531 % \captionof{figure}{A figure}
1532 % \endgroup
1533 % \end{Example}
1534 %
1535 % \pagebreak[3]
1536 % \NEWfeature{v3.1}
1537 % If an optional argument \meta{option} is given, only the settings regarding
1538 % this particular \meta{option} are cleared.\footnote{You can only specify
1539 % \emph{one} option here, not a list of options.
1540 % If you want to clean more than one option, you need to use more than one
1541 % \cs{clear}\-\texttt{caption}\-\texttt{setup}.}
1542 % While the example above not only clears the options
1543 % |labelfont=bf,|\x|textfont=it|
1544 % for figures (but all options for figures instead),
1545 % this one would only clear the |labelfont=bf| setting, leaving all other
1546 % settings for figures intact:
1547 % \begin{quote}
1548 % |\captionsetup{font=small}|\\
1549 % |\captionsetup[figure]{labelfont=bf,textfont=it}|\\
1550 % \ldots\\
1551 % | \caption{A figure}|\\
1552 % \ldots\\
1553 % |\clearcaptionsetup[labelfont]{figure}|\\
1554 % \ldots\\
1555 % | \caption{A figure}|\\
1556 % \ldots
1557 % \end{quote}
1558 % \begin{Example}
1559 % \captionsetup{font=small}
1560 % \captionsetup[figure]{labelfont=bf,textfont=it}
1561 % \begingroup
1562 % \captionof{figure}{A figure}
1563 % \endgroup
1564 % \captionsetup{position=top}
1565 % \clearcaptionsetup[labelfont]{figure}
1566 % \begingroup
1567 % \captionof{figure}{A figure}
1568 % \endgroup
1569 % \end{Example}
1570 % \begin{Expert}
1571 % Analogous to |\caption|\-|setup*| there is also a starred form
1572 % |\clear|\-|caption|\-|setup*| which suppresses warnings if the given
1573 % \meta{option} was not setup for the specified \meta{float type}.
1574 % \end{Expert}
1575 %
1576 % \medskip
1577 %
1578 % \pagebreak[3]
1579 % \DescribeMacro{\showcaptionsetup}
1580 % For debugging purposes the command
1581 % \nopagebreak[3]
1582 % \begin{quote}
1583 % |\showcaptionsetup|\marg{float type}
1584 % \end{quote}
1585 % \nopagebreak[3]
1586 % is offered. It generates a log file entry, showing the given options
1587 % for the specified \meta{float type}. For example
1588 % \begin{quote}
1589 % |\captionsetup[figure]{labelfont=bf,textfont=it}|\\
1590 % |\showcaptionsetup{figure}|
1591 % \end{quote}
1592 % gives the info:
1593 % \begin{quote}\small
1594 % |Caption Info: Option list on `figure'|\\
1595 % |Caption Data: {labelfont=bf,textfont=it} on input line 5.|
1596 % \end{quote}
1597 %
1598 % \pagebreak[3]
1599 % \subsection{Continued floats}
1600 % \label{ContinuedFloat}
1601 %
1602 % \DescribeMacro{\ContinuedFloat}
1603 % Sometimes you want to split figures or tables without giving them
1604 % their own reference number. This is what the command
1605 % \begin{quote}
1606 % |\ContinuedFloat|
1607 % \end{quote}
1608 % is for; it should be used as first command inside the floating environment.
1609 % It prevents the incrementation of the relevant counter (usually done by
1610 % |\caption|), so a figure or table containing a |\Continued|\-|Float| inside
1611 % gets the same reference number as the figure or table before.
1612 % An example:
1613 % \begin{quote}
1614 % |\begin{table}|\\
1615 % | \caption{A table}|\\
1616 % | |\ldots\\
1617 % |\end{table}|\\
1618 % \ldots\\
1619 % |\begin{table}\ContinuedFloat|\\
1620 % | \caption{A table (cont.)}|\\
1621 % | |\ldots\\
1622 % |\end{table}|
1623 % \end{quote}
1624 % gives the following result:
1625 % \begin{Example}
1626 % \captionsetup{type=table,position=b,skip=0pt}
1627 % \caption{A table}
1628 % \centerline{\ldots}
1629 % \end{Example}
1630 % \begin{Example}
1631 % \captionsetup{type=table,position=b,skip=0pt}
1632 % \ContinuedFloat
1633 % \caption{A table (cont.)}
1634 % \centerline{\ldots}
1635 % \end{Example}
1636 %
1637 % \bigskip
1638 %
1639 % \NEWfeature{v3.1}
1640 % Furthermore the |\Continued|\-|Float| command executes options associated with
1641 % the type name ``|Continued|\-|Float|''. For example this can be used to switch
1642 % to a different label format for continued figures or tables, as shown here:
1643 % \begin{quote}
1644 % |\DeclareCaptionLabelFormat{continued}{Continued #1~#2}|\\
1645 % |\captionsetup[ContinuedFloat]{labelformat=continued}|\\
1646 % \ldots\\
1647 % |\begin{table}\ContinuedFloat|\\
1648 % | \caption{A table}|\\
1649 % | |\ldots\\
1650 % |\end{table}|
1651 % \end{quote}
1652 % \begin{Example}
1653 % \captionsetup{type=table,position=b,skip=0pt}
1654 % \captionsetup[ContinuedFloat]{labelformat=continued1}
1655 % \ContinuedFloat
1656 % \caption{A table}\label{continued1}
1657 % \centerline{\ldots}
1658 % \end{Example}
1659 % \smallskip
1660 % \See{\longref{declare} for an explanation of
1661 % \cs{Declare}\-\texttt{Caption}\-\texttt{Label}\-\texttt{Format}.}
1662 %
1663 % \medskip
1664 %
1665 % There is also a \LaTeX\ counter called |Continued|\-|Float| which could be
1666 % used for own purposes.
1667 % For ordinary (floating) environments it's set to zero, to one for the first
1668 % continued float, to two inside the second one, and so on.
1669 % So every |\Continued|\-|Float| increments this counter and a floating
1670 % environment without |\Continued|\-|Float| command resets this counter to zero.
1671 % An example:
1672 % \begin{quote}
1673 % |\DeclareCaptionLabelFormat{cont}{#1~#2\alph{ContinuedFloat}}|\\
1674 % |\captionsetup[ContinuedFloat]{labelformat=cont}|\\
1675 % \ldots\\
1676 % |\begin{table}\ContinuedFloat|\\
1677 % | \caption{A table}|\\
1678 % | |\ldots\\
1679 % |\end{table}|
1680 % \end{quote}
1681 % \begin{Example}
1682 % \captionsetup{type=table,position=b,skip=0pt}
1683 % \captionsetup[ContinuedFloat]{labelformat=continued2}
1684 % \ContinuedFloat
1685 % \caption{A table}\label{continued2}
1686 % \centerline{\ldots}
1687 % \end{Example}
1688 % \medskip
1689 % A reference to this table would still result in the output
1690 % ``\autoref{continued2}'' since only the caption label format was changed.
1691 % If you would like to use the |Continued|\-|Float| counter for the references,
1692 % too, you could redefine the command |\the|\-|Continued|\-|Float| instead,
1693 % which will be appended to the figure or table counter automatically in
1694 % continued floats and is preset to be empty.
1695 % \begin{quote}
1696 % |\renewcommand\theContinuedFloat{\alph{ContinuedFloat}}|\\
1697 % \ldots\\
1698 % |\begin{table}\ContinuedFloat|\\
1699 % | \caption{A table}|\\
1700 % | |\ldots\\
1701 % |\end{table}|
1702 % \end{quote}
1703 % \begin{Example}
1704 % \captionsetup{type=table,position=b,skip=0pt}
1705 % \renewcommand\theContinuedFloat{\alph{ContinuedFloat}}
1706 % \ContinuedFloat
1707 % \caption{A table}\label{continued3}
1708 % \centerline{\ldots}
1709 % \end{Example}
1710 % \medskip
1711 % A reference to that table would result in the output ``\autoref{continued3}''.
1712 %
1713 % \pagebreak[3]
1714 % \DescribeMacro{\ContinuedFloat*}
1715 % Suppose you want to start the first figure or table of such a series with a
1716 % kind of ``Figure 7a'' and not with ``Figure 7'' (and the second one with
1717 % ``Figure 7b'' instead of ``Figure 7a'').
1718 % This is possible, too, by using the starred variant |\Continued|\-|Float*|
1719 % which---just like |\Continued|\-|Float|---executes options associated with the
1720 % type name ``|Continued|\-|Float|'' and increments the \LaTeX\ counter
1721 % |Continued|\-|Float|, \emph{but} marks the first figure or table of a series
1722 % instead:
1723 % \begin{quote}
1724 % |\renewcommand\theContinuedFloat{\alph{ContinuedFloat}}|\\
1725 % \ldots\\
1726 % |\begin{figure}\ContinuedFloat*|\\
1727 % | |\ldots\\
1728 % | \caption{First figure of a series}|\\
1729 % |\end{figure}|\\
1730 % \ldots\\
1731 % |\begin{figure}\ContinuedFloat|\\
1732 % | |\ldots\\
1733 % | \caption{Second figure of a series}|\\
1734 % |\end{figure}|\\
1735 % \ldots\\
1736 % |\begin{figure}\ContinuedFloat|\\
1737 % | |\ldots\\
1738 % | \caption{Third figure of a series}|\\
1739 % |\end{figure}|
1740 % \end{quote}
1741 % \begin{Example}
1742 % \captionsetup{type=figure,position=b,skip=0pt}
1743 % \renewcommand\theContinuedFloat{\alph{ContinuedFloat}}
1744 % \begingroup
1745 % \ContinuedFloat*
1746 % \centerline{\ldots}
1747 % \caption{First figure of a series}
1748 % \endgroup
1749 % \begingroup
1750 % \ContinuedFloat
1751 % \centerline{\ldots}
1752 % \caption{Second figure of a series}
1753 % \endgroup
1754 % \begingroup
1755 % \ContinuedFloat
1756 % \centerline{\ldots}
1757 % \caption{Third figure of a series}
1758 % \endgroup
1759 % \end{Example}
1760 %
1761 % \begin{Note}
1762 % Unfortunately \cs{ContinuedFloat*} is not available if the
1763 % \pkg{subfig} package\cite{subfig} is loaded.
1764 % \end{Note}
1765 %
1766 % \pagebreak[3]
1767 % \subsubsection*{A note about longtables}
1768 % If you want to have a different caption label in |long|\-|table|s (offered
1769 % by the \pkg{longtable} package\cite{longtable}) after a page break,
1770 % this can \emph{not} be archived by using |\Continued|\-|Float|,
1771 % but instead you could write something like:
1772 % \begin{quote}
1773 % |\DeclareCaptionLabelFormat{continued}{Continued #1~#2}|\\
1774 % \ldots\\
1775 % |\begin{longtable}{|\ldots|}|\\
1776 % | \caption{A longtable}\\|\\
1777 % |\endfirsthead|\\
1778 % | \captionsetup{labelformat=continued}|\\
1779 % | \caption[]{A longtable}\\|\\
1780 % |\endhead|\\
1781 % | |\ldots\\
1782 % |\end{longtable}|
1783 % \end{quote}
1784 %
1785 % \iffalse
1786 % --------------------------------------------------------------------------- %
1787 % \fi
1788 %
1789 % \clearpage
1790 % \section{Own enhancements}
1791 % \label{declare}
1792 %
1793 % A family of commands is provided to allow users to define their own formats
1794 % etc.
1795 % This enables information on separators, justification, fonts, and styles to
1796 % be associated with a name and kept in one place.
1797 % (These commands need to appear in the document preamble,
1798 % this is the part between |\document|\-|class| and |\begin{document}|.)
1799 %
1800 % \pagebreak[3]
1801 % \DescribeMacro{\DeclareCaption-\\Format}
1802 % You can define your own caption formats using the command
1803 % \begin{quote}
1804 % |\DeclareCaptionFormat|\marg{name}\marg{code using \#1, \#2 and \#3}\mbox{\quad.}
1805 % \end{quote}
1806 % At usage the system replaces \#1 with the caption label, \#2 with the
1807 % separator and \#3 with the text. So the standard format |plain| is
1808 % pre-defined by \thispackage\ as
1809 % \begin{quote}
1810 % |\DeclareCaptionFormat{plain}{#1#2#3\par}|\quad.
1811 % \end{quote}
1812 % \begin{Expert}
1813 % There is also a starred variant, |\Declare|\-|Caption|\-|Format*|,
1814 % which causes the code being typeset in \TeX s vertical (instead of
1815 % horizontal) mode, but does not support the |indention=| option.
1816 % \end{Expert}
1817 %
1818 % \pagebreak[3]
1819 % \DescribeMacro{\DeclareCaption-\\LabelFormat}
1820 % Likewise you can define your own caption label formats:
1821 % \begin{quote}
1822 % |\DeclareCaptionLabelFormat|\marg{name}\marg{code using \#1 and \#2}
1823 % \end{quote}
1824 % At usage \#1 gets replaced with the name (e.g. ``figure'') and \#2
1825 % gets replaced with the reference number (e.g. ``12'').
1826 % An example:
1827 % \begin{quote}
1828 % |\DeclareCaptionLabelFormat{bf-parens}{(\textbf{#2})}|\\
1829 % |\captionsetup{labelformat=bf-parens,labelsep=quad}|
1830 % \end{quote}
1831 % \example*{labelformat=bf-parens,labelsep=quad}{\exampletext}
1832 %
1833 % \pagebreak[3]
1834 % \DescribeMacro{\bothIfFirst}
1835 % \DescribeMacro{\bothIfSecond}
1836 % If you define your own caption label formats and use the
1837 % \pkg{subcaption} or \pkg{subfig}\cite{subfig} package,
1838 % you should take care of empty caption label names.
1839 % For this purpose the commands
1840 % \begin{quote}
1841 % |\bothIfFirst|\marg{first arg}\marg{second arg}\quad and\\
1842 % |\bothIfSecond|\marg{first arg}\marg{second arg}
1843 % \end{quote}
1844 % are offered. |\bothIfFirst| tests if the first argument exists (means: is
1845 % not empty), |\bothIfSecond| tests if the second argument exists. If yes,
1846 % both arguments get typeset, otherwise none of them.
1847 %
1848 % \smallskip
1849 %
1850 % \pagebreak[3]
1851 % For example the standard label format |simple| is \emph{not} defined as
1852 % \begin{quote}
1853 % |\DeclareCaptionLabelFormat{simple}{#1~#2}|\mbox{\quad,}
1854 % \end{quote}
1855 % because this could cause an extra space if \#1 is empty. Instead |simple|
1856 % is defined as
1857 % \begin{quote}
1858 % |\DeclareCaptionLabelFormat{simple}%|\\
1859 % | {\bothIfFirst{#1}{~}#2}|\mbox{\quad,}
1860 % \end{quote}
1861 % causing the space to appear only if the label name is present.
1862 %
1863 % \smallskip
1864 %
1865 % \pagebreak[3]
1866 % \DescribeMacro{\DeclareCaption-\\TextFormat}
1867 % \NEWfeature*{v3.1}
1868 % Likewise you can define your own caption text formats:
1869 % \begin{quote}
1870 % |\DeclareCaptionTextFormat|\marg{name}\marg{code using \#1}
1871 % \end{quote}
1872 % At usage \#1 gets replaced with the caption text.
1873 %
1874 % \bigskip
1875 %
1876 % \pagebreak[3]
1877 % \DescribeMacro{\DeclareCaption-\\LabelSeparator}
1878 % You can define your own caption label separators with
1879 % \begin{quote}
1880 % |\DeclareCaptionLabelSeparator|\marg{name}\marg{code}\mbox{\quad.}
1881 % \end{quote}
1882 % Again an easy example taken from \thispackage\ itself:
1883 % \begin{quote}
1884 % |\DeclareCaptionLabelSeparator{colon}{: }|
1885 % \end{quote}
1886 % \begin{Expert}
1887 % There is also a starred variant, |\Declare|\-|Caption|\-|Label|\-|Separator*|,
1888 % which causes the code being typeset without using the |label|\-|font=| setting.
1889 % So for example the label separators |quad|, |new|\-|line|, and |en|\-|dash|
1890 % are defined in this way.
1891 % \end{Expert}
1892 %
1893 % \bigskip
1894 %
1895 % \pagebreak[3]
1896 % \DescribeMacro{\DeclareCaption-\\Justification}
1897 % You can define your own caption justifications with
1898 % \begin{quote}
1899 % |\DeclareCaptionJustification|\marg{name}\marg{code}\mbox{\quad.}
1900 % \end{quote}
1901 % The \meta{code} simply gets typeset just before the caption.
1902 % E.g.~using the justification |raggedright|, which is defined as
1903 % \begin{quote}
1904 % |\DeclareCaptionJustification{raggedright}{\raggedright}|\mbox{\quad,}
1905 % \end{quote}
1906 % typesets captions with all lines moved to the left margin.
1907 %
1908 % \bigskip
1909 %
1910 % \pagebreak[3]
1911 % \DescribeMacro{\DeclareCaption-\\Font}
1912 % You can define your own caption fonts with
1913 % \begin{quote}
1914 % |\DeclareCaptionFont|\marg{name}\marg{code}\quad.
1915 % \end{quote}
1916 % For example this package defines the options |small| and |bf| as
1917 % \begin{quote}
1918 % |\DeclareCaptionFont{small}{\small}|\quad and\\
1919 % |\DeclareCaptionFont{bf}{\bfseries}|\quad.
1920 % \end{quote}
1921 % \iffalse
1922 % The line spacing could be customized using the \pkg{setspace} package,
1923 % for example:%\NEWdescription{v3.0h}
1924 % \begin{quote}
1925 % |\usepackage{setspace}|\\
1926 % |\DeclareCaptionFont{singlespacing}{\setstretch{1}}|~\footnote{%
1927 % \emph{\DefaultNoteText:} Using \cs{singlespacing} does not work here since
1928 % it contains a \cs{vskip} command.}\\
1929 % |\DeclareCaptionFont{onehalfspacing}{\onehalfspacing}|\\
1930 % |\DeclareCaptionFont{doublespacing}{\doublespacing}|\\
1931 % |\captionsetup{font={onehalfspacing,small},labelfont=bf}|
1932 % \end{quote}
1933 % \example{font={onehalfspacing,small},labelfont=bf,singlelinecheck=off}{\exampletext}
1934 % \fi
1935 % An example which brings color into life:
1936 % \begin{quote}
1937 % |\usepackage{color}|\\
1938 % |\DeclareCaptionFont{red}{\color{red}}|\\
1939 % |\DeclareCaptionFont{green}{\color{green}}|\\
1940 % |\DeclareCaptionFont{blue}{\color{blue}}|\\
1941 % |\captionsetup{labelfont={blue,bf},textfont=green}|
1942 % \end{quote}
1943 % \example*{labelfont={color=blue,bf},textfont={color=green},singlelinecheck=off}{\exampletext}
1944 % But since \thispackage\ already includes the tricky definition
1945 % \begin{quote}
1946 % |\DeclareCaptionFont{color}{\color{#1}}|
1947 % \end{quote}
1948 % you can get the same result simply with
1949 % \begin{quote}
1950 % |\usepackage{color}|\\
1951 % |\captionsetup{labelfont={color=blue,bf},|\\
1952 % | textfont={color=green}}|\quad.
1953 % \end{quote}
1954 %
1955 % \medskip
1956 %
1957 % \pagebreak[3]
1958 % \DescribeMacro{\DeclareCaption-\\Style}
1959 % You can define your own caption styles with
1960 % \begin{quote}
1961 % |\DeclareCaptionStyle|\marg{name}\oarg{additional options}\marg{options}\mbox{\quad.}
1962 % \end{quote}
1963 % Remember, caption styles are just a collection of suitable options, saved
1964 % under a given name. You can wake up these options at any time with the
1965 % option |style=|\meta{style name}.
1966 %
1967 % All caption styles are based on the |base| set of options. (See \longref{style}
1968 % for a complete list.) So you only need to specify options which are different
1969 % to them.
1970 %
1971 % If you specify \meta{additional options} they get used in addition when
1972 % the caption fits into a single line and this check was not disabled with
1973 % the option |single|\-|line|\-|check=off|.
1974 %
1975 % Again a very easy example taken from the core of this package: The
1976 % caption style |base| is pre-defined as
1977 % \begin{quote}
1978 % |\DeclareCaptionStyle{base}%|\\
1979 % | [justification=centering,indention=0pt]{}|\quad.
1980 % \end{quote}
1981 %
1982 % Something more exciting:
1983 % \begin{quote}
1984 % |\DeclareCaptionStyle{mystyle}%|\\
1985 % | [margin=5mm,justification=centering]%|\\
1986 % | {font=footnotesize,labelfont=sc,margin={10mm,0mm}}|\\
1987 % |\captionsetup{style=mystyle}|
1988 % \end{quote}
1989 % gives you caption like these ones:
1990 % \begin{Example}
1991 % \captionsetup{type=figure,style=mystyle,position=b}
1992 % \caption{A short caption.}
1993 % \caption{A long long long long long long long long long
1994 % long long long long long long long long long
1995 % long long long long long long long long long caption.}
1996 % \end{Example}
1997 %
1998 % \bigskip
1999 %
2000 % \pagebreak[3]
2001 % \DescribeMacro{\DeclareCaption-\\ListFormat}
2002 % \NEWfeature*{v3.1}
2003 % You can define your own caption list formats with
2004 % \begin{quote}
2005 % |\DeclareCaptionListFormat|\marg{name}\marg{code using \#1 and \#2}\mbox{\quad.}
2006 % \end{quote}
2007 % At usage \#1 gets replaced with the label prefix (e.g.~|\p@figure|),
2008 % and \#2 gets replaced with the reference number (e.g.~|\thefigure|).
2009 %
2010 % \iffalse
2011 % --------------------------------------------------------------------------- %
2012 % \fi
2013 %
2014 % \subsection{Further examples}
2015 % \label{examples}
2016 %
2017 % \subsubsection*{Example 1}
2018 %
2019 % If you would like to have a line break between caption label and text
2020 % you could define it this way:
2021 % \begin{quote}
2022 % |\DeclareCaptionFormat{myformat}{#1#2\\#3}|
2023 % \end{quote}
2024 % If you select this format with |\caption|\-|setup{format=|\x|myformat}|
2025 % you get captions like this:
2026 % \example{format=myformat1,labelfont=bf}{\exampletext}
2027 % You could even use an indention with this caption format:
2028 % \begin{quote}
2029 % |\captionsetup{format=myformat,indention=1cm}|
2030 % \end{quote}
2031 % This would look like this:
2032 % \example{format=myformat1,indention=1cm,labelfont=bf}{\exampletext}
2033 % Instead, you would like to have an indention only of the first line of
2034 % the caption text? No problem, e.g.
2035 % \begin{quote}
2036 % |\newlength\myindention|\\
2037 % |\DeclareCaptionFormat{myformat}%|\\
2038 % | {#1#2\\\hspace*{\myindention}#3}|\\
2039 % \ldots\\
2040 % |\setlength\myindention{1cm}|\\
2041 % |\captionsetup{format=myformat}|
2042 % \end{quote}
2043 % would give you captions like
2044 % \example{format=myformat2,myindention=1cm,labelfont=bf}{\exampletext}
2045 % But you want to have an caption option for this indention, so you can use
2046 % it for example with
2047 % |\caption|\-|setup|\x|[figure]|\x|{my|\-|indention=|\x\ldots|}|?
2048 % This could be done, too:
2049 % \begin{quote}
2050 % |\newlength\myindention|\\
2051 % |\DeclareCaptionOption{myindention}%|\\
2052 % | {\setlength\myindention{#1}}|\\
2053 % |\DeclareCaptionFormat{myformat}%|\\
2054 % | {#1#2\\\hspace*{\myindention} #3}|\\
2055 % \ldots\\
2056 % |\captionsetup{format=myformat,myindention=1cm}|
2057 % \end{quote}
2058 % would give the same result as the example above.
2059 %
2060 % \subsubsection*{Example 2}
2061 %
2062 % You want captions to look like this:
2063 % \example{format=reverse,labelformat=fullparens,labelsep=fill,labelfont=it}{\exampletext}
2064 %
2065 % \pagebreak[2]
2066 % You could do it this way:
2067 % \nopagebreak[3]
2068 % \begin{quote}
2069 % |\DeclareCaptionFormat{reverse}{#3#2#1}|\\
2070 % |\DeclareCaptionLabelFormat{fullparens}%|\\
2071 % | {(\bothIfFirst{#1}{~}#2)}|\\
2072 % |\DeclareCaptionLabelSeparator{fill}{\hfill}|\\
2073 % |\captionsetup{format=reverse,labelformat=fullparens,|\\
2074 % | labelsep=fill,font=small,labelfont=it}|
2075 % \end{quote}
2076 %
2077 % \subsubsection*{Example 3}
2078 %
2079 % The caption text should go into the left margin? A possible solution would be:
2080 % \begin{quote}
2081 % |\DeclareCaptionFormat{llap}{\llap{#1#2}#3\par}|\\
2082 % |\captionsetup{format=llap,labelsep=quad,singlelinecheck=no}|
2083 % \end{quote}
2084 % As a result you would get captions like this:
2085 % \example{format=llap,labelsep=quad,singlelinecheck=no,margin=0pt}{\exampletext}
2086 %
2087 % \medskip
2088 %
2089 % If the indention into the margin shall be fixed, you could use a combination
2090 % of |\llap| and |\makebox|, for example:
2091 % \begin{quote}
2092 % |\DeclareCaptionFormat{llapx}%|\\
2093 % | {\llap{\makebox[5em][l]{#1}}#3\par}|\\
2094 % |\captionsetup{format=llapx,singlelinecheck=off}|
2095 % \end{quote}
2096 % \example{format=llapx,singlelinecheck=off,skip=0pt,margin=0pt}{\exampletext}
2097 %
2098 % \subsubsection*{Example 4}
2099 %
2100 % This example puts a figure aside a table, but uses only one common caption for both.
2101 % This will be achieved by a combination of
2102 % |\Declare|\-|Caption|\-|Label|\-|Format| and |\caption|\-|list|\-|entry|:
2103 % \begin{quote}
2104 % |\DeclareCaptionLabelFormat{andtable}%|\\
2105 % | {#1~#2 \& \tablename~\thetable}|\\
2106 % \ldots\\
2107 % |\begin{figure}|\\
2108 % | \centering|\\
2109 % | \includegraphics{|\ldots|}%|\\
2110 % | \qquad|\\
2111 % | \begin{tabular}[b]{\ldots}|\\
2112 % | |\ldots\\
2113 % | \end{tabular}|\\
2114 % | \captionlistentry[table]{|\ldots|}|\\
2115 % | \captionsetup{labelformat=andtable}|\\
2116 % | \caption{|\ldots|}|\\
2117 % |\end{figure}|
2118 % \end{quote}
2119 % \DeleteShortVerb{\|}%
2120 % \noindent\begin{minipage}{\linewidth}
2121 % \captionsetup{type=figure}
2122 % \centering
2123 % \includegraphics[width=30pt]{cat}%
2124 % \qquad
2125 % \begin{tabular}[b]{r|rr}
2126 % & x & y \\\hline
2127 % a & 1 & 2 \\
2128 % b & 3 & 4 \\
2129 % \end{tabular}
2130 % \captionlistentry[table]{A figure and a table with a common caption}
2131 % \captionsetup{labelformat=andtable}
2132 % \caption{A figure and a table with a common caption~\footnotemark}
2133 % \end{minipage}
2134 % \footnotetext{The picture was taken with permission from the
2135 % \LaTeX\ Companion\cite{TLC2} examples.}
2136 % \MakeShortVerb{\|}
2137 %
2138 % (Please remember that |\caption|\-|list|\-|entry| increments the figure
2139 % or table counter.)
2140 %
2141 % \iffalse
2142 % --------------------------------------------------------------------------- %
2143 % \fi
2144 %
2145 % \clearpage
2146 % \section{Supported document classes}
2147 % \label{classes}
2148 %
2149 % This section will give you an overview of the document classes the
2150 % \pkg{caption} supports, what do they already offer regarding captions,
2151 % what side effects will occur when using the \pkg{caption} package with
2152 % them, and what are the `default' settings for them.
2153 %
2154 % \NEWfeature{v3.1}
2155 % The `default' settings depend on the document class you use; they represent
2156 % how the class author wanted the captions to look like. So for example
2157 % setting |format=|\x|default| can give you different visual designs when used
2158 % with different document classes.
2159 %
2160 % \begingroup\setlength\leftmargini{0.3em}% default = 2.5em
2161 % \INFO
2162 % If you don't find the document class you use in this section, you usually
2163 % don't have to worry: Many document classes (e.g.~the \cls{octavo} class)
2164 % are derived from one of the standard document classes \cls{article},
2165 % \cls{report}, or \cls{book}, and behave the same regarding captions.
2166 % \Thispackage\ automatically does a compatibility check against the document
2167 % class used and will give you the clear warning
2168 % \begin{quote}\footnotesize
2169 % |Package caption Warning: Unsupported document class (or package) detected,|\\
2170 % |(caption) usage of the caption package is not recommended.|\\
2171 % |See the caption package documentation for explanation.|
2172 % \end{quote}
2173 % if such an incompatibility was detected.
2174 % If you don't get such warning everything is fine, but if you get it the
2175 % usage of \thispackage\ is not recommended and especially not supported.
2176 % \endgroup
2177 %
2178 % \begin{Expert}
2179 % If you get such a compatibility warning but decide to use \thispackage{}
2180 % anyway, you should watch carefully what side-effects occur, usually the
2181 % look and feel of your captions will change by just including \thispackage{}
2182 % without options, meaning they do not look like as intended by the author
2183 % of the document class.
2184 % If this is fine for you, you should first specify the option |style=|\x|base|
2185 % via |\use|\-|package[style=|\x|base]{caption}| or
2186 % |\caption|\-|setup{style=|\x|base}| to set \thispackage\ into a well-defined
2187 % state.
2188 % Afterwards you can start setting your own options additionally and
2189 % keep your fingers crossed.
2190 % \end{Expert}
2191 %
2192 % \newcommand*\Option{Option}
2193 % \newcommand*\defaultvalue{\texttt{default} value}
2194 % \newcommand*\uses{\textit{uses}}
2195 % \newcommand*\settings{\textit{settings}}
2196 % \newcommand*\nofont{\textit{none}}
2197 %
2198 % \subsection{Standard \LaTeX: article, report, and book}
2199 %
2200 % \begin{tabular}{ll}
2201 % \Option & \defaultvalue \\\hline
2202 % |format=| & |plain| \\
2203 % |labelformat=| & |simple| \\
2204 % |labelsep=| & |colon| \\
2205 % |justification=| & |justified| \\
2206 % |font=| & \nofont \\
2207 % |labelfont=| & \nofont \\
2208 % |textfont=| & \nofont \\
2209 % \end{tabular}
2210 %
2211 % \begin{Annotation}
2212 % This also applies to document classes derived from them.
2213 % \end{Annotation}
2214 %
2215 % \subsection{\AmS: amsart, amsproc, and amsbook}
2216 % \label{AMS}
2217 %
2218 % \begin{tabular}{ll}
2219 % \Option & \defaultvalue \\\hline
2220 % |format=| & |plain| \\
2221 % |labelformat=| & |simple| \\
2222 % |labelsep=| & |.\enspace| \\
2223 % |justification=| & |justified| \\
2224 % |font=| & |\@captionfont| \\
2225 % |labelfont=| & |\@captionheadfont| \\
2226 % |textfont=| & |\@captionfont\upshape| \\
2227 % \end{tabular}
2228 %
2229 % \begin{Annotation*}
2230 % |\@caption|\-|font| will be set to |\normal|\-|font|, and
2231 % |\@caption|\-|head|\-|font| to |\sc|\-|shape| by the \AmS\ document classes.
2232 % \end{Annotation*}
2233 %
2234 % Furthermore the margin will be set to |\caption|\-|indent| for
2235 % more-than-one-line captions (which will be set to |3pc| by the \AmS\ classes),
2236 % the margin for single-line captions will be set to the half of it instead.
2237 % If you want to use a common margin for both, insert
2238 % |\clear|\-|caption|\-|setup[margin*]{single|\-|line}|
2239 % into the preamble of your document, after loading \thispackage.
2240 %
2241 % Additionally the options |figure|\-|position=b,|\x|table|\-|position=t|
2242 % will be set. You can override these settings by specifying other values for
2243 % |figure|\-|position=| or |table|\-|position=| in the option list while
2244 % loading \thispackage.
2245 %
2246 % \subsection{beamer}
2247 % \label{beamer}
2248 %
2249 % \begin{tabular}{ll}
2250 % \Option & \defaultvalue \\\hline
2251 % |format=| & |plain| \\
2252 % |labelformat=| & \textit{not numbered} \\
2253 % |labelsep=| & |colon| \\
2254 % |justification=| & |raggedright| \\
2255 % |font=| & \cls{beamer} ``|caption|'' \settings \\
2256 % |labelfont=| & \cls{beamer} ``|caption name|'' \settings \\
2257 % |textfont=| & \nofont \\
2258 % \end{tabular}
2259 %
2260 % \subsubsection*{Build-in features, and side-effects}
2261 % You can setup font and color settings with
2262 % |\set|\-|beamer|\-|font{caption}|\marg{options} and
2263 % |\set|\-|beamer|\-|font{caption name}|\marg{options}.
2264 % This will still work, unless you set a different font with
2265 % |\caption|\-|setup{font=|\x\meta{options}|}| or
2266 % |\caption|\-|setup{label|\-|font=|\x\meta{options}|}|.\par
2267 % Furthermore the \cls{beamer} classes offer different caption templates
2268 % which can be chosen with
2269 % |\set|\-|beamer|\-|template|\x|{caption}|\x|[|\meta{template}|]|.
2270 % Since \thispackage\ replaces this caption template mechanism,
2271 % |\def|\-|beamer|\-|template*|\x|{caption}|\x\marg{template code}
2272 % and
2273 % |\set|\-|beamer|\-|template|\x|{caption}|\x|[|\meta{template}|]|
2274 % will have no effect when \thispackage\ is used.
2275 % (Exception: Selecting the template |default|, |num|\-|bered|, or
2276 % |caption| |name| |own| |line| will be recognized by \thispackage and be mapped
2277 % to corresponding options.)
2278 %
2279 % \subsection{\KOMAScript: scrartcl, scrreprt, and scrbook}
2280 % \label{KOMA}
2281 %
2282 % \begin{tabular}{ll}
2283 % \Option & \defaultvalue \\\hline
2284 % |format=| & \uses\ |\setcapindent| \textit{\&} |\setcaphanging| \settings \\
2285 % |labelformat=| & \textit{like \purett{simple}, but with support of ``autodot''}\\
2286 % |labelsep=| & |\captionformat| \\
2287 % |justification=| & |justified| \\
2288 % |font=| & |\setkomafont{caption}| \settings \\
2289 % |labelfont=| & |\setkomafont{captionlabel}| \settings \\
2290 % |textfont=| & \nofont \\
2291 % \end{tabular}
2292 %
2293 % \subsubsection*{Build-in features}
2294 % The \KOMAScript\ document classes offer many ways to customize the look and
2295 % feel of the captions. For an overview and a full description please take a
2296 % look at the \KOMAScript\ documentation, section `Tables and Figures'.
2297 %
2298 % \subsubsection*{Side effects}
2299 % The optional argument of |\set|\-|cap|\-|width| is not supported and
2300 % will be ignored if used in conjunction with the \pkg{caption} package.
2301 % Furthermore the \KOMAScript\ options |table|\-|caption|\-|above| \&
2302 % |table|\-|caption|\-|below| and the commands |\caption|\-|above| \&
2303 % |\caption|\-|below| are stronger than the |position=| setting offered by
2304 % the \pkg{caption} package.
2305 %
2306 % \subsection{\NTG: artikel, rapport, and boek}
2307 % \label{NTG}
2308 %
2309 % \begin{tabular}{ll}
2310 % \Option & \defaultvalue \\\hline
2311 % |format=| & |plain| \\
2312 % |labelformat=| & |simple| \\
2313 % |labelsep=| & |colon| \\
2314 % |justification=| & |justified| \\
2315 % |font=| & \nofont \\
2316 % |labelfont=| & |\CaptionLabelFont| \\
2317 % |textfont=| & |\CaptionTextFont| \\
2318 % \end{tabular}
2319 %
2320 % \subsubsection*{Build-in features, and side-effects}
2321 % |\Caption|\-|Label|\-|Font| and |\Caption|\-|Text|\-|Font| can be set either
2322 % directly or by using |\Caption|\-|Fonts|.
2323 % Both is still supported unless you use one of the two options
2324 % |label|\-|font=| or |text|\-|font=| offered by \thispackage.
2325 %
2326 % \subsection{\SmF: smfart and smfbook}
2327 % \label{SMF}
2328 %
2329 % Since the \SmF\ document classes are derived from the \AmS\ document classes
2330 % the same default values are valid here.
2331 %
2332 % Additionally the margin is limited up to the tenth of the |\line|\-|width|.
2333 % If you don't like this limitation, you can switch it off with the option
2334 % |max|\-|margin=|\x|off| or |max|\-|margin=|\x|false|
2335 % (which both means the same).
2336 %
2337 % \subsection{thesis}
2338 % \label{thesis}
2339 %
2340 % \begin{tabular}{ll}
2341 % \Option & \defaultvalue \\\hline
2342 % |format=| & |hang| \\
2343 % |labelformat=| & \textit{like \purett{simple}, but with short name}\\
2344 % |labelsep=| & |colon| \\
2345 % |justification=| & |justified| \\
2346 % |font=| & \nofont \\
2347 % |labelfont=| & |\captionheaderfont| \\
2348 % |textfont=| & |\captionbodyfont| \\
2349 % \end{tabular}
2350 %
2351 % \subsubsection*{Build-in features, and side-effects}
2352 % The caption label font can be set with |\caption|\-|header|\-|font|,
2353 % the caption text font with |\caption|\-|body|\-|font|.
2354 % Both is still supported unless you use one of the two options
2355 % |label|\-|font=| or |text|\-|font=| offered by \thispackage.
2356 %
2357 % \iffalse
2358 % --------------------------------------------------------------------------- %
2359 % \fi
2360 %
2361 % \clearpage
2362 % \section{Supported babel package options}
2363 % \label{babel}
2364 %
2365 % \NEWfeature{v3.5}
2366 % Since version \version{3.5} of the \pkg{caption} package the support
2367 % is independent on the load order of \pkg{caption} and \pkg{babel}.
2368 %
2369 % \subsection{french babel option}
2370 % \label{french}
2371 %
2372 % If you use the \pkg{french} option of the \pkg{babel} package
2373 % with one of the three standard \LaTeX{} classes (or a one derived from them)
2374 % the default |label|\-|sep=| will be set to |\Caption|\-|Sep|\-|a|\-|ra|\-|tor|
2375 % (offered by \pkg{french}), overriding the default value set by the
2376 % document class.
2377 % So redefining |\Caption|\-|Sep|\-|a|\-|ra|\-|tor| will still work, unless you
2378 % don't select a different |label|\-|sep=| than the default one.
2379 %
2380 % \iffalse
2381 % --------------------------------------------------------------------------- %
2382 % \fi
2383 %
2384 % \clearpage
2385 % \section{Supported packages}
2386 % \label{packages}
2387 % \label{compatibility}
2388 %
2389 % \Thispackage\ was adapted to the following packages which deals with
2390 % captions, too:
2391 % \begin{quote}
2392 % \pkg{float}, \pkg{floatflt}, \pkg{fltpage},
2393 % \pkg{hyperref}, \pkg{hypcap}, \pkg{listings},
2394 % \pkg{longtable}, \pkg{picinpar}, \pkg{picins},
2395 % \pkg{rotating}, \pkg{setspace}, \pkg{sidecap},
2396 % \pkg{subfigure}, \pkg{supertabular}, \pkg{threeparttable},
2397 % \pkg{wrapfig}, and \pkg{xtab}
2398 % \end{quote}
2399 %
2400 % Furthermore the \pkg{floatrow} package\cite{floatrow}, the
2401 % \pkg{subcaption} package (which is part of the \pkg{caption} package
2402 % bundle), and the \pkg{subfig} package\cite{subfig} support \thispackage{}
2403 % and use its |\caption|\-|setup| interface.
2404 %
2405 % \bigskip
2406 %
2407 % \begingroup\setlength\leftmargini{0.3em}% default = 2.5em
2408 % \INFO
2409 % If a package (or document class) unknown to \thispackage\ redefines
2410 % the |\caption| command as well, this redefinition will be preferred
2411 % over the one this package offers, providing maximum compatibility and
2412 % avoiding conflicts.
2413 % If such a potential incompatibility is detected, you will see this
2414 % warning message:~\footnote{%
2415 % You can suppress this warning by specifying the option
2416 % \texttt{compatibility=true} when loading \thispackage.}
2417 % \begin{quote}\footnotesize
2418 % |Package caption Warning: \caption will not be redefined since it's already|\\
2419 % |(caption) redefined by a document class or package which is|\\
2420 % |(caption) unknown to the caption package.|\\
2421 % |See the caption package documentation for explanation.|
2422 % \end{quote}
2423 % \endgroup
2424 %
2425 % As a result, the following features offered by \thispackage\ will not be available:
2426 % \begin{itemize}
2427 % \item the options |labelformat=|, |position=auto|, |list=|, and |listformat=|
2428 % \item |\caption*| (to produce a caption without label)
2429 % \item |\caption[]{|\ldots|}| (to produce no entry in the List of Figures or Tables)
2430 % \item |\caption{}| (to produce an empty caption without label separator)
2431 % \item |\ContinuedFloat|
2432 % \item correctly justified captions in environments like \texttt{wide} and
2433 % \texttt{addmargin} which add extra margins
2434 % \item the \textsf{hypcap} feature \See{\longref{hyperref}\,}
2435 % \item the sub-caption feature \See{\pkg{subcaption} package documentation}
2436 % \end{itemize}
2437 %
2438 % \DescribeMacro{compatibility=}
2439 % You can override this compatibility mode by specifying the option
2440 % \begin{quote}
2441 % |compatibility=false|
2442 % \end{quote}
2443 % when loading \thispackage.
2444 % But please note that using this option is neither recommended nor supported
2445 % since unwanted side-effects or even errors could occur afterwards.
2446 % (For that reason you will get a warning about this.)
2447 %
2448 % \newcommand\packagedescription[1]{%
2449 % \ifvmode\else\par\fi
2450 % \nopagebreak
2451 % \parbox[b]{\linewidth}{\footnotesize\leftskip=10pt\rightskip=10pt\relax#1}\par
2452 % \nopagebreak\smallskip\nopagebreak}
2453 %
2454 % \PageBreak
2455 % \subsection{algorithms}
2456 % \label{algorithms}
2457 % \packagedescription{%
2458 % The \pkg{algorithms} package bundle\cite{algorithms} provides two
2459 % environments: The \texttt{algorithmic} environment provides a possibility
2460 % for describing algorithms, and the \texttt{algorithm} environment provides
2461 % a ``float'' wrapper for algorithms.}
2462 %
2463 % Since the \texttt{algorithm} environment is implemented via |\new|\-|float|
2464 % provided by the \pkg{float} package\cite{float}, please see \longref{float}.
2465 %
2466 % \iffalse
2467 % \pagebreak[3]
2468 % \subsection{algorithm2e}
2469 % \label{algorithm2e}
2470 % \packagedescription{%
2471 % The \pkg{algorithm2e} package\cite{algorithm2e} offers an environment for
2472 % writing algorithms in LaTeX2e.}
2473 %
2474 % Since the \pkg{algorithm2e} package does not use some kind of standard
2475 % interface for defining its floating environment (e.g.~|\newfloat| of the
2476 % \pkg{float} package) and typesetting its caption,
2477 % the \pkg{algorithm2e} package is \emph{not} supported by \thispackage.
2478 %
2479 % So if you want to customize the captions using \thispackage,
2480 % you have to build a new environment which uses a supported interface regarding
2481 % floats (e.g. using the \pkg{float} or \pkg{floatrow} package),
2482 % and combine this environment with the internal \pkg{algorithm2e} code.
2483 %
2484 % As first step you could define a non-floating environment \texttt{algorithmic},
2485 % for example:
2486 % \begin{quote}
2487 % |\usepackage{algorithm2e}|\\
2488 % |% save the "algorithm" environment from the algorithm2e package|\\
2489 % |\let\ORIGalgorithm\algorithm|\\
2490 % |\let\ORIGendalgorithm\endalgorithm|\\
2491 % |% define the algorithmic environment|\\ % , based on the saved environment
2492 % |\newenvironment{algorithmic}%|\\
2493 % | {\renewenvironment{algocf}[1][h]{}{}% pass over floating stuff|\\
2494 % | \ORIGalgorithm}%|\\
2495 % | {\ORIGendalgorithm}|\\
2496 % \ldots
2497 % \end{quote}
2498 % Having defined this non-floating environment, you could define your own new
2499 % floating environment with |\newfloat| of the \pkg{float} package
2500 % (or |\DeclareNewFloatType| of the \pkg{floatrow} package),
2501 % and use the combination of this floating environment and \texttt{algorithmic}
2502 % in its body, just like you would do when you use the
2503 % \pkg{algorithm}/\pkg{algorithmic} package tandem.
2504 %
2505 % You could even use the \pkg{algorithm} package for this purpose, for example:
2506 % \begin{quote}
2507 % \ldots\\
2508 % |% load the algorithm package to re-define the|\\
2509 % |% floating environment "algorithm" and \listofalgorithms|\\
2510 % |\let\listofalgorithms\undefined|\\
2511 % |\usepackage{algorithm}|\\
2512 % \ldots\\
2513 % |% Example usage:|\\
2514 % |\begin{algorithm}|\\
2515 % |\caption{An algorithm}|\\
2516 % |\begin{algorithmic}|\\
2517 % | \SetVline|\\
2518 % | \eIf{cond1}{|\\
2519 % | a line\;|\\
2520 % | }{|\\
2521 % | another line\;|\\
2522 % | }|\\
2523 % |\end{algorithmic}|
2524 % \end{quote}
2525 % Now you are finally able to customize the float and caption layout like every
2526 % other floating environment defined with the \pkg{float} package\cite{float},
2527 % please see \longref{float}.
2528 %
2529 % \begin{Annotation}
2530 % An alternative would be using the \pkg{algorithmicx} package.
2531 % \end{Annotation}
2532 % \fi
2533 %
2534 % \pagebreak[3]
2535 % \subsection{float}
2536 % \label{float}
2537 % \packagedescription{%
2538 % The \pkg{float} package\cite{float} introduces the commands
2539 % \cs{restylefloat} to give existing floating environments a new look \& feel
2540 % and \cs{newfloat} to define new floating environments.
2541 % It also provides the ``\texttt{H}'' float placement option which places
2542 % the environments ``here'' instead of letting them floating around.}
2543 %
2544 % For floating environments defined with \cs{newfloat} or \cs{restylefloat} the
2545 % |po|\-|si|\-|tion| option has no effect on the main caption anymore, since its
2546 % placement and spacing will be controlled by the selected float style instead.
2547 %
2548 % A caption style and options defined with the name of the float style will be
2549 % executed additionally to the regular ones.
2550 % Using this mechanism \thispackage\ emulates the default look \& feel of the
2551 % |ruled| captions: It defines the caption style
2552 % \begin{quote}
2553 % |\DeclareCaptionStyle{ruled}%|\\
2554 % | {labelfont=bf,labelsep=space,strut=off}|\mbox{\quad.}
2555 % \end{quote}
2556 % So to change this you need either define your own caption style called
2557 % |ruled| or use |\caption|\-|setup[ruled]|\marg{options} to specify additional
2558 % options.
2559 %
2560 % Also by using this mechanism the skip between a |boxed| float and its caption
2561 % is specified, overriding its global value:
2562 % \begin{quote}
2563 % |\captionsetup[boxed]{skip=2pt}|
2564 % \end{quote}
2565 % For changing this, just use |\caption|\-|setup[boxed]{skip=|\x\meta{value}|}|
2566 % with an appropriate value. Or if you want to use the global |skip| setting
2567 % instead, you can remove the usage of the local setting for these floats with
2568 % |\clear|\-|caption|\-|setup[skip]{boxed}|.
2569 %
2570 % \begin{Note}
2571 % Only one single caption can be typeset inside environments defined with
2572 % |\new|\-|float| or |\re|\-|style|\-|float|, furthermore these environments
2573 % are not behaving exactly like the pre-defined floats |figure| and |table|.
2574 % As a consequence many packages do not cooperate well with these.
2575 % Furthermore the \pkg{float} package has some caveats \& limitations,
2576 % so if you just want to define a new simple floating environment---behaving
2577 % like |figure| or |table|---I recommend using |\Declare|\-|Floating|\-|Environment|
2578 % offered by the \pkg{newfloat} package instead.
2579 % And for defining non-simple floating environments and customization I
2580 % recommend using |\Declare|\-|New|\-|Float|\-|Type| offered by the
2581 % \pkg{floatrow} package\cite{floatrow}.
2582 % \end{Note}
2583 %
2584 % \iffalse
2585 % Please also note that you \emph{don't} need a |\restyle|\-|float| for using
2586 % the ``|H|'' float placement specifier. Some docs say so, but they are
2587 % wrong.
2588 % And |\restyle|\-|float{table}| is a very good method to shoot yourself
2589 % in the foot, since many packages using |table| internally are not working
2590 % correctly afterwards.
2591 % \fi
2592 %
2593 % \pagebreak[3]
2594 % \subsection{floatflt}
2595 % \label{floatflt}
2596 % \packagedescription{%
2597 % The \pkg{floatflt} package\cite{floatflt} offers figures and tables
2598 % which do not span the full width of a page and are float around by text.}
2599 %
2600 % \NEWfeature{v3.1}
2601 % If you want to setup special options for the |float|\-|ing|\-|figure| and
2602 % |float|\-|ing|\-|table| environments you can use
2603 % \begin{quote}
2604 % |\captionsetup[floatingfigure]|\marg{options}\quad\emph{and}\\
2605 % |\captionsetup[floatingtable]|\marg{options}\quad.
2606 % \end{quote}
2607 % These options will be executed additionally to the regular ones for
2608 % |figure| or |table|.
2609 %
2610 % \begin{Note}
2611 % The |margin| or |width| setting will not be used for these figures or tables,
2612 % unless you set it explicit with |\caption|\-|setup[floating|\-|figure]{|\ldots|}|
2613 % or |\caption|\-|setup[floating|\-|table]{|\ldots|}|.
2614 % \end{Note}
2615 %
2616 % \pagebreak[3]
2617 % \subsection{fltpage}
2618 % \label{fltpage}
2619 % \packagedescription{%
2620 % The \pkg{fltpage} package\cite{fltpage} offers the outhouse of the
2621 % caption for |figure|s or |table|s which needs the whole page
2622 % for its contents. This will be done by placing the caption on the bottom
2623 % of the previous or next page.}
2624 %
2625 % \iffalse
2626 % \NEWfeature{v3.1}
2627 % Two options control the links to the environments |FPfigure| and |FPtable|:
2628 % \begin{description}
2629 % \item{\texttt{FPlist=caption} or \texttt{FPlist=figure}}\\[\smallskipamount]
2630 % If set to |caption|, the list entry will link to the caption; if set to
2631 % |figure|, it will link to the figure contents.
2632 % (The default setting is |FP|\-|list=|\x|caption|.)
2633 % \item{\texttt{FPref=caption} or \texttt{FPref=figure}}\\[\smallskipamount]
2634 % If set to |caption|, a \cs{ref}, \cs{pageref}, \cs{autoref}, or \cs{nameref}
2635 % will link to the caption; if set to |figure|, it will link to the figure contents.
2636 % (The default setting is |FP|\-|ref=|\x|figure|.)
2637 % \end{description}
2638 % \fi
2639 %
2640 % If you want to setup special options for the |FPfigure| and |FPtable|
2641 % environments you can use
2642 % \begin{quote}
2643 % |\captionsetup[FPfigure]|\marg{options}\quad\emph{and}\\
2644 % |\captionsetup[FPtable]|\marg{options}\quad.
2645 % \end{quote}
2646 % These options will be executed additionally to the regular ones for
2647 % |figure| or |table|.
2648 %
2649 % \pagebreak[3]
2650 % \subsection{frenchle and frenchpro packages}
2651 % \label{frenchpro}
2652 %
2653 % If you use the \pkg{frenchle} or \pkg{frenchpro} package,
2654 % the default |label|\-|sep=| will be set to |\caption|\-|sep|\-|a|\-|ra|\-|tor|
2655 % (offered by \pkg{frenchle/pro}) plus \cs{space}, overriding the default
2656 % value set by the document class.
2657 % So redefining |\caption|\-|sep|\-|a|\-|ra|\-|tor| will still work, unless you
2658 % don't select a different |label|\-|sep=| than the default one.
2659 %
2660 % Furthermore the default |text|\-|font=| will be set to |text|\-|font=|\x|it|,
2661 % since this emulates the default setting of |\caption|\-|font| defined by the
2662 % \pkg{frenchle} or \pkg{frenchpro} package.
2663 % Please note that the command |\caption|\-|font| is used by the
2664 % \pkg{caption} package internally for a different purpose,
2665 % so you should not change it (anymore).
2666 %
2667 % The command |\un|\-|numbered|\-|captions|\marg{figure \emph{or} table} will
2668 % still work, but only unless you don't select a different |label|\-|format=|
2669 % than the default one.
2670 %
2671 % \NEWfeature{v3.5}
2672 % Since version \version{3.5} of the \pkg{caption} package the support
2673 % is independent on the load order of \pkg{caption} and \pkg{frenchle}
2674 % resp~.\pkg{frenchpro}.
2675 %
2676 % \pagebreak[3]
2677 % \subsection{hyperref}
2678 % \label{hyperref}
2679 % \packagedescription{%
2680 % The \pkg{hyperref} package\cite{hyperref} is used to handle cross
2681 % referencing commands in LaTeX to produce hypertext links in the document.}
2682 %
2683 % \NEWfeature{v3.1}
2684 % There are two options available to control the placement of hyperlink
2685 % anchors:~\footnote{These options are named after the \pkg{hypcap} package
2686 % which they supersede.}
2687 % \begin{description}
2688 % \item{\texttt{hypcap=true} or \texttt{hypcap=false}}\\[\smallskipamount]
2689 % If set to |true| all hyperlink anchors -- where entries in the
2690 % List of Figures, |\ref|, and |\auto|\-|ref| will link to -- are placed at
2691 % the beginning of the (floating) environment.\par
2692 % If set to |false| the hyperlink anchor is (usually) placed at the caption.\par
2693 % (The default setting is |hypcap=|\x|true|.)
2694 % \item{\texttt{hypcapspace=}\meta{amount}}\\[\smallskipamount]
2695 % Because it looks poor if the hyperlink points exactly at the top of
2696 % the figure or table, you can specify a vertical distance between
2697 % the hyperlink anchor and the (floating) environment itself,
2698 % e.g.~|hyp|\-|cap|\-|space=|\x|0pt| removes this distance.\par
2699 % (The default setting is |hyp|\-|cap|\-|space=|\x|0.5\base|\-|line|\-|skip|.)
2700 % \end{description}
2701 %
2702 % Both settings have no effect in |lst|\-|listing|s (provided by the
2703 % \pkg{listings} package), |long|\-|table|s (provided by the
2704 % \pkg{longtable} package), |super|\-|tabular|s (provided by the
2705 % \pkg{supertabular} package), and |x|\-|tabular|s (provided by the
2706 % \pkg{xtab} package), within these environments hyperlink
2707 % anchors will always be placed as if |hyp|\-|cap=|\x|true| and
2708 % |hyp|\-|cap|\-|space=|\x|0pt| would be set.
2709 %
2710 % \pagebreak[3]Please note:\nopagebreak
2711 % \begin{description}
2712 % \item{\cs{captionof}\marg{type}\csmarg{\purerm\ldots}
2713 % vs.~\cs{captionsetup}\csmarg{type=\textrm{\meta{type}}}$+$\cs{caption}\csmarg{\purerm\ldots}}%
2714 % \\[\smallskipamount]
2715 % Without \pkg{hyperref} loaded, both will give you identical results.
2716 % But with \pkg{hyperref} loaded, and with |hyp|\-|cap=|\x|true| requested,
2717 % the hyperlink anchor will be placed different.
2718 % For example:
2719 % \begin{quote}
2720 % |\begin{minipage}{\linewidth}|\\
2721 % | |\ldots\\
2722 % | \captionof{figure}{A figure}|\\
2723 % |\end{minipage}|
2724 % \end{quote}
2725 % will place the hyperlink anchor at the caption.
2726 % (And if |hyp|\-|cap=|\x|true| is set, you will get a warning about this.)
2727 % But
2728 % \begin{quote}
2729 % |\begin{minipage}{\linewidth}|\\
2730 % | \captionsetup{type=figure}|\\
2731 % | |\ldots\\
2732 % | \caption{A figure}|\\
2733 % |\end{minipage}|
2734 % \end{quote}
2735 % will place the hyperlink anchor at the beginning of the |mini|\-|page|,
2736 % since |\caption|\-|setup{type=|\x|figure}| does not only set the caption type
2737 % to ``figure'' but does place a hyperlink anchor, too.
2738 %
2739 % \item{\cs{caption}\csoarg{}\csmarg{\purerm\ldots}
2740 % vs.~\cs{captionsetup}\csmarg{list=false}$+$\cs{caption}\csmarg{\purerm\ldots}}\\[\smallskipamount]
2741 % Again, without \pkg{hyperref} loaded, both will give you identical results.
2742 % But with \pkg{hyperref} loaded, the difference is in the nuances.
2743 % So for example the optional argument of |\caption| will also be written to
2744 % the |aux| file, and will be used by the |\name|\-|ref| command.
2745 % So if you choose to use |\caption| with empty optional argument,
2746 % |\name|\-|ref| will also give you an empty result.
2747 % So it's better to use |\caption|\-|setup{list=|\x|false}| if you don't
2748 % want an entry in the List of Figures or List of Tables.
2749 % \end{description}
2750 %
2751 % \pagebreak[3]
2752 % \subsection{hypcap}
2753 % \label{hypcap}
2754 % \packagedescription{%
2755 % The \pkg{hyp\-cap} package\cite{hypcap} offers a solution to the problem
2756 % that links to a float using \pkg{hyper\-ref} may anchors to the caption
2757 % rather than the beginning of the float.
2758 % Since \thispackage\ \version{3.1} already solves this problem for itself,
2759 % the \pkg{hypcap} package is usually not needed.}
2760 %
2761 % If the \pkg{hyp\-cap} package is loaded additionally to the
2762 % \pkg{hyper\-ref} package, it takes over the control of the hyperlink
2763 % anchor placement from \thispackage, overriding the options |hyp|\-|cap=|
2764 % and |hyp|\-|cap|\-|space=|.
2765 %
2766 % So for a manual placement of hyperlink anchors
2767 % |\caption|\-|setup{type=|\x\meta{type}|}| is not sufficient anymore,
2768 % instead you need to use |\cap|\-|start| (provided by the \pkg{hyp\-cap}
2769 % package) for this.
2770 %
2771 % Regarding the automatically placement the \pkg{hypcap} package offers good
2772 % placement of hyperlink anchors for the floating environments |figure| and
2773 % |table| only. In contrast the |hypcap=|\x|true| option of \thispackage\ also
2774 % offers good placements of hyperlink anchors for
2775 % |floating|\-|figure|s (provided by the \pkg{float\-flt} package),
2776 % |FP|\-|figure|s \& |FPtable|s (provided by the \pkg{flt\-page} package),
2777 % |fig|\-|window|s (provided by the \pkg{pic\-in\-par} package),
2778 % |par|\-|pic|s (provided by the \pkg{pic\-ins} package),
2779 % |SC|\-|figure|s (provided by the \pkg{side\-cap} package),
2780 % |three|\-|part|\-|table|s (provided by the \pkg{three\-part\-table} package),
2781 % and |wrapfigure|s (provided by the \pkg{wrap\-fig} package).
2782 %
2783 % \pagebreak[3]
2784 % \subsection{listings}
2785 % \label{listings}
2786 % \packagedescription{%
2787 % The \pkg{listings} package\cite{listings} typesets programming code.}
2788 %
2789 % If you want to setup special options for the |lst|\-|listing| environment
2790 % you can use
2791 % \begin{quote}
2792 % |\captionsetup[lstlisting]|\marg{options}\quad.
2793 % \end{quote}
2794 %
2795 % Please note that the \pkg{listings} package has its very own options
2796 % for controlling the position and the skips of the caption:
2797 % |caption|\-|pos=|, |above|\-|caption|\-|skip=|, and |below|\-|caption|\-|skip=|.
2798 % \See{\pkg{listings} documentation for details.}
2799 % These \pkg{listings} options override the \pkg{caption}'s ones, but
2800 % can be again overwritten by |\caption|\-|setup[lst|\-|listing]{|\ldots|}|,
2801 % e.g.%~
2802 % \begin{quote}|\caption|\-|setup[lst|\-|listing]{skip=|\x|10pt}|\quad.\end{quote}
2803 %
2804 % \pagebreak[3]
2805 % \subsection{longtable}
2806 % \label{longtable}
2807 % \packagedescription{%
2808 % The \pkg{longtable} package\cite{longtable} offers an environment
2809 % which behaves similar to the \texttt{tabular} environment, but the table
2810 % itself can span multiple pages.}
2811 %
2812 % If you want to setup special options for the |long|\-|table| environment
2813 % you can use
2814 % \begin{quote}
2815 % |\captionsetup[longtable]|\marg{options}\quad.
2816 % \end{quote}
2817 % These options will be executed additionally to the regular ones for
2818 % |table|.
2819 %
2820 % The |margin| and |width| settings usually override |\LT|\-|cap|\-|width|,
2821 % so you get an equal look \& feel of the captions in |table|s and
2822 % |long|\-|table|s.
2823 % But if you set |\LT|\-|cap|\-|width| to a value different than its default
2824 % $=$ |4in|, \thispackage\ will follow that.
2825 % (But |\LT|\-|cap|\-|width| will be overwritten by
2826 % |\caption|\-|setup[long|\-|table]{width=|\x\meta{value}|}|,
2827 % even if it is set to a value different than |4in|.)
2828 %
2829 % \begin{Note}
2830 % |\caption|\-|of| and |\Continued|\-|Float| do \emph{not} work for |long|\-|table|s.
2831 % Furthermore neither |\caption| nor |\caption|\-|list|\-|entry| will increment
2832 % the |table| counter here; it's incremented by the |long|\-|table| environment
2833 % instead.
2834 % \NEWfeature{v3.1}
2835 % If you need a |long|\-|table| which does not increment the |table| counter
2836 % please use the |long|\-|table*| environment (offered by the
2837 % \pkg{ltcaption} package which is part of \thispackage\ bundle and will be
2838 % loaded automatically).
2839 % \end{Note}
2840 %
2841 % \pagebreak[3]
2842 % \subsection{picinpar}
2843 % \label{picinpar}
2844 % \packagedescription{%
2845 % Similar to the \pkg{floatflt} package the \pkg{picinpar}
2846 % package\cite{picinpar} offers figures and tables which do not span the full
2847 % width of a page and are float around by text.
2848 % For a detailed discussion about the differences between these packages
2849 % please take a look at The \LaTeX\ Companion\cite{TLC2}.}
2850 %
2851 % \NEWfeature{v3.1}
2852 % If you want to setup special options for the |fig|\-|window| and
2853 % |tab|\-|window| environments you can use
2854 % \begin{quote}
2855 % |\captionsetup[figwindow]|\marg{options}\quad\emph{and}\\
2856 % |\captionsetup[tabwindow]|\marg{options}\quad.
2857 % \end{quote}
2858 % These options will be executed additionally to the regular ones for
2859 % |figure| or |table|.
2860 %
2861 % \begin{Note}
2862 % The |margin| or |width| setting will not be used for these figures and tables,
2863 % unless you set it explicit with |\caption|\-|setup[fig|\-|window]{|\ldots|}| or
2864 % |\caption|\-|setup[fig|\-|table]{|\ldots|}|.
2865 % \end{Note}
2866 %
2867 % \pagebreak[3]
2868 % \subsection{picins}
2869 % \label{picins}
2870 % \packagedescription{%
2871 % Similar to the \pkg{floatflt} and \pkg{picinpar} package the
2872 % \pkg{picins} package\cite{picins} offers figures and tables which do not
2873 % span the full width of a page and are float around by text.
2874 % For a detailed discussion about the differences between these packages
2875 % please take a look at The \LaTeX\ Companion\cite{TLC2}.}
2876 %
2877 % \NEWfeature{v3.1}
2878 % If you want to setup special options for the |par|\-|pic| environment you can use
2879 % \begin{quote}
2880 % |\captionsetup[parpic]|\marg{options}\quad.
2881 % \end{quote}
2882 % These options will be executed additionally to the regular ones for
2883 % |figure| or |table|.
2884 %
2885 % Furthermore |\pic|\-|caption[]{|\ldots|}| produce no entry in the List of Figures,
2886 % and |\pic|\-|caption*{|\ldots|}| gives an unlabeled \& unnumbered caption.
2887 %
2888 % \begin{Note}
2889 % The |margin| or |width| setting will not be used for these figures and tables.
2890 % \iffalse
2891 % if |pic|\-|caption|\-|side| or |pic|\-|caption|\-|top|\-|side| is used.
2892 % The |width| setting will not be used (but the |margin| setting will) if
2893 % |pic|\-|caption|\-|out|\-|side| or |pic|\-|caption|\-|in|\-|side| is used.
2894 % \fi
2895 % But you can override this by setting it explicit with
2896 % |\caption|\-|setup[par|\-|pic]{|\ldots|}|.
2897 % \end{Note}
2898 %
2899 % If you want to have a |\pic|\-|caption| of another type as |figure|, please
2900 % do \emph{not} re-define |\@cap|\-|type| as suggested by the \pkg{picins}
2901 % documentation. Please use the |\pic|\-|caption|\-|type|\marg{type} command
2902 % which is offered by \thispackage\ instead, e.g.:
2903 % \begin{quote}
2904 % |\piccaptiontype{table}|\\
2905 % |\piccaption{An example table}|\\
2906 % |\parpic(50mm,10mm)[s]{|\ldots|}|
2907 % \end{quote}
2908 %
2909 % \pagebreak[3]
2910 % \subsection{rotating}
2911 % \label{rotating}
2912 % \packagedescription{%
2913 % The \pkg{rotating} package\cite{rotating} offers the floating
2914 % environments \texttt{side\-ways\-figure} and \texttt{side\-ways\-table} which
2915 % are just like normal figures and tables but rotated by 90 or 270 degree.
2916 % Furthermore a command \cs{rot\-caption} is offered for rotated captions only.}
2917 %
2918 % \iffalse % No, we don't do that
2919 % If you want to setup special options for the |side|\-|ways|\-|figure| and
2920 % |side|\-|ways|\-|table| environments you can use
2921 % \begin{quote}
2922 % |\captionsetup[sidewaysfigure]|\marg{options}\\
2923 % |\captionsetup[sidewaystable]|\marg{options}\quad.
2924 % \end{quote}
2925 % These options will be executed additionally to the regular ones for
2926 % |figure| or |table|.
2927 % \fi
2928 %
2929 % The command |\rot|\-|caption| will be extended by \thispackage, so
2930 % |\rot|\-|caption*| and |\rot|\-|caption|\-|of| can be used analogous to
2931 % |\caption*| and |\caption|\-|of|.
2932 %
2933 % \pagebreak[3]
2934 % \subsection{setspace}
2935 % \label{setspace}
2936 % \packagedescription{%
2937 % The \pkg{setspace} package\cite{setspace} offers options and commands
2938 % to change the spacing,
2939 % e.g.\ \cs{usepackage}\x\csoarg{one\-half\-spacing}\x\csmarg{set\-space}
2940 % causes the document to be typeset in one-and-a-half spacing.}
2941 %
2942 % If the \pkg{setspace} package is used in conjunction with \thispackage,
2943 % the caption will be typeset with single spacing as default. This can be changed
2944 % by specifying either |font=|\x|one|\-|half|\-|spacing|,
2945 % |font=|\x|double|\-|spacing|, or |font={stretch=|\x\meta{amount}|}|.
2946 % \See{also \longref{fonts}}
2947 %
2948 % \pagebreak[3]
2949 % \subsection{sidecap}
2950 % \label{sidecap}
2951 % \packagedescription{%
2952 % The \pkg{sidecap} package\cite{sidecap} offers the floating environments
2953 % \texttt{SC\-figure} and \texttt{SC\-table} which are like usual figures
2954 % and tables but the caption will be put \emph{beside} the contents.}
2955 %
2956 % If you want to setup special options for the |SCfigure| and |SCtable|
2957 % environments you can use
2958 % \begin{quote}
2959 % |\captionsetup[SCfigure]|\marg{options}\quad\emph{and}\\
2960 % |\captionsetup[SCtable]|\marg{options}\quad.
2961 % \end{quote}
2962 % These options will be executed additionally to the regular ones for
2963 % |figure| or |table|.
2964 %
2965 % \pagebreak[3]
2966 % \begin{Note}
2967 % The \pkg{sidecap} package offers its own options for justification.
2968 % If set, they will override the one specified with the caption option
2969 % |jus|\-|ti|\-|fi|\-|ca|\-|tion=| for captions beside their contents.
2970 % \end{Note}
2971 %
2972 % \begin{Note}
2973 % The |margin| or |width| setting will not be used for these figures and tables,
2974 % unless you set it explicit with |\caption|\-|setup[SC|\-|figure]{|\ldots|}|
2975 % or |\caption|\-|setup[SC|\-|table]{|\ldots|}|.
2976 % \end{Note}
2977 %
2978 % \medskip
2979 %
2980 % \begin{Annotation*}
2981 % Instead of using the \pkg{sidecap} package you can also use the more
2982 % powerful and flexible \pkg{floatrow} package\cite{floatrow} for typesetting
2983 % captions beside the contents.
2984 % \end{Annotation*}
2985 %
2986 % \pagebreak[3]
2987 % \subsubsection*{Undocumented features}
2988 % The \pkg{sidecap} package \version{1.6} has some undocumented package
2989 % options and commands which allow further customization of the side-captions:
2990 %
2991 % \pagebreak[3]
2992 % \DescribeMacro{margincaption}
2993 % The package option
2994 % \begin{quote}
2995 % |margincaption|\qquad{\small(e.g.~|\usepackage[margincaption]{sidecap}|)}
2996 % \end{quote}
2997 % causes all side-captions to be placed into the margin.
2998 %
2999 % \pagebreak[3]
3000 % \DescribeMacro{\sidecaptionvpos}
3001 % The command
3002 % \begin{quote}
3003 % |\sidecaptionvpos|\marg{float type}\marg{pos}
3004 % \end{quote}
3005 % sets the vertical position of the side-caption. \meta{pos} can be either `|t|'
3006 % (for top alignment), `|b|' (for bottom alignment), or `|c|' (for center alignment).
3007 % The default setting for |table| is `|t|', for |figure| and all other ones
3008 % defined with |\Declare|\-|Floating|\-|Environment| it's `|b|'.
3009 %
3010 % \pagebreak[3]
3011 % \subsection{subfigure}
3012 % \label{subfigure}
3013 % \packagedescription{%
3014 % The \pkg{subfigure} package\cite{subfigure} provides support for small or
3015 % `sub' figures and tables within a single figure or table environment.
3016 % This package is obsolete, new users should use \pkg{subfig} instead.}
3017 %
3018 % Since the \pkg{subfigure} package is obsolete it will only be supported in
3019 % a way that old documents (which have used \thispackage\ \version{1.x} during
3020 % development) should still compile as expected.
3021 %
3022 % Please use the \pkg{subfig} or \pkg{subcaption} package instead which both supports \thispackage\
3023 % \version{3.x}.
3024 %
3025 % \See{the \pkg{subfig} package\cite{subfig} documentation for details.}
3026 %
3027 % \pagebreak[3]
3028 % \subsection{supertabular and xtab}
3029 % \label{supertabular}
3030 % \packagedescription{%
3031 % The \pkg{supertabular}\cite{supertabular} and \pkg{xtab}\cite{xtab}
3032 % packages offer an environment which can span multiple pages and is quite
3033 % similar to the \texttt{long\-table} environment provided by the
3034 % \pkg{longtable} package\cite{longtable}.
3035 % For a detailed discussion about the differences between these powerful
3036 % packages please take a look at The \LaTeX\ Companion\cite{TLC2}.}
3037 %
3038 % If you want to setup special options for the |super|\-|tabular|
3039 % or |x|\-|tabular| environment you can use
3040 % \begin{quote}
3041 % |\captionsetup[supertabular]|\marg{options}\quad\emph{or}\\
3042 % |\captionsetup[xtabular]|\marg{options}\quad.
3043 % \end{quote}
3044 % These options will be executed additionally to the regular ones for
3045 % |table|.
3046 %
3047 % \begin{Note}
3048 % |\Continued|\-|Float| does not work for |super|\-|tabular|s and |x|\-|tabular|s.
3049 % \end{Note}
3050 %
3051 % \pagebreak[3]
3052 % \subsection{threeparttable}
3053 % \label{threeparttable}
3054 % \packagedescription{%
3055 % The \pkg{threeparttable} package\cite{threeparttable} provides a scheme
3056 % for tables that have a structured note section after the table contents and
3057 % the caption.
3058 % This scheme provides an answer to the old problem of putting footnotes in
3059 % tables---by making footnotes entirely unnecessary.}
3060 %
3061 % \NEWfeature{v3.1}
3062 % If you want to setup special options for the |three|\-|part|\-|table| and
3063 % |measured|\-|figure| environments you can use
3064 % \begin{quote}
3065 % |\captionsetup[threeparttable]|\marg{options}\quad\emph{and}\\
3066 % |\captionsetup[measuredfigure]|\marg{options}\quad.
3067 % \end{quote}
3068 % These options will be executed additionally to the regular ones for
3069 % |table| or |figure|.
3070 %
3071 % \begin{Note}
3072 % Since the caption will have the same width as the contents here,
3073 % the |margin| or |width| setting will not be used for these figures and tables,
3074 % at least unless you set it explicit with
3075 % |\caption|\-|setup[three|\-|part|\-|table]{|\ldots|}| or
3076 % |\caption|\-|setup[measured|\-|figure]{|\ldots|}|.
3077 % \end{Note}
3078 %
3079 % \medskip
3080 %
3081 % \begin{Annotation*}
3082 % Instead of using the \pkg{threeparttable} package you can
3083 % also use the \pkg{floatrow} package\cite{floatrow} for this purpose.
3084 % \end{Annotation*}
3085 %
3086 % \pagebreak[3]
3087 % \subsection{wrapfig}
3088 % \label{wrapfig}
3089 % \packagedescription{%
3090 % Similar to the \pkg{floatflt}, the \pkg{picinpar}, and the
3091 % \pkg{picins} package the \pkg{wrapfig} package\cite{wrapfig} offers
3092 % figures and tables which do not span the full width of a page and are float
3093 % around by text.
3094 % For a detailed discussion about the differences between these packages
3095 % please take a look at The \LaTeX\ Companion\cite{TLC2}.}
3096 %
3097 % \NEWfeature{v3.1}
3098 % If you want to setup special options for the |wrap|\-|figure| and
3099 % |wrap|\-|table| environments you can use
3100 % \begin{quote}
3101 % |\captionsetup[wrapfigure]|\marg{options}\quad\emph{and}\\
3102 % |\captionsetup[wraptable]|\marg{options}\quad.
3103 % \end{quote}
3104 % These options will be executed additionally to the regular ones for
3105 % |figure| or |table|.
3106 %
3107 % \begin{Note}
3108 % The |margin| or |width| setting will not be used for these figures and
3109 % tables, unless you set it explicit with
3110 % |\caption|\-|setup[wrap|\-|figure]{|\ldots|}|
3111 % or |\caption|\-|setup[wrap|\-|table]{|\ldots|}|.
3112 % \end{Note}
3113 %
3114 % \iffalse
3115 % --------------------------------------------------------------------------- %
3116 % \fi
3117 %
3118 % \clearpage
3119 % \section{Further reading}
3120 %
3121 % I recommend the following documents for further reading:
3122 %
3123 % \begin{itemize}
3124 % \item
3125 % The \TeX\ FAQ -- Frequently asked questions about \TeX\ and \LaTeX:
3126 % \begin{quote}\url{http://faq.tug.org/}\end{quote}
3127 %
3128 % \item
3129 % A French FAQ can be found at
3130 % \begin{quote}\url{http://www.grappa.univ-lille3.fr/FAQ-LaTeX/}\end{quote}
3131 %
3132 % \item
3133 % ``What is a minimal working example?'' from Christian Faulhammer and Ulrich Schwarz:
3134 % \begin{quote}\url{http://www.minimalbeispiel.de/mini-en.html}\end{quote}
3135 %
3136 % \item
3137 % \textsf{epslatex} from Keith Reckdahl contains many tips around
3138 % including graphics in \LaTeXe\ documents.
3139 % You will find this document in the directory
3140 % \begin{quote}\url{http://mirror.ctan.org/info/epslatex/}\end{quote}
3141 % \end{itemize}
3142 %
3143 % \iffalse
3144 % --------------------------------------------------------------------------- %
3145 % \fi
3146 %
3147 % \pagebreak[3]
3148 % \section{Thanks}
3149 %
3150 % I would like to thank Katja Melzner,
3151 % Steven D. Cochran, Frank Mittelbach, Olga Lapko,
3152 % David Carlisle, Carsten Heinz, Keith Reckdahl, Markus Kohm,
3153 % Heiko Oberdiek, and Herbert Vo\ss.
3154 % Thanks a lot for all your help, ideas, patience, spirit, and support!
3155 %
3156 % Also I would like to thank
3157 % Harald Harders,
3158 % Peter L\"offler,
3159 % Peng Yu,
3160 % Alexander Zimmermann,
3161 % Matthias Pospiech,
3162 % J\"urgen Wieferink,
3163 % Christoph Bartoschek,
3164 % Uwe St\"ohr,
3165 % Ralf Stubner,
3166 % Geoff Vallis,
3167 % Florian Keiler,
3168 % J\"urgen G\"obel,
3169 % Uwe Siart,
3170 % Sang-Heon Shim,
3171 % Henrik Lundell,
3172 % David Byers,
3173 % William Asquith,
3174 % Prof.~Dr.~Dirk Hoffmann,
3175 % Frank Martini,
3176 % Danie Els,
3177 % Philipp Woock,
3178 % Fadi Semmo,
3179 % Matthias Stevens, and
3180 % Leo Liu
3181 % who all helped to make this package a better one.
3182 %
3183 % \iffalse
3184 % --------------------------------------------------------------------------- %
3185 % \fi
3186 %
3187 % \clearpage\appendix
3188 % \section{Alphabetical Reference}
3189 %
3190 % \makeatletter
3191 % \newenvironment{Warnings}{%
3192 % \newif\ifMessage
3193 % \def\Message{%
3194 % \ifMessage\end{minipage}\par\vspace\itemsep\pagebreak[3]\fi
3195 % \begin{minipage}{\linewidth}%
3196 % \setlength\parindent{0pt}%
3197 % \setlength\parskip{\smallskipamount}%
3198 % \setlength\leftskip{0pt}%
3199 % \color{blue}%
3200 % \Messagetrue}%
3201 % \def\Description{%
3202 % \par\color{black}\leftskip=1.5em}%
3203 % \def\Or{\@testopt\@Or{or}}%
3204 % \def\@Or[##1]{%
3205 % \\{\small\color{black}\hspace{1.5em}\textit{-- ##1 --}}\\}%
3206 % }{%
3207 % \ifMessage\end{minipage}\par\fi
3208 % }
3209 % \makeatother
3210 %
3211 % \subsection{Options}
3212 % \newcommand\preambleoption{~%
3213 % \begingroup\def\thefootnote{\fnsymbol{footnote}}%
3214 % \footnotemark[2]%
3215 % \endgroup}
3216 % \newcommand\preambleoptiontext{%
3217 % \begingroup\def\thefootnote{\fnsymbol{footnote}}%
3218 % \footnotetext[2]{These options are only available in the preamble of the document.}%
3219 % \endgroup}
3220 %
3221 % \begin{longtable*}{lll}
3222 % Option & Short description & Section \\
3223 % \hline
3224 % \endhead
3225 % |aboveskip| & sets the skip above caption & \ref{skips} \\
3226 % |belowskip| & sets the skip below caption & \ref{skips} \\
3227 % |compatibility|\preambleoption & force (non-)compatibility & \ref{compatibility} \\
3228 % |figureposition|\preambleoption & gives a hint about the figure caption position & \ref{skips} \\
3229 % |font|(|+|) & sets the font & \ref{fonts} \\
3230 % |format| & sets the format & \ref{formats} \\
3231 % \iffalse
3232 % |FPlist| & To where the list entry of a FPfigure should link? & \ref{fltpage} \\
3233 % |FPref| & To where a |\ref| to a FPfigure should link? & \ref{fltpage} \\
3234 % \fi
3235 % |hangindent| & sets the hang indention & \ref{margins} \\
3236 % |hypcap| & selects `hypcap' feature & \ref{hyperref} \\
3237 % |hypcapspace| & sets the distance between hyperlink and contents & \ref{hyperref} \\
3238 % |indention| & sets the indention & \ref{margins} \\
3239 % |justification| & sets the justification & \ref{justification} \\
3240 % |labelfont|(|+|) & sets the font of the caption label & \ref{fonts} \\
3241 % |labelformat| & sets the format of the caption label & \ref{formats} \\
3242 % |labelsep| & sets the label separator & \ref{formats} \\
3243 % |labelseparator| & --same as |labelsep|-- & \ref{formats} \\
3244 % |list| & switches the entries in the List on or off & \ref{lists} \\
3245 % |listformat| & sets the `List of Figure/Table' entry format & \ref{lists} \\
3246 % |margin| & sets the margin & \ref{margins} \\
3247 % |margin*| & sets the margin, but only if no width is set & \ref{margins} \\
3248 % |maxmargin| & sets the max. margin & \ref{margins} \\
3249 % |minmargin| & sets the min. margin & \ref{margins} \\
3250 % |name| & sets the name of the current environment & \ref{names} \\
3251 % |oneside| & selects the one-side mode & \ref{margins} \\
3252 % |options| & executes the given option list & \\
3253 % |parindent| & sets the paragraph indention & \ref{margins} \\
3254 % |parskip| & sets the skip between paragraphs & \ref{margins} \\
3255 % |position| & gives a hint about the caption position & \ref{skips} \\
3256 % |singlelinecheck| & switches the single-line-check on or off & \ref{justification} \\
3257 % |skip| & sets the skip between content and caption & \ref{skips} \\
3258 % |strut| & switches the usage of |\strut|s on or off & \ref{formats} \\
3259 % |style| & sets the caption style & \ref{style} \\
3260 % |subtype| & sets the sub-caption type & \phantom{t}--~\footnotemark \\
3261 % |tableposition|\preambleoption & gives a hint about the table caption position & \ref{skips} \\
3262 % |textfont|(|+|) & sets the font of the caption text & \ref{fonts} \\
3263 % |textformat| & sets the format of the caption text & \ref{formats} \\
3264 % |twoside| & selects the two-side mode & \ref{margins} \\
3265 % |type| & sets the caption type \& places a hyperlink anchor & \ref{types} \\
3266 % |type*| & sets the caption type only & \ref{types} \\
3267 % |width| & sets a fixed caption width & \ref{margins} \\
3268 % \end{longtable*}
3269 % \preambleoptiontext
3270 % \footnotetext{The option \texttt{subtype} is explained in the
3271 % \pkg{subcaption} package documentation.}
3272 %
3273 % \nopagebreak\parbox[t]{\linewidth}{% prevent from page break
3274 % \begin{Note*}
3275 % Obsolete options are not listed here. See
3276 % \longref{caption1} and
3277 % \longref{caption2} for a list of these options.
3278 % \end{Note*}}
3279 %
3280 % \pagebreak[3]
3281 % \subsection{Commands}
3282 %
3283 % \begin{longtable*}{lll}
3284 % Command & & Section \\
3285 % \hline
3286 % \endhead
3287 % |\abovecaptionskip| & & \ref{skips} \\
3288 % |\belowcaptionskip| & & \ref{skips} \\
3289 % |\caption| & & \ref{caption} \\
3290 % |\caption*| & & \ref{caption} \\
3291 % |\captionlistentry| & & \ref{captionlistentry} \\
3292 % |\captionof| & & \ref{caption} \\
3293 % |\captionof*| & & \ref{caption} \\
3294 % |\captionsetup| & & \ref{captionsetup} \\
3295 % |\captionsetup*| & & \ref{captionsetup} \\
3296 % |\centerfirst| & & \ref{justification} \\
3297 % |\centerlast| & & \ref{justification} \\
3298 % |\clearcaptionsetup| & & \ref{captionsetup} \\
3299 % |\clearcaptionsetup*| & & \ref{captionsetup} \\
3300 % |\ContinuedFloat| & & \ref{ContinuedFloat} \\
3301 % |\DeclareCaptionFont| & & \ref{declare} \\
3302 % |\DeclareCaptionFormat| & & \ref{declare} \\
3303 % |\DeclareCaptionFormat*| & & \ref{declare} \\
3304 % |\DeclareCaptionJustification| & & \ref{declare} \\
3305 % |\DeclareCaptionLabelFormat| & & \ref{declare} \\
3306 % |\DeclareCaptionLabelSeparator| & & \ref{declare} \\
3307 % |\DeclareCaptionLabelSeparator*| & & \ref{declare} \\
3308 % |\DeclareCaptionListFormat| & & \ref{declare} \\
3309 % |\DeclareCaptionOption| & & \ref{declare} \\
3310 % |\DeclareCaptionStyle| & & \ref{declare} \\
3311 % |\DeclareCaptionSubType| & & --~\footnotemark \\
3312 % |\DeclareCaptionTextFormat| & & \ref{declare} \\
3313 % |\showcaptionsetup| & & \ref{captionsetup} \\
3314 % \end{longtable*}
3315 % \footnotetext{\cs{DeclareCaptionSubType} is explained in the
3316 % \pkg{subcaption} package documentation.}
3317 %
3318 % \clearpage
3319 % \subsection{Warnings}
3320 %
3321 % \begin{Warnings}
3322 %
3323 % \Message
3324 % |\caption outside box or environment.|
3325 % \Or
3326 % |\captionsetup{type=...} outside box or environment.|
3327 % \Or
3328 % |\captionsetup{type*=...} or \captionof outside box|\\
3329 % | or environment.|
3330 % \Description
3331 % You have placed a |\caption|, |\caption|\-|of|, or
3332 % |\caption|\-|setup{type=|\x\meta{type}|}| command outside an box, group,
3333 % or environment.
3334 % You should not do this since it could cause some bad side-effects.
3335 % \par\See{\longref{types} and \longref{caption}}
3336 %
3337 % \Message
3338 % |\caption will not be redefined since it's already|\\
3339 % |redefined by a document class or package which is|\\
3340 % |unknown to the caption package.|
3341 % \Description
3342 % If \thispackage\ detects that some (unknown) document class or
3343 % package has enhanced |\caption|, it will not redefine
3344 % |\caption|, too, since this would simply kill the enhancement.
3345 % As a result some features, like |\caption*|, |\Continued|\-|Float|,
3346 % using the optional argument of |\caption|\-|setup|,
3347 % or the options |list=| and |hypcap=| will not be available.\par
3348 % If you don't care about the original enhancements but would
3349 % like to use the full range of features of \thispackage\ instead
3350 % you can give the unsupported(!) option |compatibility=|\x|false|
3351 % a try and keep your fingers crossed.
3352 % (But you will get the next warning instead.)
3353 % \par\See{\longref{classes} and \longref{compatibility}}
3354 %
3355 % \Message
3356 % |Forced redefinition of \caption since the|\\
3357 % |unsupported(!) package option `compatibility=false'|\\
3358 % |was given.|
3359 % \Description
3360 % Since you were so keen to specify the option |compatibility=|\x|false|
3361 % \thispackage\ will try to do its best to fulfill your wishes.
3362 % But depending on the document class or other packages you use that
3363 % can end in non-functional features or even errors. So keep your
3364 % fingers crossed!
3365 % \par\See{\longref{compatibility}}
3366 %
3367 % \Message
3368 % |Hyperref support is turned off because hyperref has|\\
3369 % |stopped early.|
3370 % \Description
3371 % If the \pkg{hyperref} package stops early during loading
3372 % (because of what-ever reason), the \pkg{hyperref} support of
3373 % \thispackage\ will not be available. As a result you could get
3374 % \pkg{hyperref} warnings and non-functional hyperlinks to figures
3375 % or tables.
3376 % \par\See{\longref{hyperref}\,}
3377 %
3378 % \Message
3379 % |Ignoring optional argument [|\meta{pos}|] of \setcapwidth.|
3380 % \Description
3381 % \Thispackage\ tries to emulate the \KOMAScript\ commands regarding
3382 % captions as best as it can. But the optional argument of the
3383 % \KOMAScript\ command |\setcapwidth| is not (yet) working if you use
3384 % this package, so if you try to use it anyway, you will get this warning.
3385 % \par\See{\longref{KOMA}}
3386 %
3387 % \Message
3388 % |Internal Warning: |\meta{warning message}|.|
3389 % \Description
3390 % You should never see this warning, either you use a package which redefines
3391 % |figure| or |table| and which is unknown to \thispackage, or this is a bug
3392 % in \thispackage.
3393 % Please send me an e-mail reporting this issue.
3394 %
3395 % \Message
3396 % |\label without proper \caption|
3397 % \Description
3398 % Regarding |\label| the floating environments behave differently than its
3399 % non-floating counterparts: The internal reference will not be generated
3400 % at the beginning of the environment, but at |\caption| instead.
3401 % So you have to place the |\label| command either just \emph{after} or
3402 % \emph{inside} the caption text (mandatory argument of |\caption|).
3403 %
3404 % \Message
3405 % |Option `|\meta{option}|' was not in list `|\meta{option list}|'.|
3406 % \Description
3407 % If you try to remove a specific option of an option list,
3408 % for example with |\clear|\-|caption|\-|setup[po|\-|si|\-|tion]{table}|,
3409 % and this option can not be found inside the option list, you will
3410 % get this warning. If this is not because of a typo and you would like
3411 % to suppress this warning, use |\clear|\-|caption|\-|setup*| instead of
3412 % |\clear|\-|caption|\-|setup|.
3413 % \par\See{\longref{captionsetup}}
3414 %
3415 % \Message
3416 % |Option list `|\meta{option list}|' undefined.|
3417 % \Description
3418 % If you try to remove a specific option of an option list,
3419 % for example with |\clear|\-|caption|\-|setup[for|\-|mat]{figure}|,
3420 % and this option list is not defined (yet), you will
3421 % get this warning. If this is not because of a typo and you would like
3422 % to suppress this warning, use |\clear|\-|caption|\-|setup*| instead of
3423 % |\clear|\-|caption|\-|setup|.
3424 % \par\See{\longref{captionsetup}}
3425 %
3426 % \Message
3427 % |Obsolete option `ignoreLTcapwidth' ignored.|
3428 % \Description
3429 % The \pkg{caption2} package option |ignoreLTcapwidth| will not be
3430 % emulated by this version of \thispackage, usually you can simply wipe it
3431 % away.
3432 % \par\See{\longref{caption2} and \longref{longtable}}
3433 %
3434 % \Message
3435 % |`ragged2e' support has been changed. Rerun to get|\\
3436 % |captions right.|
3437 % \Description
3438 % The \pkg{ragged2e} package will only be loaded by \thispackage\ if it
3439 % is actually needed.
3440 % At least two \LaTeX\ runs are needed for that, so on the first run you could
3441 % get this warning.
3442 % Just compile your document again and this warning should go away.
3443 % \par\See{\longref{justification}}
3444 %
3445 % \Message
3446 % |Reference on page |\meta{page no.}| undefined.|
3447 % \Description
3448 % If you use a |twoside| page layout, \thispackage\ needs to track the
3449 % page numbers to get the margins right.
3450 % At least two \LaTeX\ runs are needed for that, on the first run you could get
3451 % this warning.
3452 % Just compile your document again and this warning should go away.
3453 % \par\See{\longref{margins}}
3454 %
3455 % \Message
3456 % |The caption type was already set to `|\meta{type}|'.|
3457 % \Description
3458 % This warning informs you about mixed caption options. For example if
3459 % you use a |\caption|\-|setup{type=|\x|table}| or
3460 % |\caption|\-|of{table}{|\ldots|}| inside a |figure| environment,
3461 % this would result in using both option sets for that specific caption,
3462 % the one for |figure| (specified with |\caption|\-|setup[figure]{|\ldots|}|)
3463 % and the one for |table| (specified with |\caption|\-|setup[table]{|\ldots|}|)
3464 % as well.\par
3465 % {\small(You can suppress this warning by using the starred form
3466 % |\caption|\-|setup*{type=|\x\ldots|}|.)\par}
3467 % \par\See{\longref{captionsetup}}
3468 %
3469 % \Message
3470 % |The option `hypcap=true' will be ignored for this|\\
3471 % |particular \caption.|
3472 % \Description
3473 % \Thispackage\ hasn't found a proper hyperlink anchor for this particular
3474 % caption, so it decides to ignore the setting |hypcap=|\x|true| (which is set by
3475 % default). As a result a link to this caption (e.g.~in the List of Figures,
3476 % or set by |\ref| or |\auto|\-|ref|) will link you to the caption of the figure
3477 % or table, not to the figure or table itself.\par
3478 % This can happen if you use |\caption|\-|of| inside a non-floating environment,
3479 % but also if you use some package which redefines |figure| or |table|, and
3480 % which is unknown to \thispackage.\par
3481 % If this is ok for you but you want to suppress this warning, simply place a
3482 % |\caption|\-|setup{hyp|\-|cap=|\x|false}| just before the |\caption| or
3483 % |\caption|\-|of| command which is causing the warning.
3484 % If this is not ok for you, you can set a hyperlink anchor with
3485 % |\caption|\-|setup{type=|\x\meta{float type}|}| for yourself.
3486 % \par\See{\longref{hyperref}\,}
3487 %
3488 % \Message
3489 % |Unsupported document class (or package) detected,|\\
3490 % |usage of the caption package is not recommended.|
3491 % \Description
3492 % Either the document class you use is unknown to \thispackage, or you
3493 % have included a package in your document which redefines |\@make|\-|caption|
3494 % (which is responsible for typesetting the caption internally) as well.
3495 % This means \thispackage\ will either change the design of captions in an
3496 % unwanted way, or it even refuses to work correctly at all.
3497 % \par\See{\longref{classes} and \longref{compatibility}}
3498 %
3499 % \Message
3500 % |Unused \captionsetup[|\meta{type}|].|
3501 % \Description
3502 % You have specified options with |\caption|\-|setup[|\meta{type}|]| which are
3503 % not used later on.
3504 % This can be because of a typo in \meta{type},
3505 % or because you use a package which redefines |figure| or |table| and
3506 % which is unknown to \thispackage, or simply because you don't have any usage
3507 % of the environment \meta{type} after this line.
3508 % (If you want to suppress this warning you can use |\caption|\-|setup*|
3509 % instead of |\caption|\-|setup|.)
3510 % \par\See{\longref{captionsetup}}
3511 %
3512 % \Message
3513 % |Usage of the |\meta{package}| package together with the|\\
3514 % |caption package is strongly not recommended.|\\
3515 % |Instead of loading the |\meta{package}| package you should|\\
3516 % |use the caption package option `tableposition=top'.|
3517 % \Description
3518 % The package \meta{package} is dealing with caption skips as well.
3519 % Please decide which one do you actually want to use, \thispackage\ or the
3520 % other one, using both can lead to wrong skips above or below the caption.
3521 % \par\See{\longref{skips}}
3522 %
3523 % \end{Warnings}
3524 %
3525 % \pagebreak[3]
3526 % \subsection{Errors}
3527 %
3528 % \begin{Warnings}
3529 %
3530 % \Message
3531 % |Argument of \@caption has an extra }.|
3532 % \Or
3533 % |Paragraph ended before \@caption was complete.|
3534 % \Description
3535 % If you want to typeset something special (like a tabular) as caption,
3536 % you need to give an optional argument to |\caption| or |\caption|\-|of|
3537 % for the List of Figures or List of Tables, too, even if you don't
3538 % use such list.
3539 % \par\See{\longref{caption}, \longref{lists}, and \longref{hyperref}\,}
3540 %
3541 % \Message
3542 % |\caption outside float.|
3543 % \Description
3544 % You have placed a |\caption| command outside a floating environment, or
3545 % a |long|\-|table| or |wrap|\-|figure|.
3546 % If this is what you want to, please use either
3547 % |\caption|\-|setup{type=|\x\meta{type}|}| $+$ |\caption| or
3548 % |\caption|\-|of|.
3549 % \par\See{\longref{caption}}
3550 %
3551 % \Message
3552 % |\ContinuedFloat outside float.|
3553 % \Description
3554 % You have placed a |\Continued|\-|Float| command outside a floating
3555 % environment. % or |long|\-|table|.
3556 % If this is what you want to, please use the combination
3557 % |\caption|\-|setup{type=|\x\meta{type}|}| $+$ |\Continued|\-|Float|.\par
3558 % Please note that |\Continued|\-|Float| inside a |long|\-|table| is not
3559 % working, but maybe using the |long|\-|table*| environment, which
3560 % typesets a |long|\-|table| without incrementing the |table| counter,
3561 % if sufficient for you.
3562 % \par\See{\longref{ContinuedFloat} and \longref{longtable}}
3563 %
3564 % \Message
3565 % |Continued `|\meta{type}|' after `|\meta{type}|'.|
3566 % \Description
3567 % Continued figures or tables are not allowed to be interrupted by a floating
3568 % environment (or |long|\-|table|) of another type,
3569 % e.g.~a table between a figure and a continued figure.
3570 % \par\See{\longref{ContinuedFloat}}
3571 %
3572 % \Message
3573 % |For a successful cooperation we need at least version|\\
3574 % |`|\meta{date}|' of package |\meta{package}|, but only version|\\
3575 % |`|\meta{old-date}|' is available.|
3576 % \Description
3577 % \Thispackage\ does not work with such an outdated package, please update it
3578 % to a more recent version, at least to the one requested.
3579 %
3580 % \Message
3581 % |Internal Error: |\meta{error message}|.|
3582 % \Description
3583 % You should never see this error.
3584 % Please send me an e-mail reporting this issue.
3585 %
3586 % \Message
3587 % |No float type '|\meta{type}|' defined.|
3588 % \Description
3589 % The \meta{type} you have specified in |\caption|\-|setup{type=|\x\meta{type}|}|,
3590 % |\caption|\-|of|\marg{type}, or |\Declare|\-|Caption|\-|Sub|\-|Type| is
3591 % not defined.
3592 % \meta{type} should be either `\texttt{figure}' or `\texttt{table}', or
3593 % any other floating environment defined with
3594 % |\Declare|\-|Floating|\-|Environment| offered by the \pkg{newfloat} package,
3595 % |\new|\-|float| offered by the \pkg{float} package\cite{float}, or
3596 % |\Declare|\-|New|\-|Float|\-|Type| offered by the \pkg{floatrow} package\cite{floatrow}.
3597 %
3598 % \Message
3599 % |Not allowed in longtable* environment.|
3600 % \Description
3601 % The usage of |\caption| is not allowed inside the |long|\-|table*| environment.
3602 % Please use either |\caption*| for a caption without label or use the regular
3603 % |long|\-|table| environment instead.
3604 %
3605 % \Message
3606 % |Not available in compatibility mode.|
3607 % \Description
3608 % The feature required is not supported in compatibility mode.
3609 % `compatibility mode' means that \thispackage\ has detected either an
3610 % incompatible document class or an incompatible package which also
3611 % extents the |\caption| command. Leaving the original extension intact,
3612 % some features of \thispackage\ are not supported.
3613 % \par\See{\longref{compatibility}}
3614 %
3615 % \Message
3616 % |Only one \caption can be placed in this environment.|
3617 % \Description
3618 % Inside the environments offered by the \pkg{fltpage} and \pkg{sidecap}
3619 % package only \emph{one} caption can be placed. (This is due implementation design.)
3620 %
3621 % \Message
3622 % |Paragraph ended before \caption@makecurrent was complete.|
3623 % \Or
3624 % |Paragraph ended before \caption@prepareanchor was complete.|
3625 % \Description
3626 % If you want to typeset multi-paragraph captions, you need to give an
3627 % optional argument to |\caption| or |\caption|\-|of| for the List of
3628 % Figures or List of Tables, too, even if you don't use such list.
3629 % \par\See{\longref{caption}, \longref{lists}, and \longref{hyperref}\,}
3630 %
3631 % \Message
3632 % |Something's wrong--perhaps a missing \caption|\\
3633 % |in the last figure or table.|
3634 % \Description
3635 % It seems that you have used a |\sub|\-|caption| command (or a different one
3636 % which has typeset a sub-caption) without a corresponding |\caption| command.
3637 % This is not supported.
3638 %
3639 % \Message
3640 % |The option `labelsep=|\meta{name}|' does not work|\\
3641 % |with `format=hang'.|
3642 % \Or
3643 % |The option `labelsep=|\meta{name}|' does not work|\\
3644 % |with \setcaphanging (which is set by default).|
3645 % \Description
3646 % A caption label separator which contains a |\\| command (like
3647 % |labelsep=|\x|newline|) can not be combined with a hanging caption format
3648 % (like |format=|\x|hang|).
3649 % Please select either another caption label separator
3650 % (e.g.~|labelsep=|\x|colon|) or another caption format
3651 % (e.g.~|format=|\x|plain|).
3652 % \par\See{\longref{formats} or \longref{KOMA}}
3653 %
3654 % \Message
3655 % |The package option `caption=false' is obsolete.|\\
3656 % |Please pass this option to the subfig package instead|\\
3657 % |and do *not* load the caption package anymore.|
3658 % \Description
3659 % You have specified the option |caption=|\x|false|. This used to be a workaround
3660 % for not using the whole \pkg{caption} package (leaving the caption stuff
3661 % offered by the document class or other packages intact), but keeping the
3662 % \pkg{subfig} package working. This mechanism is obsolete and not offered
3663 % anymore, please pass this option to the \pkg{subfig} package instead and
3664 % do not load \thispackage\ anymore.
3665 % \par\See{the \pkg{subfig} package\cite{subfig} documentation}
3666 %
3667 % \Message
3668 % |Undefined boolean value `|\meta{value}|'.|
3669 % \Description
3670 % You tried to set a boolean option (like |singlelinecheck=| or |hypcap=|)
3671 % with an improper value. Only |false|, |no|, |off|, |0| or |true|, |yes|,
3672 % |on|, |1| is allowed here.
3673 %
3674 % \Message
3675 % |Undefined format `|\meta{name}|'.|
3676 % \Description
3677 % You tried to set a caption format which does not exists.
3678 % Maybe a typo!?
3679 % \par\See{\longref{formats}}
3680 %
3681 % \Message
3682 % |Undefined label format `|\meta{name}|'.|
3683 % \Description
3684 % You tried to set a caption label format which does not exists.
3685 % Maybe a typo!?
3686 % \par\See{\longref{formats}}
3687 %
3688 % \Message
3689 % |Undefined label separator `|\meta{name}|'.|
3690 % \Description
3691 % You tried to set a caption label separator which does not exists.
3692 % Maybe a typo!?
3693 % \par\See{\longref{formats}}
3694 %
3695 % \Message
3696 % |Undefined list format `|\meta{name}|'.|
3697 % \Description
3698 % You tried to set a caption list-of format which does not exists.
3699 % Maybe a typo!?
3700 % \par\See{\longref{lists}}
3701 %
3702 % \Message
3703 % |Undefined position `|\meta{name}|'.|
3704 % \Description
3705 % You tried to set a caption position with an improper value.
3706 % Maybe a typo!?
3707 % \par\See{\longref{skips}}
3708 %
3709 % \Message
3710 % |Undefined style `|\meta{name}|'.|
3711 % \Description
3712 % You tried to set a caption style which does not exists.
3713 % Maybe a typo!?
3714 % \par\See{\longref{style}}
3715 %
3716 % \Message
3717 % |Usage of the `position' option is incompatible|\\
3718 % |to the `|\meta{package}|' package.|
3719 % \Description
3720 % The given package is dealing with caption skips as well.
3721 % Please decide which one do you actually want to use: The |position=| option
3722 % of \thispackage\ or the mechanism of the other one; using both this way
3723 % would lead to wrong skips above or below the caption and is therefore
3724 % not supported.
3725 % \par\See{\longref{skips}}
3726 %
3727 % \Message
3728 % |Undefined text format `|\meta{name}|'.|
3729 % \Description
3730 % You tried to set a caption text format which does not exists.
3731 % Maybe a typo!?
3732 % \par\See{\longref{formats}}
3733 %
3734 % \Message
3735 % |You can't use both, the (obsolete) caption2 *and*|\\
3736 % |the (current) caption package.|
3737 % \Description
3738 % This error message says it all, you simply can't do that.
3739 % Please use only \thispackage.
3740 % \par\See{\longref{caption2}}
3741 %
3742 % \end{Warnings}
3743 %
3744 % \iffalse
3745 % --------------------------------------------------------------------------- %
3746 % \fi
3747 %
3748 % \clearpage
3749 % \section{Version history}
3750 % \label{history}
3751 %
3752 % The version $1.0$ was written in 1994 and was offering a handful of options
3753 % to customize the look \& feel of the captions.
3754 % Furthermore this version already supported the \pkg{rotating} and
3755 % \pkg{subfigure} packages.
3756 % Version $1.1$ introduced the |center|\-|last| option;
3757 % version $1.2$ added the support of the \pkg{float} package.
3758 % Version $1,3$ offered a better support of the \pkg{subfigure} package,
3759 % while version $1.4$ came with the new option |nooneline|.
3760 %
3761 % The \pkg{caption2} package $2.0$ was an experimental side-version of
3762 % the regular \pkg{caption} package. It was made public as beta test version
3763 % without proper documentation in 1995 because of the strong demand for new
3764 % features and adaptations to additional packages like the \pkg{longtable}
3765 % package.
3766 % Furthermore it offered a revised support of the \pkg{subfigure} package.
3767 % (An improved version $2.1$ was offered in 2002.)
3768 %
3769 % In 2003 I finally found some time, so a new regular release $3.0$
3770 % of the \pkg{caption} package could be build in cooperation with
3771 % Frank Mittelbach and Steven Cochran.
3772 % It was released in December 2003 and superseded the neglected
3773 % \pkg{caption2} package.
3774 % Main parts were re-written and it provided a complete re-work of
3775 % the user interface.
3776 % Furthermore it supported the \pkg{hyperref}, \pkg{hypcap},
3777 % \pkg{listings}, \pkg{sidecap}, and \pkg{supertabular} packages
3778 % additionally.
3779 %
3780 % While all the previous versions were designed for usage with the standard
3781 % \LaTeX\ document classes \cls{article}, \cls{report}, and \cls{book},
3782 % the current version $3.1$ released in 2007 also supports the \AmS,
3783 % \KOMAScript, \NTG, and \SmF\ document classes, and the \cls{beamer} class
3784 % as well.
3785 % Furthermore it was adapted to the \pkg{french} Babel option,
3786 % the \pkg{frenchle} \& \pkg{frenchpro} packages,
3787 % and the \pkg{floatflt}, \pkg{fltpage}, \pkg{picinpar},
3788 % \pkg{picins}, \pkg{setspace}, \pkg{threeparttable},
3789 % and \pkg{wrapfig} packages.
3790 % New options and commands were introduced as well, among other things
3791 % |font+|, |figure|\-|within| \& |table|\-|within|,
3792 % |list| \& |list|\-|format|, |max|\-|margin| \& |min|\-|margin|,
3793 % |\caption|\-|list|\-|entry|, |\Declare|\-|Caption|\-|List|\-|Format|.
3794 % Further benefits are the new compatibility check \see*{\longref{compatibility}},
3795 % the new ``hypcap'' feature \see*{\longref{hyperref}\,}, and the sub-caption
3796 % feature \see*{\pkg{subcaption} package documentation}.
3797 %
3798 % \iffalse
3799 % --------------------------------------------------------------------------- %
3800 % \fi
3801 %
3802 % \clearpage
3803 % \section{Compatibility to older versions}
3804 %
3805 % \subsection{caption v\texorpdfstring{$1.x$}{1.x}}
3806 % \label{caption1}
3807 %
3808 % This version of \thispackage\ still supports the old options
3809 % and commands provided by the version $1.0$ to $1.4$ of this package.
3810 % So there shouldn't occur any problems compiling old documents, but please
3811 % don't mix old options and commands with the new ones. This isn't supported
3812 % and can cause ugly side effects.
3813 %
3814 % Here comes a short oversight of the obsolete options and how
3815 % they have been replaced within this version of \thispackage:
3816 %
3817 % \begin{center}\small
3818 % \begin{tabular}{ll}
3819 % \pkg{caption} \version{1.x} & \pkg{caption} \version{3.x}\\
3820 % \hline
3821 % |normal| & |format=plain|\\
3822 % |hang| & |format=hang|\\
3823 % |isu| & |format=hang|\\
3824 % |center| & |justification=centering|\\
3825 % |centerlast| & |justification=centerlast|\\
3826 % |nooneline| & |singlelinecheck=off|\\
3827 % |scriptsize| & |font=scriptsize|\\
3828 % |footnotesize| & |font=footnotesize|\\
3829 % |small| & |font=small|\\
3830 % |normalsize| & |font=normalsize|\\
3831 % |large| & |font=large|\\
3832 % |Large| & |font=Large|\\
3833 % |up| & |labelfont=up|\\
3834 % |it| & |labelfont=it|\\
3835 % |sl| & |labelfont=sl|\\
3836 % |sc| & |labelfont=sc|\\
3837 % |md| & |labelfont=md|\\
3838 % |bf| & |labelfont=bf|\\
3839 % |rm| & |labelfont=rm|\\
3840 % |sf| & |labelfont=sf|\\
3841 % |tt| & |labelfont=tt|\\
3842 % \end{tabular}
3843 % \end{center}
3844 %
3845 % Beside the options for setting up the desired font there were also
3846 % the commands |\caption|\-|size| or |\caption|\-|font| and
3847 % |\caption|\-|label|\-|font| who could be redefined with
3848 % |\re|\-|new|\-|command| and allowed an alternate and more flexible way to
3849 % change the font used for captions.
3850 % This mechanism was replaced by the commands
3851 % \begin{quote}
3852 % |\DeclareCaptionFont{|\ldots|}{|\ldots|}|\qquad and\\
3853 % |\captionsetup{font=|\ldots|,labelfont=|\ldots|}|\qquad.
3854 % \end{quote}
3855 % \SeeUserDefined
3856 %
3857 % Setting the margin for captions was done in \version{1.x} with
3858 % \begin{quote}
3859 % |\setlength{\captionmargin}{|\ldots|}|\quad.
3860 % \end{quote}
3861 % This was replaced by
3862 % \begin{quote}
3863 % |\captionsetup{margin=|\ldots|}|\qquad.
3864 % \end{quote}
3865 % \See{\longref{margins}}
3866 %
3867 % For example the old-style code
3868 % \begin{quote}
3869 % |\usepackage[hang,bf]{caption}|\\
3870 % |\renewcommand\captionfont{\small\sffamily}|\\
3871 % |\setlength\captionmargin{10pt}|
3872 % \end{quote}
3873 % will still work fine, but should be written today as
3874 % \begin{quote}
3875 % |\usepackage[format=hang,labelfont=bf,font={small,sf},|\\
3876 % | margin=10pt]{caption}|
3877 % \end{quote}
3878 % or
3879 % \begin{quote}
3880 % |\usepackage{caption}|\\
3881 % |\captionsetup{format=hang,labelfont=bf,font={small,sf},|\\
3882 % | margin=10pt}|\qquad.
3883 % \end{quote}
3884 %
3885 % The quite exotic option |ruled| which allowed a partial usage of
3886 % the caption settings for |ruled| floats defined with the
3887 % \pkg{float} package will be emulated by this version of the
3888 % caption package, too.
3889 % But using this option is not recommended anymore since this
3890 % version of \thispackage\ offers a more flexible way
3891 % for changing the captions of these floating environments:
3892 % \begin{quote}
3893 % |\DeclareCaptionStyle{ruled}{|\ldots|}|
3894 % \end{quote}
3895 % or
3896 % \begin{quote}
3897 % |\captionsetup[ruled]{|\ldots|}|\qquad.
3898 % \end{quote}
3899 % \SeeUserDefined[, \longref{captionsetup}, and \longref{float}]
3900 %
3901 % \subsection{caption2 v\texorpdfstring{$2.x$}{2.x}}
3902 % \label{caption2}
3903 %
3904 % Although they do very similar stuff, the packages \pkg{caption} and
3905 % its experimental and now obsolete variant \pkg{caption2} have a
3906 % very different implementation design.
3907 % Therefore a full compatibility could not be offered.
3908 % For that reason you will still find a file called |caption2.sty| in
3909 % this package distribution, so old documents using the \pkg{caption2}
3910 % package will still compile fine.
3911 %
3912 % Newly created documents should use the actual version of
3913 % \thispackage\ instead. In most cases it's sufficient to replace the command
3914 % \begin{quote}
3915 % |\usepackage[...]{caption2}|
3916 % \end{quote}
3917 % by
3918 % \begin{quote}
3919 % |\usepackage[...]{caption}|\qquad.
3920 % \end{quote}
3921 % But some options and commands will not be emulated, so you can get
3922 % error messages afterwards. This section will hopefully help you removing
3923 % these errors. If you have problems migrating from \pkg{caption2}
3924 % to \pkg{caption} please don't hesitate to send me an e-mail asking
3925 % for help.
3926 %
3927 % In addition to the obsolete options shown in the last section
3928 % these ones will be emulated, too:
3929 %
3930 % \begin{center}\small
3931 % \begin{tabular}{ll}
3932 % \pkg{caption2} \version{2.x} & \pkg{caption} \version{3.x}\\
3933 % \hline
3934 % |flushleft| & |justification=raggedright|\\
3935 % |flushright| & |justification=raggedleft|\\
3936 % |oneline| & |singlelinecheck=on|\\
3937 % \end{tabular}
3938 % \end{center}
3939 %
3940 % Setting the margin for captions was done in \version{2.x} with
3941 % \begin{quote}\leavevmode\hbox{%
3942 % |\setcaptionmargin{|\ldots|}| or
3943 % |\setcaptionwidth{|\ldots|}|\quad.
3944 % }\end{quote}
3945 % This was replaced by
3946 % \begin{quote}\leavevmode\hbox{%
3947 % |\captionsetup{margin=|\ldots|}| or
3948 % |\captionsetup{width=|\ldots|}|\quad.
3949 % }\end{quote}
3950 % \See{\longref{margins}}
3951 %
3952 % Setting an indention was done in \version{2.x} with
3953 % \begin{quote}
3954 % |\captionstyle{indent}|\\
3955 % |\setlength\captionindent{|\ldots|}|\quad.
3956 % \end{quote}
3957 % \pagebreak[3]
3958 % This is now done with
3959 % \nopagebreak[3]
3960 % \begin{quote}
3961 % |\captionsetup{format=plain,indention=|\ldots|}|\quad.
3962 % \end{quote}
3963 %
3964 % The so-called single-line-check was controlled by the commands
3965 % |\oneline|\-|captions|\-|false| (for switching the check off) and
3966 % |\oneline|\-|captions|\-|true| (for switching the check on).
3967 % This was replaced by
3968 % |\caption|\-|setup{single|\-|line|\-|check=|\x|off}|
3969 % or
3970 % |\caption|\-|setup{single|\-|line|\-|check=|\x|on}|\quad.
3971 % \See{\longref{justification}}
3972 %
3973 % The commands
3974 % \begin{quote}
3975 % |\captionlabeldelim|, |\captionlabelsep|, |\captionstyle|,\\
3976 % |\defcaptionstyle|, |\newcaptionstyle|, and |\renewcaptionstyle|
3977 % \end{quote}
3978 % do not have a simple replacement and therefore will not be emulated
3979 % by this version of \thispackage. (So using them will
3980 % cause error messages.) Rewriting such code is not always easy and
3981 % straight-ahead, but by conscientious reading of this manual you should
3982 % be able to find appropriate options and commands instead.
3983 %
3984 % \iffalse
3985 % ... (some examples)
3986 % \fi
3987 %
3988 % The \version{2.x} option |ignore|\-|LT|\-|cap|\-|width| do not have a
3989 % replacement, too.
3990 % But in most cases you can simply drop using that option because
3991 % in this version of \thispackage\ the value of |\LT|\-|cap|\-|width|
3992 % will be ignored anyway (unless you set it to a different value than the
3993 % default one which is |4in|).
3994 % \See{\longref{longtable}}
3995 %
3996 % \subsection{caption v\texorpdfstring{$3.0$}{3.0}}
3997 % \label{caption3}
3998 %
3999 % \Thispackage\ \version{3.0} did not support any document classes
4000 % other than the standard \LaTeX\ ones: \cls{article}, \cls{report},
4001 % and \cls{book}.
4002 % Therefore the default settings used to be fixed, but now \thispackage{}
4003 % supports more classes, therefore they are now set in dependence on the
4004 % document class used.
4005 %
4006 % For example: While in \version{3.0} the default caption
4007 % |jus|\-|ti|\-|fi|\-|ca|\-|tion| used to be always |jus|\-|ti|\-|fied|,
4008 % it's now still |jus|\-|ti|\-|fied| when using one of the standard document
4009 % classes, but |ragged|\-|right| will be used as default format when used
4010 % with the \cls{beamer} document class.
4011 %
4012 % An easy way to select the `old' defaults is using the option
4013 % |style=base| when loading \thispackage\ (or later on using |\caption|\-|setup|).
4014 %
4015 % \medskip
4016 %
4017 % Another new feature is the automatic check for compatibility; if an
4018 % incompatibility will be found, a warning message will be issued and if a strong
4019 % incompatibility was found some features of \thispackage\ will be disabled.
4020 % Please note that only this check was added to \thispackage, so if you get
4021 % such warning message, the previous versions of \thispackage\ were incompatible
4022 % as well, but did not issued such warning, they were ``only'' having
4023 % side-effects or causing problems.
4024 % So these warnings only say that some bad side effects or problems could
4025 % happen, but not that they actually will happen.
4026 % Anyway, if you use \thispackage\ in such circumstances,
4027 % you should use it with care.
4028 %
4029 % \bigskip
4030 %
4031 % \begin{Note*}
4032 % \Thispackage\ \version{3.0} offered the option |caption=|\x|false|,
4033 % which used to be a workaround for not using the whole \pkg{caption} package
4034 % (leaving the caption stuff offered by the document class or other packages
4035 % intact), but keeping the \pkg{subfig} package\cite{subfig} working.
4036 % This mechanism is obsolete and not offered anymore, please pass this option
4037 % to the \pkg{subfig} package instead and do not load \thispackage\ anymore.
4038 % \end{Note*}
4039 %
4040 % \iffalse
4041 % --------------------------------------------------------------------------- %
4042 % \fi
4043 %
4044 % \clearpage
4045 % \section{Commands for document class authors}
4046 %
4047 % A document class could simply load the \pkg{caption} package instead
4048 % of defining an own variant of |\@make|\-|caption|. However if the author decides
4049 % not to do this -- for whatever reason -- there is a second option:
4050 %
4051 % \NEWfeature{v3.5}
4052 % If a document class defines |\caption@document|\-|class|, an adaption to the
4053 % \pkg{caption} package will be loaded as |caption-|\meta{documentclass}|.sto|
4054 % if the \pkg{caption} kernel is loaded.
4055 % The goal of this adaption file is changing the default settings of the
4056 % \pkg{caption} package so simply loading it (without any package options)
4057 % will not make any harm to the look at feel of the captions.
4058 % This gives end-users the opportunity to fine-tune certain aspects of the
4059 % appearance of captions by adding package options, without unwanted
4060 % side-effects on other aspects of the appearance.
4061 %
4062 % In both cases the command |\Set|\-|Caption|\-|Default|
4063 % could be used to adapt the \pkg{caption} package default values:
4064 %
4065 % \DescribeMacro{\SetCaptionDefault}
4066 % The command
4067 % \begin{quote}
4068 % |\SetCaptionDefault*|\marg{option}\marg{default value}
4069 % \end{quote}
4070 % changes the default value for the option \meta{option}, for example:
4071 % \begin{quote}
4072 % |\SetCaptionDefault{format}{hang}|\\
4073 % |\SetCaptionDefault{justification}{raggedright}|\\
4074 % |\DeclareCaptionLabelSeparator{silly}{ +++ }|\\
4075 % |\SetCaptionDefault{labelseparator}{silly}|
4076 % \end{quote}
4077 % This command is available for the options
4078 % |box|,
4079 % |font|,
4080 % |format|,
4081 % |justification|,
4082 % |label|\-|font|,
4083 % |label|\-|format|,
4084 % |label|\-|separator|,
4085 % |list|\-|format|,
4086 % |margin|,
4087 % |parbox|,
4088 % |position|,
4089 % |single|\-|line|\-|check|,
4090 % |text|\-|font|,
4091 % |text|\-|format|, and
4092 % |width|.
4093 %
4094 % The starred variant only makes a difference when setting the default length
4095 % of either |margin| or |width|, in this case it will use |\def| internally
4096 % instead of |\edef| to store the value so the actual margin will be calculated
4097 % when used (and not when set).
4098 %
4099 % \DescribeMacro{\SetCaptionFallback}
4100 % The command
4101 % \begin{quote}
4102 % |\SetCaptionFallback|\marg{option}\marg{fallback value}
4103 % \end{quote}
4104 % changes the fallback value for the option \meta{option}, for example:
4105 % \begin{quote}
4106 % |\SetCaptionFallback{labelformat}{simple}|
4107 % \end{quote}
4108 % Currently only the pre-defined label format `original' uses a fallback
4109 % value when |\fnum@|\meta{environment} is not defined for the current (floating)
4110 % environment.
4111 %
4112 % \DescribeMacro{\AtCaptionPackage}
4113 % The adaption file will be loaded when the \pkg{caption} kernel |caption3.sty|
4114 % will be loaded so the given adaptions will be done for the \pkg{floatrow}
4115 % and \pkg{subfig} packages even if the \pkg{caption} package isn't loaded.
4116 %
4117 % But some adaptions have to be done for the \pkg{caption} package,
4118 % and for this reason the hook
4119 % \begin{quote}|\AtCaptionPackage|\marg{code}\end{quote}
4120 % is offered to authors of adaption files.
4121 % The \meta{code} inside the hook will be executed right before the given package
4122 % options will be evaluated.
4123 %
4124 % For example the adaption file for the \KOMAScript\ document classes
4125 % uses |\At|\-|Begin|\-|Caption| to re-define the \pkg{caption} package
4126 % options |figure|\-|position| and |table|\-|position| to issue a warning
4127 % that using these options have little effect here.
4128 %
4129 % \DescribeMacro{\AfterCaptionPackage}
4130 % The additional hook
4131 % \begin{quote}|\AfterCaptionPackage|\marg{code}\end{quote}
4132 % is offered to authors of adaption files as well.
4133 % The \meta{code} inside the hook will be executed at the very end of the
4134 % \pkg{caption} package.
4135 %
4136 % \iffalse
4137 % --------------------------------------------------------------------------- %
4138 % \fi
4139 %
4140 % \clearpage
4141 % \section{Commands for babel language package authors}
4142 %
4143 % \NEWfeature{v3.5}
4144 % \DescribeMacro{\caption@switchdefault}
4145 % If the \pkg{caption3} kernel package is loaded, the command
4146 % \begin{quote}|\caption@switchdefault|\marg{option}\marg{code with \#1}\marg{new value}\end{quote}
4147 % is available which saves the old default value of the given option using
4148 % \meta{code} and sets the new default value afterwards.
4149 %
4150 % \DescribeMacro{\caption@restoredefault}
4151 % The command
4152 % \begin{quote}|\caption@restoredefault|\marg{option}\marg{old value}\end{quote}
4153 % restores the old default value which was stored in \meta{old value} before.
4154 %
4155 % Example:
4156 % \begin{quote}
4157 % |\DeclareCaptionLabelSeparator{french}{|\ldots|}|\\
4158 % |\addto\extrasfrench{%|\\
4159 % | \caption@switchdefault{labelseparator}{\babel@save #1}{french}}|\\
4160 % |% Note: \caption@restoredefault isn't needed here|
4161 % \end{quote}
4162 %
4163 % Another example:
4164 % \begin{quote}
4165 % |\caption@switchdefault{font}{\let\original@captionfont#1}{it}%|\\
4166 % \ldots\\
4167 % |\caption@restoredefault{font}{\original@captionfont}%|\\
4168 % \end{quote}
4169 %
4170 % Since boths commands are defined with |\def| inside the \pkg{caption3}
4171 % kernel, they could be pre-defined with
4172 % \begin{quote}
4173 % |\providecommand\caption@switchdefault[3]{}|\\
4174 % |\providecommand\caption@restoredefault[2]{}|
4175 % \end{quote}
4176 % inside the babel language package so their existence doesn't need to be tested
4177 % prior use.
4178 %
4179 % Additionally babel language packages should not re-define |\@make|\-|caption|
4180 % if the \pkg{caption} package is loaded, i.e.~if |\caption@makecaption| is
4181 % defined. (Unfortunately one cannot use the \LaTeX{} kernel command
4182 % |\@if|\-|package|\-|loaded{caption}| here since it's only available in the
4183 % document preamble.)
4184 %
4185 % Please note that code like
4186 % \begin{quote}
4187 % |\addto\extraswhatever{%|\\
4188 % | \@ifundefined{caption@makecaption}{%|\\
4189 % | \babel@save\@makecaption|\\
4190 % | \let\@makecaption\my@makecaption|\\
4191 % | }{%|\\
4192 % | \caption@switchdefault{|\ldots|}{\babel@save #1}{|\ldots|}%|\\
4193 % | }}|
4194 % \end{quote}
4195 % would be wrong since it mixes up the presence of the \pkg{caption3} kernel
4196 % and the \pkg{caption} package.
4197 % If the \pkg{caption3} kernel is loaded this does not mean that the
4198 % \pkg{caption} package is loaded, too, and the latter one re-defines
4199 % |\caption|, |\@caption|, and |\@make|\-|caption| while the \pkg{caption3}
4200 % kernel does not re-define any of them, instead it only provides (default) values
4201 % for the \pkg{caption}, \pkg{floatrow}, and \pkg{subfig} package.
4202 %
4203 % Currently there is build-in support for the following babel language options:
4204 % |arabic|, |farsi|, |french|, |hungarian|, |latvian|, and |magyar|.
4205 % This support could be deactivated by defining
4206 % \begin{quote}
4207 % |\def\caption@ifbabel@|\meta{package}|{false}|
4208 % \end{quote}
4209 % where \meta{package} is either |arabi|, |french|, |frenchle|, |hungarian|,
4210 % or |latvian|.
4211 %
4212 % \iffalse
4213 % --------------------------------------------------------------------------- %
4214 % \fi
4215 %
4216 % \pagebreak[4]
4217 % \section*{Internal commands}
4218 %
4219 % These internal commands are save to use by other packages as well
4220 % since their interface will not change in future releases:
4221 % \begin{quote}\begin{tabular}{ll}
4222 % Internal command & Currently used by \\
4223 % \hline
4224 % |\caption@kernel@addcontentsline| & \pkg{floatrow} \\
4225 % |\caption@settype| & \pkg{newfloat} \\
4226 % |\caption@xlabel| & \pkg{cleveref} \\
4227 % \end{tabular}\end{quote}
4228 %
4229 % If your package wants to use any other internal command of the \pkg{caption} package,
4230 % please write me an e-mail so we can define a proper interface together.
4231 %
4232 % The \pkg{lwarp} package uses a lot of internal commands as well,
4233 % but we are working on it on the Git branch \texttt{feature/lwarp}:
4234 % \url{https://gitlab.com/axelsommerfeldt/caption/-/tree/feature/lwarp}
4235 %
4236 % \iffalse
4237 % --------------------------------------------------------------------------- %
4238 % \fi
4239 %
4240 % \StopEventually{%^^A
4241 % \begin{thebibliography}{99}
4242 %
4243 % \bibitem{TLC2}
4244 % Frank Mittelbach and Michel Goossens:\\
4245 % \newblock {\em The {\LaTeX} Companion (2nd.~Ed.)},\\
4246 % \newblock Addison-Wesley, 2004.
4247 %
4248 % \bibitem{beamer}
4249 % Till Tantau:\\
4250 % \href{http://www.ctan.org/pkg/beamer}%
4251 % {\emph{User Guide to the Beamer Class, Version 3.07}},\\
4252 % March 11, 2007
4253 %
4254 % \bibitem{KOMAScript}
4255 % Markus Kohm \& Jens-Uwe-Morawski:\\
4256 % \href{http://www.ctan.org/pkg/koma-script}%
4257 % {\emph{KOMA-Script -- a versatile \LaTeXe\ bundle}},\\
4258 % 2007-01-09
4259 %
4260 % \bibitem{NTG}
4261 % Victor Eijkhout:\\
4262 % \href{http://www.ctan.org/pkg/ntgclass}%
4263 % {\emph{An introduction to the Dutch \LaTeX\ document classes}},\\
4264 % 3 September 1989
4265 %
4266 % \bibitem{algorithms}
4267 % Rog\'erio Brito:\\
4268 % \href{http://www.ctan.org/pkg/algorithms}%
4269 % {\emph{Algorithms}},\\
4270 % June 2, 2006
4271 %
4272 % \bibitem{float}
4273 % Anselm Lingnau:\\
4274 % \href{http://www.ctan.org/pkg/float}%
4275 % {\emph{An Improved Environment for Floats}},\\
4276 % 2001/11/08
4277 %
4278 % \bibitem{floatflt}
4279 % Mats Dahlgren:\\
4280 % \href{http://www.ctan.org/pkg/floatflt}%
4281 % {\emph{Welcome to the floatflt package}},\\
4282 % 1998/06/05
4283 %
4284 % \bibitem{floatrow}
4285 % Olga Lapko:\\
4286 % \href{http://www.ctan.org/pkg/floatrow}%
4287 % {\emph{The floatrow package documentation}},\\
4288 % 2009/08/02
4289 %
4290 % \bibitem{fltpage}
4291 % Sebastian Gross:\\
4292 % \href{http://www.ctan.org/pkg/fltpage}%
4293 % {\emph{Welcome to the beta test of fltpage package!}},\\
4294 % 1998/11/13
4295 %
4296 % \bibitem{hyperref}
4297 % Sebastian Rahtz \& Heiko Oberdiek:\\
4298 % \href{http://www.ctan.org/pkg/hyperref}%
4299 % {\emph{Hypertext marks in \LaTeX: a manual for hyperref}},\\
4300 % November 2012
4301 %
4302 % \bibitem{hypcap}
4303 % Heiko Oberdiek:\\
4304 % \href{http://www.ctan.org/pkg/oberdiek}%
4305 % {\emph{The hypcap package -- Adjusting anchors of captions}},\\
4306 % 2011/02/16
4307 %
4308 % \bibitem{listings}
4309 % Carsten Heinz \& Brooks Moses:\\
4310 % \href{http://www.ctan.org/pkg/listings}%
4311 % {\emph{The Listings Package}},\\
4312 % 2007/02/22
4313 %
4314 % \bibitem{longtable}
4315 % David Carlisle:\\
4316 % \href{http://www.ctan.org/pkg/longtable}%
4317 % {\emph{The longtable package}},\\
4318 % 2004/02/01
4319 %
4320 % \bibitem{picinpar}
4321 % Friedhelm Sowa:\\
4322 % \href{http://www.ctan.org/pkg/picinpar}%
4323 % {\emph{Pictures in Paragraphs}},\\
4324 % July 13, 1993
4325 %
4326 % \bibitem{picins}
4327 % Joachim Bleser and Edmund Lang:\\
4328 % \href{http://www.ctan.org/pkg/picins}%
4329 % {\emph{PicIns-Benutzerhandbuch Version 3.0}},\\
4330 % September~1992
4331 %
4332 % \bibitem{rotating}
4333 % Sebastian Rahtz and Leonor Barroca:\\
4334 % \href{http://www.ctan.org/pkg/rotating}%
4335 % {\emph{A style option for rotated objects in \LaTeX}},\\
4336 % 1997/09/26
4337 %
4338 % \bibitem{setspace}
4339 % Erica M. S. Harris \& Geoffrey Tobin:\\
4340 % \href{http://www.ctan.org/pkg/setspace}%
4341 % {\emph{LaTeX Document Package ``setspace''}},\\
4342 % 1 December 2000
4343 %
4344 % \bibitem{sidecap}
4345 % Rolf Niepraschk \& Hubert G\"a\ss lein:\\
4346 % \href{http://www.ctan.org/pkg/sidecap}%
4347 % {\emph{The sidecap package}},\\
4348 % 2003/06/06
4349 %
4350 % \bibitem{subfigure}
4351 % Steven D. Cochran:\\
4352 % \href{http://www.ctan.org/pkg/subfigure}%
4353 % {\emph{The subfigure package}},\\
4354 % 2005/03/15
4355 %
4356 % \bibitem{subfig}
4357 % Steven D. Cochran:\\
4358 % \href{http://www.ctan.org/pkg/subfig}%
4359 % {\emph{The subfig package}},\\
4360 % 2005/07/05
4361 %
4362 % \bibitem{supertabular}
4363 % Johannes Braams and Theo Jurriens:\\
4364 % \href{http://www.ctan.org/pkg/supertabular}%
4365 % {\emph{The supertabular environment}},\\
4366 % 2004/02/20
4367 %
4368 % \bibitem{threeparttable}
4369 % Donald Arseneau:\\
4370 % \href{http://www.ctan.org/pkg/threeparttable}%
4371 % {\emph{Three part tables: title, tabular environment, notes}},\\
4372 % March 5, 2010
4373 %
4374 % \bibitem{wrapfig}
4375 % Donald Arseneau:\\
4376 % \href{http://www.ctan.org/pkg/wrapfig}%
4377 % {\emph{WRAPFIG.STY ver 3.6}},\\
4378 % Jan 31, 2003
4379 %
4380 % \bibitem{xtab}
4381 % Peter Wilson:\\
4382 % \href{http://www.ctan.org/pkg/xtab}%
4383 % {\emph{The xtab package}},\\
4384 % 2011/07/31
4385 %
4386 % \end{thebibliography}
4387 % }
4388 %
4389 % \iffalse
4390 % --------------------------------------------------------------------------- %
4391 % \fi
4392 %
4393 % \DoNotIndex{\\,\_,\ ,\@@par}
4394 % \DoNotIndex{\@bsphack}
4395 % \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
4396 % \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
4397 % \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
4398 % \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
4399 % \DoNotIndex{\if@minipage,\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
4400 % \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@minipagefalse,\@minipagetrue}
4401 % \DoNotIndex{\@namedef,\@nameuse}
4402 % \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
4403 % \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setminipage,\@setpar}
4404 % \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
4405 % \DoNotIndex{\@testopt}
4406 % \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
4407 % \DoNotIndex{\p@,\z@}
4408 % \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
4409 % \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
4410 % \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
4411 % \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
4412 % \DoNotIndex{\fi,\footnotesize,\global}
4413 % \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
4414 % \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
4415 % \DoNotIndex{\ifx,\ignorespaces,\itshape}
4416 % \DoNotIndex{\kernel@ifnextchar}
4417 % \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
4418 % \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
4419 % \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
4420 % \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
4421 % \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
4422 % \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
4423 % \DoNotIndex{\providecommand,\quad}
4424 % \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
4425 % \DoNotIndex{\rightskip,\rmfamily}
4426 % \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
4427 % \DoNotIndex{\small,\string,\space,\strut}
4428 % \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
4429 % \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
4430 % \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
4431 % \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
4432 % \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
4433 % \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
4434 % \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
4435 % \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
4436 %
4437 % \iffalse
4438 % --------------------------------------------------------------------------- %
4439 % \fi
4440 %
4441 % \setlength{\parskip}{0pt plus 1pt}
4442 % \renewcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
4443 % \let\endNote\undefined
4444 %
4445 % \changes{v1.0}{1994/10/27}{First release}
4446 % \changes{v1.1}{1994/11/03}{New option \texttt{centerlast}}
4447 % \changes{v1.2}{1994/11/28}{Support of the \pkg{float} package}
4448 % \changes{v1.3}{1995/01/09}{Support of \cs{captionlabelfont} in subcaptions}
4449 % \changes{v1.4}{1995/01/30}{New option \texttt{nooneline}}
4450 % \changes{v1.4b}{1995/04/05}{Bugfix release}
4451 % \changes{v3.0}{2003/12/20}{Rewritten; many new commands and features}
4452 % \changes{v3.0d}{2004/11/28}{Split into two packages: \pkg{caption} \& \pkg{caption3}}
4453 %
4454 % \iffalse
4455 % --------------------------------------------------------------------------- %
4456 % \fi
4457 %
4458 % \clearpage
4459 % \section{The implementation}
4460 %
4461 % \iffalse
4462 %<*package>
4463 % \fi
4464 %
4465 % \subsection{Introduction}
4466 %
4467 % \Thispackage\ consists of two parts -- the kernel
4468 % (|caption3.sty|) and the main package (|caption.sty|).
4469 %
4470 % \Thispackage\ redefines the \LaTeX\ commands
4471 % |\caption|, |\@caption|, and |\@makecaption| and maps the latter one to
4472 % |\caption@@make|, giving the user the possibility to control the look \& feel
4473 % of the captions from floating environments like |figure| and |table|.
4474 % Furthermore it does similar to the caption stuff coming from other packages
4475 % (like the \pkg{longtable} or \pkg{supertabular} package):
4476 % Mapping the appropriate internal commands (like |\LT@makecaption| or
4477 % |\ST@caption|) to the ones offered by the \pkg{caption3} kernel.
4478 % So you can think of \thispackage\ as a layer package, it
4479 % simply provides adaptation layers between the caption stuff coming from
4480 % \LaTeXe\ or packages, and the caption stuff offered by the
4481 % \pkg{caption3} kernel.
4482 %
4483 % \subsection{Identification}
4484 %
4485 % We need at least \LaTeX2e\ version 1994/12/01.
4486 % \begin{macrocode}
4487 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
4488 % \end{macrocode}
4489 %
4490 % Bypass the release declarations in case the \LaTeX\ kernel doesn’t know how to deal with them
4491 % (as suggested by \url{https://www.latex-project.org/publications/2018-FMi-TUB-tb122mitt-version-rollback.pdf}).
4492 % \begin{macrocode}
4493 \providecommand\DeclareRelease[3]{}
4494 \providecommand\DeclareCurrentRelease[2]{}
4495 % \end{macrocode}
4496 %
4497 % Declare all supported releases.
4498 % \begin{macrocode}
4499 \DeclareRelease{v1}{1994-10-27}{caption_1995-04-05.sty}
4500 \DeclareRelease{v3.0}{2003-12-20}{caption_2007-04-16.sty}
4501 \DeclareRelease{v3.1}{2007-09-01}{caption_2010-01-09.sty}
4502 \DeclareRelease{v3.2}{2011-08-06}{caption_2011-11-10.sty}
4503 \DeclareRelease{v3.3}{2013-01-10}{caption_2019-09-01.sty}
4504 \DeclareRelease{v3.4}{2019-11-24}{caption_2020-07-29.sty}
4505 \DeclareRelease{v3.5}{2020-08-30}{caption_2020-10-26.sty}
4506 \DeclareCurrentRelease{v3.6}{2022-02-20}
4507 % \end{macrocode}
4508 %
4509 % Identify the current version of the package.
4510 % \begin{macrocode}
4511 \ProvidesPackage{caption}[2023/08/05 v3.6o Customizing captions (AR)]
4512 % \end{macrocode}
4513 %
4514 % \subsection{Loading the kernel}
4515 %
4516 % Load a matching version of the \pkg{caption} kernel.
4517 % \begin{macrocode}
4518 \RequirePackage{caption3}[2023/07/31] % needs v2.4d or newer
4519 % \end{macrocode}
4520 %
4521 % \subsection{Check against unknown document classes}
4522 %
4523 % \begin{macrocode}
4524 \caption@ifdocumentclass{unknown}%
4525 {\caption@WarningNoLine{%
4526 Unknown document class (or package),\MessageBreak
4527 standard defaults will be used}}%
4528 {}
4529 % \end{macrocode}
4530 %
4531 % \subsection{Check against incompatible packages}
4532 %
4533 % \changes{v3.0p}{2007/04/06}{Check against obsolete \pkg{caption2} package added}
4534 % \begin{macrocode}
4535 \@ifpackageloaded{caption2}{%
4536 \caption@Error{%
4537 You can't use both, the (obsolete) caption2 *and*\MessageBreak
4538 the (current) caption package}%
4539 \endinput
4540 }{}
4541 % \end{macrocode}
4542 %
4543 % Check against incompatible packages which used to work fine with \version{1} of the `caption' package.
4544 % \changes{v3.1}{2007/06/15}{Check against incompatible \pkg{ftcap} package added}
4545 % \changes{v3.1}{2007/06/15}{Check against incompatible \pkg{nonfloat} package added}
4546 % \changes{v3.1}{2007/06/18}{Check against incompatible \pkg{topcapt} package added}
4547 % \changes{v3.6}{2021/01/02}{Check against incompatible packages \pkg{ftcap}, \pkg{nonfloat}, and \pkg{topcapt} revised}
4548 % \begin{macrocode}
4549 \caption@AtBeginDocument{%
4550 \caption@setincompatible{\@ifpackageloaded{captcont}}{captcont package}%
4551 \caption@setincompatible{\@ifpackageloaded{ftcap}}{ftcap package}%
4552 \caption@setincompatible{\@ifpackageloaded{nonfloat}}{nonfloat package}%
4553 \caption@setincompatible{\@ifpackageloaded{topcapt}}{topcapt package}}
4554 % \end{macrocode}
4555 %
4556 % \begin{macro}{\caption@setincompatible}
4557 % \changes{v3.4}{2019/09/09}{This macro added}
4558 % \changes{v3.6}{2020/12/22}{Adapted to fallback concept}
4559 % |\caption@setincompatible|\marg{condition}\marg{message text}
4560 % \begin{macrocode}
4561 \newcommand*\caption@setincompatible[2]{%
4562 #1{%
4563 \caption@Error{%
4564 The #2 is incompatible to the\MessageBreak
4565 current version of the `caption' package,\MessageBreak
4566 so try \string\usepackage{caption}[=v1] instead}%
4567 }{}}
4568 \@onlypreamble\caption@setincompatible
4569 % \end{macrocode}
4570 % \end{macro}
4571 %
4572 % \subsection{Positioning}
4573 %
4574 % \begin{macrocode}
4575 \DeclareCaptionPosition{auto}{#2}{%
4576 \caption@ifsubcaption@above{#2}{%
4577 \ifvmode
4578 \caption@autoposition{#1}{#2}%
4579 \else
4580 #2%
4581 \fi}}
4582 % \end{macrocode}
4583 %
4584 % \subsection{Declaration of options}
4585 %
4586 % \subsubsection{Miscellaneous options}
4587 %
4588 % \begin{macrocode}
4589 \DeclareCaptionOption*{config}[caption]{%
4590 \InputIfFileExists{#1.cfg}%
4591 {\typeout{*** Local configuration file #1.cfg used ***}}%
4592 {\caption@Warning{Configuration file #1.cfg not found}}}
4593 % \end{macrocode}
4594 %
4595 % \begin{macro}{\caption@selectlistentry}
4596 % \changes{v3.2}{2010/11/07}{This macro added}
4597 % |\caption@selectlistentry|\marg{\purett{heading} or \purett{entry}}
4598 % \begin{macrocode}
4599 \newcommand*\caption@selectlistentry[1]{%
4600 \caption@ifinlist{#1}{heading}{%
4601 \let\caption@iflistheading\@firstoftwo
4602 }{\caption@ifinlist{#1}{default,list-entry,entry}{%
4603 \let\caption@iflistheading\@secondoftwo
4604 }{%
4605 \caption@Error{Undefined list-entry selection `#1'}%
4606 }}}
4607 % \end{macrocode}
4608 % \end{macro}
4609 %
4610 % \changes{v3.3}{2012-03-25}{Option \opt{list-entry} added}
4611 % \begin{macrocode}
4612 \DeclareCaptionOption{list-entry}{\caption@selectlistentry{#1}}
4613 \captionsetup{list-entry=default}
4614 % \end{macrocode}
4615 %
4616 % \changes{v3.2}{2010/11/07}{Option \opt{parboxrestore} added}
4617 % \changes{v3.6}{2021/01/07}{(Undocumented) Option \opt{parboxrestore} removed}
4618 %
4619 % \changes{v3.1f}{2007/11/28}{Option \opt{@minipage=} added}
4620 % \begin{macrocode}
4621 \DeclareCaptionOption{@minipage}{%
4622 \caption@ifinlist{#1}{auto,default}%
4623 {\let\caption@if@minipage\@gobbletwo}%
4624 {\caption@set@bool\caption@if@minipage{#1}}}
4625 \captionsetup{@minipage=default}
4626 % \end{macrocode}
4627 %
4628 % \changes{v3.1}{2007/07/21}{Option `compatibility' added}
4629 % \changes{v3.1}{2007/09/01}{caption v1.x compatibility options revised}
4630 % \changes{v3.1d}{2007/10/24}{Bugfix 07-10-24 in caption v1.x$ compatibility options}
4631 % \changes{v3.5a}{2020/09/02}{caption v1.x compatibility options fixed}
4632 % \changes{v3.6}{2020/12/22}{Option `compatibility' adapted to fallback concept}
4633 % \changes{v3.6h}{2022/07/03}{Command \cs{caption@ifcompatibility} re-added}
4634 %
4635 % We only support boolean values for the |compatibility=| option
4636 % since these were the only one which were documented in the past.
4637 %
4638 % \begin{macrocode}
4639 \DeclareCaptionOption{compatibility}[1]{%
4640 \caption@ifinlist{#1}{1,true,yes,on}{%
4641 \caption@Error{%
4642 Obsolete compatibility value `#1',\MessageBreak
4643 please use either \string\usepackage{caption}[=v1]\MessageBreak
4644 or \string\usepackage{caption-light} instead}%
4645 }{\caption@ifinlist{#1}{0,false,no,off}{%
4646 \let\caption@ifcompatibility\@secondoftwo % not used; for backward compatibility only
4647 }{%
4648 \caption@Error{Undefined compatibility value `#1'}%
4649 }}}
4650 \@onlypreamble@key{caption}{compatibility}
4651 \caption@setbool{compatibility}{0} % default: Try not to be compatible to v1.x
4652 % \end{macrocode}
4653 %
4654 % \subsubsection{caption v1.x compatibility options}
4655 %
4656 % \begin{macrocode}
4657 \DeclareCaptionOptionNoValue*{normal}{%
4658 \caption@setup{format=plain,justification=justified}}
4659 \DeclareCaptionOptionNoValue*{isu}{%
4660 \caption@setup{format=hang,justification=justified}}
4661 \DeclareCaptionOptionNoValue*{hang}{%
4662 \caption@setup{format=hang,justification=justified}}
4663 \DeclareCaptionOptionNoValue*{center}{%
4664 \caption@setup{format=plain,justification=centering}}
4665 \DeclareCaptionOptionNoValue*{centerlast}{%
4666 \caption@setup{format=plain,justification=centerlast}}
4667 % \end{macrocode}
4668 %
4669 % \begin{macrocode}
4670 \DeclareCaptionOptionNoValue*{scriptsize}{\def\captionfont{\scriptsize}}
4671 \DeclareCaptionOptionNoValue*{footnotesize}{\def\captionfont{\footnotesize}}
4672 \DeclareCaptionOptionNoValue*{small}{\def\captionfont{\small}}
4673 \DeclareCaptionOptionNoValue*{normalsize}{\def\captionfont{\normalsize}}
4674 \DeclareCaptionOptionNoValue*{large}{\def\captionfont{\large}}
4675 \DeclareCaptionOptionNoValue*{Large}{\def\captionfont{\Large}}
4676 % \end{macrocode}
4677 %
4678 % \begin{macrocode}
4679 \DeclareCaptionOptionNoValue*{up}{\caption@setup{labelfont+=up}}
4680 \DeclareCaptionOptionNoValue*{it}{\caption@setup{labelfont+=it}}
4681 \DeclareCaptionOptionNoValue*{sl}{\caption@setup{labelfont+=sl}}
4682 \DeclareCaptionOptionNoValue*{sc}{\caption@setup{labelfont+=sc}}
4683 \DeclareCaptionOptionNoValue*{md}{\caption@setup{labelfont+=md}}
4684 \DeclareCaptionOptionNoValue*{bf}{\caption@setup{labelfont+=bf}}
4685 \DeclareCaptionOptionNoValue*{rm}{\caption@setup{labelfont+=rm}}
4686 \DeclareCaptionOptionNoValue*{sf}{\caption@setup{labelfont+=sf}}
4687 \DeclareCaptionOptionNoValue*{tt}{\caption@setup{labelfont+=tt}}
4688 % \end{macrocode}
4689 %
4690 % \begin{macrocode}
4691 \DeclareCaptionOptionNoValue*{nooneline}{\caption@setup{slc=0}}
4692 % \end{macrocode}
4693 %
4694 % \begin{macrocode}
4695 \caption@setbool{ruled}{0}
4696 \DeclareCaptionOptionNoValue*{ruled}{\caption@setbool{ruled}{1}}
4697 % \end{macrocode}
4698 %
4699 % \subsubsection{caption2 v2.x compatibility options}
4700 % \changes{v3.0h}{2005/07/08}{caption2 \version{2.x} compatibility options added}
4701 % \changes{v3.1}{2007/09/01}{caption2 v2.x compatibility options revised}
4702 % \changes{v3.1d}{2007/10/24}{Bugfix 07-10-24 in caption v2.x$ compatibility options}
4703 % \changes{v3.5a}{2020/09/02}{caption v2.x compatibility options fixed}
4704 %
4705 % \begin{macrocode}
4706 \DeclareCaptionOptionNoValue*{flushleft}{%
4707 \caption@setup{format=plain,justification=raggedright}}
4708 \DeclareCaptionOptionNoValue*{flushright}{%
4709 \caption@setup{format=plain,justification=raggedleft}}
4710 % \end{macrocode}
4711 % \begin{macrocode}
4712 \DeclareCaptionOptionNoValue*{oneline}{\caption@setup{slc=1}}
4713 % \end{macrocode}
4714 % \begin{macrocode}
4715 \DeclareCaptionOptionNoValue*{ignoreLTcapwidth}{%
4716 \caption@WarningNoLine{Obsolete option `ignoreLTcapwidth' ignored}}
4717 % \end{macrocode}
4718 %
4719 % \subsubsection{Obsolete caption v3.0 options}
4720 % \changes{v3.1}{2007/05/07}{Package option \opt{caption} marked as obsolete,
4721 % gives error now}
4722 %
4723 % \begin{macrocode}
4724 \DeclareCaptionOption*{caption}{%
4725 \caption@setbool{temp}{#1}%
4726 \caption@ifbool{temp}{}{%
4727 \caption@Error{%
4728 The package option `caption=#1' is obsolete.\MessageBreak
4729 Please pass this option to the subfig package instead\MessageBreak
4730 and do *not* load the caption package anymore}}}
4731 % \end{macrocode}
4732 %
4733 % \subsubsection{fltpage package support options}
4734 %
4735 % \changes{v3.1}{2007/09/01}{Options `FPlist' \& `FPref' added}
4736 % With these options is controlled where the list-of entry and |\ref| or
4737 % |\pageref| or |\autoref| will link to.
4738 % Defaults are |FPlist=caption| and |FPref=figure| which is inconsistent,
4739 % but compatible to the usual behaviour of the \pkg{fltpage} package.
4740 % \begin{macrocode}
4741 \DeclareCaptionOption{FPlist}[1]{\caption@setFPoption{list}{#1}}
4742 \DeclareCaptionOption{FPref}[1]{\caption@setFPoption{ref}{#1}}
4743 \@onlypreamble@key{caption}{FPlist}
4744 \@onlypreamble@key{caption}{FPref}
4745 % \end{macrocode}
4746 % \begin{macrocode}
4747 \newcommand*\caption@setFPoption[2]{%
4748 \edef\caption@tempa{\@car#2\@nil}%
4749 \caption@setbool{FP#1cap}{\if c\caption@tempa 1\else 0\fi}}
4750 \@onlypreamble\caption@setFPoption
4751 % \end{macrocode}
4752 % \begin{macrocode}
4753 \captionsetup{FPlist=caption,FPref=figure}
4754 % \end{macrocode}
4755 %
4756 % \subsubsection{hyperref package support options}
4757 %
4758 % \changes{v3.1}{2007/06/21}{Options `hypcap' \& `hypcapspace' added}
4759 % With |hypcap=off| one can turn the \pkg{hypcap} support off
4760 % (default is |on|).
4761 % \begin{macrocode}
4762 \DeclareCaptionOption{hypcap}[1]{\caption@setbool{hypcap}{#1}}
4763 \DeclareCaptionOption{hypcapspace}{\def\caption@hypcapspace{#1}}
4764 % \end{macrocode}
4765 % \begin{macrocode}
4766 \captionsetup{hypcap=1,hypcapspace=.5\baselineskip}
4767 % \end{macrocode}
4768 %
4769 % \subsection{Document class support}
4770 %
4771 % Execute the code declared with |\At|\-|Caption|\-|Package|.
4772 % We do this right before processing the options so stuff done with
4773 % |\At|\-|Caption|\-|Package| could be overwritten by user options.
4774 %
4775 % \begin{macrocode}
4776 \caption@documentclass@code
4777 \let\caption@documentclass@code\@undefined
4778 \let\AtCaptionPackage\@firstofone
4779 % \end{macrocode}
4780 %
4781 % \subsection{Processing of options}
4782 %
4783 % \changes{v3.0m}{2007/03/04}{Verbose option added}
4784 % \changes{v3.1}{2007/07/02}{Verbose option removed from package}
4785 % \changes{v3.1}{2007/03/17}{We do not process global options anymore}
4786 %
4787 % \begin{macrocode}
4788 \caption@SetupOptions{caption}{\caption@setkeys{#1}{#2}}
4789 \caption@ProcessOptions*{caption}
4790 % \end{macrocode}
4791 %
4792 % \subsection{\cs{caption}, \cs{@caption}, and \cs{@makecaption}}
4793 %
4794 % \begin{macro}{\caption@flags}
4795 % \changes{v3.3}{2018/08/08}{This counter and associated macros added}
4796 % Since we support continued floats and sub-figures it's not an easy task
4797 % to manage the figure (and table) counter, especially since previous versions
4798 % of the caption package have proven that correcting a counter locally is not a good idea,
4799 % and to make it dependent on the |position=| setting (like the \pkg{subfig} package does)
4800 % is not a good idea, either.
4801 %
4802 % In the past three boolean switches were used to store the flags, but since some
4803 % packages (like the \pkg{floatrow} and \pkg{tabu} package) try hard to keep
4804 % \LaTeX{} counter changes locally under certain circumstances, it seems a good idea to make
4805 % these flags a \LaTeX{} counter value.
4806 %
4807 % See also:
4808 % \url{https://gitlab.com/axelsommerfeldt/caption/-/issues/27} and
4809 % \url{https://tex.stackexchange.com/questions/444942/subcaptionbox-in-tabu-wrong-numbering-of-subfigures}
4810 %
4811 % \begin{macrocode}
4812 \newcounter{caption@flags}
4813 % \end{macrocode}
4814 % \end{macro}
4815 %
4816 % \begin{macro}{\caption@clrflags}
4817 % \changes{v3.3}{2018/08/08}{This macro added}
4818 % |\caption@clrflags| clears all flags.
4819 % Note that we have to use |\set|\-|counter| here (instead of using \TeX{} primitives)
4820 % since some packages re-define |\set|\-|counter| to keep counter changes local.
4821 % \begin{macrocode}
4822 \newcommand*\caption@clrflags{%
4823 \setcounter{caption@flags}{0}}
4824 % \end{macrocode}
4825 % \end{macro}
4826 %
4827 % \begin{macro}{\caption@ifflags}
4828 % \changes{v3.6}{2020/12/28}{This macro added}
4829 % |\caption@ifflags|\marg{yes-code}\marg{no-code}\\
4830 % tests if any of the flags is set.
4831 % \begin{macrocode}
4832 \newcommand*\caption@ifflags{%
4833 \ifcase\c@caption@flags
4834 \expandafter\@secondoftwo
4835 \else
4836 \expandafter\@firstoftwo
4837 \fi}
4838 % \end{macrocode}
4839 % \end{macro}
4840 %
4841 % \begin{macro}{\caption@setflag}
4842 % \changes{v3.3}{2013/04/14}{This macro added}
4843 % \changes{v3.3}{2018/08/08}{Rewritten so a counter is used instead of a switch}
4844 % |\caption@setflag|\marg{number}\\
4845 % sets the flag with the given number (where \meta{number} is one of 1, 2, 4, 8, 16, \ldots).
4846 % Note that we have to use |\add|\-|to|\-|counter| here (instead of |\advance|)
4847 % since some packages re-define |\add|\-|to|\-|counter| to keep counter changes local.
4848 % \begin{macrocode}
4849 \newcommand*\caption@setflag[1]{%
4850 \caption@ifflag{#1}{}{\addtocounter{caption@flags}{#1}}}
4851 % \end{macrocode}
4852 % \end{macro}
4853 %
4854 % \begin{macro}{\caption@ifflag}
4855 % \changes{v3.3}{2011/12/28}{This switch added}
4856 % \changes{v3.3}{2018/08/08}{Rewritten (and renamed) so a counter is used instead of a switch}
4857 % |\caption@ifflag|\marg{number}\marg{yes-code}\marg{no-code}\\
4858 % tests if the flag with the given number is set (where \meta{number} is one of 1, 2, 4, 8, 16, \ldots).
4859 % \begin{macrocode}
4860 \newcommand*\caption@ifflag[1]{%
4861 \@tempcnta\c@caption@flags
4862 \divide\@tempcnta #1\relax
4863 \ifodd\@tempcnta
4864 \expandafter\@firstoftwo
4865 \else
4866 \expandafter\@secondoftwo
4867 \fi}
4868 % \end{macrocode}
4869 % \end{macro}
4870 %
4871 % \begin{macro}{\caption@setcontinued}
4872 % \changes{v3.6}{2020/09/20}{This macro added}
4873 % |\caption@setcontinued| sets the `continued float' flag, i.e. |\continued|\-|float| was used.
4874 % \begin{macrocode}
4875 \newcommand*\caption@setcontinued{\caption@setflag1}
4876 % \end{macrocode}
4877 % \end{macro}
4878 %
4879 % \begin{macro}{\caption@ifcontinued}
4880 % \changes{v3.3}{2011/12/28}{This switch added}
4881 % \changes{v3.3}{2018/08/08}{\cs{ifcaption@ContinuedFloat} replaced by \cs{caption@ifflag1}}
4882 % \changes{v3.6}{2020/09/20}{Revived as \cs{caption@ifcontinued}}
4883 % |\caption@if|\-|continued|\marg{yes-code}\marg{no-code}\\
4884 % tests if the `continued float' flag is set.
4885 % \begin{macrocode}
4886 \newcommand*\caption@ifcontinued{\caption@ifflag1}
4887 % \end{macrocode}
4888 % \end{macro}
4889 %
4890 % \begin{macro}{\caption@setcaption}
4891 % \changes{v3.6}{2020/09/20}{This macro added}
4892 % |\caption@setcaption| sets the `caption' flag, i.e. |\caption|, |\phantom|\-|caption|, or |\caption|\-|list|\-|entry| was used.
4893 % \begin{macrocode}
4894 \newcommand*\caption@setcaption{\caption@setflag2}
4895 % \end{macrocode}
4896 % \end{macro}
4897 %
4898 % \begin{macro}{\caption@ifcaption}
4899 % \changes{v3.3}{2011/12/28}{This switch added}
4900 % \changes{v3.3}{2018/08/08}{\cs{ifcaption@caption} replaced by \cs{caption@ifflag2}}
4901 % \changes{v3.6}{2020/09/20}{Revived as \cs{caption@ifcaption}}
4902 % |\caption@if|\-|caption|\marg{yes-code}\marg{no-code}\\
4903 % tests if the `caption' flag is set.
4904 % \begin{macrocode}
4905 \newcommand*\caption@ifcaption{\caption@ifflag2}
4906 % \end{macrocode}
4907 % \end{macro}
4908 %
4909 % \begin{macro}{\caption@setsubcaption}
4910 % \changes{v3.6}{2020/09/20}{This macro added}
4911 % |\caption@setsubcaption| sets the `subcaption' flag, i.e. |\subcaption|, |\subcaptionbox|, \ldots was used.
4912 % \begin{macrocode}
4913 \newcommand*\caption@setsubcaption{%
4914 \caption@ifcaption{\caption@setflag8}{\caption@setflag4}}
4915 % \end{macrocode}
4916 % \end{macro}
4917 %
4918 % \begin{macro}{\caption@ifsubcaption@above}
4919 % \changes{v3.3}{2011/12/28}{This switch added}
4920 % \changes{v3.3}{2018/08/08}{\cs{ifcaption@subcaption} replaced by \cs{caption@ifflag4}}
4921 % \changes{v3.6}{2020/09/20}{Revived as \cs{caption@ifsubcaption@above} and \cs{caption@ifsubcaption@below}}
4922 % |\caption@if|\-|sub|\-|caption@above|\marg{yes-code}\marg{no-code}\\
4923 % tests if the `subcaption' flag was set before the `caption' flag was set, i.e. a sub-caption was typeset \emph{above} the corresponding caption.
4924 % \begin{macrocode}
4925 \newcommand*\caption@ifsubcaption@above{\caption@ifflag4}
4926 % \end{macrocode}
4927 % \end{macro}
4928 %
4929 % \begin{macro}{\caption@ifsubcaption@below}
4930 % \changes{v3.3}{2011/12/28}{This switch added}
4931 % \changes{v3.3}{2018/08/08}{\cs{ifcaption@subcaption} replaced by \cs{caption@ifflag4}}
4932 % \changes{v3.6}{2020/09/20}{Revived as \cs{caption@ifsubcaption@above} and \cs{caption@ifsubcaption@below}}
4933 % |\caption@if|\-|sub|\-|caption@below|\marg{yes-code}\marg{no-code}\\
4934 % tests if the `subcaption' flag was set after the `caption' flag was set, i.e. a sub-caption was typeset \emph{below} the corresponding caption.
4935 % \begin{macrocode}
4936 \newcommand*\caption@ifsubcaption@below{\caption@ifflag8}
4937 % \end{macrocode}
4938 % \end{macro}
4939 %
4940 % \begin{macro}{\caption@caption}
4941 % \changes{v3.0f}{2005/05/22}{Bugfix: \cs{ContinuedFloat} added}
4942 % \changes{v3.0f}{2005/06/13}{Support of \cs{caption*[]} removed}
4943 % \changes{v3.0l}{2007/01/19}{Minimal support of \textsf{combine} package added}
4944 % \changes{v3.1}{2007/02/04}{Re-written, does not save \& use original definition anymore}
4945 % \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
4946 % Here comes our definition of |\caption| and |\caption*|.
4947 % Beside the support of the starred variant this code was adapted to the
4948 % various packages we support.
4949 % We are using |\caption@dblarg| instead of |\@dblarg| so |\caption{}|
4950 % (with an empty arg.) will produce a list-of entry, but |\caption[]{}|
4951 % won't.
4952 % \begin{macrocode}
4953 \def\caption@caption{%
4954 \caption@iftype
4955 {\caption@checkgrouplevel\@empty\caption
4956 \caption@star
4957 {\caption@refstepcounter\@captype}%
4958 {\caption@dblarg{\@caption\@captype}}}%
4959 {\caption@OutsideFloat\caption
4960 \caption@withoptargs\@gobbletwo}}
4961 % \end{macrocode}
4962 % \end{macro}
4963 %
4964 % \begin{macro}{\caption@OutsideFloat}
4965 % \changes{v3.6}{2022/01/05}{This macro added}
4966 % |\caption@OutsideFloat}| issues a ``\meta{command} outside float'' error.
4967 % \begin{macrocode}
4968 \newcommand*\caption@OutsideFloat[1]{%
4969 \caption@Error{\string#1 outside float}}
4970 % \end{macrocode}
4971 % \end{macro}
4972 %
4973 % \begin{macro}{\caption@star}
4974 % \changes{v3.1}{2007/06/24}{Renamed from \cs{caption@caption} to \cs{caption@star}}
4975 % \changes{v3.2c}{2011/08/21}{\cs{global} removed}
4976 % A helper macro which processes the optional |*| after |\caption|.
4977 % \begin{macrocode}
4978 \newcommand*\caption@star[2]{%
4979 \@ifstar{\caption@startrue#2[]}{#1#2}}
4980 % \end{macrocode}
4981 % \end{macro}
4982 %
4983 % \begin{macro}{\caption@@caption}
4984 % \changes{v3.1}{2007/02/04}{Re-written, does not save\&use original definition anymore}
4985 % \changes{v3.1f}{2007/11/28}{Bugfix: Handling of \texttt{@minipage} flag added}
4986 % \changes{v3.1f}{2007/11/28}{Support of option \opt{@minipage} added}
4987 % \changes{v3.1g}{2008/03/16}{Internal: Uses \cs{caption@prepareanchor} now}
4988 % \changes{v3.2d}{2011/10/21}{Adapted to the \textsf{memoir} document class}
4989 % \changes{v3.2f}{2012/01/14}{Usage of \cs{M@gettitle} moved to \cs{caption@prepareanchor}}
4990 % \changes{v3.3}{2013/01/06}{Adapted to the \textsf{nag} package}
4991 % \changes{v3.6}{2022/01/06}{Usage of \cs{caption@nobreak} added to improve \textsf{beamer} document class support}
4992 % As above, our version has been adapted to the packages we support.
4993 % Additionally our code is nested by |\caption@begin|\-|ex| \&
4994 % |\caption@end| instead of |\begin|\-|group| \& |\end|\-|group|.
4995 % Furthermore we use |\caption@par|\-|box|\-|restore| instead of
4996 % |\@parbox|\-|restore|.
4997 % \begin{macrocode}
4998 \long\def\caption@@caption#1[#2]#3{%
4999 % \end{macrocode}
5000 % \begin{macrocode}
5001 \ifcaption@star \else
5002 \caption@prepareanchor{#1}{#2}%
5003 \memcaptioninfo{#1}{\csname the#1\endcsname}{#2}{#3}%
5004 \@nameuse{nag@hascaptiontrue}%
5005 \fi
5006 % \end{macrocode}
5007 % \begin{macrocode}
5008 \par
5009 \caption@nobreak
5010 \caption@beginex{#1}{#2}{#3}%
5011 \caption@setfloatcapt{%
5012 \caption@parboxrestore
5013 \if@minipage
5014 \@setminipage
5015 \fi
5016 \caption@normalsize
5017 \ifcaption@star
5018 \let\caption@makeanchor\@firstofone
5019 \fi
5020 \@makecaption{\csname fnum@#1\endcsname}%
5021 {\ignorespaces\caption@makeanchor{#3}}\par
5022 \caption@nobreak
5023 \caption@if@minipage\@minipagetrue\@minipagefalse}%
5024 \caption@end}
5025 % \end{macrocode}
5026 % \cls{memoir} document class stuff:
5027 % \begin{macrocode}
5028 \providecommand\memcaptioninfo[4]{}
5029 % \end{macrocode}
5030 % \end{macro}
5031 %
5032 % \begin{macro}{\caption@prepareanchor}
5033 % \changes{v3.1g}{2008/03/16}{This macro added}
5034 % \changes{v3.2f}{2012/01/14}{Usage of \cs{M@gettitle} moved from \cs{caption@@caption}}
5035 % \begin{macrocode}
5036 \newcommand*\caption@prepareanchor[2]{%
5037 \caption@makecurrent{#1}{#2}%
5038 \caption@ifhypcap\caption@@start\relax
5039 \M@gettitle{#2}}
5040 % \end{macrocode}
5041 % \cls{memoir} document class stuff:
5042 % \begin{macrocode}
5043 \providecommand\M@gettitle[1]{}
5044 % \end{macrocode}
5045 % \end{macro}
5046 %
5047 % \begin{macro}{\caption@nobreak}
5048 % \changes{v3.6}{2022/01/06}{This macro added}
5049 % |\caption@nobreak| for use in places where |\@caption| or |\beamer@makecaption| does |\nobreak|.
5050 % It's defined to do nothing unless the \cls{beamer} document class is used.
5051 % \begin{macrocode}
5052 \newcommand*\caption@nobreak{}
5053 % \end{macrocode}
5054 % \end{macro}
5055 %
5056 % \begin{macro}{\caption@parboxrestore}
5057 % \changes{v3.1}{2007/03/03}{This macro definition added}
5058 % \changes{v3.1b}{2007/09/17}{Bugfix: Redefinition of CR added}
5059 % \changes{v3.2}{2010/11/07}{Support of option \opt{parboxrestore} added}
5060 % \changes{v3.5g}{2020/10/26}{New implementation; renamed from \cs{caption@boxrestore} to \cs{caption@parboxrestore}}
5061 % \changes{v3.6}{2021/01/02}{Always uses \cs{@parboxrestore} now}
5062 % |\caption@parboxrestore| simply expands to |\@par|\-|box|\-|restore|.
5063 % \begin{macrocode}
5064 \newcommand*\caption@parboxrestore{\@parboxrestore}
5065 % \end{macrocode}
5066 % \end{macro}
5067 %
5068 % \begin{macro}{\caption@makecaption}
5069 % \changes{v3.1i}{2008/05/06}{Usage of \cs{caption@rule} added}
5070 % \changes{v3.6}{2022/01/06}{Usage of \cs{caption@nobreak} added to improve \textsf{beamer} document class support}
5071 % |\@makecaption|\marg{label}\marg{text}\par
5072 % We do basically the same as the original code (from the standard
5073 % \LaTeX\ document classes), but take care of the |position=| setting
5074 % and use |\caption@@make| from the \pkg{caption} kernel to finally
5075 % typeset the caption.
5076 % \begin{macrocode}
5077 \long\def\caption@makecaption#1#2{%
5078 \caption@nobreak
5079 \caption@make@above
5080 \caption@nobreak
5081 \caption@@make{#1}{#2}%
5082 \caption@nobreak
5083 \caption@make@below
5084 \caption@nobreak}
5085 % \end{macrocode}
5086 % \end{macro}
5087 %
5088 % \begin{macro}{\caption@make@above}
5089 % \begin{macro}{\caption@make@below}
5090 % \changes{v3.3a}{2019/04/02}{This macro added}
5091 % |\caption@make@above|\\
5092 % |\caption@make@below|\par
5093 % Typesets the stuff above or below the caption, depending on |\caption@iftop|.
5094 % \begin{macrocode}
5095 \newcommand*\caption@make@above{%
5096 \caption@iftop
5097 \caption@belowskip
5098 {\caption@rule\caption@aboveskip}}
5099 % \end{macrocode}
5100 % \begin{macrocode}
5101 \newcommand*\caption@make@below{%
5102 \caption@iftop
5103 {\caption@aboveskip\caption@rule}%
5104 \caption@belowskip}
5105 % \end{macrocode}
5106 % \end{macro}
5107 % \end{macro}
5108 %
5109 % \begin{macro}{\caption@redefine}
5110 % \changes{v3.1}{2007/05/09}{Re-definition of \cs{@xfloat} added}
5111 % \changes{v3.1b}{2007/09/22}{cs{@xfloat} will now be redefined in compatibility mode, too}
5112 % \changes{v3.1k}{2009/03/30}{The macro \cs{caption@redefine} contains the patching code now}
5113 % \changes{v3.5}{2020/08/30}{Re-definition of \cs{@xdblfloat} added}
5114 % \begin{macrocode}
5115 \newcommand*\caption@redefine{%
5116 % \end{macrocode}
5117 % Prior to \version{3.4} we only redefined |\caption| and |\@caption| if the current definitions
5118 % were well known, so documents written in the old (\pkg{caption} package \version{1.x}) days
5119 % (where |\caption| \& |\@caption| were not redefined by us) still compiled fine.
5120 % This used to make sense when introducing \version{3.0} in the year 2003
5121 % but is simply overcautious and especially unwanted by the user nowadays.
5122 % So starting with \version{3.4} we only do not redefine |\caption| and |\@caption| if the
5123 % `compatibility' option is set to `true', and starting with \version{3.6} we always redefine them.
5124 % \begin{macrocode}
5125 \let\caption\caption@caption
5126 \let\@caption\caption@@caption
5127 % \end{macrocode}
5128 % We redefine |\@x|\-|float| so inside floating environments our
5129 % type-specific options will be used, a \pkg{hyperref}
5130 % anchor will be set etc.
5131 % \begin{macrocode}
5132 \let\caption@ORI@xfloat\@xfloat
5133 \let\@xfloat\caption@xfloat
5134 % \end{macrocode}
5135 % We redefine |\@xdbl|\-|float|, too, so special options for |figure*|
5136 % or |table*| will be applied here.
5137 % \begin{macrocode}
5138 \let\caption@ORI@xdblfloat\@xdblfloat
5139 \let\@xdblfloat\caption@xdblfloat
5140 % \end{macrocode}
5141 % \begin{macrocode}
5142 }
5143 % \end{macrocode}
5144 % Some packages (like the \pkg{hyperref} package for example) redefines
5145 % |\caption| and |\@caption|, too.
5146 % So we have to use |\At|\-|Begin|\-|Document| here, so we can make sure
5147 % our definition is the one which will be valid at last.
5148 % \begin{macrocode}
5149 \caption@AtBeginDocument{%
5150 \caption@redefine
5151 \let\caption@redefine\relax}
5152 % \end{macrocode}
5153 % The redefinition of |\@make|\-|caption| will be done immediately.
5154 % \begin{macrocode}
5155 \let\@makecaption\caption@makecaption
5156 % \end{macrocode}
5157 % \end{macro}
5158 %
5159 % \begin{macro}{\caption@xfloat}
5160 % \changes{v3.1}{2007/05/09}{Re-definition of \cs{@xfloat} added}
5161 % \changes{v3.5}{2020/08/30}{Definition and usage of \cs{caption@xfloat@hook} added}
5162 % \changes{v3.6}{2020/12/27}{Re-definition of \cs{@xfloat} put into \cs{caption@xfloat}}
5163 % \begin{macrocode}
5164 \def\caption@xfloat#1[#2]{%
5165 \caption@ORI@xfloat{#1}[#2]%
5166 \caption@settype{#1}%
5167 \caption@setanchor
5168 \caption@xfloat@hook}
5169 % \end{macrocode}
5170 % Hook, could be extended with |\g@addto@macro\caption@x|\-|float@hook{|\ldots|}|.
5171 % (The caption type could be found in |\@cap|\-|type|.)
5172 % \begin{macrocode}
5173 \newcommand*\caption@xfloat@hook{}
5174 % \end{macrocode}
5175 % \end{macro}
5176 %
5177 % \begin{macro}{\caption@xdblfloat}
5178 % \changes{v3.5}{2020/08/30}{Re-definition of \cs{@xdblfloat} added}
5179 % \changes{v3.5}{2020/08/30}{Definition and usage of \cs{caption@xdblfloat@hook} added}
5180 % \changes{v3.6}{2020/12/27}{Re-definition of \cs{@xdblfloat} put into \cs{caption@xdblfloat}}
5181 % \begin{macrocode}
5182 \def\caption@xdblfloat#1[#2]{%
5183 \caption@ORI@xdblfloat{#1}[#2]% expands to \@xfloat{#1}[#2] + extra stuff
5184 \caption@setoptions{#1*}%
5185 \caption@xdblfloat@hook}
5186 % \end{macrocode}
5187 % Hook, could be extended with |\g@addto@macro\caption@xdbl|\-|float@hook{|\ldots|}|.
5188 % (The caption type could be found in |\@cap|\-|type|.)
5189 % \begin{macrocode}
5190 \newcommand*\caption@xdblfloat@hook{}
5191 % \end{macrocode}
5192 % \end{macro}
5193 %
5194 % \subsection{\cs{setcaptiontype} and \cs{setcaptionsubtype}}
5195 %
5196 % \changes{v3.0d}{2004/08/03}{Option \opt{type=} added}
5197 % \changes{v3.1}{2007/06/25}{Option \opt{type*=} added}
5198 % \changes{v3.1f}{2007/11/16}{Option \opt{subtype} \& \opt{subtype*} added}
5199 % \changes{v3.2}{2010/10/24}{Bugfix 10-10-17: Option \opt{type=} uses \cs{setcaptiontype} instead of \cs{caption@settype} now}
5200 %
5201 % \begin{macrocode}
5202 \caption@AtBeginDocument{%
5203 % \end{macrocode}
5204 % \begin{macrocode}
5205 \DeclareCaptionOption{type}{\setcaptiontype{#1}}%
5206 \DeclareCaptionOption{type*}{\setcaptiontype*{#1}}%
5207 % \end{macrocode}
5208 % \begin{macrocode}
5209 \DeclareCaptionOptionNoValue{subtype}{\setcaptionsubtype\relax}%
5210 \DeclareCaptionOptionNoValue{subtype*}{\setcaptionsubtype*}%
5211 % \end{macrocode}
5212 % \begin{macrocode}
5213 }
5214 % \end{macrocode}
5215 %
5216 % \emph{Important Note:}
5217 % Like |\captionof| the option |type=| should only be used inside a
5218 % group, box, or environment and does not check if the argument is a valid
5219 % floating environment or not.
5220 %
5221 % \begin{macro}{\setcaptiontype}
5222 % \changes{v3.2}{2010/10/24}{This macro added}
5223 % \changes{v3.5}{2020/08/24}{Definition method adapted to the \pkg{caption-light} package}
5224 % \changes{v3.6}{2022/02/20}{Optional argument added}
5225 % \changes{v3.6e}{2022/04/17}{Re-written, task sequence corrected}
5226 % \changes{v3.6f}{2022/04/18}{\cs{@ifnextchar} replaced by \cs{kernel@ifnextchar}}
5227 % |\setcaptiontype*|\oarg{additional options}\marg{type}\\
5228 % Like |\captionsetup{type=|\meta{type}|}|, but also works if |\caption|\-|setup| was redefined.
5229 % The non-starred version sets a \pkg{hyperref} anchor additionally
5230 % (if |hypcap=|\-|true| and the \pkg{hypcap} package is not loaded).
5231 % \begin{macrocode}
5232 \def\setcaptiontype{%
5233 \caption@teststar\@setcaptiontype\@gobble\@iden}
5234 % \end{macrocode}
5235 % \begin{macrocode}
5236 \newcommand*\@setcaptiontype[1]{%
5237 \kernel@ifnextchar[%]
5238 {\@setcaptiontype@#1}%
5239 {\@@setcaptiontype#1\relax}}
5240 % \end{macrocode}
5241 % \begin{macrocode}
5242 \def\@setcaptiontype@#1[#2]{%
5243 \@@setcaptiontype{#1}{\caption@setoptions{#2}}}
5244 % \end{macrocode}
5245 % \begin{macrocode}
5246 \newcommand*\@@setcaptiontype[3]{%
5247 \caption@settype{#3}#2%
5248 \caption@parboxrestore@light
5249 #1\caption@setanchor}
5250 % \end{macrocode}
5251 % \end{macro}
5252 %
5253 % \begin{macro}{\caption@settype}
5254 % \changes{v3.1}{2007/05/09}{This macro added}
5255 % \changes{v3.1b}{2007/09/22}{Usage of \cs{caption@xlabel} added}
5256 % \changes{v3.1d}{2007/10/23}{Error message for \cs{caption@checkgrouplevel} revised}
5257 % \changes{v3.1f}{2007/12/03}{Crappy \cs{caption@iftypewarning} replaced}
5258 % \changes{v3.1g}{2008/01/12}{Usage of \cs{ifcaptionsetup@star} added}
5259 % \changes{v3.2}{2010/10/26}{Error message moved from here to \cs{caption@refstepcounter}}
5260 % \changes{v3.3}{2011/12/28}{Resetting of \cs{ifcaption@caption} and \cs{ifcaption@subcaption} added}
5261 % \changes{v3.4e}{2020/01/02}{Checks added to prevent misuse regading subtypes}
5262 % \changes{v3.4e}{2020/01/02}{Check added if the subtype is defined}
5263 % \changes{v3.5d}{2020/09/28}{This macro revised}
5264 % \changes{v3.6}{2020/12/27}{Some code out-sourced to \cs{caption@reset@currentlabel}}
5265 % \changes{v3.6}{2021/01/02}{Usage of \cs{caption@initposition} added}
5266 % \changes{v3.6}{2021/01/09}{Usage of \cs{flushsubcaptionlistentries} added}
5267 % \changes{v3.6e}{2022/04/17}{Starred variant and optional argument removed}
5268 % \changes{v3.6g}{2022/04/18}{Usage of \cs{ifcaptionsetup@star} removed}
5269 % |\caption@settype|\marg{type}\\
5270 % sets |\@captype| and executes the options associated with it
5271 % (using |\caption@set|\-|options|).
5272 % Furthermore we check |\current|\-|group|\-|level| (if avail), and
5273 % use the macro |\caption@|(|sub|)|type|\-|hook| (which will be used by our
5274 % \pkg{float} package support).\par
5275 % \begin{macrocode}
5276 \newcommand*\caption@settype{%
5277 \caption@initposition
5278 \caption@clrflags
5279 \aftergroup\flushsubcaptionlistentries
5280 \caption@@settype{}}
5281 % \end{macrocode}
5282 % \begin{macrocode}
5283 \newcommand*\caption@@settype[2]{%
5284 % #1 = "" or "sub"
5285 % #2 = <type>, e.g.: "figure" or "subfigure"
5286 \caption@Debug{#1type:=#2}%
5287 \@nameuse{caption@check#1type}{#2}%
5288 {\caption@checkgrouplevel{#1}{\setcaption#1type}%
5289 % \end{macrocode}
5290 % \begin{macrocode}
5291 \edef\caption@tempa{#2}%
5292 \expandafter\ifx\csname @#1captype\endcsname\caption@tempa \else
5293 \@nameuse{caption@#1type@warning}%
5294 \fi
5295 \expandafter\let\csname @#1captype\endcsname\caption@tempa
5296 % \end{macrocode}
5297 % \begin{macrocode}
5298 \@nameuse{caption@#1typehook}%
5299 % \end{macrocode}
5300 % \begin{macrocode}
5301 \caption@setoptions{#2}%
5302 \ifx\caption@opt\relax
5303 \@nameundef{caption@#1type@warning}%
5304 \else
5305 \@namedef{caption@#1type@warning}{\caption@Warning{%
5306 The #1type was already set to
5307 `\csname @#1captype\endcsname'\MessageBreak}}%
5308 \fi}}
5309 % \end{macrocode}
5310 % \end{macro}
5311 %
5312 % \begin{macro}{\setcaptionsubtype}
5313 % \changes{v3.2a}{2011/08/15}{This macro added}
5314 % \changes{v3.5d}{2020/09/28}{This macro revised}
5315 % \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
5316 % \changes{v3.6}{2022/01/07}{Multiple use is suppressed now by checking \cs{caption@ifsubtype}}
5317 % \changes{v3.6e}{2022/04/17}{Re-written}
5318 % |\setcaptionsubtype*|\\
5319 % Like |\captionsetup{subtype}|, but also works if |\caption|\-|setup| was redefined.
5320 % Sets |\@sub|\-|cap|\-|type| and executes the options associated with it.
5321 % The non-starred version sets a \pkg{hyperref} anchor additionally
5322 % (if |hypcap=|\-|true| and the \pkg{hypcap} package is not loaded).
5323 % \begin{macrocode}
5324 \newcommand*\setcaptionsubtype{%
5325 \caption@teststar\@setcaptionsubtype\@gobble\@iden}
5326 % \end{macrocode}
5327 % \begin{macrocode}
5328 \newcommand*\@setcaptionsubtype[1]{%
5329 \caption@iftype
5330 {\caption@ifsubtype
5331 {\caption@Debug{type=\@captype, subtype=\@subcaptype}}%
5332 {\caption@@settype{sub}{sub\@captype}%
5333 #1\caption@setanchor}}%
5334 {\caption@OutsideFloat\setcaptionsubtype}}
5335 % \end{macrocode}
5336 % \end{macro}
5337 %
5338 % \begin{macro}{\caption@parboxrestore@light}
5339 % \changes{v3.2}{2010/10/24}{This macro added}
5340 % \changes{v3.5g}{2020/10/26}{Renamed from \cs{caption@boxrestore@mini} to \cs{caption@parboxrestore@mini}}
5341 % \changes{v3.6}{2021/01/02}{Renamed from \cs{caption@parboxrestore@mini} to \cs{caption@parboxrestore@light}}
5342 % Resets |\par| so the very first |\par| in |\@caption| behaves quite the same as in floating environments.
5343 % Will be used by |\set|\-|caption|\-|type|.
5344 % \begin{macrocode}
5345 \newcommand*\caption@parboxrestore@light{%
5346 \let\par\@@par
5347 \parindent\z@ \parskip\z@skip
5348 \sloppy}
5349 % \end{macrocode}
5350 % \end{macro}
5351 %
5352 % \begin{macro}{\caption@setanchor}
5353 % \changes{v3.6e}{2022/04/17}{Code extracted from \cs{caption@settype}}
5354 % |\caption@setanchor|\\
5355 % sets a \pkg{hyperref} anchor.
5356 % \begin{macrocode}
5357 \newcommand*\caption@setanchor{%
5358 \caption@reset@currentlabel
5359 \caption@start}
5360 % \end{macrocode}
5361 % \end{macro}
5362 %
5363 % \begin{macro}{\caption@reset@currentlabel}
5364 % \changes{v3.6}{2020/12/27}{This macro out-sourced from \cs{caption@settype}}
5365 % Redefine |\@currentlabel| so a |\label| before |\caption| will result
5366 % in a hint instead of a wrong reference.
5367 % \begin{macrocode}
5368 \newcommand*\caption@reset@currentlabel{%
5369 \let\@currentlabel\caption@undefinedlabel
5370 % \let\@currentHlabel\@undefined
5371 \ifx\caption@x@label\@undefined
5372 \let\caption@x@label\label
5373 \let\label\caption@xlabel
5374 \fi}
5375 % \end{macrocode}
5376 % \end{macro}
5377 %
5378 % \begin{macro}{\caption@iftype}
5379 % \changes{v3.1}{2007/04/11}{This macro definition added}
5380 % Since we often need to check if |\@cap|\-|type| is defined (means: we
5381 % are inside a floating environment) this helper macro was introduced.
5382 % \begin{macrocode}
5383 \newcommand*\caption@iftype{\caption@ifdefined\@captype}
5384 % \end{macrocode}
5385 % \end{macro}
5386 %
5387 % \begin{macro}{\caption@ifsubtype}
5388 % \changes{v3.6}{2022/01/07}{This macro definition added}
5389 % Since we often need to check if |\@sub|\-|cap|\-|type| is defined (means: we
5390 % are inside a sub-caption group of a floating environment) this helper macro was introduced.
5391 % \begin{macrocode}
5392 \newcommand*\caption@ifsubtype{\caption@ifdefined\@subcaptype}
5393 % \end{macrocode}
5394 % \end{macro}
5395 %
5396 % \begin{macro}{\caption@checktype}
5397 % \changes{v3.4g}{2020/01/02}{This macro definition added}
5398 % \changes{v3.4m}{2020/07/29}{Check of \cs{sf@counterlist} from \pkg{subfig} package added}
5399 % |\caption@checktype|\marg{type}\marg{code}\par
5400 % is used by |\caption@settype| and should either expand the code or issue an error
5401 % if the given type is not a proper type, i.e. it is a sub-type instead (either defined by
5402 % |\DeclareCaptionSubType| or |\newsubfloat|\cite{subfig}).
5403 % \begin{macrocode}
5404 \newcommand*\caption@checktype[1]{%
5405 \caption@ifdefined@subtype{#1}\@firstoftwo{\caption@ifin@list\sf@counterlist{#1}}%
5406 {\caption@Error{Should not be used with subtype `#1'}%
5407 \@gobble}%
5408 \@firstofone}
5409 % \end{macrocode}
5410 % \end{macro}
5411 %
5412 % \begin{macro}{\caption@checksubtype}
5413 % \changes{v3.4g}{2020/01/02}{This macro definition added}
5414 % \changes{v3.4m}{2020/07/29}{Check of \cs{sf@counterlist} from \pkg{subfig} package added}
5415 % \changes{v3.6c}{2022/04/06}{Check of \cs{sf@counterlist} from \pkg{subfig} package removed}
5416 % \changes{v3.6c}{2022/04/06}{Usage of \cs{caption@subtypesource} added}
5417 % |\caption@checksubtype|\marg{type}\marg{code}\par
5418 % is used by |\caption@settype| and should either expand the code or issue an error
5419 % if the given type is not a proper sub-type, i.e. not defined by |\Declare|\-|Caption|\-|Sub|\-|Type|.
5420 % \begin{macrocode}
5421 \newcommand*\caption@checksubtype[1]{%
5422 \caption@ifdefined@subtype{#1}%
5423 \@firstofone
5424 {\@ifundefined{c@#1}%
5425 {\caption@Error{Undefined counter `#1'}}%
5426 {\caption@subtypesource\caption@subtype@source{#1}%
5427 \caption@Error{The counter `#1' was defined by\MessageBreak\caption@subtype@source}}%
5428 \@gobble}}
5429 % \end{macrocode}
5430 % \end{macro}
5431 %
5432 % \begin{macro}{\caption@checkgrouplevel}
5433 % \changes{v3.1}{2007/07/15}{This macro definition added}
5434 % \changes{v3.1f}{2007/11/28}{Error changed to warning (compatibility)}
5435 % \changes{v3.3}{2013/04/21}{Uses \cs{caption@ifeTeX} now}
5436 % \changes{v3.5}{2019/09/11}{Relies on \eTeX{} now}
5437 % Checks if |\captionsetup{type=|\ldots|}| or |\caption| is done
5438 % inside a group or not -- in the latter case a warning message will
5439 % be issued.
5440 % \begin{macrocode}
5441 \newcommand*\caption@checkgrouplevel[2]{%
5442 \@ifundefined{#1caption@grouplevel}{%
5443 \caption@ifundefined\caption@grouplevel{\let\caption@grouplevel\z@}{}%
5444 \ifnum\currentgrouplevel>\caption@grouplevel\relax
5445 \expandafter\edef\csname #1caption@grouplevel\endcsname{%
5446 \the\currentgrouplevel}%
5447 \else
5448 \caption@Warning{\string#2\MessageBreak outside box or environment}%
5449 \fi
5450 }{}}%
5451 % \end{macrocode}
5452 % \end{macro}
5453 %
5454 % \begin{macro}{\caption@undefinedlabel}
5455 % \changes{v3.1}{2007/07/03}{This macro definition added}
5456 % \changes{v3.1b}{2007/09/22}{Contents changed to \texttt{??}}
5457 % \changes{v3.1i}{2008/04/13}{Contents changed to \cs{caption@xref}(\ldots)}
5458 % \changes{v3.1k}{2009/03/30}{Bugfix 08-12-08: \cs{caption@xref} is robust now}
5459 % \changes{v3.2c}{2011/09/13}{Text changed from `before' to `without proper'}
5460 % \changes{v3.3}{2016/02/21}{Text changed from `without proper \cs{caption}' to `without proper reference'}
5461 % This label will be used for |\currentlabel| inside (floating) environments
5462 % as default. (see above)
5463 % \iffalse\Note{All commands used have to be robust here.}\fi
5464 % \begin{macrocode}
5465 \newcommand*\caption@undefinedlabel{%
5466 \protect\caption@xref{\caption@labelname}{\on@line}}
5467 % \end{macrocode}
5468 % \begin{macrocode}
5469 \DeclareRobustCommand*\caption@xref[2]{%
5470 \caption@WarningNoLine{\noexpand\label without proper reference#2}%
5471 \@setref\relax\@undefined{#1}}
5472 % \end{macrocode}
5473 % \begin{macrocode}
5474 \newcommand*\caption@labelname{??}
5475 % \end{macrocode}
5476 % \end{macro}
5477 %
5478 % \begin{macro}{\caption@xlabel}
5479 % \changes{v3.1b}{2007/09/22}{This macro definition added}
5480 % \changes{v3.1f}{2007/11/11}{Revised}
5481 % \changes{v3.1i}{2008/04/13}{Bugfix: \cs{pageref} should always work now}
5482 % \changes{v3.2c}{2011/08/19}{Works with optional arguments now, too}
5483 % The new code of |\label| inside floating environments.
5484 % |\label| will be redefined using |\caption@withoptargs|, so
5485 % |#1| are the optional arguments (if any), and
5486 % |#2| is the mandatory argument here.
5487 % \begin{macrocode}
5488 \newcommand*\caption@xlabel{%
5489 \caption@withoptargs\caption@@xlabel}
5490 % \end{macrocode}
5491 % \begin{macrocode}
5492 \newcommand*\caption@@xlabel[2]{%
5493 \caption@@@xlabel
5494 \def\caption@labelname{#2}%
5495 \caption@x@label#1{#2}}
5496 % \end{macrocode}
5497 % \begin{macrocode}
5498 \newcommand*\caption@@@xlabel{%
5499 \global\let\caption@@@xlabel\@empty
5500 \@bsphack
5501 \protected@write\@auxout{}%
5502 {\string\providecommand*\string\caption@xref[2]{%
5503 \string\@setref\string\relax\string\@undefined{\string##1}}}%
5504 \@esphack}
5505 % \end{macrocode}
5506 % \end{macro}
5507 %
5508 % \begin{macro}{\captionof}
5509 % \changes{v3.1}{2007/05/09}{Uses \cs{caption@settype} instead of \cs{def}\cs{@captype}}
5510 % \changes{v3.1c}{2007/09/22}{Bugfix: Redefinition of \cs{caption@setfloatcapt} removed}
5511 % \changes{v3.1e}{2007/10/30}{Better compatibility: Will be defined with \cs{AtBeginDocument} now}
5512 % \changes{v3.2}{2010/10/24}{Bugfix 10-10-17: Uses \cs{setcaptiontype} instead of \cs{caption@settype} now}
5513 % \changes{v3.5}{2020/08/24}{Definition method adapted to the \pkg{caption-light} package}
5514 % |\captionof|\marg{type}\oarg{lst\_entry}\marg{heading}\\
5515 % |\captionof*|\oarg{lst\_entry}\marg{heading}\par
5516 % \Note{This will be defined with \cs{AtBeginDocument} so
5517 % \cs{usepackage}\csmarg{caption,capt-of} will still work.
5518 % (Compatibility to \version{1.x})}
5519 % \begin{macrocode}
5520 \caption@AtBeginDocument{%
5521 \def\captionof{\caption@teststar\caption@of{\caption*}\caption}}
5522 % \end{macrocode}
5523 % \begin{macrocode}
5524 \providecommand*\caption@of[2]{\setcaptiontype*{#2}#1}
5525 % \end{macrocode}
5526 % \end{macro}
5527 %
5528 % \subsection{\cs{phantomcaption}}
5529 %
5530 % \begin{macro}{\phantomcaption}
5531 % \changes{v3.2}{2010/10/31}{Bugfix 10-09-01b: This macro added}
5532 % \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
5533 % |\phantomcaption|\par
5534 % increments the counter and generates an reference
5535 % which could be used with |\label|, but does not typeset anything.
5536 % \begin{macrocode}
5537 \newcommand*\phantomcaption{%
5538 \caption@iftype
5539 {\caption@refstepcounter\@captype}%
5540 {\caption@OutsideFloat\phantomcaption}}
5541 % \end{macrocode}
5542 % \end{macro}
5543 %
5544 % \subsection{\cs{captionlistentry}}
5545 %
5546 % \begin{macro}{\captionlistentry}
5547 % \changes{v3.1}{2007/07/28}{This macro added}
5548 % \changes{v3.1f}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
5549 % \changes{v3.1g}{2008/01/20}{Starred variant added}
5550 % \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
5551 % \changes{v3.6}{2020/12/27}{With optional argument \cs{caption@refstepcounter@} is used instead of \cs{caption@refstepcounter}}
5552 % \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
5553 % \changes{v3.6f}{2022/04/18}{\cs{@ifnextchar} replaced by \cs{kernel@ifnextchar}}
5554 % |\captionlistentry|\oarg{float type}\marg{list entry}\\
5555 % |\captionlistentry*|\oarg{float type}\marg{list entry}
5556 % \begin{macrocode}
5557 \newcommand*\captionlistentry{%
5558 \caption@teststar\caption@listentry\@firstoftwo\@secondoftwo}
5559 % \end{macrocode}
5560 % \begin{macrocode}
5561 \newcommand*\caption@listentry[1]{%
5562 \kernel@ifnextchar[%]
5563 {\caption@listentry@{#1}}%
5564 {\caption@@listentry{#1}}}
5565 % \end{macrocode}
5566 % \begin{macrocode}
5567 \def\caption@listentry@#1[#2]{%
5568 \caption@@@listentry{#1}{#2}{\caption@refstepcounter@}}
5569 % \end{macrocode}
5570 % \begin{macrocode}
5571 \newcommand*\caption@@listentry[1]{%
5572 \caption@iftype
5573 {\caption@@@listentry{#1}{\@captype}{\caption@refstepcounter}}%
5574 {\caption@OutsideFloat\captionlistentry
5575 \@gobble}}
5576 % \end{macrocode}
5577 % \begin{macrocode}
5578 \newcommand*\caption@@@listentry[4]{%
5579 \@bsphack
5580 #1{\caption@gettitle{#4}}%
5581 {#3{#2}\caption@makecurrent{#2}{#4}}%
5582 \caption@addcontentsline{#2}{#4}%
5583 \@esphack}
5584 % \end{macrocode}
5585 % \end{macro}
5586 %
5587 % \subsection{\cs{captiontext}}
5588 %
5589 % \begin{macro}{\captiontext}
5590 % \changes{v3.6}{2022/01/05}{This macro added}
5591 % \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
5592 % |\captiontext*|\oarg{number}\marg{text for caption}\par
5593 % typesets the caption without incrementing the counter,
5594 % without putting an entry into the list, and without skips.
5595 % The starred variant skips the single-line-check additionally
5596 % and does not use a box or parbox or margin.
5597 % \begin{macrocode}
5598 \newcommand*\captiontext{%
5599 \caption@iftype
5600 {\caption@text\@captype}%
5601 {\caption@OutsideFloat\captiontext
5602 \caption@withoptargs\@gobbletwo}}
5603 \newcommand*\caption@text[1]{%
5604 \caption@teststar{\caption@@text{#1}}\caption@@@make\caption@@make}
5605 \newcommand*\caption@@text[2]{%
5606 \kernel@ifnextchar[%]
5607 {\caption@@@text{#1}#2\@iden}%
5608 {\caption@@@text{#1}#2\@gobble[0]}}
5609 \long\def\caption@@@text#1#2#3[#4]#5{%
5610 \begingroup
5611 #3{\csname c@#1\endcsname #4\relax}%
5612 #2{\caption@fnum{#1}}{#5}%
5613 \endgroup}
5614 % \end{macrocode}
5615 % \end{macro}
5616 %
5617 % \subsection{The \env{captiongroup} environment}
5618 %
5619 % \begin{environment}{captiongroup}
5620 % \changes{v3.6}{2022/02/20}{This environment definition added}
5621 % \env{captiongroup} is simply an environment containing |\set|\-|caption|\-|type|, that's all.
5622 % A starred variant of this environment is available, too, which uses |\set|\-|caption|\-|type*|.
5623 % \begin{macrocode}
5624 \newenvironment{captiongroup}{\setcaptiontype}{}
5625 \newenvironment{captiongroup*}{\setcaptiontype*}{}
5626 % \end{macrocode}
5627 % \end{environment}
5628 %
5629 % \subsubsection{The \env{captionblock} environment}
5630 %
5631 % \begin{macro}{\caption@minipage}
5632 % \changes{v3.6}{2022/02/20}{This macro definition added}
5633 % This is a \env{minipage} with |\set|\-|caption|\-|type| as first contents line.
5634 % \begin{macrocode}
5635 \newcommand*\caption@minipage{%
5636 \@testopt\caption@iminipage b}
5637 % \end{macrocode}
5638 % We pass all other optional arguments using the generic helper macro
5639 % |\caption@with|\-|opt|\-|args| offered by the \pkg{caption} kernel).
5640 % \begin{macrocode}
5641 \def\caption@iminipage[#1]{%
5642 \caption@withoptargs{\caption@iiminipage{#1}}}
5643 % \end{macrocode}
5644 % `B' and `T' will add a |\vspace{0pt}|, all other values (and additional
5645 % optional arguments) will be passed unseen to the |minipage| environment.
5646 % \begin{macrocode}
5647 \newcommand*\caption@iiminipage[3]{%
5648 \let\caption@endminipage@hook\@empty
5649 \if#1B%
5650 \minipage[b]#2{#3}%
5651 \def\caption@endminipage@hook{\vspace{0pt}}%
5652 \else\if#1T%
5653 \minipage[t]#2{#3}%
5654 \vspace{0pt}%
5655 \else
5656 \minipage[#1]#2{#3}%
5657 \fi\fi
5658 \@floatboxreset
5659 \setcaptiontype}
5660 % \end{macrocode}
5661 % \begin{macrocode}
5662 \newcommand*\caption@endminipage{%
5663 \caption@endminipage@hook
5664 \endminipage}
5665 % \end{macrocode}
5666 % \end{macro}
5667 %
5668 % \begin{environment}{captionblock}
5669 % \changes{v3.6}{2022/02/20}{This environment definition added}
5670 % \env{captionblock} is a \env{minipage} with |\set|\-|caption|\-|type| as first contents line.
5671 % \begin{macrocode}
5672 \newenvironment{captionblock}{\caption@minipage}{\caption@endminipage}
5673 % \end{macrocode}
5674 % \end{environment}
5675 %
5676 % \subsection{\cs{captionbox}}
5677 %
5678 % \begin{macro}{\captionbox}
5679 % \changes{v3.2}{2010/12/17}{This macro added}
5680 % \changes{v3.2a}{2011/08/16}{\cs{captionsetup} replaces with \cs{captionbox@settype} and \cs{caption@setposition}}
5681 % \changes{v3.3}{2012/04/09}{Adapted to revised version of \cs{caption@withoptargs}}
5682 % \changes{v3.3}{2017/03/19}{When used with fixed witdh the content will not be hboxed anymore}
5683 % \changes{v3.3c}{2019/09/01}{Adapted so it could be used by \cs{subfloat} offered by \pkg{subcaption}}
5684 % \changes{v3.5}{2020/07/28}{Adapted to \pkg{caption3} v2.0}
5685 % \changes{v3.6}{2020/12/24}{Check of argument \meta{inner-pos} added}
5686 % A |\parbox| with contents and caption, separated by an invisible |\hrule|.
5687 % \begin{macrocode}
5688 \newcommand*\captionbox{%
5689 \caption@withoptargs{\caption@ibox\@gobble}}
5690 % \end{macrocode}
5691 % \begin{macrocode}
5692 \newcommand\caption@ibox[3]{%
5693 \kernel@ifnextchar[%]
5694 {\caption@iibox{#1}{#2}{#3}}%
5695 {\caption@iibox@{#1}{#2}{#3}}}
5696 % \end{macrocode}
5697 % \begin{macrocode}
5698 \long\def\caption@iibox#1#2#3[#4]{%
5699 \@testopt{\caption@iiibox{#1}{#2}{#3}[{#4}]}\captionbox@innerpos@default}
5700 % \end{macrocode}
5701 % \begin{macrocode}
5702 \long\def\caption@iibox@#1#2#3#4{%
5703 \setbox\@tempboxa\hbox{#4}%
5704 \caption@iiibox{#1}{#2}{#3}[\wd\@tempboxa][\captionbox@innerpos@default]{\unhbox\@tempboxa}}
5705 % \end{macrocode}
5706 % \begin{macrocode}
5707 \long\def\caption@iiibox#1{%
5708 \caption@iiiibox{#1}\vbox\vtop}
5709 % \end{macrocode}
5710 % \begin{macrocode}
5711 \long\def\caption@iiiibox#1#2#3#4#5[#6][#7]#8{%
5712 \caption@checkdecl{justification}{#7}{%
5713 \begingroup
5714 #1*% set \caption@position
5715 \caption@iftop{%
5716 \endgroup
5717 \parbox[t]{#6}{%
5718 #1\relax
5719 \caption@setposition t%
5720 #2{\caption#4{#5}}%
5721 \captionbox@hrule
5722 \csname caption@justification@#7\endcsname
5723 #8}%
5724 }{%
5725 \endgroup
5726 \parbox[b]{#6}{%
5727 #1\relax
5728 \caption@setposition b%
5729 \csname caption@justification@#7\endcsname
5730 #8%
5731 \captionbox@hrule
5732 #3{\caption#4{#5}}}%
5733 }}}
5734 % \end{macrocode}
5735 % \begin{macrocode}
5736 \newcommand*\captionbox@innerpos@default{c}
5737 \newcommand*\captionbox@hrule{\hrule\@height\z@\relax}
5738 % \end{macrocode}
5739 % \begin{macrocode}
5740 \providecommand*\caption@justification@c{\centering}
5741 \providecommand*\caption@justification@l{\raggedright}
5742 \providecommand*\caption@justification@r{\raggedleft}
5743 \providecommand*\caption@justification@s{}
5744 % \end{macrocode}
5745 % \end{macro}
5746 %
5747 % \subsection{\cs{continuedfloat}}
5748 %
5749 % \begin{macro}{\c@continuedfloat}
5750 % \changes{v3.4}{2015/09/16}{Counter renamed from \cs{ContinuedFloat} to \cs{continuedfloat}}
5751 % |\thecontinuedfloat| will be preset to |\@empty|, so usually the continuation counter is not
5752 % included in the caption label or references.
5753 % \begin{macrocode}
5754 \newcounter{continuedfloat}
5755 \let\c@ContinuedFloat\c@continuedfloat % defined for compatibility reasons
5756 % \end{macrocode}
5757 % \begin{macrocode}
5758 \def\thecontinuedfloat{\theContinuedFloat}
5759 \let\theContinuedFloat\@empty % defined for compatibility reasons
5760 % \end{macrocode}
5761 % \end{macro}
5762 %
5763 % \begin{macro}{\continuedfloat@captype}
5764 % \changes{v3.6}{Renamed from \cs{caption@CFtype} to \cs{continuedfloat@captype}}
5765 % Since we have only a single `continuedfloat' counter (and not one per caption type),
5766 % we need to attach a caption type to our counter to make sure that the counter is not
5767 % (mis-)used for a different float type while it holds a value other than zero.
5768 % \begin{macrocode}
5769 \newcommand*\continuedfloat@captype{??}
5770 % \end{macrocode}
5771 % \end{macro}
5772 %
5773 % \begin{macro}{\caption@reset@continuedfloat}
5774 % |\caption@reset@continuedfloat|\marg{caption type}\\
5775 % resets the continuation counter to zero and attaches the given caption type to it.
5776 % \begin{macrocode}
5777 \newcommand*\caption@reset@continuedfloat[1]{%
5778 \xdef\continuedfloat@captype{#1}%
5779 \@stpelt{continuedfloat}}
5780 % \end{macrocode}
5781 % \end{macro}
5782 %
5783 % \begin{macro}{\caption@set@continuedfloat}
5784 % \changes{v3.6}{2020/12/27}{Some code of \cs{continuedfloat} out-sourced to this macro}
5785 % |\caption@set@continuedfloat|\marg{yes-code}\marg{no-code}\\
5786 % checks if the current caption type matches the one attached to the `continuedfloat' counter
5787 % before increasing it.
5788 % \begin{macrocode}
5789 \newcommand*\caption@set@continuedfloat{%
5790 \ifx\@captype\continuedfloat@captype
5791 \stepcounter{continuedfloat}%
5792 \expandafter\@firstoftwo
5793 \else
5794 \caption@Error{Continued `\@captype' after `\continuedfloat@captype'}%
5795 \expandafter\@secondoftwo
5796 \fi}
5797 % \end{macrocode}
5798 % \end{macro}
5799 %
5800 % \begin{macro}{\continuedfloat}
5801 % \changes{v3.0i}{2005/11/12}{Optional argument added}
5802 % \changes{v3.0g}{2005/06/28}{Bugfix: \cs{newcounter} replaced by \cs{newcount}}
5803 % \changes{v3.1}{2007/07/02}{Format of \pkg{hyperref} extension changed}
5804 % \changes{v3.1}{2007/07/07}{\cs{caption@setoptions} added}
5805 % \changes{v3.1g}{2008/01/29}{Starred variant added}
5806 % \changes{v3.2f}{2011/12/17}{Undocumented optional argument removed}
5807 % \changes{v3.2f}{2011/12/17}{Redefinition of \cs{caption@@@continuedfloat} added}
5808 % \changes{v3.3}{2011/12/28}{Uses \cs{ifcaption@ContinuedFloat} now}
5809 % \changes{v3.3}{2013/05/01}{Usage of \cs{caption@restorecounters} added}
5810 % \changes{v3.3}{2013/12/16}{Bugfix: Does not use \cs{caption@ContinuedFloat} anymore since this breaks \cs{ContinuedFloat} offered by the \pkg{subfig} package}
5811 % \changes{v3.4}{2015/09/16}{Renamed from \cs{ContinuedFloat} to \cs{continuedfloat}}
5812 % \changes{v3.5f}{2020/10/06}{Usage of \cs{caption@restorecounters} removed}
5813 % \changes{v3.6}{2020/12/27}{Check of counter caption type out-sourced to \cs{caption@check@continuedfloat}}
5814 % \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
5815 % |\continuedfloat|\\
5816 % |\continuedfloat*|\par
5817 % This mainly sets the `continued float' flag, increments the continuation counter, and executes the given options.
5818 % \begin{macrocode}
5819 \def\continuedfloat{%
5820 \caption@teststar\caption@continuedfloat\@firstoftwo\@secondoftwo}
5821 % \end{macrocode}
5822 % \begin{macrocode}
5823 \newcommand*\caption@continuedfloat[1]{%
5824 \caption@iftype
5825 {#1{\caption@@refstepcounter\@captype}{}%
5826 \caption@@continuedfloat\@captype}%
5827 {\caption@OutsideFloat\continuedfloat}}
5828 % \end{macrocode}
5829 % \begin{macrocode}
5830 \newcommand*\caption@@continuedfloat{%
5831 \caption@clrflags
5832 \caption@set@continuedfloat
5833 {\caption@setcontinued
5834 \caption@@@continuedfloat}%
5835 {\@gobble}}
5836 % \end{macrocode}
5837 % \begin{macrocode}
5838 \newcommand*\caption@@@continuedfloat[1]{%
5839 \caption@setoptions{ContinuedFloat}% for compatibility reasons
5840 \caption@setoptions{continuedfloat}%
5841 \caption@setoptions{continued#1}%
5842 \expandafter\l@addto@macro\csname the#1\endcsname\thecontinuedfloat
5843 % \end{macrocode}
5844 % When the \pkg{hyperref} package is used we have the problem
5845 % that the usage of |\continued|\-|float| will create duplicate
5846 % hyper links -- |\@current|\-|Href| will be the same for the main float and
5847 % the continued ones. So we have to make sure unique labels and references
5848 % will be created each time. We do this by extending |\the|\-|H|\-|figure| and
5849 % |\the|\-|H|\-|table|, so for continued floats the scheme
5850 % \begin{quote}\meta{type}|.|\meta{type \#}|\alph{|\meta{continued \#}|}|\end{quote}
5851 % will be used instead of
5852 % \begin{quote}\meta{type}|.|\meta{type \#}\quad\quad.\end{quote}
5853 % \par{\small(This implementation follows an idea from Steven Douglas Cochran.)}
5854 % \Note{This does not help if the \pkg{hyperref} package option \texttt{naturalnames=true} is set.}
5855 % \begin{macrocode}
5856 \@ifundefined{theH#1}{}{%
5857 \expandafter\l@addto@macro\csname theH#1\endcsname{%
5858 \@alph\c@continuedfloat}}%
5859 % \end{macrocode}
5860 % Make sure the options and the \pkg{hyperref} patch is only applied once (per group).
5861 % \begin{macrocode}
5862 \let\caption@@@continuedfloat\@gobble}
5863 % \end{macrocode}
5864 % \end{macro}
5865 %
5866 % \begin{macro}{\ContinuedFloat}
5867 % For compatibility reasons we still support the obsolete |\Continued|\-|Float|.
5868 % \begin{macrocode}
5869 \def\ContinuedFloat{\continuedfloat} % defined for compatibility reasons
5870 % \end{macrocode}
5871 % \end{macro}
5872 %
5873 % \begin{macro}{\caption@ContinuedFloat}
5874 % \changes{v3.0f}{2005/06/11}{This macro added}
5875 % \changes{v3.3}{2013/12/16}{Bugfix: Revised and defined with \cs{def} instead of \cs{newcommand}}
5876 % |\caption@ContinuedFloat|\marg{caption type}\par
5877 % This one is used by \cs{ContinuedFloat} offered by the \pkg{subfig} package.
5878 % Since the \pkg{subfig} package does its own counter handling we try not to
5879 % interfere by changing couter-related flags.
5880 % not interfere with it
5881 % \begin{macrocode}
5882 \def\caption@ContinuedFloat{%
5883 \caption@set@continuedfloat\caption@@@continuedfloat\@gobble}
5884 % \end{macrocode}
5885 % \end{macro}
5886 %
5887 % \begin{macro}{\nextfloat}
5888 % \changes{v3.6}{2020/09/20}{This command added}
5889 % \changes{v3.6}{2021/01/09}{Usage of \cs{flushsubcaptionlistentries} added}
5890 % \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
5891 % |\nextfloat| resets the flags (indicating that the next contents of the floating environment starts here),
5892 % and sets a new \pkg{hyperref} anchor.
5893 % \begin{macrocode}
5894 \providecommand*\nextfloat{%
5895 \caption@teststar\caption@nextfloat\@firstoftwo\@secondoftwo}
5896 % \end{macrocode}
5897 % \begin{macrocode}
5898 \newcommand*\caption@nextfloat[1]{%
5899 \caption@iftype
5900 {\caption@@nextfloat\@captype
5901 #1{}{\caption@reset@currentlabel\caption@start}}%
5902 {\caption@OutsideFloat\nextfloat}}
5903 % \end{macrocode}
5904 % \begin{macrocode}
5905 \newcommand*\caption@@nextfloat[1]{%
5906 \flushsubcaptionlistentries
5907 \caption@clrflags
5908 \ifx\caption@@@continuedfloat\@gobble
5909 % next continued float
5910 \caption@set@continuedfloat\caption@setcontinued\relax
5911 \fi}
5912 % \end{macrocode}
5913 % \end{macro}
5914 %
5915 % \subsection{Internal helpers}
5916 %
5917 % \begin{macro}{\caption@refstepcounter}
5918 % \changes{v3.1}{2007/07/28}{This macro added}
5919 % \changes{v3.2}{2010/10/26}{Error message moved from \cs{caption@@@settype} to here}
5920 % \changes{v3.2c}{2011/09/04}{Support of \cs{donemaincaptiontrue} from \textsf{memoir} document class added}
5921 % \changes{v3.3}{2011/12/28}{Usage of \cs{ifcaption@caption}, \cs{ifcaption@subcaption}, and \cs{ifcaption@ContinuedFloat} added}
5922 % \changes{v3.5e}{2020/09/28}{Bugfix in re-definition of \cs{stepcounter}; uses \cs{edef} instead of \cs{def} now}
5923 % \changes{v3.6}{2020/09/20}{Handling of flags out-sourced to \cs{caption@ifrefstepcounter}}
5924 % \changes{v3.6}{2020/12/27}{\cs{caption@@@refstepcounter} renamed to \cs{caption@refstepcounter@}}
5925 % \changes{v3.6}{2021/01/09}{Adapted to current interface of \cs{caption@prepare@stepcounter}}
5926 % |\caption@refstepcounter|\marg{counter}\\
5927 % increments the float counter (using |\ref|\-|step|\-|counter|) and resets the continuation counter.
5928 % \begin{macrocode}
5929 \newcommand*\caption@refstepcounter{%
5930 \@nameuse{donemaincaptiontrue}% Support of the memoir document class
5931 \caption@ifrefstepcounter\caption@@refstepcounter\caption@@refcounter}
5932 % \end{macrocode}
5933 % \begin{macrocode}
5934 \newcommand*\caption@@refstepcounter[1]{%
5935 \caption@prepare@stepcounter{#1}%
5936 \caption@refstepcounter@{#1}}
5937 % \end{macrocode}
5938 % \begin{macrocode}
5939 \newcommand*\caption@@refcounter[1]{%
5940 \let\caption@stepcounter@ORI\stepcounter
5941 \def\stepcounter##1{%
5942 \edef\caption@tempa{#1}%
5943 \edef\caption@tempb{##1}%
5944 \ifx\caption@tempa\caption@tempb
5945 % Suppress incrementation of counter
5946 \else
5947 \caption@stepcounter@ORI{##1}%
5948 \fi}%
5949 \caption@refstepcounter@{#1}%
5950 \let\stepcounter\caption@stepcounter@ORI}
5951 % \end{macrocode}
5952 % \begin{macrocode}
5953 \newcommand*\caption@refstepcounter@{\refstepcounter}
5954 % \end{macrocode}
5955 % \end{macro}
5956 %
5957 % \begin{macro}{\caption@stepcounter}
5958 % \changes{v3.6}{2020/09/20}{This macro added}
5959 % \changes{v3.6}{2020/12/27}{Handling of flags out-sourced to \cs{caption@ifstepcounter}}
5960 % \changes{v3.6}{2020/12/27}{\cs{caption@@@stepcounter} renamed to \cs{caption@stepcounter@}}
5961 % \changes{v3.6}{2021/01/09}{Adapted to current interface of \cs{caption@prepare@stepcounter}}
5962 % |\caption@stepcounter|\marg{counter}\\
5963 % increments the float counter (using |\step|\-|counter|) and resets the continuation counter.
5964 % \begin{macrocode}
5965 \newcommand*\caption@stepcounter{%
5966 \caption@ifstepcounter\caption@@stepcounter\caption@@counter}
5967 % \end{macrocode}
5968 % \begin{macrocode}
5969 \newcommand*\caption@@stepcounter[1]{%
5970 \caption@prepare@stepcounter{#1}%
5971 \caption@stepcounter@{#1}}
5972 % \end{macrocode}
5973 % \begin{macrocode}
5974 \newcommand*\caption@@counter[1]{} % nothing to do
5975 % \end{macrocode}
5976 % \begin{macrocode}
5977 \newcommand*\caption@stepcounter@{\stepcounter}
5978 % \end{macrocode}
5979 % \end{macro}
5980 %
5981 % \begin{macro}{\caption@prepare@stepcounter}
5982 % \changes{v3.3}{2011/12/28}{This macro added}
5983 % \changes{v3.6}{2021/01/09}{Argument \meta{source hint} dropped; adapted to current interface of \cs{caption@addsubcontentslines}}
5984 % |\caption@prepare@stepcounter|\marg{counter}
5985 % Dumps the cached list entries and resets the continuation counter.
5986 % \begin{macrocode}
5987 \newcommand*\caption@prepare@stepcounter{%
5988 \caption@addsubcontentslines\relax
5989 \caption@reset@continuedfloat}
5990 % \end{macrocode}
5991 % \end{macro}
5992 %
5993 % \begin{macro}{\caption@ifrefstepcounter}
5994 % \changes{v3.6}{2020/09/20}{This macro added}
5995 % |\caption@ifrefstepcounter|\marg{yes-code}\marg{no-code}\\
5996 % tests if the counter should be increased or not. Furthermore it updates the flags accordingly.
5997 % \begin{macrocode}
5998 \newcommand*\caption@ifrefstepcounter{%
5999 \caption@ifcounter
6000 % \end{macrocode}
6001 % If a caption was already typeset in this environment, we need to increment the counter (again).
6002 % \begin{macrocode}
6003 {\caption@ifcaption}%
6004 % \end{macrocode}
6005 % If a caption and a sub-caption below it were already typeset, we issue a warning additionally.
6006 % (This will only be done if |position=b| is set because this is the case were the sub-caption numbering got most likely wrong.)
6007 % \begin{macrocode}
6008 {\caption@ifsubcaption@below{\caption@iftop\@secondoftwo\@firstoftwo}{\@secondoftwo}}%
6009 % \end{macrocode}
6010 % In each case set the `caption' flag to indicate a caption was typeset.
6011 % \begin{macrocode}
6012 {\caption@setcaption}}
6013 % \end{macrocode}
6014 % \end{macro}
6015 %
6016 % \begin{macro}{\caption@ifstepcounter}
6017 % \changes{v3.6}{2020/12/27}{This macro added}
6018 % |\caption@ifstepcounter|\marg{yes-code}\marg{no-code}\\
6019 % tests if the counter should be increased or not. Furthermore it updates the flags accordingly.
6020 % \begin{macrocode}
6021 \newcommand*\caption@ifstepcounter{%
6022 \caption@ifcounter
6023 % \end{macrocode}
6024 % If a caption and a sub-caption above it were already typeset in this environment, we need to increment the counter (again).
6025 % \begin{macrocode}
6026 {\caption@ifcaption\caption@ifsubcaption@above\@secondoftwo}%
6027 % \end{macrocode}
6028 % In this case issue a warning additionally.
6029 % (This will only be done if |position=t| is set because this is the case were the sub-caption numbering got most likely wrong.)
6030 % \begin{macrocode}
6031 {\caption@iftop}%
6032 % \end{macrocode}
6033 % In each case set the `subcaption' flag to indicate a sub-caption was typeset.
6034 % \begin{macrocode}
6035 {\caption@setsubcaption}}
6036 % \end{macrocode}
6037 % \end{macro}
6038 %
6039 % \begin{macro}{\caption@ifcounter}
6040 % \changes{v3.6}{2020/12/28}{This macro added}
6041 % |\caption@ifcounter|\marg{increment the counter?}\marg{issue a warning?}\marg{set flag}\marg{yes-code}\marg{no-code}\\
6042 % contains the common code of |\caption@if|\-|ref|\-|step|\-|counter| and |\caption@if|\-|step|\-|counter|.
6043 % \begin{macrocode}
6044 \newcommand*\caption@ifcounter[3]{%
6045 \caption@ifflags
6046 % \end{macrocode}
6047 % Test if the counter should be incremented (again). If yes, test if a warning should be issued additionally.
6048 % (If the counter gets incremented all flags will be cleared to indicate a new run.)
6049 % \begin{macrocode}
6050 {#1%
6051 {#2\caption@Warning\@gobble{Ambiguous sub-caption(s), use \string\nextfloat}%
6052 \caption@clrflags
6053 \let\caption@next\@firstoftwo}%
6054 {\let\caption@next\@secondoftwo}}%
6055 % \end{macrocode}
6056 % Always increment the counter if no flag was set so far.
6057 % \begin{macrocode}
6058 {\let\caption@next\@firstoftwo}%
6059 % \end{macrocode}
6060 % Set either the `caption' or `subcaption' flag.
6061 % \begin{macrocode}
6062 #3%
6063 % \end{macrocode}
6064 % \begin{macrocode}
6065 \caption@next}
6066 % \end{macrocode}
6067 % \end{macro}
6068 %
6069 % \begin{macro}{\caption@dblarg}
6070 % \changes{v3.1}{2007/02/05}{This macro added}
6071 % \changes{v3.3}{2012/03/25}{Support of option \opt{list-entry} added}
6072 % \changes{v3.6n}{2023/07/31}{Only an empty list-entry will expand to \cs{relax}, otherwise it remains unchanged}
6073 % A |\relax| was added compared to |\@dblarg| so |\caption{}| will be
6074 % expanded to |\caption[\relax]{}| (and not to |\caption[]{}|).
6075 % Furthermore support for option \opt{list-entry} was added.
6076 % \begin{macrocode}
6077 \newcommand\caption@dblarg[1]{%
6078 \kernel@ifnextchar[%]
6079 {\caption@ydblarg{#1}}%
6080 {\caption@xdblarg{#1}}}
6081 % \end{macrocode}
6082 % \begin{macrocode}
6083 \newcommand\caption@xdblarg[2]{%
6084 \caption@iftokens{#2}{#1[{#2}]{#2}}{#1[\relax]{}}}
6085 % \end{macrocode}
6086 % \begin{macrocode}
6087 \long\def\caption@ydblarg#1[#2]#3{%
6088 \caption@iflistheading{#1[{#3}]{#3}}{#1[{#2}]{#3}}}
6089 % \end{macrocode}
6090 % \begin{macrocode}
6091 % \end{macrocode}
6092 % \end{macro}
6093 %
6094 % \begin{macro}{\caption@begin}
6095 % \changes{v3.0a}{2004/01/23}{\cs{caption@settype} changed to \cs{caption@setfloattype}}
6096 % \changes{v3.0e}{2005/04/12}{Check for default label format added}
6097 % \changes{v3.0f}{2005/06/11}{Usage of \cs{caption@resetContinuedFloat} added}
6098 % \changes{v3.1}{2007/05/09}{Usage of \cs{caption@setfloattype} \& \cs{caption@resetContinuedFloat} removed}
6099 % \changes{v3.3}{2011/12/29}{Usage of \cs{caption@fixedposition} removed}
6100 % Our handling of |\caption| will always be surrounded by
6101 % |\caption@begin| (or |\caption@beginex|) and |\caption@end|.\par
6102 % |\caption@begin|\marg{type} performs these tasks:
6103 % \begin{enumerate}
6104 % \item[1.] Override the |position=| setting, if necessary.
6105 % (for example if set to |auto| or used inside a |supertabular|)
6106 % \item[2.] Start a new group.
6107 % \item[3.] Define |\fnum@|\meta{type} if the caption label format is set
6108 % to non-default.
6109 % \end{enumerate}
6110 % \begin{macrocode}
6111 \newcommand*\caption@begin[1]{%
6112 \caption@fixposition
6113 \begingroup
6114 \caption@setfnum{#1}}
6115 % \end{macrocode}
6116 % \end{macro}
6117 %
6118 % \begin{macro}{\caption@beginex}
6119 % \changes{v3.0b}{2004/05/16}{Support of \opt{listof=} added}
6120 % \changes{v3.0l}{2007/02/04}{Takes now 3 args instead of 2, check for empty heading added}
6121 % \changes{v3.1}{2007/07/01}{Makes lst-entry now instead of redefining \cs{addcontentsline}}
6122 % \changes{v3.2}{2010/10/26}{Bugfix 09-05-15: Setting of \cs{lst@@caption} added}
6123 % \changes{v3.5h}{2022/03/01}{Hook added, setting of \cs{lst@@caption} removed}
6124 % |\caption@beginex|\marg{type}\marg{list entry}\marg{heading}\par
6125 % performs the same tasks as |\caption@begin| and additionally:
6126 % \begin{enumerate}
6127 % \item[4.] Apply the hook |\caption@beginex@hook|
6128 % \item[5.] Make an entry in the list-of-whatever.
6129 % \item[6.] Set |\caption@ifempty| according argument \meta{heading}.
6130 % \end{enumerate}
6131 % \begin{macrocode}
6132 \newcommand\caption@beginex[3]{%
6133 \caption@begin{#1}%
6134 \caption@beginex@hook
6135 \caption@addcontentsline{#1}{#2}%
6136 \caption@ifempty{#3}{}}
6137 % \end{macrocode}
6138 % \begin{macrocode}
6139 \newcommand*\caption@beginex@hook{}
6140 % \end{macrocode}
6141 % \end{macro}
6142 %
6143 % \begin{macro}{\caption@end}
6144 % \changes{v3.3}{2011/12/29}{Usage of \cs{caption@fixedposition} removed}
6145 % |\caption@end| closes the group.
6146 % \begin{macrocode}
6147 \newcommand*\caption@end{%
6148 \endgroup}
6149 % \end{macrocode}
6150 % \end{macro}
6151 %
6152 % \changes{v3.0a}{2004/01/23}{Internal hooks \cs{caption@@begin} \& \cs{caption@@end} added}
6153 % \changes{v3.0h}{2005/10/06}{Internal hooks \cs{caption@@begin} \& \cs{caption@@end} removed}
6154 %
6155 % \begin{macro}{\caption@normalsize}
6156 % \changes{v3.1}{2007/05/05}{This macro definition added}
6157 % \changes{v3.5}{2020/07/27}{Adapted to \pkg{caption3} v2.0}
6158 % This one will be used by |\@caption| instead of |\normalsize|.
6159 % \begin{macrocode}
6160 \newcommand*\caption@normalsize{%
6161 \caption@font@normal\@unused}
6162 % \end{macrocode}
6163 % \end{macro}
6164 %
6165 % \begin{macro}{\caption@setfloatcapt}
6166 % Needed for support of the \pkg{float} package, where the caption will
6167 % not be typeset directly, but catched in a |\vbox| called |\@floatcapt|
6168 % instead.
6169 % \begin{macrocode}
6170 \let\caption@setfloatcapt\@firstofone
6171 % \end{macrocode}
6172 % \end{macro}
6173 %
6174 % \begin{macro}{\caption@makecurrent}
6175 % This one is needed for support of the \pkg{nameref} and \pkg{hyperref} package.
6176 % \changes{v3.2f}{2012/01/14}{Bugfix: Usage of \cs{caption@gettitle} added}
6177 % \begin{macrocode}
6178 \newcommand*\caption@makecurrent[1]{\caption@gettitle}
6179 % \end{macrocode}
6180 % \end{macro}
6181 %
6182 % \begin{macro}{\caption@makeanchor}
6183 % \begin{macro}{\caption@start}
6184 % \begin{macro}{\caption@@start}
6185 % \begin{macro}{\caption@freezeHref}
6186 % \begin{macro}{\caption@defrostHref}
6187 % All these are needed for support of the \pkg{hyperref} package.
6188 % \begin{macrocode}
6189 \let\caption@makeanchor\@firstofone
6190 \let\caption@start\relax
6191 \let\caption@@start\relax
6192 \let\caption@freezeHref\relax
6193 \let\caption@defrostHref\relax
6194 % \end{macrocode}
6195 % \end{macro}
6196 % \end{macro}
6197 % \end{macro}
6198 % \end{macro}
6199 % \end{macro}
6200 %
6201 % \begin{macro}{\caption@gettitle}
6202 % \changes{v3.1l}{2010/01/09}{This macro and its usage added to adapt the definition of \cs{@currentlabelname} to recent versions of \pkg{nameref}}
6203 % \changes{v3.6o}{2023/08/05}{Support for older versions of \pkg{nameref} revised to make it compatible with \LaTeX\ 2023-06-01}
6204 % This one is needed for support of the \pkg{nameref} package.
6205 % \begin{macrocode}
6206 \newcommand\caption@gettitle[1]{%
6207 \caption@ifdefined\NR@gettitle
6208 {\NR@gettitle{#1}}% % support for recent versions of nameref package
6209 {\caption@ifdefined\NR@sect{\def\@currentlabelname{#1}}{}}} % support for older versions of nameref package
6210 % \end{macrocode}
6211 % \end{macro}
6212 %
6213 % \subsection{Support for sub-captions}
6214 % \changes{v3.1f}{2007/11/16}{Support for sub-captions added}
6215 %
6216 % \begin{macro}{\subcaptionsetup}
6217 % \changes{v3.6l}{2023/03/22}{This macro definition moved from \pkg{subcaption} package to here}
6218 % |\subcaptionsetup*|\oarg{environment}\marg{options}
6219 % is an abbreviation for |\caption|\-|setup*[sub|\meta{environment}|]|\marg{options},
6220 % especially |\sub|\-|caption|\-|setup|\marg{options} sets options valid for all sub-captions.
6221 % \begin{macrocode}
6222 \newcommand*\subcaptionsetup{%
6223 \caption@teststar\@subcaptionsetup*{}}
6224 % \end{macrocode}
6225 % \begin{macrocode}
6226 \newcommand*\@subcaptionsetup[1]{%
6227 \@testopt{\captionsetup@sub{#1}}{}}
6228 % \end{macrocode}
6229 % \begin{macrocode}
6230 \def\captionsetup@sub#1[#2]#3{%
6231 \captionsetup#1[sub#2]{#3}}
6232 % \end{macrocode}
6233 % \end{macro}
6234 %
6235 % \begin{macro}{\caption@subtypehook}
6236 % \changes{v3.1g}{2008/03/20}{Redefinition of \cs{caption@setlist} added}
6237 % \changes{v3.1k}{2009/10/09}{Bugfix 09-08-12b: \cs{@makecaption} will now be restored here, too}
6238 % \changes{v3.2}{2011/06/26}{Uses \cs{caption@@addcontentsline} instead of \cs{addcontentsline} now}
6239 % \changes{v3.2a}{2011/08/17}{Redefinition of \cs{phantomcaption} added}
6240 % \changes{v3.2a}{2011/08/17}{Usage of \cs{caption@warmup} added}
6241 % \changes{v3.2c}{2011/09/30}{Bugfix 11-09-26: Usage of \cs{if@subfloatrow} added}
6242 % \changes{v3.3}{2011/12/28}{Bugfix 11-12-16: \cs{caption@l@stepcounter} replaced by \cs{stepcounter}}
6243 % \changes{v3.3}{2012/03/15}{Usage of \cs{caption@setbox} added}
6244 % \changes{v3.3}{2013/05/01}{Redefinition of \cs{caption@settype} added}
6245 % \changes{v3.3}{2013/06/17}{Missing redefinition of \cs{captionlistentry} added}
6246 % \changes{v3.3}{2018/09/06}{Adapted to the \pkg{chkfloat} package}
6247 % \changes{v3.4f}{2020/01/03}{Redefinition of \cs{@caption} added since it was redefined by the \env{threeparttable} environment}
6248 % \changes{v3.5}{2020/07/27}{Adapted to \pkg{caption3} v2.0}
6249 % \changes{v3.6}{2020/09/20}{Handling of flags out-sourced to \cs{caption@stepcounter}}
6250 % \changes{v3.6d}{2022/04/17}{Usage of \cs{if@subfloatrow} removed in favour of a re-definition of \env{subfloatrow*}}
6251 % Hook, will be used inside \cs{caption@setsubtype}.\par
6252 % (Note: If we are inside an |sub|\-|float|\-|row| environment we have to keep
6253 % the |\@make|\-|caption| code of the \pkg{floatrow} package intact.)
6254 % \begin{macrocode}
6255 \newcommand*\caption@subtypehook{%
6256 \ifx\caption\caption@subcaption \else
6257 \caption@warmup
6258 \caption@stepcounter\@captype
6259 \caption@ifcaption
6260 {}%
6261 {\let\caption@add@contentsline\caption@addsubcontentsline
6262 \let\caption@addsubcontentslines\@gobble}%
6263 % \end{macrocode}
6264 % \begin{macrocode}
6265 \c@continuedfloat=0\relax
6266 \let\caption@setfloatcapt\@firstofone
6267 \let\caption@chkfloat\@gobbletwo
6268 % \end{macrocode}
6269 % \begin{macrocode}
6270 \caption@set{box}{none}%
6271 \caption@clearmargin
6272 \caption@iflist{}{\let\caption@setlist\@gobble}%
6273 \caption@setoptions{sub}%
6274 \caption@setoptions{subfloat}% for subfig-package compatibility
6275 % \end{macrocode}
6276 % \begin{macrocode}
6277 % redefine \setcaptiontype
6278 \renewcommand*\caption@settype[1]{%
6279 \caption@Error{##1 inside \@subcaptype}}%
6280 % \end{macrocode}
6281 % \begin{macrocode}
6282 % redefine \caption
6283 \let\caption\caption@subcaption
6284 \let\@caption\caption@@caption
6285 \let\phantomcaption\caption@subphantom
6286 \let\captionlistentry\caption@sublistentry
6287 \let\captiontext\caption@subtext
6288 % \let\@captype\@subcaptype
6289 \let\caption@refstepcounter\caption@refstepcounter@
6290 % \end{macrocode}
6291 % \begin{macrocode}
6292 % restore \@makecaption
6293 \let\@makecaption\caption@makecaption
6294 \fi}%
6295 % \end{macrocode}
6296 % \end{macro}
6297 %
6298 % \begin{macro}{\caption@subcaption}
6299 % Makes a sub-caption.
6300 % \begin{macrocode}
6301 \newcommand*\caption@subcaption{%
6302 \caption@checkgrouplevel{sub}\subcaption
6303 \caption@star
6304 {\caption@refstepcounter\@subcaptype}%
6305 {\caption@dblarg{\@caption\@subcaptype}}}
6306 % \end{macrocode}
6307 % \end{macro}
6308 %
6309 % \begin{macro}{\caption@subphantom}
6310 % \changes{v3.2a}{2011/08/17}{This macro added}
6311 % Same as |\phantomcaption|, but for sub-captions.
6312 % \begin{macrocode}
6313 \newcommand*\caption@subphantom{%
6314 \caption@checkgrouplevel{sub}\phantomsubcaption
6315 \caption@refstepcounter\@subcaptype}
6316 % \end{macrocode}
6317 % \end{macro}
6318 %
6319 % \begin{macro}{\caption@sublistentry}
6320 % \changes{v3.3}{2013/06/17}{This macro added}
6321 % Same as |\captionlistentry|, but for sub-captions.
6322 % \begin{macrocode}
6323 \newcommand*\caption@sublistentry{%
6324 \caption@teststar\@subcaptionlistentry\@firstoftwo\@secondoftwo}
6325 % \end{macrocode}
6326 % \begin{macrocode}
6327 \newcommand*\@subcaptionlistentry[1]{%
6328 \@testopt{\caption@listentry{#1}}{\@subcaptype}}
6329 % \end{macrocode}
6330 % \end{macro}
6331 %
6332 % \begin{macro}{\caption@subtext}
6333 % \changes{v3.2a}{2011/08/17}{This macro added}
6334 % Same as |\captiontext|, but for sub-captions.
6335 % \begin{macrocode}
6336 \newcommand*\caption@subtext{%
6337 % \caption@checkgrouplevel{sub}\subcaptiontext
6338 \caption@text\@subcaptype}
6339 % \end{macrocode}
6340 % \end{macro}
6341 %
6342 % \begin{macro}{caption@clearsubcontentslines}
6343 % Clear pending sub-caption list entries.
6344 % \begin{macrocode}
6345 \newcommand*\caption@clearsubcontentslines{%
6346 \global\let\caption@subcontentslines\@empty}
6347 % \end{macrocode}
6348 % \begin{macrocode}
6349 \caption@clearsubcontentslines
6350 % \end{macrocode}
6351 % \end{macro}
6352 %
6353 % \begin{macro}{\caption@addsubcontentsline}
6354 % \changes{v3.1i}{2008/08/02}{\cs{label}, \cs{index}, and \cs{glossary} are allowed inside the list entry now}
6355 % \changes{v3.2}{2011/06/26}{Uses \cs{caption@@addcontentsline} instead of \cs{addcontentsline} now}
6356 % \changes{v3.2c}{2011/08/19}{Uses \cs{caption@gobble} instead of \cs{@gobble} now}
6357 % \changes{v3.3}{2012/01/15}{Debug message added}
6358 % \changes{v3.3}{2013/03/10}{A single \cs{protect} replaced by \cs{noexpand}}
6359 % \changes{v3.6m}{2023/07/28}{Redefinition of \cs{label} etc. replaced by \cs{caption@prepareslc}}
6360 % Add a pending sub-caption list entry.
6361 % \begin{macrocode}
6362 \newcommand*\caption@addsubcontentsline[4]{%
6363 \caption@Debug{\string\caption@addsubcontentsline{#1}{#2}}%
6364 \begingroup
6365 \caption@prepareslc
6366 \protected@edef\@tempa{\endgroup
6367 \noexpand\g@addto@macro\noexpand\caption@subcontentslines{%
6368 \noexpand\@namedef{the#2}{\csname the#2\endcsname}%
6369 \ifx\@currentHref\@undefined \else
6370 \noexpand\def\noexpand\@currentHref{\@currentHref}%
6371 \fi
6372 \noexpand\caption@@@addcontentsline{#1}{#2}{#3}{#4}}}%
6373 \@tempa}
6374 % \end{macrocode}
6375 % \end{macro}
6376 %
6377 % \begin{macro}{\flushsubcaptionlistentries}
6378 % \changes{v3.3}{2012/01/15}{Renamed from \cs{caption@addsubcontentslines} to \cs{flushsubcaptionlistentries}}
6379 % \changes{v3.3}{2013/03/10}{Bugfix: Missing redefinition of \cs{caption@addsubcontentslines} added}
6380 % \changes{v3.6}{2021/01/09}{Patch of \cs{chapter} and \cs{appendix} dropped}
6381 % Writes pending sub-caption list entries.
6382 % (Note: We keep the parameter of |\caption@add|\-|sub|\-|contents|\-|lines| for compatibility reasons although it's not used anymore.)
6383 % \begin{macrocode}
6384 \newcommand*\flushsubcaptionlistentries{%
6385 \caption@addsubcontentslines\relax}
6386 % \end{macrocode}
6387 % \begin{macrocode}
6388 \renewcommand*\caption@addsubcontentslines[1]{%
6389 \caption@Debug{\string\flushsubcaptionlistentries}%
6390 \begingroup
6391 \caption@subcontentslines
6392 \endgroup
6393 \caption@clearsubcontentslines}
6394 % \end{macrocode}
6395 % \end{macro}
6396 %
6397 % \subsection{Babel package support}
6398 %
6399 % \subsubsection{The arabic \& farsi babel option}
6400 % \changes{v3.5}{2020/08/02}{\pkg{arabic} babel support addded}
6401 %
6402 % \begin{macrocode}
6403 \caption@IfBabelArabi{%
6404 % \end{macrocode}
6405 %
6406 % The \pkg{arabicore} package re-defines |\@make|\-|caption|, |\fnum@figure|, and |\fnum@table|
6407 % incompatible to the \pkg{caption} package, therefore we have to restore our or the original definitions here.
6408 %
6409 % \begin{macrocode}
6410 \let\@makecaption\caption@makecaption
6411 \def\fnum@figure{\figurename\nobreakspace\thefigure}%
6412 \def\fnum@table{\tablename\nobreakspace\thetable}%
6413 % \end{macrocode}
6414 %
6415 % \begin{macrocode}
6416 }{}
6417 % \end{macrocode}
6418 %
6419 % \subsubsection{The frenchle \& frenchpro package}
6420 % \changes{v3.0h}{2005/10/03}{\pkg{frenchle/pro} package support added}
6421 % \changes{v3.5}{2020/08/01}{\pkg{frenchle/pro} package support updated}
6422 %
6423 % \begin{macrocode}
6424 \caption@IfFrenchLe{%
6425 % \end{macrocode}
6426 %
6427 % \begin{macro}{\f@ffrench}
6428 % \begin{macro}{\f@tfrench}
6429 % |\f@ffrench| and |\f@tfrench| reflect |\fnum@figure| and |\fnum@table|
6430 % when used in French mode. These contain additional code which typesets
6431 % the caption separator |\caption|\-|separator| instead of the usual colon.
6432 % Because this breaks with our |\@make|\-|caption| code we have to remove
6433 % this additional code here.
6434 % \begin{macrocode}
6435 \def\f@ffrench{\ifx\listoffigures\relax\else\figurename~\thefigure\fi}%
6436 \def\f@tfrench{\ifx\listoftables\relax\else\tablename~\thetable\fi}%
6437 \let\@eatDP\@undefined
6438 % \end{macrocode}
6439 % \end{macro}
6440 % \end{macro}
6441 %
6442 % Since the \pkg{frenchle} package overwrites |\@make|\-|caption| (within |\GO|\-|french|),
6443 % we need to save it beforehand and restore it afterwards.
6444 % \begin{macrocode}
6445 \caption@AtBeginDocument{%
6446 \let\caption@original@makecaption\@makecaption}%
6447 \g@addto@macro\GOfrench{%
6448 \let\@makecaption\caption@original@makecaption}%
6449 % \end{macrocode}
6450 %
6451 % \begin{macrocode}
6452 }{}
6453 % \end{macrocode}
6454 %
6455 % \subsubsection{The hungarian \& magyar babel option}
6456 % \changes{v3.2}{2009/03/29}{\pkg{magyar} babel support added}
6457 % \changes{v3.3}{2018/08/26}{\pkg{magyar} babel support revised}
6458 % \changes{v3.5}{2020/08/02}{\pkg{magyar} babel support updated}
6459 %
6460 % \begin{macrocode}
6461 \caption@IfBabelHungarian{%
6462 % \end{macrocode}
6463 %
6464 % Since the \pkg{magyar} package tends to overwrite |\@make|\-|caption|
6465 % we save it beforehand and restore it afterwards.
6466 % \Note{Currently it will not be overwritten, caused by a side-effect of a
6467 % work-around for the \pkg{floatrow} package within \pkg{caption3}.}
6468 %
6469 % \begin{macrocode}
6470 \caption@AtBeginDocument{%
6471 \let\caption@original@makecaption\@makecaption}%
6472 \caption@ifdefined\extrashungarian{%
6473 \addto\extrashungarian{%
6474 \let\@makecaption\caption@original@makecaption}}{}%
6475 \caption@ifdefined\extrasmagyar{%
6476 \addto\extrasmagyar{%
6477 \let\@makecaption\caption@original@makecaption}}{}%
6478 % \end{macrocode}
6479 %
6480 % \begin{macrocode}
6481 }{}
6482 % \end{macrocode}
6483 %
6484 % \subsubsection{The latvian babel option}
6485 % \changes{v3.5}{2020/08/02}{\pkg{latvian} babel support updated}
6486 %
6487 % \begin{macrocode}
6488 \caption@IfBabelLatvian{%
6489 % \end{macrocode}
6490 %
6491 % The \pkg{latvian} package re-defines |\@make|\-|caption| incompatible to the \pkg{caption} package,
6492 % therefore we have to restore our definitions here.
6493 %
6494 % \begin{macrocode}
6495 \let\@makecaption\caption@makecaption
6496 % \end{macrocode}
6497 %
6498 % \begin{macrocode}
6499 }{}
6500 % \end{macrocode}
6501 %
6502 % \subsection{Package support}
6503 % \changes{v3.1}{2007/04/11}{Package options `float', `longtable' etc.~are not supported anymore, removed}
6504 %
6505 % \begin{macro}{\caption@IfPackageLoaded}
6506 % \changes{v3.0f}{2005/05/29}{3rd argument \meta{code} added, so no extra check is needed}
6507 % \changes{v3.1}{2007/07/04}{Re-written \& renamed from \cs{caption@ifpackage} to \cs{caption@IfPackageLoaded}}
6508 % \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
6509 % |\caption@IfPackageLoaded|\marg{package}\oarg{version}\marg{true}\marg{false}\par
6510 % Some kind of combination of |\@ifpackageloaded| and |\@ifpackagelater|.
6511 % If the \meta{package} is not loaded yet, the check will be (re-)done
6512 % |\AtBeginDocument|, so the \meta{package} could be loaded later on, too.
6513 % \begin{macrocode}
6514 \newcommand\caption@IfPackageLoaded[1]{%
6515 \@testopt{\caption@@IfPackageLoaded{#1}}{}}
6516 \@onlypreamble\caption@IfPackageLoaded
6517 % \end{macrocode}
6518 % \begin{macrocode}
6519 \long\def\caption@@IfPackageLoaded#1[#2]#3#4{%
6520 \@ifpackageloaded{#1}\@firstofone{%
6521 \caption@Debug{#1 package is not loaded (yet)\@gobble}%
6522 \caption@AtBeginDocument}{%
6523 \caption@If@Package@Loaded{#1}[{#2}]{#3}{#4}}}
6524 \@onlypreamble\caption@@IfPackageLoaded
6525 % \end{macrocode}
6526 % \begin{macrocode}
6527 \long\def\caption@If@Package@Loaded#1[#2]{%
6528 \@ifpackageloaded{#1}{%
6529 \caption@InfoNoLine{#1 package is loaded}%
6530 \@ifpackagelater{#1}{#2}\@firstoftwo{%
6531 \caption@Error{%
6532 For a successful cooperation we need at least version\MessageBreak
6533 `#2' of package #1,\MessageBreak
6534 but only version\MessageBreak
6535 `\csname ver@#1.\@pkgextension\endcsname'\MessageBreak
6536 is available}%
6537 \@secondoftwo}%
6538 }{\@secondoftwo}}
6539 \@onlypreamble\caption@If@Package@Loaded
6540 % \end{macrocode}
6541 % \end{macro}
6542 %
6543 % \begin{macro}{\caption@clearmargin}
6544 % \changes{v3.1}{2007/05/05}{This macro definition added}
6545 % \changes{v3.6}{2021/01/17}{Adapted to current implementation of \cs{caption@setmargin}}
6546 % This macro will be used by some package support stuff where the usual
6547 % margin setting is not welcome, e.g. in the \pkg{sidecap} package.
6548 % \begin{macrocode}
6549 \newcommand*\caption@clearmargin{%
6550 \caption@setmargin\z@
6551 \let\caption@minmargin\@undefined}
6552 % \end{macrocode}
6553 % \end{macro}
6554 %
6555 % \begin{macrocode}
6556 \caption@setbool{needfreeze}{0}
6557 \caption@AtBeginDocument*{%
6558 \caption@ifneedfreeze{%
6559 % \end{macrocode}
6560 %
6561 % \begin{macro}{\caption@freezetype}
6562 % \changes{v3.3}{2013/05/01}{This macro added}
6563 % |\caption@freezetype|\marg{type}\par
6564 % Used by the \pkg{fltpage} \& \pkg{sidecap} package support.
6565 % \begin{macrocode}
6566 \newcommand*\caption@freezetype[1]{%
6567 \caption@settype{#1}%
6568 \captionsetup*[sub]{hypcap=true}% Note: This is just a (q&d) workaround!
6569 \caption@freeze}%
6570 % \end{macrocode}
6571 % \end{macro}
6572 %
6573 % \begin{macro}{\caption@freeze}
6574 % \changes{v3.1}{2007/07/22}{This macro added}
6575 % \changes{v3.1c}{2007/10/06}{\cs{caption} \& \cs{@caption} revised for enhanced compatibility}
6576 % \changes{v3.1c}{2007/10/06}{Bugfix: Made \cs{@caption} long}
6577 % \changes{v3.1f}{2007/11/16}{Uses `space hack' instead of \cs{ignorespaces} now}
6578 % \changes{v3.1g}{2008/01/29}{Starred variants of \cs{ContinuedFloat} and \cs{captionsetup} added}
6579 % \changes{v3.2}{2010/10/26}{Bugfix 10-09-01a: Uses \cs{ignorespaces} instead of `space hack' again}
6580 % \changes{v3.2a}{2011/08/17}{Starred variant of \cs{caption@freeze} removed}
6581 % \changes{v3.2b}{2011/08/18}{Redefines \cs{caption@setup} instead of \cs{captionsetup} now}
6582 % \changes{v3.2b}{2011/08/18}{Redefinition of \cs{label} revised}
6583 % \changes{v3.2c}{2011/08/21}{Revised}
6584 % \changes{v3.3}{2013/01/06}{Adapted to new switch \cs{caption@caption} etc.}
6585 % |\caption@freeze|\par
6586 % Used by the \pkg{bicaption} package.
6587 % \begin{macrocode}
6588 \newcommand*\caption@freeze{%
6589 \let\caption@frozen@continuedfloat\continuedfloat
6590 \def\continuedfloat{%
6591 \caption@@freeze{\caption@@@continuedfloat\@captype}%
6592 \caption@frozen@continuedfloat}%
6593 % \end{macrocode}
6594 % \begin{macrocode}
6595 \let\caption@frozen@nextfloat\nextfloat
6596 \def\nextfloat{\caption@freeze@error}%
6597 % \end{macrocode}
6598 % \begin{macrocode}
6599 \let\caption@frozen@setup\caption@setup
6600 \def\caption@setup##1{%
6601 \caption@@freeze{\caption@setup{##1}}%
6602 \caption@frozen@setup{##1}}%
6603 % \end{macrocode}
6604 % \begin{macrocode}
6605 \let\caption@frozen@caption\caption
6606 \def\caption{%
6607 \def\caption{\caption@freeze@error\caption@gobble}%
6608 \@ifstar
6609 {\caption@SC@caption*}%
6610 {\let\@currentlabel\caption@SClabel
6611 \caption@withoptargs\caption@SC@caption}}%
6612 \long\def\caption@SC@caption##1##2{%
6613 \caption@@freeze{\caption##1{##2}}%
6614 \ignorespaces}%
6615 % \end{macrocode}
6616 % \begin{macrocode}
6617 \let\caption@frozen@label\label
6618 \def\label{%
6619 \caption@withoptargs\caption@SC@label}%
6620 \def\caption@SC@label##1##2{%
6621 \ifx\@currentlabel\caption@SClabel
6622 \@bsphack
6623 \caption@freeze@label{##1}{##2}%
6624 \@esphack
6625 \else
6626 \caption@frozen@label##1{##2}%
6627 \fi}%
6628 \def\caption@SClabel{\caption@undefinedlabel}%
6629 \def\caption@freeze@label##1##2{%
6630 \caption@@freeze{\label##1{##2}}}%
6631 % \end{macrocode}
6632 % \begin{macrocode}
6633 \global\let\caption@frozen@content\@empty
6634 \long\def\caption@@freeze{%
6635 \g@addto@macro\caption@frozen@content}%
6636 % \end{macrocode}
6637 % \begin{macrocode}
6638 \def\caption@warmup{%
6639 \let\continuedfloat\caption@frozen@continuedfloat
6640 \let\nextfloat\caption@frozen@nextfloat
6641 \let\caption@setup\caption@frozen@setup
6642 \let\caption\caption@frozen@caption
6643 \let\label\caption@frozen@label}}%
6644 % \end{macrocode}
6645 % \begin{macrocode}
6646 \newcommand*\caption@freeze@error{%
6647 \caption@Error{Only one \noexpand\caption can be placed in this environment}}
6648 % \end{macrocode}
6649 % \end{macro}
6650 %
6651 % \begin{macro}{\caption@prepare@defrost}
6652 % \changes{v3.3}{2013/01/06}{This macro added}
6653 % Prevent resetting the caption flags
6654 % \begin{macrocode}
6655 \newcommand*\caption@prepare@defrost{%
6656 \def\caption@settype{\caption@@settype{}}}
6657 % \end{macrocode}
6658 % \end{macro}
6659 %
6660 % \begin{macro}{\caption@defrost}
6661 % \changes{v3.1}{2007/07/22}{This macro added}
6662 % \changes{v3.1g}{2008/01/30}{\cs{caption@defrost@setup} added}
6663 % \changes{v3.2c}{2011/08/21}{Adapted to changes of \cs{caption@freeze}}
6664 % \changes{v3.2c}{2011/08/21}{\cs{caption@defrost@setup} removed}
6665 % |\caption@defrost|
6666 % \begin{macrocode}
6667 \newcommand*\caption@defrost{%
6668 \ifx\caption@frozen@caption\@undefined
6669 \caption@frozen@content
6670 \else
6671 \caption@Error{Internal Error:\MessageBreak
6672 \noexpand\caption@defrost in same group as \string\caption@freeze}%
6673 \fi}%
6674 % \end{macrocode}
6675 % \end{macro}
6676 %
6677 % \begin{macrocode}
6678 }{}%
6679 \caption@undefbool{needfreeze}}
6680 % \end{macrocode}
6681 %
6682 % \begin{macro}{\caption@warmup}
6683 % \changes{v3.2a}{2011/08/17}{This macro added}
6684 % |\caption@warmup|
6685 % \begin{macrocode}
6686 \let\caption@warmup\relax
6687 % \end{macrocode}
6688 % \end{macro}
6689 %
6690 % \subsubsection{The changepage package}
6691 % \changes{v3.4k}{2020/05/30}{Patch of the \pkg{changepage} package added}
6692 %
6693 % \begin{macrocode}
6694 \caption@IfPackageLoaded{changepage}[2008/07/23 memoir-v3.7k]{%
6695 % \end{macrocode}
6696 %
6697 % \begin{macro}{\caption@patch@adjustwidth}
6698 % \changes{v3.4k}{2020/05/30}{This macro definition added}
6699 % \changes{v3.6j}{2023/03/12}{\cs{ignorespaces} added to environment re-definition}
6700 % Both environments, \env{adjustwidth} and \env{adjustwidth*}, are starting a \env{list} \cs{item}.
6701 % But \cs{hsize} isn't set properly inside a \env{list} item, and therefore \cs{@makecaption}
6702 % (offered by document classes) doesn't work properly when used inside \env{adjustwidth}.
6703 % Therefore we try to detect the situation ``Are we inside a \env{adjustwidth} environment?''
6704 % inside \cs{@makecaption} and fix this. (Sigh!)
6705 % \begin{macrocode}
6706 \providecommand*\caption@patch@adjustwidth[1]{%
6707 \expandafter\let\csname caption@#1\expandafter\endcsname\csname #1\endcsname
6708 \expandafter\renewcommand\csname #1\endcsname[2]{%
6709 \@nameuse{caption@#1}{##1}{##2}%
6710 \caption@set@adjustwidth
6711 \ignorespaces}}%
6712 \caption@patch@adjustwidth{adjustwidth}%
6713 \caption@patch@adjustwidth{adjustwidth*}%
6714 \let\caption@patch@adjustwidth\relax
6715 % \end{macrocode}
6716 % \end{macro}
6717 %
6718 % \begin{macro}{\caption@set@adjustwidth}
6719 % \changes{v3.4k}{2020/05/30}{This macro definition added}
6720 % \changes{v3.5h}{2022/03/01}{Usage of \cs{AtBeginCaption} replaced by \cs{l@addto@macro}\cs{caption@beginex@hook}}
6721 % We cannot simply set and test a flag here since our adjustment to \cs{hsize} should
6722 % not be done within a \cs{parbox} within a \env{adjustwidth} environment for example,
6723 % and therefore we store \cs{hsize} and \cs{linewidth}, and test \cs{hsize} and \cs{linewidth}
6724 % against the stored values instead. If they are equal we are (hopefully) quite save
6725 % to assume that we are now inside a plain \env{adjustwidth} environment and therefore need
6726 % to fix \cs{hsize} before typesetting the caption. (Deep sigh!)
6727 % \begin{macrocode}
6728 \newdimen\caption@adjustwidth@hsize
6729 \newdimen\caption@adjustwidth@linewidth
6730 % \end{macrocode}
6731 % \begin{macrocode}
6732 \providecommand*\caption@set@adjustwidth{%
6733 \caption@adjustwidth@hsize\hsize
6734 \caption@adjustwidth@linewidth\linewidth
6735 \l@addto@macro\caption@beginex@hook\caption@test@adjustwidth}%
6736 % \end{macrocode}
6737 % \end{macro}
6738 %
6739 % \begin{macro}{\caption@test@adjustwidth}
6740 % \changes{v3.4k}{2020/05/30}{This macro definition added}
6741 % Test if the values of \cs{hsize} and \cs{linewidth} are identical to
6742 % the ones stored in the \env{adjustwidth} environment.
6743 % If yes, set \cs{hsize} to the correct value.
6744 % \begin{macrocode}
6745 \providecommand\caption@test@adjustwidth{%
6746 \ifdim\hsize=\caption@adjustwidth@hsize
6747 \ifdim\linewidth=\caption@adjustwidth@linewidth
6748 \hsize=\linewidth
6749 \fi
6750 \fi}%
6751 % \end{macrocode}
6752 % \end{macro}
6753 %
6754 % \begin{macrocode}
6755 }{}%
6756 % \end{macrocode}
6757 %
6758 % \subsubsection{The chkfloat package}
6759 % \changes{v3.3}{2018/09/06}{Support of the \pkg{chkfloat} package added}
6760 %
6761 % \begin{macrocode}
6762 \caption@IfPackageLoaded{chkfloat}[2012/08/19 v0.1]{%
6763 % \end{macrocode}
6764 %
6765 % \begin{macro}{\caption@chkfloat}
6766 % \changes{v3.3}{2018/09/06}{This macro added}
6767 % \begin{macrocode}
6768 \caption@ifdefined\chkfloat@addcontentsline{%
6769 \renewcommand\caption@chkfloat{\chkfloat@addcontentsline}%
6770 }{%
6771 \renewcommand\caption@chkfloat[2]{%
6772 \caption@ifdefined\chkfloat@page{%
6773 \addtocontents{fof}{\protect\chkfloat@{\thepage}{\chkfloat@page}{\csname fnum@#1\endcsname: #2}}%
6774 }{}}%
6775 }%
6776 % \end{macrocode}
6777 % \end{macro}
6778 %
6779 % \begin{macrocode}
6780 }{}%
6781 % \end{macrocode}
6782 %
6783 % \subsubsection{The float package}
6784 % \changes{v3.0f}{2005/05/31}{\pkg{float} package support rewritten and improved}
6785 % \iffalse
6786 % (This is a more straight-ahead implementation, but it only works with \version{1.3}
6787 % now, so \version{1.2} is no longer supported.
6788 % \fi
6789 %
6790 % The \pkg{float} package usually do not use the \LaTeX\ kernel command
6791 % |\@caption| to typeset the caption but |\float@caption| instead.
6792 % (|\@caption| will only be used if the float is re-styled with
6793 % |\restylefloat*|.)
6794 %
6795 % The main two things |\float@caption| is doing different are:
6796 % \begin{itemize}
6797 % \item The caption will be typeset inside a |\savebox| called |\@floatcapt|
6798 % so it can be placed above or below the float contents afterwards.
6799 % \item |\@makecaption| will not be used to finally typeset the caption.
6800 % Instead |\@fs@capt| will be used which definition is part of the float
6801 % style.
6802 % (Note that |\@fs@capt| will not typeset any vertical space above or below
6803 % the caption; instead this space will be typeset by the float style code
6804 % itself.)
6805 % \end{itemize}
6806 %
6807 % \begin{macrocode}
6808 \caption@IfPackageLoaded{float}[2001/11/08 v1.3d]{%
6809 \@ifpackageloaded{floatrow}{%
6810 \caption@If@Package@Loaded{floatrow}[2007/08/24 v0.2a]{}{}%
6811 }{%
6812 % \end{macrocode}
6813 %
6814 % \begin{macro}{\@float@setevery}
6815 % \changes{v3.1k}{2009/10/09}{Bugfix 08-12-05: \cs{color@begin/endgroup} added
6816 % to redefinition of \cs{caption@setfloatcapt}}
6817 % \changes{v3.4b}{2019/12/16}{Usage of \cs{caption@float@setname} added}
6818 % |\@float@setevery|\marg{float type} is provided by the \pkg{float}
6819 % package; it's called every time a floating environment defined with
6820 % |\newfloat| or |\restylefloat| begins.
6821 % We use this hook to do some adaptations and to setup the proper caption
6822 % style (if defined) and additional settings declared with
6823 % |\captionsetup|\oarg{float style}.
6824 % \begin{macrocode}
6825 \let\caption@ORI@float@setevery\@float@setevery
6826 \def\@float@setevery#1{%
6827 \float@ifcaption{#1}{%
6828 % \end{macrocode}
6829 %
6830 % First of all we set the caption position to it's proper value by
6831 % converting |\@fs@iftopcapt| (which is part of a float style and
6832 % controls where the caption will be typeset, above or below the float
6833 % contents) to our |position=| setting.
6834 % Since the spacing above and below the caption will be done by the float
6835 % style and \emph{not} by us this sounds quite useless. But in fact it isn't,
6836 % since some packages based on \thispackage\ (like the \pkg{subfig}
6837 % package) could have an interest for this information and therefore use the
6838 % |\caption@iftop| macro we provide in our kernel. Furthermore we need this
6839 % information for ourself in |\captionof| which uses |\@makecaption| to
6840 % finally typeset the caption with skips.
6841 % \begin{macrocode}
6842 \caption@setposition{\@fs@iftopcapt t\else b\fi}%
6843 % \end{macrocode}
6844 %
6845 % Afterward we redefine |\caption@setfloatcapt| (which will be used inside
6846 % |\@caption|) so the caption will be set inside the box |\@floatcapt|,
6847 % without extra vertical space.
6848 % \begin{macrocode}
6849 \renewcommand\caption@setfloatcapt[1]{%
6850 \let\@makecaption\caption@@make
6851 \global\setbox\@floatcapt\vbox{%
6852 \color@begingroup ##1\color@endgroup}}%
6853 % \end{macrocode}
6854 %
6855 % To allow different caption styles for different float styles we also
6856 % determine the current float style (e.g. `ruled') and select
6857 % a caption style (and additional settings) with the same name, if defined.
6858 % \begin{macrocode}
6859 \float@getstyle\float@style{#1}%
6860 \caption@setstyle*\float@style
6861 \caption@setoptions\float@style
6862 % \end{macrocode}
6863 %
6864 % \begin{macrocode}
6865 }{}%
6866 \caption@float@setname{#1}%
6867 \caption@freezeHref % will be defrosted in \float@makebox
6868 \caption@ORI@float@setevery{#1}}%
6869 % \end{macrocode}
6870 % \end{macro}
6871 %
6872 % \begin{macro}{\float@makebox}
6873 % \changes{v3.3}{2013/01/06}{Corrects wrong load order hyperref-float now}
6874 % \changes{v3.3}{2013/02/03}{Correction of wrong load order hyperref-float revised}
6875 % Redefine |\float@makebox|:
6876 % \begin{macrocode}
6877 \caption@AtBeginDocument{%
6878 % \end{macrocode}
6879 % If it was redefined by the \pkg{hyperref} package,
6880 % we need to build on the original definition (and not on the redefined one).
6881 % \begin{macrocode}
6882 \caption@ifdefined\HyOrg@float@makebox
6883 {\let\caption@ORI@float@makebox\HyOrg@float@makebox}%
6884 {\let\caption@ORI@float@makebox\float@makebox}%
6885 \renewcommand\float@makebox[1]{%
6886 \caption@ORI@float@makebox{#1\relax \caption@defrostHref}}%
6887 % \end{macrocode}
6888 % \begin{macrocode}
6889 }%
6890 % \end{macrocode}
6891 % \end{macro}
6892 %
6893 % \begin{macro}{\caption@float@setname}
6894 % \changes{v3.1}{2007/07/08}{float package hook added}
6895 % \changes{v3.4b}{2019/12/16}{Renamed from \cs{caption@typehook} to \cs{caption@float@setname}}
6896 % \changes{v3.6i}{2023/02/19}{Uses \cs{def} instead of \cs{let} now}
6897 % \LaTeX\ and almost every other packages use
6898 % |\|\meta{type}|name|
6899 % to provide a macro for the type or environment name -- for example
6900 % the command |\figure|\-|name| will usually contain the name of the floating
6901 % environment |figure|:
6902 % \begin{quote}
6903 % |\newcommand\figurename{Figure}|
6904 % \end{quote}
6905 % But the \pkg{float} package doesn't follow this common naming
6906 % convention:
6907 % For floats defined with |\new|\-|float| it uses |\fname@|\meta{type} instead,
6908 % which breaks with our code (and with |\auto|\-|ref| and some other things as
6909 % well).
6910 % So we have to map the \pkg{float} package name to the common one here.\par
6911 % \Note{If the float was not defined with \cs{newfloat} but with
6912 % \cs{restylefloat} instead, \cs{fname@}\meta{type} is not defined.}
6913 % \begin{macrocode}
6914 \newcommand*\caption@float@setname[1]{%
6915 \expandafter\ifx\csname #1name\endcsname\relax % either undefined or \relax
6916 \@namedef{#1name}{\@nameuse{fname@#1}}%
6917 \fi}%
6918 % \end{macrocode}
6919 % \end{macro}
6920 %
6921 % \begin{macro}{\caption@setname}
6922 % \changes{v3.6i}{2023/02/19}{Re-definition of \cs{caption@setname} added to \pkg{float} package support}
6923 % Same problem as in |\caption@float@set|\-|name|, but other direction:
6924 % If the option |name=| is used, we should set |\fname@|\meta{type}, too.
6925 % \begin{macrocode}
6926 \renewcommand*\caption@setname[2]{%
6927 \@ifundefined{fname@#1}{}{\caption@ifdefined\floatname\floatname\@gobbletwo{#1}{#2}}%
6928 \@namedef{#1name}{#2}}%
6929 % \end{macrocode}
6930 % \end{macro}
6931 %
6932 % \changes{v3.0f}{2005/06/26}{Skips of \env{plaintop} and \env{boxed} floats corrected}
6933 % \begin{macro}{\fs@plaintop}
6934 % \begin{macro}{\fs@boxed}
6935 % Since the float styles |plaintop| and |boxed| don't use |\abovecaptionskip|
6936 % which could be set with |skip=| (|plaintop| uses |\belowcaptionskip| instead of
6937 % |\abovecaptionskip|, and |boxed| uses a fixed space of |2pt|)
6938 % we patch the according float style macros here to change this.
6939 % \begin{macrocode}
6940 \g@addto@macro\fs@plaintop{\def\@fs@mid{\vspace\abovecaptionskip\relax}}%
6941 \g@addto@macro\fs@boxed{\def\@fs@mid{\kern\abovecaptionskip\relax}}%
6942 % \end{macrocode}
6943 % \end{macro}
6944 % \end{macro}
6945 %
6946 % \begin{macro}{\float@getstyle}
6947 % \changes{v3.1}{2007/06/10}{This macro added}
6948 % |\float@getstyle|\marg{cmd}\marg{type}\par
6949 % Determining the float style is not so easy because the only hint
6950 % provided by the \pkg{float} package is the macro
6951 % |\fst@|\meta{float type} which points to the macro which represents the
6952 % float style. So for example after
6953 % \begin{quote}
6954 % |\floatstyle{ruled}|\\
6955 % |\newfloat{Program}{tbp}{lop}|
6956 % \end{quote}
6957 % |\fst@Program| will be defined as
6958 % \begin{quote}
6959 % |\def\fst@Program{\fs@ruled}|\quad.
6960 % \end{quote}\par
6961 % So here is what we do: We make the first level expansion of
6962 % |\fst@|\meta{float type} a string so we can gobble the first four tokens
6963 % (= |\fs@|), so only the the name of the float style is left.\par
6964 % \emph{TODO:} We need to convert the catcodes here.
6965 % \begin{macrocode}
6966 \providecommand*\float@getstyle[2]{%
6967 \edef#1{%
6968 \noexpand\expandafter\noexpand\@gobblefour\noexpand\string
6969 \expandafter\expandafter\expandafter\noexpand
6970 \csname fst@#2\endcsname}%
6971 \edef#1{#1}%
6972 \caption@Debug{floatstyle{#2} = `#1'}}%
6973 % \end{macrocode}
6974 % \end{macro}
6975 %
6976 % \begin{macro}{\float@ifcaption}
6977 % \changes{v3.1}{2007/06/23}{This macro added}
6978 % |\float@ifcaption|\marg{type}\marg{if-clause}\marg{else-clause}\par
6979 % Here we determine if the user has used |\newfloat| or |\restylefloat|,
6980 % or |\restylefloat*|.
6981 % This is quite easy: If |\@float@c@|\meta{captype} is the same as
6982 % |\float@caption|, the user has used |\newfloat| or |\restylefloat|,
6983 % otherwise we assume he has used |\restylefloat*|.
6984 % (This test will fail if some package re-defines |\float@caption|,
6985 % so we have to assume that there is no one.)
6986 % \begin{macrocode}
6987 \providecommand*\float@ifcaption[1]{%
6988 \expandafter\ifx\csname @float@c@#1\endcsname\float@caption
6989 \expandafter\@firstoftwo
6990 \else
6991 \expandafter\@secondoftwo
6992 \fi}%
6993 % \end{macrocode}
6994 % \end{macro}
6995 %
6996 % \begin{macrocode}
6997 }}{%
6998 \providecommand*\float@ifcaption[1]{\@secondoftwo}%
6999 % \clearcaptionsetup{boxed}% used by the floatrow package?
7000 }
7001 % \end{macrocode}
7002 %
7003 % The skip between `boxed' floats and their caption defaults to |2pt|.
7004 %
7005 % \begin{macrocode}
7006 \captionsetup[boxed]{skip=2pt} % do not issue a warning when not used
7007 % \end{macrocode}
7008 %
7009 % \changes{v3.0f}{2005/05/26}{\opt{strut=0} added to caption style \opt{ruled}}
7010 % \changes{v3.0f}{2005/05/27}{Option \opt{ruled} fixed}
7011 % To emulate the `ruled' definition of |\@fs@capt| we provide a caption style
7012 % `ruled' with appropriate options. But if the package option |ruled| was
7013 % specified, we setup some caption parameters to emulate the behavior
7014 % of \thispackage\ \version{1.x} option |ruled| instead, i.e.,
7015 % the current caption settings will be used, but without margin and without
7016 % `single-line-check'.
7017 % \begin{macrocode}
7018 \caption@ifbool{ruled}{%
7019 \captionsetup[ruled]{margin=0pt,minmargin=0,slc=0}%
7020 }{%
7021 \DeclareCaptionStyle{ruled}{labelfont=bf,labelsep=space,strut=0}%
7022 }
7023 \caption@undefbool{ruled}
7024 % \end{macrocode}
7025 %
7026 % \subsubsection{The floatflt package}
7027 % \changes{v3.1}{2007/06/10}{Support of the \pkg{floatflt} package added}
7028 %
7029 % \begin{macrocode}
7030 \caption@IfPackageLoaded{floatflt}[1996/02/27 v1.3]{%
7031 % \end{macrocode}
7032 %
7033 % \begin{macro}{\floatingfigure}
7034 % We patch |\floatingfigure| so |\caption@floatflt| will be used.
7035 % \begin{macrocode}
7036 \let\caption@ORI@floatingfigure\floatingfigure
7037 \def\floatingfigure{%
7038 \caption@floatflt{figure}%
7039 \caption@ORI@floatingfigure}%
7040 % \end{macrocode}
7041 % \end{macro}
7042 %
7043 % \begin{macro}{\floatingtable}
7044 % Same with |\floatingtable|\ldots
7045 % \begin{macrocode}
7046 \let\caption@ORI@floatingtable\floatingtable
7047 \def\floatingtable{%
7048 \caption@floatflt{table}%
7049 % \caption@setautoposition b%
7050 \caption@ORI@floatingtable}%
7051 % \end{macrocode}
7052 % \end{macro}
7053 %
7054 % \begin{macro}{\caption@floatflt}
7055 % \changes{v3.1c}{2007/10/06}{Bugfix: \cs{caption@clearmargin} added}
7056 % Here we do two things:
7057 % \begin{enumerate}
7058 % \item We use |\caption@set|\-|options{|\-|floating|\meta{type}|}| so
7059 % |\caption|\-|setup[|\-|floating|\meta{type}|]{|\ldots|}| is supported.
7060 % \item |\line|\-|width| must be set correctly.
7061 % Usually this is done by |\@par|\-|box|\-|restore| inside |\@caption|,
7062 % but since we use |\@caption@parbox|\-|restore| we have to map this to
7063 % |\@par|\-|box|\-|restore| instead.
7064 % \end{enumerate}
7065 % \begin{macrocode}
7066 \newcommand*\caption@floatflt[1]{%
7067 \caption@settype{#1}%
7068 \caption@clearmargin
7069 \caption@setoptions{floating#1}%
7070 \caption@setanchor}%
7071 % \end{macrocode}
7072 % \end{macro}
7073 %
7074 % \begin{macrocode}
7075 }{}
7076 % \end{macrocode}
7077 %
7078 % \subsubsection{The floatrow package}
7079 %
7080 % \begin{macrocode}
7081 \caption@IfPackageLoaded{floatrow}[2008/08/02 v0.3b]{%
7082 % \end{macrocode}
7083 %
7084 % \begin{macro}{\captionlabel}
7085 % \changes{v3.6e}{2022/04/17}{This macro re-definition added}
7086 % The original definition of |\caption|\-|label| uses the internal macro
7087 % |\caption@set|\-|sub|\-|type| which does not exist anymore and needs to
7088 % be replaced by |\set|\-|caption|\-|sub|\-|type|.
7089 % \begin{macrocode}
7090 \renewcommand\captionlabel[1]{{\def\FR@tmp{\@captype}\ifnum\floatbox@depth>\@ne
7091 \def\FR@tmp{sub\@captype}\setcaptionsubtype*\stepcounter{\FR@tmp}\fi
7092 \caption@@@make{\caption@fnum\FR@tmp}{#1}}}
7093 % \end{macrocode}
7094 % \end{macro}
7095 %
7096 % \begin{environment}{subfloatrow}
7097 % \changes{v3.6d}{2022/04/17}{This environment re-definition added}
7098 % The original definition of the environment |sub|\-|float|\-|row|
7099 % uses |\caption|\-|setup{sub|\-|type}| to switch caption commands
7100 % like |\caption| to their counterparts offered by the \pkg{subcaption}
7101 % package.
7102 % Since \pkg{caption} \version{3.6} this does not work in coorparation
7103 % with the \pkg{subfig} package anymore, and therefore we replace it
7104 % with a hook which could be filled by the \pkg{subcaption} package.
7105 % \begin{macrocode}
7106 \renewenvironment{subfloatrow}{\capsubrowsettings
7107 \caption@subfloatrow@hook % as replacement for \captionsetup{subtype}
7108 \@nameuse{subfloatrow*}}{\@nameuse{endsubfloatrow*}}
7109 % \end{macrocode}
7110 % \begin{macrocode}
7111 \providecommand*\caption@subfloatrow@hook{}
7112 % \end{macrocode}
7113 % \end{environment}
7114 %
7115 % \begin{environment}{subfloatrow*}
7116 % \changes{v3.6d}{2022/04/17}{This environment re-definition added}
7117 % Some packages (like the \pkg{float} and \pkg{floatrow} package) re-define
7118 % |\@make|\-|caption| for special handling of the main caption.
7119 % Since this usually does not work fine with sub-captions, the command
7120 % |\set|\-|caption|\-|sub|\-|type| will restore the definition
7121 % of |\@make|\-|caption|. But this is not desired here, and therefore
7122 % we make sure that |\flrow@make|\-|caption| will be used for sub-captions,
7123 % too.
7124 % \begin{macrocode}
7125 \renewenvironment{subfloatrow*}[1][2]{\let\flrow@to\empty
7126 \let\Xhsize\sXhsize%\let\Zhsize\sZhsize
7127 \FR@ifunloc{\let\FR@ifcountH\@firstoftwo}\let\c@FRobj\c@FRsobj
7128 \def\FRleftmargin{}\def\FRrightmargin{}\let\floatrowsep\subfloatrowsep
7129 \floatrow[#1]\killfloatstyle
7130 \let\caption@makecaption\flrow@makecaption}% <- This line added
7131 {\ifdim\lastskip>\z@\unskip\fi
7132 \@ifundefined{adjustsubfloats}\relax\adjustsubfloats\endfloatrow}
7133 % \end{macrocode}
7134 % \end{environment}
7135 %
7136 % \begin{macrocode}
7137 }{}
7138 % \end{macrocode}
7139 %
7140 % \subsubsection{The fltpage package}
7141 % \changes{v3.1}{2007/07/22}{Support of the \pkg{fltpage} package added}
7142 %
7143 % \begin{macrocode}
7144 \caption@IfPackageLoaded{fltpage}[1998/10/29 v.0.3]{%
7145 \caption@setbool{needfreeze}{1}%
7146 % \end{macrocode}
7147 %
7148 % \begin{macro}{\FP@positionLabel}
7149 % \changes{v3.2c}{2011/08/28}{This redefinition added}
7150 % Original code:
7151 % \begin{verbatim}
7152 % \newcommand{\FP@positionLabel}{%
7153 % FP\@captype-\number\value{FP@\@captype C}-pos}
7154 % \end{verbatim}%^^A
7155 % \begin{macrocode}
7156 \renewcommand\FP@positionLabel{%
7157 FP\FP@captype-\number\value{FP@\FP@captype C}-pos}%
7158 % \end{macrocode}
7159 % \end{macro}
7160 %
7161 % \begin{macro}{\FP@helpNote}
7162 % Original code:
7163 % \begin{verbatim}
7164 % \newcommand{\FP@helpNote}[2]{%
7165 % \typeout{FP#1 is inserted on page \pageref{#2}!}}%
7166 % \end{verbatim}%^^A
7167 % \begin{macrocode}
7168 \renewcommand\FP@helpNote[2]{%
7169 \begingroup % save \caption@thepage
7170 \caption@pageref{#2}%
7171 \typeout{FP#1 is inserted on page \caption@thepage!}%
7172 \endgroup}%
7173 % \end{macrocode}
7174 % \end{macro}
7175 %
7176 % \begin{macro}{\FP@floatBegin}
7177 % \changes{v3.1f}{2007/11/16}{Uses `space hack' instead of \cs{ignorespaces} now}
7178 % \changes{v3.1k}{2009/10/09}{Bugfix 09-09-11: Missing \cs{ignorespaces} added}
7179 % \changes{v3.2c}{2011/08/28}{Adapted to current version of \cs{caption@freeze}}
7180 % \changes{v3.2f}{2012/02/19}{Bugfix 12-02-16: \texttt{minipage} environment added}
7181 % \changes{v3.3}{2013/05/01}{Usage of \cs{caption@freeze} replaced by \cs{caption@freezetype}}
7182 % Original code:
7183 % \begin{verbatim}
7184 % \newcommand{\FP@floatBegin}[1]{%
7185 % \gdef\@captype{#1}%
7186 % \global\let\FP@savedCaptionCommand\caption%
7187 % \global\let\FP@savedLabelCommand\label%
7188 % \ifthenelse{\equal{\@captype}{figure}}
7189 % {\global\let\old@Fnum\fnum@figure}%
7190 % {\global\let\old@Fnum\fnum@table}%
7191 % \let\FP@LabelText\@empty%
7192 % \let\FP@CaptionText\@empty%
7193 % \let\FP@optionalCaptionText\@empty%
7194 % \renewcommand\label[1]{\gdef\FP@LabelText{##1}}%
7195 % \renewcommand\caption[2][]{%
7196 % \gdef\FP@optionalCaptionText{##1}\gdef\FP@CaptionText{##2}}%
7197 % \begin{lrbox}{\FP@floatCorpusBOX}%
7198 % }%
7199 % \end{verbatim}%^^A
7200 % \begin{macrocode}
7201 \renewcommand*\FP@floatBegin[1]{%
7202 \def\FP@captype{#1}%
7203 \begin{lrbox}{\FP@floatCorpusBOX}%
7204 \minipage\hsize % changes from LR mode to vertical mode
7205 \caption@freezetype{#1}%
7206 \ignorespaces}%
7207 % \end{macrocode}
7208 % \end{macro}
7209 %
7210 % \begin{macro}{\FP@floatEnd}
7211 % \changes{v3.1g}{2008/01/30}{Some minor bugfixes}
7212 % \changes{v3.2c}{2011/08/28}{Adapted to current version of \cs{caption@freeze}}
7213 % \changes{v3.2f}{2012/02/19}{Bugfix 12-02-16: \texttt{minipage} environment added}
7214 % Original code:
7215 % \begin{verbatim}
7216 % \newcommand{\FP@floatEnd}{%
7217 % \end{lrbox}%
7218 % \global\setbox\FP@floatCorpusBOX=\box\FP@floatCorpusBOX
7219 % \stepcounter{FP@\@captype C}%
7220 % \FP@savedLabelCommand{\FP@positionLabel}%
7221 % \FP@helpNote{\@captype}{\FP@positionLabel}%
7222 % \FP@float
7223 % {\FP@positionLabel}% location label test
7224 % {\begin{\@captype}[p!]
7225 % \usebox{\FP@floatCorpusBOX}%
7226 % \refstepcounter{\@captype}%
7227 % \ifthenelse{\equal{\FP@LabelText}{\@empty}}
7228 % {}{\FP@savedLabelCommand{\expandafter\protect\FP@LabelText}}%
7229 % \end{\@captype}}
7230 % {\addtocounter{\@captype}{-1}}
7231 % {\begin{\@captype}[b!]%
7232 % \ifthenelse{\equal{\FP@guide}{\@empty}}%
7233 % {}{\ifthenelse{\equal{\@captype}{figure}}%
7234 % {\renewcommand{\fnum@figure}{\old@Fnum\ {\FP@guide}}}%
7235 % {\renewcommand{\fnum@table}{\old@Fnum\ {\FP@guide}}}}%
7236 % \setlength{\abovecaptionskip}{2pt plus2pt minus 1pt} % length above caption
7237 % \setlength{\belowcaptionskip}{2pt plus2pt minus 1pt} % length above caption
7238 % \FP@separatorCaption%
7239 % \ifthenelse{\equal{\FP@optionalCaptionText}{\@empty}}%
7240 % {\FP@savedCaptionCommand{\expandafter\protect\FP@CaptionText}}%
7241 % {\FP@savedCaptionCommand[\expandafter\protect\FP@optionalCaptionText]%
7242 % {\expandafter\protect\FP@CaptionText}}%
7243 % \end{\@captype}}%
7244 % }%
7245 % \end{verbatim}%^^A
7246 % \begin{macrocode}
7247 \renewcommand*\FP@floatEnd{%
7248 \endminipage
7249 \end{lrbox}%
7250 % \end{macrocode}
7251 % \begin{macrocode}
7252 \stepcounter{FP@\FP@captype C}%
7253 \caption@label\FP@positionLabel
7254 \FP@helpNote\FP@captype\FP@positionLabel
7255 % \end{macrocode}
7256 % \begin{macrocode}
7257 \FP@float
7258 {\FP@positionLabel}% location label test
7259 {\caption@prepare@defrost
7260 \begin\FP@captype[p!]%
7261 \usebox\FP@floatCorpusBOX
7262 \end\FP@captype}%
7263 {\@ifundefined{theH\FP@captype}{}{%
7264 \expandafter\l@addto@macro\csname theH\FP@captype\endcsname{.FP}}}%
7265 {\caption@prepare@defrost
7266 \begin\FP@captype[b!]%
7267 \let\FP@savedSetfnumCommand\caption@setfnum
7268 \def\caption@setfnum##1{%
7269 \FP@savedSetfnumCommand{##1}%
7270 \ifx\FP@guide\@empty \else
7271 \expandafter\l@addto@macro\csname fnum@##1\endcsname{\ {\FP@guide}}%
7272 \fi}%
7273 \setlength\abovecaptionskip{2pt plus 2pt minus 1pt}% length above caption
7274 \setlength\belowcaptionskip{2pt plus 2pt minus 1pt}% length below caption
7275 \caption@setoptions{FP\@captype}%
7276 \FP@separatorCaption
7277 \caption@defrost
7278 \end\FP@captype}%
7279 }%
7280 % \end{macrocode}
7281 % \end{macro}
7282 %
7283 % \begin{macrocode}
7284 }{%
7285 \let\caption@ifFPlistcap\@undefined
7286 \let\caption@ifFPrefcap\@undefined
7287 }
7288 % \end{macrocode}
7289 %
7290 % \subsubsection{The hyperref package}
7291 % \changes{v3.0f}{2005/06/11}{Support of the \pkg{hyperref} package added}
7292 % \changes{v3.1}{2007/03/09}{Usage of \cs{hyper@makecurrent} instead of
7293 % \cs{theHfigure} as indicator for \pkg{hyperref} package}
7294 % \changes{v3.2}{2011/07/30}{Test if \pkg{hyperref} has stopped early revised}
7295 % \changes{v3.2c}{2011/08/24}{Test if \pkg{hyperref} has stopped early adapted to current version of \pkg{hyperref} package: Usage of \cs{IfHyperBoolean} added}
7296 %
7297 % \begin{macrocode}
7298 \caption@IfPackageLoaded{hyperref}[2003/11/30 v6.74m]{%
7299 % Test if hyperref has stopped early
7300 \caption@ifundefined\IfHyperBoolean{%
7301 \caption@set@bool\caption@ifhyp@stoppedearly0%
7302 \caption@ifundefined\H@refstepcounter
7303 {\caption@set@bool\caption@ifhyp@stoppedearly1}{%
7304 \caption@ifundefined\hyper@makecurrent
7305 {\caption@set@bool\caption@ifhyp@stoppedearly1}{%
7306 \caption@ifundefined\measuring@true
7307 {\caption@set@bool\caption@ifhyp@stoppedearly1}{}}}%
7308 }{%
7309 \def\caption@ifhyp@stoppedearly{\IfHyperBoolean{stoppedearly}}%
7310 }%
7311 \caption@ifhyp@stoppedearly{% hyperref has stopped early
7312 \caption@InfoNoLine{%
7313 Hyperref support is turned off\MessageBreak
7314 because hyperref has stopped early}%
7315 }{%
7316 \AtCaptionSingleLineCheck{\measuring@true}%
7317 % \end{macrocode}
7318 %
7319 % \begin{macro}{\caption@refstepcounter@}
7320 % We redefine |\caption@refstepcounter@| so |\H@refstepcounter| will be used
7321 % instead of |\refstepcounter| inside |\caption| \& |\captionlistentry|.
7322 % \begin{macrocode}
7323 \renewcommand*\caption@refstepcounter@{\H@refstepcounter}%
7324 % \end{macrocode}
7325 % \end{macro}
7326 %
7327 % \begin{macro}{\caption@makecurrent}
7328 % \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
7329 % We redefine |\caption@makecurrent| so a \pkg{hyperref} label
7330 % will be defined inside |\@caption|.
7331 % \Note{Will be redefined by \cs{caption@start}.}
7332 % \begin{macrocode}
7333 \renewcommand*\caption@makecurrent[2]{%
7334 \caption@makecurrentHref{#1}%
7335 \caption@Debug{hyperref current=\@currentHref}%
7336 \caption@gettitle{#2}}%
7337 % \end{macrocode}
7338 % \begin{macrocode}
7339 \newcommand*\caption@makecurrentHref{\hyper@makecurrent}%
7340 % \end{macrocode}
7341 % \end{macro}
7342 %
7343 % \begin{macro}{\caption@makeanchor}
7344 % \changes{v3.1l}{2010/01/09}{Adapted to the current hyperref package}
7345 % We redefine |\caption@makeanchor| so a \pkg{hyperref} anchor
7346 % will be set inside |\@caption|.
7347 % \Note{Will be redefined by \cs{caption@start}.}
7348 % \begin{macrocode}
7349 \renewcommand\caption@makeanchor[1]{%
7350 \caption@Debug{hyperref anchor: \@currentHref}%
7351 % If we cannot have nesting, the anchor is empty.
7352 \ifHy@nesting
7353 \expandafter\hyper@@anchor\expandafter{\@currentHref}{#1}%
7354 \else
7355 \Hy@raisedlink{%
7356 \expandafter\hyper@@anchor\expandafter{\@currentHref}{\relax}%
7357 }#1%
7358 \fi}%
7359 % \end{macrocode}
7360 % \begin{macrocode}
7361 \AtCaptionSingleLineCheck{\let\caption@makeanchor\@firstofone}%
7362 % \end{macrocode}
7363 % \end{macro}
7364 %
7365 % \paragraph{The hypcap option}
7366 %
7367 % \begin{macro}{\if@capstart}
7368 % Like the \pkg{hypcap} package we define the switch |\if@capstart|, too.
7369 % \begin{macrocode}
7370 \newif\if@capstart
7371 % \end{macrocode}
7372 % \end{macro}
7373 %
7374 % \begin{macro}{\caption@start}
7375 % \changes{v3.0l}{2007/02/20}{%
7376 % \cs{caption@currentHref} renamed to \cs{hc@currentHref}}
7377 % \changes{v3.1}{2007/06/21}{%
7378 % This macro renamed from \cs{capstart} to \cs{caption@start} and revised}
7379 % While the \pkg{hypcap} package defines a macro called |\capstart|
7380 % our variant is called |\caption@start| and is controlled by the option
7381 % |hypcap=||false|/|true|.
7382 % \begin{macrocode}
7383 \def\caption@start{\caption@ifhypcap\caption@start@\relax}%
7384 \def\caption@start@{%
7385 % \end{macrocode}
7386 % Generate the \pkg{hyperref} label and set the \pkg{hyperref} anchor,
7387 % usually (if |hypcap=false|) both is done inside |\@caption|.
7388 % \begin{macrocode}
7389 \caption@makestart\@captype
7390 \caption@startanchor\@currentHref
7391 % \end{macrocode}
7392 % Prevent |\@caption| from generating a new \pkg{hyperref} label,
7393 % use the label we save in |\hc@currentHref| instead.
7394 % (We also support the |@capstart| flag from the \pkg{hypcap} package.)
7395 % \begin{macrocode}
7396 \global\@capstarttrue
7397 \let\hc@currentHref\@currentHref
7398 \def\caption@makecurrentHref##1{%
7399 \global\@capstartfalse
7400 \global\let\@currentHref\hc@currentHref}%
7401 % \end{macrocode}
7402 % Prevent |\@caption| from generating a \pkg{hyperref} anchor since this
7403 % has already been done.
7404 % \begin{macrocode}
7405 \let\caption@makeanchor\@firstofone
7406 % \end{macrocode}
7407 % \begin{macrocode}
7408 }%
7409 % \end{macrocode}
7410 % \end{macro}
7411 %
7412 % \begin{macro}{\caption@makestart}
7413 % \changes{v3.1c}{2007/09/30}{\cs{@currentHref} will be extended by \texttt{caption}
7414 % instead of \texttt{xxx} now}
7415 % |\caption@makestart|\marg{type}
7416 % defines a \pkg{hyperref} anchor inside |\caption@start|.\par
7417 % Since we offer |\continuedfloat| the float counter can change between
7418 % `now' and |\caption|, i.e., we simply don't know the figure or table counter
7419 % yet and therefore we are not able to generate the `right' \pkg{hyperref}
7420 % label.
7421 % Two different solutions of this problem came into my mind:
7422 % \begin{enumerate}
7423 % \item I could use the aux file for this purpose.\par
7424 % -or-
7425 % \item I set |hypertexnames=false| locally.
7426 % Furthermore I use |#1.caption.|\meta{counter} (instead of |#1.|\meta{counter})
7427 % as naming scheme for |\@currentHref| to avoid conflicts with other hyper
7428 % links which are generated with |hypertexnames=true|.
7429 % \end{enumerate}
7430 % The first idea has the advantage that the `right' anchor name will be
7431 % generated, but one needs an additional \LaTeX\ run if figures or tables
7432 % will be inserted or removed.\par
7433 % The second idea has the advantage that it's very easy to implement, but
7434 % has some side-effects, e.g. the anchor names don't follow the figure or
7435 % table label names anymore.\par
7436 % Since I'm lazy I implemented the second idea, maybe I will revise this
7437 % later on.
7438 % \begin{macrocode}
7439 \newcommand*\caption@makestart[1]{%
7440 \begingroup
7441 \Hy@hypertexnamesfalse
7442 % \gdef\@currentHlabel{}%
7443 \hyper@makecurrent{#1.caption}%
7444 \endgroup
7445 \caption@Debug{hypcap start=\@currentHref}}%
7446 % \end{macrocode}
7447 % \end{macro}
7448 %
7449 % \begin{macro}{\caption@startanchor}
7450 % \changes{v3.1b}{2007/09/17}{Bugfix 06-09-17: We use \cs{caption@anchor} instead of \cs{hyper@@anchor}}
7451 % \changes{v3.1g}{2008/03/16}{Warning about TeX mode replaced with debug info}
7452 % |\caption@startanchor|\marg{Href}
7453 % sets a \pkg{hyperref} anchor inside |\caption@start|.\par
7454 % This code was taken from the \pkg{hypcap} package\cite{hypcap} and adapted.
7455 % \Note{Since \cs{hyper@@anchor}\marg{Href}\csmarg{\string\relax} can cause
7456 % a change from vertical mode to horizontal mode (design flaw in
7457 % \pkg{hyperref} package!?), and since the workaround
7458 % \cs{let}\cs{leavevmode}\cs{relax} which can be found in the
7459 % \pkg{hypcap} package is not always sufficient
7460 % (for example with ``Direct pdfmark support'' and \texttt{breaklinks=true}),
7461 % we use \cs{caption@anchor} instead of \cs{hyper@@anchor} here.}
7462 % \begin{macrocode}
7463 \newcommand*\caption@startanchor[1]{%
7464 \ifvmode\begingroup
7465 \caption@Debug{hypcap anchor: #1 (vertical mode)}%
7466 \@tempdima\prevdepth
7467 \nointerlineskip
7468 \vspace*{-\caption@hypcapspace}%
7469 \caption@anchor{#1}%
7470 \vspace*{\caption@hypcapspace}%
7471 \prevdepth\@tempdima
7472 \endgroup\else
7473 \caption@Debug{hypcap anchor: #1 (horizontal mode)}%
7474 \caption@anchor{#1}%
7475 \fi}%
7476 % \end{macrocode}
7477 % \end{macro}
7478 %
7479 % \begin{macro}{\caption@anchor}
7480 % \changes{v3.1c}{2007/10/17}{Workaround 07-10-17: We use \cs{caption@raisedlink} instead of \cs{Hy@raisedlink} now}
7481 % |\caption@anchor|\marg{Href} sets a \pkg{hyperref} anchor.
7482 % \begin{macrocode}
7483 \newcommand*\caption@anchor[1]{%
7484 \ifmeasuring@ \else
7485 \caption@raisedlink{\hyper@anchorstart{#1}\hyper@anchorend}%
7486 \fi}%
7487 % \end{macrocode}
7488 % \Note{Since \cs{Hy@raisedlink} change \cs{@tempdima} we surrounded it by \cs{ifvmode},
7489 % suppressing ``\texttt{LaTeX Warning: Float too large for page by 1.0pt}'' in \texttt{sideways} floats.
7490 % (This is not necessary since \pkg{hyperref} \version{6.77}.)}
7491 % \begin{macrocode}
7492 \ifx\HyperRaiseLinkLength\@tempdima
7493 \def\caption@raisedlink#1{\ifvmode#1\else\Hy@raisedlink{#1}\fi}%
7494 \else
7495 \let\caption@raisedlink\Hy@raisedlink
7496 \fi
7497 % \end{macrocode}
7498 % \end{macro}
7499 %
7500 % \begin{macro}{\caption@@start}
7501 % Will be used by |\caption@freezeHref|. Apart from that we issue a warning
7502 % if we expect a saved \pkg{hyperref} label coming from |\caption@start|,
7503 % but there isn't any.
7504 % \begin{macrocode}
7505 \def\caption@@start{%
7506 \caption@ifundefined\hc@currentHref{%
7507 \caption@Warning{%
7508 The option `hypcap=true' will be ignored for this\MessageBreak
7509 particular \string\caption}}{}}%
7510 % \end{macrocode}
7511 % \end{macro}
7512 %
7513 % \begin{macro}{\caption@freezeHref}
7514 % Suppress |\caption@start| from generating a \pkg{hyperref} label and
7515 % setting a \pkg{hyperref} anchor. Instead if |\@caption| generates a
7516 % \pkg{hyperref} label, it will be stored in |\caption@currentHref|.
7517 % Furthermore we need to redefine |\caption@setfloatcapt| so no
7518 % \pkg{hyperref} anchor will be placed in |\@caption|.
7519 % \iffalse
7520 % (Since |\caption@setfloatcapt| will be set to |\@firstofone| inside
7521 % |\subcaption| there is no need to add its restauration to
7522 % |\caption@subtypehook|.)
7523 % \fi
7524 % \begin{macrocode}
7525 \def\caption@freezeHref{%
7526 \let\caption@ORI@start\caption@start
7527 \def\caption@start{\let\caption@start\caption@ORI@start}%
7528 % \end{macrocode}
7529 % \begin{macrocode}
7530 % \let\caption@ORI@@start\caption@@start
7531 % \l@addto@macro\caption@subtypehook{%
7532 % \let\caption@@start\caption@ORI@@start}%
7533 % \end{macrocode}
7534 % \begin{macrocode}
7535 \global\let\caption@currentHref\@undefined
7536 \def\caption@@start{\global\let\caption@currentHref\@currentHref}%
7537 % \end{macrocode}
7538 % \begin{macrocode}
7539 \let\caption@ORI@setfloatcapt\caption@setfloatcapt
7540 \renewcommand*\caption@setfloatcapt{%
7541 \ifx\caption@currentHref\@undefined \else
7542 \let\caption@makeanchor\@firstofone
7543 \fi
7544 \caption@ORI@setfloatcapt}}%
7545 % \end{macrocode}
7546 % \end{macro}
7547 %
7548 % \begin{macro}{\caption@defrostHref}
7549 % If there is a freezed |\@currentHref|, we set the \pkg{hyperref}
7550 % anchor here.
7551 % \begin{macrocode}
7552 \def\caption@defrostHref{%
7553 \ifx\caption@currentHref\@undefined \else
7554 \caption@startanchor\caption@currentHref
7555 \global\let\caption@currentHref\@undefined
7556 \fi}%
7557 % \end{macrocode}
7558 % \end{macro}
7559 %
7560 % \begin{macrocode}
7561 }}{}
7562 % \end{macrocode}
7563 %
7564 % \subsubsection{The hypcap package}
7565 % \changes{v3.0f}{2005/06/22}{Support of the \pkg{hypcap} package added}
7566 % \changes{v3.0l}{2007/02/20}{Adapted to \pkg{hypcap} \version{1.6}}
7567 % \changes{v3.1e}{2007/11/04}{\pkg{hypcap} support adapted to \pkg{hyperref} \version{6.77}}
7568 %
7569 % \begin{macrocode}
7570 \caption@IfPackageLoaded{hypcap}{% v1.0
7571 \ifx\caption@start\relax \else % hyperref hasn't stopped early
7572 % \end{macrocode}
7573 %
7574 % If the \pkg{hypcap} package was loaded, we give up our own
7575 % hyperlink placement algorithm and give the control over the placement
7576 % to the \pkg{hypcap} package instead.
7577 %
7578 % \begin{macro}{\capstart}
7579 % \changes{v3.1k}{2009/10/09}{Support of \cs{ifcapstart} (\pkg{hypcap} package \version{1.10}) added}
7580 % We do this simply by mapping |\capstart| to |\caption@start@|,
7581 % although our code does not behave exactly like the original one:
7582 % The original |\capstart| has an effect on the next |\caption|
7583 % only but our version affects \emph{all} |\caption|s in the same
7584 % environment, at least unless a new |\capstart| will be placed.
7585 % \begin{macrocode}
7586 \caption@ifundefined\capstarttrue % check for v1.10 of hypcap package
7587 {\def\capstart{\caption@start@}}%
7588 {\def\capstart{\ifcapstart\caption@start@\fi}}%
7589 \let\caption@start\relax
7590 \let\caption@@start\relax
7591 % \end{macrocode}
7592 % \end{macro}
7593 %
7594 % \begin{macro}{\caption@hypcapspace}
7595 % Furthermore we map our |\caption@hypcapspace| to |\hypcapspace|
7596 % offered by the \pkg{hypcap} package.
7597 % \begin{macrocode}
7598 \caption@set@bool\caption@ifhypcap 1%
7599 \renewcommand*\caption@hypcapspace{\hypcapspace}%
7600 % \end{macrocode}
7601 % \end{macro}
7602 %
7603 % \begin{macrocode}
7604 \fi}{}
7605 % \end{macrocode}
7606 %
7607 % \subsubsection{The listings package}
7608 % \changes{v3.0b}{2004/05/16}{Support of the \pkg{listings} package added}
7609 %
7610 % \begin{macrocode}
7611 \caption@IfPackageLoaded{listings}[2004/02/13 v1.2]{%
7612 % \end{macrocode}
7613 %
7614 % \begin{macro}{\lst@MakeCaption}
7615 % \changes{v3.1g}{2008/01/20}{Bugfix: Skips are handled correctly now}
7616 % \changes{v3.1k}{2008/03/29}{Bugfix 08-10-16-dctt: \texttt{rule=0} added}
7617 % \changes{v3.2}{2010/10/26}{Bugfix 10-07-20a: Set \cs{hsize} to \cs{linewidth}, if necessary}
7618 % \changes{v3.4c}{2020/01/01}{Ugly workaround for usage in lists added}
7619 % \changes{v3.4d}{2020/01/01}{Ugly workaround for usage in lists revised}
7620 % \changes{v3.6}{2021/01/04}{Re-definition of \cs{addcontentsline} added}
7621 % To support the \pkg{listings} package we need to redefine
7622 % |\lst@Make|\-|Caption| so the original stuff is nested with
7623 % |\caption@begin| and |\caption@end| etc.\par
7624 % We set a flag inside the "Init" hook of the \pkg{listings} package (where adaption of |\line|\-|width| etc.~takes place).
7625 % \begin{macrocode}
7626 \caption@setbool{lst@Init}{0}%
7627 \lst@AddToHook{Init}{\caption@setbool{lst@Init}{1}}%
7628 % \end{macrocode}
7629 % \begin{macrocode}
7630 \let\caption@ORI@lst@MakeCaption\lst@MakeCaption
7631 \renewcommand*\lst@MakeCaption[1]{% #1 is `t' or `b'
7632 % \end{macrocode}
7633 % This macro is always called twice by the \pkg{listings} package (with `t' or `b' as parameter),
7634 % therefore we need an extra group here.
7635 % \begin{macrocode}
7636 \begingroup
7637 % \end{macrocode}
7638 % Inside lists the \pkg{listings} package ignores the left margin (|\@total|\-|left|\-|margin|) for captions.
7639 % We emulate this behaviour by adding a negative skip which will be typeset ahead of |\caption@box|.\par
7640 % Note: We only need to do this if the ``Init'' hook of the \pkg{listings} package wasn't called yet.
7641 % \begin{macrocode}
7642 \caption@iflst@Init{}{%
7643 \edef\caption@lst@leftskip{\noexpand\hskip-\the\@totalleftmargin\noexpand\relax}%
7644 \l@addto@macro\caption@beginhook\caption@lst@leftskip}%
7645 % \end{macrocode}
7646 % We set |position=#1| and if it was set to `top',
7647 % we swap the skips so the default behavior of the \pkg{listings} package
7648 % will not be changed. (Note that the \pkg{listings} package has set its
7649 % own |\abovecaptionskip| \& |\belowcaptionskip| values prior to calling
7650 % \cs{lst@MakeCaption}.)
7651 % \begin{macrocode}
7652 \caption@setposition{#1}%
7653 \caption@iftop{%
7654 \@tempdima\belowcaptionskip
7655 \belowcaptionskip\abovecaptionskip
7656 \abovecaptionskip\@tempdima}{}%
7657 % \end{macrocode}
7658 % Workaround for issue with wrong skips (FIXME: This should be examined further)
7659 % \begin{macrocode}
7660 \caption@setup{rule=0}%
7661 % \end{macrocode}
7662 % Afterwards we set the local `lstlisting' options.
7663 % \begin{macrocode}
7664 \caption@setoptions{lstlisting}%
7665 % \end{macrocode}
7666 % If the |position=| is now set to |auto|, we take over the |captionpos=|
7667 % setting from the \pkg{listings} package.
7668 % \begin{macrocode}
7669 \caption@setautoposition{#1}%
7670 % \end{macrocode}
7671 % \begin{macrocode}
7672 % We re-define |\addcontentsline| so our list format gets used for the lol entry etc.
7673 \ifx\lst@@caption\@empty \else
7674 \let\caption@ORI@addcontentsline\addcontentsline
7675 \renewcommand*\addcontentsline[3]{%
7676 \let\addcontentsline\caption@ORI@addcontentsline
7677 \caption@addcontentsline{lstlisting}{\lst@@caption}}%
7678 \fi
7679 % \end{macrocode}
7680 % At the end we do similar stuff as in our \cs{@caption} code.
7681 % \begin{macrocode}
7682 \caption@begin{lstlisting}%
7683 \caption@ORI@lst@MakeCaption{#1}%
7684 \caption@end
7685 % \end{macrocode}
7686 % \begin{macrocode}
7687 \endgroup}%
7688 % \end{macrocode}
7689 % \end{macro}
7690 %
7691 % \begin{macro}{\lst@makecaption}
7692 % \begin{macro}{\lst@maketitle}
7693 % Wrapper macros for typesetting the |caption=| or |title=| value.
7694 % \begin{macrocode}
7695 \def\lst@makecaption{\caption@starfalse\@makecaption}%
7696 \def\lst@maketitle{\caption@startrue\@makecaption\@empty}%
7697 % \end{macrocode}
7698 % \end{macro}
7699 % \end{macro}
7700 %
7701 % \begin{macro}{\ext@lstlisting}
7702 % \changes{v3.1}{2007/03/03}{This macro added}
7703 % Since the \pkg{listings} package do not define |\ext@lstlisting|
7704 % but we needed it when |\captionof{lstlisting}| will be done by the end user,
7705 % we define it here.
7706 % \begin{macrocode}
7707 \providecommand*\ext@lstlisting{lol}%
7708 % \end{macrocode}
7709 % \end{macro}
7710 %
7711 % \begin{macro}{\lst@@caption}
7712 % \changes{v3.1}{2007/03/03}{This macro added}
7713 % \changes{v3.1a}{2007/07/13}{Bugfix 07-09-13: \cs{lst@@caption} will not be re-defined anymore}
7714 % \changes{v3.2}{2010/10/26}{Bugfix 09-05-15: Setting of \cs{lst@@caption} added to \cs{caption@beginex}}
7715 % \changes{v3.5h}{2022/03/01}{Re-definition of \cs{lst@@caption} moved from \cs{caption@beginex} to \cs{caption@beginex@hook}}
7716 % We define |\lst@@caption| to non-|\@empty|, so |\fnum@lst|\-|listing| will
7717 % include a numbering.
7718 % \begin{macrocode}
7719 \l@addto@macro\caption@beginex@hook{\let\lst@@caption\relax}%
7720 % \end{macrocode}
7721 % \end{macro}
7722 %
7723 % \begin{macrocode}
7724 }{}
7725 % \end{macrocode}
7726 %
7727 % \subsubsection{The longtable package}
7728 %
7729 % \begin{macro}{\LTcaptype}
7730 % \changes{v3.1}{2007/07/06}{This macro and its support added}
7731 % |\LTcaptype| is preset to |table|.
7732 % \begin{macrocode}
7733 \providecommand*\LTcaptype{table}
7734 % \end{macrocode}
7735 % \end{macro}
7736 %
7737 % \begin{macro}{\caption@AtBeginLongtable}
7738 % \changes{v3.5}{2018/04/15}{This macro added}
7739 % \begin{macrocode}
7740 \providecommand*\caption@LT@array{}
7741 \newcommand\caption@AtBeginLongtable{%
7742 \g@addto@macro\caption@LT@array}
7743 % \end{macrocode}
7744 % \end{macro}
7745 %
7746 % \begin{macrocode}
7747 \caption@IfPackageLoaded{longtable}[1995/05/24 v3.14]{%
7748 % \end{macrocode}
7749 % \begin{macrocode}
7750 \RequirePackage{ltcaption}[2018/08/26]%
7751 \let\LT@@makecaption\@undefined
7752 % \end{macrocode}
7753 %
7754 % \begin{macro}{\LT@array}
7755 % \changes{v3.1}{2007/07/22}{This redefinition added}
7756 % \changes{v3.1a}{2007/09/16}{Bugfix: This redefinition will always be done \cs{AtBeginDocument}}
7757 % \changes{v3.1g}{2008/01/20}{Bugfix in \cs{captionlistentry}: Table counter will not be incremented anymore, \cs{nameref} works}
7758 % \changes{v3.3}{2016/01/31}{Support for \cs{bicaption} added}
7759 % \changes{v3.3}{2018/10/05}{Definition of \cs{captionlistentry} fixed}
7760 % \changes{v3.5}{2018/04/15}{Usage of \cs{caption@AtBeginLongtable} added}
7761 % \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
7762 % \changes{v3.6g}{2022/04/18}{Adapted to recent version of \pkg{caption3} package}
7763 % We redefine |\LT@array| here to get |\captionsetup|\marg{options} working inside |longtable|s.
7764 % \Note{Since the \pkg{hyperref} package patches \cs{LT@array} as well
7765 % and since this only works with the original definition of \cs{LT@array},
7766 % we have to do this after the \pkg{hyperref} package, i.e.~\cs{AtBeginDocument}.}
7767 % \begin{macrocode}
7768 \caption@AtBeginDocument{%
7769 \let\caption@ORI@LT@array\LT@array
7770 \renewcommand*\LT@array{%
7771 \caption@LT@array
7772 \caption@ORI@LT@array}}%
7773 % \end{macrocode}
7774 % \begin{macrocode}
7775 \caption@AtBeginLongtable{%
7776 % |\captionsetup| for longtable:
7777 % \begin{macrocode}
7778 \global\let\caption@opt@@longtable\@undefined
7779 \def\captionsetup{%
7780 \noalign\bgroup
7781 \@ifstar\@captionsetup\@captionsetup}% gobble *
7782 \def\@captionsetup#1{\LT@captionsetup{#1}\egroup}%
7783 \def\LT@captionsetup#1{%
7784 \caption@setup@options\@gobble[@longtable]{#1}%
7785 \global\let\caption@opt@@longtable\caption@opt@@longtable}%
7786 % \end{macrocode}
7787 % |\captionlistentry| for longtable:
7788 % \begin{macrocode}
7789 \def\captionlistentry{%
7790 \noalign\bgroup
7791 \@ifstar{\egroup\LT@listentry\LTcaptype}% gobble *
7792 {\egroup\LT@listentry\LTcaptype}}%
7793 % \end{macrocode}
7794 % |\continuedfloat| for longtable:\\
7795 % {\small(Commented out, since it's not deeply tested and quite useless anyway)}
7796 % \Note{\pkg{hyperref} versions $<$ v6.76j uses $2\times$ \cs{hyper@makecurrent}}
7797 % \begin{macrocode}
7798 % \caption@ifhypcap{%
7799 % \let\caption@ORI@hyper@makecurrent\hyper@makecurrent
7800 % \def\hyper@makecurrent##1{%
7801 % \let\hyper@makecurrent\caption@ORI@hyper@makecurrent
7802 % \caption@makestart{##1}%
7803 %% \let\Hy@LT@currentHlabel\@currentHlabel
7804 % \let\Hy@LT@currentHref\@currentHref
7805 % \def\hyper@makecurrent####1{%
7806 %% \let\@currentHlabel\Hy@LT@currentHlabel
7807 % \let\@currentHref\Hy@LT@currentHref}}%
7808 % \let\caption@ORI@continuedfloat\continuedfloat
7809 % \def\continuedfloat{\noalign{%
7810 % \gdef\caption@setContinuedFloat{%
7811 % \let\caption@reset@continuedfloat\@gobble}%
7812 % \def\caption@setoptions##1{%
7813 % \g@addto@macro\caption@setContinuedFloat{%
7814 % \caption@setoptions{##1}}}%
7815 % \let\@captype\LTcaptype
7816 % \caption@ORI@ContinuedFloat}}%
7817 % }{%
7818 % \def\continuedfloat{\noalign{%
7819 % \caption@Error{%
7820 % \noexpand\continuedfloat inside longtables\MessageBreak
7821 % is only available with `hypcap=true'}}}%
7822 % }%
7823 % \global\let\caption@setContinuedFloat\@empty
7824 \def\continuedfloat{\noalign{%
7825 \caption@OutsideFloat\continuedfloat}}%
7826 % \end{macrocode}
7827 % |\bicaption| for longtable:
7828 % \begin{macrocode}
7829 \let\bicaption\LT@bicaption
7830 % \end{macrocode}
7831 % \begin{macrocode}
7832 }%
7833 % \end{macrocode}
7834 % \end{macro}
7835 %
7836 % \begin{macro}{\LT@capti@n}
7837 % \changes{v3.3}{2016/02/01}{This re-definition added}
7838 % The original implementation:
7839 % \begin{verbatim}
7840 % \def\LT@capti@n{%
7841 % \@ifstar
7842 % {\egroup\LT@c@ption\@gobble[]}%
7843 % {\egroup\@xdblarg{\LT@c@ption\@firstofone}}}
7844 % \end{verbatim}%^^A
7845 % Our implementation uses |\caption@xdblarg| instead of |\@xdblarg|:
7846 % \begin{macrocode}
7847 \def\LT@capti@n{%
7848 \@ifstar
7849 {\egroup\LT@c@ption\@gobble[]}%
7850 {\egroup\caption@xdblarg{\LT@c@ption\@firstofone}}}%
7851 % \end{macrocode}
7852 % \end{macro}
7853 %
7854 % \begin{macro}{\LT@makecaption}
7855 % \changes{v3.0d}{2004/08/10}{Bugfix 04-08-04: \cs{abovecaptionskip} \& \cs{belowcaptionskip} will be used now}
7856 % \changes{v3.0e}{2005/05/05}{Bugfix: \cs{captionsetup[longtable]} overrides \cs{LTcapwidth} now}
7857 % \changes{v3.0h}{2005/10/07}{\cs{caption@LT@make} introduced}
7858 % \changes{v3.3}{2016/02/01}{Support for \cs{bicaption} via \cs{caption@LT@setup} added}
7859 % \changes{v3.3a}{2019/04/02}{Work-around for problem with \pkg{floatrow} added}
7860 % \changes{v3.6}{2021/01/09}{Adapted to current interface of \cs{caption@prepare@stepcounter}}
7861 % |\LT@makecaption|\marg{cmd}\marg{label}\marg{text}\par
7862 % \smallskip
7863 % The original definition:
7864 % \begin{verbatim}
7865 % \def\LT@makecaption#1#2#3{%
7866 % \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{%
7867 % % Based on article class "\@makecaption", "#1" is "\@gobble" in star
7868 % % form, and "\@firstofone" otherwise.
7869 % \sbox\@tempboxa{#1{#2: }#3}%
7870 % \ifdim\wd\@tempboxa>\hsize
7871 % #1{#2: }#3%
7872 % \else
7873 % \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
7874 % \fi
7875 % \endgraf\vskip\baselineskip}%
7876 % \hss}}}
7877 % \end{verbatim}%^^A
7878 % Our definition:
7879 % \begin{macrocode}
7880 \renewcommand\LT@makecaption[3]{%
7881 \caption@LT@make{%
7882 \caption@LT@settype\LTcaptype
7883 % \end{macrocode}
7884 % |\caption@LT@setup| is re-defined inside the \pkg{bicaption} package
7885 % and contains the preparation of typesetting of the bilingual caption.
7886 % \begin{macrocode}
7887 \caption@LT@setup
7888 % \end{macrocode}
7889 % \iffalse
7890 % The default |position=| setting for longtables is |top|.
7891 % (This emulates the standard behavior of the \pkg{longtable} package
7892 % which has no skip above the caption but a skip below it.)
7893 % \fi
7894 % |position=auto| is a bad idea for longtables, but we do our very best.
7895 % This works quite well for captions inside the longtable contents, but
7896 % not for captions inside the longtable (end)foot.
7897 % \Note{This should be `top' if unclear!}
7898 % \begin{macrocode}
7899 \caption@setautoposition{\ifcase\LT@rows t\else b\fi}%
7900 % \end{macrocode}
7901 % We set |\ifcaption@star| according the 1st argument.
7902 % \begin{macrocode}
7903 \caption@startrue#1\caption@starfalse
7904 % \end{macrocode}
7905 % \begin{macrocode}
7906 \caption@prepare@stepcounter\LTcaptype
7907 % \end{macrocode}
7908 % \changes{v3.1}{2007/05/05}{\cs{caption@font@normal} added}
7909 % \begin{macrocode}
7910 \caption@begin\LTcaptype
7911 \caption@normalsize
7912 % \end{macrocode}
7913 % The following skip has the purpose to correct the height of the
7914 % |\parbox[t]|. Usually it's the height of the very first line, but
7915 % because of our extra skips (|\abovecaptionskip| and |\belowcaptionskip|)
7916 % it's always |0pt|.\par
7917 % (A different idea would be typesetting the first skip outside the longtable
7918 % column with |\noalign{\vskip|\ldots|}|, but this means we have to move
7919 % |\caption@begin| to some other place because it does not work in tabular
7920 % mode. And at the moment I have no idea on how to do this in an elegant
7921 % way\ldots)
7922 % \begin{macrocode}
7923 \vskip-\ht\strutbox
7924 % \end{macrocode}
7925 % Work-around for problem with \pkg{floatrow}:
7926 % The |\below|\-|caption|\-|skip| disturbs the environment in which the caption is actually typeset (by creating extra, unwanted space),
7927 % so we supress this skip if the \pkg{floatrow} package is loaded.
7928 % (This fixes \issue{50})
7929 % \begin{macrocode}
7930 \caption@ifdefined\FBifcaptop{%
7931 \let\caption@belowskip\@empty}{}%
7932 % \end{macrocode}
7933 % The following code should look familiar. We do our skips and use
7934 % |\caption@@make| to typeset the caption itself.
7935 % \begin{macrocode}
7936 \caption@make@above
7937 \caption@@make{#2}{#3}\endgraf
7938 \caption@make@below
7939 \caption@end}}%
7940 % \end{macrocode}
7941 % \end{macro}
7942 %
7943 % \begin{macro}{\LT@listentry}
7944 % \changes{v3.3}{2018/08/26}{This macro added}
7945 % \changes{v3.3}{2018/10/05}{Bugfix: \cs{ignorespaces} added}
7946 % \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
7947 % \begin{macrocode}
7948 \renewcommand*\LT@listentry[2]{%
7949 \begingroup
7950 \caption@LT@settype{#1}%
7951 \caption@listentry\@firstoftwo[{#1}]{#2}%
7952 \endgroup\ignorespaces}%
7953 % \end{macrocode}
7954 % \end{macro}
7955 %
7956 % \begin{macro}{\caption@LT@settype}
7957 % \changes{v3.3}{2018/08/26}{This macro added}
7958 % \changes{v3.3}{2018/10/05}{Uses argument no. 1 instead of \cs{LTcaptype}}
7959 % \changes{v3.6}{2021/01/17}{Adapted to current implementation of \cs{caption@setwidth}}
7960 % \begin{macrocode}
7961 \newcommand*\caption@LT@settype[1]{%
7962 \caption@settype{#1}%
7963 % \end{macrocode}
7964 % If |\LTcapwidth| is not set to its default value |4in| we assume
7965 % that it shall overwrite our own setting.
7966 % (But |\captionsetup[longtable]{width=|\ldots|}| will overwrite |\LTcapwidth|.)
7967 % \begin{macrocode}
7968 \ifdim\LTcapwidth=4in \else
7969 \caption@setwidth\LTcapwidth
7970 \fi
7971 % \end{macrocode}
7972 % \begin{macrocode}
7973 \caption@setoptions{longtable}%
7974 % \caption@setContinuedFloat
7975 % \end{macrocode}
7976 % Finally set options applied by |\captionsetup| inside the longtable.
7977 % \begin{macrocode}
7978 \caption@setoptions{@longtable}}%
7979 % \end{macrocode}
7980 % \end{macro}
7981 %
7982 % \begin{macro}{\flrow@setlist}
7983 % \changes{v3.4g}{2020/01/03}{Redefinition of this macro added}
7984 % The \pkg{floatrow} package uses |\flrow@setlist{{table}{longtable}}| inside its redefinition of |\LT@array| without setting |\@captype| first,
7985 % and this makes |\captionsetup[table]{name=...}| doomed to fail for longtables (``Undefined control sequence'').
7986 % Unfortunately we cannot easily patch |\LT@array| again to fix this bug in \pkg{floatrow} since it will be patched |\AtBeginDocument|.
7987 % Therefore we patch |\flrow@setlist| instead to catch and fix the bug on-the-fly.
7988 % \begin{macrocode}
7989 \caption@AtBeginDocument{\caption@ifdefined\flrow@setlist@{%
7990 \caption@InfoNoLine{Fixing longtable code of `floatrow' package}%
7991 \let\caption@flrow@setlist@\flrow@setlist@
7992 \renewcommand\flrow@setlist@[1]{%
7993 \def\caption@tempa{{table}{longtable}}%
7994 \def\caption@tempb{#1}%
7995 \ifx\caption@tempa\caption@tempb
7996 \def\@captype{table}%
7997 \fi
7998 \caption@flrow@setlist@{#1}}%
7999 }{}}%
8000 % \end{macrocode}
8001 % \end{macro}
8002 %
8003 % \begin{macrocode}
8004 }{%
8005 \let\caption@AtBeginLongtable\@gobble
8006 \let\caption@LT@array\@undefined
8007 }
8008 % \end{macrocode}
8009 %
8010 % \begin{macro}{\caption@LT@setup}
8011 % \changes{v3.3}{2016/02/01}{This macro added}
8012 % Hook for stuff which prepares the typesetting of the \pkg{longtable} caption.
8013 % \begin{macrocode}
8014 \providecommand*\caption@LT@setup{}
8015 % \end{macrocode}
8016 % \end{macro}
8017 %
8018 % \subsubsection{The picinpar package}
8019 % \changes{v3.1}{2007/06/13}{Support of the \pkg{picinpar} package added}
8020 %
8021 % \begin{macrocode}
8022 \caption@IfPackageLoaded{picinpar}{%
8023 % \end{macrocode}
8024 %
8025 % \begin{macro}{\figwindow}
8026 % \begin{macro}{\tabwindow}
8027 % The \pkg{picinpar} package comes with its own caption code
8028 % (|\wincaption|, |\@wincaption|, |\@makewincaption|, \ldots)
8029 % so we redefine |\figwindow| \& |\tabwindow| to use |\caption| instead.
8030 % \begin{macrocode}
8031 \long\def\figwindow[#1,#2,#3,#4] {%
8032 \caption@window{figure}%
8033 \caption@setoptions{figwindow}%
8034 \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }%
8035 % \end{macrocode}
8036 % \begin{macrocode}
8037 \long\def\tabwindow[#1,#2,#3,#4] {%
8038 \caption@window{table}%
8039 \caption@setoptions{tabwindow}%
8040 \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }%
8041 % \end{macrocode}
8042 % \end{macro}
8043 % \end{macro}
8044 %
8045 % \begin{macro}{\caption@window}
8046 % \changes{v3.1c}{2007/10/06}{Bugfix: \cs{caption@clearmargin} added}
8047 % Beside calling |\caption@settype| we redefine |\caption@par|\-|box|\-|restore|
8048 % (as in \pkg{floatflt} \& \pkg{picins} package support)
8049 % and |\@makecaption| (as in \pkg{float} package support) here.
8050 % \begin{macrocode}
8051 \newcommand*\caption@window[1]{%
8052 \let\@makecaption\caption@@make
8053 \caption@setautoposition b%
8054 \caption@settype{#1}%
8055 \caption@clearmargin
8056 \caption@setanchor}%
8057 % \end{macrocode}
8058 % \end{macro}
8059 %
8060 % \begin{macro}{\caption@wincaption}
8061 % \changes{v3.1d}{2007/10/25}{Missing \% added}
8062 % \changes{v3.3}{2013/04/14}{\cs{caption@ContinuedFloattrue} added}
8063 % \changes{v3.3}{2018/10/06}{\cs{caption@ContinuedFloattrue} replaced by \cs{caption@setflag1}}
8064 % \changes{v3.6}{2020/12/28}{\cs{caption@setflag1} replaced by \cs{caption@clrflags}\cs{caption@setcontinued}}
8065 % This one finally typesets the caption using |\caption|.
8066 % \begin{macrocode}
8067 \newcommand\caption@wincaption[1]{%
8068 % \end{macrocode}
8069 % This will be done twice for every |figwindow| \& |tabwindow| caption --
8070 % on the first run |\picwd| is |0pt|, on the second run |\picwd| is |\hsize|.
8071 % \begin{macrocode}
8072 \ifdim\picwd=\z@
8073 \let\caption@makecurrent\@gobbletwo
8074 \let\caption@@start\relax
8075 \caption@prepareslc
8076 \else
8077 % don't increment the figure or table counter again
8078 \caption@clrflags
8079 \caption@setcontinued
8080 \fi
8081 % \end{macrocode}
8082 % The argument |#1| could contain simply the caption text
8083 % (e.g.~|A figure caption|), but it could also contain an optional argument,
8084 % the \meta{lst\_entry}
8085 % (e.g.~|[An| |entry| |to| |the| |LOF]||{A| |figure| |caption}|).
8086 % Therefore we have to test if |#1| begins with~|[| or not; furthermore we
8087 % support a starred variant -- as in |\caption*| -- so we test for~|*|, too.
8088 % \begin{macrocode}
8089 \edef\@tempa{\expandafter\noexpand\@car#1\@nil}%
8090 \if\@tempa*%
8091 \let\@tempa\@firstofone
8092 \else\if\@tempa[%]
8093 \let\@tempa\@firstofone
8094 \else
8095 \let\@tempa\@empty
8096 \fi\fi
8097 \expandafter\caption\@tempa{#1}}%
8098 % \end{macrocode}
8099 % \end{macro}
8100 %
8101 % \begin{macrocode}
8102 }{}
8103 % \end{macrocode}
8104 %
8105 % \subsubsection{The picins package}
8106 % \changes{v3.0j}{2006/01/26}{Support of the \pkg{picins} package added}
8107 %
8108 % \begin{macro}{\piccaptiontype}
8109 % |\piccaptiontype|\marg{type}\par
8110 % We offer this macro for changing the \meta{type} of the caption, so the user
8111 % doesn't have to redefine |\@captype|, as proposed in the \pkg{picins}
8112 % documentation.
8113 % \Note{We define this macro here so it can be used in the
8114 % preamble of the document, even when \thispackage\ was loaded prior to the
8115 % \pkg{picins} package.}
8116 % \begin{macrocode}
8117 \newcommand*\piccaptiontype[1]{\def\@piccaptype{#1}}
8118 % \end{macrocode}
8119 % \end{macro}
8120 %
8121 % \begin{macrocode}
8122 \caption@IfPackageLoaded{picins}{%
8123 % \end{macrocode}
8124 %
8125 % Initial set |\@piccaptype| and undefine |\@captype| which was set to
8126 % |figure| by the \pkg{picins} package.
8127 % \begin{macrocode}
8128 \caption@ifundefined\@piccaptype{%
8129 \caption@iftype{%
8130 \let\@piccaptype\@captype
8131 }{%
8132 \def\@piccaptype{figure}%
8133 }%
8134 }{}%
8135 \let\@captype\@undefined
8136 % \end{macrocode}
8137 %
8138 % \begin{macro}{\piccaption}
8139 % The original code:
8140 % \begin{verbatim}
8141 % \def\piccaption{\@ifnextchar [{\@piccaption}{\@piccaption[]}}
8142 % \end{verbatim}%^^A
8143 % Our code uses |\caption@star| so |\piccaption*| works,
8144 % and |\caption@dblarg| so |\piccaption{}| works correctly.
8145 % \begin{macrocode}
8146 \def\piccaption{\caption@star\relax{\caption@dblarg\@piccaption}}%
8147 % \end{macrocode}
8148 % \end{macro}
8149 %
8150 % \begin{macro}{\make@piccaption}
8151 % \changes{v3.1}{2007/12/06}{Bugfix: \cs{caption@clearmargin} will always be used now}
8152 % The original code:
8153 % \begin{verbatim}
8154 % \def\make@piccaption{%
8155 % [...]
8156 % \setbox\@TEXT=\vbox{\hsize\hsiz@\caption[\sh@rtf@rm]{\capti@nt@xt}}%
8157 % }
8158 % \end{verbatim}%^^A
8159 % In our code we have to correct several things:
8160 % \begin{enumerate}
8161 % \item |\@captype| must be defined, since we have removed the global
8162 % definition.
8163 % \item We use |\caption@setoptions{parpic}| so
8164 % |\captionsetup[parpic]{|\ldots|}| is supported.
8165 % \item |\linewidth| must be set correctly.
8166 % Usually this is done by |\@parbox|\-|restore| inside |\@caption|,
8167 % but since we use |\@caption@parbox|\-|restore| we have to map this to
8168 % |\@parbox|\-|restore| instead.
8169 % \item The two arguments of |\caption| (|\sh@rtf@rm| \& |\capti@nt@xt|)
8170 % should be expanded on first level so |\caption[]{|\ldots|}| and
8171 % |\caption[|\ldots|]{}| work correctly.
8172 % \end{enumerate}
8173 % \begin{macrocode}
8174 \let\caption@ORI@make@piccaption\make@piccaption
8175 \def\make@piccaption{%
8176 \let\caption@ORI\caption
8177 % \end{macrocode}
8178 % \begin{macrocode}
8179 \long\def\caption[##1]##2{%
8180 \caption@freezeHref % will be defrosted in \ivparpic
8181 \caption@settype\@piccaptype
8182 % \ifnum\c@piccaptionpos>2\relax
8183 \caption@clearmargin
8184 % \else
8185 % \caption@width\z@ % do not use "width=" setting
8186 % \fi
8187 \caption@setoptions{parpic}%
8188 \caption@setautoposition b%
8189 \caption@setanchor
8190 % \end{macrocode}
8191 % \begin{macrocode}
8192 \expandafter\expandafter\expandafter\caption@ORI
8193 \expandafter\expandafter\expandafter[%
8194 \expandafter\expandafter\expandafter{%
8195 \expandafter##1\expandafter}\expandafter]\expandafter{##2}}%
8196 % \end{macrocode}
8197 % {\footnotesize\begin{quote}
8198 % \leavevmode\llap{-or-\quad}%^^A
8199 % |\begingroup|\\
8200 % | \toks0\expandafter{##1}| |\toks2\expandafter{##2}|\\
8201 % | \edef\x{\endgroup|\\
8202 % | \noexpand\caption@ORI[{\the\toks0}]{\the\toks2}}|\\
8203 % | \x|
8204 % \end{quote}
8205 % \begin{quote}
8206 % \leavevmode\llap{-or-\quad}%^^A
8207 % |\edef\x{%|\\
8208 % | \noexpand\caption@ORI[{\unexpanded\expandafter{##1}}]%|\\
8209 % | {\unexpanded\expandafter{##2}}}|\\
8210 % |\-|
8211 % \end{quote}}
8212 % \begin{macrocode}
8213 \caption@ORI@make@piccaption
8214 \let\caption\caption@ORI}%
8215 % \end{macrocode}
8216 % \end{macro}
8217 %
8218
8219 % \begin{macro}{\ivparpic}
8220 % \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
8221 % We need to set our \pkg{hyperref} anchor here.
8222 % Not bullet-proof since we have to redefine |\noindent| here!
8223 % \begin{macrocode}
8224 \let\caption@ORI@ivparpic\ivparpic
8225 \def\ivparpic(#1,#2)(#3,#4)[#5][#6]#7{%
8226 \let\caption@ORI@noindent\noindent
8227 \def\noindent{%
8228 \caption@defrostHref
8229 \let\noindent\caption@ORI@noindent
8230 \noindent}%
8231 \caption@ORI@ivparpic(#1,#2)(#3,#4)[{#5}][{#6}]{#7}%
8232 \let\noindent\caption@ORI@noindent}%
8233 % \end{macrocode}
8234 % \end{macro}
8235 %
8236 % \begin{macrocode}
8237 }{%
8238 \let\piccaptiontype\@undefined
8239 }
8240 % \end{macrocode}
8241 %
8242 % \subsubsection{The rotating package}
8243 %
8244 % \begin{macrocode}
8245 \caption@IfPackageLoaded{rotating}[1995/08/22 v2.10]{%
8246 % \end{macrocode}
8247 %
8248 % \begin{macro}{\rotcaption}
8249 % \changes{v3.0c}{2004/07/16}{Bugfix: Check for \cs{caption@star} removed}
8250 % \changes{v3.0i}{2005/12/07}{Rewritten, works with \pkg{hyperref} now}
8251 % Make |\rotcaption*| work.
8252 % \begin{macrocode}
8253 \def\rotcaption{\let\@makecaption\@makerotcaption\caption}%
8254 % \let\@rotcaption\@undefined
8255 % \end{macrocode}
8256 % \end{macro}
8257 %
8258 % \begin{macro}{\rotcaptionof}
8259 % \changes{v3.0i}{2005/12/07}{New}
8260 % Make |\rotcaptionof(*)| work.
8261 % \begin{macrocode}
8262 \def\rotcaptionof{%
8263 \caption@teststar\caption@of{\rotcaption*}\rotcaption}%
8264 % \end{macrocode}
8265 % \end{macro}
8266 %
8267 % \begin{macro}{\@makerotcaption}
8268 % \changes{v3.0i}{2005/12/06}{Rewritten, should finally work proper now}
8269 % \changes{v3.0m}{2007/03/04}{Uses \cs{caption@parbox} instead of \cs{caption@start/endbox}}
8270 % \changes{v3.3}{2012/12/26}{Rewritten (again)}
8271 % \changes{v3.6}{2021/01/17}{Adapted to current implementation of \cs{caption@setmargin}}
8272 % Original (bugfixed) code:
8273 % \begin{verbatim}
8274 % \long\def\@makerotcaption#1#2{%
8275 % \setbox\@tempboxa\hbox{#1: #2}%
8276 % \ifdim \wd\@tempboxa > .8\vsize
8277 % \rotatebox{90}{%
8278 % \begin{minipage}{.8\textheight}#1: #2\end{minipage}%
8279 % }%\par % <== \par removed (AR)
8280 % \else%
8281 % \rotatebox{90}{\box\@tempboxa}%
8282 % \fi
8283 % \nobreak\hspace{12pt}% <== \nobreak added (AR)
8284 % }
8285 % \end{verbatim}%^^A
8286 % Our version emulates this behavior, but if |width=| is set,
8287 % the rotated caption is always typeset as |\parbox|.
8288 % (Note that |margin=| is not supported here.)
8289 % \begin{macrocode}
8290 \long\def\@makerotcaption#1#2{%
8291 \rotatebox{90}{%
8292 \ifdim\caption@width=\z@
8293 \caption@setwidth{.8\vsize}%
8294 \l@addto@macro\caption@singleline{%
8295 \caption@setup{parbox=none}}%
8296 \fi
8297 \let\caption@calcmargin\relax
8298 \caption@@make{#1}{#2}}%
8299 \nobreak\hspace{12pt}}%
8300 % \end{macrocode}
8301 % \end{macro}
8302 %
8303 % \begin{macrocode}
8304 }{}
8305 % \end{macrocode}
8306 %
8307 % \subsubsection{The scrextend package}
8308 % \changes{v3.6j}{2023/03/12}{Patch of the \pkg{scrextend} package added}
8309 %
8310 % \begin{macro}{\caption@IfKomaPackageLoaded}
8311 % \changes{v3.6j}{2023/03/12}{This macro definition added}
8312 % \changes{v3.6k}{2023/03/14}{Check for \cs{scr@caption} replaced by \cs{caption@ifdocumentclass}}
8313 % \begin{macrocode}
8314 \caption@ifdocumentclass{koma}%
8315 {\long\def\caption@IfKomaPackageLoaded#1[#2]#3#4{%
8316 \caption@InfoNoLine{KOMA-Script #1 package detected}%
8317 #3}}%
8318 {\let\caption@IfKomaPackageLoaded\caption@IfPackageLoaded}
8319 % \end{macrocode}
8320 % \end{macro}
8321 %
8322 % \begin{macrocode}
8323 \caption@IfKomaPackageLoaded{scrextend}[2002/07/01 v3.0]{%
8324 % \end{macrocode}
8325 %
8326 % \begin{macro}{\caption@patch@addmargin}
8327 % \changes{v3.6j}{2023/03/12}{This macro definition added}
8328 % Both environments, \env{addmargin} and \env{addmargin*}, are starting a \env{list} \cs{item}.
8329 % But \cs{hsize} isn't set properly inside a \env{list} item, and therefore \cs{@makecaption}
8330 % (offered by document classes) doesn't work properly when used inside \env{addmargin}.
8331 % Therefore we try to detect the situation ``Are we inside a \env{addmargin} environment?''
8332 % inside \cs{@makecaption} and fix this. (Sigh!)
8333 % \begin{macrocode}
8334 \let\caption@addmargin@env\@addmargin
8335 \renewcommand*\@addmargin{%
8336 \@testopt\caption@@addmargin\@tempa}%
8337 \def\caption@@addmargin[#1]#2{%
8338 \caption@addmargin@env[{#1}]{#2}%
8339 \caption@set@addmargin
8340 \ignorespaces}%
8341 % \end{macrocode}
8342 % \end{macro}
8343 %
8344 % \begin{macro}{\caption@set@addmargin}
8345 % \changes{v3.6j}{2023/03/12}{This macro definition added}
8346 % We cannot simply set and test a flag here since our adjustment to \cs{hsize} should
8347 % not be done within a \cs{parbox} within a \env{addmargin} environment for example,
8348 % and therefore we store \cs{hsize} and \cs{linewidth}, and test \cs{hsize} and \cs{linewidth}
8349 % against the stored values instead. If they are equal we are (hopefully) quite save
8350 % to assume that we are now inside a plain \env{addmargin} environment and therefore need
8351 % to fix \cs{hsize} before typesetting the caption. (Deep sigh!)
8352 % \begin{macrocode}
8353 \newdimen\caption@addmargin@hsize
8354 \newdimen\caption@addmargin@linewidth
8355 % \end{macrocode}
8356 % \begin{macrocode}
8357 \providecommand*\caption@set@addmargin{%
8358 \caption@addmargin@hsize\hsize
8359 \caption@addmargin@linewidth\linewidth
8360 \l@addto@macro\caption@beginex@hook\caption@test@addmargin}%
8361 % \end{macrocode}
8362 % \end{macro}
8363 %
8364 % \begin{macro}{\caption@test@addmargin}
8365 % \changes{v3.6j}{2023/03/12}{This macro definition added}
8366 % Test if the values of \cs{hsize} and \cs{linewidth} are identical to
8367 % the ones stored in the \env{addmargin} environment.
8368 % If yes, set \cs{hsize} to the correct value.
8369 % \begin{macrocode}
8370 \providecommand\caption@test@addmargin{%
8371 \ifdim\hsize=\caption@addmargin@hsize
8372 \ifdim\linewidth=\caption@addmargin@linewidth
8373 \hsize=\linewidth
8374 \fi
8375 \fi}%
8376 % \end{macrocode}
8377 % \end{macro}
8378 %
8379 % \begin{macrocode}
8380 }{}%
8381 % \end{macrocode}
8382 %
8383 % \subsubsection{The sidecap package}
8384 %
8385 % \begin{macrocode}
8386 \caption@IfPackageLoaded{sidecap}[2003/06/06 v1.6f]{%
8387 \caption@setbool{needfreeze}{1}%
8388 % \end{macrocode}
8389 %
8390 % \begin{macro}{\SC@zfloat}
8391 % \changes{v3.0b}{2004/05/16}{Local definition of \cs{captionsetup} added}
8392 % \changes{v3.0c}{2004/07/16}{Bugfix 04-07-15: Check for \cs{caption@star} removed}
8393 % \changes{v3.1c}{2007/10/06}{\cs{caption} will be saved \& restored now}
8394 % \changes{v3.2a}{2011/08/17}{Bugfix: Uses \cs{caption@freeze} instead of \cs{caption@freeze*} now}
8395 % \changes{v3.3}{2013/05/01}{Usage of \cs{caption@freeze} replaced by \cs{caption@freezetype}}
8396 % \changes{v3.6i}{2022/07/10}{\cs{ignorespaces} appended}
8397 % This macro will be called at the start of the environment, here is a good
8398 % opportunity to do some adaptations to |\caption| and |\captionsetup|.
8399 % \begin{macrocode}
8400 \let\caption@ORI@SC@zfloat\SC@zfloat
8401 \def\SC@zfloat#1#2#3[#4]{%
8402 % \end{macrocode}
8403 % First we use the original definition, but restore \cs{caption} and \cs{label}
8404 % so \cs{caption@freeze} and \cs{caption@warmup} will work correctly.
8405 % \begin{macrocode}
8406 \caption@ORI@SC@zfloat{#1}{#2}{#3}[#4]%
8407 \SC@RestoreCommands
8408 % \end{macrocode}
8409 % Since the sidecap package uses our |\caption| code outside the
8410 % environment the regular |\caption|\-|setup| will not work.
8411 % So we need a special version here which saves the given argument list
8412 % which will be executed later on.
8413 % Furthermore we need to make |\caption*| work.
8414 % \begin{macrocode}
8415 \caption@freezetype{#2}%
8416 % \end{macrocode}
8417 % The sidecap package uses |\ifx\label\SC@label| to test if it is just inside a
8418 % |SC|\-|figure| or not. So we redefine |\SC@label| here so this test will still work.
8419 % \begin{macrocode}
8420 \let\SC@label\label
8421 % \end{macrocode}
8422 % Since the original definition of |\SC@zfloat| ends with |\begin{lrbox}| which ends with |\ignore|\-|spaces|,
8423 % we do have to end our re-definition of |\SC@zfloat| with |\ignore|\-|spaces| as well.
8424 % \begin{macrocode}
8425 \ignorespaces}%
8426 % \end{macrocode}
8427 % \begin{macrocode}
8428 \providecommand*\SC@RestoreCommands{%
8429 \let\caption=\SC@orig@caption \let\label=\SC@orig@label}%
8430 % \end{macrocode}
8431 % \end{macro}
8432 %
8433 % \begin{macro}{\endSC@FLOAT}
8434 % \changes{v3.0i}{2006/01/12}{\cs{@listdepth}\cs{z@} added}
8435 % \changes{v3.1}{2007/05/05}{Call of \cs{caption@setoptions}\arg{SCfloat} added}
8436 % This macro will be called at the end of the environment, here we need to
8437 % setup our stuff before the \pkg{sidecap} package actually typesets
8438 % its caption.
8439 % \begin{macrocode}
8440 \let\caption@ORI@endSC@FLOAT\endSC@FLOAT
8441 \def\endSC@FLOAT{%
8442 % \end{macrocode}
8443 % Before we can typeset the caption we need to set the margin to zero
8444 % because any extra margin would only be disturbing here.\par
8445 % (We don't need to take care about the caption position because
8446 % the sidecap package set both |\abovecaptionskip| and |\belowcaptionskip|
8447 % to a skip of zero anyway.)\par
8448 % Furthermore |\SC@justify| will override the caption justification, if set.
8449 % The usage of |\SC@justify| differs from version to version of the
8450 % \pkg{sidecap} package:\par
8451 % \begin{tabular}{ll}
8452 % Version 1.4: & |\SC@justify| is not defined\\
8453 % Version 1.5: & |\SC@justify| is |\relax| when not set\\
8454 % Version 1.6: & |\SC@justify| is |\@empty| when not set\\
8455 % \end{tabular}
8456 % \begin{macrocode}
8457 \def\caption@setSC@justify{%
8458 \caption@clearmargin
8459 \ifx\SC@justify\@empty \else
8460 \let\caption@justification\SC@justify
8461 \let\SC@justify\@empty
8462 \fi}%
8463 % \end{macrocode}
8464 % Make the original definition of |\endSC@FLOAT| to use our caption
8465 % stuff instead of its own.
8466 % \Note{At this point the \pkg{sidecap} definition of \cs{caption} is valid,
8467 % not the regular one!}
8468 % \begin{macrocode}
8469 \let\caption\SC@orig@caption
8470 \def\SC@orig@caption[##1]##2{%
8471 \caption@setSC@justify
8472 %%% \caption@setoptions{SC}%
8473 \caption@setoptions{SC\@captype}%
8474 \caption@defrost}%
8475 % \end{macrocode}
8476 % Finally we call the original definition of |\endSC@FLOAT|.
8477 % \begin{macrocode}
8478 \caption@setSC@justify % for compatibility mode
8479 \caption@prepare@defrost
8480 \caption@ORI@endSC@FLOAT}%
8481 % \end{macrocode}
8482 % \end{macro}
8483 %
8484 % \begin{macrocode}
8485 }{}
8486 % \end{macrocode}
8487 %
8488 % \subsubsection{The subfigure package}
8489 % \changes{v3.1}{2007/04/06}{subfigure package support added}
8490 %
8491 % \begin{macrocode}
8492 \caption@IfPackageLoaded{subfigure}[2002/01/23 v2.1]{%
8493 % \end{macrocode}
8494 %
8495 % \begin{macro}{\sf@ifpositiontop}
8496 % \changes{v3.1a}{2007/09/15}{Bugfix 07-09-15: Check for \cs{@captype} added}
8497 % If the \pkg{subfigure} package is loaded, we map |\sf@ifpositiontop|
8498 % to |\iffiguretopcap| or |\iftabletopcap|, so the \pkg{subfigure}
8499 % \version{2.1} options \opt{figbotcap} etc. will still work.
8500 % \begin{macrocode}
8501 \def\sf@ifpositiontop{%
8502 \ifx\@captype\@undefined
8503 \expandafter\@gobbletwo
8504 \else\ifx\@captype\relax
8505 \expandafter\expandafter\expandafter\@gobbletwo
8506 \else
8507 \expandafter\expandafter\expandafter\sf@if@position@top
8508 \fi\fi}
8509 % \end{macrocode}
8510 % \begin{macrocode}
8511 \def\sf@if@position@top{%
8512 \@ifundefined{if\@captype topcap}%
8513 {\@gobbletwo}%
8514 {\@nameuse{if\@captype topcap}%
8515 \expandafter\@firstoftwo
8516 \else
8517 \expandafter\@secondoftwo
8518 \fi}}
8519 % \end{macrocode}
8520 % \end{macro}
8521 %
8522 % \begin{macrocode}
8523 }{}
8524 % \end{macrocode}
8525 %
8526 % \subsubsection{The supertabular and xtab packages}
8527 %
8528 % \begin{macrocode}
8529 \caption@IfPackageLoaded{supertabular}[2002/07/19 v4.1e]{%
8530 % \end{macrocode}
8531 %
8532 % \begin{macro}{\tablecaption}
8533 % \changes{v3.0e}{2005/05/05}{Made \cs{topcaption*} and \cs{bottomcaption*} work}
8534 % \changes{v3.1h}{2008/04/01}{Bugfix: Star variant does not increment table counter anymore}
8535 % Make |\topcaption*| and |\bottomcaption*| work.
8536 % \begin{macrocode}
8537 \renewcommand*\tablecaption{%
8538 \caption@star
8539 {\refstepcounter{table}}%
8540 {\caption@dblarg{\@xtablecaption}}}%
8541 % \end{macrocode}
8542 % \end{macro}
8543 %
8544 % \begin{macro}{\@xtablecaption}
8545 % \changes{v3.1h}{2008/04/01}{Made \cs{nameref} \& \cs{autoref} work}
8546 % \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
8547 % \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
8548 % Make |\nameref| and |\autoref| work.
8549 % \begin{macrocode}
8550 \let\caption@ORI@xtablecaption\@xtablecaption
8551 \long\def\@xtablecaption[#1]#2{%
8552 \caption@gettitle{#2}%
8553 \caption@ORI@xtablecaption[{#1}]{#2}}%
8554 % \end{macrocode}
8555 % \end{macro}
8556 %
8557 % \begin{macro}{\ST@caption}
8558 % \changes{v3.0a}{2004/01/23}{Bugfix: Missing \cs{par} added}
8559 % \changes{v3.1h}{2008/04/01}{Bugfix: \cs{@currentlabelname} will be set now}
8560 % The original code:
8561 % \begin{verbatim}
8562 % \long\def\ST@caption#1[#2]#3{\par%
8563 % \addcontentsline{\csname ext@#1\endcsname}{#1}%
8564 % {\protect\numberline{%
8565 % \csname the#1\endcsname}{\ignorespaces #2}}
8566 % \begingroup
8567 % \@parboxrestore
8568 % \normalsize
8569 % \if@topcaption \vskip -10\p@ \fi
8570 % \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
8571 % \if@topcaption \vskip 10\p@ \fi
8572 % \endgroup}
8573 % \end{verbatim}%^^A
8574 % \begin{macrocode}
8575 \long\def\ST@caption#1[#2]#3{\par%
8576 \caption@settype{#1}%
8577 \caption@setoptions{supertabular}%
8578 % \end{macrocode}
8579 % The |position=| setting will be overwritten by the
8580 % \pkg{supertabular} package: If |\topcaption| was used,
8581 % the position will be |top| automatically, |bottom| otherwise.
8582 % \begin{macrocode}
8583 \caption@setposition{\if@topcaption t\else b\fi}%
8584 % \end{macrocode}
8585 % \begin{macrocode}
8586 \caption@beginex{#1}{#2}{#3}%
8587 \caption@parboxrestore
8588 \caption@normalsize
8589 \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
8590 \caption@end}%
8591 % \end{macrocode}
8592 % \end{macro}
8593 %
8594 % \begin{macrocode}
8595 }{}
8596 % \end{macrocode}
8597 %
8598 % \changes{v3.1h}{2008/04/01}{Support of the xtab package added}
8599 % \begin{macrocode}
8600 \caption@IfPackageLoaded{xtab}[2000/04/09 v2.3]{%
8601 % \end{macrocode}
8602 %
8603 % \begin{macro}{\tablecaption}
8604 % Make |\topcaption*| and |\bottomcaption*| work.
8605 % \begin{macrocode}
8606 \renewcommand*\tablecaption{%
8607 \caption@star
8608 {\refstepcounter{table}}%
8609 {\caption@dblarg{\@xtablecaption}}}%
8610 % \end{macrocode}
8611 % \end{macro}
8612 %
8613 % \begin{macro}{\@xtablecaption}
8614 % \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
8615 % \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
8616 % Make |\nameref| and |\autoref| work.
8617 % \begin{macrocode}
8618 \let\caption@ORI@xtablecaption\@xtablecaption
8619 \long\def\@xtablecaption[#1]#2{%
8620 \caption@gettitle{#2}%
8621 \caption@ORI@xtablecaption[{#1}]{#2}}%
8622 % \end{macrocode}
8623 % \end{macro}
8624 %
8625 % \begin{macro}{\ST@caption}
8626 % The original code:
8627 % \begin{verbatim}
8628 % \long\def\ST@caption#1[#2]#3{\par%
8629 % \@initisotab
8630 % \addcontentsline{\csname ext@#1\endcsname}{#1}%
8631 % {\protect\numberline{%
8632 % \csname the#1\endcsname}{\ignorespaces #2}}%
8633 % \begingroup
8634 % \@parboxrestore
8635 % \normalsize
8636 % %% \if@topcaption \vskip -10\p@ \fi
8637 % \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
8638 % %% \if@topcaption \vskip 10\p@ \fi
8639 % \endgroup
8640 % \global\advance\ST@pageleft -\PWSTcapht
8641 % \ST@trace\tw@{Added caption. Space left for xtabular: \the\ST@pageleft}}
8642 % \end{verbatim}%^^A
8643 % \begin{macrocode}
8644 \long\def\ST@caption#1[#2]#3{\par%
8645 \caption@settype{#1}%
8646 \caption@setoptions{xtabular}%
8647 % \end{macrocode}
8648 % \begin{macrocode}
8649 \caption@set{position}{\if@topcaption t\else b\fi}%
8650 % \end{macrocode}
8651 % \begin{macrocode}
8652 \@initisotab
8653 \caption@beginex{#1}{#2}{#3}%
8654 \caption@parboxrestore
8655 \caption@normalsize
8656 \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
8657 \caption@end
8658 \global\advance\ST@pageleft -\PWSTcapht
8659 \ST@trace\tw@{Added caption. Space left for xtabular: \the\ST@pageleft}}%
8660 % \end{macrocode}
8661 % \end{macro}
8662 %
8663 % \begin{macrocode}
8664 }{}
8665 % \end{macrocode}
8666 %
8667 % \subsubsection{The threeparttable package}
8668 % \changes{v3.1}{2007/05/08}{Support of the \pkg{threeparttable} package added}
8669 %
8670 % \begin{macrocode}
8671 \caption@IfPackageLoaded{threeparttable}[2003/06/13 v3.0]{%
8672 % \end{macrocode}
8673 %
8674 % \begin{macro}{\threeparttable}
8675 % \changes{v3.3}{2016/01/31}{Bugfix: \cs{@captype} will be used if already defined}
8676 % \changes{v3.6e}{2022/04/17}{Main code outsourced to \cs{caption@setthreeparttable}}
8677 % Unfortunately |\@captype| is not set when |\TPT@common| will be used,
8678 % so we have to redefine |\threeparttable| and |\measuredfigure| instead.
8679 % \begin{macrocode}
8680 \let\caption@ORI@threeparttable\threeparttable
8681 \renewcommand*\threeparttable{%
8682 \caption@setthreeparttabletype{threepart}{table}%
8683 \caption@ORI@threeparttable}%
8684 % \end{macrocode}
8685 % \end{macro}
8686 %
8687 % \begin{macro}{\measuredfigure}
8688 % \changes{v3.3}{2016/01/31}{Bugfix: \cs{@captype} will be used if already defined}
8689 % \changes{v3.6e}{2022/04/17}{Main code outsourced to \cs{caption@setthreeparttable}}
8690 % Same here\ldots
8691 % \begin{macrocode}
8692 \let\caption@ORI@measuredfigure\measuredfigure
8693 \renewcommand*\measuredfigure{%
8694 \caption@setthreeparttabletype{measured}{figure}%
8695 \caption@ORI@measuredfigure}%
8696 % \end{macrocode}
8697 % \end{macro}
8698 %
8699 % \begin{macro}{\caption@setthreeparttabletype}
8700 % \changes{v3.6e}{2022/04/17}{Extracted from \cs{threeparttable} and \cs{measuredfigure}}
8701 % \changes{v3.6e}{2022/04/17}{Support for usage inside \env{subtable} or \env{subfigure} added}
8702 % |\caption@setthreeparttabletype|\marg{threepart type}\marg{main type}
8703 % \begin{macrocode}
8704 \newcommand*\caption@setthreeparttabletype[2]{%
8705 \caption@ifsubtype
8706 {\def\caption@threeparttabletype{#1sub#2}%
8707 \let\caption@setanchor\relax}%
8708 {\caption@settype{\@ifundefined{@captype}{#2}{\@captype}}%
8709 \def\caption@threeparttabletype{#1#2}}%
8710 %%% \caption@setposition{auto}% ?
8711 \caption@clearmargin
8712 \caption@setoptions\caption@threeparttabletype
8713 \caption@setanchor}%
8714 % \end{macrocode}
8715 % \end{macro}
8716 %
8717 % \begin{macro}{\TPT@caption}
8718 % The original code:
8719 % \begin{verbatim}
8720 % \def\TPT@caption#1[#2]#3{\gdef\TPT@docapt
8721 % {\par\global\let\TPT@docapt\@undefined \TPT@LA@caption{#1}[{#2}]%
8722 % {\strut\ignorespaces#3\ifhmode\unskip\@finalstrut\strutbox\fi}}%
8723 % \ifx\TPT@hsize\@empty \let\label\TPT@gatherlabel \abovecaptionskip\z@skip
8724 % \else \TPT@docapt \fi \ignorespaces}
8725 % \end{verbatim}%^^A
8726 % \begin{macrocode}
8727 \def\TPT@caption#1[#2]#3{%
8728 \gdef\TPT@docapt{%
8729 \global\let\TPT@docapt\@undefined
8730 \caption@setautoposition\caption@TPT@position
8731 \TPT@LA@caption{#1}[{#2}]{#3}}%
8732 \ifx\TPT@hsize\@empty
8733 \let\label\TPT@gatherlabel % Bug: does not work for measuredfigures
8734 \gdef\caption@TPT@position{t}%
8735 \g@addto@macro\TPT@docapt\caption@TPT@eatvskip
8736 \else
8737 \def\caption@TPT@position{b}%
8738 \TPT@docapt
8739 \fi
8740 \ignorespaces}%
8741 % \end{macrocode}
8742 % \begin{macrocode}
8743 %\newcommand*\caption@TPT@eatvskip{\vskip-.2\baselineskip}%
8744 \def\caption@TPT@eatvskip#1\vskip{#1\@tempdima=}%
8745 % \end{macrocode}
8746 % \end{macro}
8747 %
8748 % \begin{macrocode}
8749 }{}
8750 % \end{macrocode}
8751 %
8752 % \subsubsection{The wrapfig package}
8753 % \changes{v3.1}{2007/05/05}{Support of the \pkg{wrapfig} package added}
8754 % \changes{v3.2d}{2011/11/02}{Support of the \pkg{wrapfig} package rewritten}
8755 %
8756 % \begin{macrocode}
8757 \caption@IfPackageLoaded{wrapfig}[2003/01/31 v3.6]{%
8758 % \end{macrocode}
8759 %
8760 % \begin{macro}{\wrapfloat}
8761 % \changes{v3.2d}{2011/11/02}{Redefinition of this macro added}
8762 % \changes{v3.6}{2020/12/28}{Usage of \cs{@testopt} added}
8763 % First of all we make the \pkg{wrapfig} package independent from the package
8764 % load order regarding the \pkg{float} package.
8765 % Since the usage of |\@float@set|\-|every| is missing in the code of the \pkg{wrapfig}
8766 % package (it should be in the redefinition of |\float@re|\-|style|, right after
8767 % |\@nameuse{fst@#1}|), we don't use it here, too,
8768 % especially since |\wrap|\-|float| will usually not be used when used with re-styled floats.
8769 % \begin{macrocode}
8770 \renewcommand*\wrapfloat[1]{%
8771 \def\@captype{#1}%
8772 \@ifundefined{fst@#1}{}{%
8773 \@nameuse{fst@#1}%
8774 % \@float@setevery{#1}%
8775 \def\WF@floatstyhook{\let\@currbox\WF@box
8776 \global\setbox\WF@box\float@makebox{\wd\WF@box}}}%
8777 \@testopt\WF@wr{}}
8778 % \end{macrocode}
8779 % \end{macro}
8780 %
8781 % \begin{macro}{\WF@rapt}
8782 % \changes{v3.2d}{2011/11/02}{Usage of \cs{WF@captionstyhook} added}
8783 % Original code:
8784 % \begin{verbatim}
8785 % \def\WF@rapt[#1]#2{% final two args: #1 = overhang, #2 = width,
8786 % \gdef\WF@ovh{#1}% hold overhang for later, when \width is known
8787 % \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}%
8788 % \ifdim\hsize>\z@ \@parboxrestore \else
8789 % \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption
8790 % \ignorespaces \fi}
8791 % \end{verbatim}%^^A
8792 % Our code has |\WF@captionstyhook| in addition:
8793 % \begin{macrocode}
8794 \def\WF@rapt[#1]#2{% final two args: #1 = overhang, #2 = width,
8795 \gdef\WF@ovh{#1}% hold overhang for later, when \width is known
8796 \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}%
8797 \expandafter\WF@captionstyhook\expandafter{\@captype}% <= new
8798 \ifdim\hsize>\z@ \@parboxrestore \else
8799 \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption
8800 \ignorespaces \fi}%
8801 % \end{macrocode}
8802 % \end{macro}
8803 %
8804 % \begin{macro}{\WF@captionstyhook}
8805 % \changes{v3.2d}{2011/11/02}{This macro added}
8806 % \changes{v3.2e}{2011/11/10}{Bugfix 11-11-09: float package support fixed}
8807 % We place our \pkg{hyperref} anchor here, apply the `wrap' options etc.
8808 % Since the usage of |\@float@set|\-|every| is missing in the \pkg{wrapfig}
8809 % package we will catch it up here for making the necessary adaptions to the
8810 % \pkg{float} package.
8811 % \begin{macrocode}
8812 \def\WF@captionstyhook#1{%
8813 \let\@captype\@undefined
8814 \@ifundefined{fst@#1}{}{\@float@setevery{#1}}%
8815 \caption@settype{#1}%
8816 \caption@clearmargin
8817 %%% \caption@setoptions{wrap}%
8818 \caption@setoptions{wrap#1}%
8819 \caption@setanchor}%
8820 % \end{macrocode}
8821 % \end{macro}
8822 %
8823 % \begin{macrocode}
8824 }{}
8825 % \end{macrocode}
8826 %
8827 % \subsection{Debug stuff}
8828 %
8829 % \begin{macro}{\caption@checkcounter}
8830 % \changes{v3.6}{2020/12/28}{This macro added}
8831 % |\caption@checkref|\marg{counter}\marg{expected value}\\
8832 % checks if |\value|\marg{counter} would result in the \meta{expected value}.
8833 % \begin{macrocode}
8834 \newcommand*\caption@checkcounter[1]{%
8835 \caption@check{\the#1}{\@nameuse{the#1}}}
8836 % \end{macrocode}
8837 % \begin{macrocode}
8838 \newcommand*\caption@check[3]{%
8839 \edef\caption@tempa{#2}%
8840 \edef\caption@tempb{#3}%
8841 \ifx\caption@tempa\caption@tempb
8842 \caption@Info{\string#1 = \caption@tempa}%
8843 \else
8844 \caption@Error{\string#1 = \caption@tempa\space <> \caption@tempb}%
8845 \fi}
8846 % \end{macrocode}
8847 % \end{macro}
8848 %
8849 % \begin{macro}{\caption@checkref}
8850 % \changes{v3.6}{2020/12/28}{This macro added}
8851 % |\caption@checkref|\marg{marker}\marg{expected value}\\
8852 % checks if |\ref|\marg{marker} would result in the \meta{expected value}.
8853 % \begin{macrocode}
8854 \newcommand*\caption@checkref[2]{%
8855 \@ifundefined{r@#1}{}%
8856 {\expandafter\expandafter\expandafter
8857 \caption@@checkref\csname r@#1\endcsname\@nil{#1}{#2}}}
8858 % \end{macrocode}
8859 % \begin{macrocode}
8860 \def\caption@@checkref#1#2\@nil#3#4{%
8861 \caption@check{\ref{#3}}{#1}{#4}}
8862 % \end{macrocode}
8863 % \end{macro}
8864 %
8865 % \subsection{That's all Folks!}
8866 %
8867 % Execute the code declared with |\After|\-|Caption|\-|Package|.
8868 %
8869 % \begin{macrocode}
8870 \caption@endtitles@code
8871 \let\caption@endtitles@code\@undefined
8872 \let\AfterCaptionPackage\@firstofone
8873 % \end{macrocode}
8874 %
8875 % \iffalse
8876 %</package>
8877 % \fi
8878 %
8879 % \iffalse
8880 % --------------------------------------------------------------------------- %
8881 % \fi
8882 %
8883 % \clearpage
8884 % \Finale
8885 %
8886 \endinput
8887