Debian Codegraph @

texmf-dist/source/latex/caption/fallback/v3.4/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, caption2.dtx, caption3.dtx,
23 % bicaption.dtx, ltcaption.dtx, subcaption.dtx,
24 % the derived files
25 % caption.sty, caption2.sty, caption3.sty,
26 % bicaption.sty, ltcaption.sty, subcaption.sty,
27 % and the user manuals
28 % caption-deu.tex, caption-eng.tex, caption-rus.tex.
29 %
30 % \fi
31 % \CheckSum{2988}
32 %
33 % \iffalse
34 %<*driver>
35 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
36 \ProvidesFile{caption.drv}[2015/09/16 v3.4 Implementation of the caption package]
37 \hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
38 %\errorcontextlines=3
39 %
40 \documentclass{ltxdoc}
41 \setlength\parindent{0pt}
42 \setlength\parskip{\smallskipamount}
43 %
44 \makeatletter % make room for subsections like 2.16.14 in the TOC
45 %\newcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
46 \renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.7em}}
47 \makeatother
48 %
49 \usepackage{ifpdf}
50 \ifpdf
51 \usepackage{mathptmx,courier}
52 \usepackage[scaled=0.90]{helvet}
53 \addtolength\marginparwidth{15pt}
54 \fi
55 %
56 \usepackage{hypdoc}
57 \ifpdf\usepackage{hypdestopt}\fi
58 \hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}}
59 %
60 \usepackage[debug]{caption}[2013/01/01]
61 %
62 \DeclareRobustCommand*\eTeX{\texorpdfstring
63 {\leavevmode\hbox{$\varepsilon$}-\TeX}%
64 {e-TeX}}
65 \DeclareRobustCommand*\AmS{\texorpdfstring
66 {{\protect\usefont{OMS}{cmsy}{m}{n}A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}%
67 {AMS}}
68 \DeclareRobustCommand*\KOMAScript{\texorpdfstring
69 {\textsf{K\kern.05em O\kern.05em M\kern.05em A\kern.1em-\kern.1em Script}}%
70 {KOMA-Script}}
71 \DeclareRobustCommand*\NTG{NTG}
72 \DeclareRobustCommand*\SmF{SMF}
73 %
74 \begin{document}
75 \DocInput{caption.dtx}
76 \end{document}
77 %</driver>
78 % \fi
79 %
80 % \newcommand*\purerm[1]{\texorpdfstring{{\upshape\mdseries\rmfamily #1}}{#1}}
81 % \newcommand*\puresf[1]{\texorpdfstring{{\upshape\mdseries\sffamily #1}}{#1}}
82 % \newcommand*\purett[1]{\texorpdfstring{{\upshape\mdseries\ttfamily #1}}{#1}}
83 % \let\class\puresf \let\package\puresf
84 % \let\env\purett \let\opt\purett
85 %
86 % \def\thispackage{the \package{caption} package}
87 % \def\Thispackage{The \package{caption} package}
88 %
89 % \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
90 % \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
91 % \newcommand*\version[2][]{\textit{v#2}}
92 %
93 % \newcommand*\issue[1]{GitLab~\##1}
94 %
95 % \GetFileInfo{caption.sty}
96 %
97 % \title{The Implementation of
98 % \texorpdfstring{\thispackage\thanks{%^^A
99 % This package has version number \fileversion, last revised \filedate.}}%^^A
100 % {the caption package}}
101 % \author{Axel Sommerfeldt\\
102 % \url{https://gitlab.com/axelsommerfeldt/caption}}
103 % \date{\filedate}
104 % \maketitle
105 %
106 % \begin{abstract}
107 % \Thispackage\ consists of two parts -- the kernel
108 % (|caption3.sty|) and the main package (|caption.sty|).
109 %
110 % \Thispackage\ redefines the \LaTeX\ commands
111 % |\caption|, |\@caption|, and |\@makecaption| and maps the latter one to
112 % |\caption@@make|, giving the user the possibility to control the look \& feel
113 % of the captions from floating environments like |figure| and |table|.
114 % Furthermore it does similar to the caption stuff coming from other packages
115 % (like the \package{longtable} or \package{supertabular} package):
116 % Mapping the appropriate internal commands (like |\LT@makecaption| or
117 % |\ST@caption|) to the ones offered by the \package{caption3} kernel.
118 % So you can think of \thispackage\ as a layer package, it
119 % simply provides adaptation layers between the caption stuff coming from
120 % \LaTeXe\ or packages, and the caption stuff offered by the
121 % \package{caption3} kernel.
122 % \end{abstract}
123 %
124 % \section*{User manual}
125 %
126 % This document is describing the code implementation only.
127 % The user documentation can be found in
128 % \nopagebreak\begin{quote}
129 % \begin{tabular}{ll}
130 % \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-eng.pdf}%
131 % {\texttt{caption-eng.pdf}} & The English documentation \\
132 % \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-rus.pdf}%
133 % {\texttt{caption-rus.pdf}} & The Russian documentation\footnotemark \\
134 % \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-deu.pdf}%
135 % {\texttt{caption-deu.pdf}} & The German documentation \\
136 % \end{tabular}
137 % \footnotetext{Thanks a lot to Olga Lapko for this translation}
138 % \end{quote}
139 %
140 % \StopEventually{}
141 % \clearpage
142 % \tableofcontents
143 %
144 % \iffalse
145 % --------------------------------------------------------------------------- %
146 % \fi
147 %
148 % \DoNotIndex{\\,\_,\ ,\@@par}
149 % \DoNotIndex{\@bsphack}
150 % \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
151 % \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
152 % \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
153 % \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
154 % \DoNotIndex{\if@minipage,\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
155 % \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@minipagefalse,\@minipagetrue}
156 % \DoNotIndex{\@namedef,\@nameuse}
157 % \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
158 % \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setminipage,\@setpar}
159 % \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
160 % \DoNotIndex{\@testopt}
161 % \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
162 % \DoNotIndex{\p@,\z@}
163 % \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
164 % \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
165 % \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
166 % \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
167 % \DoNotIndex{\fi,\footnotesize,\global}
168 % \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
169 % \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
170 % \DoNotIndex{\ifx,\ignorespaces,\itshape}
171 % \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
172 % \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
173 % \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
174 % \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
175 % \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
176 % \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
177 % \DoNotIndex{\providecommand,\quad}
178 % \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
179 % \DoNotIndex{\rightskip,\rmfamily}
180 % \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
181 % \DoNotIndex{\small,\string,\space,\strut}
182 % \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
183 % \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
184 % \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
185 % \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
186 % \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
187 % \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
188 % \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
189 % \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
190 %
191 % \iffalse
192 % --------------------------------------------------------------------------- %
193 % \fi
194 %
195 % \setlength{\parskip}{0pt plus 1pt}
196 % \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
197 %
198 % \changes{v1.0}{1994/10/27}{First release}
199 % \changes{v1.1}{1994/11/03}{New option \texttt{centerlast}}
200 % \changes{v1.2}{1994/11/28}{Support of the \package{float} package}
201 % \changes{v1.3}{1995/01/09}{Support of \cs{captionlabelfont} in subcaptions}
202 % \changes{v1.4}{1995/01/30}{New option \texttt{nooneline}}
203 % \changes{v1.4b}{1995/04/05}{Bugfix release}
204 % \changes{v3.0}{2003/12/20}{Rewritten; many new commands and features}
205 % \changes{v3.0d}{2004/11/28}{Split into two packages: \package{caption} \& \package{caption3}}
206 %
207 % \iffalse
208 % --------------------------------------------------------------------------- %
209 % \fi
210 %
211 % \clearpage
212 %
213 % \iffalse
214 %<*package>
215 % \fi
216 %
217 % \section{Identification}
218 %
219 % \begin{macrocode}
220 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
221 \ProvidesPackage{caption}[2023/08/05 v3.4p Customizing captions (AR)]
222 % \end{macrocode}
223 %
224 % \section{Loading the kernel}
225 %
226 % \begin{macrocode}
227 \RequirePackage{caption3}[=2020/07/29] % needs v1.13 or newer
228 % \end{macrocode}
229 %
230 % \section{Check against unknown document classes}
231 %
232 % \begin{macrocode}
233 \caption@ifbool{documentclass}{}{%
234 \caption@WarningNoLine{%
235 Unknown document class (or package),\MessageBreak
236 standard defaults will be used}}
237 % \end{macrocode}
238 %
239 % \section{Check against incompatible packages}
240 %
241 % \changes{v3.0p}{2007/04/06}{Check against obsolete \package{caption2} package added}
242 % \begin{macrocode}
243 \@ifpackageloaded{caption2}{%
244 \caption@Error{%
245 You can't use both, the (obsolete) caption2 *and*\MessageBreak
246 the (current) caption package}%
247 \endinput
248 }{}
249 % \end{macrocode}
250 %
251 % \changes{v3.1}{2007/06/15}{Check against incompatible \package{ftcap} package added}
252 % \changes{v3.1}{2007/06/15}{Check against incompatible \package{nonfloat} package added}
253 % \changes{v3.1}{2007/06/18}{Check against incompatible \package{topcapt} package added}
254 % \begin{macrocode}
255 \caption@AtBeginDocument{%
256 \@ifpackageloaded{ftcap}{\caption@DisablePositionOption{ftcap}}{}%
257 \@ifpackageloaded{nonfloat}{\caption@DisablePositionOption{nonfloat}}{}%
258 \@ifpackageloaded{topcapt}{\caption@DisablePositionOption{topcapt}}{}}
259 % \end{macrocode}
260 % \begin{macro}{\caption@DisablePositionOption}
261 % \changes{v3.1g}{2008/03/20}{\texttt{position=b} added}
262 % \changes{v3.1h}{2008/03/29}{%
263 % Name changed from \cs{caption@IncompatiblePackage} to \cs{caption@DisablePositionOption};
264 % disables the `position' option now instead of issuing a warning}
265 % |\caption@DisablePositionOption|\marg{package}\par
266 % disables the `position' option.
267 % \begin{macrocode}
268 \newcommand*\caption@DisablePositionOption[1]{%
269 \caption@InfoNoLine{%
270 `#1' package detected; setting `position=b' for compatibility reasons}%
271 \caption@setposition b%
272 % \end{macrocode}
273 % \begin{macrocode}
274 \DeclareCaptionOption{position}{%
275 \caption@Error{Usage of the `position' option is incompatible\MessageBreak
276 to the `#1' package}}}
277 % \end{macrocode}
278 % \begin{macrocode}
279 \@onlypreamble\caption@DisablePositionOption
280 % \end{macrocode}
281 % \end{macro}
282 %
283 % \section{Declaration of options}
284 %
285 % \subsection{Miscellaneous options}
286 %
287 % \begin{macrocode}
288 \DeclareCaptionOption*{config}[caption]{%
289 \InputIfFileExists{#1.cfg}%
290 {\typeout{*** Local configuration file #1.cfg used ***}}%
291 {\caption@Warning{Configuration file #1.cfg not found}}}
292 % \end{macrocode}
293 %
294 % \begin{macro}{\caption@selectlistentry}
295 % \changes{v3.2}{2010/11/07}{This macro added}
296 % |\caption@selectlistentry|\marg{\purett{heading} or \purett{entry}}
297 % \begin{macrocode}
298 \newcommand*\caption@selectlistentry[1]{%
299 \caption@ifinlist{#1}{heading}{%
300 \let\caption@iflistheading\@firstoftwo
301 }{\caption@ifinlist{#1}{default,list-entry,entry}{%
302 \let\caption@iflistheading\@secondoftwo
303 }{%
304 \caption@Error{Undefined list-entry selection `#1'}%
305 }}}
306 % \end{macrocode}
307 % \end{macro}
308 %
309 % \changes{v3.3}{2012-03-25}{Option \opt{list-entry} added}
310 % \begin{macrocode}
311 \DeclareCaptionOption{list-entry}{\caption@selectlistentry{#1}}
312 \captionsetup{list-entry=default}
313 % \end{macrocode}
314 %
315 % \begin{macro}{\caption@setparboxrestore}
316 % \changes{v3.2}{2010/11/07}{This macro added}
317 % |\caption@setparboxrestore|\marg{\purett{partial} or \purett{full}}
318 % \begin{macrocode}
319 \newcommand*\caption@setparboxrestore[1]{%
320 \caption@ifinlist{#1}{full}{%
321 \caption@setfullparboxrestore
322 }{\caption@ifinlist{#1}{default,light,partial}{%
323 \let\caption@parboxrestore\@secondoftwo
324 }{%
325 \caption@Error{Undefined parboxrestore `#1'}%
326 }}}
327 % \end{macrocode}
328 % \end{macro}
329 %
330 % \begin{macro}{\caption@setfullparboxrestore}
331 % \changes{v3.2}{2010/11/07}{This macro added}
332 % |\caption@setfullparboxrestore|\par
333 % This is an abbreviation for |\caption@setparboxrestore{full}|.
334 % \begin{macrocode}
335 \newcommand*\caption@setfullparboxrestore{%
336 \let\caption@parboxrestore\@firstoftwo}
337 % \end{macrocode}
338 % \end{macro}
339 %
340 % \changes{v3.2}{2010/11/07}{Option \opt{parboxrestore} added}
341 % \begin{macrocode}
342 \DeclareCaptionOption{parboxrestore}{\caption@setparboxrestore{#1}}
343 \captionsetup{parboxrestore=default}
344 % \end{macrocode}
345 %
346 % \changes{v3.1f}{2007/11/28}{Option \opt{@minipage=} added}
347 % \begin{macrocode}
348 \DeclareCaptionOption{@minipage}{%
349 \caption@ifinlist{#1}{auto,default}%
350 {\let\caption@if@minipage\@gobbletwo}%
351 {\caption@set@bool\caption@if@minipage{#1}}}
352 \captionsetup{@minipage=default}
353 % \end{macrocode}
354 %
355 % \subsection{caption v1.x compatibility options}
356 % \changes{v3.1}{2007/07/21}{Option `compatibility' added}
357 % \changes{v3.1}{2007/09/01}{caption v1.x compatibility options revised}
358 % \changes{v3.1d}{2007/10/24}{Bugfix 07-10-24 in caption v1.x$ compatibility options}
359 %
360 % Currently we support |v1| and |v3| as values for the |compatibility=| option.
361 % But since this used to be a boolean option is the past we still support any boolean value
362 % for compatibility reasons.
363 %
364 % \begin{macrocode}
365 \DeclareCaptionOption{compatibility}[v1]{%
366 \caption@ifinlist{#1}{v1,1,true,yes,on}{%
367 \let\caption@ifcompatibility\@firstoftwo
368 }{\caption@ifinlist{#1}{v3,3,0,false,no,off}{%
369 \let\caption@ifcompatibility\@secondoftwo
370 }{%
371 \caption@Error{Undefined compatibility value `#1'}%
372 }}}
373 \@onlypreamble@key{caption}{compatibility}
374 % \end{macrocode}
375 % \begin{macrocode}
376 \caption@setbool{compatibility}{0} % default: Try not to be compatible to v1.x
377 % \end{macrocode}
378 %
379 % \begin{macro}{\caption@setincompatible}
380 % \changes{v3.4}{2019/09/09}{This macro added}
381 % |\caption@setincompatible|\marg{condition}\marg{message text}
382 % \begin{macrocode}
383 \newcommand*\caption@setincompatible[2]{%
384 #1{%
385 \caption@WarningNoLine{%
386 #2;\MessageBreak
387 Setting compatibility to v1}%
388 \caption@setbool{compatibility}{1}%
389 }{}}
390 % \end{macrocode}
391 % \end{macro}
392 %
393 % Check against incompatible packages which used to work fine with v1 of the `caption' package.
394 % \begin{macrocode}
395 \caption@AtBeginDocument{\caption@ifcompatibility{}{%
396 % \end{macrocode}
397 % The usage of the (now obsolete) \package{captcont} package,
398 % which brings its own definition of |\caption*|, was quite common in the old days.
399 % \begin{macrocode}
400 \caption@setincompatible{\@ifpackageloaded{captcont}}{captcont package is loaded}%
401 % \end{macrocode}
402 % To be continued\ldots
403 % \begin{macrocode}
404 }}
405 % \end{macrocode}
406 %
407 % \begin{macrocode}
408 \DeclareCaptionOptionNoValue*{normal}{%
409 \caption@setformat{plain}%
410 \caption@setjustification{justified}}
411 \DeclareCaptionOptionNoValue*{isu}{%
412 \caption@setformat{hang}%
413 \caption@setjustification{justified}}
414 \DeclareCaptionOptionNoValue*{hang}{%
415 \caption@setformat{hang}%
416 \caption@setjustification{justified}}
417 \DeclareCaptionOptionNoValue*{center}{%
418 \caption@setformat{plain}%
419 \caption@setjustification{centering}}
420 \DeclareCaptionOptionNoValue*{centerlast}{%
421 \caption@setformat{plain}%
422 \caption@setjustification{centerlast}}
423 % \end{macrocode}
424 %
425 % \begin{macrocode}
426 \DeclareCaptionOptionNoValue*{scriptsize}{\def\captionfont{\scriptsize}}
427 \DeclareCaptionOptionNoValue*{footnotesize}{\def\captionfont{\footnotesize}}
428 \DeclareCaptionOptionNoValue*{small}{\def\captionfont{\small}}
429 \DeclareCaptionOptionNoValue*{normalsize}{\def\captionfont{\normalsize}}
430 \DeclareCaptionOptionNoValue*{large}{\def\captionfont{\large}}
431 \DeclareCaptionOptionNoValue*{Large}{\def\captionfont{\Large}}
432 % \end{macrocode}
433 %
434 % \begin{macrocode}
435 \DeclareCaptionOptionNoValue*{up}{\l@addto@macro\captionlabelfont\upshape}
436 \DeclareCaptionOptionNoValue*{it}{\l@addto@macro\captionlabelfont\itshape}
437 \DeclareCaptionOptionNoValue*{sl}{\l@addto@macro\captionlabelfont\slshape}
438 \DeclareCaptionOptionNoValue*{sc}{\l@addto@macro\captionlabelfont\scshape}
439 \DeclareCaptionOptionNoValue*{md}{\l@addto@macro\captionlabelfont\mdseries}
440 \DeclareCaptionOptionNoValue*{bf}{\l@addto@macro\captionlabelfont\bfseries}
441 \DeclareCaptionOptionNoValue*{rm}{\l@addto@macro\captionlabelfont\rmfamily}
442 \DeclareCaptionOptionNoValue*{sf}{\l@addto@macro\captionlabelfont\sffamily}
443 \DeclareCaptionOptionNoValue*{tt}{\l@addto@macro\captionlabelfont\ttfamily}
444 % \end{macrocode}
445 %
446 % \begin{macrocode}
447 \DeclareCaptionOptionNoValue*{nooneline}{\caption@setbool{slc}{0}}
448 % \end{macrocode}
449 %
450 % \begin{macrocode}
451 \caption@setbool{ruled}{0}
452 \DeclareCaptionOptionNoValue*{ruled}{\caption@setbool{ruled}{1}}
453 % \end{macrocode}
454 %
455 % \subsection{caption2 v2.x compatibility options}
456 % \changes{v3.0h}{2005/07/08}{caption2 \version{2.x} compatibility options added}
457 % \changes{v3.1}{2007/09/01}{caption2 v2.x compatibility options revised}
458 % \changes{v3.1d}{2007/10/24}{Bugfix 07-10-24 in caption v2.x$ compatibility options}
459 %
460 % \begin{macrocode}
461 \DeclareCaptionOptionNoValue*{flushleft}{%
462 \caption@setformat{plain}%
463 \caption@setjustification{raggedright}}
464 \DeclareCaptionOptionNoValue*{flushright}{%
465 \caption@setformat{plain}%
466 \caption@setjustification{raggedleft}}
467 % \end{macrocode}
468 % \begin{macrocode}
469 \DeclareCaptionOptionNoValue*{oneline}{\caption@setbool{slc}{1}}
470 % \end{macrocode}
471 % \begin{macrocode}
472 \DeclareCaptionOptionNoValue*{ignoreLTcapwidth}{%
473 \caption@WarningNoLine{Obsolete option `ignoreLTcapwidth' ignored}}
474 % \end{macrocode}
475 %
476 % \subsection{Obsolete caption v3.0 options}
477 % \changes{v3.1}{2007/05/07}{Package option \opt{caption} marked as obsolete,
478 % gives error now}
479 %
480 % \begin{macrocode}
481 \DeclareCaptionOption*{caption}{%
482 \caption@setbool{temp}{#1}%
483 \caption@ifbool{temp}{}{%
484 \caption@Error{%
485 The package option `caption=#1' is obsolete.\MessageBreak
486 Please pass this option to the subfig package instead\MessageBreak
487 and do *not* load the caption package anymore}}}
488 % \end{macrocode}
489 %
490 % \subsection{fltpage package support options}
491 %
492 % \changes{v3.1}{2007/09/01}{Options `FPlist' \& `FPref' added}
493 % With these options is controlled where the list-of entry and |\ref| resp.
494 % |\pageref| or |\autoref| will link to.
495 % Defaults are |FPlist=caption| and |FPref=figure| which is inconsistent,
496 % but compatible to the usual behaviour of the \package{fltpage} package.
497 % \begin{macrocode}
498 \DeclareCaptionOption{FPlist}[1]{\caption@setFPoption{list}{#1}}
499 \DeclareCaptionOption{FPref}[1]{\caption@setFPoption{ref}{#1}}
500 \@onlypreamble@key{caption}{FPlist}
501 \@onlypreamble@key{caption}{FPref}
502 % \end{macrocode}
503 % \begin{macrocode}
504 \newcommand*\caption@setFPoption[2]{%
505 \edef\caption@tempa{\@car#2\@nil}%
506 \caption@setbool{FP#1cap}{\if c\caption@tempa 1\else 0\fi}}
507 \@onlypreamble\caption@setFPoption
508 % \end{macrocode}
509 % \begin{macrocode}
510 \captionsetup{FPlist=caption,FPref=figure}
511 % \end{macrocode}
512 %
513 % \subsection{hyperref package support options}
514 %
515 % \changes{v3.1}{2007/06/21}{Options `hypcap' \& `hypcapspace' added}
516 % With |hypcap=off| one can turn the \package{hypcap} support off
517 % (default is |on|).
518 % \begin{macrocode}
519 \DeclareCaptionOption{hypcap}[1]{\caption@setbool{hypcap}{#1}}
520 \DeclareCaptionOption{hypcapspace}{\def\caption@hypcapspace{#1}}
521 % \end{macrocode}
522 % \begin{macrocode}
523 \captionsetup{hypcap=1,hypcapspace=.5\baselineskip}
524 % \end{macrocode}
525 %
526 % \section{\AmS{} \& \SmF{} document classes support}
527 % \changes{v3.1}{2007/07/29}{\AmS\ \& \SmF\ document classes support added}
528 %
529 % \begin{macrocode}
530 \caption@ifclassloaded{ams}{%
531 \caption@InfoNoLine{AMS or SMF document class}%
532 % \end{macrocode}
533 % \begin{macrocode}
534 \setlength\belowcaptionskip{0pt}% set to 12pt by AMS class
535 % \end{macrocode}
536 % \begin{macrocode}
537 }{}
538 % \end{macrocode}
539 %
540 % \section{\KOMAScript{} document classes support}
541 % \changes{v3.0a}{2004/01/18}{Minimum adaptation to \KOMAScript\ added}
542 % \changes{v3.0h}{2005/08/22}{\KOMAScript\ compatibility options added}
543 % \changes{v3.0i}{2005/11/17}{\KOMAScript\ compatibility commands added}
544 % \changes{v3.0l}{2007/02/18}{\KOMAScript\ compatibility revised}
545 % \changes{v3.1}{2007/03/17}{\KOMAScript\ compatibility options removed}
546 % \changes{v3.1}{2007/04/05}{\KOMAScript\ compatibility revised \& enhanced}
547 %
548 % \begin{macrocode}
549 \caption@ifclassloaded{koma}{%
550 \caption@InfoNoLine{KOMA-Script document class}%
551 % \end{macrocode}
552 %
553 % Here we emulate the caption related commands and take over the caption
554 % related settings from the \KOMAScript\ classes.
555 %
556 % \begin{macro}{\@tablecaptionabovetrue}
557 % \begin{macro}{\@tablecaptionabovefalse}
558 % \changes{v3.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
559 % \begin{macrocode}
560 \g@addto@macro\@tablecaptionabovetrue{\captionsetup*[table]{position=t}}
561 \g@addto@macro\@tablecaptionabovefalse{\captionsetup*[table]{position=b}}
562 % \end{macrocode}
563 % \begin{macrocode}
564 \if@tablecaptionabove
565 \@tablecaptionabovetrue
566 \else
567 \@tablecaptionabovefalse
568 \fi
569 % \end{macrocode}
570 % \end{macro}
571 % \end{macro}
572 %
573 % \begin{macro}{\@figurecaptionabovetrue}
574 % \begin{macro}{\@figurecaptionabovefalse}
575 % \changes{v3.3}{2013/02/15}{Support of \cs{@figurecaptionabovetrue} added}
576 % \begin{macrocode}
577 \caption@ifdefined\@figurecaptionabovetrue{%
578 % \end{macrocode}
579 % \begin{macrocode}
580 \g@addto@macro\@figurecaptionabovetrue{\captionsetup*[figure]{position=t}}
581 \g@addto@macro\@figurecaptionabovefalse{\captionsetup*[figure]{position=b}}
582 % \end{macrocode}
583 % \begin{macrocode}
584 \if@figurecaptionabove
585 \@figurecaptionabovetrue
586 \else
587 \@figurecaptionabovefalse
588 \fi
589 % \end{macrocode}
590 % \begin{macrocode}
591 }{}%
592 % \end{macrocode}
593 % \end{macro}
594 % \end{macro}
595 %
596 % \begin{macro}{\onelinecaptionstrue}
597 % \begin{macro}{\onelinecaptionsfalse}
598 % \changes{v3.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
599 % \begin{macrocode}
600 \g@addto@macro\onelinecaptionstrue{\let\caption@ifslc\@firstoftwo}
601 \g@addto@macro\onelinecaptionsfalse{\let\caption@ifslc\@secondoftwo}
602 % \end{macrocode}
603 % \begin{macrocode}
604 \ifonelinecaptions
605 \onelinecaptionstrue
606 \else
607 \onelinecaptionsfalse
608 \fi
609 % \end{macrocode}
610 % \end{macro}
611 % \end{macro}
612 %
613 % \begin{macro}{\@captionabovetrue}
614 % \begin{macro}{\@captionabovefalse}
615 % \changes{v3.0j}{2006/03/21}{Bugfix 06-03-21:
616 % \cs{let}\cs{caption@setposition}\cs{@gobble} added}
617 % \changes{v3.0n}{2006/03/09}{Accidentally this got broken in \version{3.0m}, fixed}
618 % \changes{v3.1}{2007/03/31}{We redefine \cs{captionabovetrue/false} now
619 % instead of \cs{captionabove/below}}
620 % \changes{v3.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
621 % \changes{v3.1k}{2009/10/09}{\opt{figureposition} and \opt{tableposition} will issue a warning now}
622 % \changes{v3.4}{2019/09/11}{\opt{figureposition} and \opt{tableposition} will now set the position anyway since it could be used by other packages}
623 % Please note that these are stronger than the \opt{position} setting, therefore we
624 % override the options \opt{figureposition} and \opt{tableposition} to typeout a warning.
625 % \begin{macrocode}
626 \g@addto@macro\@captionabovetrue{\let\caption@position\@firstoftwo}
627 \g@addto@macro\@captionabovefalse{\let\caption@position\@secondoftwo}
628 % \end{macrocode}
629 % \begin{macrocode}
630 \DeclareCaptionOption{figureposition}{%
631 \caption@WarningNoLine{Option `figureposition=#1' has no effect\MessageBreak
632 when used with a KOMA script document class}%
633 \captionsetup*[figure]{position=#1}}
634 \DeclareCaptionOption{tableposition}{%
635 \caption@WarningNoLine{Option `tableposition=#1' has no effect\MessageBreak
636 when used with a KOMA script document class}%
637 \captionsetup*[table]{position=#1}}
638 % \end{macrocode}
639 % \end{macro}
640 % \end{macro}
641 %
642 % \begin{macro}{\setcapindent}
643 % \begin{macrocode}
644 \let\caption@KOMA@setcapindent\@setcapindent
645 \renewcommand*\@setcapindent[1]{%
646 \caption@KOMA@setcapindent{#1}\caption@setcapindent}
647 % \end{macrocode}
648 % \begin{macrocode}
649 \let\caption@KOMA@@setcapindent\@@setcapindent
650 \renewcommand*\@@setcapindent[1]{%
651 \caption@KOMA@@setcapindent{#1}\caption@setcapindent}
652 % \end{macrocode}
653 % \begin{macrocode}
654 \newcommand*\caption@setcapindent{%
655 \captionsetup{indent=\ifdim\cap@indent<\z@\z@\else\cap@indent\fi}}
656 % \end{macrocode}
657 % \end{macro}
658 %
659 % \begin{macrocode}
660 \caption@ifdefined\cap@indent{\caption@setcapindent}{}
661 % \end{macrocode}
662 %
663 % \begin{macro}{\setcapwidth}
664 % \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
665 % \Note{The optional argument of \cs{setcapwidth} if not supported (yet),
666 % so we issue a warning if used.
667 % (Since this does not seem to have an negative effect when used
668 % by the \texttt{captionbeside} environment, we suppress the warning here.)}
669 % \begin{macrocode}
670 \expandafter\let\expandafter\caption@KOMA@setcapwidth
671 \csname\string\setcapwidth\endcsname
672 \@namedef{\string\setcapwidth}[#1]#2{%
673 \caption@KOMA@setcapwidth[{#1}]{#2}\caption@setcapwidth{#1}}
674 % \end{macrocode}
675 % \begin{macrocode}
676 \newcommand*\caption@setcapwidth[1]{%
677 \ifx\\#1\\\else
678 \caption@ifdefined\cap@margin{%
679 \def\@tempa{captionbeside}%
680 \ifx\@tempa\@currenvir\else\caption@Warning{%
681 Ignoring optional argument [#1] of \string\setcapwidth\MessageBreak}%
682 \fi}{}%
683 \fi
684 \captionsetup{width=\cap@width}}
685 % \end{macrocode}
686 % \end{macro}
687 %
688 % \begin{macrocode}
689 \def\caption@tempa{\hsize}%
690 \ifx\caption@tempa\cap@width \else
691 \caption@setcapwidth{?}
692 \fi
693 % \end{macrocode}
694 %
695 % \begin{macro}{\setcapmargin}
696 % \begin{macrocode}
697 \expandafter\let\expandafter\caption@KOMA@setcapmargin
698 \csname\string\@setcapmargin\endcsname
699 \@namedef{\string\@setcapmargin}[#1]#2{%
700 \caption@KOMA@setcapmargin[{#1}]{#2}\caption@setcapmargin}
701 % \end{macrocode}
702 % \begin{macrocode}
703 \expandafter\let\expandafter\caption@KOMA@@setcapmargin
704 \csname\string\@@setcapmargin\endcsname
705 \@namedef{\string\@@setcapmargin}[#1]#2{%
706 \caption@KOMA@@setcapmargin[{#1}]{#2}\caption@setcapmargin}
707 % \end{macrocode}
708 % \begin{macrocode}
709 \newcommand*\caption@setcapmargin{%
710 \begingroup
711 \let\onelinecaptionsfalse\relax
712 \def\@twoside{0}%
713 \def\if@twoside{\def\@twoside{1}\iffalse}%
714 \cap@margin
715 \def\@tempa{\endgroup}%
716 \ifx\cap@left\hfill\else\ifx\cap@right\hfill\else
717 \def\hspace##1##{\@firstofone}%
718 \edef\@tempa{\endgroup
719 \noexpand\captionsetup{%
720 twoside=\@twoside,slc=0,%
721 margin={\cap@left,\cap@right}}}%
722 \fi\fi
723 \@tempa}
724 % \end{macrocode}
725 % \end{macro}
726 %
727 % \begin{macrocode}
728 \ifx\cap@margin\relax \else
729 \caption@setcapmargin
730 \fi
731 % \end{macrocode}
732 %
733 % \begin{macrocode}
734 }{}
735 % \end{macrocode}
736 %
737 % \section{Processing of options}
738 %
739 % \changes{v3.0m}{2007/03/04}{Verbose option added}
740 % \changes{v3.1}{2007/07/02}{Verbose option removed from package}
741 %
742 % \changes{v3.1}{2007/03/17}{We do not process global options anymore}
743 % \begin{macrocode}
744 \caption@SetupOptions{caption}{\caption@setkeys{#1}{#2}}
745 \caption@ProcessOptions*{caption}
746 % \end{macrocode}
747 %
748 % \section{\cs{caption}, \cs{@caption}, and \cs{@makecaption}}
749 %
750 % \begin{macro}{\caption@ifflag}
751 % \changes{v3.3}{2011/12/28}{This switch added}
752 % \changes{v3.3}{2018/08/08}{Rewritten (and renamed) so a counter is used instead of a switch}
753 % Since we support continued floats and sub-figures it's not an easy task
754 % to manage the figure (and table) counter. (Especially since previous versions
755 % of the caption package has proven that correcting a counter locally is not a good idea.)
756 %
757 % These three switches hold the
758 % current status: |\caption@if|\-|flag{2}| is set if the caption was already
759 % typeset (so the counter doesn't need to be incremented for sub-figures),
760 % |\caption@if|\-|flag{4}| is set if there is already content which have
761 % incremented the counter (so the counter doesn't need to be incremented
762 % for the main caption, further sub-figures, and other stuff), and
763 % |\caption@if|\-|flag{1}| is set if |\continued|\-|float| was given.
764 %
765 % In the past three boolean switches were used to store the flags, but since some
766 % packages (like the \package{floatrow} and \package{tabu} package) try hard to keep
767 % counter changes locally under certain circumstances, it seems a good idea to make
768 % these flags a counter value, too.
769 % \begin{macrocode}
770 \newcounter{caption@flags}
771 % \end{macrocode}
772 % \begin{macrocode}
773 \newcommand*\caption@ifflag[1]{%
774 \@tempcnta\c@caption@flags
775 \divide\@tempcnta #1\relax
776 \ifodd\@tempcnta
777 \expandafter\@firstoftwo
778 \else
779 \expandafter\@secondoftwo
780 \fi}
781 % \end{macrocode}
782 % \end{macro}
783 %
784 % \begin{macro}{\caption@clrflags}
785 % \changes{v3.3}{2018/08/08}{This macro added}
786 % \begin{macro}{\caption@clrflag}
787 % \changes{v3.3}{2013/04/14}{This macro added}
788 % \changes{v3.3}{2018/08/08}{Rewritten so a counter is used instead of a switch}
789 % \begin{macro}{\caption@setflag}
790 % \changes{v3.3}{2013/04/14}{This macro added}
791 % \changes{v3.3}{2018/08/08}{Rewritten so a counter is used instead of a switch}
792 % Furthermore we introduce the macros \cs{caption@clrflag} and \cs{caption@setflag}
793 % for clearing resp.~setting these flags.
794 % \begin{macrocode}
795 \newcommand*\caption@clrflags{%
796 \setcounter{caption@flags}\z@}
797 % \end{macrocode}
798 % \begin{macrocode}
799 \newcommand*\caption@clrflag[1]{%
800 \caption@ifflag{#1}{\caption@addtoflags{-#1}}{}}
801 \newcommand*\caption@setflag[1]{%
802 \caption@ifflag{#1}{}{\caption@addtoflags{#1}}}
803 \newcommand*\caption@addtoflags{%
804 \addtocounter{caption@flags}}
805 % \end{macrocode}
806 % \end{macro}
807 % \end{macro}
808 % \end{macro}
809 %
810 % \begin{macro}{\caption@caption}
811 % \changes{v3.0f}{2005/05/22}{Bugfix: \cs{ContinuedFloat} added}
812 % \changes{v3.0f}{2005/06/13}{Support of \cs{caption*[]} removed}
813 % \changes{v3.0l}{2007/01/19}{Minimal support of \textsf{combine} package added}
814 % \changes{v3.1}{2007/02/04}{Re-written, does not save\&use original definition anymore}
815 % Here comes our definition of |\caption| and |\caption*|.
816 % Beside the support of the starred variant this code was adapted to the
817 % various packages we support.
818 % We are using |\caption@dblarg| instead of |\@dblarg| so |\caption{}|
819 % (with an empty arg.) will produce a list-of entry, but |\caption[]{}|
820 % won't.
821 % \begin{macrocode}
822 \def\caption@caption{%
823 \caption@iftype
824 {\caption@checkgrouplevel\@empty\caption
825 \caption@star
826 {\caption@refstepcounter\@captype}%
827 {\caption@dblarg{\@caption\@captype}}}%
828 {\caption@Error{\noexpand\caption outside float}%
829 \caption@gobble}}
830 % \end{macrocode}
831 % \end{macro}
832 %
833 % \begin{macro}{\caption@star}
834 % \changes{v3.1}{2007/06/24}{Renamed from \cs{caption@caption} to \cs{caption@star}}
835 % \changes{v3.2c}{2011/08/21}{\cs{global} removed}
836 % A helper macro which processes the optional |*| after |\caption|.
837 % \begin{macrocode}
838 \newcommand*\caption@star[2]{%
839 \@ifstar{\caption@startrue#2[]}{#1#2}}
840 % \end{macrocode}
841 % \end{macro}
842 %
843 % \begin{macro}{\caption@@caption}
844 % \changes{v3.1}{2007/02/04}{Re-written, does not save\&use original definition anymore}
845 % \changes{v3.1f}{2007/11/28}{Bugfix: Handling of \texttt{@minipage} flag added}
846 % \changes{v3.1f}{2007/11/28}{Support of option \opt{@minipage} added}
847 % \changes{v3.1g}{2008/03/16}{Internal: Uses \cs{caption@prepareanchor} now}
848 % \changes{v3.2d}{2011/10/21}{Adapted to the \textsf{memoir} document class}
849 % \changes{v3.2f}{2012/01/14}{Usage of \cs{M@gettitle} moved to \cs{caption@prepareanchor}}
850 % \changes{v3.3}{2013/01/06}{Adapted to the \textsf{nag} package}
851 % As above, our version has been adapted to the packages we support.
852 % Additionally our code is nested by |\caption@beginex| \&
853 % |\caption@end| instead of |\begingroup| \& |\endgroup|.
854 % Furthermore we use |\caption@boxrestore| instead of |\@parboxrestore|
855 % so this code also works correctly inside list-based environments
856 % like |wide| \& |addmargin|. (This, and the fact that we use
857 % |\linewidth| instead of |\hsize| inside |\@makecaption|, solves
858 % \href{http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=latex/2472}%^^A
859 % {\LaTeX\ PR \texttt{latex/2472}}.)
860 % \begin{macrocode}
861 \long\def\caption@@caption#1[#2]#3{%
862 % \end{macrocode}
863 % \begin{macrocode}
864 \ifcaption@star \else
865 \caption@prepareanchor{#1}{#2}%
866 \memcaptioninfo{#1}{\csname the#1\endcsname}{#2}{#3}%
867 \@nameuse{nag@hascaptiontrue}%
868 \fi
869 % \end{macrocode}
870 % \begin{macrocode}
871 \par
872 \caption@beginex{#1}{#2}{#3}%
873 \caption@setfloatcapt{%
874 \caption@boxrestore
875 \if@minipage
876 \@setminipage
877 \fi
878 \caption@normalsize
879 \ifcaption@star
880 \let\caption@makeanchor\@firstofone
881 \fi
882 \@makecaption{\csname fnum@#1\endcsname}%
883 {\ignorespaces\caption@makeanchor{#3}}\par
884 \caption@if@minipage\@minipagetrue\@minipagefalse}%
885 \caption@end}
886 % \end{macrocode}
887 % \textsf{memoir} document class stuff:
888 % \begin{macrocode}
889 \providecommand\M@gettitle[1]{}
890 \providecommand\memcaptioninfo[4]{}
891 % \end{macrocode}
892 % \end{macro}
893 %
894 % \begin{macro}{\caption@prepareanchor}
895 % \changes{v3.1g}{2008/03/16}{This macro added}
896 % \changes{v3.2f}{2012/01/14}{Usage of \cs{M@gettitle} moved from \cs{caption@@caption}}
897 % \begin{macrocode}
898 \newcommand*\caption@prepareanchor[2]{%
899 \caption@makecurrent{#1}{#2}%
900 \caption@ifhypcap\caption@@start\relax
901 \M@gettitle{#2}}
902 % \end{macrocode}
903 % \end{macro}
904 %
905 % \begin{macro}{\caption@makecaption}
906 % \changes{v3.1i}{2008/05/06}{Usage of \cs{caption@rule} added}
907 % |\@makecaption|\marg{label}\marg{text}\par
908 % We do basically the same as the original code (from the standard
909 % \LaTeX\ document classes), but take care of the |position=| setting
910 % and use |\caption@@make| from the \package{caption} kernel to finally
911 % typeset the caption.
912 % \begin{macrocode}
913 \long\def\caption@makecaption#1#2{%
914 \caption@make@above
915 \caption@@make{#1}{#2}%
916 \caption@make@below}
917 % \end{macrocode}
918 % \end{macro}
919 %
920 % \begin{macro}{\caption@make@above}
921 % \begin{macro}{\caption@make@below}
922 % \changes{v3.3a}{2019/04/02}{This macro added}
923 % |\caption@make@above|\\
924 % |\caption@make@below|\par
925 % Typesets the stuff above resp.~below the caption, depending on |\caption@iftop|.
926 % \begin{macrocode}
927 \newcommand*\caption@make@above{%
928 \caption@iftop
929 \caption@belowskip
930 {\caption@rule\caption@aboveskip}}
931 % \end{macrocode}
932 % \begin{macrocode}
933 \newcommand*\caption@make@below{%
934 \caption@iftop
935 {\caption@aboveskip\caption@rule}%
936 \caption@belowskip}
937 % \end{macrocode}
938 % \end{macro}
939 % \end{macro}
940 %
941 % \begin{macro}{\caption@aboveskip}
942 % \begin{macro}{\caption@belowskip}
943 % \changes{v3.3a}{2019/04/02}{This macro added}
944 % |\caption@aboveskip|\\
945 % |\caption@belowskip|\par
946 % Typesets the skip above resp.~below the caption.
947 % \begin{macrocode}
948 \newcommand*\caption@aboveskip{%
949 \vskip\abovecaptionskip}
950 % \end{macrocode}
951 % \begin{macrocode}
952 \newcommand*\caption@belowskip{%
953 \vskip\belowcaptionskip}
954 % \end{macrocode}
955 % \end{macro}
956 % \end{macro}
957 %
958 % \begin{macro}{\caption@redefine}
959 % \changes{v3.1k}{2009/03/30}{This macro added, it contains the patching code now}
960 % Prior to \version{3.4} we only redefined |\caption| and |\@caption| if the current definitions
961 % were well known, so documents written in the old (\package{caption} package \version{1.x}) days
962 % (where |\caption| \& |\@caption| were not redefined by us) still compiled fine.
963 % This used to make sense when introducing \version{3.0} in the year 2003
964 % but is simply overcautious and especially unwanted by the user nowadays.
965 % So starting with \version{3.4} we only do not redefine |\caption| and |\@caption| if the
966 % `compatibility' option is set to `v1'.
967 % \begin{macrocode}
968 \newcommand*\caption@redefine{}
969 \g@addto@macro\caption@redefine{%
970 % \end{macrocode}
971 % \begin{macrocode}
972 \caption@ifcompatibility{%
973 % \end{macrocode}
974 % \begin{macrocode}
975 \caption@InfoNoLine{
976 \noexpand\caption will not be redefined since `compatibility' is set to v1}%
977 % \end{macrocode}
978 % \begin{macrocode}
979 \renewcommand*\caption@redefine{}%
980 % \end{macrocode}
981 %
982 % |\continuedfloat| is not supported in compatibility mode.
983 % \begin{macrocode}
984 \renewcommand*\caption@continuedfloat[1]{%
985 \caption@Error{Not available in compatibility mode}}%
986 % \end{macrocode}
987 %
988 % |\caption@start| is not supported in compatibility mode.
989 % \begin{macrocode}
990 \caption@AtBeginDocument*{%
991 \let\caption@start\relax
992 \caption@ifdefined\caption@ORI@capstart{%
993 \caption@Debug{%
994 Restore hypcap definition of \string\capstart\@gobble}%
995 \let\capstart\caption@ORI@capstart}{}%
996 }%
997 % \end{macrocode}
998 %
999 % \begin{macro}{\caption@star}
1000 % We redefine |\caption@star| here so it does not make any harm.
1001 % \begin{macrocode}
1002 \renewcommand*\caption@star[2]{#1#2}%
1003 % \end{macrocode}
1004 % \end{macro}
1005 %
1006 % \begin{macrocode}
1007 }{%
1008 % \end{macrocode}
1009 %
1010 % \begin{macro}{\caption}
1011 % \begin{macro}{\@caption}
1012 % \begin{macrocode}
1013 \renewcommand*\caption@redefine{%
1014 \let\caption\caption@caption
1015 \let\@caption\caption@@caption}%
1016 % \end{macrocode}
1017 % \end{macro}
1018 % \end{macro}
1019 %
1020 % \begin{macrocode}
1021 }%
1022 % \end{macrocode}
1023 % \begin{macrocode}
1024 \caption@redefine
1025 \caption@AtBeginDocument*{%
1026 \let\caption@ORI@capstart\@undefined}%
1027 % \end{macrocode}
1028 %
1029 % \begin{macro}{\@xfloat}
1030 % \changes{v3.1}{2007/05/09}{This re-definition added}
1031 % \changes{v3.1b}{2007/09/22}{Will now be redefined in compatibility mode, too}
1032 % We redefine |\@xfloat| so inside floating environments our
1033 % type-specific options will be used, a \package{hyperref}
1034 % anchor will be set etc.
1035 % \begin{macrocode}
1036 \let\caption@ORI@xfloat\@xfloat
1037 \def\@xfloat#1[#2]{%
1038 \caption@ORI@xfloat{#1}[#2]%
1039 \caption@settype{#1}}%
1040 % \end{macrocode}
1041 % \end{macro}
1042 %
1043 % \begin{macrocode}
1044 }
1045 % \end{macrocode}
1046 % \end{macro}
1047 %
1048 % Some packages (like the \package{hyperref} package for example) redefines
1049 % |\caption| and |\@caption|, too.
1050 % So we have to use |\AtBeginDocument| here, so we can make sure
1051 % our definition is the one which will be valid at last.
1052 % \begin{macrocode}
1053 \caption@AtBeginDocument{\caption@redefine}
1054 % \end{macrocode}
1055 %
1056 % \begin{macro}{\@makecaption}
1057 % \begin{macrocode}
1058 \let\@makecaption\caption@makecaption
1059 % \end{macrocode}
1060 % \end{macro}
1061 %
1062 % \begin{macro}{\phantomcaption}
1063 % \changes{v3.2}{2010/10/31}{Bugfix 10-09-01b: This macro added}
1064 % |\phantomcaption|\par
1065 % Use this one for figures with subcaptions but without main caption.
1066 % \begin{macrocode}
1067 \newcommand\phantomcaption{%
1068 \caption@iftype
1069 {\caption@refstepcounter\@captype}%
1070 {\caption@Error{\noexpand\phantomcaption outside float}}}%
1071 % \end{macrocode}
1072 % \end{macro}
1073 %
1074 % \section{\cs{captionof}}
1075 %
1076 % \changes{v3.0d}{2004/08/03}{Option \opt{type=} added}
1077 % \changes{v3.1}{2007/06/25}{Option \opt{type*=} added}
1078 % \changes{v3.1f}{2007/11/16}{Option \opt{subtype} \& \opt{subtype*} added}
1079 % \changes{v3.2}{2010/10/24}{Bugfix 10-10-17: Option \opt{type=} uses \cs{setcaptiontype} instead of \cs{caption@settype} now}
1080 %
1081 % \begin{macrocode}
1082 \caption@AtBeginDocument{%
1083 % \end{macrocode}
1084 % \begin{macrocode}
1085 \DeclareCaptionOption{type}{\setcaptiontype{#1}}%
1086 \DeclareCaptionOption{type*}{\setcaptiontype*{#1}}%
1087 % \end{macrocode}
1088 % \begin{macrocode}
1089 \DeclareCaptionOptionNoValue{subtype}{\setcaptionsubtype\relax}%
1090 \DeclareCaptionOptionNoValue{subtype*}{\setcaptionsubtype*}%
1091 % \end{macrocode}
1092 % \begin{macrocode}
1093 }
1094 % \end{macrocode}
1095 %
1096 % \emph{Important Note:}
1097 % Like |\captionof| the option |type=| should only be used inside a
1098 % group, box, or environment and does not check if the argument is a valid
1099 % floating environment or not.
1100 %
1101 % \begin{macro}{\setcaptiontype}
1102 % \changes{v3.2}{2010/10/24}{This macro added}
1103 % \changes{v3.4e}{2020/01/02}{Check added if the subtype is defined}
1104 % Like |\captionsetup{type=xxx}|, but also works if \cs{captionsetup} was redefined.
1105 % \begin{macrocode}
1106 \newcommand\setcaptiontype{%
1107 \caption@boxrestore@mini
1108 \caption@settype}
1109 % \end{macrocode}
1110 % \end{macro}
1111 %
1112 % \begin{macro}{\setcaptionsubtype}
1113 % \changes{v3.2a}{2011/08/15}{This macro added}
1114 % Same, but sets the sub-type.
1115 % \begin{macrocode}
1116 \newcommand\setcaptionsubtype{%
1117 \caption@iftype
1118 \caption@setsubtype
1119 {\caption@Error{\noexpand\setcaptionsubtype outside float}}}%
1120 % \end{macrocode}
1121 % \begin{macrocode}
1122 \newcommand\caption@setsubtype{%
1123 \@ifstar
1124 {\caption@@settype{sub}*{sub\@captype}}%
1125 {\caption@@settype{sub}{sub\@captype}}}%
1126 % \end{macrocode}
1127 % \end{macro}
1128 %
1129 % \begin{macro}{\caption@settype}
1130 % \changes{v3.1}{2007/05/09}{This macro added}
1131 % \changes{v3.1b}{2007/09/22}{Usage of \cs{caption@xlabel} added}
1132 % \changes{v3.1d}{2007/10/23}{Error message for \cs{caption@checkgrouplevel} revised}
1133 % \changes{v3.1f}{2007/11/16}{\cs{caption@setsubtype} added}
1134 % \changes{v3.1f}{2007/12/03}{Crappy \cs{caption@iftypewarning} replaced}
1135 % \changes{v3.1g}{2008/01/12}{Usage of \cs{ifcaptionsetup@star} added}
1136 % \changes{v3.2}{2010/10/26}{Error message moved from here to \cs{caption@refstepcounter}}
1137 % \changes{v3.3}{2011/12/28}{Resetting of \cs{ifcaption@caption} and \cs{ifcaption@subcaption} added}
1138 % \changes{v3.4e}{2020/01/02}{Checks added to prevent misuse regading subtypes}
1139 % |\caption@settype*|\marg{type}\par
1140 % sets |\@captype| and executes the options associated with it
1141 % (using |\caption@set|\-|options|).
1142 % Furthermore we check |\current|\-|group|\-|level| (if avail),
1143 % redefine |\@currentlabel| so a |\label| before |\caption| will result
1144 % in a hint instead of a wrong reference, and
1145 % use the macro |\caption@|(|sub|)|type|\-|hook| (which will be used by our
1146 % \package{float} package support).\par
1147 % The non-starred version sets a \package{hyperref} anchor additionally
1148 % (if |hypcap=|\-|true| and the \package{hypcap} package is not loaded).
1149 % \begin{macrocode}
1150 \newcommand*\caption@settype{%
1151 \caption@clrflags
1152 \caption@set@type}
1153 % \end{macrocode}
1154 % \begin{macrocode}
1155 \newcommand*\caption@set@type{%
1156 \caption@@settype{}}
1157 % \end{macrocode}
1158 % \begin{macrocode}
1159 \newcommand*\caption@@settype[1]{%
1160 \caption@teststar{\caption@@@settype{#1}}\@firstoftwo\@secondoftwo}
1161 % \end{macrocode}
1162 % \begin{macrocode}
1163 \newcommand*\caption@@@settype[3]{%
1164 % #1 = "" or "sub"
1165 % #2 = \@firstoftwo in star form, \@secondoftwo otherwise
1166 % #3 = <type>, e.g. "figure" or "subfigure"
1167 \caption@Debug{#1type=#3}%
1168 \@nameuse{caption@check#1type}{#3}%
1169 {\caption@checkgrouplevel{#1}{%
1170 \captionsetup{#1type#2*\@empty=...}#2{ or
1171 \@backslashchar#1captionof}{}}%
1172 % \end{macrocode}
1173 % \begin{macrocode}
1174 \edef\caption@tempa{#3}%
1175 \expandafter\ifx\csname @#1captype\endcsname\caption@tempa \else
1176 \ifcaptionsetup@star\else\@nameuse{caption@#1type@warning}\fi
1177 \fi
1178 \expandafter\let\csname @#1captype\endcsname\caption@tempa
1179 % \end{macrocode}
1180 % \begin{macrocode}
1181 \@nameuse{caption@#1typehook}%
1182 % \end{macrocode}
1183 % \begin{macrocode}
1184 \caption@setoptions{#3}%
1185 \ifx\caption@opt\relax
1186 \@nameundef{caption@#1type@warning}%
1187 \else
1188 \@namedef{caption@#1type@warning}{\caption@Warning{%
1189 The #1type was already set to
1190 `\csname @#1captype\endcsname'\MessageBreak}}%
1191 \fi
1192 % \end{macrocode}
1193 % \begin{macrocode}
1194 #2{}{%
1195 \let\@currentlabel\caption@undefinedlabel
1196 % \let\@currentHlabel\@undefined
1197 \ifx\caption@x@label\@undefined
1198 \let\caption@x@label\label
1199 \let\label\caption@xlabel
1200 \fi
1201 \caption@start}}}
1202 % \end{macrocode}
1203 % \end{macro}
1204 %
1205 % \begin{macro}{\caption@iftype}
1206 % \changes{v3.1}{2007/04/11}{This macro and its usage added}
1207 % Since we often need to check if |\@captype| is defined (means: we
1208 % are inside a floating environment) this helper macro was introduced.
1209 % \begin{macrocode}
1210 \newcommand*\caption@iftype{\caption@ifdefined\@captype}
1211 % \end{macrocode}
1212 % \end{macro}
1213 %
1214 % \begin{macro}{\caption@checktype}
1215 % \changes{v3.4g}{2020/01/02}{This macro and its usage added}
1216 % \changes{v3.4m}{2020/07/29}{Check of \cs{sf@counterlist} from \package{subfig} package added}
1217 % |\caption@checktype|\marg{type}\marg{code}\par
1218 % is used by |\caption@settype| and should either expand the code or issue an error
1219 % if the given type is not a proper type, i.e. it is a sub-type instead (either defined by
1220 % |\DeclareCaptionSubType| or |\newsubfloat|\cite{subfig}).
1221 % \begin{macrocode}
1222 \newcommand*\caption@checktype[1]{%
1223 \caption@ifsubtype{#1}\@firstoftwo{\caption@ifin@list\sf@counterlist{#1}}%
1224 {\caption@Error{Should not be used with subtype `#1'}%
1225 \@gobble}%
1226 \@firstofone}
1227 % \end{macrocode}
1228 % \end{macro}
1229 %
1230 % \begin{macro}{\caption@checksubtype}
1231 % \changes{v3.4g}{2020/01/02}{This macro and its usage added}
1232 % \changes{v3.4m}{2020/07/29}{Check of \cs{sf@counterlist} from \package{subfig} package added}
1233 % |\caption@checksubtype|\marg{type}\marg{code}\par
1234 % is used by |\caption@settype| and should either expand the code or issue an error
1235 % if the given type is not a proper sub-type, i.e. not defined by |\Declare|\-|Caption|\-|Sub|\-|Type|.
1236 % Since the |sub|\-|float|\-|row| environment offered by the \package{floatrow} package\cite{floatrow}
1237 % is using |\caption|\-|setup{sub|\-|type}| even if the sub-type was defined by |\new|\-|sub|\-|float|
1238 % offered by \package{subfig}\cite{subfig}, we take a more relaxed view of things here and allow
1239 % those sub-types as well (but not without warning since we do not support this).
1240 % \begin{macrocode}
1241 \newcommand*\caption@checksubtype[1]{%
1242 \caption@ifsubtype{#1}%
1243 \@firstofone
1244 {\caption@ifin@list\sf@counterlist{#1}%
1245 {\caption@Warning{%
1246 \noexpand\setcaptionsubtype without \string\DeclareCaptionSubType.\MessageBreak
1247 This is not designed to work; you could try replacing\MessageBreak
1248 the `subfig' package with `subcaption' to resolve\MessageBreak
1249 this problem which occurred}%
1250 \@firstofone}%
1251 {\caption@Error{Undefined subtype `#1'}%
1252 \@gobble}}}
1253 % \end{macrocode}
1254 % \end{macro}
1255 %
1256 % \begin{macro}{\caption@checkgrouplevel}
1257 % \changes{v3.1}{2007/07/15}{This macro and its usage added}
1258 % \changes{v3.1f}{2007/11/28}{Error changed to warning (compatibility)}
1259 % \changes{v3.3}{2013/04/21}{Uses \cs{caption@ifeTeX} now}
1260 % Checks if |\captionsetup{type=|\ldots|}| or |\caption| is done
1261 % inside a group or not -- in the latter case a warning message will
1262 % be issued. (needs \eTeX)
1263 % \begin{macrocode}
1264 \caption@ifeTeX{%
1265 \newcommand*\caption@checkgrouplevel[2]{%
1266 \@ifundefined{#1caption@grouplevel}{%
1267 \caption@ifundefined\caption@grouplevel{\let\caption@grouplevel\z@}{}%
1268 \ifnum\currentgrouplevel>\caption@grouplevel\relax
1269 \expandafter\edef\csname #1caption@grouplevel\endcsname{%
1270 \the\currentgrouplevel}%
1271 \else
1272 \caption@Warning{\string#2\MessageBreak outside box or environment}%
1273 \fi
1274 }{}}%
1275 }{%
1276 \let\caption@checkgrouplevel\@gobbletwo
1277 }
1278 % \end{macrocode}
1279 % \end{macro}
1280 %
1281 % \begin{macro}{\caption@undefinedlabel}
1282 % \changes{v3.1}{2007/07/03}{This macro and its usage added}
1283 % \changes{v3.1b}{2007/09/22}{Contents changed to \texttt{??}}
1284 % \changes{v3.1i}{2008/04/13}{Contents changed to \cs{caption@xref}(\ldots)}
1285 % \changes{v3.1k}{2009/03/30}{Bugfix 08-12-08: \cs{caption@xref} is robust now}
1286 % \changes{v3.2c}{2011/09/13}{Text changed from `before' to `without proper'}
1287 % \changes{v3.3}{2016/02/21}{Text changed from `without proper \cs{caption}' to `without proper reference'}
1288 % This label will be used for |\currentlabel| inside (floating) environments
1289 % as default. (see above)
1290 % \iffalse\Note{All commands used have to be robust here.}\fi
1291 % \begin{macrocode}
1292 \newcommand*\caption@undefinedlabel{%
1293 \protect\caption@xref{\caption@labelname}{\on@line}}
1294 % \end{macrocode}
1295 % \begin{macrocode}
1296 \DeclareRobustCommand*\caption@xref[2]{%
1297 \caption@WarningNoLine{\noexpand\label without proper reference#2}%
1298 \@setref\relax\@undefined{#1}}
1299 % \end{macrocode}
1300 % \begin{macrocode}
1301 \newcommand*\caption@labelname{??}
1302 % \end{macrocode}
1303 % \end{macro}
1304 % \begin{macro}{\caption@xlabel}
1305 % \changes{v3.1b}{2007/09/22}{This macro and its usage added}
1306 % \changes{v3.1f}{2007/11/11}{Revised}
1307 % \changes{v3.1i}{2008/04/13}{Bugfix: \cs{pageref} should always work now}
1308 % \changes{v3.2c}{2011/08/19}{Works with optional arguments now, too}
1309 % The new code of |\label| inside floating environments.
1310 % |\label| will be redefined using |\caption@withoptargs|, so
1311 % |#1| are the optional arguments (if any), and
1312 % |#2| is the mandatory argument here.
1313 % \begin{macrocode}
1314 \newcommand*\caption@xlabel{%
1315 \caption@withoptargs\caption@@xlabel}
1316 % \end{macrocode}
1317 % \begin{macrocode}
1318 \newcommand*\caption@@xlabel[2]{%
1319 \caption@@@xlabel
1320 \def\caption@labelname{#2}%
1321 \caption@x@label#1{#2}}
1322 % \end{macrocode}
1323 % \begin{macrocode}
1324 \newcommand*\caption@@@xlabel{%
1325 \global\let\caption@@@xlabel\@empty
1326 \@bsphack
1327 \protected@write\@auxout{}%
1328 {\string\providecommand*\string\caption@xref[2]{%
1329 \string\@setref\string\relax\string\@undefined{\string##1}}}%
1330 \@esphack}
1331 % \end{macrocode}
1332 % \end{macro}
1333 %
1334 % \begin{macro}{\captionof}
1335 % \changes{v3.1}{2007/05/09}{Uses \cs{caption@settype} instead of \cs{def}\cs{@captype}}
1336 % \changes{v3.1c}{2007/09/22}{Bugfix: Redefinition of \cs{caption@setfloatcapt} removed}
1337 % \changes{v3.1e}{2007/10/30}{Better compatibility: Will be defined with \cs{AtBeginDocument} now}
1338 % \changes{v3.2}{2010/10/24}{Bugfix 10-10-17: Uses \cs{setcaptiontype} instead of \cs{caption@settype} now}
1339 % |\captionof|\marg{type}\oarg{lst\_entry}\marg{heading}\\
1340 % |\captionof*|\oarg{lst\_entry}\marg{heading}\par
1341 % \Note{This will be defined with \cs{AtBeginDocument} so
1342 % \cs{usepackage}\csmarg{caption,capt-of} will still work.
1343 % (Compatibility to \version{1.x})}
1344 % \begin{macrocode}
1345 \caption@AtBeginDocument{%
1346 \def\captionof{\caption@teststar\caption@of{\caption*}\caption}}
1347 % \end{macrocode}
1348 % \begin{macrocode}
1349 \newcommand*\caption@of[2]{\setcaptiontype*{#2}#1}
1350 % \end{macrocode}
1351 % \end{macro}
1352 %
1353 % \section{\cs{captionlistentry}}
1354 %
1355 % \begin{macro}{\captionlistentry}
1356 % \changes{v3.1}{2007/07/28}{This macro added}
1357 % \changes{v3.1f}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
1358 % \changes{v3.1g}{2008/01/20}{Starred variant added}
1359 % \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
1360 % |\captionlistentry|\oarg{float type}\marg{list entry}\\
1361 % |\captionlistentry*|\oarg{float type}\marg{list entry}
1362 % \begin{macrocode}
1363 \newcommand*\captionlistentry{%
1364 \caption@teststar\@captionlistentry\@firstoftwo\@secondoftwo}
1365 % \end{macrocode}
1366 % \begin{macrocode}
1367 \newcommand*\@captionlistentry[1]{%
1368 \@testopt{\caption@listentry{#1}}\@captype}
1369 % \end{macrocode}
1370 % \begin{macrocode}
1371 \def\caption@listentry#1[#2]#3{%
1372 \@bsphack
1373 #1{\caption@gettitle{#3}}%
1374 {\caption@refstepcounter{#2}%
1375 \caption@makecurrent{#2}{#3}}%
1376 \caption@addcontentsline{#2}{#3}%
1377 \@esphack}
1378 % \end{macrocode}
1379 % \end{macro}
1380 %
1381 % \section{\cs{captionbox}}
1382 %
1383 % \begin{macro}{\captionbox}
1384 % \changes{v3.2}{2010/12/17}{This macro added}
1385 % \changes{v3.2a}{2011/08/16}{\cs{captionsetup} replaces with \cs{captionbox@settype} and \cs{caption@setposition}}
1386 % \changes{v3.3}{2012/04/09}{Adapted to revised version of \cs{caption@withoptargs}}
1387 % \changes{v3.3}{2017/03/19}{When used with fixed witdh the content will not be hboxed anymore}
1388 % \changes{v3.3c}{2019/09/01}{Adapted so it could be used by \cs{subfloat} offered by \package{subcaption}}
1389 % \changes{v3.4l}{2020/07/29}{\cs{captionbox@hj@default} renamed to \cs{captionbox@innerpos@default}}
1390 % A |\parbox| with contents and caption, separated by an invisible |\hrule|.
1391 % \begin{macrocode}
1392 \newcommand*\captionbox{%
1393 \caption@withoptargs{\caption@ibox\@gobble}}
1394 % \end{macrocode}
1395 % \begin{macrocode}
1396 \newcommand\caption@ibox[3]{%
1397 \kernel@ifnextchar[%]
1398 {\caption@iibox{#1}{#2}{#3}}%
1399 {\caption@iibox@{#1}{#2}{#3}}}
1400 % \end{macrocode}
1401 % \begin{macrocode}
1402 \long\def\caption@iibox#1#2#3[#4]{%
1403 \@testopt{\caption@iiibox{#1}{#2}{#3}[{#4}]}\captionbox@innerpos@default}
1404 % \end{macrocode}
1405 % \begin{macrocode}
1406 \long\def\caption@iibox@#1#2#3#4{%
1407 \setbox\@tempboxa\hbox{#4}%
1408 \caption@iiibox{#1}{#2}{#3}[\wd\@tempboxa][\captionbox@innerpos@default]{\unhbox\@tempboxa}}
1409 % \end{macrocode}
1410 % \begin{macrocode}
1411 \long\def\caption@iiibox#1{%
1412 \caption@iiiibox{#1}\vbox\vtop}
1413 % \end{macrocode}
1414 % \begin{macrocode}
1415 \long\def\caption@iiiibox#1#2#3#4#5[#6][#7]#8{%
1416 \begingroup
1417 #1*% set \caption@position
1418 \caption@iftop{%
1419 \endgroup
1420 \parbox[t]{#6}{%
1421 #1\relax
1422 \caption@setposition t%
1423 #2{\caption#4{#5}}%
1424 \captionbox@hrule
1425 \csname caption@hj@#7\endcsname
1426 #8}%
1427 }{%
1428 \endgroup
1429 \parbox[b]{#6}{%
1430 #1\relax
1431 \caption@setposition b%
1432 \csname caption@hj@#7\endcsname
1433 #8%
1434 \captionbox@hrule
1435 #3{\caption#4{#5}}}%
1436 }}
1437 % \end{macrocode}
1438 % \begin{macrocode}
1439 \newcommand*\captionbox@innerpos@default{c}
1440 \newcommand*\captionbox@hrule{\hrule\@height\z@\relax}
1441 % \end{macrocode}
1442 % \begin{macrocode}
1443 \providecommand*\caption@hj@c{\centering}
1444 \providecommand*\caption@hj@l{\raggedright}
1445 \providecommand*\caption@hj@r{\raggedleft}
1446 \providecommand*\caption@hj@s{}
1447 % \end{macrocode}
1448 % \end{macro}
1449 %
1450 % \section{\cs{continuedfloat}}
1451 %
1452 % \begin{macro}{\continuedfloat}
1453 % \changes{v3.0i}{2005/11/12}{Optional argument added}
1454 % \changes{v3.0g}{2005/06/28}{Bugfix: \cs{newcounter} replaced by \cs{newcount}}
1455 % \changes{v3.1}{2007/07/02}{Format of \package{hyperref} extension changed}
1456 % \changes{v3.1}{2007/07/07}{\cs{caption@setoptions} added}
1457 % \changes{v3.1g}{2008/01/29}{Starred variant added}
1458 % \changes{v3.2f}{2011/12/17}{Undocumented optional argument removed}
1459 % \changes{v3.3}{2011/12/28}{Uses \cs{ifcaption@ContinuedFloat} now}
1460 % \changes{v3.3}{2013/05/01}{Usage of \cs{caption@restorecounters} added}
1461 % \changes{v3.3}{2013/12/16}{Bugfix: Does not use \cs{caption@ContinuedFloat} anymore since this breaks \cs{ContinuedFloat} offered by the \package{subfig} package}
1462 % \changes{v3.4}{2015/09/16}{Renamed from \cs{ContinuedFloat} to \cs{continuedfloat}}
1463 % |\continuedfloat|\\
1464 % |\continuedfloat*|\par
1465 % This mainly sets the appropriate flag, increments the
1466 % continuation counter, and executes the given options.
1467 % Furthermore we set |\caption@reset|\-|continued|\-|float| to |\@gobble| so the
1468 % continuation counter will not be reset to zero inside |\caption@ref|\-|step|\-|counter|.\par
1469 % When the \package{hyperref} package is used we have the problem
1470 % that the usage of |\continued|\-|float| will create duplicate
1471 % hyper links -- |\@current|\-|Href| will be the same for the main float and
1472 % the continued ones. So we have to make sure unique labels and references
1473 % will be created each time. We do this by extending |\the|\-|H|\-|figure| and
1474 % |\the|\-|H|\-|table|, so for continued floats the scheme
1475 % \begin{quote}\meta{type}|.|\meta{type \#}|\alph{|\meta{continued \#}|}|\end{quote}
1476 % will be used instead of
1477 % \begin{quote}\meta{type}|.|\meta{type \#}\quad\quad.\end{quote}
1478 % \par{\small(This implementation follows an idea from Steven Douglas Cochran.)}
1479 % \Note{This does not help if the \package{hyperref} package option
1480 % \texttt{naturalnames=true} is set.}
1481 % \begin{macrocode}
1482 \def\continuedfloat{%
1483 \caption@iftype
1484 {\caption@continuedfloat\@captype}%
1485 {\caption@Error{\noexpand\continuedfloat outside float}}}
1486 % \end{macrocode}
1487 % \begin{macrocode}
1488 \newcommand*\caption@continuedfloat[1]{%
1489 \@ifstar
1490 {\caption@@refstepcounter\@captype
1491 \caption@@continuedfloat{#1}}%
1492 {\caption@continued@float{#1}}}
1493 % \end{macrocode}
1494 % \begin{macrocode}
1495 \newcommand*\caption@continued@float[1]{%
1496 \edef\caption@tempa{#1}%
1497 \ifx\caption@tempa\caption@CFtype
1498 \caption@restorecounters
1499 \caption@@continuedfloat{#1}%
1500 \else
1501 \caption@Error{Continued `#1' after `\caption@CFtype'}%
1502 \fi}
1503 % \end{macrocode}
1504 % \begin{macrocode}
1505 \newcommand*\caption@@continuedfloat{%
1506 \caption@setflag1% continued float
1507 \caption@@@continuedfloat}
1508 \newcommand*\caption@@@continuedfloat{%
1509 \stepcounter{continuedfloat}%
1510 \caption@@@@continuedfloat}
1511 % \end{macrocode}
1512 % \begin{macrocode}
1513 \newcommand*\caption@@@@continuedfloat[1]{%
1514 \caption@setoptions{ContinuedFloat}% for compatibility reasons
1515 \caption@setoptions{continuedfloat}%
1516 \caption@setoptions{continued#1}%
1517 \expandafter\l@addto@macro\csname the#1\endcsname\thecontinuedfloat
1518 \@ifundefined{theH#1}{}{%
1519 \expandafter\l@addto@macro\csname theH#1\endcsname{%
1520 \@alph\c@continuedfloat}}%
1521 \let\caption@@@@continuedfloat\@gobble}
1522 % \end{macrocode}
1523 % \begin{macrocode}
1524 \newcommand*\caption@CFtype{??}
1525 % \end{macrocode}
1526 % \end{macro}
1527 %
1528 % \begin{macro}{\thecontinuedfloat}
1529 % \changes{v3.4}{2015/09/16}{Renamed from \cs{theContinuedFloat} to \cs{thecontinuedfloat}}
1530 % This one is preset to \cs{@empty}, so usually the continuation counter is not
1531 % included in the caption label or references.
1532 % \begin{macrocode}
1533 \newcounter{continuedfloat}
1534 \let\c@ContinuedFloat\c@continuedfloat % defined for compatibility reasons
1535 \def\thecontinuedfloat{\theContinuedFloat}
1536 \let\theContinuedFloat\@empty % defined for compatibility reasons
1537 % \end{macrocode}
1538 % \end{macro}
1539 %
1540 % \begin{macro}{\caption@reset@continuedfloat}
1541 % \changes{v3.2f}{2011/12/17}{Redefinition of \cs{continuedfloat} added}
1542 % |\caption@reset@continuedfloat|\marg{type}\par
1543 % If a continuation counter is defined, we reset it.
1544 % (This one will be called inside |\@caption|.)
1545 % \begin{macrocode}
1546 \newcommand*\caption@reset@continuedfloat[1]{%
1547 \xdef\caption@CFtype{#1}%
1548 \@stpelt{continuedfloat}}
1549 % \end{macrocode}
1550 % \end{macro}
1551 %
1552 % \begin{macro}{\ContinuedFloat}
1553 % For compatibility reasons we still support |\Continued|\-|Float|.
1554 % \begin{macrocode}
1555 \def\ContinuedFloat{\continuedfloat} % defined for compatibility reasons
1556 % \end{macrocode}
1557 % \end{macro}
1558 %
1559 % \begin{macro}{\caption@ContinuedFloat}
1560 % \changes{v3.0f}{2005/06/11}{This macro added}
1561 % \changes{v3.3}{2013/12/16}{Bugfix: Revised and defined with \cs{def} instead of \cs{newcommand}}
1562 % |\caption@ContinuedFloat|\marg{type}\par
1563 % This one is used by \cs{ContinuedFloat} offered by the \package{subfig} package.
1564 % \begin{macrocode}
1565 \def\caption@ContinuedFloat{%
1566 \let\caption@reset@continuedfloat\@gobble
1567 \caption@@@continuedfloat}
1568 % \end{macrocode}
1569 % \end{macro}
1570 %
1571 % \begin{macro}{\donemaincaptionfalse}
1572 % Since the \class{memoir} document class resets the sub-caption
1573 % counter at |\@float|, right after |\done|\-|main|\-|caption|\-|false|,
1574 % we save all sub-caption counters at |\done|\-|main|\-|caption|\-|false|
1575 % so we can restore them using |\caption@restore|\-|counters|
1576 % inside |\continued|\-|float|.
1577 % \begin{macrocode}
1578 \caption@ifdefined\donemaincaptionfalse{%
1579 \g@addto@macro\donemaincaptionfalse\caption@savesubcounters}{}
1580 % \end{macrocode}
1581 % \end{macro}
1582 %
1583 % \section{Internal helpers}
1584 %
1585 % \begin{macro}{\caption@refstepcounter}
1586 % \changes{v3.1}{2007/07/28}{This macro added}
1587 % \changes{v3.2}{2010/10/26}{Error message moved from \cs{caption@@@settype} to here}
1588 % \changes{v3.2c}{2011/09/04}{Support of \cs{donemaincaptiontrue} from \textsf{memoir} document class added}
1589 % \changes{v3.3}{2011/12/28}{Usage of \cs{ifcaption@caption}, \cs{ifcaption@subcaption}, and \cs{ifcaption@ContinuedFloat} added}
1590 % Increments the float (i.e. |figure| or |table|) counter,
1591 % resets the continuation counter, and redefines itself to |\@gobble|.
1592 % \begin{macrocode}
1593 \newcommand*\caption@refstepcounter[1]{%
1594 \@ifundefined{c@#1}%
1595 {\caption@Error{No float type '#1' defined}}%
1596 {\caption@ref@stepcounter{#1}%
1597 % \end{macrocode}
1598 % Set flag if this part of the figure (or table) contains a caption now.
1599 % (If |\caption@if|\-|top| is not set, |\caption| is at the bottom of this part,
1600 % therefore ending this part, so we set the flag to |false| in this case.)
1601 % \begin{macrocode}
1602 \caption@fixposition
1603 \caption@iftop\caption@setflag\caption@clrflag2% caption
1604 % \end{macrocode}
1605 % This part does not contain content (like sub-figures) yet,
1606 % so we set |\if|\-|caption@sub|\-|caption| to |false|.
1607 % \begin{macrocode}
1608 \caption@clrflag4% subcaption
1609 % \end{macrocode}
1610 % Support of the \textsf{memoir} document class.
1611 % \begin{macrocode}
1612 \@nameuse{donemaincaptiontrue}}}
1613 % \end{macrocode}
1614 % \begin{macrocode}
1615 \newcommand*\caption@ref@stepcounter{%
1616 \caption@ifflag1{% continued float
1617 \let\caption@tempa\caption@@refcounter
1618 \caption@clrflag1% continued float
1619 }{%
1620 \let\caption@tempa\caption@@refstepcounter
1621 \caption@ifflag2{}{% caption
1622 \caption@ifflag4{% subcaption
1623 % Counter was already incremented by content, so we suppress \stepcounter{#1} here
1624 \let\caption@tempa\caption@@refcounter
1625 }{}%
1626 }%
1627 }%
1628 \caption@tempa}
1629 % \end{macrocode}
1630 % \begin{macrocode}
1631 \newcommand*\caption@@refcounter[1]{%
1632 \let\caption@stepcounter@ORI\stepcounter
1633 \def\stepcounter##1{%
1634 \edef\caption@tempa{#1}% Backport of commit 43567491e5b075d661c080bca298f5428f289758 from 2020/09/28: \def -> \edef
1635 \edef\caption@tempb{##1}% Backport of commit 43567491e5b075d661c080bca298f5428f289758 from 2020/09/28: \def -> \edef
1636 \ifx\caption@tempa\caption@tempb \else
1637 \caption@stepcounter@ORI{##1}%
1638 \fi}%
1639 \caption@@@refstepcounter{#1}%
1640 \let\stepcounter\caption@stepcounter@ORI}
1641 % \end{macrocode}
1642 % \begin{macrocode}
1643 \newcommand*\caption@@refstepcounter[1]{%
1644 \caption@prepare@stepcounter{#1}{ref}%
1645 \caption@@@refstepcounter{#1}}
1646 % \end{macrocode}
1647 % \begin{macrocode}
1648 \newcommand*\caption@@stepcounter[1]{%
1649 \caption@prepare@stepcounter{#1}{}%
1650 \caption@@@stepcounter{#1}}
1651 % \end{macrocode}
1652 % \begin{macrocode}
1653 \newcommand*\caption@prepare@stepcounter[2]{%
1654 \caption@addsubcontentslines{#2stepcounter}%
1655 \caption@reset@continuedfloat{#1}}
1656 % \end{macrocode}
1657 % \begin{macrocode}
1658 \newcommand*\caption@@@refstepcounter{\refstepcounter}
1659 % \end{macrocode}
1660 % \begin{macrocode}
1661 \newcommand*\caption@@@stepcounter{\stepcounter}
1662 % \end{macrocode}
1663 % \end{macro}
1664 %
1665 % \begin{macro}{\caption@dblarg}
1666 % \changes{v3.1}{2007/02/05}{This macro added}
1667 % \changes{v3.1f}{2007/12/06}{Bugfix 07-12-06: Changed so it works without \cs{kernel@ifnextchar}
1668 % (which was introduced in \LaTeXe\ 2004/01/23), too}
1669 % \changes{v3.3}{2012/03/25}{Support of option \opt{list-entry} added}
1670 % A |\relax| was added compared to |\@dblarg| so |\caption{}| will be
1671 % expanded to |\caption[\relax]{}| (and not to |\caption[]{}|).
1672 % Furthermore support for option \opt{list-entry} was added.
1673 % \begin{macrocode}
1674 \@ifundefined{kernel@ifnextchar}{\let\kernel@ifnextchar\@ifnextchar}{}
1675 % \end{macrocode}
1676 % \begin{macrocode}
1677 \newcommand\caption@dblarg[1]{%
1678 \kernel@ifnextchar[{\caption@ydblarg{#1}}{\caption@xdblarg{#1}}}
1679 % \end{macrocode}
1680 % \begin{macrocode}
1681 \newcommand\caption@xdblarg[2]{%
1682 #1[{#2\relax}]{#2}}
1683 % \end{macrocode}
1684 % \begin{macrocode}
1685 \long\def\caption@ydblarg#1[#2]#3{%
1686 \caption@iflistheading{#1[{#3}]{#3}}{#1[{#2}]{#3}}}
1687 % \end{macrocode}
1688 % \end{macro}
1689 %
1690 % \begin{macro}{\caption@begin}
1691 % \changes{v3.0a}{2004/01/23}{\cs{caption@settype} changed to \cs{caption@setfloattype}}
1692 % \changes{v3.0e}{2005/04/12}{Check for default label format added}
1693 % \changes{v3.0f}{2005/06/11}{Usage of \cs{caption@resetContinuedFloat} added}
1694 % \changes{v3.1}{2007/05/09}{Usage of \cs{caption@setfloattype} \& \cs{caption@resetContinuedFloat} removed}
1695 % \changes{v3.3}{2011/12/29}{Usage of \cs{caption@fixedposition} removed}
1696 % Our handling of |\caption| will always be surrounded by
1697 % |\caption@begin| (or |\caption@beginex|) and |\caption@end|.\par
1698 % |\caption@begin|\marg{type} performs these tasks:
1699 % \begin{enumerate}
1700 % \item[1.] Override the |position=| setting, if necessary.
1701 % (for example if set to |auto| or used inside a |supertabular|)
1702 % \item[2.] Start a new group.
1703 % \item[3.] Define |\fnum@|\meta{type} if the caption label format is set
1704 % to non-default.
1705 % \end{enumerate}
1706 % \begin{macrocode}
1707 \newcommand*\caption@begin[1]{%
1708 \caption@fixposition
1709 \begingroup
1710 \caption@setfnum{#1}}
1711 % \end{macrocode}
1712 % \end{macro}
1713 %
1714 % \begin{macro}{\caption@beginex}
1715 % \changes{v3.0b}{2004/05/16}{Support of \opt{listof=} added}
1716 % \changes{v3.0l}{2007/02/04}{Takes now 3 args instead of 2, check for empty heading added}
1717 % \changes{v3.1}{2007/07/01}{Makes lst-entry now instead of redefining \cs{addcontentsline}}
1718 % \changes{v3.2}{2010/10/26}{Bugfix 09-05-15: Setting of \cs{lst@@caption} added}
1719 % |\caption@beginex|\marg{type}\marg{list entry}\marg{heading}\par
1720 % performs the same tasks as |\caption@begin| and additionally:
1721 % \begin{enumerate}
1722 % \item[4.] Set |\lst@@caption|, so |\fnum@lstlisting| will include a numbering.
1723 % \item[5.] Make an entry in the list-of-whatever.
1724 % \item[6.] Set |\caption@ifempty| according argument \meta{heading}.
1725 % \end{enumerate}
1726 % \begin{macrocode}
1727 \newcommand\caption@beginex[3]{%
1728 \caption@begin{#1}%
1729 \let\lst@@caption\relax
1730 \caption@addcontentsline{#1}{#2}%
1731 \caption@ifempty{#3}{}}
1732 % \end{macrocode}
1733 % \end{macro}
1734 %
1735 % \begin{macro}{\caption@end}
1736 % \changes{v3.3}{2011/12/29}{Usage of \cs{caption@fixedposition} removed}
1737 % |\caption@end| closes the group.
1738 % \begin{macrocode}
1739 \newcommand*\caption@end{%
1740 \endgroup}
1741 % \end{macrocode}
1742 % \end{macro}
1743 %
1744 % \changes{v3.0a}{2004/01/23}{%
1745 % Internal hooks \cs{caption@@begin} \& \cs{caption@@end} added}
1746 % \changes{v3.0h}{2005/10/06}{%
1747 % Internal hooks \cs{caption@@begin} \& \cs{caption@@end} removed}
1748 %
1749 % \begin{macro}{\caption@setfnum}
1750 % \changes{v3.1}{2007/03/10}{This macro added}
1751 % |\caption@setfnum|\marg{type}\\
1752 % redefines |\fnum@|\meta{type} according the caption label format
1753 % set with |labelformat=|. But if |labelformat=default| is set,
1754 % |\fnum@|\meta{type} will not be overwritten by us.
1755 % \begin{macrocode}
1756 \newcommand*\caption@setfnum[1]{%
1757 \@ifundefined{fnum@#1}{\iftrue}{\ifx\caption@lfmt\caption@lfmt@default\else}%
1758 \@namedef{fnum@#1}{\caption@fnum{#1}}%
1759 \fi}
1760 % \end{macrocode}
1761 % \end{macro}
1762 %
1763 % \begin{macro}{\caption@boxrestore}
1764 % \changes{v3.1}{2007/03/03}{This macro and its usage added}
1765 % \changes{v3.1b}{2007/09/17}{Bugfix: Redefinition of CR added}
1766 % \changes{v3.2}{2010/11/07}{Support of option \opt{parboxrestore} added}
1767 % The original code (from |latex/base/ltboxes.dtx|):
1768 % \begin{verbatim}
1769 % \def\@parboxrestore{\@arrayparboxrestore\let\\\@normalcr}
1770 % \def\@arrayparboxrestore{%
1771 % \let\if@nobreak\iffalse
1772 % \let\if@noskipsec\iffalse
1773 % \let\par\@@par
1774 % \let\-\@dischyph
1775 % \let\'\@acci\let\`\@accii\let\=\@acciii
1776 % \parindent\z@ \parskip\z@skip
1777 % \everypar{}%
1778 % \linewidth\hsize
1779 % \@totalleftmargin\z@
1780 % \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
1781 % \parfillskip\@flushglue \lineskip\normallineskip
1782 % \baselineskip\normalbaselineskip
1783 % \sloppy}
1784 % \end{verbatim}%^^A
1785 % This one will be used by |\@caption| instead of |\@parboxrestore|.
1786 % \begin{macrocode}
1787 \newcommand*\caption@boxrestore{%
1788 \caption@parboxrestore{\@parboxrestore}{%
1789 \let\if@nobreak\iffalse
1790 \let\if@noskipsec\iffalse
1791 \let\par\@@par
1792 % \let\-\@dischyph
1793 % \let\'\@acci\let\`\@accii\let\=\@acciii
1794 \parindent\z@ \parskip\z@skip
1795 \everypar{}%
1796 % \linewidth\hsize
1797 % \@totalleftmargin\z@
1798 \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
1799 \parfillskip\@flushglue \lineskip\normallineskip
1800 \baselineskip\normalbaselineskip
1801 \sloppy
1802 \let\\\@normalcr
1803 }}
1804 % \end{macrocode}
1805 % \end{macro}
1806 %
1807 % \begin{macro}{\caption@boxrestore@mini}
1808 % \changes{v3.2}{2010/10/24}{This macro added}
1809 % Resets \cs{par} so the very first \cs{par} in \cs{@caption} behaves quite the same as in floating environments.
1810 % Will be used by \cs{setcaptiontype}.
1811 % \begin{macrocode}
1812 \newcommand\caption@boxrestore@mini{%
1813 \let\par\@@par
1814 \parindent\z@ \parskip\z@skip
1815 \sloppy}
1816 % \end{macrocode}
1817 % \end{macro}
1818 %
1819 % \begin{macro}{\caption@normalsize}
1820 % \changes{v3.1}{2007/05/05}{This macro and its usage added}
1821 % This one will be used by |\@caption| instead of |\normalsize|.\par
1822 % Its code is equivalent to
1823 % \begin{quote}
1824 % |\caption@font{normal}%|
1825 % \end{quote}
1826 % but executes faster (since the starred form of |\caption@font|
1827 % does not use |\setkeys| internally).
1828 % \begin{macrocode}
1829 \newcommand*\caption@normalsize{%
1830 \caption@font*{\KV@caption@fnt@normal\@unused}}
1831 % \end{macrocode}
1832 % \end{macro}
1833 %
1834 % \begin{macro}{\caption@setfloatcapt}
1835 % Needed for support of the \package{float} package, where the caption will
1836 % not be typeset directly, but catched in a |\vbox| called |\@floatcapt|
1837 % instead.
1838 % \begin{macrocode}
1839 \let\caption@setfloatcapt\@firstofone
1840 % \end{macrocode}
1841 % \end{macro}
1842 %
1843 % \begin{macro}{\caption@makecurrent}
1844 % This one is needed for support of the \package{nameref} and \package{hyperref} package.
1845 % \changes{v3.2f}{2012/01/14}{Bugfix: Usage of \cs{caption@gettitle} added}
1846 % \begin{macrocode}
1847 \newcommand*\caption@makecurrent[1]{\caption@gettitle}
1848 % \end{macrocode}
1849 % \end{macro}
1850 %
1851 % \begin{macro}{\caption@makeanchor}
1852 % \begin{macro}{\caption@start}
1853 % \begin{macro}{\caption@@start}
1854 % \begin{macro}{\caption@freezeHref}
1855 % \begin{macro}{\caption@defrostHref}
1856 % All these are needed for support of the \package{hyperref} package.
1857 % \begin{macrocode}
1858 \let\caption@makeanchor\@firstofone
1859 \let\caption@start\relax
1860 \let\caption@@start\relax
1861 \let\caption@freezeHref\relax
1862 \let\caption@defrostHref\relax
1863 % \end{macrocode}
1864 % \end{macro}
1865 % \end{macro}
1866 % \end{macro}
1867 % \end{macro}
1868 % \end{macro}
1869 %
1870 % \begin{macro}{\caption@gettitle}
1871 % \changes{v3.1l}{2010/01/09}{This macro and its usage added to adapt the definition of \cs{@currentlabelname} to recent versions of \package{nameref}}
1872 % \changes{v3.4p}{2023/08/05}{Support for older versions of \package{nameref} revised to make it compatible with \LaTeX\ 2023-06-01}
1873 % This one is needed for support of the \package{nameref} package.
1874 % \begin{macrocode}
1875 \newcommand\caption@gettitle[1]{%
1876 \caption@ifdefined\NR@gettitle
1877 {\NR@gettitle{#1}}% % support for recent versions of nameref package
1878 {\caption@ifdefined\NR@sect{\def\@currentlabelname{#1}}{}}} % support for older versions of nameref package
1879 % \end{macrocode}
1880 % \end{macro}
1881 %
1882 % \section{Support for sub-captions}
1883 % \changes{v3.1f}{2007/11/16}{Support for sub-captions added}
1884 %
1885 % \begin{macro}{\caption@subtypehook}
1886 % \changes{v3.1g}{2008/03/20}{Redefinition of \cs{caption@setlist} added}
1887 % \changes{v3.1k}{2009/10/09}{Bugfix 09-08-12b: \cs{@makecaption} will now be restored here, too}
1888 % \changes{v3.2}{2011/06/26}{Uses \cs{caption@@addcontentsline} instead of \cs{addcontentsline} now}
1889 % \changes{v3.2a}{2011/08/17}{Redefinition of \cs{phantomcaption} added}
1890 % \changes{v3.2a}{2011/08/17}{Usage of \cs{caption@warmup} added}
1891 % \changes{v3.2c}{2011/09/30}{Bugfix 11-09-26: Usage of \cs{if@subfloatrow} added}
1892 % \changes{v3.3}{2011/12/28}{Bugfix 11-12-16: \cs{caption@l@stepcounter} replaced by \cs{stepcounter}}
1893 % \changes{v3.3}{2012/03/15}{Usage of \cs{caption@setbox} added}
1894 % \changes{v3.3}{2013/05/01}{Redefinition of \cs{caption@settype} added}
1895 % \changes{v3.3}{2013/06/17}{Missing redefinition of \cs{captionlistentry} added}
1896 % \changes{v3.3}{2018/09/06}{Adapted to the \package{chkfloat} package}
1897 % \changes{v3.4f}{2020/01/03}{Redefinition of \cs{@caption} added since it was redefined by the \env{threeparttable} environment}
1898 % Hook, will be used inside \cs{caption@setsubtype}.\par
1899 % (Note: If we are inside an |sub|\-|float|\-|row| environment we have to keep
1900 % the |\@make|\-|caption| code of the \package{floatrow} package intact.)
1901 % \begin{macrocode}
1902 \newcommand*\caption@subtypehook{%
1903 \ifx\caption\caption@subcaption \else
1904 \caption@warmup
1905 % \end{macrocode}
1906 % \begin{macrocode}
1907 \caption@ifflag2{}{% caption
1908 % no \caption in this part of the (floating) environment yet
1909 \let\caption@add@contentsline\caption@addsubcontentsline
1910 \let\caption@addsubcontentslines\@gobble
1911 \caption@ifflag4{}{% subcaption
1912 % no \subcaption in this part of the (floating) environment yet
1913 \caption@ifflag1{% continued float
1914 \caption@clrflag1%
1915 }{%
1916 \caption@@stepcounter\@captype
1917 }%
1918 \caption@setflag4% subcaption
1919 }%
1920 }%
1921 % \end{macrocode}
1922 % \begin{macrocode}
1923 \c@continuedfloat=0\relax
1924 \let\caption@setfloatcapt\@firstofone
1925 \let\caption@chkfloat\@gobbletwo
1926 % \end{macrocode}
1927 % \begin{macrocode}
1928 \caption@setbox{none}%
1929 \caption@clearmargin
1930 \caption@iflist{}{\let\caption@setlist\@gobble}%
1931 \caption@setoptions{sub}%
1932 \caption@setoptions{subfloat}% for subfig-package compatibility
1933 % \end{macrocode}
1934 % \begin{macrocode}
1935 % redefine \setcaptiontype
1936 \def\caption@settype{\caption@withoptargs\caption@sub@settype}%
1937 \def\caption@sub@settype##1##2{%
1938 \edef\caption@tempa{##2}%
1939 \ifx\caption@tempa\@captype
1940 %%% \caption@setsubtype##1\relax
1941 \else
1942 \caption@Error{##2 inside \@subcaptype}%
1943 \fi}%
1944 % \end{macrocode}
1945 % \begin{macrocode}
1946 % redefine \caption
1947 \let\caption\caption@subcaption
1948 \let\@caption\caption@@caption
1949 \let\phantomcaption\caption@subphantom
1950 \let\captionlistentry\caption@sublistentry
1951 % \let\@captype\@subcaptype
1952 \let\caption@refstepcounter\caption@@@refstepcounter
1953 % \end{macrocode}
1954 % \begin{macrocode}
1955 % restore \@makecaption
1956 \if@subfloatrow
1957 \caption@Debug{Keeping \string\@makecaption}%
1958 \else
1959 \let\@makecaption\caption@makecaption
1960 \fi
1961 \fi}%
1962 % \end{macrocode}
1963 % \end{macro}
1964 %
1965 % \begin{macro}{\if@subfloatrow}
1966 % \changes{v3.2c}{2011/09/30}{This macro added}
1967 % This macro tests if we are inside an |sub|\-|float|\-|row| or |sub|\-|float|\-|row*| environment.
1968 % \begin{macrocode}
1969 \caption@AtBeginDocument{%
1970 \caption@ifundefined\@subfloatrowtrue
1971 {\newif\if@subfloatrow
1972 \caption@ifundefined\subfloatrow{}%
1973 {\caption@Debug{Patching subfloatrow environment}%
1974 \g@addto@macro\capsubrowsettings{\@subfloatrowtrue}%
1975 \g@addto@macro\killfloatstyle{%
1976 \ifx\c@FRobj\c@FRsobj\@subfloatrowtrue\fi}}}%
1977 {\caption@Debug{\string\if@subfloatrow is already defined}}}%
1978 % \end{macrocode}
1979 % \end{macro}
1980 %
1981 % \begin{macro}{\caption@subcaption}
1982 % Makes a sub-caption.
1983 % \begin{macrocode}
1984 \newcommand*\caption@subcaption{%
1985 \caption@checkgrouplevel{sub}\subcaption
1986 \caption@star
1987 {\caption@refstepcounter\@subcaptype}%
1988 {\caption@dblarg{\@caption\@subcaptype}}}
1989 % \end{macrocode}
1990 % \end{macro}
1991 %
1992 % \begin{macro}{\caption@subphantom}
1993 % \changes{v3.2a}{2011/08/17}{This macro added}
1994 % Same as |\phantomcaption|, but for sub-captions.
1995 % \begin{macrocode}
1996 \newcommand*\caption@subphantom{%
1997 \caption@checkgrouplevel{sub}\phantomsubcaption
1998 \caption@refstepcounter\@subcaptype}
1999 % \end{macrocode}
2000 % \end{macro}
2001 %
2002 % \begin{macro}{\caption@sublistentry}
2003 % \changes{v3.3}{2013/06/17}{This macro added}
2004 % Same as |\captionlistentry|, but for sub-captions.
2005 % \begin{macrocode}
2006 \newcommand*\caption@sublistentry{%
2007 \caption@teststar\@subcaptionlistentry\@firstoftwo\@secondoftwo}
2008 % \end{macrocode}
2009 % \begin{macrocode}
2010 \newcommand*\@subcaptionlistentry[1]{%
2011 \@testopt{\caption@listentry{#1}}\@subcaptype}
2012 % \end{macrocode}
2013 % \end{macro}
2014 %
2015 % \begin{macro}{caption@clearsubcontentslines}
2016 % Clear pending sub-caption list entries.
2017 % \begin{macrocode}
2018 \newcommand*\caption@clearsubcontentslines{%
2019 \global\let\caption@subcontentslines\@empty}
2020 % \end{macrocode}
2021 % \begin{macrocode}
2022 \caption@clearsubcontentslines
2023 % \end{macrocode}
2024 % \end{macro}
2025 %
2026 % \begin{macro}{\caption@addsubcontentsline}
2027 % \changes{v3.1i}{2008/08/02}{Bugfix 08-07-28:
2028 % \cs{label}, \cs{index}, and \cs{glossary} are allowed inside the list entry now}
2029 % \changes{v3.2}{2011/06/26}{Uses \cs{caption@@addcontentsline} instead of \cs{addcontentsline} now}
2030 % \changes{v3.2c}{2011/08/19}{Uses \cs{caption@gobble} instead of \cs{@gobble} now}
2031 % \changes{v3.3}{2012/01/15}{Debug message added}
2032 % \changes{v3.3}{2013/03/10}{A single \cs{protect} replaced by \cs{noexpand}}
2033 % Add a pending sub-caption list entry.
2034 % \begin{macrocode}
2035 \newcommand*\caption@addsubcontentsline[4]{%
2036 \caption@Debug{\string\caption@addsubcontentsline{#1}{#2}}%
2037 \begingroup
2038 \let\label\caption@gobble
2039 \let\index\caption@gobble
2040 \let\glossary\caption@gobble
2041 \protected@edef\@tempa{\endgroup
2042 \noexpand\g@addto@macro\noexpand\caption@subcontentslines{%
2043 \noexpand\@namedef{the#2}{\csname the#2\endcsname}%
2044 \ifx\@currentHref\@undefined \else
2045 \noexpand\def\noexpand\@currentHref{\@currentHref}%
2046 \fi
2047 \noexpand\caption@@@addcontentsline{#1}{#2}{#3}{#4}}}%
2048 \@tempa}
2049 % \end{macrocode}
2050 % \end{macro}
2051 %
2052 % \begin{macro}{\flushsubcaptionlistentries}
2053 % \changes{v3.3}{2012/01/15}{Renamed from \cs{caption@addsubcontentslines} to \cs{flushsubcaptionlistentries}}
2054 % \changes{v3.3}{2013/03/10}{Bugfix: Missing redefinition of \cs{caption@addsubcontentslines} added}
2055 % Writes pending sub-caption list entries.
2056 % \begin{macrocode}
2057 \newcommand*\flushsubcaptionlistentries{%
2058 \caption@addsubcontentslines{user}}
2059 % \end{macrocode}
2060 % \begin{macrocode}
2061 \renewcommand*\caption@addsubcontentslines[1]{%
2062 \caption@Debug{\string\flushsubcaptionlistentries (#1)}%
2063 \begingroup
2064 \caption@subcontentslines
2065 \endgroup
2066 \caption@clearsubcontentslines}
2067 % \end{macrocode}
2068 % We need to patch \cs{chapter} otherwise a vertical gap will be inserted into
2069 % the list prior pending sub-caption list entries.
2070 % We do this |\At|\-|Begin|\-|Document| so packages like \package{newfloat}
2071 % will not complain about an unknown document class.
2072 % \begin{macrocode}
2073 \AtBeginDocument{%
2074 % \end{macrocode}
2075 % \begin{macrocode}
2076 \caption@ifdefined\chapter{%
2077 \let\caption@chapter@ORI\chapter
2078 \def\chapter{%
2079 \caption@addsubcontentslines{chapter}\caption@chapter@ORI}}{}%
2080 % \end{macrocode}
2081 % Same for \cs{appendix}.
2082 % \begin{macrocode}
2083 \caption@ifdefined\appendix{%
2084 \let\caption@appendix@ORI\appendix
2085 \def\appendix{%
2086 \caption@addsubcontentslines{appendix}\caption@appendix@ORI}}{}%
2087 % \end{macrocode}
2088 % Flush the list of pending sub-caption list entries at the end of the document.
2089 % \begin{macrocode}
2090 \caption@addsubcontentslines{AtEndDocument}%
2091 % \end{macrocode}
2092 % \begin{macrocode}
2093 }
2094 % \end{macrocode}
2095 % \end{macro}
2096 %
2097 %
2098 % \section{Document class \& Babel package support}
2099 %
2100 % \subsection{The \AmS{} \& \SmF{} classes}
2101 % \changes{v3.1}{2007/07/29}{\AmS\ \& \SmF\ classes support added}
2102 %
2103 % \begin{macrocode}
2104 \caption@ifdefined\smf@makecaption{\let\smf@makecaption\@makecaption}{}
2105 % \end{macrocode}
2106 %
2107 % \subsection{The beamer class}
2108 % \changes{v3.1}{2007/03/10}{beamer class support added}
2109 %
2110 % \begin{macrocode}
2111 \@ifclassloaded{beamer}{%
2112 \caption@InfoNoLine{beamer document class}%
2113 % \end{macrocode}
2114 %
2115 % \begin{macro}{\figure}
2116 % \changes{v3.1f}{2007/12/17}{This re-definition for \class{beamer} document class added}
2117 % \changes{v3.3d}{2019/09/01}{This re-definition for \class{beamer} document class revised}
2118 % We redefine |figure| so our type-specific options will be used etc.
2119 % \begin{macrocode}
2120 \let\caption@ORI@figure\figure
2121 \def\figure{\caption@settype{figure}\caption@ORI@figure}
2122 % \end{macrocode}
2123 % \end{macro}
2124 %
2125 % \begin{macro}{\table}
2126 % \changes{v3.1f}{2007/12/17}{This re-definition for \class{beamer} document class added}
2127 % \changes{v3.3d}{2019/09/01}{This re-definition for \class{beamer} document class revised}
2128 % \changes{v3.4a}{2019/10/18}{Bug fixed which was introduced in previous revision}
2129 % We redefine |table| so our type-specific options will be used etc.
2130 % \begin{macrocode}
2131 \let\caption@ORI@table\table
2132 \def\table{\caption@settype{table}\caption@ORI@table}
2133 % \end{macrocode}
2134 % \end{macro}
2135 %
2136 % \begin{macrocode}
2137 }{}
2138 % \end{macrocode}
2139 %
2140 % \subsection{The \KOMAScript{} classes}
2141 %
2142 % \KOMAScript\ contains the code
2143 % |\AtBeginDocument{\let\scr@caption\caption}|
2144 % so we need to update |\scr@caption| here, too.
2145 %
2146 % \begin{macrocode}
2147 \caption@ifdefined\scr@caption{%
2148 \caption@AtBeginDocument{\let\scr@caption\caption}}{}
2149 % \end{macrocode}
2150 %
2151 % \subsection{The frenchb Babel option}
2152 % \changes{v3.1}{2006/05/14}{Adaptation to \package{frenchb} added}
2153 %
2154 % Suppress
2155 % ``Package |frenchb.ldf| Warning: The definition of |\@makecaption| has been
2156 % changed, frenchb will NOT customize it.''
2157 % (but only if we emulate this customization)
2158 % \begin{macrocode}
2159 \@nameuse{caption@frenchb}\@nameundef{caption@frenchb}
2160 % \end{macrocode}
2161 %
2162 % \subsection{The frenchle/pro package}
2163 % \changes{v3.0h}{2005/10/03}{Adaptation to \package{frenchle/pro} added}
2164 %
2165 % \begin{macrocode}
2166 \caption@AtBeginDocument{\caption@ifdefined\frenchTeXmods{%
2167 \caption@InfoNoLine{frenchle/pro package is loaded}%
2168 % \end{macrocode}
2169 %
2170 % \begin{macrocode}
2171 \let\captionfont@ORI\captionfont
2172 \let\captionlabelfont@ORI\captionlabelfont
2173 \let\@makecaption@ORI\@makecaption
2174 % \end{macrocode}
2175
2176 % If |\GOfrench| is defined as |\relax| all the re-definitions regarding
2177 % captions have already been done, so we can do our patches immediately.
2178 % Otherwise we must add our stuff to |\GOfrench|.
2179 % \begin{macrocode}
2180 \caption@ifdefined\GOfrench
2181 {\def\caption@tempa{\g@addto@macro\GOfrench}}%
2182 {\let\caption@tempa\@firstofone}%
2183 \caption@tempa{%
2184 % \end{macrocode}
2185 %
2186 % \begin{macrocode}
2187 \let\captionfont\captionfont@ORI
2188 \let\captionfont@ORI\@undefined
2189 \let\captionlabelfont\captionlabelfont@ORI
2190 \let\captionlabelfont@ORI\@undefined
2191 \let\@makecaption\@makecaption@ORI
2192 \let\@makecaption@ORI\@undefined
2193 % \end{macrocode}
2194 %
2195 % \begin{macro}{\@cnORI}
2196 % We update the definition of |\@cnORI| so it actually reflects
2197 % our definition of |\caption|.
2198 % \begin{macrocode}
2199 \let\@cnORI\caption
2200 % \end{macrocode}
2201 % \end{macro}
2202 %
2203 % \begin{macro}{\@tablescaption}
2204 % The \package{frenchle/pro} package sets |\caption| to |\@tablescaption| at
2205 % |\begin{table}| for special treatment of footnotes.
2206 % Therefore we have to patch |\@tablescaption| so |\caption*| will work
2207 % inside the |table| environment.
2208 % \begin{macrocode}
2209 \let\caption@tcORI\@tablescaption
2210 \def\@tablescaption{\caption@star\relax\caption@tcORI}%
2211 % \end{macrocode}
2212 % \end{macro}
2213 %
2214 % \begin{macro}{\f@ffrench}
2215 % \begin{macro}{\f@tfrench}
2216 % |\f@ffrench| and |\f@tfrench| reflect |\fnum@figure| and |\fnum@table|
2217 % when used in French mode. These contain additional code which typesets
2218 % the caption separator |\captionseparator| instead of the usual colon.
2219 % Because this breaks with our |\@makecaption| code we have to remove
2220 % this additional code here.
2221 % \begin{macrocode}
2222 \let\@eatDP\@undefined
2223 \let\caption@tempa\@empty
2224 \ifx\f@ffrench\fnum@figure
2225 \l@addto@macro\caption@tempa{\let\fnum@figure\f@ffrench}%
2226 \fi
2227 \ifx\f@tfrench\fnum@table
2228 \l@addto@macro\caption@tempa{\let\fnum@table\f@tfrench}%
2229 \fi
2230 \def\f@ffrench{\ifx\listoffigures\relax\else\figurename~\thefigure\fi}%
2231 \def\f@tfrench{\ifx\listoftables\relax\else\tablename~\thetable\fi}%
2232 \caption@tempa
2233 % \end{macrocode}
2234 % \end{macro}
2235 % \end{macro}
2236 %
2237 % \begin{macrocode}
2238 }%
2239 }{}}
2240 % \end{macrocode}
2241 %
2242 % \subsection{The hungarian and magyar Babel option}
2243 % \changes{v3.2}{2009/03/29}{\package{magyar} package support added}
2244 % \changes{v3.3}{2018/08/26}{\package{magyar} package support revised}
2245 %
2246 % \begin{macrocode}
2247 \def\caption@tempa#1{%
2248 \@ifpackagewith{babel}{#1}{%
2249 \caption@InfoNoLine{#1 babel option is loaded}%
2250 \expandafter\addto\csname extras#1\endcsname{%
2251 % reverse changes made by magyar.ldf
2252 \let\@makecaption\caption@makecaption
2253 \babel@save\@makecaption
2254 \caption@redefine
2255 \babel@save\@caption}%
2256 }{}}
2257 % \end{macrocode}
2258 % \begin{macrocode}
2259 \caption@tempa{hungarian}%
2260 \caption@tempa{magyar}%
2261 % \end{macrocode}
2262 %
2263 % \section{Package support}
2264 % \changes{v3.1}{2007/04/11}{Package options `float', `longtable' etc.
2265 % are not supported anymore, removed}
2266 %
2267 % \begin{macro}{\caption@IfPackageLoaded}
2268 % \changes{v3.0f}{2005/05/29}{3rd argument \meta{code} added,
2269 % so no extra check is needed}
2270 % \changes{v3.1}{2007/07/04}{Re-written \& renamed from \cs{caption@ifpackage}
2271 % to \cs{caption@IfPackageLoaded}}
2272 % \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
2273 % |\caption@IfPackageLoaded|\marg{package}\oarg{version}\marg{true}\marg{false}\par
2274 % Some kind of combination of |\@ifpackageloaded| and |\@ifpackagelater|.
2275 % If the \meta{package} is not loaded yet, the check will be (re-)done
2276 % |\AtBeginDocument|, so the \meta{package} could be loaded later on, too.
2277 % \begin{macrocode}
2278 \newcommand\caption@IfPackageLoaded[1]{%
2279 \@testopt{\caption@@IfPackageLoaded{#1}}{}}
2280 \@onlypreamble\caption@IfPackageLoaded
2281 % \end{macrocode}
2282 % \begin{macrocode}
2283 \long\def\caption@@IfPackageLoaded#1[#2]#3#4{%
2284 \@ifpackageloaded{#1}\@firstofone{%
2285 \caption@Debug{#1 package is not loaded (yet)\@gobble}%
2286 \caption@AtBeginDocument}{%
2287 \caption@If@Package@Loaded{#1}[{#2}]{#3}{#4}}}
2288 \@onlypreamble\caption@@IfPackageLoaded
2289 % \end{macrocode}
2290 % \begin{macrocode}
2291 \long\def\caption@If@Package@Loaded#1[#2]{%
2292 \@ifpackageloaded{#1}{%
2293 \caption@InfoNoLine{#1 package is loaded}%
2294 \@ifpackagelater{#1}{#2}\@firstoftwo{%
2295 \caption@Error{%
2296 For a successful cooperation we need at least version\MessageBreak
2297 `#2' of package #1,\MessageBreak
2298 but only version\MessageBreak
2299 `\csname ver@#1.\@pkgextension\endcsname'\MessageBreak
2300 is available}%
2301 \@secondoftwo}%
2302 }{\@secondoftwo}}
2303 \@onlypreamble\caption@If@Package@Loaded
2304 % \end{macrocode}
2305 % \end{macro}
2306 %
2307 % \begin{macro}{\caption@clearmargin}
2308 % \changes{v3.1}{2007/05/05}{This macro and its usage added}
2309 % This macro will be used by some package support stuff where the usual
2310 % margin setting is not welcome, e.g. in the \package{sidecap} package.
2311 % \begin{macrocode}
2312 \newcommand*\caption@clearmargin{%
2313 \setcaptionmargin\z@
2314 \let\caption@minmargin\@undefined}
2315 % \end{macrocode}
2316 % \end{macro}
2317 %
2318 % \begin{macrocode}
2319 \caption@setbool{needfreeze}{0}
2320 \caption@AtBeginDocument*{%
2321 \caption@ifneedfreeze{%
2322 % \end{macrocode}
2323 %
2324 % \begin{macro}{\caption@freezetype}
2325 % \changes{v3.3}{2013/05/01}{This macro added}
2326 % |\caption@freezetype|\marg{type}\par
2327 % Used by the \package{fltpage} \& \package{sidecap} package support.
2328 % \begin{macrocode}
2329 \newcommand*\caption@freezetype[1]{%
2330 \caption@settype*{#1}%
2331 \captionsetup*[sub]{hypcap=true}% Note: This is just a (q&d) workaround!
2332 \caption@freeze}%
2333 % \end{macrocode}
2334 % \end{macro}
2335 %
2336 % \begin{macro}{\caption@freeze}
2337 % \changes{v3.1}{2007/07/22}{This macro added}
2338 % \changes{v3.1c}{2007/10/06}{\cs{caption} \& \cs{@caption} revised for enhanced compatibility}
2339 % \changes{v3.1c}{2007/10/06}{Bugfix: Made \cs{@caption} long}
2340 % \changes{v3.1f}{2007/11/16}{Uses `space hack' instead of \cs{ignorespaces} now}
2341 % \changes{v3.1g}{2008/01/29}{Starred variants of \cs{ContinuedFloat} and \cs{captionsetup} added}
2342 % \changes{v3.2}{2010/10/26}{Bugfix 10-09-01a: Uses \cs{ignorespaces} instead of `space hack' again}
2343 % \changes{v3.2a}{2011/08/17}{Starred variant of \cs{caption@freeze} removed}
2344 % \changes{v3.2b}{2011/08/18}{Redefines \cs{caption@setup} instead of \cs{captionsetup} now}
2345 % \changes{v3.2b}{2011/08/18}{Redefinition of \cs{label} revised}
2346 % \changes{v3.2c}{2011/08/21}{Revised}
2347 % \changes{v3.3}{2013/01/06}{Adapted to new switch \cs{caption@caption} etc.}
2348 % |\caption@freeze|\par
2349 % Used by the \package{bicaption} package.
2350 % \begin{macrocode}
2351 \newcommand*\caption@freeze{%
2352 \let\caption@frozen@continuedfloat\continuedfloat
2353 \def\continuedfloat{%
2354 \caption@@freeze{\caption@@@@continuedfloat\@captype}%
2355 \caption@frozen@continuedfloat}%
2356 % \end{macrocode}
2357 % \begin{macrocode}
2358 \let\caption@frozen@setup\caption@setup
2359 \def\caption@setup##1{%
2360 \caption@@freeze{\caption@setup{##1}}%
2361 \caption@frozen@setup{##1}}%
2362 % \end{macrocode}
2363 % \begin{macrocode}
2364 \let\caption@frozen@caption\caption
2365 \def\caption{%
2366 \def\caption{%
2367 \caption@Error{%
2368 Only one \noexpand\caption can be placed in this environment}%
2369 \caption@gobble}%
2370 \@ifstar
2371 {\caption@SC@caption*}%
2372 {\let\@currentlabel\caption@SClabel
2373 \caption@withoptargs\caption@SC@caption}}%
2374 \long\def\caption@SC@caption##1##2{%
2375 \caption@@freeze{\caption##1{##2}}%
2376 \ignorespaces}%
2377 % \end{macrocode}
2378 % \begin{macrocode}
2379 \let\caption@frozen@label\label
2380 \def\label{%
2381 \caption@withoptargs\caption@SC@label}%
2382 \def\caption@SC@label##1##2{%
2383 \ifx\@currentlabel\caption@SClabel
2384 \@bsphack
2385 \caption@freeze@label{##1}{##2}%
2386 \@esphack
2387 \else
2388 \caption@frozen@label##1{##2}%
2389 \fi}%
2390 \def\caption@SClabel{\caption@undefinedlabel}%
2391 \def\caption@freeze@label##1##2{%
2392 \caption@@freeze{\label##1{##2}}}%
2393 % \end{macrocode}
2394 % \begin{macrocode}
2395 \global\let\caption@frozen@content\@empty
2396 \long\def\caption@@freeze{%
2397 \g@addto@macro\caption@frozen@content}%
2398 % \end{macrocode}
2399 % \begin{macrocode}
2400 \def\caption@warmup{%
2401 \let\continuedfloat\caption@frozen@continuedfloat
2402 \let\caption@setup\caption@frozen@setup
2403 \let\caption\caption@frozen@caption
2404 \let\label\caption@frozen@label}}%
2405 % \end{macrocode}
2406 % \end{macro}
2407 %
2408 % \begin{macro}{\caption@prepare@defrost}
2409 % \changes{v3.3}{2013/01/06}{This macro added}
2410 % Prevent resetting the caption flags
2411 % \begin{macrocode}
2412 \newcommand*\caption@prepare@defrost{%
2413 \let\caption@settype\caption@set@type}
2414 % \end{macrocode}
2415 % \end{macro}
2416 %
2417 % \begin{macro}{\caption@defrost}
2418 % \changes{v3.1}{2007/07/22}{This macro added}
2419 % \changes{v3.1g}{2008/01/30}{\cs{caption@defrost@setup} added}
2420 % \changes{v3.2c}{2011/08/21}{Adapted to changes of \cs{caption@freeze}}
2421 % \changes{v3.2c}{2011/08/21}{\cs{caption@defrost@setup} removed}
2422 % |\caption@defrost|
2423 % \begin{macrocode}
2424 \newcommand*\caption@defrost{%
2425 \ifx\caption@frozen@caption\@undefined
2426 \caption@frozen@content
2427 \else
2428 \caption@Error{Internal Error:\MessageBreak
2429 \noexpand\caption@defrost in same group as \string\caption@freeze}%
2430 \fi}%
2431 % \end{macrocode}
2432 % \end{macro}
2433 %
2434 % \begin{macrocode}
2435 }{}%
2436 \caption@undefbool{needfreeze}}
2437 % \end{macrocode}
2438 %
2439 % \begin{macro}{\caption@warmup}
2440 % \changes{v3.2a}{2011/08/17}{This macro added}
2441 % |\caption@warmup|
2442 % \begin{macrocode}
2443 \let\caption@warmup\relax
2444 % \end{macrocode}
2445 % \end{macro}
2446 %
2447 % \subsection{The changepage package}
2448 % \changes{v3.4k}{2020/05/30}{Patch of the \package{changepage} package added}
2449 %
2450 % \begin{macrocode}
2451 \caption@IfPackageLoaded{changepage}[2008/07/23 memoir-v3.7k]{%
2452 % \end{macrocode}
2453 %
2454 % Both environments, \env{adjustwidth} and \env{adjustwidth*}, are starting a \env{list} \cs{item}.
2455 % But \cs{hsize} isn't set properly inside a \env{list} item, and therefore \cs{@makecaption}
2456 % (offered by document classes) doesn't work properly when used inside \env{adjustwidth}.
2457 % Therefore we try to detect the situation ``Are we inside a adjustwidth environment?''
2458 % inside \cs{@makecaption} and fix this. (Sigh!)
2459 %
2460 % We cannot simply set and test a flag here since our adjustment to \cs{hsize} should
2461 % not be done within a \cs{parbox} within a adjustwidth environment for example,
2462 % and therefore we store \cs{hsize} and \cs{linewidth}, and test \cs{hsize} and \cs{linewidth}
2463 % against the stored values instead. If they are equal we are (hopefully) quite save
2464 % to assume that we are now inside a plain \env{adjustwidth} environment and therefore need
2465 % to fix \cs{hsize} before typesetting the caption. (Deep sigh!)
2466 %
2467 % \begin{macro}{\caption@adjustwidth@hsize}
2468 % \begin{macro}{\caption@adjustwidth@linewidth}
2469 % \begin{macrocode}
2470 \newdimen\caption@adjustwidth@hsize
2471 \newdimen\caption@adjustwidth@linewidth
2472 % \end{macrocode}
2473 % \end{macro}
2474 % \end{macro}
2475 %
2476 % \begin{macro}{\caption@set@adjustwidth}
2477 % \changes{v3.4k}{2020/05/30}{This macro and its usage added}
2478 % Store the values of \cs{hsize} and \cs{linewidth}.
2479 % \begin{macrocode}
2480 \providecommand*\caption@set@adjustwidth{%
2481 \caption@adjustwidth@hsize\hsize
2482 \caption@adjustwidth@linewidth\linewidth}%
2483 % \end{macrocode}
2484 % \begin{macrocode}
2485 \providecommand*\caption@patch@changepage[1]{%
2486 \expandafter\let\csname caption@#1\expandafter\endcsname\csname #1\endcsname
2487 \expandafter\renewcommand\csname #1\endcsname[2]{%
2488 \@nameuse{caption@#1}{##1}{##2}%
2489 \caption@set@adjustwidth}}%
2490 \caption@patch@changepage{adjustwidth}%
2491 \caption@patch@changepage{adjustwidth*}%
2492 \let\caption@patch@changepage\relax
2493 % \end{macrocode}
2494 % \end{macro}
2495 %
2496 % \begin{macro}{\caption@test@adjustwidth}
2497 % \changes{v3.4k}{2020/05/30}{This macro and its usage added}
2498 % Test if the values of \cs{hsize} and \cs{linewidth} are identical to
2499 % the ones stored in the \env{adjustwidth} environment.
2500 % If yes, set \cs{hsize} to the correct value.
2501 % \begin{macrocode}
2502 \providecommand\caption@test@adjustwidth{%
2503 \ifdim\hsize=\caption@adjustwidth@hsize
2504 \ifdim\linewidth=\caption@adjustwidth@linewidth
2505 \hsize=\linewidth
2506 \fi
2507 \fi}%
2508 % \end{macrocode}
2509 % \begin{macrocode}
2510 \AtBeginCaption{\caption@test@adjustwidth}%
2511 % \end{macrocode}
2512 % \end{macro}
2513 %
2514 % \begin{macrocode}
2515 }{}%
2516 % \end{macrocode}
2517 %
2518 % \subsection{The chkfloat package}
2519 % \changes{v3.3}{2018/09/06}{Support of the \package{chkfloat} package added}
2520 %
2521 % \begin{macrocode}
2522 \caption@IfPackageLoaded{chkfloat}[2012/08/19 v0.1]{%
2523 % \end{macrocode}
2524 %
2525 % \begin{macro}{\caption@chkfloat}
2526 % \changes{v3.3}{2018/09/06}{This macro added}
2527 % \begin{macrocode}
2528 \caption@ifdefined\chkfloat@addcontentsline{%
2529 \renewcommand\caption@chkfloat{\chkfloat@addcontentsline}%
2530 }{%
2531 \renewcommand\caption@chkfloat[2]{%
2532 \caption@ifdefined\chkfloat@page{%
2533 \addtocontents{fof}{\protect\chkfloat@{\thepage}{\chkfloat@page}{\csname fnum@#1\endcsname: #2}}%
2534 }{}}%
2535 }%
2536 % \end{macrocode}
2537 % \end{macro}
2538 %
2539 % \begin{macrocode}
2540 }{}%
2541 % \end{macrocode}
2542 %
2543 % \subsection{The float package}
2544 % \changes{v3.0f}{2005/05/31}{\package{float} package support rewritten and improved}
2545 % \iffalse
2546 % (This is a more straight-ahead implementation, but it only works with v1.3
2547 % now, so v1.2 is no longer supported. The old code including documentation
2548 % can be found in caption-30f-050530.zip)
2549 % \fi
2550 %
2551 % The \package{float} package usually do not use the \LaTeX\ kernel command
2552 % |\@caption| to typeset the caption but |\float@caption| instead.
2553 % (|\@caption| will only be used if the float is re-styled with
2554 % |\restylefloat*|.)
2555 %
2556 % The main two things |\float@caption| is doing different are:
2557 % \begin{itemize}
2558 % \item The caption will be typeset inside a |\savebox| called |\@floatcapt|
2559 % so it can be placed above or below the float contents afterwards.
2560 % \item |\@makecaption| will not be used to finally typeset the caption.
2561 % Instead |\@fs@capt| will be used which definition is part of the float
2562 % style.
2563 % (Note that |\@fs@capt| will not typeset any vertical space above or below
2564 % the caption; instead this space will be typeset by the float style code
2565 % itself.)
2566 % \end{itemize}
2567 %
2568 % \begin{macrocode}
2569 \caption@IfPackageLoaded{float}[2001/11/08 v1.3d]{%
2570 \@ifpackageloaded{floatrow}{%
2571 \caption@If@Package@Loaded{floatrow}[2007/08/24 v0.2a]{}{}%
2572 }{%
2573 % \end{macrocode}
2574 %
2575 % \begin{macro}{\@float@setevery}
2576 % \changes{v3.1k}{2009/10/09}{Bugfix 08-12-05: \cs{color@begin/endgroup} added
2577 % to redefinition of \cs{caption@setfloatcapt}}
2578 % \changes{v3.4b}{2019/12/16}{Usage of \cs{caption@float@setname} added}
2579 % |\@float@setevery|\marg{float type} is provided by the \package{float}
2580 % package; it's called every time a floating environment defined with
2581 % |\newfloat| or |\restylefloat| begins.
2582 % We use this hook to do some adaptations and to setup the proper caption
2583 % style (if defined) and additional settings declared with
2584 % |\captionsetup|\oarg{float style}.
2585 % \begin{macrocode}
2586 \let\caption@ORI@float@setevery\@float@setevery
2587 \def\@float@setevery#1{%
2588 \float@ifcaption{#1}{%
2589 % \end{macrocode}
2590 %
2591 % First of all we set the caption position to it's proper value by
2592 % converting |\@fs@iftopcapt| (which is part of a float style and
2593 % controls where the caption will be typeset, above or below the float
2594 % contents) to our |position=| setting.
2595 % Since the spacing above and below the caption will be done by the float
2596 % style and \emph{not} by us this sounds quite useless. But in fact it isn't,
2597 % since some packages based on \thispackage\ (like the \package{subfig}
2598 % package) could have an interest for this information and therefore use the
2599 % |\caption@iftop| macro we provide in our kernel. Furthermore we need this
2600 % information for ourself in |\captionof| which uses |\@makecaption| to
2601 % finally typeset the caption with skips.
2602 % \begin{macrocode}
2603 \caption@setposition{\@fs@iftopcapt t\else b\fi}%
2604 % \end{macrocode}
2605 %
2606 % Afterward we redefine |\caption@setfloatcapt| (which will be used inside
2607 % |\@caption|) so the caption will be set inside the box |\@floatcapt|,
2608 % without extra vertical space.
2609 % \begin{macrocode}
2610 \renewcommand\caption@setfloatcapt[1]{%
2611 \let\@makecaption\caption@@make
2612 \global\setbox\@floatcapt\vbox{%
2613 \color@begingroup ##1\color@endgroup}}%
2614 % \end{macrocode}
2615 %
2616 % To allow different caption styles for different float styles we also
2617 % determine the current float style (e.g. `ruled') and select
2618 % a caption style (and additional settings) with the same name, if defined.
2619 % \begin{macrocode}
2620 \float@getstyle\float@style{#1}%
2621 \caption@setstyle*\float@style
2622 \caption@setoptions\float@style
2623 % \end{macrocode}
2624 %
2625 % \begin{macrocode}
2626 }{}%
2627 \caption@float@setname{#1}%
2628 \caption@freezeHref % will be defrosted in \float@makebox
2629 \caption@ORI@float@setevery{#1}}%
2630 % \end{macrocode}
2631 % \end{macro}
2632 %
2633 % \begin{macro}{\float@makebox}
2634 % \changes{v3.3}{2013/01/06}{Corrects wrong load order hyperref-float now}
2635 % \changes{v3.3}{2013/02/03}{Correction of wrong load order hyperref-float revised}
2636 % Redefine |\float@makebox| (only if we are not operating in compatibility mode).
2637 % \begin{macrocode}
2638 \caption@AtBeginDocument{\caption@ifcompatibility{}{%
2639 % \end{macrocode}
2640 % If it was redefined by the \package{hyperref} package,
2641 % we need to build on the original definition (and not on the redefined one).
2642 % \begin{macrocode}
2643 \caption@ifdefined\HyOrg@float@makebox
2644 {\let\caption@ORI@float@makebox\HyOrg@float@makebox}%
2645 {\let\caption@ORI@float@makebox\float@makebox}%
2646 \renewcommand\float@makebox[1]{%
2647 \caption@ORI@float@makebox{#1\relax \caption@defrostHref}}%
2648 % \end{macrocode}
2649 % \begin{macrocode}
2650 }}%
2651 % \end{macrocode}
2652 % \end{macro}
2653 %
2654 % \begin{macro}{\caption@float@setname}
2655 % \changes{v3.1}{2007/07/08}{float package hook added}
2656 % \changes{v3.4b}{2019/12/16}{Renamed from \cs{caption@typehook} to \cs{caption@float@setname}}
2657 % \LaTeX\ and almost every other packages use
2658 % |\|\meta{type}|name|
2659 % to provide a macro for the type resp.~environment name -- for example
2660 % the command |\figurename| will usually contain the name of the floating
2661 % environment |figure|:
2662 % \begin{quote}
2663 % |\newcommand\figurename{Figure}|
2664 % \end{quote}
2665 % But the \package{float} package doesn't follow this common naming
2666 % convention:
2667 % For floats defined with |\newfloat| it uses |\fname@|\meta{type} instead,
2668 % which breaks with our code (and with |\autoref| and some other things as
2669 % well).
2670 % So we have to map the \package{float} package name to the common one here.\par
2671 % \Note{If the float was not defined with \cs{newfloat} but with
2672 % \cs{restylefloat} instead, \cs{fname@}\meta{type} is not defined.}
2673 % \begin{macrocode}
2674 \newcommand*\caption@float@setname[1]{%
2675 \expandafter\ifx\csname #1name\endcsname\relax
2676 \expandafter\let\csname #1name\expandafter\endcsname
2677 \csname fname@#1\endcsname
2678 \fi}%
2679 % \end{macrocode}
2680 % \end{macro}
2681 %
2682 % \changes{v3.0f}{2005/06/26}{Skips of \env{plaintop} and \env{boxed} floats corrected}
2683 % \begin{macro}{\fs@plaintop}
2684 % \begin{macro}{\fs@boxed}
2685 % Since the float styles |plaintop| and |boxed| don't use |\abovecaptionskip|
2686 % which could be set with |skip=| (|plaintop| uses |\belowcaptionskip| instead of
2687 % |\abovecaptionskip|, and |boxed| uses a fixed space of |2pt|)
2688 % we patch the according float style macros here to change this.
2689 % \begin{macrocode}
2690 \g@addto@macro\fs@plaintop{\def\@fs@mid{\vspace\abovecaptionskip\relax}}%
2691 \g@addto@macro\fs@boxed{\def\@fs@mid{\kern\abovecaptionskip\relax}}%
2692 % \end{macrocode}
2693 % \end{macro}
2694 % \end{macro}
2695 %
2696 % \begin{macro}{\float@getstyle}
2697 % \changes{v3.1}{2007/06/10}{This macro added}
2698 % |\float@getstyle|\marg{cmd}\marg{type}\par
2699 % Determining the float style is not so easy because the only hint
2700 % provided by the \package{float} package is the macro
2701 % |\fst@|\meta{float type} which points to the macro which represents the
2702 % float style. So for example after
2703 % \begin{quote}
2704 % |\floatstyle{ruled}|\\
2705 % |\newfloat{Program}{tbp}{lop}|
2706 % \end{quote}
2707 % |\fst@Program| will be defined as
2708 % \begin{quote}
2709 % |\def\fst@Program{\fs@ruled}|\quad.
2710 % \end{quote}\par
2711 % So here is what we do: We make the first level expansion of
2712 % |\fst@|\meta{float type} a string so we can gobble the first four tokens
2713 % (= |\fs@|), so only the the name of the float style is left.\par
2714 % \emph{TODO:} We need to convert the catcodes here.
2715 % \begin{macrocode}
2716 \providecommand*\float@getstyle[2]{%
2717 \edef#1{%
2718 \noexpand\expandafter\noexpand\@gobblefour\noexpand\string
2719 \expandafter\expandafter\expandafter\noexpand
2720 \csname fst@#2\endcsname}%
2721 \edef#1{#1}%
2722 \caption@Debug{floatstyle{#2} = `#1'}}%
2723 % \end{macrocode}
2724 % \end{macro}
2725 %
2726 % \begin{macro}{\float@ifcaption}
2727 % \changes{v3.1}{2007/06/23}{This macro added}
2728 % |\float@ifcaption|\marg{type}\marg{if-clause}\marg{else-clause}\par
2729 % Here we determine if the user has used |\newfloat| resp.~|\restylefloat|,
2730 % or |\restylefloat*|.
2731 % This is quite easy: If |\@float@c@|\meta{captype} is the same as
2732 % |\float@caption|, the user has used |\newfloat| or |\restylefloat|,
2733 % otherwise we assume he has used |\restylefloat*|.
2734 % (This test will fail if some package re-defines |\float@caption|,
2735 % so we have to assume that there is no one.)
2736 % \begin{macrocode}
2737 \providecommand*\float@ifcaption[1]{%
2738 \expandafter\ifx\csname @float@c@#1\endcsname\float@caption
2739 \expandafter\@firstoftwo
2740 \else
2741 \expandafter\@secondoftwo
2742 \fi}%
2743 % \end{macrocode}
2744 % \end{macro}
2745 %
2746 % \begin{macrocode}
2747 }}{%
2748 \providecommand*\float@ifcaption[1]{\@secondoftwo}%
2749 % \clearcaptionsetup{boxed}% used by the floatrow package?
2750 }
2751 % \end{macrocode}
2752 %
2753 % The skip between `boxed' floats and their caption defaults to |2pt|.
2754 %
2755 % \begin{macrocode}
2756 \captionsetup[boxed]{skip=2pt} % do not issue a warning when not used
2757 % \end{macrocode}
2758 %
2759 % \changes{v3.0f}{2005/05/26}{\opt{strut=0} added to caption style \opt{ruled}}
2760 % \changes{v3.0f}{2005/05/27}{Option \opt{ruled} fixed}
2761 % To emulate the `ruled' definition of |\@fs@capt| we provide a caption style
2762 % `ruled' with appropriate options. But if the package option |ruled| was
2763 % specified, we setup some caption parameters to emulate the behavior
2764 % of \thispackage\ \version{1.x} option |ruled| instead, i.e.,
2765 % the current caption settings will be used, but without margin and without
2766 % `single-line-check'.
2767 % \begin{macrocode}
2768 \caption@ifbool{ruled}{%
2769 \captionsetup[ruled]{margin=0pt,minmargin=0,slc=0}%
2770 }{%
2771 \DeclareCaptionStyle{ruled}{labelfont=bf,labelsep=space,strut=0}%
2772 }
2773 \caption@undefbool{ruled}
2774 % \end{macrocode}
2775 %
2776 % \subsection{The floatflt package}
2777 % \changes{v3.1}{2007/06/10}{Support of the \package{floatflt} package added}
2778 %
2779 % \begin{macrocode}
2780 \caption@IfPackageLoaded{floatflt}[1996/02/27 v1.3]{%
2781 % \end{macrocode}
2782 %
2783 % \begin{macro}{\floatingfigure}
2784 % We patch |\floatingfigure| so |\caption@floatflt| will be used.
2785 % \begin{macrocode}
2786 \let\caption@ORI@floatingfigure\floatingfigure
2787 \def\floatingfigure{%
2788 \caption@floatflt{figure}%
2789 \caption@ORI@floatingfigure}%
2790 % \end{macrocode}
2791 % \end{macro}
2792 %
2793 % \begin{macro}{\floatingtable}
2794 % Same with |\floatingtable|\ldots
2795 % \begin{macrocode}
2796 \let\caption@ORI@floatingtable\floatingtable
2797 \def\floatingtable{%
2798 \caption@floatflt{table}%
2799 % \caption@setautoposition b%
2800 \caption@ORI@floatingtable}%
2801 % \end{macrocode}
2802 % \end{macro}
2803 %
2804 % \begin{macro}{\caption@floatflt}
2805 % \changes{v3.1c}{2007/10/06}{Bugfix: \cs{caption@clearmargin} added}
2806 % Here we do two things:
2807 % \begin{enumerate}
2808 % \item We use |\caption@set|\-|options{|\-|floating|\meta{type}|}| so
2809 % |\caption|\-|setup[|\-|floating|\meta{type}|]{|\ldots|}| is supported.
2810 % \item |\line|\-|width| must be set correctly.
2811 % Usually this is done by |\@par|\-|box|\-|restore| inside |\@caption|,
2812 % but since we use |\@caption@box|\-|restore| we have to map this to
2813 % |\@par|\-|box|\-|restore| instead.
2814 % \end{enumerate}
2815 % \begin{macrocode}
2816 \newcommand*\caption@floatflt[1]{%
2817 \caption@settype{#1}%
2818 \caption@clearmargin
2819 \caption@setfullparboxrestore
2820 \caption@setoptions{floating#1}}%
2821 % \end{macrocode}
2822 % \end{macro}
2823 %
2824 % \begin{macrocode}
2825 }{}
2826 % \end{macrocode}
2827 %
2828 % \subsection{The fltpage package}
2829 % \changes{v3.1}{2007/07/22}{Support of the \package{fltpage} package added}
2830 %
2831 % \begin{macrocode}
2832 \caption@IfPackageLoaded{fltpage}[1998/10/29 v.0.3]{%
2833 \caption@setbool{needfreeze}{1}%
2834 % \end{macrocode}
2835 %
2836 % \begin{macro}{\FP@positionLabel}
2837 % \changes{v3.2c}{2011/08/28}{This redefinition added}
2838 % Original code:
2839 % \begin{verbatim}
2840 % \newcommand{\FP@positionLabel}{%
2841 % FP\@captype-\number\value{FP@\@captype C}-pos}
2842 % \end{verbatim}%^^A
2843 % \begin{macrocode}
2844 \renewcommand\FP@positionLabel{%
2845 FP\FP@captype-\number\value{FP@\FP@captype C}-pos}%
2846 % \end{macrocode}
2847 % \end{macro}
2848 %
2849 % \begin{macro}{\FP@helpNote}
2850 % Original code:
2851 % \begin{verbatim}
2852 % \newcommand{\FP@helpNote}[2]{%
2853 % \typeout{FP#1 is inserted on page \pageref{#2}!}}%
2854 % \end{verbatim}%^^A
2855 % \begin{macrocode}
2856 \renewcommand\FP@helpNote[2]{%
2857 \begingroup % save \caption@thepage
2858 \caption@pageref{#2}%
2859 \typeout{FP#1 is inserted on page \caption@thepage!}%
2860 \endgroup}%
2861 % \end{macrocode}
2862 % \end{macro}
2863 %
2864 % \begin{macro}{\FP@floatBegin}
2865 % \changes{v3.1f}{2007/11/16}{Uses `space hack' instead of \cs{ignorespaces} now}
2866 % \changes{v3.1k}{2009/10/09}{Bugfix 09-09-11: Missing \cs{ignorespaces} added}
2867 % \changes{v3.2c}{2011/08/28}{Adapted to current version of \cs{caption@freeze}}
2868 % \changes{v3.2f}{2012/02/19}{Bugfix 12-02-16: \texttt{minipage} environment added}
2869 % \changes{v3.3}{2013/05/01}{Usage of \cs{caption@freeze} replaced by \cs{caption@freezetype}}
2870 % Original code:
2871 % \begin{verbatim}
2872 % \newcommand{\FP@floatBegin}[1]{%
2873 % \gdef\@captype{#1}%
2874 % \global\let\FP@savedCaptionCommand\caption%
2875 % \global\let\FP@savedLabelCommand\label%
2876 % \ifthenelse{\equal{\@captype}{figure}}
2877 % {\global\let\old@Fnum\fnum@figure}%
2878 % {\global\let\old@Fnum\fnum@table}%
2879 % \let\FP@LabelText\@empty%
2880 % \let\FP@CaptionText\@empty%
2881 % \let\FP@optionalCaptionText\@empty%
2882 % \renewcommand\label[1]{\gdef\FP@LabelText{##1}}%
2883 % \renewcommand\caption[2][]{%
2884 % \gdef\FP@optionalCaptionText{##1}\gdef\FP@CaptionText{##2}}%
2885 % \begin{lrbox}{\FP@floatCorpusBOX}%
2886 % }%
2887 % \end{verbatim}%^^A
2888 % \begin{macrocode}
2889 \renewcommand*\FP@floatBegin[1]{%
2890 \def\FP@captype{#1}%
2891 \begin{lrbox}{\FP@floatCorpusBOX}%
2892 \minipage\hsize % changes from LR mode to vertical mode
2893 \caption@freezetype{#1}%
2894 \ignorespaces}%
2895 % \end{macrocode}
2896 % \end{macro}
2897 %
2898 % \begin{macro}{\FP@floatEnd}
2899 % \changes{v3.1g}{2008/01/30}{Some minor bugfixes}
2900 % \changes{v3.2c}{2011/08/28}{Adapted to current version of \cs{caption@freeze}}
2901 % \changes{v3.2f}{2012/02/19}{Bugfix 12-02-16: \texttt{minipage} environment added}
2902 % Original code:
2903 % \begin{verbatim}
2904 % \newcommand{\FP@floatEnd}{%
2905 % \end{lrbox}%
2906 % \global\setbox\FP@floatCorpusBOX=\box\FP@floatCorpusBOX
2907 % \stepcounter{FP@\@captype C}%
2908 % \FP@savedLabelCommand{\FP@positionLabel}%
2909 % \FP@helpNote{\@captype}{\FP@positionLabel}%
2910 % \FP@float
2911 % {\FP@positionLabel}% location label test
2912 % {\begin{\@captype}[p!]
2913 % \usebox{\FP@floatCorpusBOX}%
2914 % \refstepcounter{\@captype}%
2915 % \ifthenelse{\equal{\FP@LabelText}{\@empty}}
2916 % {}{\FP@savedLabelCommand{\expandafter\protect\FP@LabelText}}%
2917 % \end{\@captype}}
2918 % {\addtocounter{\@captype}{-1}}
2919 % {\begin{\@captype}[b!]%
2920 % \ifthenelse{\equal{\FP@guide}{\@empty}}%
2921 % {}{\ifthenelse{\equal{\@captype}{figure}}%
2922 % {\renewcommand{\fnum@figure}{\old@Fnum\ {\FP@guide}}}%
2923 % {\renewcommand{\fnum@table}{\old@Fnum\ {\FP@guide}}}}%
2924 % \setlength{\abovecaptionskip}{2pt plus2pt minus 1pt} % length above caption
2925 % \setlength{\belowcaptionskip}{2pt plus2pt minus 1pt} % length above caption
2926 % \FP@separatorCaption%
2927 % \ifthenelse{\equal{\FP@optionalCaptionText}{\@empty}}%
2928 % {\FP@savedCaptionCommand{\expandafter\protect\FP@CaptionText}}%
2929 % {\FP@savedCaptionCommand[\expandafter\protect\FP@optionalCaptionText]%
2930 % {\expandafter\protect\FP@CaptionText}}%
2931 % \end{\@captype}}%
2932 % }%
2933 % \end{verbatim}%^^A
2934 % \begin{macrocode}
2935 \renewcommand*\FP@floatEnd{%
2936 \endminipage
2937 \end{lrbox}%
2938 % \end{macrocode}
2939 % \begin{macrocode}
2940 \stepcounter{FP@\FP@captype C}%
2941 \caption@label\FP@positionLabel
2942 \FP@helpNote\FP@captype\FP@positionLabel
2943 % \end{macrocode}
2944 % \begin{macrocode}
2945 \FP@float
2946 {\FP@positionLabel}% location label test
2947 {\caption@prepare@defrost
2948 \begin\FP@captype[p!]%
2949 \usebox\FP@floatCorpusBOX
2950 \end\FP@captype}%
2951 {\@ifundefined{theH\FP@captype}{}{%
2952 \expandafter\l@addto@macro\csname theH\FP@captype\endcsname{.FP}}}%
2953 {\caption@prepare@defrost
2954 \begin\FP@captype[b!]%
2955 \let\FP@savedSetfnumCommand\caption@setfnum
2956 \def\caption@setfnum##1{%
2957 \FP@savedSetfnumCommand{##1}%
2958 \ifx\FP@guide\@empty \else
2959 \expandafter\l@addto@macro\csname fnum@##1\endcsname{\ {\FP@guide}}%
2960 \fi}%
2961 \setlength\abovecaptionskip{2pt plus 2pt minus 1pt}% length above caption
2962 \setlength\belowcaptionskip{2pt plus 2pt minus 1pt}% length below caption
2963 \caption@setoptions{FP\@captype}%
2964 \FP@separatorCaption
2965 \caption@defrost
2966 \end\FP@captype}%
2967 }%
2968 % \end{macrocode}
2969 % \end{macro}
2970 %
2971 % \begin{macrocode}
2972 }{%
2973 \let\caption@ifFPlistcap\@undefined
2974 \let\caption@ifFPrefcap\@undefined
2975 }
2976 % \end{macrocode}
2977 %
2978 % \subsection{The hyperref package}
2979 % \changes{v3.0f}{2005/06/11}{Support of the \package{hyperref} package added}
2980 % \changes{v3.1}{2007/03/09}{Usage of \cs{hyper@makecurrent} instead of
2981 % \cs{theHfigure} as indicator for \package{hyperref} package}
2982 % \changes{v3.2}{2011/07/30}{Test if \package{hyperref} has stopped early revised}
2983 % \changes{v3.2c}{2011/08/24}{Test if \package{hyperref} has stopped early adapted to current version of \package{hyperref} package: Usage of \cs{IfHyperBoolean} added}
2984 %
2985 % \begin{macrocode}
2986 \caption@IfPackageLoaded{hyperref}[2003/11/30 v6.74m]{%
2987 % Test if hyperref has stopped early
2988 \caption@ifundefined\IfHyperBoolean{%
2989 \caption@set@bool\caption@ifhyp@stoppedearly0%
2990 \caption@ifundefined\H@refstepcounter
2991 {\caption@set@bool\caption@ifhyp@stoppedearly1}{%
2992 \caption@ifundefined\hyper@makecurrent
2993 {\caption@set@bool\caption@ifhyp@stoppedearly1}{%
2994 \caption@ifundefined\measuring@true
2995 {\caption@set@bool\caption@ifhyp@stoppedearly1}{}}}%
2996 }{%
2997 \def\caption@ifhyp@stoppedearly{\IfHyperBoolean{stoppedearly}}%
2998 }%
2999 \caption@ifhyp@stoppedearly{% hyperref has stopped early
3000 \caption@InfoNoLine{%
3001 Hyperref support is turned off\MessageBreak
3002 because hyperref has stopped early}%
3003 }{%
3004 \g@addto@macro\caption@prepareslc{\measuring@true}%
3005 % \end{macrocode}
3006 %
3007 % \begin{macro}{\caption@@@refstepcounter}
3008 % We redefine |\caption@@refstepcounter| so |\H@refstepcounter| will be used
3009 % instead of |\refstepcounter| inside |\caption| \& |\captionlistentry|.
3010 % \begin{macrocode}
3011 \renewcommand*\caption@@@refstepcounter{\H@refstepcounter}%
3012 % \end{macrocode}
3013 % \end{macro}
3014 %
3015 % \begin{macro}{\caption@makecurrent}
3016 % \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
3017 % We redefine |\caption@makecurrent| so a \package{hyperref} label
3018 % will be defined inside |\@caption|.
3019 % \Note{Will be redefined by \cs{caption@start}.}
3020 % \begin{macrocode}
3021 \renewcommand*\caption@makecurrent[2]{%
3022 \caption@makecurrentHref{#1}%
3023 \caption@Debug{hyperref current=\@currentHref}%
3024 \caption@gettitle{#2}}%
3025 % \end{macrocode}
3026 % \begin{macrocode}
3027 \newcommand*\caption@makecurrentHref{\hyper@makecurrent}%
3028 % \end{macrocode}
3029 % \end{macro}
3030 %
3031 % \begin{macro}{\caption@makeanchor}
3032 % \changes{v3.1l}{2010/01/09}{Adapted to the current hyperref package}
3033 % We redefine |\caption@makeanchor| so a \package{hyperref} anchor
3034 % will be set inside |\@caption|.
3035 % \Note{Will be redefined by \cs{caption@start}.}
3036 % \begin{macrocode}
3037 \renewcommand\caption@makeanchor[1]{%
3038 \caption@Debug{hyperref anchor: \@currentHref}%
3039 % If we cannot have nesting, the anchor is empty.
3040 \ifHy@nesting
3041 \expandafter\hyper@@anchor\expandafter{\@currentHref}{#1}%
3042 \else
3043 \Hy@raisedlink{%
3044 \expandafter\hyper@@anchor\expandafter{\@currentHref}{\relax}%
3045 }#1%
3046 \fi}%
3047 % \end{macrocode}
3048 % \begin{macrocode}
3049 \g@addto@macro\caption@prepareslc{\let\caption@makeanchor\@firstofone}%
3050 % \end{macrocode}
3051 % \end{macro}
3052 %
3053 % \paragraph{The hypcap option}
3054 %
3055 % \begin{macro}{\if@capstart}
3056 % Like the \package{hypcap} package we define the switch |\if@capstart|, too.
3057 % \begin{macrocode}
3058 \newif\if@capstart
3059 % \end{macrocode}
3060 % \end{macro}
3061 %
3062 % \begin{macro}{\caption@start}
3063 % \changes{v3.0l}{2007/02/20}{%
3064 % \cs{caption@currentHref} renamed to \cs{hc@currentHref}}
3065 % \changes{v3.1}{2007/06/21}{%
3066 % This macro renamed from \cs{capstart} to \cs{caption@start} and revised}
3067 % While the \package{hypcap} package defines a macro called |\capstart|
3068 % our variant is called |\caption@start| and is controlled by the option
3069 % |hypcap=||false|/|true|.
3070 % \begin{macrocode}
3071 \def\caption@start{\caption@ifhypcap\caption@start@\relax}%
3072 \def\caption@start@{%
3073 % \end{macrocode}
3074 % Generate the \package{hyperref} label and set the \package{hyperref} anchor,
3075 % usually (if |hypcap=false|) both is done inside |\@caption|.
3076 % \begin{macrocode}
3077 \caption@makestart\@captype
3078 \caption@startanchor\@currentHref
3079 % \end{macrocode}
3080 % Prevent |\@caption| from generating a new \package{hyperref} label,
3081 % use the label we save in |\hc@currentHref| instead.
3082 % (We also support the |@capstart| flag from the \package{hypcap} package.)
3083 % \begin{macrocode}
3084 \global\@capstarttrue
3085 \let\hc@currentHref\@currentHref
3086 \def\caption@makecurrentHref##1{%
3087 \global\@capstartfalse
3088 \global\let\@currentHref\hc@currentHref}%
3089 % \end{macrocode}
3090 % Prevent |\@caption| from generating a \package{hyperref} anchor since this
3091 % has already been done.
3092 % \begin{macrocode}
3093 \let\caption@makeanchor\@firstofone
3094 % \end{macrocode}
3095 % \begin{macrocode}
3096 }%
3097 % \end{macrocode}
3098 % \end{macro}
3099 %
3100 % \begin{macro}{\caption@makestart}
3101 % \changes{v3.1c}{2007/09/30}{\cs{@currentHref} will be extended by \texttt{caption}
3102 % instead of \texttt{xxx} now}
3103 % |\caption@makestart|\marg{type}
3104 % defines a \package{hyperref} anchor inside |\caption@start|.\par
3105 % Since we offer |\continuedfloat| the float counter can change between
3106 % `now' and |\caption|, i.e., we simply don't know the figure or table counter
3107 % yet and therefore we are not able to generate the `right' \package{hyperref}
3108 % label.
3109 % Two different solutions of this problem came into my mind:
3110 % \begin{enumerate}
3111 % \item I could use the aux file for this purpose.\par
3112 % -or-
3113 % \item I set |hypertexnames=false| locally.
3114 % Furthermore I use |#1.caption.|\meta{counter} (instead of |#1.|\meta{counter})
3115 % as naming scheme for |\@currentHref| to avoid conflicts with other hyper
3116 % links which are generated with |hypertexnames=true|.
3117 % \end{enumerate}
3118 % The first idea has the advantage that the `right' anchor name will be
3119 % generated, but one needs an additional \LaTeX\ run if figures or tables
3120 % will be inserted or removed.\par
3121 % The second idea has the advantage that it's very easy to implement, but
3122 % has some side-effects, e.g. the anchor names don't follow the figure or
3123 % table label names anymore.\par
3124 % Since I'm lazy I implemented the second idea, maybe I will revise this
3125 % later on.
3126 % \begin{macrocode}
3127 \newcommand*\caption@makestart[1]{%
3128 \begingroup
3129 \Hy@hypertexnamesfalse
3130 % \gdef\@currentHlabel{}%
3131 \hyper@makecurrent{#1.caption}%
3132 \endgroup
3133 \caption@Debug{hypcap start=\@currentHref}}%
3134 % \end{macrocode}
3135 % \end{macro}
3136 %
3137 % \begin{macro}{\caption@startanchor}
3138 % \changes{v3.1b}{2007/09/17}{Bugfix 06-09-17: We use \cs{caption@anchor} instead of \cs{hyper@@anchor}}
3139 % \changes{v3.1g}{2008/03/16}{Warning about TeX mode replaced with debug info}
3140 % |\caption@startanchor|\marg{Href}
3141 % sets a \package{hyperref} anchor inside |\caption@start|.\par
3142 % This code was taken from the \package{hypcap} package\cite{hypcap} and adapted.
3143 % \Note{Since \cs{hyper@@anchor}\marg{Href}\csmarg{\string\relax} can cause
3144 % a change from vertical mode to horizontal mode (design flaw in
3145 % \package{hyperref} package!?), and since the workaround
3146 % \cs{let}\cs{leavevmode}\cs{relax} which can be found in the
3147 % \package{hypcap} package is not always sufficient
3148 % (for example with ``Direct pdfmark support'' and \texttt{breaklinks=true}),
3149 % we use \cs{caption@anchor} instead of \cs{hyper@@anchor} here.}
3150 % \begin{macrocode}
3151 \newcommand*\caption@startanchor[1]{%
3152 \ifvmode\begingroup
3153 \caption@Debug{hypcap anchor: #1 (vertical mode)}%
3154 \@tempdima\prevdepth
3155 \nointerlineskip
3156 \vspace*{-\caption@hypcapspace}%
3157 \caption@anchor{#1}%
3158 \vspace*{\caption@hypcapspace}%
3159 \prevdepth\@tempdima
3160 \endgroup\else
3161 \caption@Debug{hypcap anchor: #1 (horizontal mode)}%
3162 \caption@anchor{#1}%
3163 \fi}%
3164 % \end{macrocode}
3165 % \end{macro}
3166 %
3167 % \begin{macro}{\caption@anchor}
3168 % \changes{v3.1c}{2007/10/17}{Workaround 07-10-17: We use \cs{caption@raisedlink} instead of \cs{Hy@raisedlink} now}
3169 % |\caption@anchor|\marg{Href} sets a \package{hyperref} anchor.
3170 % \begin{macrocode}
3171 \newcommand*\caption@anchor[1]{%
3172 \ifmeasuring@ \else
3173 \caption@raisedlink{\hyper@anchorstart{#1}\hyper@anchorend}%
3174 \fi}%
3175 % \end{macrocode}
3176 % \Note{Since \cs{Hy@raisedlink} change \cs{@tempdima} we surrounded it by \cs{ifvmode},
3177 % suppressing ``\texttt{LaTeX Warning: Float too large for page by 1.0pt}'' in \texttt{sideways} floats.
3178 % (This is not necessary since \package{hyperref} \version{6.77}.)}
3179 % \begin{macrocode}
3180 \ifx\HyperRaiseLinkLength\@tempdima
3181 \def\caption@raisedlink#1{\ifvmode#1\else\Hy@raisedlink{#1}\fi}%
3182 \else
3183 \let\caption@raisedlink\Hy@raisedlink
3184 \fi
3185 % \end{macrocode}
3186 % \end{macro}
3187 %
3188 % \begin{macro}{\caption@@start}
3189 % Will be used by |\caption@freezeHref|. Apart from that we issue a warning
3190 % if we expect a saved \package{hyperref} label coming from |\caption@start|,
3191 % but there isn't any.
3192 % \begin{macrocode}
3193 \def\caption@@start{%
3194 \caption@ifundefined\hc@currentHref{%
3195 \caption@Warning{%
3196 The option `hypcap=true' will be ignored for this\MessageBreak
3197 particular \string\caption}}{}}%
3198 % \end{macrocode}
3199 % \end{macro}
3200 %
3201 % \begin{macro}{\caption@freezeHref}
3202 % Suppress |\caption@start| from generating a \package{hyperref} label and
3203 % setting a \package{hyperref} anchor. Instead if |\@caption| generates a
3204 % \package{hyperref} label, it will be stored in |\caption@currentHref|.
3205 % Furthermore we need to redefine |\caption@setfloatcapt| so no
3206 % \package{hyperref} anchor will be placed in |\@caption|.
3207 % \iffalse
3208 % (Since |\caption@setfloatcapt| will be set to |\@firstofone| inside
3209 % |\subcaption| there is no need to add its restauration to
3210 % |\caption@subtypehook|.)
3211 % \fi
3212 % \begin{macrocode}
3213 \def\caption@freezeHref{%
3214 \let\caption@ORI@start\caption@start
3215 \def\caption@start{\let\caption@start\caption@ORI@start}%
3216 % \end{macrocode}
3217 % \begin{macrocode}
3218 % \let\caption@ORI@@start\caption@@start
3219 % \l@addto@macro\caption@subtypehook{%
3220 % \let\caption@@start\caption@ORI@@start}%
3221 % \end{macrocode}
3222 % \begin{macrocode}
3223 \global\let\caption@currentHref\@undefined
3224 \def\caption@@start{\global\let\caption@currentHref\@currentHref}%
3225 % \end{macrocode}
3226 % \begin{macrocode}
3227 \let\caption@ORI@setfloatcapt\caption@setfloatcapt
3228 \renewcommand*\caption@setfloatcapt{%
3229 \ifx\caption@currentHref\@undefined \else
3230 \let\caption@makeanchor\@firstofone
3231 \fi
3232 \caption@ORI@setfloatcapt}}%
3233 % \end{macrocode}
3234 % \end{macro}
3235 %
3236 % \begin{macro}{\caption@defrostHref}
3237 % If there is a freezed |\@currentHref|, we set the \package{hyperref}
3238 % anchor here.
3239 % \begin{macrocode}
3240 \def\caption@defrostHref{%
3241 \ifx\caption@currentHref\@undefined \else
3242 \caption@startanchor\caption@currentHref
3243 \global\let\caption@currentHref\@undefined
3244 \fi}%
3245 % \end{macrocode}
3246 % \end{macro}
3247 %
3248 % \begin{macrocode}
3249 }}{}
3250 % \end{macrocode}
3251 %
3252 % \subsection{The hypcap package}
3253 % \changes{v3.0f}{2005/06/22}{Support of the \package{hypcap} package added}
3254 % \changes{v3.0l}{2007/02/20}{Adapted to \package{hypcap} \version{1.6}}
3255 % \changes{v3.1e}{2007/11/04}{\package{hypcap} support adapted to \package{hyperref} \version{6.77}}
3256 %
3257 % \begin{macrocode}
3258 \caption@IfPackageLoaded{hypcap}{% v1.0
3259 \ifx\caption@start\relax \else % hyperref hasn't stopped early
3260 % \end{macrocode}
3261 %
3262 % If the \package{hypcap} package was loaded, we give up our own
3263 % hyperlink placement algorithm and give the control over the placement
3264 % to the \package{hypcap} package instead.
3265 %
3266 % \begin{macro}{\capstart}
3267 % \changes{v3.1k}{2009/10/09}{Support of \cs{ifcapstart} (\package{hypcap} package \version{1.10}) added}
3268 % We do this simply by mapping |\capstart| to |\caption@start@|,
3269 % although our code does not behave exactly like the original one:
3270 % The original |\capstart| has an effect on the next |\caption|
3271 % only but our version affects \emph{all} |\caption|s in the same
3272 % environment, at least unless a new |\capstart| will be placed.
3273 % \begin{macrocode}
3274 \let\caption@ORI@capstart\capstart % save for compatibility mode
3275 \caption@ifundefined\capstarttrue % check for v1.10 of hypcap package
3276 {\def\capstart{\caption@start@}}%
3277 {\def\capstart{\ifcapstart\caption@start@\fi}}%
3278 \let\caption@start\relax
3279 \let\caption@@start\relax
3280 % \end{macrocode}
3281 % \end{macro}
3282 %
3283 % \begin{macro}{\caption@hypcapspace}
3284 % Furthermore we map our |\caption@hypcapspace| to |\hypcapspace|
3285 % offered by the \package{hypcap} package.
3286 % \begin{macrocode}
3287 \caption@set@bool\caption@ifhypcap 1%
3288 \renewcommand*\caption@hypcapspace{\hypcapspace}%
3289 % \end{macrocode}
3290 % \end{macro}
3291 %
3292 % \begin{macrocode}
3293 \fi}{}
3294 % \end{macrocode}
3295 %
3296 % \subsection{The listings package}
3297 % \changes{v3.0b}{2004/05/16}{Support of the \package{listings} package added}
3298 %
3299 % \begin{macrocode}
3300 \caption@IfPackageLoaded{listings}[2004/02/13 v1.2]{%
3301 % \end{macrocode}
3302 %
3303 % \begin{macro}{\lst@MakeCaption}
3304 % \changes{v3.1g}{2008/01/20}{Bugfix: Skips are handled correctly now}
3305 % \changes{v3.1k}{2008/03/29}{Bugfix 08-10-16-dctt: \texttt{rule=0} added}
3306 % \changes{v3.2}{2010/10/26}{Bugfix 10-07-20a: Set \cs{hsize} to \cs{linewidth}, if necessary}
3307 % \changes{v3.4c}{2020/01/01}{Ugly workaround for usage in lists added}
3308 % \changes{v3.4d}{2020/01/01}{Ugly workaround for usage in lists revised}
3309 % To support the \package{listings} package we need to redefine
3310 % |\lst@Make|\-|Caption| so the original stuff is nested with
3311 % |\caption@begin| and |\caption@end| etc.\par
3312 % We set a flag inside the "Init" hook of the \package{listings} package (where adaption of |\line|\-|width| etc.~takes place).
3313 % \begin{macrocode}
3314 \caption@setbool{lst@Init}{0}%
3315 \lst@AddToHook{Init}{\caption@setbool{lst@Init}{1}}%
3316 % \end{macrocode}
3317 % \begin{macrocode}
3318 \let\caption@ORI@lst@MakeCaption\lst@MakeCaption
3319 \def\lst@MakeCaption#1{% #1 is `t' or `b'
3320 % \end{macrocode}
3321 % This macro is always called twice by the \package{listings} package (with `t' resp. `b' as parameter),
3322 % therefore we need an extra group here.
3323 % \begin{macrocode}
3324 \begingroup
3325 % \end{macrocode}
3326 % Inside lists the \package{listings} package ignores the left margin (|\@total|\-|left|\-|margin|) for captions.
3327 % We emulate this behaviour by adding a negative skip which will be typeset ahead of |\caption@box|.\par
3328 % Note: We only need to do this if the ``Init'' hook of the \package{listings} package wasn't called yet.
3329 % \begin{macrocode}
3330 \caption@iflst@Init{}{%
3331 \edef\caption@lst@leftskip{\noexpand\hskip-\the\@totalleftmargin\noexpand\relax}%
3332 \l@addto@macro\caption@beginhook\caption@lst@leftskip}%
3333 % \end{macrocode}
3334 % We set |position=#1| and if it was set to `top',
3335 % we swap the skips so the default behavior of the \package{listings} package
3336 % will not be changed. (Note that the \package{listings} package has set its
3337 % own |\abovecaptionskip| \& |\belowcaptionskip| values prior to calling
3338 % \cs{lst@MakeCaption}.)
3339 % \begin{macrocode}
3340 \caption@setposition{#1}%
3341 \caption@iftop{%
3342 \@tempdima\belowcaptionskip
3343 \belowcaptionskip\abovecaptionskip
3344 \abovecaptionskip\@tempdima}{}%
3345 % \end{macrocode}
3346 % Workaround for issue with wrong skips (FIXME: This should be examined further)
3347 % \begin{macrocode}
3348 \caption@setup{rule=0}%
3349 % \end{macrocode}
3350 % Afterwards we set the local `lstlisting' options.
3351 % \begin{macrocode}
3352 \caption@setoptions{lstlisting}%
3353 % \end{macrocode}
3354 % If the |position=| is now set to |auto|, we take over the |captionpos=|
3355 % setting from the \package{listings} package.
3356 % \begin{macrocode}
3357 \caption@setautoposition{#1}%
3358 % \end{macrocode}
3359 % At the end we do similar stuff as in our \cs{@caption} code.
3360 % \begin{macrocode}
3361 \caption@begin{lstlisting}%
3362 \caption@ORI@lst@MakeCaption{#1}%
3363 \caption@end
3364 % \end{macrocode}
3365 % \begin{macrocode}
3366 \endgroup}%
3367 % \end{macrocode}
3368 % \end{macro}
3369 %
3370 % \begin{macro}{\lst@makecaption}
3371 % \begin{macro}{\lst@maketitle}
3372 % Wrapper macros for typesetting the |caption=| resp. |title=| value.
3373 % \begin{macrocode}
3374 \def\lst@makecaption{\caption@starfalse\@makecaption}%
3375 \def\lst@maketitle{\caption@startrue\@makecaption\@empty}%
3376 % \end{macrocode}
3377 % \end{macro}
3378 % \end{macro}
3379 %
3380 % \begin{macro}{\ext@lstlisting}
3381 % \changes{v3.1}{2007/03/03}{This macro added}
3382 % Since the \package{listings} package do not define |\ext@lstlisting|
3383 % but we needed it when |\captionof{lstlisting}| will be done by the end user,
3384 % we define it here.
3385 % \begin{macrocode}
3386 \providecommand*\ext@lstlisting{lol}%
3387 % \end{macrocode}
3388 % \end{macro}
3389 %
3390 % \changes{v3.1a}{2007/07/13}{Bugfix 07-09-13: \cs{lst@@caption} will not be re-defined anymore}
3391 %
3392 % \begin{macrocode}
3393 }{}
3394 % \end{macrocode}
3395 %
3396 % \subsection{The longtable package}
3397 %
3398 % \begin{macro}{\LTcaptype}
3399 % \changes{v3.1}{2007/07/06}{This macro and its support added}
3400 % |\LTcaptype| is preset to |table|.
3401 % \begin{macrocode}
3402 \providecommand*\LTcaptype{table}
3403 % \end{macrocode}
3404 % \end{macro}
3405 %
3406 % \begin{macrocode}
3407 \caption@IfPackageLoaded{longtable}[1995/05/24 v3.14]{%
3408 % \end{macrocode}
3409 % \begin{macrocode}
3410 \RequirePackage{ltcaption}[=2018/08/26]%
3411 \let\LT@@makecaption\@undefined
3412 % \end{macrocode}
3413 %
3414 % \begin{macro}{\LT@array}
3415 % \changes{v3.1}{2007/07/22}{This redefinition added}
3416 % \changes{v3.1a}{2007/09/14}{Bugfix 07-09-14: Redefinition of \cs{@captionabovetrue} \& \cs{@captionabovefalse} added}
3417 % \changes{v3.1a}{2007/09/16}{Bugfix: This redefinition will always be done \cs{AtBeginDocument}}
3418 % \changes{v3.1g}{2008/01/20}{Bugfix in \cs{captionlistentry}: Table counter will not be incremented anymore, \cs{nameref} works}
3419 % \changes{v3.3}{2016/01/31}{Support for \cs{bicaption} added}
3420 % \changes{v3.3}{2018/10/05}{Definition of \cs{captionlistentry} fixed}
3421 % We redefine |\LT@array| here to get |\captionsetup|\marg{options}
3422 % working inside |longtable|s.
3423 % \Note{Since the \package{hyperref} package patches \cs{LT@array} as well
3424 % and since this only works with the original definition of \cs{LT@array},
3425 % we have to do this after the \package{hyperref} package,
3426 % i.e.~\cs{AtBeginDocument}.}
3427 % \begin{macrocode}
3428 \caption@AtBeginDocument{%
3429 \let\caption@ORI@LT@array\LT@array
3430 \renewcommand*\LT@array{%
3431 % \end{macrocode}
3432 % |\captionsetup| for longtable:
3433 % \begin{macrocode}
3434 \global\let\caption@opt@@longtable\@undefined
3435 \def\captionsetup{%
3436 \noalign\bgroup
3437 \@ifstar\@captionsetup\@captionsetup}% gobble *
3438 \def\@captionsetup##1{\LT@captionsetup{##1}\egroup}%
3439 \def\LT@captionsetup##1{%
3440 \captionsetup@startrue\caption@setup@options[@longtable]{##1}%
3441 \global\let\caption@opt@@longtable\caption@opt@@longtable}%
3442 % \end{macrocode}
3443 % |\captionabove| \& |\captionbelow| for longtable: (\KOMAScript\ document class)
3444 % \begin{macrocode}
3445 \def\@captionabovetrue{\LT@captionsetup{position=t}}%
3446 \def\@captionabovefalse{\LT@captionsetup{position=b}}%
3447 % \end{macrocode}
3448 % |\captionlistentry| for longtable:
3449 % \begin{macrocode}
3450 \def\captionlistentry{%
3451 \noalign\bgroup
3452 \@ifstar{\egroup\LT@listentry\LTcaptype}% gobble *
3453 {\egroup\LT@listentry\LTcaptype}}%
3454 % \end{macrocode}
3455 % |\continuedfloat| for longtable:\\
3456 % {\small(Commented out, since it's not deeply tested and quite useless anyway)}
3457 % \Note{\package{hyperref} versions $<$ v6.76j uses $2\times$ \cs{hyper@makecurrent}}
3458 % \begin{macrocode}
3459 % \caption@ifhypcap{%
3460 % \let\caption@ORI@hyper@makecurrent\hyper@makecurrent
3461 % \def\hyper@makecurrent##1{%
3462 % \let\hyper@makecurrent\caption@ORI@hyper@makecurrent
3463 % \caption@makestart{##1}%
3464 %% \let\Hy@LT@currentHlabel\@currentHlabel
3465 % \let\Hy@LT@currentHref\@currentHref
3466 % \def\hyper@makecurrent####1{%
3467 %% \let\@currentHlabel\Hy@LT@currentHlabel
3468 % \let\@currentHref\Hy@LT@currentHref}}%
3469 % \let\caption@ORI@continuedfloat\continuedfloat
3470 % \def\continuedfloat{\noalign{%
3471 % \gdef\caption@setContinuedFloat{%
3472 % \let\caption@reset@continuedfloat\@gobble}%
3473 % \def\caption@setoptions####1{%
3474 % \g@addto@macro\caption@setContinuedFloat{%
3475 % \caption@setoptions{####1}}}%
3476 % \let\@captype\LTcaptype
3477 % \caption@ORI@ContinuedFloat}}%
3478 % }{%
3479 % \def\continuedfloat{\noalign{%
3480 % \caption@Error{%
3481 % \noexpand\continuedfloat inside longtables\MessageBreak
3482 % is only available with `hypcap=true'}}}%
3483 % }%
3484 % \global\let\caption@setContinuedFloat\@empty
3485 \def\continuedfloat{\noalign{%
3486 \caption@Error{\noexpand\continuedfloat outside float}}}%
3487 % \end{macrocode}
3488 % |\bicaption| for longtable:
3489 % \begin{macrocode}
3490 \let\bicaption\LT@bicaption
3491 % \end{macrocode}
3492 %
3493 % \begin{macrocode}
3494 \caption@ORI@LT@array}}%
3495 % \end{macrocode}
3496 % \end{macro}
3497 %
3498 % \begin{macro}{\LT@capti@n}
3499 % \changes{v3.3}{2016/02/01}{This re-definition added}
3500 % The original implementation:
3501 % \begin{verbatim}
3502 % \def\LT@capti@n{%
3503 % \@ifstar
3504 % {\egroup\LT@c@ption\@gobble[]}%
3505 % {\egroup\@xdblarg{\LT@c@ption\@firstofone}}}
3506 % \end{verbatim}%^^A
3507 % Our implementation uses |\caption@xdblarg| instead of |\@xdblarg|:
3508 % \begin{macrocode}
3509 \def\LT@capti@n{%
3510 \@ifstar
3511 {\egroup\LT@c@ption\@gobble[]}%
3512 {\egroup\caption@xdblarg{\LT@c@ption\@firstofone}}}%
3513 % \end{macrocode}
3514 % \end{macro}
3515 %
3516 % \begin{macro}{\LT@makecaption}
3517 % \changes{v3.0d}{2004/08/10}{%
3518 % Bugfix 04-08-04: \cs{abovecaptionskip} \& \cs{belowcaptionskip} will be used now}
3519 % \changes{v3.0e}{2005/05/05}{%
3520 % Bugfix: \cs{captionsetup[longtable]} overrides \cs{LTcapwidth} now}
3521 % \changes{v3.0h}{2005/10/07}{\cs{caption@LT@make} introduced}
3522 % \changes{v3.3}{2016/02/01}{Support for \cs{bicaption} via \cs{caption@LT@setup} added}
3523 % \changes{v3.3a}{2019/04/02}{Work-around for problem with \package{floatrow} added}
3524 % |\LT@makecaption|\marg{cmd}\marg{label}\marg{text}\par
3525 % \smallskip
3526 % The original definition:
3527 % \begin{verbatim}
3528 % \def\LT@makecaption#1#2#3{%
3529 % \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{%
3530 % % Based on article class "\@makecaption", "#1" is "\@gobble" in star
3531 % % form, and "\@firstofone" otherwise.
3532 % \sbox\@tempboxa{#1{#2: }#3}%
3533 % \ifdim\wd\@tempboxa>\hsize
3534 % #1{#2: }#3%
3535 % \else
3536 % \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
3537 % \fi
3538 % \endgraf\vskip\baselineskip}%
3539 % \hss}}}
3540 % \end{verbatim}%^^A
3541 % Our definition:
3542 % \begin{macrocode}
3543 \renewcommand\LT@makecaption[3]{%
3544 \caption@LT@make{%
3545 \caption@LT@settype\LTcaptype
3546 % \end{macrocode}
3547 %
3548 % |\caption@LT@setup| is re-defined inside the \package{bicaption} package
3549 % and contains the preparation of typesetting of the bilingual caption.
3550 % \begin{macrocode}
3551 \caption@LT@setup
3552 % \end{macrocode}
3553 %
3554 % \iffalse
3555 % The default |position=| setting for longtables is |top|.
3556 % (This emulates the standard behavior of the \package{longtable} package
3557 % which has no skip above the caption but a skip below it.)
3558 % \fi
3559 %
3560 % |position=auto| is a bad idea for longtables, but we do our very best.
3561 % This works quite well for captions inside the longtable contents, but
3562 % not for captions inside the longtable (end)foot.
3563 % \Note{This should be `top' if unclear!}
3564 % \begin{macrocode}
3565 \caption@setautoposition{\ifcase\LT@rows t\else b\fi}%
3566 % \end{macrocode}
3567 %
3568 % We set |\ifcaption@star| according the 1st argument.
3569 % \begin{macrocode}
3570 \caption@startrue#1\caption@starfalse
3571 % \end{macrocode}
3572 %
3573 % \begin{macrocode}
3574 \caption@prepare@stepcounter\LTcaptype{LT}%
3575 % \end{macrocode}
3576 %
3577 % \changes{v3.1}{2007/05/05}{\cs{caption@normalsize} added}
3578 % \begin{macrocode}
3579 \caption@begin\LTcaptype
3580 \caption@normalsize
3581 % \end{macrocode}
3582 %
3583 % The following skip has the purpose to correct the height of the
3584 % |\parbox[t]|. Usually it's the height of the very first line, but
3585 % because of our extra skips (|\abovecaptionskip| and |\belowcaptionskip|)
3586 % it's always |0pt|.\par
3587 % (A different idea would be typesetting the first skip outside the longtable
3588 % column with |\noalign{\vskip|\ldots|}|, but this means we have to move
3589 % |\caption@begin| to some other place because it does not work in tabular
3590 % mode. And at the moment I have no idea on how to do this in an elegant
3591 % way\ldots)
3592 % \begin{macrocode}
3593 \vskip-\ht\strutbox
3594 % \end{macrocode}
3595 %
3596 % Work-around for problem with \package{floatrow}:
3597 % The |\below|\-|caption|\-|skip| disturbs the environment in which the caption is actually typeset (by creating extra, unwanted space),
3598 % so we supress this skip if the \package{floatrow} package is loaded.
3599 % (This fixes \issue{50})
3600 % \begin{macrocode}
3601 \caption@ifdefined\FBifcaptop{%
3602 \let\caption@belowskip\@empty}{}%
3603 % \end{macrocode}
3604 %
3605 % The following code should look familiar. We do our skips and use
3606 % |\caption@@make| to typeset the caption itself.
3607 % \begin{macrocode}
3608 \caption@make@above
3609 \caption@@make{#2}{#3}\endgraf
3610 \caption@make@below
3611 \caption@end}}%
3612 % \end{macrocode}
3613 % \end{macro}
3614 %
3615 % \begin{macro}{\LT@listentry}
3616 % \changes{v3.3}{2018/08/26}{This macro added}
3617 % \changes{v3.3}{2018/10/05}{Bugfix: \cs{ignorespaces} added}
3618 % \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
3619 % \begin{macrocode}
3620 \renewcommand*\LT@listentry[2]{%
3621 \begingroup
3622 \caption@LT@settype{#1}%
3623 \caption@listentry\@firstoftwo[{#1}]{#2}%
3624 \endgroup\ignorespaces}%
3625 % \end{macrocode}
3626 % \end{macro}
3627 %
3628 % \begin{macro}{\caption@LT@settype}
3629 % \changes{v3.3}{2018/08/26}{This macro added}
3630 % \changes{v3.3}{2018/10/05}{Uses argument no. 1 instead of \cs{LTcaptype}}
3631 % \begin{macrocode}
3632 \newcommand*\caption@LT@settype[1]{%
3633 \caption@settype*{#1}%
3634 % \end{macrocode}
3635 % If |\LTcapwidth| is not set to its default value |4in| we assume
3636 % that it shall overwrite our own setting.
3637 % (But |\captionsetup[longtable]{width=|\ldots|}| will overwrite |\LTcapwidth|.)
3638 % \begin{macrocode}
3639 \ifdim\LTcapwidth=4in \else
3640 \setcaptionwidth\LTcapwidth
3641 \fi
3642 % \end{macrocode}
3643 % \begin{macrocode}
3644 \caption@setoptions{longtable}%
3645 % \caption@setContinuedFloat
3646 % \end{macrocode}
3647 % Finally set options applied by |\captionsetup| inside the longtable.
3648 % \begin{macrocode}
3649 \caption@setoptions{@longtable}}%
3650 % \end{macrocode}
3651 % \end{macro}
3652 %
3653 % \begin{macro}{\flrow@setlist}
3654 % \changes{v3.4g}{2020/01/03}{Redefinition of this macro added}
3655 % The \package{floatrow} package uses |\flrow@setlist{{table}{longtable}}| inside its redefinition of |\LT@array| without setting |\@captype| first,
3656 % and this makes |\captionsetup[table]{name=...}| doomed to fail for longtables (``Undefined control sequence'').
3657 % Unfortunately we cannot easily patch |\LT@array| again to fix this bug in \package{floatrow} since it will be patched |\AtBeginDocument|.
3658 % Therefore we patch |\flrow@setlist| instead to catch and fix the bug on-the-fly.
3659 % \begin{macrocode}
3660 \caption@AtBeginDocument{\caption@ifdefined\flrow@setlist@{%
3661 \caption@InfoNoLine{Fixing longtable code of `floatrow' package}%
3662 \let\caption@flrow@setlist@\flrow@setlist@
3663 \renewcommand\flrow@setlist@[1]{%
3664 \def\caption@tempa{{table}{longtable}}%
3665 \def\caption@tempb{#1}%
3666 \ifx\caption@tempa\caption@tempb
3667 \def\@captype{table}%
3668 \fi
3669 \caption@flrow@setlist@{#1}}%
3670 }{}}%
3671 % \end{macrocode}
3672 % \end{macro}
3673 %
3674 % \begin{macrocode}
3675 }{}
3676 % \end{macrocode}
3677 %
3678 % \begin{macro}{\caption@LT@setup}
3679 % \changes{v3.3}{2016/02/01}{This macro added}
3680 % Hook for stuff which prepares the typesetting of the \package{longtable} caption.
3681 % \begin{macrocode}
3682 \providecommand*\caption@LT@setup{}
3683 % \end{macrocode}
3684 % \end{macro}
3685 %
3686 % \subsection{The picinpar package}
3687 % \changes{v3.1}{2007/06/13}{Support of the \package{picinpar} package added}
3688 %
3689 % \begin{macrocode}
3690 \caption@IfPackageLoaded{picinpar}{%
3691 % \end{macrocode}
3692 %
3693 % \begin{macro}{\figwindow}
3694 % \begin{macro}{\tabwindow}
3695 % The \package{picinpar} package comes with its own caption code
3696 % (|\wincaption|, |\@wincaption|, |\@makewincaption|, \ldots)
3697 % so we redefine |\figwindow| \& |\tabwindow| to use |\caption| instead.
3698 % \begin{macrocode}
3699 \long\def\figwindow[#1,#2,#3,#4] {%
3700 \caption@window{figure}%
3701 \caption@setoptions{figwindow}%
3702 \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }%
3703 % \end{macrocode}
3704 % \begin{macrocode}
3705 \long\def\tabwindow[#1,#2,#3,#4] {%
3706 \caption@window{table}%
3707 \caption@setoptions{tabwindow}%
3708 \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }%
3709 % \end{macrocode}
3710 % \end{macro}
3711 % \end{macro}
3712 %
3713 % \begin{macro}{\caption@window}
3714 % \changes{v3.1c}{2007/10/06}{Bugfix: \cs{caption@clearmargin} added}
3715 % Beside calling |\caption@settype| we redefine |\caption@boxrestore|
3716 % (as in \package{floatflt} \& \package{picins} package support)
3717 % and |\@makecaption| (as in \package{float} package support) here.
3718 % \begin{macrocode}
3719 \newcommand*\caption@window[1]{%
3720 \let\@makecaption\caption@@make
3721 \caption@setautoposition b%
3722 \caption@settype{#1}%
3723 \caption@clearmargin
3724 \caption@setfullparboxrestore}%
3725 % \end{macrocode}
3726 % \end{macro}
3727 %
3728 % \begin{macro}{\caption@wincaption}
3729 % \changes{v3.1d}{2007/10/25}{Missing \% added}
3730 % \changes{v3.3}{2013/04/14}{\cs{caption@ContinuedFloattrue} added}
3731 % \changes{v3.3}{2018/10/06}{\cs{caption@ContinuedFloattrue} replaced by \cs{caption@setflag1}}
3732 % This one finally typesets the caption using |\caption|.
3733 % \begin{macrocode}
3734 \newcommand\caption@wincaption[1]{%
3735 % \end{macrocode}
3736 % This will be done twice for every |figwindow| \& |tabwindow| caption --
3737 % on the first run |\picwd| is |0pt|, on the second run |\picwd| is |\hsize|.
3738 % \begin{macrocode}
3739 \ifdim\picwd=\z@
3740 \let\caption@makecurrent\@gobbletwo
3741 \let\caption@@start\relax
3742 \caption@prepareslc
3743 \else
3744 \caption@setflag1%
3745 \fi
3746 % \end{macrocode}
3747 % The argument |#1| could contain simply the caption text
3748 % (e.g.~|A figure caption|), but it could also contain an optional argument,
3749 % the \meta{lst\_entry}
3750 % (e.g.~|[An| |entry| |to| |the| |LOF]||{A| |figure| |caption}|).
3751 % Therefore we have to test if |#1| begins with~|[| or not; furthermore we
3752 % support a starred variant -- as in |\caption*| -- so we test for~|*|, too.
3753 % \begin{macrocode}
3754 \edef\@tempa{\expandafter\noexpand\@car#1\@nil}%
3755 \if\@tempa*%
3756 \let\@tempa\@firstofone
3757 \else\if\@tempa[%]
3758 \let\@tempa\@firstofone
3759 \else
3760 \let\@tempa\@empty
3761 \fi\fi
3762 \expandafter\caption\@tempa{#1}}%
3763 % \end{macrocode}
3764 % \end{macro}
3765 %
3766 % \begin{macrocode}
3767 }{}
3768 % \end{macrocode}
3769 %
3770 % \subsection{The picins package}
3771 % \changes{v3.0j}{2006/01/26}{Support of the \package{picins} package added}
3772 %
3773 % \begin{macro}{\piccaptiontype}
3774 % |\piccaptiontype|\marg{type}\par
3775 % We offer this macro for changing the \meta{type} of the caption, so the user
3776 % doesn't have to redefine |\@captype|, as proposed in the \package{picins}
3777 % documentation.
3778 % \Note{We define this macro here so it can be used in the
3779 % preamble of the document, even when \thispackage\ was loaded prior to the
3780 % \package{picins} package.}
3781 % \begin{macrocode}
3782 \newcommand*\piccaptiontype[1]{\def\@piccaptype{#1}}
3783 % \end{macrocode}
3784 % \end{macro}
3785 %
3786 % \begin{macrocode}
3787 \caption@IfPackageLoaded{picins}{%
3788 % \end{macrocode}
3789 %
3790 % Initial set |\@piccaptype| and undefine |\@captype| which was set to
3791 % |figure| by the \package{picins} package.
3792 % \begin{macrocode}
3793 \caption@ifundefined\@piccaptype{%
3794 \caption@iftype{%
3795 \let\@piccaptype\@captype
3796 }{%
3797 \def\@piccaptype{figure}%
3798 }%
3799 }{}%
3800 \let\@captype\@undefined
3801 % \end{macrocode}
3802 %
3803 % \begin{macro}{\piccaption}
3804 % The original code:
3805 % \begin{verbatim}
3806 % \def\piccaption{\@ifnextchar [{\@piccaption}{\@piccaption[]}}
3807 % \end{verbatim}%^^A
3808 % Our code uses |\caption@star| so |\piccaption*| works,
3809 % and |\caption@dblarg| so |\piccaption{}| works correctly.
3810 % \begin{macrocode}
3811 \def\piccaption{\caption@star\relax{\caption@dblarg\@piccaption}}%
3812 % \end{macrocode}
3813 % \end{macro}
3814 %
3815 % \begin{macro}{\make@piccaption}
3816 % \changes{v3.1}{2007/12/06}{Bugfix: \cs{caption@clearmargin} will always be used now}
3817 % The original code:
3818 % \begin{verbatim}
3819 % \def\make@piccaption{%
3820 % [...]
3821 % \setbox\@TEXT=\vbox{\hsize\hsiz@\caption[\sh@rtf@rm]{\capti@nt@xt}}%
3822 % }
3823 % \end{verbatim}%^^A
3824 % In our code we have to correct several things:
3825 % \begin{enumerate}
3826 % \item |\@captype| must be defined, since we have removed the global
3827 % definition.
3828 % \item We use |\caption@setoptions{parpic}| so
3829 % |\captionsetup[parpic]{|\ldots|}| is supported.
3830 % \item |\linewidth| must be set correctly.
3831 % Usually this is done by |\@parboxrestore| inside |\@caption|,
3832 % but since we use |\@caption@boxrestore| we have to map this to
3833 % |\@parboxrestore| instead.
3834 % \item The two arguments of |\caption| (|\sh@rtf@rm| \& |\capti@nt@xt|)
3835 % should be expanded on first level so |\caption[]{|\ldots|}| and
3836 % |\caption[|\ldots|]{}| work correctly.
3837 % \end{enumerate}
3838 % \begin{macrocode}
3839 \let\caption@ORI@make@piccaption\make@piccaption
3840 \def\make@piccaption{%
3841 \let\caption@ORI\caption
3842 % \end{macrocode}
3843 % \begin{macrocode}
3844 \long\def\caption[##1]##2{%
3845 \caption@freezeHref % will be defrosted in \ivparpic
3846 \caption@settype\@piccaptype
3847 % \ifnum\c@piccaptionpos>2\relax
3848 \caption@clearmargin
3849 % \else
3850 % \captionwidth\z@ % do not use "width=" setting
3851 % \fi
3852 \caption@setfullparboxrestore
3853 \caption@setoptions{parpic}%
3854 \caption@setautoposition b%
3855 % \end{macrocode}
3856 % \begin{macrocode}
3857 \expandafter\expandafter\expandafter\caption@ORI
3858 \expandafter\expandafter\expandafter[%
3859 \expandafter\expandafter\expandafter{%
3860 \expandafter##1\expandafter}\expandafter]\expandafter{##2}}%
3861 % \end{macrocode}
3862 % {\footnotesize\begin{quote}
3863 % \leavevmode\llap{-or-\quad}%^^A
3864 % |\begingroup|\\
3865 % | \toks0\expandafter{##1}| |\toks2\expandafter{##2}|\\
3866 % | \edef\x{\endgroup|\\
3867 % | \noexpand\caption@ORI[{\the\toks0}]{\the\toks2}}|\\
3868 % | \x|
3869 % \end{quote}
3870 % \begin{quote}
3871 % \leavevmode\llap{-or-\quad}%^^A
3872 % |\edef\x{%|\\
3873 % | \noexpand\caption@ORI[{\unexpanded\expandafter{##1}}]%|\\
3874 % | {\unexpanded\expandafter{##2}}}|\\
3875 % |\-|
3876 % \end{quote}}
3877 % \begin{macrocode}
3878 \caption@ORI@make@piccaption
3879 \let\caption\caption@ORI}%
3880 % \end{macrocode}
3881 % \end{macro}
3882 %
3883
3884 % \begin{macro}{\ivparpic}
3885 % \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
3886 % We need to set our \package{hyperref} anchor here.
3887 % Not bullet-proof since we have to redefine |\noindent| here!
3888 % \begin{macrocode}
3889 \let\caption@ORI@ivparpic\ivparpic
3890 \def\ivparpic(#1,#2)(#3,#4)[#5][#6]#7{%
3891 \let\caption@ORI@noindent\noindent
3892 \def\noindent{%
3893 \caption@defrostHref
3894 \let\noindent\caption@ORI@noindent
3895 \noindent}%
3896 \caption@ORI@ivparpic(#1,#2)(#3,#4)[{#5}][{#6}]{#7}%
3897 \let\noindent\caption@ORI@noindent}%
3898 % \end{macrocode}
3899 % \end{macro}
3900 %
3901 % \begin{macrocode}
3902 }{%
3903 \let\piccaptiontype\@undefined
3904 }
3905 % \end{macrocode}
3906 %
3907 % \subsection{The rotating package}
3908 %
3909 % \begin{macrocode}
3910 \caption@IfPackageLoaded{rotating}[1995/08/22 v2.10]{%
3911 % \end{macrocode}
3912 %
3913 % \begin{macro}{\rotcaption}
3914 % \changes{v3.0c}{2004/07/16}{Bugfix: Check for \cs{caption@star} removed}
3915 % \changes{v3.0i}{2005/12/07}{Rewritten, works with \package{hyperref} now}
3916 % Make |\rotcaption*| work.
3917 % \begin{macrocode}
3918 \def\rotcaption{\let\@makecaption\@makerotcaption\caption}%
3919 % \let\@rotcaption\@undefined
3920 % \end{macrocode}
3921 % \end{macro}
3922 %
3923 % \begin{macro}{\rotcaptionof}
3924 % \changes{v3.0i}{2005/12/07}{New}
3925 % Make |\rotcaptionof(*)| work.
3926 % \begin{macrocode}
3927 \def\rotcaptionof{%
3928 \caption@teststar\caption@of{\rotcaption*}\rotcaption}%
3929 % \end{macrocode}
3930 % \end{macro}
3931 %
3932 % \begin{macro}{\@makerotcaption}
3933 % \changes{v3.0i}{2005/12/06}{Rewritten, should finally work proper now}
3934 % \changes{v3.0m}{2007/03/04}{Uses \cs{caption@parbox} instead of \cs{caption@start/endbox} now}
3935 % \changes{v3.3}{2012/12/26}{Rewritten (again)}
3936 % Original (bugfixed) code:
3937 % \begin{verbatim}
3938 % \long\def\@makerotcaption#1#2{%
3939 % \setbox\@tempboxa\hbox{#1: #2}%
3940 % \ifdim \wd\@tempboxa > .8\vsize
3941 % \rotatebox{90}{%
3942 % \begin{minipage}{.8\textheight}#1: #2\end{minipage}%
3943 % }%\par % <== \par removed (AR)
3944 % \else%
3945 % \rotatebox{90}{\box\@tempboxa}%
3946 % \fi
3947 % \nobreak\hspace{12pt}% <== \nobreak added (AR)
3948 % }
3949 % \end{verbatim}%^^A
3950 % Our version emulates this behavior, but if |width=| is set,
3951 % the rotated caption is always typeset as |\parbox|.
3952 % (Note that |margin=| is not supported here.)
3953 % \begin{macrocode}
3954 \long\def\@makerotcaption#1#2{%
3955 \rotatebox{90}{%
3956 \ifdim\captionwidth=\z@
3957 \setcaptionwidth{.8\vsize}%
3958 \l@addto@macro\caption@singleline{%
3959 \caption@setup{parbox=none}}%
3960 \fi
3961 \let\caption@calcmargin\relax
3962 \caption@@make{#1}{#2}}%
3963 \nobreak\hspace{12pt}}%
3964 % \end{macrocode}
3965 % \end{macro}
3966 %
3967 % \begin{macrocode}
3968 }{}
3969 % \end{macrocode}
3970 %
3971 % \subsection{The sidecap package}
3972 %
3973 % \begin{macrocode}
3974 \caption@IfPackageLoaded{sidecap}[2003/06/06 v1.6f]{%
3975 \caption@setbool{needfreeze}{1}%
3976 % \end{macrocode}
3977 %
3978 % \begin{macro}{\SC@zfloat}
3979 % \changes{v3.0b}{2004/05/16}{Local definition of \cs{captionsetup} added}
3980 % \changes{v3.0c}{2004/07/16}{Bugfix 04-07-15: Check for \cs{caption@star} removed}
3981 % \changes{v3.1c}{2007/10/06}{\cs{caption} will be saved \& restored now}
3982 % \changes{v3.2a}{2011/08/17}{Bugfix: Uses \cs{caption@freeze} instead of \cs{caption@freeze*} now}
3983 % \changes{v3.3}{2013/05/01}{Usage of \cs{caption@freeze} replaced by \cs{caption@freezetype}}
3984 % \changes{v3.4o}{2022/07/10}{\cs{ignorespaces} appended}
3985 % This macro will be called at the start of the environment, here is a good
3986 % opportunity to do some adaptations to |\caption| and |\captionsetup|.
3987 % \begin{macrocode}
3988 \let\caption@ORI@SC@zfloat\SC@zfloat
3989 \def\SC@zfloat#1#2#3[#4]{%
3990 % \end{macrocode}
3991 % First we use the original definition, but restore \cs{caption} and \cs{label}
3992 % so \cs{caption@freeze} and \cs{caption@warmup} will work correctly.
3993 % \begin{macrocode}
3994 \caption@ORI@SC@zfloat{#1}{#2}{#3}[#4]%
3995 \SC@RestoreCommands
3996 % \end{macrocode}
3997 % Since the sidecap package uses our |\caption| code outside the
3998 % environment the regular |\caption|\-|setup| will not work.
3999 % So we need a special version here which saves the given argument list
4000 % which will be executed later on.
4001 % Furthermore we need to make |\caption*| work.
4002 % \begin{macrocode}
4003 \caption@freezetype{#2}%
4004 % \end{macrocode}
4005 % The sidecap package uses |\ifx\label\SC@label| to test if it is just inside a
4006 % |SC|\-|figure| or not. So we redefine |\SC@label| here so this test will still work.
4007 % \begin{macrocode}
4008 \let\SC@label\label
4009 % \end{macrocode}
4010 % Since the original definition of |\SC@zfloat| ends with |\begin{lrbox}| which ends with |\ignore|\-|spaces|,
4011 % we do have to end our re-definition of |\SC@zfloat| with |\ignore|\-|spaces| as well.
4012 % \begin{macrocode}
4013 \ignorespaces}%
4014 % \end{macrocode}
4015 % \begin{macrocode}
4016 \providecommand*\SC@RestoreCommands{%
4017 \let\caption=\SC@orig@caption \let\label=\SC@orig@label}%
4018 % \end{macrocode}
4019 % \end{macro}
4020 %
4021 % \begin{macro}{\endSC@FLOAT}
4022 % \changes{v3.0i}{2006/01/12}{\cs{@listdepth}\cs{z@} added}
4023 % \changes{v3.1}{2007/05/05}{Call of \cs{caption@setoptions}\arg{SCfloat} added}
4024 % This macro will be called at the end of the environment, here we need to
4025 % setup our stuff before the \package{sidecap} package actually typesets
4026 % its caption.
4027 % \begin{macrocode}
4028 \let\caption@ORI@endSC@FLOAT\endSC@FLOAT
4029 \def\endSC@FLOAT{%
4030 % \end{macrocode}
4031 % Before we can typeset the caption we need to set the margin to zero
4032 % because any extra margin would only be disturbing here.\par
4033 % (We don't need to take care about the caption position because
4034 % the sidecap package set both |\abovecaptionskip| and |\belowcaptionskip|
4035 % to a skip of zero anyway.)\par
4036 % Furthermore |\SC@justify| will override the caption justification, if set.
4037 % The usage of |\SC@justify| differs from version to version of the
4038 % \package{sidecap} package:\par
4039 % \begin{tabular}{ll}
4040 % Version 1.4: & |\SC@justify| is not defined\\
4041 % Version 1.5: & |\SC@justify| is |\relax| when not set\\
4042 % Version 1.6: & |\SC@justify| is |\@empty| when not set\\
4043 % \end{tabular}
4044 % \begin{macrocode}
4045 \def\caption@setSC@justify{%
4046 \caption@clearmargin
4047 \ifx\SC@justify\@empty \else
4048 \let\caption@hj\SC@justify
4049 \let\SC@justify\@empty
4050 \fi}%
4051 % \end{macrocode}
4052 % Make the original definition of |\endSC@FLOAT| to use our caption
4053 % stuff instead of its own.
4054 % \Note{At this point the \package{sidecap} definition of \cs{caption} is valid,
4055 % not the regular one!}
4056 % \begin{macrocode}
4057 \let\caption\SC@orig@caption
4058 \def\SC@orig@caption[##1]##2{%
4059 \caption@setSC@justify
4060 %%% \caption@setoptions{SC}%
4061 \caption@setoptions{SC\@captype}%
4062 \caption@defrost}%
4063 % \end{macrocode}
4064 % Finally we call the original definition of |\endSC@FLOAT|.
4065 % \begin{macrocode}
4066 \caption@setSC@justify % for compatibility mode
4067 \caption@prepare@defrost
4068 \caption@ORI@endSC@FLOAT}%
4069 % \end{macrocode}
4070 % \end{macro}
4071 %
4072 % \begin{macrocode}
4073 }{}
4074 % \end{macrocode}
4075 %
4076 % \subsection{The subfigure package}
4077 % \changes{v3.1}{2007/04/06}{subfigure package support added}
4078 %
4079 % \begin{macrocode}
4080 \caption@IfPackageLoaded{subfigure}[2002/01/23 v2.1]{%
4081 % \end{macrocode}
4082 %
4083 % \begin{macro}{\sf@ifpositiontop}
4084 % \changes{v3.1a}{2007/09/15}{Bugfix 07-09-15: Check for \cs{@captype} added}
4085 % If the \package{subfigure} package is loaded, we map |\sf@ifpositiontop|
4086 % to |\iffiguretopcap| resp. |\iftabletopcap|, so the \package{subfigure}
4087 % \version{2.1} options \opt{figbotcap} etc. will still work.
4088 % \begin{macrocode}
4089 \def\sf@ifpositiontop{%
4090 \ifx\@captype\@undefined
4091 \expandafter\@gobbletwo
4092 \else\ifx\@captype\relax
4093 \expandafter\expandafter\expandafter\@gobbletwo
4094 \else
4095 \expandafter\expandafter\expandafter\sf@if@position@top
4096 \fi\fi}
4097 % \end{macrocode}
4098 % \begin{macrocode}
4099 \def\sf@if@position@top{%
4100 \@ifundefined{if\@captype topcap}%
4101 {\@gobbletwo}%
4102 {\@nameuse{if\@captype topcap}%
4103 \expandafter\@firstoftwo
4104 \else
4105 \expandafter\@secondoftwo
4106 \fi}}
4107 % \end{macrocode}
4108 % \end{macro}
4109 %
4110 % \begin{macrocode}
4111 }{}
4112 % \end{macrocode}
4113 %
4114 % \subsection{The supertabular and xtab packages}
4115 %
4116 % \begin{macrocode}
4117 \caption@IfPackageLoaded{supertabular}[2002/07/19 v4.1e]{%
4118 % \end{macrocode}
4119 %
4120 % \begin{macro}{\tablecaption}
4121 % \changes{v3.0e}{2005/05/05}{Made \cs{topcaption*} and \cs{bottomcaption*} work}
4122 % \changes{v3.1h}{2008/04/01}{Bugfix: Star variant does not increment table counter anymore}
4123 % Make |\topcaption*| and |\bottomcaption*| work.
4124 % \begin{macrocode}
4125 \renewcommand*\tablecaption{%
4126 \caption@star
4127 {\refstepcounter{table}}%
4128 {\caption@dblarg{\@xtablecaption}}}%
4129 % \end{macrocode}
4130 % \end{macro}
4131 %
4132 % \begin{macro}{\@xtablecaption}
4133 % \changes{v3.1h}{2008/04/01}{Made \cs{nameref} \& \cs{autoref} work}
4134 % \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
4135 % \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
4136 % Make |\nameref| and |\autoref| work.
4137 % \begin{macrocode}
4138 \let\caption@ORI@xtablecaption\@xtablecaption
4139 \long\def\@xtablecaption[#1]#2{%
4140 \caption@gettitle{#2}%
4141 \caption@ORI@xtablecaption[{#1}]{#2}}%
4142 % \end{macrocode}
4143 % \end{macro}
4144 %
4145 % \begin{macro}{\ST@caption}
4146 % \changes{v3.0a}{2004/01/23}{Bugfix: Missing \cs{par} added}
4147 % \changes{v3.1h}{2008/04/01}{Bugfix: \cs{@currentlabelname} will be set now}
4148 % The original code:
4149 % \begin{verbatim}
4150 % \long\def\ST@caption#1[#2]#3{\par%
4151 % \addcontentsline{\csname ext@#1\endcsname}{#1}%
4152 % {\protect\numberline{%
4153 % \csname the#1\endcsname}{\ignorespaces #2}}
4154 % \begingroup
4155 % \@parboxrestore
4156 % \normalsize
4157 % \if@topcaption \vskip -10\p@ \fi
4158 % \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
4159 % \if@topcaption \vskip 10\p@ \fi
4160 % \endgroup}
4161 % \end{verbatim}%^^A
4162 % \begin{macrocode}
4163 \long\def\ST@caption#1[#2]#3{\par%
4164 \caption@settype*{#1}%
4165 \caption@setoptions{supertabular}%
4166 % \end{macrocode}
4167 % The |position=| setting will be overwritten by the
4168 % \package{supertabular} package: If |\topcaption| was used,
4169 % the position will be |top| automatically, |bottom| otherwise.
4170 % \begin{macrocode}
4171 \def\caption@fixposition{%
4172 \caption@setposition{\if@topcaption t\else b\fi}}%
4173 % \end{macrocode}
4174 % \begin{macrocode}
4175 \caption@beginex{#1}{#2}{#3}%
4176 \caption@boxrestore
4177 \caption@normalsize
4178 \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
4179 \caption@end}%
4180 % \end{macrocode}
4181 % \end{macro}
4182 %
4183 % \begin{macrocode}
4184 }{}
4185 % \end{macrocode}
4186 %
4187 % \changes{v3.1h}{2008/04/01}{Support of the xtab package added}
4188 % \begin{macrocode}
4189 \caption@IfPackageLoaded{xtab}[2000/04/09 v2.3]{%
4190 % \end{macrocode}
4191 %
4192 % \begin{macro}{\tablecaption}
4193 % Make |\topcaption*| and |\bottomcaption*| work.
4194 % \begin{macrocode}
4195 \renewcommand*\tablecaption{%
4196 \caption@star
4197 {\refstepcounter{table}}%
4198 {\caption@dblarg{\@xtablecaption}}}%
4199 % \end{macrocode}
4200 % \end{macro}
4201 %
4202 % \begin{macro}{\@xtablecaption}
4203 % \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
4204 % \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
4205 % Make |\nameref| and |\autoref| work.
4206 % \begin{macrocode}
4207 \let\caption@ORI@xtablecaption\@xtablecaption
4208 \long\def\@xtablecaption[#1]#2{%
4209 \caption@gettitle{#2}%
4210 \caption@ORI@xtablecaption[{#1}]{#2}}%
4211 % \end{macrocode}
4212 % \end{macro}
4213 %
4214 % \begin{macro}{\ST@caption}
4215 % The original code:
4216 % \begin{verbatim}
4217 % \long\def\ST@caption#1[#2]#3{\par%
4218 % \@initisotab
4219 % \addcontentsline{\csname ext@#1\endcsname}{#1}%
4220 % {\protect\numberline{%
4221 % \csname the#1\endcsname}{\ignorespaces #2}}%
4222 % \begingroup
4223 % \@parboxrestore
4224 % \normalsize
4225 % %% \if@topcaption \vskip -10\p@ \fi
4226 % \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
4227 % %% \if@topcaption \vskip 10\p@ \fi
4228 % \endgroup
4229 % \global\advance\ST@pageleft -\PWSTcapht
4230 % \ST@trace\tw@{Added caption. Space left for xtabular: \the\ST@pageleft}}
4231 % \end{verbatim}%^^A
4232 % \begin{macrocode}
4233 \long\def\ST@caption#1[#2]#3{\par%
4234 \caption@settype*{#1}%
4235 \caption@setoptions{xtabular}%
4236 % \end{macrocode}
4237 % \begin{macrocode}
4238 \def\caption@fixposition{%
4239 \caption@setposition{\if@topcaption t\else b\fi}}%
4240 % \end{macrocode}
4241 % \begin{macrocode}
4242 \@initisotab
4243 \caption@beginex{#1}{#2}{#3}%
4244 \caption@boxrestore
4245 \caption@normalsize
4246 \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
4247 \caption@end
4248 \global\advance\ST@pageleft -\PWSTcapht
4249 \ST@trace\tw@{Added caption. Space left for xtabular: \the\ST@pageleft}}%
4250 % \end{macrocode}
4251 % \end{macro}
4252 %
4253 % \begin{macrocode}
4254 }{}
4255 % \end{macrocode}
4256 %
4257 % \subsection{The threeparttable package}
4258 % \changes{v3.1}{2007/05/08}{Support of the \package{threeparttable} package added}
4259 %
4260 % \begin{macrocode}
4261 \caption@IfPackageLoaded{threeparttable}[2003/06/13 v3.0]{%
4262 % \end{macrocode}
4263 %
4264 % \begin{macro}{\threeparttable}
4265 % \changes{v3.3}{2016/01/31}{Bugfix: \cs{@captype} will be used if already defined}
4266 % Unfortunately |\@captype| is not set when |\TPT@common| will be used,
4267 % so we have to redefine |\threeparttable| and |\measuredfigure| instead.
4268 % \begin{macrocode}
4269 \let\caption@ORI@threeparttable\threeparttable
4270 \renewcommand*\threeparttable{%
4271 \caption@settype{\@ifundefined{@captype}{table}{\@captype}}%
4272 %%% \caption@setposition a% ?
4273 \caption@clearmargin
4274 \caption@setoptions{threeparttable}%
4275 \caption@ORI@threeparttable}%
4276 % \end{macrocode}
4277 % \end{macro}
4278 % \begin{macro}{\measuredfigure}
4279 % \changes{v3.3}{2016/01/31}{Bugfix: \cs{@captype} will be used if already defined}
4280 % Same here\ldots
4281 % \begin{macrocode}
4282 \let\caption@ORI@measuredfigure\measuredfigure
4283 \renewcommand*\measuredfigure{%
4284 \caption@settype{\@ifundefined{@captype}{figure}{\@captype}}%
4285 %%% \caption@setposition a% ?
4286 \caption@clearmargin
4287 \caption@setoptions{measuredfigure}%
4288 \caption@ORI@measuredfigure}%
4289 % \end{macrocode}
4290 % \end{macro}
4291 %
4292 % \begin{macro}{\TPT@caption}
4293 % The original code:
4294 % \begin{verbatim}
4295 % \def\TPT@caption#1[#2]#3{\gdef\TPT@docapt
4296 % {\par\global\let\TPT@docapt\@undefined \TPT@LA@caption{#1}[{#2}]%
4297 % {\strut\ignorespaces#3\ifhmode\unskip\@finalstrut\strutbox\fi}}%
4298 % \ifx\TPT@hsize\@empty \let\label\TPT@gatherlabel \abovecaptionskip\z@skip
4299 % \else \TPT@docapt \fi \ignorespaces}
4300 % \end{verbatim}%^^A
4301 % \begin{macrocode}
4302 \def\TPT@caption#1[#2]#3{%
4303 \gdef\TPT@docapt{%
4304 \global\let\TPT@docapt\@undefined
4305 \caption@setautoposition\caption@TPT@position
4306 \TPT@LA@caption{#1}[{#2}]{#3}}%
4307 \ifx\TPT@hsize\@empty
4308 \let\label\TPT@gatherlabel % Bug: does not work for measuredfigures
4309 \gdef\caption@TPT@position{t}%
4310 \g@addto@macro\TPT@docapt\caption@TPT@eatvskip
4311 \else
4312 \def\caption@TPT@position{b}%
4313 \TPT@docapt
4314 \fi
4315 \ignorespaces}%
4316 % \end{macrocode}
4317 % \begin{macrocode}
4318 %\newcommand*\caption@TPT@eatvskip{\vskip-.2\baselineskip}%
4319 \def\caption@TPT@eatvskip#1\vskip{#1\@tempdima=}%
4320 % \end{macrocode}
4321 % \end{macro}
4322 %
4323 % \begin{macrocode}
4324 }{}
4325 % \end{macrocode}
4326 %
4327 % \subsection{The wrapfig package}
4328 % \changes{v3.1}{2007/05/05}{Support of the \package{wrapfig} package added}
4329 % \changes{v3.2d}{2011/11/02}{Support of the \package{wrapfig} package rewritten}
4330 %
4331 % \begin{macrocode}
4332 \caption@IfPackageLoaded{wrapfig}[2003/01/31 v3.6]{%
4333 % \end{macrocode}
4334 %
4335 % \begin{macro}{\wrapfloat}
4336 % \changes{v3.2d}{2011/11/02}{Redefinition of this macro added}
4337 % First of all we make the \package{wrapfig} package independent from the package
4338 % load order regarding the \package{float} package.
4339 % Since the usage of |\@float@set|\-|every| is missing in the code of the \package{wrapfig}
4340 % package (it should be in the redefinition of |\float@re|\-|style|, right after
4341 % |\@nameuse{fst@#1}|), we don't use it here, too,
4342 % especially since |\wrap|\-|float| will usually not be used when used with re-styled floats.
4343 % \begin{macrocode}
4344 \renewcommand*\wrapfloat[1]{%
4345 \def\@captype{#1}%
4346 \@ifundefined{fst@#1}{}{%
4347 \@nameuse{fst@#1}%
4348 % \@float@setevery{#1}%
4349 \def\WF@floatstyhook{\let\@currbox\WF@box
4350 \global\setbox\WF@box\float@makebox{\wd\WF@box}}}%
4351 \@ifnextchar[\WF@wr{\WF@wr[]}}
4352 % \end{macrocode}
4353 % \end{macro}
4354 %
4355 % \begin{macro}{\WF@rapt}
4356 % \changes{v3.2d}{2011/11/02}{Usage of \cs{WF@captionstyhook} added}
4357 % Original code:
4358 % \begin{verbatim}
4359 % \def\WF@rapt[#1]#2{% final two args: #1 = overhang, #2 = width,
4360 % \gdef\WF@ovh{#1}% hold overhang for later, when \width is known
4361 % \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}%
4362 % \ifdim\hsize>\z@ \@parboxrestore \else
4363 % \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption
4364 % \ignorespaces \fi}
4365 % \end{verbatim}%^^A
4366 % Our code has |\WF@captionstyhook| in addition:
4367 % \begin{macrocode}
4368 \def\WF@rapt[#1]#2{% final two args: #1 = overhang, #2 = width,
4369 \gdef\WF@ovh{#1}% hold overhang for later, when \width is known
4370 \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}%
4371 \expandafter\WF@captionstyhook\expandafter{\@captype}% <= new
4372 \ifdim\hsize>\z@ \@parboxrestore \else
4373 \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption
4374 \ignorespaces \fi}%
4375 % \end{macrocode}
4376 % \end{macro}
4377 %
4378 % \begin{macro}{\WF@captionstyhook}
4379 % \changes{v3.2d}{2011/11/02}{This macro added}
4380 % \changes{v3.2e}{2011/11/10}{Bugfix 11-11-09: float package support fixed}
4381 % We place our \package{hyperref} anchor here, apply the `wrap' options etc.
4382 % Since the usage of |\@float@set|\-|every| is missing in the \package{wrapfig}
4383 % package we will catch it up here for making the necessary adaptions to the
4384 % \package{float} package.
4385 % \begin{macrocode}
4386 \def\WF@captionstyhook#1{%
4387 \let\@captype\@undefined
4388 \@ifundefined{fst@#1}{}{\@float@setevery{#1}}%
4389 \caption@settype{#1}%
4390 \caption@clearmargin
4391 %%% \caption@setoptions{wrap}%
4392 \caption@setoptions{wrap#1}}%
4393 % \end{macrocode}
4394 % \end{macro}
4395 %
4396 % \begin{macrocode}
4397 }{}
4398 % \end{macrocode}
4399 %
4400 % \iffalse
4401 %</package>
4402 % \fi
4403 %
4404 % \iffalse
4405 % --------------------------------------------------------------------------- %
4406 % \fi
4407 %
4408 % \clearpage
4409 % \begin{thebibliography}{99}
4410 % \bibitem{beamer}
4411 % Till Tantau:\\
4412 % \href{http://www.ctan.org/pkg/beamer}%
4413 % {\emph{The beamer class, User Guide for version 3.25}},\\
4414 % December 26, 2012
4415 %
4416 % \bibitem{KOMAScript}
4417 % Markus Kohm \& Jens-Uwe-Morawski:\\
4418 % \href{http://www.ctan.org/pkg/koma-script}%
4419 % {\emph{KOMA-Script -- a versatile \LaTeXe\ bundle}},\\
4420 % 2012-07-22
4421 %
4422 % \bibitem{NTG}
4423 % Victor Eijkhout:\\
4424 % \href{http://www.ctan.org/pkg/ntgclass}%
4425 % {\emph{An introduction to the Dutch \LaTeX\ document classes}},\\
4426 % 3 September 1989
4427 %
4428 % \bibitem{float}
4429 % Anselm Lingnau:\\
4430 % \href{http://www.ctan.org/pkg/float}%
4431 % {\emph{An Improved Environment for Floats}},\\
4432 % 2001/11/08
4433 %
4434 % \bibitem{floatflt}
4435 % Mats Dahlgren:\\
4436 % \href{http://www.ctan.org/pkg/floatflt}%
4437 % {\emph{Welcome to the floatflt package}},\\
4438 % 1998/06/05
4439 %
4440 % \bibitem{floatrow}
4441 % Olga Lapko:\\
4442 % \href{http://www.ctan.org/pkg/floatrow}%
4443 % {\emph{The floatrow package documentation}},\\
4444 % 2009/08/02
4445 %
4446 % \bibitem{fltpage}
4447 % Sebastian Gross:\\
4448 % \href{http://www.ctan.org/pkg/fltpage}%
4449 % {\emph{Welcome to the beta test of fltpage package!}},\\
4450 % 1998/11/13
4451 %
4452 % \bibitem{hyperref}
4453 % Sebastian Rahtz \& Heiko Oberdiek:\\
4454 % \href{http://www.ctan.org/pkg/hyperref}%
4455 % {\emph{Hypertext marks in \LaTeX: a manual for hyperref}},\\
4456 % November 2012
4457 %
4458 % \bibitem{hypcap}
4459 % Heiko Oberdiek:\\
4460 % \href{http://www.ctan.org/pkg/oberdiek}%
4461 % {\emph{The hypcap package -- Adjusting anchors of captions}},\\
4462 % 2011/02/16
4463 %
4464 % \bibitem{listings}
4465 % Carsten Heinz \& Brooks Moses:\\
4466 % \href{http://www.ctan.org/pkg/listings}%
4467 % {\emph{The Listings Package}},\\
4468 % 2007/02/22
4469 %
4470 % \bibitem{longtable}
4471 % David Carlisle:\\
4472 % \href{http://www.ctan.org/pkg/longtable}%
4473 % {\emph{The longtable package}},\\
4474 % 2004/02/01
4475 %
4476 % \bibitem{picinpar}
4477 % Friedhelm Sowa:\\
4478 % \href{http://www.ctan.org/pkg/picinpar}%
4479 % {\emph{Pictures in Paragraphs}},\\
4480 % July 13, 1993
4481 %
4482 % \bibitem{picins}
4483 % Joachim Bleser and Edmund Lang:\\
4484 % \href{http://www.ctan.org/pkg/picins}%
4485 % {\emph{PicIns-Benutzerhandbuch Version 3.0}},\\
4486 % September~1992
4487 %
4488 % \bibitem{rotating}
4489 % Sebastian Rahtz and Leonor Barroca:\\
4490 % \href{http://www.ctan.org/pkg/rotating}%
4491 % {\emph{A style option for rotated objects in \LaTeX}},\\
4492 % 1997/09/26
4493 %
4494 % \bibitem{sidecap}
4495 % Rolf Niepraschk \& Hubert G\"a\ss lein:\\
4496 % \href{http://www.ctan.org/pkg/sidecap}%
4497 % {\emph{The sidecap package}},\\
4498 % 2003/06/06
4499 %
4500 % \bibitem{subfigure}
4501 % Steven D. Cochran:\\
4502 % \href{http://www.ctan.org/pkg/subfigure}%
4503 % {\emph{The subfigure package}},\\
4504 % 2005/03/15
4505 %
4506 % \bibitem{subfig}
4507 % Steven D. Cochran:\\
4508 % \href{http://www.ctan.org/pkg/subfig}%
4509 % {\emph{The subfig package}},\\
4510 % 2005/07/05
4511 %
4512 % \bibitem{supertabular}
4513 % Johannes Braams and Theo Jurriens:\\
4514 % \href{http://www.ctan.org/pkg/supertabular}%
4515 % {\emph{The supertabular environment}},\\
4516 % 2004/02/20
4517 %
4518 % \bibitem{threeparttable}
4519 % Donald Arseneau:\\
4520 % \href{http://www.ctan.org/pkg/threeparttable}%
4521 % {\emph{Three part tables: title, tabular environment, notes}},\\
4522 % March 5, 2010
4523 %
4524 % \bibitem{wrapfig}
4525 % Donald Arseneau:\\
4526 % \href{http://www.ctan.org/pkg/wrapfig}%
4527 % {\emph{WRAPFIG.STY ver 3.6}},\\
4528 % Jan 31, 2003
4529 %
4530 % \bibitem{xtab}
4531 % Peter Wilson:\\
4532 % \href{http://www.ctan.org/pkg/xtab}%
4533 % {\emph{The xtab package}},\\
4534 % 2011/07/31
4535 % \end{thebibliography}
4536 %
4537 % \iffalse
4538 % --------------------------------------------------------------------------- %
4539 % \fi
4540 %
4541 % \clearpage
4542 % \Finale
4543 %
4544 \endinput