Debian Codegraph @

texmf-dist/tex/latex/caption/caption.sty

raw
1 %%
2 %% This is file `caption.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% caption.dtx (with options: `package')
8 %%
9 %% Copyright (C) 1994-2023 Axel Sommerfeldt ([email protected])
10 %%
11 %% https://gitlab.com/axelsommerfeldt/caption
12 %%
13 %% --------------------------------------------------------------------------
14 %%
15 %% This work may be distributed and/or modified under the
16 %% conditions of the LaTeX Project Public License, either version 1.3
17 %% of this license or (at your option) any later version.
18 %% The latest version of this license is in
19 %% http://www.latex-project.org/lppl.txt
20 %% and version 1.3 or later is part of all distributions of LaTeX
21 %% version 2003/12/01 or later.
22 %%
23 %% This work has the LPPL maintenance status "maintained".
24 %%
25 %% This Current Maintainer of this work is Axel Sommerfeldt.
26 %%
27 %% This work consists of the files
28 %% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
29 %% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
30 %% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
31 %% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
32 %% the derived files
33 %% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
34 %% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
35 %% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
36 %% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty.
37 %%
38 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
39 \providecommand\DeclareRelease[3]{}
40 \providecommand\DeclareCurrentRelease[2]{}
41 \DeclareRelease{v1}{1994-10-27}{caption_1995-04-05.sty}
42 \DeclareRelease{v3.0}{2003-12-20}{caption_2007-04-16.sty}
43 \DeclareRelease{v3.1}{2007-09-01}{caption_2010-01-09.sty}
44 \DeclareRelease{v3.2}{2011-08-06}{caption_2011-11-10.sty}
45 \DeclareRelease{v3.3}{2013-01-10}{caption_2019-09-01.sty}
46 \DeclareRelease{v3.4}{2019-11-24}{caption_2020-07-29.sty}
47 \DeclareRelease{v3.5}{2020-08-30}{caption_2020-10-26.sty}
48 \DeclareCurrentRelease{v3.6}{2022-02-20}
49 \ProvidesPackage{caption}[2023/08/05 v3.6o Customizing captions (AR)]
50 \RequirePackage{caption3}[2023/07/31] % needs v2.4d or newer
51 \caption@ifdocumentclass{unknown}%
52 {\caption@WarningNoLine{%
53 Unknown document class (or package),\MessageBreak
54 standard defaults will be used}}%
55 {}
56 \@ifpackageloaded{caption2}{%
57 \caption@Error{%
58 You can't use both, the (obsolete) caption2 *and*\MessageBreak
59 the (current) caption package}%
60 \endinput
61 }{}
62 \caption@AtBeginDocument{%
63 \caption@setincompatible{\@ifpackageloaded{captcont}}{captcont package}%
64 \caption@setincompatible{\@ifpackageloaded{ftcap}}{ftcap package}%
65 \caption@setincompatible{\@ifpackageloaded{nonfloat}}{nonfloat package}%
66 \caption@setincompatible{\@ifpackageloaded{topcapt}}{topcapt package}}
67 \newcommand*\caption@setincompatible[2]{%
68 #1{%
69 \caption@Error{%
70 The #2 is incompatible to the\MessageBreak
71 current version of the `caption' package,\MessageBreak
72 so try \string\usepackage{caption}[=v1] instead}%
73 }{}}
74 \@onlypreamble\caption@setincompatible
75 \DeclareCaptionPosition{auto}{#2}{%
76 \caption@ifsubcaption@above{#2}{%
77 \ifvmode
78 \caption@autoposition{#1}{#2}%
79 \else
80 #2%
81 \fi}}
82 \DeclareCaptionOption*{config}[caption]{%
83 \InputIfFileExists{#1.cfg}%
84 {\typeout{*** Local configuration file #1.cfg used ***}}%
85 {\caption@Warning{Configuration file #1.cfg not found}}}
86 \newcommand*\caption@selectlistentry[1]{%
87 \caption@ifinlist{#1}{heading}{%
88 \let\caption@iflistheading\@firstoftwo
89 }{\caption@ifinlist{#1}{default,list-entry,entry}{%
90 \let\caption@iflistheading\@secondoftwo
91 }{%
92 \caption@Error{Undefined list-entry selection `#1'}%
93 }}}
94 \DeclareCaptionOption{list-entry}{\caption@selectlistentry{#1}}
95 \captionsetup{list-entry=default}
96 \DeclareCaptionOption{@minipage}{%
97 \caption@ifinlist{#1}{auto,default}%
98 {\let\caption@if@minipage\@gobbletwo}%
99 {\caption@set@bool\caption@if@minipage{#1}}}
100 \captionsetup{@minipage=default}
101 \DeclareCaptionOption{compatibility}[1]{%
102 \caption@ifinlist{#1}{1,true,yes,on}{%
103 \caption@Error{%
104 Obsolete compatibility value `#1',\MessageBreak
105 please use either \string\usepackage{caption}[=v1]\MessageBreak
106 or \string\usepackage{caption-light} instead}%
107 }{\caption@ifinlist{#1}{0,false,no,off}{%
108 \let\caption@ifcompatibility\@secondoftwo % not used; for backward compatibility only
109 }{%
110 \caption@Error{Undefined compatibility value `#1'}%
111 }}}
112 \@onlypreamble@key{caption}{compatibility}
113 \caption@setbool{compatibility}{0} % default: Try not to be compatible to v1.x
114 \DeclareCaptionOptionNoValue*{normal}{%
115 \caption@setup{format=plain,justification=justified}}
116 \DeclareCaptionOptionNoValue*{isu}{%
117 \caption@setup{format=hang,justification=justified}}
118 \DeclareCaptionOptionNoValue*{hang}{%
119 \caption@setup{format=hang,justification=justified}}
120 \DeclareCaptionOptionNoValue*{center}{%
121 \caption@setup{format=plain,justification=centering}}
122 \DeclareCaptionOptionNoValue*{centerlast}{%
123 \caption@setup{format=plain,justification=centerlast}}
124 \DeclareCaptionOptionNoValue*{scriptsize}{\def\captionfont{\scriptsize}}
125 \DeclareCaptionOptionNoValue*{footnotesize}{\def\captionfont{\footnotesize}}
126 \DeclareCaptionOptionNoValue*{small}{\def\captionfont{\small}}
127 \DeclareCaptionOptionNoValue*{normalsize}{\def\captionfont{\normalsize}}
128 \DeclareCaptionOptionNoValue*{large}{\def\captionfont{\large}}
129 \DeclareCaptionOptionNoValue*{Large}{\def\captionfont{\Large}}
130 \DeclareCaptionOptionNoValue*{up}{\caption@setup{labelfont+=up}}
131 \DeclareCaptionOptionNoValue*{it}{\caption@setup{labelfont+=it}}
132 \DeclareCaptionOptionNoValue*{sl}{\caption@setup{labelfont+=sl}}
133 \DeclareCaptionOptionNoValue*{sc}{\caption@setup{labelfont+=sc}}
134 \DeclareCaptionOptionNoValue*{md}{\caption@setup{labelfont+=md}}
135 \DeclareCaptionOptionNoValue*{bf}{\caption@setup{labelfont+=bf}}
136 \DeclareCaptionOptionNoValue*{rm}{\caption@setup{labelfont+=rm}}
137 \DeclareCaptionOptionNoValue*{sf}{\caption@setup{labelfont+=sf}}
138 \DeclareCaptionOptionNoValue*{tt}{\caption@setup{labelfont+=tt}}
139 \DeclareCaptionOptionNoValue*{nooneline}{\caption@setup{slc=0}}
140 \caption@setbool{ruled}{0}
141 \DeclareCaptionOptionNoValue*{ruled}{\caption@setbool{ruled}{1}}
142 \DeclareCaptionOptionNoValue*{flushleft}{%
143 \caption@setup{format=plain,justification=raggedright}}
144 \DeclareCaptionOptionNoValue*{flushright}{%
145 \caption@setup{format=plain,justification=raggedleft}}
146 \DeclareCaptionOptionNoValue*{oneline}{\caption@setup{slc=1}}
147 \DeclareCaptionOptionNoValue*{ignoreLTcapwidth}{%
148 \caption@WarningNoLine{Obsolete option `ignoreLTcapwidth' ignored}}
149 \DeclareCaptionOption*{caption}{%
150 \caption@setbool{temp}{#1}%
151 \caption@ifbool{temp}{}{%
152 \caption@Error{%
153 The package option `caption=#1' is obsolete.\MessageBreak
154 Please pass this option to the subfig package instead\MessageBreak
155 and do *not* load the caption package anymore}}}
156 \DeclareCaptionOption{FPlist}[1]{\caption@setFPoption{list}{#1}}
157 \DeclareCaptionOption{FPref}[1]{\caption@setFPoption{ref}{#1}}
158 \@onlypreamble@key{caption}{FPlist}
159 \@onlypreamble@key{caption}{FPref}
160 \newcommand*\caption@setFPoption[2]{%
161 \edef\caption@tempa{\@car#2\@nil}%
162 \caption@setbool{FP#1cap}{\if c\caption@tempa 1\else 0\fi}}
163 \@onlypreamble\caption@setFPoption
164 \captionsetup{FPlist=caption,FPref=figure}
165 \DeclareCaptionOption{hypcap}[1]{\caption@setbool{hypcap}{#1}}
166 \DeclareCaptionOption{hypcapspace}{\def\caption@hypcapspace{#1}}
167 \captionsetup{hypcap=1,hypcapspace=.5\baselineskip}
168 \caption@documentclass@code
169 \let\caption@documentclass@code\@undefined
170 \let\AtCaptionPackage\@firstofone
171 \caption@SetupOptions{caption}{\caption@setkeys{#1}{#2}}
172 \caption@ProcessOptions*{caption}
173 \newcounter{caption@flags}
174 \newcommand*\caption@clrflags{%
175 \setcounter{caption@flags}{0}}
176 \newcommand*\caption@ifflags{%
177 \ifcase\c@caption@flags
178 \expandafter\@secondoftwo
179 \else
180 \expandafter\@firstoftwo
181 \fi}
182 \newcommand*\caption@setflag[1]{%
183 \caption@ifflag{#1}{}{\addtocounter{caption@flags}{#1}}}
184 \newcommand*\caption@ifflag[1]{%
185 \@tempcnta\c@caption@flags
186 \divide\@tempcnta #1\relax
187 \ifodd\@tempcnta
188 \expandafter\@firstoftwo
189 \else
190 \expandafter\@secondoftwo
191 \fi}
192 \newcommand*\caption@setcontinued{\caption@setflag1}
193 \newcommand*\caption@ifcontinued{\caption@ifflag1}
194 \newcommand*\caption@setcaption{\caption@setflag2}
195 \newcommand*\caption@ifcaption{\caption@ifflag2}
196 \newcommand*\caption@setsubcaption{%
197 \caption@ifcaption{\caption@setflag8}{\caption@setflag4}}
198 \newcommand*\caption@ifsubcaption@above{\caption@ifflag4}
199 \newcommand*\caption@ifsubcaption@below{\caption@ifflag8}
200 \def\caption@caption{%
201 \caption@iftype
202 {\caption@checkgrouplevel\@empty\caption
203 \caption@star
204 {\caption@refstepcounter\@captype}%
205 {\caption@dblarg{\@caption\@captype}}}%
206 {\caption@OutsideFloat\caption
207 \caption@withoptargs\@gobbletwo}}
208 \newcommand*\caption@OutsideFloat[1]{%
209 \caption@Error{\string#1 outside float}}
210 \newcommand*\caption@star[2]{%
211 \@ifstar{\caption@startrue#2[]}{#1#2}}
212 \long\def\caption@@caption#1[#2]#3{%
213 \ifcaption@star \else
214 \caption@prepareanchor{#1}{#2}%
215 \memcaptioninfo{#1}{\csname the#1\endcsname}{#2}{#3}%
216 \@nameuse{nag@hascaptiontrue}%
217 \fi
218 \par
219 \caption@nobreak
220 \caption@beginex{#1}{#2}{#3}%
221 \caption@setfloatcapt{%
222 \caption@parboxrestore
223 \if@minipage
224 \@setminipage
225 \fi
226 \caption@normalsize
227 \ifcaption@star
228 \let\caption@makeanchor\@firstofone
229 \fi
230 \@makecaption{\csname fnum@#1\endcsname}%
231 {\ignorespaces\caption@makeanchor{#3}}\par
232 \caption@nobreak
233 \caption@if@minipage\@minipagetrue\@minipagefalse}%
234 \caption@end}
235 \providecommand\memcaptioninfo[4]{}
236 \newcommand*\caption@prepareanchor[2]{%
237 \caption@makecurrent{#1}{#2}%
238 \caption@ifhypcap\caption@@start\relax
239 \M@gettitle{#2}}
240 \providecommand\M@gettitle[1]{}
241 \newcommand*\caption@nobreak{}
242 \newcommand*\caption@parboxrestore{\@parboxrestore}
243 \long\def\caption@makecaption#1#2{%
244 \caption@nobreak
245 \caption@make@above
246 \caption@nobreak
247 \caption@@make{#1}{#2}%
248 \caption@nobreak
249 \caption@make@below
250 \caption@nobreak}
251 \newcommand*\caption@make@above{%
252 \caption@iftop
253 \caption@belowskip
254 {\caption@rule\caption@aboveskip}}
255 \newcommand*\caption@make@below{%
256 \caption@iftop
257 {\caption@aboveskip\caption@rule}%
258 \caption@belowskip}
259 \newcommand*\caption@redefine{%
260 \let\caption\caption@caption
261 \let\@caption\caption@@caption
262 \let\caption@ORI@xfloat\@xfloat
263 \let\@xfloat\caption@xfloat
264 \let\caption@ORI@xdblfloat\@xdblfloat
265 \let\@xdblfloat\caption@xdblfloat
266 }
267 \caption@AtBeginDocument{%
268 \caption@redefine
269 \let\caption@redefine\relax}
270 \let\@makecaption\caption@makecaption
271 \def\caption@xfloat#1[#2]{%
272 \caption@ORI@xfloat{#1}[#2]%
273 \caption@settype{#1}%
274 \caption@setanchor
275 \caption@xfloat@hook}
276 \newcommand*\caption@xfloat@hook{}
277 \def\caption@xdblfloat#1[#2]{%
278 \caption@ORI@xdblfloat{#1}[#2]% expands to \@xfloat{#1}[#2] + extra stuff
279 \caption@setoptions{#1*}%
280 \caption@xdblfloat@hook}
281 \newcommand*\caption@xdblfloat@hook{}
282 \caption@AtBeginDocument{%
283 \DeclareCaptionOption{type}{\setcaptiontype{#1}}%
284 \DeclareCaptionOption{type*}{\setcaptiontype*{#1}}%
285 \DeclareCaptionOptionNoValue{subtype}{\setcaptionsubtype\relax}%
286 \DeclareCaptionOptionNoValue{subtype*}{\setcaptionsubtype*}%
287 }
288 \def\setcaptiontype{%
289 \caption@teststar\@setcaptiontype\@gobble\@iden}
290 \newcommand*\@setcaptiontype[1]{%
291 \kernel@ifnextchar[%]
292 {\@setcaptiontype@#1}%
293 {\@@setcaptiontype#1\relax}}
294 \def\@setcaptiontype@#1[#2]{%
295 \@@setcaptiontype{#1}{\caption@setoptions{#2}}}
296 \newcommand*\@@setcaptiontype[3]{%
297 \caption@settype{#3}#2%
298 \caption@parboxrestore@light
299 #1\caption@setanchor}
300 \newcommand*\caption@settype{%
301 \caption@initposition
302 \caption@clrflags
303 \aftergroup\flushsubcaptionlistentries
304 \caption@@settype{}}
305 \newcommand*\caption@@settype[2]{%
306 \caption@Debug{#1type:=#2}%
307 \@nameuse{caption@check#1type}{#2}%
308 {\caption@checkgrouplevel{#1}{\setcaption#1type}%
309 \edef\caption@tempa{#2}%
310 \expandafter\ifx\csname @#1captype\endcsname\caption@tempa \else
311 \@nameuse{caption@#1type@warning}%
312 \fi
313 \expandafter\let\csname @#1captype\endcsname\caption@tempa
314 \@nameuse{caption@#1typehook}%
315 \caption@setoptions{#2}%
316 \ifx\caption@opt\relax
317 \@nameundef{caption@#1type@warning}%
318 \else
319 \@namedef{caption@#1type@warning}{\caption@Warning{%
320 The #1type was already set to
321 `\csname @#1captype\endcsname'\MessageBreak}}%
322 \fi}}
323 \newcommand*\setcaptionsubtype{%
324 \caption@teststar\@setcaptionsubtype\@gobble\@iden}
325 \newcommand*\@setcaptionsubtype[1]{%
326 \caption@iftype
327 {\caption@ifsubtype
328 {\caption@Debug{type=\@captype, subtype=\@subcaptype}}%
329 {\caption@@settype{sub}{sub\@captype}%
330 #1\caption@setanchor}}%
331 {\caption@OutsideFloat\setcaptionsubtype}}
332 \newcommand*\caption@parboxrestore@light{%
333 \let\par\@@par
334 \parindent\z@ \parskip\z@skip
335 \sloppy}
336 \newcommand*\caption@setanchor{%
337 \caption@reset@currentlabel
338 \caption@start}
339 \newcommand*\caption@reset@currentlabel{%
340 \let\@currentlabel\caption@undefinedlabel
341 \ifx\caption@x@label\@undefined
342 \let\caption@x@label\label
343 \let\label\caption@xlabel
344 \fi}
345 \newcommand*\caption@iftype{\caption@ifdefined\@captype}
346 \newcommand*\caption@ifsubtype{\caption@ifdefined\@subcaptype}
347 \newcommand*\caption@checktype[1]{%
348 \caption@ifdefined@subtype{#1}\@firstoftwo{\caption@ifin@list\sf@counterlist{#1}}%
349 {\caption@Error{Should not be used with subtype `#1'}%
350 \@gobble}%
351 \@firstofone}
352 \newcommand*\caption@checksubtype[1]{%
353 \caption@ifdefined@subtype{#1}%
354 \@firstofone
355 {\@ifundefined{c@#1}%
356 {\caption@Error{Undefined counter `#1'}}%
357 {\caption@subtypesource\caption@subtype@source{#1}%
358 \caption@Error{The counter `#1' was defined by\MessageBreak\caption@subtype@source}}%
359 \@gobble}}
360 \newcommand*\caption@checkgrouplevel[2]{%
361 \@ifundefined{#1caption@grouplevel}{%
362 \caption@ifundefined\caption@grouplevel{\let\caption@grouplevel\z@}{}%
363 \ifnum\currentgrouplevel>\caption@grouplevel\relax
364 \expandafter\edef\csname #1caption@grouplevel\endcsname{%
365 \the\currentgrouplevel}%
366 \else
367 \caption@Warning{\string#2\MessageBreak outside box or environment}%
368 \fi
369 }{}}%
370 \newcommand*\caption@undefinedlabel{%
371 \protect\caption@xref{\caption@labelname}{\on@line}}
372 \DeclareRobustCommand*\caption@xref[2]{%
373 \caption@WarningNoLine{\noexpand\label without proper reference#2}%
374 \@setref\relax\@undefined{#1}}
375 \newcommand*\caption@labelname{??}
376 \newcommand*\caption@xlabel{%
377 \caption@withoptargs\caption@@xlabel}
378 \newcommand*\caption@@xlabel[2]{%
379 \caption@@@xlabel
380 \def\caption@labelname{#2}%
381 \caption@x@label#1{#2}}
382 \newcommand*\caption@@@xlabel{%
383 \global\let\caption@@@xlabel\@empty
384 \@bsphack
385 \protected@write\@auxout{}%
386 {\string\providecommand*\string\caption@xref[2]{%
387 \string\@setref\string\relax\string\@undefined{\string##1}}}%
388 \@esphack}
389 \caption@AtBeginDocument{%
390 \def\captionof{\caption@teststar\caption@of{\caption*}\caption}}
391 \providecommand*\caption@of[2]{\setcaptiontype*{#2}#1}
392 \newcommand*\phantomcaption{%
393 \caption@iftype
394 {\caption@refstepcounter\@captype}%
395 {\caption@OutsideFloat\phantomcaption}}
396 \newcommand*\captionlistentry{%
397 \caption@teststar\caption@listentry\@firstoftwo\@secondoftwo}
398 \newcommand*\caption@listentry[1]{%
399 \kernel@ifnextchar[%]
400 {\caption@listentry@{#1}}%
401 {\caption@@listentry{#1}}}
402 \def\caption@listentry@#1[#2]{%
403 \caption@@@listentry{#1}{#2}{\caption@refstepcounter@}}
404 \newcommand*\caption@@listentry[1]{%
405 \caption@iftype
406 {\caption@@@listentry{#1}{\@captype}{\caption@refstepcounter}}%
407 {\caption@OutsideFloat\captionlistentry
408 \@gobble}}
409 \newcommand*\caption@@@listentry[4]{%
410 \@bsphack
411 #1{\caption@gettitle{#4}}%
412 {#3{#2}\caption@makecurrent{#2}{#4}}%
413 \caption@addcontentsline{#2}{#4}%
414 \@esphack}
415 \newcommand*\captiontext{%
416 \caption@iftype
417 {\caption@text\@captype}%
418 {\caption@OutsideFloat\captiontext
419 \caption@withoptargs\@gobbletwo}}
420 \newcommand*\caption@text[1]{%
421 \caption@teststar{\caption@@text{#1}}\caption@@@make\caption@@make}
422 \newcommand*\caption@@text[2]{%
423 \kernel@ifnextchar[%]
424 {\caption@@@text{#1}#2\@iden}%
425 {\caption@@@text{#1}#2\@gobble[0]}}
426 \long\def\caption@@@text#1#2#3[#4]#5{%
427 \begingroup
428 #3{\csname c@#1\endcsname #4\relax}%
429 #2{\caption@fnum{#1}}{#5}%
430 \endgroup}
431 \newenvironment{captiongroup}{\setcaptiontype}{}
432 \newenvironment{captiongroup*}{\setcaptiontype*}{}
433 \newcommand*\caption@minipage{%
434 \@testopt\caption@iminipage b}
435 \def\caption@iminipage[#1]{%
436 \caption@withoptargs{\caption@iiminipage{#1}}}
437 \newcommand*\caption@iiminipage[3]{%
438 \let\caption@endminipage@hook\@empty
439 \if#1B%
440 \minipage[b]#2{#3}%
441 \def\caption@endminipage@hook{\vspace{0pt}}%
442 \else\if#1T%
443 \minipage[t]#2{#3}%
444 \vspace{0pt}%
445 \else
446 \minipage[#1]#2{#3}%
447 \fi\fi
448 \@floatboxreset
449 \setcaptiontype}
450 \newcommand*\caption@endminipage{%
451 \caption@endminipage@hook
452 \endminipage}
453 \newenvironment{captionblock}{\caption@minipage}{\caption@endminipage}
454 \newcommand*\captionbox{%
455 \caption@withoptargs{\caption@ibox\@gobble}}
456 \newcommand\caption@ibox[3]{%
457 \kernel@ifnextchar[%]
458 {\caption@iibox{#1}{#2}{#3}}%
459 {\caption@iibox@{#1}{#2}{#3}}}
460 \long\def\caption@iibox#1#2#3[#4]{%
461 \@testopt{\caption@iiibox{#1}{#2}{#3}[{#4}]}\captionbox@innerpos@default}
462 \long\def\caption@iibox@#1#2#3#4{%
463 \setbox\@tempboxa\hbox{#4}%
464 \caption@iiibox{#1}{#2}{#3}[\wd\@tempboxa][\captionbox@innerpos@default]{\unhbox\@tempboxa}}
465 \long\def\caption@iiibox#1{%
466 \caption@iiiibox{#1}\vbox\vtop}
467 \long\def\caption@iiiibox#1#2#3#4#5[#6][#7]#8{%
468 \caption@checkdecl{justification}{#7}{%
469 \begingroup
470 #1*% set \caption@position
471 \caption@iftop{%
472 \endgroup
473 \parbox[t]{#6}{%
474 #1\relax
475 \caption@setposition t%
476 #2{\caption#4{#5}}%
477 \captionbox@hrule
478 \csname caption@justification@#7\endcsname
479 #8}%
480 }{%
481 \endgroup
482 \parbox[b]{#6}{%
483 #1\relax
484 \caption@setposition b%
485 \csname caption@justification@#7\endcsname
486 #8%
487 \captionbox@hrule
488 #3{\caption#4{#5}}}%
489 }}}
490 \newcommand*\captionbox@innerpos@default{c}
491 \newcommand*\captionbox@hrule{\hrule\@height\z@\relax}
492 \providecommand*\caption@justification@c{\centering}
493 \providecommand*\caption@justification@l{\raggedright}
494 \providecommand*\caption@justification@r{\raggedleft}
495 \providecommand*\caption@justification@s{}
496 \newcounter{continuedfloat}
497 \let\c@ContinuedFloat\c@continuedfloat % defined for compatibility reasons
498 \def\thecontinuedfloat{\theContinuedFloat}
499 \let\theContinuedFloat\@empty % defined for compatibility reasons
500 \newcommand*\continuedfloat@captype{??}
501 \newcommand*\caption@reset@continuedfloat[1]{%
502 \xdef\continuedfloat@captype{#1}%
503 \@stpelt{continuedfloat}}
504 \newcommand*\caption@set@continuedfloat{%
505 \ifx\@captype\continuedfloat@captype
506 \stepcounter{continuedfloat}%
507 \expandafter\@firstoftwo
508 \else
509 \caption@Error{Continued `\@captype' after `\continuedfloat@captype'}%
510 \expandafter\@secondoftwo
511 \fi}
512 \def\continuedfloat{%
513 \caption@teststar\caption@continuedfloat\@firstoftwo\@secondoftwo}
514 \newcommand*\caption@continuedfloat[1]{%
515 \caption@iftype
516 {#1{\caption@@refstepcounter\@captype}{}%
517 \caption@@continuedfloat\@captype}%
518 {\caption@OutsideFloat\continuedfloat}}
519 \newcommand*\caption@@continuedfloat{%
520 \caption@clrflags
521 \caption@set@continuedfloat
522 {\caption@setcontinued
523 \caption@@@continuedfloat}%
524 {\@gobble}}
525 \newcommand*\caption@@@continuedfloat[1]{%
526 \caption@setoptions{ContinuedFloat}% for compatibility reasons
527 \caption@setoptions{continuedfloat}%
528 \caption@setoptions{continued#1}%
529 \expandafter\l@addto@macro\csname the#1\endcsname\thecontinuedfloat
530 \@ifundefined{theH#1}{}{%
531 \expandafter\l@addto@macro\csname theH#1\endcsname{%
532 \@alph\c@continuedfloat}}%
533 \let\caption@@@continuedfloat\@gobble}
534 \def\ContinuedFloat{\continuedfloat} % defined for compatibility reasons
535 \def\caption@ContinuedFloat{%
536 \caption@set@continuedfloat\caption@@@continuedfloat\@gobble}
537 \providecommand*\nextfloat{%
538 \caption@teststar\caption@nextfloat\@firstoftwo\@secondoftwo}
539 \newcommand*\caption@nextfloat[1]{%
540 \caption@iftype
541 {\caption@@nextfloat\@captype
542 #1{}{\caption@reset@currentlabel\caption@start}}%
543 {\caption@OutsideFloat\nextfloat}}
544 \newcommand*\caption@@nextfloat[1]{%
545 \flushsubcaptionlistentries
546 \caption@clrflags
547 \ifx\caption@@@continuedfloat\@gobble
548 % next continued float
549 \caption@set@continuedfloat\caption@setcontinued\relax
550 \fi}
551 \newcommand*\caption@refstepcounter{%
552 \@nameuse{donemaincaptiontrue}% Support of the memoir document class
553 \caption@ifrefstepcounter\caption@@refstepcounter\caption@@refcounter}
554 \newcommand*\caption@@refstepcounter[1]{%
555 \caption@prepare@stepcounter{#1}%
556 \caption@refstepcounter@{#1}}
557 \newcommand*\caption@@refcounter[1]{%
558 \let\caption@stepcounter@ORI\stepcounter
559 \def\stepcounter##1{%
560 \edef\caption@tempa{#1}%
561 \edef\caption@tempb{##1}%
562 \ifx\caption@tempa\caption@tempb
563 % Suppress incrementation of counter
564 \else
565 \caption@stepcounter@ORI{##1}%
566 \fi}%
567 \caption@refstepcounter@{#1}%
568 \let\stepcounter\caption@stepcounter@ORI}
569 \newcommand*\caption@refstepcounter@{\refstepcounter}
570 \newcommand*\caption@stepcounter{%
571 \caption@ifstepcounter\caption@@stepcounter\caption@@counter}
572 \newcommand*\caption@@stepcounter[1]{%
573 \caption@prepare@stepcounter{#1}%
574 \caption@stepcounter@{#1}}
575 \newcommand*\caption@@counter[1]{} % nothing to do
576 \newcommand*\caption@stepcounter@{\stepcounter}
577 \newcommand*\caption@prepare@stepcounter{%
578 \caption@addsubcontentslines\relax
579 \caption@reset@continuedfloat}
580 \newcommand*\caption@ifrefstepcounter{%
581 \caption@ifcounter
582 {\caption@ifcaption}%
583 {\caption@ifsubcaption@below{\caption@iftop\@secondoftwo\@firstoftwo}{\@secondoftwo}}%
584 {\caption@setcaption}}
585 \newcommand*\caption@ifstepcounter{%
586 \caption@ifcounter
587 {\caption@ifcaption\caption@ifsubcaption@above\@secondoftwo}%
588 {\caption@iftop}%
589 {\caption@setsubcaption}}
590 \newcommand*\caption@ifcounter[3]{%
591 \caption@ifflags
592 {#1%
593 {#2\caption@Warning\@gobble{Ambiguous sub-caption(s), use \string\nextfloat}%
594 \caption@clrflags
595 \let\caption@next\@firstoftwo}%
596 {\let\caption@next\@secondoftwo}}%
597 {\let\caption@next\@firstoftwo}%
598 #3%
599 \caption@next}
600 \newcommand\caption@dblarg[1]{%
601 \kernel@ifnextchar[%]
602 {\caption@ydblarg{#1}}%
603 {\caption@xdblarg{#1}}}
604 \newcommand\caption@xdblarg[2]{%
605 \caption@iftokens{#2}{#1[{#2}]{#2}}{#1[\relax]{}}}
606 \long\def\caption@ydblarg#1[#2]#3{%
607 \caption@iflistheading{#1[{#3}]{#3}}{#1[{#2}]{#3}}}
608 \newcommand*\caption@begin[1]{%
609 \caption@fixposition
610 \begingroup
611 \caption@setfnum{#1}}
612 \newcommand\caption@beginex[3]{%
613 \caption@begin{#1}%
614 \caption@beginex@hook
615 \caption@addcontentsline{#1}{#2}%
616 \caption@ifempty{#3}{}}
617 \newcommand*\caption@beginex@hook{}
618 \newcommand*\caption@end{%
619 \endgroup}
620 \newcommand*\caption@normalsize{%
621 \caption@font@normal\@unused}
622 \let\caption@setfloatcapt\@firstofone
623 \newcommand*\caption@makecurrent[1]{\caption@gettitle}
624 \let\caption@makeanchor\@firstofone
625 \let\caption@start\relax
626 \let\caption@@start\relax
627 \let\caption@freezeHref\relax
628 \let\caption@defrostHref\relax
629 \newcommand\caption@gettitle[1]{%
630 \caption@ifdefined\NR@gettitle
631 {\NR@gettitle{#1}}% % support for recent versions of nameref package
632 {\caption@ifdefined\NR@sect{\def\@currentlabelname{#1}}{}}} % support for older versions of nameref package
633 \newcommand*\subcaptionsetup{%
634 \caption@teststar\@subcaptionsetup*{}}
635 \newcommand*\@subcaptionsetup[1]{%
636 \@testopt{\captionsetup@sub{#1}}{}}
637 \def\captionsetup@sub#1[#2]#3{%
638 \captionsetup#1[sub#2]{#3}}
639 \newcommand*\caption@subtypehook{%
640 \ifx\caption\caption@subcaption \else
641 \caption@warmup
642 \caption@stepcounter\@captype
643 \caption@ifcaption
644 {}%
645 {\let\caption@add@contentsline\caption@addsubcontentsline
646 \let\caption@addsubcontentslines\@gobble}%
647 \c@continuedfloat=0\relax
648 \let\caption@setfloatcapt\@firstofone
649 \let\caption@chkfloat\@gobbletwo
650 \caption@set{box}{none}%
651 \caption@clearmargin
652 \caption@iflist{}{\let\caption@setlist\@gobble}%
653 \caption@setoptions{sub}%
654 \caption@setoptions{subfloat}% for subfig-package compatibility
655 \renewcommand*\caption@settype[1]{%
656 \caption@Error{##1 inside \@subcaptype}}%
657 \let\caption\caption@subcaption
658 \let\@caption\caption@@caption
659 \let\phantomcaption\caption@subphantom
660 \let\captionlistentry\caption@sublistentry
661 \let\captiontext\caption@subtext
662 \let\caption@refstepcounter\caption@refstepcounter@
663 \let\@makecaption\caption@makecaption
664 \fi}%
665 \newcommand*\caption@subcaption{%
666 \caption@checkgrouplevel{sub}\subcaption
667 \caption@star
668 {\caption@refstepcounter\@subcaptype}%
669 {\caption@dblarg{\@caption\@subcaptype}}}
670 \newcommand*\caption@subphantom{%
671 \caption@checkgrouplevel{sub}\phantomsubcaption
672 \caption@refstepcounter\@subcaptype}
673 \newcommand*\caption@sublistentry{%
674 \caption@teststar\@subcaptionlistentry\@firstoftwo\@secondoftwo}
675 \newcommand*\@subcaptionlistentry[1]{%
676 \@testopt{\caption@listentry{#1}}{\@subcaptype}}
677 \newcommand*\caption@subtext{%
678 \caption@text\@subcaptype}
679 \newcommand*\caption@clearsubcontentslines{%
680 \global\let\caption@subcontentslines\@empty}
681 \caption@clearsubcontentslines
682 \newcommand*\caption@addsubcontentsline[4]{%
683 \caption@Debug{\string\caption@addsubcontentsline{#1}{#2}}%
684 \begingroup
685 \caption@prepareslc
686 \protected@edef\@tempa{\endgroup
687 \noexpand\g@addto@macro\noexpand\caption@subcontentslines{%
688 \noexpand\@namedef{the#2}{\csname the#2\endcsname}%
689 \ifx\@currentHref\@undefined \else
690 \noexpand\def\noexpand\@currentHref{\@currentHref}%
691 \fi
692 \noexpand\caption@@@addcontentsline{#1}{#2}{#3}{#4}}}%
693 \@tempa}
694 \newcommand*\flushsubcaptionlistentries{%
695 \caption@addsubcontentslines\relax}
696 \renewcommand*\caption@addsubcontentslines[1]{%
697 \caption@Debug{\string\flushsubcaptionlistentries}%
698 \begingroup
699 \caption@subcontentslines
700 \endgroup
701 \caption@clearsubcontentslines}
702 \caption@IfBabelArabi{%
703 \let\@makecaption\caption@makecaption
704 \def\fnum@figure{\figurename\nobreakspace\thefigure}%
705 \def\fnum@table{\tablename\nobreakspace\thetable}%
706 }{}
707 \caption@IfFrenchLe{%
708 \def\f@ffrench{\ifx\listoffigures\relax\else\figurename~\thefigure\fi}%
709 \def\f@tfrench{\ifx\listoftables\relax\else\tablename~\thetable\fi}%
710 \let\@eatDP\@undefined
711 \caption@AtBeginDocument{%
712 \let\caption@original@makecaption\@makecaption}%
713 \g@addto@macro\GOfrench{%
714 \let\@makecaption\caption@original@makecaption}%
715 }{}
716 \caption@IfBabelHungarian{%
717 \caption@AtBeginDocument{%
718 \let\caption@original@makecaption\@makecaption}%
719 \caption@ifdefined\extrashungarian{%
720 \addto\extrashungarian{%
721 \let\@makecaption\caption@original@makecaption}}{}%
722 \caption@ifdefined\extrasmagyar{%
723 \addto\extrasmagyar{%
724 \let\@makecaption\caption@original@makecaption}}{}%
725 }{}
726 \caption@IfBabelLatvian{%
727 \let\@makecaption\caption@makecaption
728 }{}
729 \newcommand\caption@IfPackageLoaded[1]{%
730 \@testopt{\caption@@IfPackageLoaded{#1}}{}}
731 \@onlypreamble\caption@IfPackageLoaded
732 \long\def\caption@@IfPackageLoaded#1[#2]#3#4{%
733 \@ifpackageloaded{#1}\@firstofone{%
734 \caption@Debug{#1 package is not loaded (yet)\@gobble}%
735 \caption@AtBeginDocument}{%
736 \caption@If@Package@Loaded{#1}[{#2}]{#3}{#4}}}
737 \@onlypreamble\caption@@IfPackageLoaded
738 \long\def\caption@If@Package@Loaded#1[#2]{%
739 \@ifpackageloaded{#1}{%
740 \caption@InfoNoLine{#1 package is loaded}%
741 \@ifpackagelater{#1}{#2}\@firstoftwo{%
742 \caption@Error{%
743 For a successful cooperation we need at least version\MessageBreak
744 `#2' of package #1,\MessageBreak
745 but only version\MessageBreak
746 `\csname ver@#1.\@pkgextension\endcsname'\MessageBreak
747 is available}%
748 \@secondoftwo}%
749 }{\@secondoftwo}}
750 \@onlypreamble\caption@If@Package@Loaded
751 \newcommand*\caption@clearmargin{%
752 \caption@setmargin\z@
753 \let\caption@minmargin\@undefined}
754 \caption@setbool{needfreeze}{0}
755 \caption@AtBeginDocument*{%
756 \caption@ifneedfreeze{%
757 \newcommand*\caption@freezetype[1]{%
758 \caption@settype{#1}%
759 \captionsetup*[sub]{hypcap=true}% Note: This is just a (q&d) workaround!
760 \caption@freeze}%
761 \newcommand*\caption@freeze{%
762 \let\caption@frozen@continuedfloat\continuedfloat
763 \def\continuedfloat{%
764 \caption@@freeze{\caption@@@continuedfloat\@captype}%
765 \caption@frozen@continuedfloat}%
766 \let\caption@frozen@nextfloat\nextfloat
767 \def\nextfloat{\caption@freeze@error}%
768 \let\caption@frozen@setup\caption@setup
769 \def\caption@setup##1{%
770 \caption@@freeze{\caption@setup{##1}}%
771 \caption@frozen@setup{##1}}%
772 \let\caption@frozen@caption\caption
773 \def\caption{%
774 \def\caption{\caption@freeze@error\caption@gobble}%
775 \@ifstar
776 {\caption@SC@caption*}%
777 {\let\@currentlabel\caption@SClabel
778 \caption@withoptargs\caption@SC@caption}}%
779 \long\def\caption@SC@caption##1##2{%
780 \caption@@freeze{\caption##1{##2}}%
781 \ignorespaces}%
782 \let\caption@frozen@label\label
783 \def\label{%
784 \caption@withoptargs\caption@SC@label}%
785 \def\caption@SC@label##1##2{%
786 \ifx\@currentlabel\caption@SClabel
787 \@bsphack
788 \caption@freeze@label{##1}{##2}%
789 \@esphack
790 \else
791 \caption@frozen@label##1{##2}%
792 \fi}%
793 \def\caption@SClabel{\caption@undefinedlabel}%
794 \def\caption@freeze@label##1##2{%
795 \caption@@freeze{\label##1{##2}}}%
796 \global\let\caption@frozen@content\@empty
797 \long\def\caption@@freeze{%
798 \g@addto@macro\caption@frozen@content}%
799 \def\caption@warmup{%
800 \let\continuedfloat\caption@frozen@continuedfloat
801 \let\nextfloat\caption@frozen@nextfloat
802 \let\caption@setup\caption@frozen@setup
803 \let\caption\caption@frozen@caption
804 \let\label\caption@frozen@label}}%
805 \newcommand*\caption@freeze@error{%
806 \caption@Error{Only one \noexpand\caption can be placed in this environment}}
807 \newcommand*\caption@prepare@defrost{%
808 \def\caption@settype{\caption@@settype{}}}
809 \newcommand*\caption@defrost{%
810 \ifx\caption@frozen@caption\@undefined
811 \caption@frozen@content
812 \else
813 \caption@Error{Internal Error:\MessageBreak
814 \noexpand\caption@defrost in same group as \string\caption@freeze}%
815 \fi}%
816 }{}%
817 \caption@undefbool{needfreeze}}
818 \let\caption@warmup\relax
819 \caption@IfPackageLoaded{changepage}[2008/07/23 memoir-v3.7k]{%
820 \providecommand*\caption@patch@adjustwidth[1]{%
821 \expandafter\let\csname caption@#1\expandafter\endcsname\csname #1\endcsname
822 \expandafter\renewcommand\csname #1\endcsname[2]{%
823 \@nameuse{caption@#1}{##1}{##2}%
824 \caption@set@adjustwidth
825 \ignorespaces}}%
826 \caption@patch@adjustwidth{adjustwidth}%
827 \caption@patch@adjustwidth{adjustwidth*}%
828 \let\caption@patch@adjustwidth\relax
829 \newdimen\caption@adjustwidth@hsize
830 \newdimen\caption@adjustwidth@linewidth
831 \providecommand*\caption@set@adjustwidth{%
832 \caption@adjustwidth@hsize\hsize
833 \caption@adjustwidth@linewidth\linewidth
834 \l@addto@macro\caption@beginex@hook\caption@test@adjustwidth}%
835 \providecommand\caption@test@adjustwidth{%
836 \ifdim\hsize=\caption@adjustwidth@hsize
837 \ifdim\linewidth=\caption@adjustwidth@linewidth
838 \hsize=\linewidth
839 \fi
840 \fi}%
841 }{}%
842 \caption@IfPackageLoaded{chkfloat}[2012/08/19 v0.1]{%
843 \caption@ifdefined\chkfloat@addcontentsline{%
844 \renewcommand\caption@chkfloat{\chkfloat@addcontentsline}%
845 }{%
846 \renewcommand\caption@chkfloat[2]{%
847 \caption@ifdefined\chkfloat@page{%
848 \addtocontents{fof}{\protect\chkfloat@{\thepage}{\chkfloat@page}{\csname fnum@#1\endcsname: #2}}%
849 }{}}%
850 }%
851 }{}%
852 \caption@IfPackageLoaded{float}[2001/11/08 v1.3d]{%
853 \@ifpackageloaded{floatrow}{%
854 \caption@If@Package@Loaded{floatrow}[2007/08/24 v0.2a]{}{}%
855 }{%
856 \let\caption@ORI@float@setevery\@float@setevery
857 \def\@float@setevery#1{%
858 \float@ifcaption{#1}{%
859 \caption@setposition{\@fs@iftopcapt t\else b\fi}%
860 \renewcommand\caption@setfloatcapt[1]{%
861 \let\@makecaption\caption@@make
862 \global\setbox\@floatcapt\vbox{%
863 \color@begingroup ##1\color@endgroup}}%
864 \float@getstyle\float@style{#1}%
865 \caption@setstyle*\float@style
866 \caption@setoptions\float@style
867 }{}%
868 \caption@float@setname{#1}%
869 \caption@freezeHref % will be defrosted in \float@makebox
870 \caption@ORI@float@setevery{#1}}%
871 \caption@AtBeginDocument{%
872 \caption@ifdefined\HyOrg@float@makebox
873 {\let\caption@ORI@float@makebox\HyOrg@float@makebox}%
874 {\let\caption@ORI@float@makebox\float@makebox}%
875 \renewcommand\float@makebox[1]{%
876 \caption@ORI@float@makebox{#1\relax \caption@defrostHref}}%
877 }%
878 \newcommand*\caption@float@setname[1]{%
879 \expandafter\ifx\csname #1name\endcsname\relax % either undefined or \relax
880 \@namedef{#1name}{\@nameuse{fname@#1}}%
881 \fi}%
882 \renewcommand*\caption@setname[2]{%
883 \@ifundefined{fname@#1}{}{\caption@ifdefined\floatname\floatname\@gobbletwo{#1}{#2}}%
884 \@namedef{#1name}{#2}}%
885 \g@addto@macro\fs@plaintop{\def\@fs@mid{\vspace\abovecaptionskip\relax}}%
886 \g@addto@macro\fs@boxed{\def\@fs@mid{\kern\abovecaptionskip\relax}}%
887 \providecommand*\float@getstyle[2]{%
888 \edef#1{%
889 \noexpand\expandafter\noexpand\@gobblefour\noexpand\string
890 \expandafter\expandafter\expandafter\noexpand
891 \csname fst@#2\endcsname}%
892 \edef#1{#1}%
893 \caption@Debug{floatstyle{#2} = `#1'}}%
894 \providecommand*\float@ifcaption[1]{%
895 \expandafter\ifx\csname @float@c@#1\endcsname\float@caption
896 \expandafter\@firstoftwo
897 \else
898 \expandafter\@secondoftwo
899 \fi}%
900 }}{%
901 \providecommand*\float@ifcaption[1]{\@secondoftwo}%
902 }
903 \captionsetup[boxed]{skip=2pt} % do not issue a warning when not used
904 \caption@ifbool{ruled}{%
905 \captionsetup[ruled]{margin=0pt,minmargin=0,slc=0}%
906 }{%
907 \DeclareCaptionStyle{ruled}{labelfont=bf,labelsep=space,strut=0}%
908 }
909 \caption@undefbool{ruled}
910 \caption@IfPackageLoaded{floatflt}[1996/02/27 v1.3]{%
911 \let\caption@ORI@floatingfigure\floatingfigure
912 \def\floatingfigure{%
913 \caption@floatflt{figure}%
914 \caption@ORI@floatingfigure}%
915 \let\caption@ORI@floatingtable\floatingtable
916 \def\floatingtable{%
917 \caption@floatflt{table}%
918 \caption@ORI@floatingtable}%
919 \newcommand*\caption@floatflt[1]{%
920 \caption@settype{#1}%
921 \caption@clearmargin
922 \caption@setoptions{floating#1}%
923 \caption@setanchor}%
924 }{}
925 \caption@IfPackageLoaded{floatrow}[2008/08/02 v0.3b]{%
926 \renewcommand\captionlabel[1]{{\def\FR@tmp{\@captype}\ifnum\floatbox@depth>\@ne
927 \def\FR@tmp{sub\@captype}\setcaptionsubtype*\stepcounter{\FR@tmp}\fi
928 \caption@@@make{\caption@fnum\FR@tmp}{#1}}}
929 \renewenvironment{subfloatrow}{\capsubrowsettings
930 \caption@subfloatrow@hook % as replacement for \captionsetup{subtype}
931 \@nameuse{subfloatrow*}}{\@nameuse{endsubfloatrow*}}
932 \providecommand*\caption@subfloatrow@hook{}
933 \renewenvironment{subfloatrow*}[1][2]{\let\flrow@to\empty
934 \let\Xhsize\sXhsize%\let\Zhsize\sZhsize
935 \FR@ifunloc{\let\FR@ifcountH\@firstoftwo}\let\c@FRobj\c@FRsobj
936 \def\FRleftmargin{}\def\FRrightmargin{}\let\floatrowsep\subfloatrowsep
937 \floatrow[#1]\killfloatstyle
938 \let\caption@makecaption\flrow@makecaption}% <- This line added
939 {\ifdim\lastskip>\z@\unskip\fi
940 \@ifundefined{adjustsubfloats}\relax\adjustsubfloats\endfloatrow}
941 }{}
942 \caption@IfPackageLoaded{fltpage}[1998/10/29 v.0.3]{%
943 \caption@setbool{needfreeze}{1}%
944 \renewcommand\FP@positionLabel{%
945 FP\FP@captype-\number\value{FP@\FP@captype C}-pos}%
946 \renewcommand\FP@helpNote[2]{%
947 \begingroup % save \caption@thepage
948 \caption@pageref{#2}%
949 \typeout{FP#1 is inserted on page \caption@thepage!}%
950 \endgroup}%
951 \renewcommand*\FP@floatBegin[1]{%
952 \def\FP@captype{#1}%
953 \begin{lrbox}{\FP@floatCorpusBOX}%
954 \minipage\hsize % changes from LR mode to vertical mode
955 \caption@freezetype{#1}%
956 \ignorespaces}%
957 \renewcommand*\FP@floatEnd{%
958 \endminipage
959 \end{lrbox}%
960 \stepcounter{FP@\FP@captype C}%
961 \caption@label\FP@positionLabel
962 \FP@helpNote\FP@captype\FP@positionLabel
963 \FP@float
964 {\FP@positionLabel}% location label test
965 {\caption@prepare@defrost
966 \begin\FP@captype[p!]%
967 \usebox\FP@floatCorpusBOX
968 \end\FP@captype}%
969 {\@ifundefined{theH\FP@captype}{}{%
970 \expandafter\l@addto@macro\csname theH\FP@captype\endcsname{.FP}}}%
971 {\caption@prepare@defrost
972 \begin\FP@captype[b!]%
973 \let\FP@savedSetfnumCommand\caption@setfnum
974 \def\caption@setfnum##1{%
975 \FP@savedSetfnumCommand{##1}%
976 \ifx\FP@guide\@empty \else
977 \expandafter\l@addto@macro\csname fnum@##1\endcsname{\ {\FP@guide}}%
978 \fi}%
979 \setlength\abovecaptionskip{2pt plus 2pt minus 1pt}% length above caption
980 \setlength\belowcaptionskip{2pt plus 2pt minus 1pt}% length below caption
981 \caption@setoptions{FP\@captype}%
982 \FP@separatorCaption
983 \caption@defrost
984 \end\FP@captype}%
985 }%
986 }{%
987 \let\caption@ifFPlistcap\@undefined
988 \let\caption@ifFPrefcap\@undefined
989 }
990 \caption@IfPackageLoaded{hyperref}[2003/11/30 v6.74m]{%
991 % Test if hyperref has stopped early
992 \caption@ifundefined\IfHyperBoolean{%
993 \caption@set@bool\caption@ifhyp@stoppedearly0%
994 \caption@ifundefined\H@refstepcounter
995 {\caption@set@bool\caption@ifhyp@stoppedearly1}{%
996 \caption@ifundefined\hyper@makecurrent
997 {\caption@set@bool\caption@ifhyp@stoppedearly1}{%
998 \caption@ifundefined\measuring@true
999 {\caption@set@bool\caption@ifhyp@stoppedearly1}{}}}%
1000 }{%
1001 \def\caption@ifhyp@stoppedearly{\IfHyperBoolean{stoppedearly}}%
1002 }%
1003 \caption@ifhyp@stoppedearly{% hyperref has stopped early
1004 \caption@InfoNoLine{%
1005 Hyperref support is turned off\MessageBreak
1006 because hyperref has stopped early}%
1007 }{%
1008 \AtCaptionSingleLineCheck{\measuring@true}%
1009 \renewcommand*\caption@refstepcounter@{\H@refstepcounter}%
1010 \renewcommand*\caption@makecurrent[2]{%
1011 \caption@makecurrentHref{#1}%
1012 \caption@Debug{hyperref current=\@currentHref}%
1013 \caption@gettitle{#2}}%
1014 \newcommand*\caption@makecurrentHref{\hyper@makecurrent}%
1015 \renewcommand\caption@makeanchor[1]{%
1016 \caption@Debug{hyperref anchor: \@currentHref}%
1017 % If we cannot have nesting, the anchor is empty.
1018 \ifHy@nesting
1019 \expandafter\hyper@@anchor\expandafter{\@currentHref}{#1}%
1020 \else
1021 \Hy@raisedlink{%
1022 \expandafter\hyper@@anchor\expandafter{\@currentHref}{\relax}%
1023 }#1%
1024 \fi}%
1025 \AtCaptionSingleLineCheck{\let\caption@makeanchor\@firstofone}%
1026 \newif\if@capstart
1027 \def\caption@start{\caption@ifhypcap\caption@start@\relax}%
1028 \def\caption@start@{%
1029 \caption@makestart\@captype
1030 \caption@startanchor\@currentHref
1031 \global\@capstarttrue
1032 \let\hc@currentHref\@currentHref
1033 \def\caption@makecurrentHref##1{%
1034 \global\@capstartfalse
1035 \global\let\@currentHref\hc@currentHref}%
1036 \let\caption@makeanchor\@firstofone
1037 }%
1038 \newcommand*\caption@makestart[1]{%
1039 \begingroup
1040 \Hy@hypertexnamesfalse
1041 \hyper@makecurrent{#1.caption}%
1042 \endgroup
1043 \caption@Debug{hypcap start=\@currentHref}}%
1044 \newcommand*\caption@startanchor[1]{%
1045 \ifvmode\begingroup
1046 \caption@Debug{hypcap anchor: #1 (vertical mode)}%
1047 \@tempdima\prevdepth
1048 \nointerlineskip
1049 \vspace*{-\caption@hypcapspace}%
1050 \caption@anchor{#1}%
1051 \vspace*{\caption@hypcapspace}%
1052 \prevdepth\@tempdima
1053 \endgroup\else
1054 \caption@Debug{hypcap anchor: #1 (horizontal mode)}%
1055 \caption@anchor{#1}%
1056 \fi}%
1057 \newcommand*\caption@anchor[1]{%
1058 \ifmeasuring@ \else
1059 \caption@raisedlink{\hyper@anchorstart{#1}\hyper@anchorend}%
1060 \fi}%
1061 \ifx\HyperRaiseLinkLength\@tempdima
1062 \def\caption@raisedlink#1{\ifvmode#1\else\Hy@raisedlink{#1}\fi}%
1063 \else
1064 \let\caption@raisedlink\Hy@raisedlink
1065 \fi
1066 \def\caption@@start{%
1067 \caption@ifundefined\hc@currentHref{%
1068 \caption@Warning{%
1069 The option `hypcap=true' will be ignored for this\MessageBreak
1070 particular \string\caption}}{}}%
1071 \def\caption@freezeHref{%
1072 \let\caption@ORI@start\caption@start
1073 \def\caption@start{\let\caption@start\caption@ORI@start}%
1074 \global\let\caption@currentHref\@undefined
1075 \def\caption@@start{\global\let\caption@currentHref\@currentHref}%
1076 \let\caption@ORI@setfloatcapt\caption@setfloatcapt
1077 \renewcommand*\caption@setfloatcapt{%
1078 \ifx\caption@currentHref\@undefined \else
1079 \let\caption@makeanchor\@firstofone
1080 \fi
1081 \caption@ORI@setfloatcapt}}%
1082 \def\caption@defrostHref{%
1083 \ifx\caption@currentHref\@undefined \else
1084 \caption@startanchor\caption@currentHref
1085 \global\let\caption@currentHref\@undefined
1086 \fi}%
1087 }}{}
1088 \caption@IfPackageLoaded{hypcap}{% v1.0
1089 \ifx\caption@start\relax \else % hyperref hasn't stopped early
1090 \caption@ifundefined\capstarttrue % check for v1.10 of hypcap package
1091 {\def\capstart{\caption@start@}}%
1092 {\def\capstart{\ifcapstart\caption@start@\fi}}%
1093 \let\caption@start\relax
1094 \let\caption@@start\relax
1095 \caption@set@bool\caption@ifhypcap 1%
1096 \renewcommand*\caption@hypcapspace{\hypcapspace}%
1097 \fi}{}
1098 \caption@IfPackageLoaded{listings}[2004/02/13 v1.2]{%
1099 \caption@setbool{lst@Init}{0}%
1100 \lst@AddToHook{Init}{\caption@setbool{lst@Init}{1}}%
1101 \let\caption@ORI@lst@MakeCaption\lst@MakeCaption
1102 \renewcommand*\lst@MakeCaption[1]{% #1 is `t' or `b'
1103 \begingroup
1104 \caption@iflst@Init{}{%
1105 \edef\caption@lst@leftskip{\noexpand\hskip-\the\@totalleftmargin\noexpand\relax}%
1106 \l@addto@macro\caption@beginhook\caption@lst@leftskip}%
1107 \caption@setposition{#1}%
1108 \caption@iftop{%
1109 \@tempdima\belowcaptionskip
1110 \belowcaptionskip\abovecaptionskip
1111 \abovecaptionskip\@tempdima}{}%
1112 \caption@setup{rule=0}%
1113 \caption@setoptions{lstlisting}%
1114 \caption@setautoposition{#1}%
1115 \ifx\lst@@caption\@empty \else
1116 \let\caption@ORI@addcontentsline\addcontentsline
1117 \renewcommand*\addcontentsline[3]{%
1118 \let\addcontentsline\caption@ORI@addcontentsline
1119 \caption@addcontentsline{lstlisting}{\lst@@caption}}%
1120 \fi
1121 \caption@begin{lstlisting}%
1122 \caption@ORI@lst@MakeCaption{#1}%
1123 \caption@end
1124 \endgroup}%
1125 \def\lst@makecaption{\caption@starfalse\@makecaption}%
1126 \def\lst@maketitle{\caption@startrue\@makecaption\@empty}%
1127 \providecommand*\ext@lstlisting{lol}%
1128 \l@addto@macro\caption@beginex@hook{\let\lst@@caption\relax}%
1129 }{}
1130 \providecommand*\LTcaptype{table}
1131 \providecommand*\caption@LT@array{}
1132 \newcommand\caption@AtBeginLongtable{%
1133 \g@addto@macro\caption@LT@array}
1134 \caption@IfPackageLoaded{longtable}[1995/05/24 v3.14]{%
1135 \RequirePackage{ltcaption}[2018/08/26]%
1136 \let\LT@@makecaption\@undefined
1137 \caption@AtBeginDocument{%
1138 \let\caption@ORI@LT@array\LT@array
1139 \renewcommand*\LT@array{%
1140 \caption@LT@array
1141 \caption@ORI@LT@array}}%
1142 \caption@AtBeginLongtable{%
1143 \global\let\caption@opt@@longtable\@undefined
1144 \def\captionsetup{%
1145 \noalign\bgroup
1146 \@ifstar\@captionsetup\@captionsetup}% gobble *
1147 \def\@captionsetup#1{\LT@captionsetup{#1}\egroup}%
1148 \def\LT@captionsetup#1{%
1149 \caption@setup@options\@gobble[@longtable]{#1}%
1150 \global\let\caption@opt@@longtable\caption@opt@@longtable}%
1151 \def\captionlistentry{%
1152 \noalign\bgroup
1153 \@ifstar{\egroup\LT@listentry\LTcaptype}% gobble *
1154 {\egroup\LT@listentry\LTcaptype}}%
1155 %% \let\Hy@LT@currentHlabel\@currentHlabel
1156 %% \let\@currentHlabel\Hy@LT@currentHlabel
1157 \def\continuedfloat{\noalign{%
1158 \caption@OutsideFloat\continuedfloat}}%
1159 \let\bicaption\LT@bicaption
1160 }%
1161 \def\LT@capti@n{%
1162 \@ifstar
1163 {\egroup\LT@c@ption\@gobble[]}%
1164 {\egroup\caption@xdblarg{\LT@c@ption\@firstofone}}}%
1165 \renewcommand\LT@makecaption[3]{%
1166 \caption@LT@make{%
1167 \caption@LT@settype\LTcaptype
1168 \caption@LT@setup
1169 \caption@setautoposition{\ifcase\LT@rows t\else b\fi}%
1170 \caption@startrue#1\caption@starfalse
1171 \caption@prepare@stepcounter\LTcaptype
1172 \caption@begin\LTcaptype
1173 \caption@normalsize
1174 \vskip-\ht\strutbox
1175 \caption@ifdefined\FBifcaptop{%
1176 \let\caption@belowskip\@empty}{}%
1177 \caption@make@above
1178 \caption@@make{#2}{#3}\endgraf
1179 \caption@make@below
1180 \caption@end}}%
1181 \renewcommand*\LT@listentry[2]{%
1182 \begingroup
1183 \caption@LT@settype{#1}%
1184 \caption@listentry\@firstoftwo[{#1}]{#2}%
1185 \endgroup\ignorespaces}%
1186 \newcommand*\caption@LT@settype[1]{%
1187 \caption@settype{#1}%
1188 \ifdim\LTcapwidth=4in \else
1189 \caption@setwidth\LTcapwidth
1190 \fi
1191 \caption@setoptions{longtable}%
1192 \caption@setoptions{@longtable}}%
1193 \caption@AtBeginDocument{\caption@ifdefined\flrow@setlist@{%
1194 \caption@InfoNoLine{Fixing longtable code of `floatrow' package}%
1195 \let\caption@flrow@setlist@\flrow@setlist@
1196 \renewcommand\flrow@setlist@[1]{%
1197 \def\caption@tempa{{table}{longtable}}%
1198 \def\caption@tempb{#1}%
1199 \ifx\caption@tempa\caption@tempb
1200 \def\@captype{table}%
1201 \fi
1202 \caption@flrow@setlist@{#1}}%
1203 }{}}%
1204 }{%
1205 \let\caption@AtBeginLongtable\@gobble
1206 \let\caption@LT@array\@undefined
1207 }
1208 \providecommand*\caption@LT@setup{}
1209 \caption@IfPackageLoaded{picinpar}{%
1210 \long\def\figwindow[#1,#2,#3,#4] {%
1211 \caption@window{figure}%
1212 \caption@setoptions{figwindow}%
1213 \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }%
1214 \long\def\tabwindow[#1,#2,#3,#4] {%
1215 \caption@window{table}%
1216 \caption@setoptions{tabwindow}%
1217 \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }%
1218 \newcommand*\caption@window[1]{%
1219 \let\@makecaption\caption@@make
1220 \caption@setautoposition b%
1221 \caption@settype{#1}%
1222 \caption@clearmargin
1223 \caption@setanchor}%
1224 \newcommand\caption@wincaption[1]{%
1225 \ifdim\picwd=\z@
1226 \let\caption@makecurrent\@gobbletwo
1227 \let\caption@@start\relax
1228 \caption@prepareslc
1229 \else
1230 % don't increment the figure or table counter again
1231 \caption@clrflags
1232 \caption@setcontinued
1233 \fi
1234 \edef\@tempa{\expandafter\noexpand\@car#1\@nil}%
1235 \if\@tempa*%
1236 \let\@tempa\@firstofone
1237 \else\if\@tempa[%]
1238 \let\@tempa\@firstofone
1239 \else
1240 \let\@tempa\@empty
1241 \fi\fi
1242 \expandafter\caption\@tempa{#1}}%
1243 }{}
1244 \newcommand*\piccaptiontype[1]{\def\@piccaptype{#1}}
1245 \caption@IfPackageLoaded{picins}{%
1246 \caption@ifundefined\@piccaptype{%
1247 \caption@iftype{%
1248 \let\@piccaptype\@captype
1249 }{%
1250 \def\@piccaptype{figure}%
1251 }%
1252 }{}%
1253 \let\@captype\@undefined
1254 \def\piccaption{\caption@star\relax{\caption@dblarg\@piccaption}}%
1255 \let\caption@ORI@make@piccaption\make@piccaption
1256 \def\make@piccaption{%
1257 \let\caption@ORI\caption
1258 \long\def\caption[##1]##2{%
1259 \caption@freezeHref % will be defrosted in \ivparpic
1260 \caption@settype\@piccaptype
1261 \caption@clearmargin
1262 \caption@setoptions{parpic}%
1263 \caption@setautoposition b%
1264 \caption@setanchor
1265 \expandafter\expandafter\expandafter\caption@ORI
1266 \expandafter\expandafter\expandafter[%
1267 \expandafter\expandafter\expandafter{%
1268 \expandafter##1\expandafter}\expandafter]\expandafter{##2}}%
1269 \caption@ORI@make@piccaption
1270 \let\caption\caption@ORI}%
1271
1272 \let\caption@ORI@ivparpic\ivparpic
1273 \def\ivparpic(#1,#2)(#3,#4)[#5][#6]#7{%
1274 \let\caption@ORI@noindent\noindent
1275 \def\noindent{%
1276 \caption@defrostHref
1277 \let\noindent\caption@ORI@noindent
1278 \noindent}%
1279 \caption@ORI@ivparpic(#1,#2)(#3,#4)[{#5}][{#6}]{#7}%
1280 \let\noindent\caption@ORI@noindent}%
1281 }{%
1282 \let\piccaptiontype\@undefined
1283 }
1284 \caption@IfPackageLoaded{rotating}[1995/08/22 v2.10]{%
1285 \def\rotcaption{\let\@makecaption\@makerotcaption\caption}%
1286 \def\rotcaptionof{%
1287 \caption@teststar\caption@of{\rotcaption*}\rotcaption}%
1288 \long\def\@makerotcaption#1#2{%
1289 \rotatebox{90}{%
1290 \ifdim\caption@width=\z@
1291 \caption@setwidth{.8\vsize}%
1292 \l@addto@macro\caption@singleline{%
1293 \caption@setup{parbox=none}}%
1294 \fi
1295 \let\caption@calcmargin\relax
1296 \caption@@make{#1}{#2}}%
1297 \nobreak\hspace{12pt}}%
1298 }{}
1299 \caption@ifdocumentclass{koma}%
1300 {\long\def\caption@IfKomaPackageLoaded#1[#2]#3#4{%
1301 \caption@InfoNoLine{KOMA-Script #1 package detected}%
1302 #3}}%
1303 {\let\caption@IfKomaPackageLoaded\caption@IfPackageLoaded}
1304 \caption@IfKomaPackageLoaded{scrextend}[2002/07/01 v3.0]{%
1305 \let\caption@addmargin@env\@addmargin
1306 \renewcommand*\@addmargin{%
1307 \@testopt\caption@@addmargin\@tempa}%
1308 \def\caption@@addmargin[#1]#2{%
1309 \caption@addmargin@env[{#1}]{#2}%
1310 \caption@set@addmargin
1311 \ignorespaces}%
1312 \newdimen\caption@addmargin@hsize
1313 \newdimen\caption@addmargin@linewidth
1314 \providecommand*\caption@set@addmargin{%
1315 \caption@addmargin@hsize\hsize
1316 \caption@addmargin@linewidth\linewidth
1317 \l@addto@macro\caption@beginex@hook\caption@test@addmargin}%
1318 \providecommand\caption@test@addmargin{%
1319 \ifdim\hsize=\caption@addmargin@hsize
1320 \ifdim\linewidth=\caption@addmargin@linewidth
1321 \hsize=\linewidth
1322 \fi
1323 \fi}%
1324 }{}%
1325 \caption@IfPackageLoaded{sidecap}[2003/06/06 v1.6f]{%
1326 \caption@setbool{needfreeze}{1}%
1327 \let\caption@ORI@SC@zfloat\SC@zfloat
1328 \def\SC@zfloat#1#2#3[#4]{%
1329 \caption@ORI@SC@zfloat{#1}{#2}{#3}[#4]%
1330 \SC@RestoreCommands
1331 \caption@freezetype{#2}%
1332 \let\SC@label\label
1333 \ignorespaces}%
1334 \providecommand*\SC@RestoreCommands{%
1335 \let\caption=\SC@orig@caption \let\label=\SC@orig@label}%
1336 \let\caption@ORI@endSC@FLOAT\endSC@FLOAT
1337 \def\endSC@FLOAT{%
1338 \def\caption@setSC@justify{%
1339 \caption@clearmargin
1340 \ifx\SC@justify\@empty \else
1341 \let\caption@justification\SC@justify
1342 \let\SC@justify\@empty
1343 \fi}%
1344 \let\caption\SC@orig@caption
1345 \def\SC@orig@caption[##1]##2{%
1346 \caption@setSC@justify
1347 %%% \caption@setoptions{SC}%
1348 \caption@setoptions{SC\@captype}%
1349 \caption@defrost}%
1350 \caption@setSC@justify % for compatibility mode
1351 \caption@prepare@defrost
1352 \caption@ORI@endSC@FLOAT}%
1353 }{}
1354 \caption@IfPackageLoaded{subfigure}[2002/01/23 v2.1]{%
1355 \def\sf@ifpositiontop{%
1356 \ifx\@captype\@undefined
1357 \expandafter\@gobbletwo
1358 \else\ifx\@captype\relax
1359 \expandafter\expandafter\expandafter\@gobbletwo
1360 \else
1361 \expandafter\expandafter\expandafter\sf@if@position@top
1362 \fi\fi}
1363 \def\sf@if@position@top{%
1364 \@ifundefined{if\@captype topcap}%
1365 {\@gobbletwo}%
1366 {\@nameuse{if\@captype topcap}%
1367 \expandafter\@firstoftwo
1368 \else
1369 \expandafter\@secondoftwo
1370 \fi}}
1371 }{}
1372 \caption@IfPackageLoaded{supertabular}[2002/07/19 v4.1e]{%
1373 \renewcommand*\tablecaption{%
1374 \caption@star
1375 {\refstepcounter{table}}%
1376 {\caption@dblarg{\@xtablecaption}}}%
1377 \let\caption@ORI@xtablecaption\@xtablecaption
1378 \long\def\@xtablecaption[#1]#2{%
1379 \caption@gettitle{#2}%
1380 \caption@ORI@xtablecaption[{#1}]{#2}}%
1381 \long\def\ST@caption#1[#2]#3{\par%
1382 \caption@settype{#1}%
1383 \caption@setoptions{supertabular}%
1384 \caption@setposition{\if@topcaption t\else b\fi}%
1385 \caption@beginex{#1}{#2}{#3}%
1386 \caption@parboxrestore
1387 \caption@normalsize
1388 \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
1389 \caption@end}%
1390 }{}
1391 \caption@IfPackageLoaded{xtab}[2000/04/09 v2.3]{%
1392 \renewcommand*\tablecaption{%
1393 \caption@star
1394 {\refstepcounter{table}}%
1395 {\caption@dblarg{\@xtablecaption}}}%
1396 \let\caption@ORI@xtablecaption\@xtablecaption
1397 \long\def\@xtablecaption[#1]#2{%
1398 \caption@gettitle{#2}%
1399 \caption@ORI@xtablecaption[{#1}]{#2}}%
1400 \long\def\ST@caption#1[#2]#3{\par%
1401 \caption@settype{#1}%
1402 \caption@setoptions{xtabular}%
1403 \caption@set{position}{\if@topcaption t\else b\fi}%
1404 \@initisotab
1405 \caption@beginex{#1}{#2}{#3}%
1406 \caption@parboxrestore
1407 \caption@normalsize
1408 \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
1409 \caption@end
1410 \global\advance\ST@pageleft -\PWSTcapht
1411 \ST@trace\tw@{Added caption. Space left for xtabular: \the\ST@pageleft}}%
1412 }{}
1413 \caption@IfPackageLoaded{threeparttable}[2003/06/13 v3.0]{%
1414 \let\caption@ORI@threeparttable\threeparttable
1415 \renewcommand*\threeparttable{%
1416 \caption@setthreeparttabletype{threepart}{table}%
1417 \caption@ORI@threeparttable}%
1418 \let\caption@ORI@measuredfigure\measuredfigure
1419 \renewcommand*\measuredfigure{%
1420 \caption@setthreeparttabletype{measured}{figure}%
1421 \caption@ORI@measuredfigure}%
1422 \newcommand*\caption@setthreeparttabletype[2]{%
1423 \caption@ifsubtype
1424 {\def\caption@threeparttabletype{#1sub#2}%
1425 \let\caption@setanchor\relax}%
1426 {\caption@settype{\@ifundefined{@captype}{#2}{\@captype}}%
1427 \def\caption@threeparttabletype{#1#2}}%
1428 %%% \caption@setposition{auto}% ?
1429 \caption@clearmargin
1430 \caption@setoptions\caption@threeparttabletype
1431 \caption@setanchor}%
1432 \def\TPT@caption#1[#2]#3{%
1433 \gdef\TPT@docapt{%
1434 \global\let\TPT@docapt\@undefined
1435 \caption@setautoposition\caption@TPT@position
1436 \TPT@LA@caption{#1}[{#2}]{#3}}%
1437 \ifx\TPT@hsize\@empty
1438 \let\label\TPT@gatherlabel % Bug: does not work for measuredfigures
1439 \gdef\caption@TPT@position{t}%
1440 \g@addto@macro\TPT@docapt\caption@TPT@eatvskip
1441 \else
1442 \def\caption@TPT@position{b}%
1443 \TPT@docapt
1444 \fi
1445 \ignorespaces}%
1446 %\newcommand*\caption@TPT@eatvskip{\vskip-.2\baselineskip}%
1447 \def\caption@TPT@eatvskip#1\vskip{#1\@tempdima=}%
1448 }{}
1449 \caption@IfPackageLoaded{wrapfig}[2003/01/31 v3.6]{%
1450 \renewcommand*\wrapfloat[1]{%
1451 \def\@captype{#1}%
1452 \@ifundefined{fst@#1}{}{%
1453 \@nameuse{fst@#1}%
1454 \def\WF@floatstyhook{\let\@currbox\WF@box
1455 \global\setbox\WF@box\float@makebox{\wd\WF@box}}}%
1456 \@testopt\WF@wr{}}
1457 \def\WF@rapt[#1]#2{% final two args: #1 = overhang, #2 = width,
1458 \gdef\WF@ovh{#1}% hold overhang for later, when \width is known
1459 \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}%
1460 \expandafter\WF@captionstyhook\expandafter{\@captype}% <= new
1461 \ifdim\hsize>\z@ \@parboxrestore \else
1462 \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption
1463 \ignorespaces \fi}%
1464 \def\WF@captionstyhook#1{%
1465 \let\@captype\@undefined
1466 \@ifundefined{fst@#1}{}{\@float@setevery{#1}}%
1467 \caption@settype{#1}%
1468 \caption@clearmargin
1469 %%% \caption@setoptions{wrap}%
1470 \caption@setoptions{wrap#1}%
1471 \caption@setanchor}%
1472 }{}
1473 \newcommand*\caption@checkcounter[1]{%
1474 \caption@check{\the#1}{\@nameuse{the#1}}}
1475 \newcommand*\caption@check[3]{%
1476 \edef\caption@tempa{#2}%
1477 \edef\caption@tempb{#3}%
1478 \ifx\caption@tempa\caption@tempb
1479 \caption@Info{\string#1 = \caption@tempa}%
1480 \else
1481 \caption@Error{\string#1 = \caption@tempa\space <> \caption@tempb}%
1482 \fi}
1483 \newcommand*\caption@checkref[2]{%
1484 \@ifundefined{r@#1}{}%
1485 {\expandafter\expandafter\expandafter
1486 \caption@@checkref\csname r@#1\endcsname\@nil{#1}{#2}}}
1487 \def\caption@@checkref#1#2\@nil#3#4{%
1488 \caption@check{\ref{#3}}{#1}{#4}}
1489 \caption@endtitles@code
1490 \let\caption@endtitles@code\@undefined
1491 \let\AfterCaptionPackage\@firstofone
1492 \endinput
1493 %%
1494 %% End of file `caption.sty'.