Debian Codegraph @

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

raw
1 %%
2 %% This is file `caption3.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% caption3.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.0} {2003-12-20}{caption3_2007-04-11.sty} % for caption v3.0
42 \DeclareRelease{v1.1} {2007-09-01}{caption3_2010-01-14.sty} % for caption v3.1
43 \DeclareRelease{v1.3} {2011-08-06}{caption3_2011-11-01.sty} % for caption v3.2
44 \DeclareRelease{v1.8} {2013-01-10}{caption3_2019-09-01.sty} % for caption v3.3
45 \DeclareRelease{v1.13}{2019-11-24}{caption3_2020-07-29.sty} % for caption v3.4
46 \DeclareRelease{v2.0} {2020-08-30}{caption3_2020-10-26.sty} % for caption v3.5
47 \DeclareCurrentRelease{v2.3}{2022-02-20} % for caption v3.6
48 \ProvidesPackage{caption3}[2023/07/31 v2.4d caption3 kernel (AR)]
49 \@ifundefined{kernel@ifnextchar}{\let\kernel@ifnextchar\@ifnextchar}{}
50 \providecommand*\@nameundef[1]{%
51 \expandafter\let\csname #1\endcsname\@undefined}
52 \providecommand\l@addto@macro[2]{%
53 \edef#1{\unexpanded\expandafter{#1#2}}}
54 \def\bothIfFirst#1#2{\caption@bothif{#1}{#1#2}}
55 \def\bothIfSecond#1#2{\caption@bothif{#2}{#1#2}}
56 \newcommand*\caption@bothif[2]{%
57 \begingroup
58 \caption@prepare@bothif
59 \protected@xdef\caption@tempa{#1}%
60 \endgroup
61 \ifx\caption@tempa\@empty \else
62 #2%
63 \fi}
64 \providecommand*\caption@prepare@bothif{}
65 \g@addto@macro\caption@prepare@bothif{%
66 \let\inputencoding\@gobble}
67 \newcommand*\caption@ifundefined[1]{%
68 \ifdefined#1%
69 \ifx#1\relax
70 \expandafter\expandafter\expandafter\@firstoftwo
71 \else
72 \expandafter\expandafter\expandafter\@secondoftwo
73 \fi
74 \else
75 \expandafter\@firstoftwo
76 \fi}
77 \newcommand*\caption@ifdefined[1]{%
78 \ifdefined#1%
79 \ifx#1\relax
80 \expandafter\expandafter\expandafter\@secondoftwo
81 \else
82 \expandafter\expandafter\expandafter\@firstoftwo
83 \fi
84 \else
85 \expandafter\@secondoftwo
86 \fi}
87 \newcommand*\caption@ifinlist{%
88 \@expandtwoargs\caption@@ifinlist}
89 \newcommand*\caption@@ifinlist[2]{%
90 \begingroup
91 \def\@tempa##1,#1,##2\@nil{%
92 \endgroup
93 \ifx\relax##2\relax
94 \expandafter\@secondoftwo
95 \else
96 \expandafter\@firstoftwo
97 \fi}%
98 \@tempa,#2,#1,\@nil}%
99 \newcommand*\caption@ifin@list[2]{%
100 \caption@ifempty@list#1%
101 {\@secondoftwo}%
102 {\@expandtwoargs\caption@@ifinlist{#2}{#1}}}
103 \newcommand*\caption@g@addto@list[2]{%
104 \caption@ifempty@list#1{\gdef#1{#2}}{\g@addto@macro#1{,#2}}}
105 \newcommand*\caption@l@addto@list[2]{%
106 \caption@ifempty@list#1{\def#1{#2}}{\l@addto@macro#1{,#2}}}
107 \newcommand*\caption@g@removefrom@list[2]{%
108 \caption@l@removefrom@list#1{#2}%
109 \global\let#1#1}
110 \newcommand*\caption@l@removefrom@list[2]{%
111 \caption@ifempty@list#1{}{\@expandtwoargs\@removeelement{#2}#1#1}}
112 \newcommand*\caption@for@list[2]{%
113 \caption@ifempty@list#1{}%
114 {\def\caption@tempb##1{#2}%
115 \@for\caption@tempa:=#1\do{%
116 \expandafter\caption@tempb\expandafter{\caption@tempa}}}}
117 \newcommand*\caption@ifempty@list[1]{%
118 \ifx#1\@undefined
119 \expandafter\@firstoftwo
120 \else\ifx#1\relax
121 \expandafter\expandafter\expandafter\@firstoftwo
122 \else\ifx#1\@empty
123 \expandafter\expandafter\expandafter\expandafter
124 \expandafter\expandafter\expandafter\@firstoftwo
125 \else
126 \expandafter\expandafter\expandafter\expandafter
127 \expandafter\expandafter\expandafter\@secondoftwo
128 \fi\fi\fi}
129 \newcommand*\caption@setbool[1]{%
130 \expandafter\caption@set@bool\csname caption@if#1\endcsname}
131 \newcommand*\caption@set@bool[2]{%
132 \caption@if@bool{#2}{\let#1\@firstoftwo}{\let#1\@secondoftwo}}
133 \newcommand*\caption@if@bool[1]{%
134 \caption@ifinlist{#1}{1,true,yes,on}%
135 {\@firstoftwo}%
136 {\caption@ifinlist{#1}{0,false,no,off}%
137 {}%
138 {\caption@Error{Undefined boolean value `#1'}}%
139 \@secondoftwo}}
140 \newcommand*\caption@ifbool[1]{\@nameuse{caption@if#1}}
141 \newcommand*\caption@undefbool[1]{\@nameundef{caption@if#1}}
142 \newcommand*\caption@teststar[3]{%
143 \@ifstar{#1{#2}}{#1{#3}}}
144 \newcommand*\caption@teststar@[3]{%
145 \@ifstar{#1{#2}}{\caption@ifatletter{#1{#2}}{#1{#3}}}}
146 \AtBeginDocument{\let\caption@teststar@\caption@teststar}
147 \newcommand*\caption@ifatletter{%
148 \ifnum\the\catcode`\@=11
149 \expandafter\@firstoftwo
150 \else
151 \expandafter\@secondoftwo
152 \fi}
153 \AtBeginDocument{\let\caption@ifatletter\@secondoftwo}
154 \newcommand*\caption@withoptargs[1]{%
155 \@ifstar
156 {\def\caption@tempa{*}\caption@@withoptargs{#1}}%
157 {\def\caption@tempa{}\caption@@withoptargs{#1}}}
158 \def\caption@@withoptargs#1{%
159 \kernel@ifnextchar[%]
160 {\caption@@@withoptargs{#1}}%
161 {\caption@@@@withoptargs{#1}}}
162 \def\caption@@@withoptargs#1[#2]{%
163 \l@addto@macro\caption@tempa{[{#2}]}%
164 \caption@@withoptargs{#1}}
165 \def\caption@@@@withoptargs#1{%
166 \def\caption@tempb{#1}%
167 \expandafter\caption@tempb\expandafter{\caption@tempa}}
168 \DeclareRobustCommand*\caption@gobble{%
169 \caption@withoptargs\@gobbletwo}
170 \newcommand\caption@iftokens[1]{%
171 \if\relax\detokenize{#1}\relax
172 \expandafter\@secondoftwo
173 \else
174 \expandafter\@firstoftwo
175 \fi}
176 \let\caption@begindocumenthook\@empty
177 \let\caption@@begindocumenthook\@empty
178 \def\caption@AtBeginDocument{%
179 \caption@teststar\g@addto@macro
180 \caption@@begindocumenthook\caption@begindocumenthook}
181 \AtBeginDocument{%
182 \caption@InfoNoLine{Begin \noexpand\AtBeginDocument code}%
183 \def\caption@AtBeginDocument{%
184 \@ifstar{\g@addto@macro\caption@@begindocumenthook}\@firstofone}%
185 \caption@begindocumenthook
186 \let\caption@begindocumenthook\relax
187 \def\caption@AtBeginDocument{%
188 \@ifstar\@firstofone\@firstofone}%
189 \caption@@begindocumenthook
190 \let\caption@@begindocumenthook\relax
191 \caption@InfoNoLine{End \noexpand\AtBeginDocument code}}
192 \newcommand*\caption@Info[1]{%
193 \PackageInfo{caption}{#1}}
194 \newcommand*\caption@InfoNoLine[1]{%
195 \caption@Info{#1\@gobble}}
196 \newcommand*\caption@Warning[1]{%
197 \caption@WarningNoLine{#1\on@line}}
198 \newcommand*\caption@WarningNoLine[1]{%
199 \PackageWarning{caption}{#1.^^J\caption@wh\@gobbletwo}}
200 \newcommand*\caption@wh{%
201 See the caption package documentation for explanation.}
202 \newcommand*\caption@Error[1]{%
203 \PackageError{caption}{#1}{\caption@@eh{caption}}}
204 \newcommand*\caption@@eh[1]{%
205 If you do not understand this error, please take a closer look\MessageBreak
206 at the documentation of the `#1' package, especially the\MessageBreak
207 section about errors.\MessageBreak\@ehc}
208 \let\caption@KV@err\caption@Error
209 \RequirePackage{keyval}[1997/11/10]
210 \providecommand*\undefine@key[2]{%
211 \@nameundef{KV@#1@#2}\@nameundef{KV@#1@#2@default}}
212 \providecommand*\@preamble@keys{}
213 \providecommand*\@onlypreamble@key[2]{\@cons\@preamble@keys{{#1}{#2}}}
214 \@onlypreamble\@onlypreamble@key
215 \@onlypreamble\@preamble@keys
216 \providecommand*\@notprerr@key[1]{\KV@err{Can be used only in preamble}}
217 \caption@AtBeginDocument*{%
218 \def\@elt#1#2{\expandafter\let\csname KV@#1@#2\endcsname\@notprerr@key}%
219 \@preamble@keys
220 \let\@elt\relax}
221 \newcommand*\DeclareCaptionOption{%
222 \caption@teststar\caption@declareoption\AtEndOfPackage\@gobble}
223 \@onlypreamble\DeclareCaptionOption
224 \newcommand*\caption@declareoption[2]{%
225 #1{\undefine@key{caption}{#2}}\caption@declare@option{#2}}
226 \@onlypreamble\caption@declareoption
227 \newcommand*\caption@declare@option{%
228 \define@key{caption}}
229 %% no \@onlypreamble\caption@declare@option since it will be used by \captionsetup
230 \newcommand*\DeclareCaptionOptionNoValue{%
231 \caption@teststar\caption@declareoption@novalue\AtEndOfPackage\@gobble}
232 \@onlypreamble\DeclareCaptionOptionNoValue
233 \newcommand\caption@declareoption@novalue[3]{%
234 \caption@declareoption{#1}{#2}[\KV@err]{%
235 \caption@option@novalue{#2}{##1}{#3}}}
236 \@onlypreamble\caption@declareoption@novalue
237 \newcommand*\caption@option@novalue[2]{%
238 \ifx\KV@err#2%
239 \expandafter\@firstofone
240 \else
241 \KV@err{No value allowed for #1}%
242 \expandafter\@gobble
243 \fi}
244 \newcommand*\captionsetup{%
245 \caption@teststar@\@captionsetup\@gobble\@firstofone}
246 \newcommand*\@captionsetup[1]{%
247 \kernel@ifnextchar[%]
248 {\caption@setup@options#1}%
249 {\caption@setup}}
250 \newcommand*\caption@setup{%
251 \caption@setkeys{caption}}
252 \def\caption@setup@options#1[#2]{%
253 \kernel@ifnextchar[%]
254 {\caption@stepthecounter
255 \@expandtwoargs\caption@setup@options@@{#2}{@\caption@thecounter}#1}%
256 {\caption@setup@options@#1{#2}}}
257 \def\caption@setup@options@@#1#2#3[#4]#5{%
258 \caption@declare@option{#2}[]{\caption@setup@options@\@gobble{#4}{#5}}%
259 \caption@setup@options@#3{#1}{#2}}
260 \newcommand*\caption@setup@options@[3]{%
261 \@bsphack
262 #1{\caption@addtooptlist{#2}}%
263 \caption@checkoptions{#3}%
264 \expandafter\caption@l@addto@list\csname caption@opt@#2\endcsname{#3}%
265 \@esphack}
266 \newcommand*\caption@checkoptions[1]{%
267 \begingroup
268 \caption@prepare@optioncheck
269 \caption@setup{#1}%
270 \endgroup}
271 \providecommand*\caption@prepare@optioncheck{}
272 \let\IfCaptionOptionCheck\@secondoftwo
273 \g@addto@macro\caption@prepare@optioncheck{%
274 \let\IfCaptionOptionCheck\@firstoftwo}
275 \newcommand*\clearcaptionsetup{%
276 \caption@teststar@\@clearcaptionsetup\@gobble\@firstofone}
277 \newcommand*\@clearcaptionsetup[1]{%
278 \let\caption@tempa#1%
279 \@testopt\@@clearcaptionsetup{}}
280 \def\@@clearcaptionsetup[#1]#2{%
281 \@bsphack
282 \expandafter\caption@ifempty@list\csname caption@opt@#2\endcsname
283 {\caption@tempa{\caption@Warning{Option list `#2' undefined}}}%
284 {\ifx,#1,%
285 \caption@clearsetup{#2}%
286 \else
287 \caption@@removefromsetup{#1}{#2}%
288 \fi}%
289 \@esphack}
290 \newcommand*\caption@clearsetup[1]{%
291 \caption@removefromoptlist{#1}%
292 \@nameundef{caption@opt@#1}}
293 \newcommand*\caption@removefromsetup{%
294 \let\caption@tempa\@gobble
295 \caption@@removefromsetup}
296 \newcommand*\caption@@removefromsetup[2]{%
297 \expandafter\let\expandafter\@tempa\csname caption@opt@#2\endcsname
298 \expandafter\let\csname caption@opt@#2\endcsname\@undefined
299 \def\@tempb##1=##2\@nil{##1}%
300 \edef\@tempc{#1}%
301 \@for\@tempa:=\@tempa\do{%
302 \edef\@tempd{\expandafter\@tempb\@tempa=\@nil}%
303 \ifx\@tempd\@tempc
304 \let\caption@tempa\@gobble
305 \else
306 \expandafter\expandafter\expandafter\caption@l@addto@list
307 \expandafter\csname caption@opt@#2\expandafter\endcsname
308 \expandafter{\@tempa}%
309 \fi}%
310 \expandafter\caption@ifempty@list\csname caption@opt@#2\endcsname
311 {\caption@removefromoptlist{#2}}{}%
312 \caption@tempa{\caption@Warning{%
313 Option `#1' was not in list `#2'}}}
314 \newcommand*\showcaptionsetup[2][\@firstofone]{%
315 \@bsphack
316 \GenericWarning{}{%
317 #1 Caption Info: Option list on `#2'\MessageBreak
318 #1 Caption Data: \@ifundefined{caption@opt@#2}{%
319 -none-%
320 }{%
321 {\expandafter\expandafter\expandafter\strip@prefix
322 \expandafter\meaning\csname caption@opt@#2\endcsname}%
323 }}%
324 \@esphack}
325 \DeclareCaptionOption{options}{\caption@setoptions{#1}}
326 \newcommand*\caption@setoptions[1]{%
327 \caption@Debug{options=#1}%
328 \expandafter\let\expandafter\caption@opt\csname caption@opt@#1\endcsname
329 \ifx\caption@opt\relax \else
330 \caption@xsetup\caption@opt
331 \caption@clearsetup{#1}%
332 \fi}
333 \newcommand*\caption@xsetup[1]{\expandafter\caption@setup\expandafter{#1}}
334 \newcommand*\caption@addtooptlist[1]{%
335 \@ifundefined{caption@opt@#1@lineno}%
336 {\caption@dooptlist\caption@g@addto@list{#1}%
337 \expandafter\xdef\csname caption@opt@#1@lineno\endcsname{\the\inputlineno}}%
338 {}}
339 \newcommand*\caption@removefromoptlist[1]{%
340 \caption@dooptlist\caption@g@removefrom@list{#1}%
341 \global\expandafter\let\csname caption@opt@#1@lineno\endcsname\@undefined}
342 \newcommand*\caption@dooptlist[2]{%
343 \begingroup
344 \edef\@tempa{#2}\@onelevel@sanitize\@tempa
345 \expandafter#1\expandafter\caption@optlist\expandafter{\@tempa}%
346 \endgroup}
347 \AtEndDocument{%
348 \caption@for@list\caption@optlist
349 {\caption@WarningNoLine{%
350 Unused \string\captionsetup[#1]
351 on input line \csname caption@opt@#1@lineno\endcsname}}}
352 \newcommand*\caption@setkeys{\@dblarg\caption@@setkeys}
353 \long\def\caption@@setkeys[#1]#2#3{%
354 \@bsphack
355 \expandafter\let\csname ORI@KV@err\caption@keydepth\endcsname\KV@err
356 \expandafter\let\csname ORI@KV@errx\caption@keydepth\endcsname\KV@errx
357 \expandafter\let\csname ORI@XKV@err\caption@keydepth\endcsname\XKV@err
358 \edef\caption@keydepth{\caption@keydepth i}%
359 \expandafter\let\expandafter\KV@err\csname #1@KV@err\endcsname
360 \ifx\KV@err\relax
361 \def\KV@err##1{\PackageError{#1}{##1}{%
362 See the #1 package documentation for explanation.}}%
363 \fi
364 \def\KV@errx{\KV@err}%
365 \def\XKV@err{\let\@tempa\XKV@tkey\KV@err}%
366 \caption@Debug{\noexpand\setkeys{#2}{#3}}%
367 \setkeys{#2}{#3}%
368 \edef\caption@keydepth{\expandafter\@gobble\caption@keydepth}%
369 \expandafter\let\expandafter\KV@err\csname ORI@KV@err\caption@keydepth\endcsname
370 \expandafter\let\expandafter\KV@errx\csname ORI@KV@errx\caption@keydepth\endcsname
371 \expandafter\let\expandafter\XKV@err\csname ORI@XKV@err\caption@keydepth\endcsname
372 \@esphack}
373 \let\caption@keydepth\@empty
374 \newcommand*\caption@ExecuteOptions[2]{%
375 \expandafter\@expandtwoargs\csname caption@setkeys@#1\endcsname{#1}{#2}}%
376 \@onlypreamble\caption@ExecuteOptions
377 \newcommand*\caption@ProcessOptions{%
378 \caption@teststar\caption@@ProcessOptions\@gobble\@firstofone}
379 \@onlypreamble\caption@ProcessOptions
380 \newcommand\caption@@ProcessOptions[2]{%
381 \let\@tempc\relax
382 \let\caption@tempa\@empty
383 #1{% \@firstofone -or- \@gobble
384 \@for\CurrentOption:=\@classoptionslist\do{%
385 \@ifundefined{KV@#2@\CurrentOption}{}{%
386 \@ifundefined{KV@#2@\CurrentOption @default}{%
387 \PackageInfo{#2}{Global option `\CurrentOption' ignored}%
388 }{%
389 \PackageInfo{#2}{Global option `\CurrentOption' processed}%
390 \edef\caption@tempa{\caption@tempa\CurrentOption,}%
391 \@expandtwoargs\@removeelement\CurrentOption
392 \@unusedoptionlist\@unusedoptionlist
393 }%
394 }%
395 }%
396 \let\CurrentOption\@empty
397 }%
398 \caption@ExecuteOptions{#2}{\caption@tempa\@ptionlist{\@currname.\@currext}}%
399 \AtEndOfPackage{\let\@unprocessedoptions\relax}}
400 \@onlypreamble\caption@@ProcessOptions
401 \newcommand\caption@SetupOptions[2]{%
402 \@namedef{caption@setkeys@#1}##1##2{#2}%
403 \expandafter\@onlypreamble\csname caption@setkeys@#1\endcsname
404 \@cons\caption@SetupOptions@list{{#1}}}
405 \@onlypreamble\caption@SetupOptions
406 \newcommand*\caption@SetupOptions@list{}
407 \@onlypreamble\caption@SetupOptions@list
408 %% Unfortunately we have to patch internal \LaTeX\ code here
409 %% to get rid of unnecessary ``Option clash'' error messages.
410 %% I have asked Frank Mittelbach and David Carlisle in 2018
411 %% and have asked Frank again in 2020 for a proper interface instead of
412 %% this dirty hack, but my requests got declined.
413 \let\caption@onefilewithoptions\@onefilewithoptions
414 \def\@onefilewithoptions#1[#2]{%
415 \begingroup
416 \def\@tempa{%
417 \endgroup
418 \caption@onefilewithoptions{#1}[{#2}]}%
419 \def\@tempb{#1}%
420 \def\@elt##1{%
421 \def\@tempc{##1}%
422 \ifx\@tempb\@tempc
423 \def\@tempa{%
424 \endgroup
425 \caption@ExecuteOptions{#1}{#2}%
426 \caption@onefilewithoptions{#1}[]}%
427 \fi}
428 \caption@SetupOptions@list
429 \@tempa}
430 \@onlypreamble\caption@onefilewithoptions
431 \newcommand*\caption@decl[3][\def]{%
432 \global\long\expandafter#1\csname caption@#2@#3\endcsname}
433 \@onlypreamble\caption@decl
434 \newcommand*\caption@ifdecl[2]{%
435 \@ifundefined{caption@#1@#2}\@secondoftwo\@firstoftwo}
436 \newcommand*\caption@checkdecl[2]{%
437 \caption@ifdecl{#1}{#2}%
438 \@firstofone
439 {\caption@Error{Undefined #1 `#2'}%
440 \@gobble}}
441 \newcommand*\caption@set{%
442 \caption@maparg\caption@@set}%
443 \newcommand*\caption@@set[3]{%
444 \caption@checkdecl{#1}{#3}{%
445 \expandafter\def\csname caption@#2\expandafter\endcsname\expandafter{\csname caption@#1@#3\endcsname}}}
446 \newcommand*\SetCaptionDefault{%
447 \caption@teststar\caption@setdefault\def\edef}
448 \@onlypreamble\SetCaptionDefault
449 \newcommand*\caption@setdefault[2]{%
450 \@ifundefined{caption@setdefault@#2}%
451 {\caption@maparg\caption@@setdefault}%
452 {\@nameuse{caption@setdefault@#2}{#1}}%
453 {#2}}
454 \newcommand*\caption@@setdefault[3]{%
455 \caption@ifdefault{#3}%
456 {\caption@Error{Invalid argument for \string\SetCaptionDefault: `#3'}}% would cause an infinite loop otherwise
457 {\caption@@set{#1}{#2@default}{#3}}}
458 \newcommand*\caption@ifdefault{\caption@ifequal{default}}
459 \newcommand*\caption@ifequal[2]{%
460 \edef\caption@tempa{#1}%
461 \edef\caption@tempb{#2}%
462 \ifx\caption@tempa\caption@tempb
463 \expandafter\@firstoftwo
464 \else
465 \expandafter\@secondoftwo
466 \fi}
467 \newcommand*\caption@setmapping[2]{%
468 \@namedef{caption@map@#1}{#2}}
469 \@onlypreamble\caption@setmapping
470 \newcommand*\caption@maparg[2]{%
471 \@ifundefined{caption@map@#2}%
472 {#1{#2}}%
473 {#1{\csname caption@map@#2\endcsname}}%
474 {#2}}
475 \def\caption@switchdefault#1#2{%
476 \def\caption@tempa##1{#2}%
477 \expandafter\caption@tempa\csname caption@#1@default\endcsname
478 \caption@setdefault\def{#1}}
479 \def\caption@restoredefault#1#2{%
480 \caption@checkdecl{#1}{default}{%
481 \caption@ifdefined#2{%
482 \expandafter\let\csname caption@#1@default\endcsname#2%
483 \let#2\@undefined}{}}}
484 \newcommand*\SetCaptionFallback{%
485 \caption@maparg\caption@@setfallback}
486 \@onlypreamble\SetCaptionFallback
487 \newcommand*\caption@@setfallback[3]{%
488 \caption@ifequal{fallback}{#3}%
489 {\caption@Error{Invalid argument for \string\SetCaptionFallback: `#3'}}% would cause an infinite loop otherwise
490 {\caption@@set{#1}{#2@fallback}{#3}}}
491 \@onlypreamble\caption@@setfallback
492 \newcommand*\caption@decl@package[2]{%
493 \kernel@ifnextchar[%]
494 {\caption@declare@package{#1}{#2}}%
495 {\caption@declarepackage{#1}{#2}}}
496 \@onlypreamble\caption@decl@package
497 \def\caption@declare@package#1#2[#3]#4{%
498 \global\@namedef{caption@#1@#4@package}{#3}%
499 #2{#4}}
500 \@onlypreamble\caption@declare@package
501 \newcommand*\caption@declarepackage[3]{%
502 \global\@nameundef{caption@#1@#3@package}%
503 #2{#3}}
504 \@onlypreamble\caption@declarepackage
505 \newcommand*\caption@load@package[2]{%
506 \expandafter\let\expandafter\caption@tempa\csname caption@#1@#2@package\endcsname
507 \caption@ifdefined\caption@tempa
508 {\caption@requirepackage\caption@tempa{#1=#2}}%
509 {}}
510 \newcommand*\DeclareCaptionLength[1]{%
511 \expandafter\newdimen\csname caption@#1\endcsname
512 \@namedef{caption@setdefault@#1}{\caption@setdefault@length}%
513 \SetCaptionDefault*{#1}}
514 \@onlypreamble\DeclareCaptionLength
515 \newcommand*\caption@setdefault@length[3]{%
516 \expandafter#1\csname caption@#2@default\endcsname{#3}}
517 \newcommand*\caption@setlength[2]{%
518 \caption@ifdefault{#2}%
519 {\expandafter\let\expandafter\caption@tempa\csname caption@#1@default\endcsname}%
520 {\def\caption@tempa{#2}}%
521 \expandafter\setlength\csname caption@#1\endcsname\caption@tempa}
522 \newdimen\caption@tempdima
523 \newdimen\captionmargin
524 \setlength\captionmargin{0pt}
525 \newcommand\caption@setdefault@margin[3]{%
526 \caption@setdefault@length{#1}{left#2}{#3}%
527 \caption@setdefault@length{#1}{right#2}{#3}}
528 \DeclareCaptionLength{leftmargin}{0pt}
529 \DeclareCaptionLength{rightmargin}{0pt}
530 \newdimen\caption@width
531 \setlength\caption@width{0pt}
532 \DeclareCaptionOption{margin}{\caption@setmargin{#1}}
533 \DeclareCaptionOption{margin*}{\caption@setmargin*{#1}}
534 \DeclareCaptionOption{width}{\caption@setwidth{#1}}
535 \DeclareCaptionOption{width*}{\caption@setwidth*{#1}}
536 \DeclareCaptionOption{calcmargin}{\caption@setcalcmargin{#1}}
537 \DeclareCaptionOption{calcmargin*}{\caption@setcalcmargin*{#1}}
538 \DeclareCaptionOption{calcwidth}{\caption@setcalcwidth{#1}}
539 \DeclareCaptionOption{calcwidth*}{\caption@setcalcwidth*{#1}}
540 \DeclareCaptionOption{twoside}[1]{\caption@set@bool\caption@iftwoside{#1}}
541 \DeclareCaptionOptionNoValue{oneside}{\caption@set@bool\caption@iftwoside0}
542 \caption@set@bool\caption@iftwoside{\if@twoside 1\else 0\fi}
543 \DeclareCaptionOption{minmargin}{\caption@setoptcmd\caption@minmargin{#1}}
544 \DeclareCaptionOption{maxmargin}{\caption@setoptcmd\caption@maxmargin{#1}}
545 \newcommand*\caption@setmargin{%
546 \caption@resetcalcmargin
547 \caption@@setmargin}
548 \newcommand*\caption@@setmargin{%
549 \caption@teststar\caption@@@setmargin\@gobble\@firstofone}
550 \newcommand*\caption@@@setmargin[2]{%
551 #1{\caption@width\z@}%
552 \caption@@@@setmargin#2,#2,\@nil}
553 \def\caption@@@@setmargin#1,#2,#3\@nil{%
554 \caption@iftokens{#1#2}%
555 {\caption@@@@@setmargin{left}{#1}%
556 \caption@@@@@setmargin{right}{#2}}%
557 {\caption@Error{Missing number}}}
558 \newcommand*\caption@@@@@setmargin[2]{%
559 \caption@iftokens{#2}{\caption@setlength{#1margin}{#2}}{}}
560 \newcommand*\caption@setwidth{%
561 \caption@resetcalcmargin
562 \caption@@setwidth}
563 \newcommand*\caption@@setwidth{%
564 \caption@teststar\caption@@@setwidth\@gobble\@firstofone}
565 \newcommand*\caption@@@setwidth[2]{%
566 #1{\caption@leftmargin\z@\caption@rightmargin\z@}%
567 \setlength\caption@width{#2}}
568 \newcommand*\caption@setcalcmargin{%
569 \caption@teststar{\caption@@setcalcmargin\caption@@setmargin}%
570 \@secondoftwo\@firstoftwo}
571 \newcommand*\caption@@setcalcmargin[3]{%
572 #2{\caption@resetcalcmargin
573 \l@addto@macro\caption@calcmargin@hook{#1{#3}}}%
574 {\l@addto@macro\caption@calcmargin@hook{#1*{#3}}}}
575 \newcommand*\caption@resetcalcmargin{%
576 \let\caption@calcmargin@hook\@empty}
577 \newcommand*\caption@setcalcwidth{%
578 \caption@teststar{\caption@@setcalcmargin\caption@@setwidth}%
579 \@secondoftwo\@firstoftwo}
580 \newcommand*\caption@thecounter{0}
581 \newcommand*\caption@stepthecounter{%
582 \@tempcnta\caption@thecounter
583 \advance\@tempcnta\@ne\relax
584 \xdef\caption@thecounter{\the\@tempcnta}%
585 \global\let\caption@ifoddpage\caption@ifoddpage@}
586 \newcommand*\caption@newlabel{\@newl@bel{caption@r}}
587 \newcommand*\caption@thepage{\the\c@page}
588 \newcommand*\caption@label[1]{%
589 \caption@@label
590 \protected@write\@auxout{\let\caption@thepage\relax}%
591 {\string\caption@newlabel{#1}{\caption@thepage}}}
592 \newcommand*\caption@@label{%
593 \global\let\caption@@label\relax
594 \protected@write\@auxout{}%
595 {\string\providecommand*\string\caption@newlabel[2]{}}}
596 \newcommand*\caption@pageref[1]{%
597 \expandafter\ifx\csname caption@r@#1\endcsname\relax
598 \G@refundefinedtrue % => 'There are undefined references.'
599 \@latex@warning{Reference `caption #1' on page \thepage \space undefined}%
600 \else
601 \expandafter\let\expandafter\caption@thepage\csname caption@r@#1\endcsname
602 \fi}
603 \newcommand*\caption@ifoddpage@{%
604 \caption@iftwoside{%
605 \caption@label\caption@thecounter
606 \caption@pageref\caption@thecounter
607 \ifodd\caption@thepage
608 \global\let\caption@ifoddpage\@firstoftwo
609 \else
610 \global\let\caption@ifoddpage\@secondoftwo
611 \fi
612 }{\global\let\caption@ifoddpage\@firstoftwo}%
613 \caption@ifoddpage}
614 \newcommand*\caption@setoptcmd[2]{%
615 \caption@ifinlist{#2}{0,false,no,off}{\let#1\@undefined}{\def#1{#2}}}
616 \DeclareCaptionLength{indent}{0pt}
617 \DeclareCaptionLength{parindent}{0pt}
618 \DeclareCaptionLength{hangindent}{0pt}
619 \DeclareCaptionOption{indent}[\leftmargini]{% obsolete
620 \caption@setlength{indent}{#1}}
621 \DeclareCaptionOption{indention}[\leftmargini]{%
622 \caption@setlength{indent}{#1}}
623 \DeclareCaptionOption{parindent}{%
624 \caption@setlength{parindent}{#1}}
625 \DeclareCaptionOption{hangindent}{%
626 \caption@setlength{hangindent}{#1}}
627 \DeclareCaptionOption{parskip}{%
628 \l@addto@macro\caption@@par{\setlength\parskip{#1}}}
629 \newcommand*\DeclareCaptionStyle[1]{%
630 \@testopt{\caption@declarestyle{#1}}{}}
631 \@onlypreamble\DeclareCaptionStyle
632 \def\caption@declarestyle#1[#2]#3{%
633 \caption@decl{style}{#1}%
634 {\def\caption@slsty{#2}%
635 \def\caption@sty{#3}}%
636 \@namedef{caption@sty@#1}{\@unused}}
637 \@onlypreamble\caption@declarestyle
638 \DeclareCaptionOption{style}{\caption@setstyle{#1}}
639 \DeclareCaptionOption{style*}{\caption@setstyle*{#1}}
640 \newcommand*\caption@setstyle{%
641 \caption@teststar\caption@@setstyle\caption@ifdecl\caption@checkdecl}
642 \newcommand*\caption@@setstyle[2]{%
643 #1{style}{#2}%
644 {\caption@set{style}{#2}%
645 \caption@style % defines \caption@sty & \caption@slsty
646 \ifx\caption@setstyle@flag\@undefined
647 \let\caption@setstyle@flag\relax % prevent \caption@resetstyle if called recursively
648 \caption@resetstyle
649 \caption@xsetup\caption@sty
650 \let\caption@setstyle@flag\@undefined
651 \else
652 \caption@xsetup\caption@sty
653 \fi}%
654 {}}
655 \newcommand*\caption@resetstyle{%
656 \caption@setup{%
657 box=none,boxcolor=white,parbox=parbox,%
658 format=plain,labelformat=default,labelsep=colon,textformat=simple,%
659 font=,labelfont=,textfont=,size=,%
660 justification=justified,slc,rule,strut,%
661 margin=0pt,minmargin=0,maxmargin=0,%
662 indent=0pt,parindent=0pt,hangindent=0pt}}
663 \DeclareCaptionStyle{base}[indent=0pt,justification=centering]{}
664 \DeclareCaptionStyle{default}[indent=0pt,justification=centering]{%
665 box=default,%
666 format=default,labelformat=default,labelsep=default,textformat=default,%
667 font=default,labelfont=default,textfont=default,size=default,%
668 justification=default,slc=default,margin=default,%
669 indent=default,parindent=default,hangindent=default}
670 \newcommand*\DeclareCaptionSinglelinecheck[2]{%
671 \caption@decl{singlelinecheck}{#1}{#2}}
672 \@onlypreamble\DeclareCaptionSinglelinecheck
673 \DeclareCaptionOption{singlelinecheck}[1]{\caption@setsinglelinecheck{#1}}
674 \DeclareCaptionOption{slc}[1]{\KV@caption@singlelinecheck{#1}}
675 \DeclareCaptionSinglelinecheck{on}{\@firstoftwo}
676 \DeclareCaptionSinglelinecheck{off}{\@secondoftwo}
677 \SetCaptionDefault{singlelinecheck}{on}
678 \newcommand*\caption@setsinglelinecheck[1]{%
679 \caption@ifdecl{singlelinecheck}{#1}%
680 {\caption@set{singlelinecheck}{#1}}%
681 {\caption@set@bool\caption@singlelinecheck{#1}}}
682 \newcommand\DeclareCaptionBox[2]{%
683 \caption@decl{box}{#1}##1##2{#2}}
684 \@onlypreamble\DeclareCaptionBox
685 \DeclareCaptionOption{box}{\caption@set{box}{#1}}
686 \DeclareCaptionOption{parbox}{\caption@set{parbox}{#1}}
687 \caption@setmapping{parbox}{box}
688 \DeclareCaptionBox{empty}{}
689 \DeclareCaptionBox{none}{#2}
690 \DeclareCaptionBox{parbox}{\parbox[b]{#1}{#2}}
691 \DeclareCaptionBox{colorbox}{%
692 \colorbox{\caption@boxcolor}{%
693 \setlength\caption@tempdima{#1}%
694 \addtolength\caption@tempdima{-2\fboxsep}%
695 \linewidth\caption@tempdima\relax
696 \hsize\caption@tempdima\relax
697 #2}}
698 \DeclareCaptionOption{boxcolor}{\def\caption@boxcolor{#1}}
699 \DeclareCaptionOption{boxsep}{\setlength\fboxsep{#1}}
700 \SetCaptionDefault{box}{none}
701 \newcommand*\DeclareCaptionFormat{%
702 \caption@teststar\caption@declareformat\@gobble\@firstofone}
703 \@onlypreamble\DeclareCaptionFormat
704 \newcommand*\caption@declareformat[2]{%
705 \@dblarg{\caption@@declareformat#1{#2}}}
706 \@onlypreamble\caption@declareformat
707 \long\def\caption@@declareformat#1#2[#3]#4{%
708 \caption@decl[\edef]{format}{#2}{%
709 \unexpanded{\let\caption@ifhmode#1}%
710 \unexpanded{\long\def\caption@slfmt}####1####2####3\unexpanded{{#3}}%
711 \unexpanded{\long\def\caption@fmt}####1####2####3\unexpanded{{#4}}}}
712 \@onlypreamble\caption@@declareformat
713 \newcommand*\caption@useformat[1]{% used by caption-koma.sto
714 \caption@checkdecl{format}{#1}{%
715 \begingroup
716 \@nameuse{caption@format@#1}\global\let\caption@tempa\caption@fmt
717 \endgroup\caption@tempa}}
718 \DeclareCaptionOption{format}{\caption@set{format}{#1}}
719 \DeclareCaptionFormat{plain}{#1#2#3\par}
720 \DeclareCaptionFormat{hang}[#1#2#3\par]{%
721 \caption@iflabelseparatorwithnewline
722 {\caption@Error{%
723 The option `labelsep=\caption@labelsep@name' does not work\MessageBreak
724 with `format=hang'}}%
725 {\@hangfrom{#1#2}%
726 \advance\caption@parindent\hangindent\relax
727 \advance\caption@hangindent\hangindent\relax
728 \caption@@par#3\par}}
729 \SetCaptionDefault{format}{plain}
730 \newcommand*\DeclareCaptionLabelFormat[2]{%
731 \caption@decl{labelformat}{#1}##1##2{#2}}
732 \@onlypreamble\DeclareCaptionLabelFormat
733 \DeclareCaptionOption{labelformat}{\caption@set{labelformat}{#1}}
734 \DeclareCaptionLabelFormat{empty}{}
735 \DeclareCaptionLabelFormat{simple}{\bothIfFirst{#1}{\nobreakspace}#2}
736 \DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{\nobreakspace}(#2)}
737 \DeclareCaptionLabelFormat{brace}{\bothIfFirst{#1}{\nobreakspace}#2)}
738 \DeclareCaptionLabelFormat{autodot}{\bothIfFirst{#1}{\nobreakspace}#2\autodot}
739 \DeclareCaptionLabelFormat{unnumbered}{#1}
740 \DeclareCaptionLabelFormat{original}{%
741 \caption@ifdefined\caption@original@fnum
742 {\caption@original@fnum}%
743 {\caption@labelformat@fallback{#1}{#2}}}
744 \SetCaptionDefault{labelformat}{original}
745 \SetCaptionFallback{labelformat}{simple}
746 \newcommand\DeclareCaptionLabelSeparator{%
747 \@ifstar
748 \DeclareCaptionLabelSeparator@
749 {\caption@declarelabelseparator\@firstofone}}
750 \@onlypreamble\DeclareCaptionLabelSeparator
751 \newcommand\DeclareCaptionLabelSeparator@{%
752 \@ifstar
753 \DeclareCaptionLabelSeparator@@
754 {\caption@declarelabelseparator\@gobble}}
755 \@onlypreamble\DeclareCaptionLabelSeparator@
756 \newcommand*\DeclareCaptionLabelSeparator@@[2]{%
757 \caption@declarelabelseparator
758 {#2\@gobble\@firstofone}%
759 {#1}}
760 \@onlypreamble\DeclareCaptionLabelSeparator@@
761 \newcommand\caption@declarelabelseparator[3]{%
762 \caption@decl{labelseparator}{#2}%
763 {\def\caption@iflabelfont{#1}%
764 \def\caption@labelsep@name{#2}%
765 \def\caption@labelsep{#3}}%
766 \@namedef{caption@lsep@#2}{#3}}
767 \newcommand*\caption@lsep@default{\caption@labelseparator@default\caption@labelsep}%
768 \@onlypreamble\caption@declarelabelseparator
769 \newcommand*\caption@LabelSeparatorWithNewline[1]{%
770 \caption@g@addto@list\caption@labelsep@crlist{#1}}
771 \@onlypreamble\caption@LabelSeparatorWithNewline
772 \newcommand*\caption@iflabelseparatorwithnewline{%
773 \caption@ifin@list\caption@labelsep@crlist\caption@labelsep@name}
774 \DeclareCaptionOption{labelsep}{\caption@set{labelseparator}{#1}}
775 \DeclareCaptionOption{labelseparator}{\caption@set{labelseparator}{#1}}
776 \DeclareCaptionLabelSeparator{none}{}
777 \DeclareCaptionLabelSeparator{colon}{: }
778 \DeclareCaptionLabelSeparator{period}{. }
779 \DeclareCaptionLabelSeparator{space}{ }
780 \DeclareCaptionLabelSeparator*{quad}{\quad}
781 \DeclareCaptionLabelSeparator*{newline}{\captionnewline}
782 \caption@LabelSeparatorWithNewline{newline} % does not work with "format=hang"
783 \DeclareCaptionLabelSeparator*{endash}{\space\textendash\space}
784 \DeclareCaptionLabelSeparator{gobble}{ }
785 \DeclareCaptionLabelSeparator{gobbletwo}{}
786 \newcommand*\captionnewline{\\\relax}
787 \SetCaptionDefault{labelseparator}{colon}
788 \newcommand\DeclareCaptionTextFormat[2]{%
789 \caption@decl{textformat}{#1}##1{#2}}
790 \@onlypreamble\DeclareCaptionTextFormat
791 \DeclareCaptionOption{textformat}{\caption@set{textformat}{#1}}
792 \DeclareCaptionTextFormat{empty}{%
793 \caption@get@label#1\caption@makeanchor{}\@nil
794 \caption@thelabel\caption@clrlabel}
795 \long\def\caption@get@label#1\caption@makeanchor#2#3\@nil{%
796 \caption@iftokens{#2}{\caption@getlabel{#2}}{\caption@getlabel{#1}}}
797 \DeclareCaptionTextFormat{simple}{#1}
798 \DeclareCaptionTextFormat{period}{#1.}
799 \SetCaptionDefault{textformat}{simple}
800 \newcommand\caption@getlabel[1]{%
801 \caption@@getlabel#1\label{}\@nil}
802 \long\def\caption@@getlabel#1\label#2#3\@nil{%
803 \def\@tempa{#2}%
804 \ifx\@tempa\@empty
805 \let\caption@thelabel\relax
806 \else
807 \def\@tempb{*}%
808 \ifx\@tempa\@tempb
809 \def\caption@thelabel{\label*}%
810 \caption@@@getlabel#3\@nil
811 \else
812 \def\caption@thelabel{\label}%
813 \caption@@@getlabel{#2}#3\@nil
814 \fi
815 \fi}
816 \long\def\caption@@@getlabel#1#2\@nil{%
817 \def\@tempa{#1}%
818 \def\@tempb{[}%
819 \ifx\@tempa\@tempb
820 \caption@@@@getlabel#1#2\@nil
821 \else
822 \l@addto@macro\caption@thelabel{{#1}}%
823 \fi}
824 \long\def\caption@@@@getlabel[#1]#2\@nil{%
825 \l@addto@macro\caption@thelabel{[{#1}]}%
826 \caption@@@getlabel#2\@nil}
827 \newcommand*\caption@clrlabel{\let\caption@thelabel\relax}
828 \caption@clrlabel
829 \DeclareCaptionOption{strut}[1]{\caption@set@bool\caption@ifstrut{#1}}
830 \newcommand*\DeclareCaptionFont{%
831 \caption@decl@package{font}{\caption@declarefont}}
832 \@onlypreamble\DeclareCaptionFont
833 \newcommand*\caption@declarefont[2]{%
834 \caption@decl{font}{#1}##1{#2}%
835 \define@key{caption@font}{#1}[]{\caption@addto@font{#1}{##1}}}
836 \@onlypreamble\caption@@declarefont
837 \newcommand*\caption@addto@font[1]{%
838 \caption@load@package{font}{#1}%
839 \caption@add@to@font{font}{#1}}
840 \newcommand*\caption@add@to@font[3]{%
841 \expandafter\g@addto@macro\expandafter\caption@fnt\expandafter{\csname caption@#1@#2\endcsname{#3}}}
842 \DeclareCaptionOption{font}{\caption@setfont{font}{#1}}
843 \DeclareCaptionOption{font+}{\caption@addtofont{font}{#1}}
844 \DeclareCaptionOption{labelfont}{\caption@setfont{labelfont}{#1}}
845 \DeclareCaptionOption{labelfont+}{\caption@addtofont{labelfont}{#1}}
846 \caption@setmapping{labelfont}{font}
847 \DeclareCaptionOption{textfont}{\caption@setfont{textfont}{#1}}
848 \DeclareCaptionOption{textfont+}{\caption@addtofont{textfont}{#1}}
849 \caption@setmapping{textfont}{font}
850 \newcommand*\caption@setfont[1]{%
851 \expandafter\let\csname caption#1\endcsname\@empty
852 \caption@addtofont{#1}}
853 \newcommand*\caption@addtofont[2]{%
854 \expandafter\let\expandafter\caption@fnt\csname caption#1\endcsname
855 \begingroup
856 \define@key{caption@font}{default}[]{\caption@add@to@font{#1}{default}{##1}}%
857 \caption@setkeys[caption]{caption@font}{#2}%
858 \endgroup
859 \expandafter\let\csname caption#1\endcsname\caption@fnt}
860 \DeclareCaptionFont{normalcolor}{\normalcolor}
861 \DeclareCaptionFont{color}{\color{#1}}
862 \DeclareCaptionFont{normalfont}{\normalfont}
863 \DeclareCaptionFont{up}{\upshape}
864 \DeclareCaptionFont{it}{\itshape}
865 \DeclareCaptionFont{sl}{\slshape}
866 \DeclareCaptionFont{sc}{\scshape}
867 \DeclareCaptionFont{md}{\mdseries}
868 \DeclareCaptionFont{bf}{\bfseries}
869 \DeclareCaptionFont{rm}{\rmfamily}
870 \DeclareCaptionFont{sf}{\sffamily}
871 \DeclareCaptionFont{tt}{\ttfamily}
872 \DeclareCaptionFont{tiny}{\tiny}
873 \DeclareCaptionFont{scriptsize}{\scriptsize}
874 \DeclareCaptionFont{footnotesize}{\footnotesize}
875 \DeclareCaptionFont{small}{\small}
876 \DeclareCaptionFont{normalsize}{\normalsize}
877 \DeclareCaptionFont{large}{\large}
878 \DeclareCaptionFont{Large}{\Large}
879 \DeclareCaptionFont{LARGE}{\LARGE}
880 \DeclareCaptionFont{huge}{\huge}
881 \DeclareCaptionFont{Huge}{\Huge}
882 \DeclareCaptionFont{smaller}{\caption@smaller}
883 \DeclareCaptionFont{larger}{\caption@larger}
884 \DeclareCaptionFont{none}{}
885 \DeclareCaptionFont{normal}{%
886 \caption@font@normalcolor\@unused
887 \caption@font@normalfont\@unused
888 \caption@font@normalsize\@unused
889 \caption@font@singlespacing\@unused}
890 \SetCaptionDefault{font}{none}
891 \SetCaptionDefault{labelfont}{none}
892 \SetCaptionDefault{textfont}{none}
893 \caption@setmapping{footfont}{font}
894 \SetCaptionDefault{footfont}{none}
895 \caption@setmapping{@tempa}{font}
896 \SetCaptionDefault{@tempa}{none}
897 \newcommand\caption@smaller{%
898 \ifx\@currsize\tiny
899 \relax
900 \else\ifx\@currsize\scriptsize
901 \tiny
902 \else\ifx\@currsize\footnotesize
903 \scriptsize
904 \else\ifx\@currsize\small
905 \footnotesize
906 \else\ifx\@currsize\normalsize
907 \small
908 \else\ifx\@currsize\large
909 \normalsize
910 \else\ifx\@currsize\Large
911 \large
912 \else\ifx\@currsize\LARGE
913 \Large
914 \else\ifx\@currsize\huge
915 \LARGE
916 \else\ifx\@currsize\Huge
917 \huge
918 \else
919 \caption@Warning{%
920 Cannot determine current font size.\MessageBreak
921 Try setting it with `size=' explicitly}%
922 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
923 \newcommand\caption@larger{%
924 \ifx\@currsize\tiny
925 \scriptsize
926 \else\ifx\@currsize\scriptsize
927 \footnotesize
928 \else\ifx\@currsize\footnotesize
929 \small
930 \else\ifx\@currsize\small
931 \normalsize
932 \else\ifx\@currsize\normalsize
933 \large
934 \else\ifx\@currsize\large
935 \Large
936 \else\ifx\@currsize\Large
937 \LARGE
938 \else\ifx\@currsize\LARGE
939 \huge
940 \else\ifx\@currsize\huge
941 \Huge
942 \else\ifx\@currsize\Huge
943 \relax
944 \else
945 \caption@Warning{%
946 Cannot determine current font size.\MessageBreak
947 Try setting it with `size=' explicitly}%
948 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
949 \newcommand*\caption@hypersetup{\caption@ifdefined\hypersetup\hypersetup\@gobble}
950 \DeclareCaptionFont{hypersetup}{\caption@hypersetup{#1}} % for usage in \captionsetup{font={hypersetup=...}}
951 \DeclareCaptionOption{hypersetup}{\caption@hypersetup{#1}} % for usage in \captionsetup[<env>]{hypersetup=...}
952 \DeclareCaptionOption{size}{\caption@setfont{size}{#1}}
953 \caption@setmapping{size}{font}
954 \SetCaptionDefault{size}{none}
955 \newcommand*\DeclareCaptionJustification{%
956 \caption@withoptargs\caption@declare@justification}
957 \newcommand*\caption@declare@justification[3]{%
958 \caption@decl@package{justification}{\caption@decl{justification}}#1{#2}{#3}%
959 \expandafter\let\csname caption@hj@#2\expandafter\endcsname\csname caption@justification@#2\endcsname}
960 \@onlypreamble\DeclareCaptionJustification
961 \DeclareCaptionOption{justification}{%
962 \caption@load@package{justification}{#1}%
963 \caption@set{justification}{#1}}
964 \DeclareCaptionJustification{justified}{}
965 \DeclareCaptionJustification{centering}{\centering}
966 \DeclareCaptionJustification{centerfirst}{\centerfirst}
967 \DeclareCaptionJustification{centerlast}{\centerlast}
968 \DeclareCaptionJustification{raggedleft}{\raggedleft}
969 \DeclareCaptionJustification{raggedright}{\raggedright}
970 \SetCaptionDefault{justification}{justified}
971 \providecommand\centerfirst{%
972 \let\\\@centercr
973 \edef\caption@normaladjust{%
974 \leftskip\the\leftskip
975 \rightskip\the\rightskip
976 \parfillskip\the\parfillskip\relax}%
977 \leftskip\z@\@plus -1fil%
978 \rightskip\z@\@plus 1fil%
979 \parfillskip\z@skip
980 \noindent\hskip\z@\@plus 2fil%
981 \@setpar{\@@par\@restorepar\caption@normaladjust}}
982 \providecommand\centerlast{%
983 \let\\\@centercr
984 \leftskip\z@\@plus 1fil%
985 \rightskip\z@\@plus -1fil%
986 \parfillskip\z@\@plus 2fil\relax}
987 \caption@ifundefined\abovecaptionskip{%
988 \newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@}}{}
989 \caption@ifundefined\belowcaptionskip{%
990 \newlength\belowcaptionskip\setlength\belowcaptionskip{0\p@}}{}
991 \DeclareCaptionOption{aboveskip}{\setlength\abovecaptionskip{#1}}
992 \DeclareCaptionOption{belowskip}{\setlength\belowcaptionskip{#1}}
993 \DeclareCaptionOption{skip}{\setlength\abovecaptionskip{#1}}
994 \newcommand*\caption@rule{\caption@ifrule\caption@hrule\relax}
995 \newcommand*\caption@hrule{\hrule\@height\z@}
996 \DeclareCaptionOption{rule}[1]{\caption@set@bool\caption@ifrule{#1}}
997 \newcommand*\DeclareCaptionPosition[3]{%
998 \caption@decl[\edef]{position}{#1}{%
999 \unexpanded{\def\caption@fallback@position}####1####2\unexpanded{{#2}}%
1000 \unexpanded{\def\caption@regular@position}####1####2\unexpanded{{#3}}}}
1001 \@onlypreamble\DeclareCaptionPosition
1002 \DeclareCaptionOption{position}{\caption@setposition{#1}}
1003 \DeclareCaptionOption{figureposition}{\captionsetup*[figure]{position=#1}}
1004 \@onlypreamble@key{caption}{figureposition}
1005 \DeclareCaptionOption{tableposition}{\captionsetup*[table]{position=#1}}
1006 \@onlypreamble@key{caption}{tableposition}
1007 \newcommand*\caption@setposition{%
1008 \caption@initposition
1009 \caption@set{position}}
1010 \DeclareCaptionPosition{top}{#1}{#1}
1011 \def\caption@position@t{\caption@position@top}
1012 \def\caption@position@above{\caption@position@top}
1013 \DeclareCaptionPosition{bottom}{#2}{#2}
1014 \def\caption@position@b{\caption@position@bottom}
1015 \def\caption@position@below{\caption@position@bottom}
1016 \DeclareCaptionPosition{auto}{#2}{\caption@autoposition{#1}{#2}}
1017 \def\caption@position@a{\caption@position@auto} % needed by floatrow package, \flrow@cappos
1018 \SetCaptionDefault{position}{auto}
1019 \newcommand*\caption@initposition{%
1020 \let\caption@@iftop\@undefined}
1021 \newcommand*\caption@iftop{%
1022 \caption@@fixposition\caption@fallback@position
1023 \caption@@iftop}
1024 \newcommand*\caption@fixposition{%
1025 \caption@@fixposition\caption@regular@position}
1026 \newcommand*\caption@@fixposition[1]{%
1027 \ifx\caption@@iftop\@undefined
1028 \caption@position % defines \caption@fallback@position and \caption@regular@position
1029 #1{\let\caption@@iftop\@firstoftwo}{\let\caption@@iftop\@secondoftwo}%
1030 \fi}
1031 \newcommand*\caption@setautoposition[1]{%
1032 \renewcommand*\caption@position@auto{%
1033 \@nameuse{caption@position@#1}}}
1034 \newcommand*\caption@autoposition[2]{%
1035 \ifvmode
1036 \edef\caption@tempa{\the\prevdepth}%
1037 \caption@Debug{\string\prevdepth=\caption@tempa}%
1038 \ifdim\prevdepth>-\p@
1039 #2% position=bottom
1040 \else
1041 #1% position=top
1042 \fi
1043 \else
1044 #2% position=bottom
1045 \fi}
1046 \newcommand*\DeclareCaptionAutoPosition{%
1047 \renewcommand*\caption@autoposition[2]}%
1048 \newcommand*\caption@beginhook{}
1049 \newcommand*\caption@endhook{}
1050 \newcommand*\AtBeginCaption{\l@addto@macro\caption@beginhook}
1051 \newcommand*\AtEndCaption{\l@addto@macro\caption@endhook}
1052 \DeclareCaptionOption{list}[1]{\caption@setlist{#1}}
1053 \DeclareCaptionOption{listof}[1]{\caption@setlist{#1}}
1054 \newcommand*\caption@setlist{\caption@set@bool\caption@iflist}
1055 \caption@setlist{on}
1056 \DeclareCaptionOption{listtype}{\caption@setlisttype{#1}}
1057 \DeclareCaptionOption{listtype+}{\caption@setlisttype@ext{#1}}
1058 \newcommand*\caption@setlisttype{%
1059 \caption@setlisttype@ext{}%
1060 \caption@@setlisttype\caption@listtype}
1061 \newcommand*\caption@@setlisttype[2]{%
1062 \edef#1{#2}%
1063 \ifx#1\@empty \let#1\@undefined \fi}
1064 \newcommand*\caption@setlisttype@ext{%
1065 \caption@@setlisttype\caption@listtype@ext}
1066 \newcommand*\DeclareCaptionListFormat[2]{%
1067 \caption@decl{listformat}{#1}##1##2{#2}}
1068 \@onlypreamble\DeclareCaptionListFormat
1069 \DeclareCaptionOption{listformat}{\caption@set{listformat}{#1}}
1070 \DeclareCaptionListFormat{empty}{}
1071 \DeclareCaptionListFormat{simple}{#1#2}
1072 \DeclareCaptionListFormat{subsimple}{#2}
1073 \DeclareCaptionListFormat{parens}{#1(#2)}
1074 \DeclareCaptionListFormat{subparens}{(#2)}
1075 \DeclareCaptionListFormat{period}{#1#2.}
1076 \DeclareCaptionListFormat{subperiod}{#2.}
1077 \SetCaptionDefault{listformat}{subsimple}
1078 \newcommand*\caption@lstfmt{\caption@listformat}
1079 \DeclareCaptionOption{debug}[1]{%
1080 \caption@set@bool\caption@ifdebug{#1}%
1081 \caption@ifdebug
1082 {\let\caption@Debug\caption@Info}%
1083 {\let\caption@Debug\@gobble}}
1084 \DeclareOption{debug}{\setkeys{caption}{debug}}
1085 \setkeys{caption}{debug=0}
1086 \newcommand\@makecaption@standard[2]{%
1087 \vskip\abovecaptionskip
1088 \sbox\@tempboxa{#1: #2}%
1089 \ifdim \wd\@tempboxa >\hsize
1090 #1: #2\par
1091 \else
1092 \global \@minipagefalse
1093 \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
1094 \fi
1095 \vskip\belowcaptionskip}
1096 \@onlypreamble\@makecaption@standard
1097 \newcommand\@makecaption@arabic[2]{%
1098 \vskip\abovecaptionskip
1099 \sbox\@tempboxa{#1: #2}%
1100 \sbox\@Arabitempboxa{\textRL{#2} : #1}%
1101 \if@rl{
1102 \ifdim \wd\@Arabitempboxa >\hsize
1103 \textRL{#2} : #1\par
1104 \else
1105 \global \@minipagefalse
1106 \hb@xt@\hsize{\hfil\box\@Arabitempboxa\hfil}%
1107 \fi}\else{
1108 \ifdim \wd\@tempboxa >\hsize
1109 #1: #2\par
1110 \else
1111 \global \@minipagefalse
1112 \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
1113 \fi}\fi
1114 \vskip\belowcaptionskip}
1115 \@onlypreamble\@makecaption@arabic
1116 \newcommand\@makecaption@latvian[2]{%
1117 \vskip10\p@
1118 \sbox\@tempboxa{#1\if\empty#2\else: #2\fi}%
1119 \ifdim\wd\@tempboxa>\hsize
1120 #1: #2\par
1121 \else
1122 \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
1123 \fi}
1124 \@onlypreamble\@makecaption@latvian
1125 \caption@ifundefined\caption@documentclass{%
1126 \@ifclassloaded{beamer}{%
1127 \caption@InfoNoLine{beamer document class detected}%
1128 \def\caption@documentclass{beamer}%
1129 }{\@ifclassloaded{elsarticle}{%
1130 \caption@InfoNoLine{elsarticle document class detected}%
1131 \def\caption@documentclass{elsarticle}%
1132 }{\@ifclassloaded{memoir}{%
1133 \caption@InfoNoLine{memoir document class detected}%
1134 \def\caption@documentclass{memoir}%
1135 }{\caption@ifdefined\scr@caption{%
1136 \caption@InfoNoLine{KOMA-Script document class detected}%
1137 \def\caption@documentclass{koma}%
1138 }{\caption@ifdefined\@captionheadfont{%
1139 \caption@InfoNoLine{AMS or SMF document class detected}%
1140 \def\caption@documentclass{ams-smf}%
1141 }{\caption@ifdefined\CaptionFonts{%
1142 \caption@InfoNoLine{NTG document class detected}%
1143 \def\caption@documentclass{ntg}%
1144 }{\caption@ifdefined\cph@font{%
1145 \caption@ifdefined\cpb@font\@firstoftwo\@secondoftwo
1146 }{%
1147 \@secondoftwo
1148 }{%
1149 \caption@InfoNoLine{thesis document class detected}%
1150 \def\caption@documentclass{thesis}%
1151 }{%
1152 \def\caption@documentclass{standard}%
1153 \ifx\@makecaption\@undefined
1154 \caption@InfoNoLine{Document class w/o caption stuff detected}%
1155 \else
1156 \ifx\@makecaption\@makecaption@standard
1157 \caption@InfoNoLine{Standard document class detected}%
1158 \else
1159 \ifx\@makecaption\@makecaption@arabic
1160 \caption@InfoNoLine{arabic babel option detected}%
1161 \else
1162 \ifx\@makecaption\@makecaption@latvian
1163 \caption@InfoNoLine{latvian babel option detected}%
1164 \else
1165 \caption@InfoNoLine{%
1166 Unknown document class (or package),\MessageBreak
1167 standard defaults will be used}%
1168 \caption@InfoNoLine{\string\@makecaption\space=\space\meaning\@makecaption\@gobble}%
1169 \def\caption@documentclass{unknown}%
1170 \fi
1171 \fi
1172 \fi
1173 \fi
1174 }}}}}}}%
1175 }{}
1176 \newcommand*\caption@ifdocumentclass[1]{%
1177 \begingroup
1178 \edef\caption@tempa{\caption@documentclass}%
1179 \edef\caption@tempb{#1}%
1180 \ifx\caption@tempa\caption@tempb
1181 \endgroup\expandafter\@firstoftwo
1182 \else
1183 \endgroup\expandafter\@secondoftwo
1184 \fi}
1185 \newcommand*\AtCaptionPackage{%
1186 \g@addto@macro\caption@documentclass@code}
1187 \@onlypreamble\AtCaptionPackage
1188 \providecommand*\caption@documentclass@code{}
1189 \@onlypreamble\caption@documentclass@code
1190 \newcommand*\AfterCaptionPackage{%
1191 \g@addto@macro\caption@endtitles@code}
1192 \@onlypreamble\AfterCaptionPackage
1193 \providecommand*\caption@endtitles@code{}
1194 \@onlypreamble\caption@endtitles@code
1195 \newcommand*\caption@IfBabelPackageLoaded[4]{%
1196 \caption@ifdefined#2\@firstofone\caption@AtBeginDocument{%
1197 \caption@if@bool{\@nameuse{caption@ifbabel@#1}}%
1198 {\def\caption@tempa{\caption@ifdefined#2}}%
1199 {\let\caption@tempa\@secondoftwo}%
1200 \caption@tempa
1201 {\caption@InfoNoLine{#1 babel package is loaded}#3}%
1202 {#4}}}
1203 \@onlypreamble\caption@IfBabelPackageLoaded
1204 \DeclareCaptionLabelSeparator{arabi}{\if@rl\space\fi: }
1205 \newcommand*\caption@IfBabelArabi{%
1206 \caption@IfBabelPackageLoaded{arabi}{\ArabiCoreLoaded}}
1207 \@onlypreamble\caption@IfBabelArabi
1208 \providecommand*\caption@ifbabel@arabi{true}
1209 \caption@IfBabelArabi{%
1210 \newcommand\caption@rl[1]{\if@rl\textRL{#1}\else\textLR{#1}\fi}%
1211 \caption@ifdefined\extrasarabic{%
1212 \addto\extrasarabic{%
1213 \caption@switchdefault{labelseparator}{\babel@save #1}{arabi}}}{}%
1214 \caption@ifdefined\extrasfarsi{%
1215 \addto\extrasfarsi{%
1216 \caption@switchdefault{labelseparator}{\babel@save #1}{arabi}}}{}%
1217 }{%
1218 \let\caption@rl\@firstofone
1219 }
1220 \DeclareCaptionLabelSeparator{french}{\caption@french@labelseparator}
1221 \newcommand*\caption@IfBabelFrench{%
1222 \caption@IfBabelPackageLoaded{french}{\FB@makecaption}}
1223 \@onlypreamble\caption@IfBabelFrench
1224 \providecommand*\caption@ifbabel@french{true}
1225 \caption@IfBabelFrench{%
1226 \providecommand\caption@french@labelseparator{\CaptionSeparator}%
1227 \ifFB@active@punct
1228 \DeclareCaptionLabelSeparator{colon}{%
1229 \ifFBfrench\penalty\@M\FBcolonspace\fi : }%
1230 \fi
1231 \ifFBOldFigTabCaptions
1232 \caption@ifdefined\extrasfrench{%
1233 \addto\extrasfrench{%
1234 \caption@switchdefault{labelseparator}{\babel@save #1}{french}}}{}%
1235 \caption@ifdefined\extrasacadian{%
1236 \addto\extrasacadian{%
1237 \caption@switchdefault{labelseparator}{\babel@save #1}{french}}}{}%
1238 \else
1239 \ifFBCustomiseFigTabCaptions
1240 \caption@AtBeginDocument{%
1241 \ifFB@mainlanguage@FR
1242 \SetCaptionDefault{labelseparator}{french}%
1243 \fi}%
1244 \fi
1245 \fi
1246 }{}
1247 \newcommand*\caption@IfFrenchLe{%
1248 \caption@IfBabelPackageLoaded{frenchle}{\frenchTeXmods}}
1249 \@onlypreamble\caption@IfBabelFrenchLe
1250 \providecommand*\caption@ifbabel@frenchle{true}
1251 \caption@IfFrenchLe{%
1252 \providecommand\caption@french@labelseparator{\captionseparator\space}%
1253 \g@addto@macro\extrasfrench{%
1254 \caption@switchdefault{labelseparator}{\let\caption@original@labelseparator#1}{french}%
1255 \caption@switchdefault{font}{\let\caption@original@font#1}{it}%
1256 \caption@switchdefault{labelfont}{\let\caption@original@labelfont#1}{up}}%
1257 \g@addto@macro\extrasenglish{%
1258 \caption@restoredefault{labelseparator}{\caption@original@labelseparator}%
1259 \caption@restoredefault{font}{\caption@original@font}%
1260 \caption@restoredefault{labelfont}{\caption@original@labelfont}}%
1261 \caption@AtBeginDocument{%
1262 \let\captionfont@original\captionfont
1263 \let\captionlabelfont@original\captionlabelfont}%
1264 \g@addto@macro\GOfrench{%
1265 \let\captionfont\captionfont@original
1266 \let\captionlabelfont\captionlabelfont@original}%
1267 }{}
1268 \DeclareCaptionLabelFormat{magyar}{#2\bothIfSecond{.~}{#1}}
1269 \newcommand*\caption@IfBabelHungarian{%
1270 \caption@IfBabelPackageLoaded{hungarian}{\magyar@opt@defaults}}
1271 \@onlypreamble\caption@IfBabelHungarian
1272 \providecommand*\caption@ifbabel@hungarian{true}
1273 \caption@IfBabelHungarian{%
1274 \caption@ifdefined\extrashungarian{%
1275 \addto\extrashungarian{%
1276 \caption@switchdefault{labelformat}{\babel@save #1}{magyar}%
1277 \caption@switchdefault{labelseparator}{\babel@save #1}{period}%
1278 \caption@switchdefault{listformat}{\babel@save #1}{subperiod}}}{}%
1279 \caption@ifdefined\extrasmagyar{%
1280 \addto\extrasmagyar{%
1281 \caption@switchdefault{labelformat}{\babel@save #1}{magyar}%
1282 \caption@switchdefault{labelseparator}{\babel@save #1}{period}%
1283 \caption@switchdefault{listformat}{\babel@save #1}{subperiod}}}{}%
1284 }{}
1285 \DeclareCaptionLabelFormat{latvian}{#2\bothIfSecond{~}{#1}}
1286 \newcommand*\caption@IfBabelLatvian{%
1287 \caption@IfBabelPackageLoaded{latvian}{\bbl@latvianindent}}
1288 \@onlypreamble\caption@IfBabelLatvian
1289 \providecommand*\caption@ifbabel@latvian{true}
1290 \caption@IfBabelLatvian{%
1291 \caption@ifdefined\extraslatvian{%
1292 \addto\extraslatvian{%
1293 \caption@switchdefault{labelformat}{\babel@save #1}{latvian}}}{}%
1294 }{}
1295 \newcommand*\caption@ifpackageloaded[1]{%
1296 \expandafter\ifx\csname ver@#1.\caption@pkgextension\endcsname\relax
1297 \expandafter\@secondoftwo
1298 \else
1299 \expandafter\@firstoftwo
1300 \fi}
1301 \let\caption@pkgextension\@pkgextension
1302 \newcommand*\caption@pkg@list{}
1303 \newcommand*\caption@requirepackage[2]{%
1304 \caption@ifpackageloaded{#1}{}{\caption@@requirepackage{#1}{#2}}}
1305 \newcommand*\caption@@requirepackage[2]{%
1306 \@cons\caption@packagelist{{#1}{#2}}} % load package later on
1307 \caption@AtBeginDocument{%
1308 \renewcommand*\caption@@requirepackage[2]{%
1309 \caption@Error{Option `#2' requires the `#1' package}}}
1310 \newcommand*\caption@packagelist{}
1311 \@onlypreamble\caption@packagelist
1312 \caption@AtBeginDocument{%
1313 \def\caption@tempa{\endgroup}%
1314 \begingroup
1315 \def\@elt#1#2{%
1316 \g@addto@macro\caption@tempa{%
1317 \caption@loadpackage{#1}{#2}}}%
1318 \caption@packagelist
1319 \caption@tempa}
1320 \newcommand*\caption@loadpackage[2]{%
1321 \caption@ifpackageloaded{#1}{}{\caption@@loadpackage{#1}{#2}}}
1322 \newcommand*\caption@@loadpackage[2]{%
1323 \caption@Info{Option `#2' requires the `#1' package}%
1324 \RequirePackage{#1}\relax}
1325 \caption@AtBeginDocument{%
1326 \let\caption@@loadpackage\caption@@requirepackage}
1327 \newcommand*\caption@newfloat[2]{%
1328 \IfCaptionOptionCheck
1329 {\caption@requirepackage{newfloat}{#1}}%
1330 {\let\KV@prefix@ORI\KV@prefix
1331 \let\@tempc@ORI\@tempc
1332 \caption@loadpackage{newfloat}{#1}%
1333 #2%
1334 \let\@tempc\@tempc@ORI
1335 \let\KV@prefix\KV@prefix@ORI}}
1336 \DeclareCaptionOption{figurename}{\caption@SetName{figure}{#1}}
1337 \@onlypreamble@key{caption}{figurename}
1338 \DeclareCaptionOption{tablename}{\caption@SetName{table}{#1}}
1339 \@onlypreamble@key{caption}{tablename}
1340 \DeclareCaptionOption{listfigurename}{\caption@SetName{listfigure}{#1}}
1341 \@onlypreamble@key{caption}{listfigurename}
1342 \DeclareCaptionOption{listtablename}{\caption@SetName{listtable}{#1}}
1343 \@onlypreamble@key{caption}{listtablename}
1344 \newcommand*\caption@SetName[2]{%
1345 \caption@newfloat{#1name}{\newfloat@setname{#1}{#2}}}
1346 \@onlypreamble\caption@SetName
1347 \DeclareCaptionOption{name}{%
1348 \IfCaptionOptionCheck{}{\caption@setname\@captype{#1}}}
1349 \newcommand*\caption@setname[2]{%
1350 \@namedef{#1name}{#2}}
1351 \DeclareCaptionOption{figurewithin}{\caption@within{figure}{#1}}
1352 \DeclareCaptionOptionNoValue{figurewithout}{\caption@within{figure}{none}}
1353 \DeclareCaptionOption{tablewithin}{\caption@within{table}{#1}}
1354 \DeclareCaptionOptionNoValue{tablewithout}{\caption@within{table}{none}}
1355 \newcommand*\caption@within[2]{%
1356 \caption@newfloat{#1within=#2}{\newfloat@setwithin{#1}{#2}}}
1357 \DeclareCaptionOption{within}{%
1358 \caption@newfloat{within=#1}{\newfloatsetup{within=#1}}}
1359 \DeclareCaptionOptionNoValue{without}{%
1360 \caption@newfloat{without}{\newfloatsetup{without}}}
1361 \DeclareCaptionJustification[ragged2e]{Justified}{\justifying}
1362 \DeclareCaptionJustification[ragged2e]{Centering}{\Centering}
1363 \DeclareCaptionJustification[ragged2e]{RaggedLeft}{\RaggedLeft}
1364 \DeclareCaptionJustification[ragged2e]{RaggedRight}{\RaggedRight}
1365 \DeclareCaptionFont[sansmath]{sansmath}{\sansmath}
1366 \DeclareCaptionFont{singlespacing}{%
1367 \caption@ifdefined\setspace@singlespace
1368 {\setstretch\setspace@singlespace}% usually 1, could be changed by \SetSinglespace
1369 {}}
1370 \DeclareCaptionFont{stretch}{%
1371 \caption@ifdefined\setstretch
1372 {\setstretch{#1}}%
1373 {\def\baselinestretch{#1}\selectfont}}
1374 \DeclareCaptionFont[setspace]{onehalfspacing}{\onehalfspacing}
1375 \DeclareCaptionFont[setspace]{doublespacing}{\doublespacing}
1376 \caption@AtBeginDocument{%
1377 \def\@tempa{2005/06/28 ver: 1.3 subfig package}%
1378 \expandafter\ifx\csname [email protected]\endcsname\@tempa
1379 \caption@InfoNoLine{subfig package v1.3 is loaded}%
1380 \def\caption@eh{\caption@@eh{subfig}}%
1381 \let\caption@setfloattype\@gobble
1382 \let\@dottedxxxline\sf@NEW@dottedxxxline
1383 \let\sf@subfloat\sf@NEW@subfloat
1384 \def\sf@ifpositiontop{\caption@iftop}%
1385 \fi
1386 \let\sf@NEW@dottedxxxline\@undefined
1387 \let\sf@NEW@subfloat\@undefined}
1388 \def\sf@NEW@dottedxxxline#1#2#3#4#5#6#7{%
1389 \begingroup
1390 \caption@setfloattype{#1}%
1391 \caption@setoptions{subfloat}%
1392 \caption@setoptions{sub#1}%
1393 \ifnum #3>\@nameuse{c@#2depth}\else
1394 \@dottedtocline{\z@}{#4}{#5}{#6}{#7}%
1395 \fi
1396 \endgroup}
1397 \def\sf@NEW@subfloat{%
1398 \begingroup
1399 \@nameuse{caption@warmup}%
1400 \caption@setfloattype\@captype
1401 \sf@ifpositiontop{%
1402 \maincaptiontoptrue
1403 }{%
1404 \maincaptiontopfalse
1405 }%
1406 \caption@setoptions{subfloat}%
1407 \caption@setoptions{sub\@captype}%
1408 \let\sf@oldlabel=\label
1409 \let\label=\subfloat@label
1410 \ifmaincaptiontop\else
1411 \advance\@nameuse{c@\@captype}\@ne\relax
1412 \fi
1413 \refstepcounter{sub\@captype}%
1414 \setcounter{sub\@captype @save}{\value{sub\@captype}}%
1415 \@ifnextchar [% %] match left bracket
1416 {\sf@@subfloat}%
1417 {\sf@@subfloat[\@empty]}}
1418 \DeclareCaptionOption{lofdepth}[2]{\caption@ifdefined\c@lofdepth{\setcounter{lofdepth}{#1}}{}}
1419 \DeclareCaptionOption{lotdepth}[2]{\caption@ifdefined\c@lotdepth{\setcounter{lotdepth}{#1}}{}}
1420 \newcommand\caption@addcontentsline[2]{%
1421 \caption@ifcontentsline{#2}{%
1422 \begingroup
1423 \let\@tempa\@gobble
1424 \caption@ifdefined\caption@listtype
1425 {\let\@tempa\@firstofone}%
1426 {\edef\caption@listtype{#1}}%
1427 \caption@ifdefined\caption@listtype@ext
1428 {\edef\caption@listtype{\caption@listtype\caption@listtype@ext}%
1429 \let\@tempa\@firstofone}%
1430 {}%
1431 \@tempa
1432 {\caption@Debug{addcontentsline: #1 => \caption@listtype}%
1433 \@namedef{the\caption@listtype}{\caption@the{#1}}}%
1434 \expandafter\caption@@addcontentsline\expandafter{\caption@listtype}{#2}%
1435 \endgroup}%
1436 \caption@addsubcontentslines{#1}}
1437 \newcommand\caption@@addcontentsline[2]{%
1438 {\let\\\space
1439 \@ifundefined{ext@#1}%
1440 {\caption@Error{No float type '#1' defined}}%
1441 {\def\captionlisttype{#1}%
1442 \caption@add@contentsline
1443 {\csname ext@#1\endcsname}%
1444 {#1}%
1445 {\caption@listformat{\caption@p{#1}}{\caption@the{#1}}}%
1446 {\ignorespaces #2}%
1447 \caption@chkfloat{#1}{#2}}}}
1448 \newcommand*\caption@add@contentsline{%
1449 \caption@@@addcontentsline}
1450 \newcommand*\caption@@@addcontentsline[4]{%
1451 \addcontentsline{#1}{#2}{\protect\numberline{#3}{#4}}}
1452 \let\caption@chkfloat\@gobbletwo
1453 \newcommand\caption@ifcontentsline[1]{%
1454 \caption@iflist
1455 {\def\@tempa{#1}}%
1456 {\let\@tempa\@empty}%
1457 \ifx\@tempa\@empty
1458 \expandafter\@gobble
1459 \else
1460 \expandafter\@firstofone
1461 \fi}
1462 \newcommand*\caption@addsubcontentslines[1]{}
1463 \newif\ifcaption@star
1464 \newcommand*\caption@aboveskip{%
1465 \vskip\abovecaptionskip}
1466 \newcommand*\caption@belowskip{%
1467 \vskip\belowcaptionskip}
1468 \newcommand*\caption@fnum[1]{%
1469 \caption@@fnum{#1}{\@nameuse{#1name}}{\caption@the{#1}}}
1470 \newcommand*\caption@@fnum[1]{%
1471 \expandafter\let\expandafter\caption@original@fnum\csname caption@fnum@#1\endcsname % for label format `original'
1472 \caption@labelformat}
1473 \newcommand*\caption@setfnum[1]{%
1474 \@ifundefined{caption@fnum@#1}%
1475 {\expandafter\let\csname caption@fnum@#1\expandafter\endcsname\csname fnum@#1\endcsname
1476 \@namedef{fnum@#1}{\caption@fnum{#1}}}%
1477 {}}
1478 \newcommand*\caption@p[1]{\@nameuse{p@#1}}
1479 \newcommand*\caption@the[1]{\@nameuse{the#1}}
1480 \newcommand*\caption@make{%
1481 \kernel@ifnextchar[%]
1482 \caption@make@
1483 {\caption@make@@\caption@labelformat}}
1484 \def\caption@make@[#1]{%
1485 \caption@make@@{\caption@@fnum{#1}}}
1486 \newcommand\caption@make@@[3]{%
1487 \caption@@make{#1{#2}{#3}}}
1488 \newcommand\caption@@make[2]{%
1489 \begingroup
1490 \caption@@make@{#1}{#2}%
1491 \endgroup
1492 \caption@@make@epilogue}
1493 \newcommand\caption@@make@[2]{%
1494 \caption@stepthecounter
1495 \caption@beginhook
1496 \caption@box\hsize{%
1497 \caption@singlelinecheck{\caption@slc{#1}{#2}\caption@singleline\caption@multiline}{\caption@multiline}%
1498 \caption@calcmargin
1499 \caption@make@leftmargin
1500 \caption@make@parbox{%
1501 \caption@make@indention
1502 \caption@@@make{#1}{#2}}%
1503 \caption@make@rightmargin
1504 }%
1505 \caption@endhook}
1506 \newcommand*\caption@make@leftmargin{%
1507 \caption@tempdima\caption@leftmargin
1508 \caption@ifhmode{\advance\caption@tempdima\caption@indent\relax}%
1509 \hspace\caption@tempdima}
1510 \newcommand*\caption@make@parbox{%
1511 \caption@tempdima\caption@width
1512 \caption@ifhmode{\advance\caption@tempdima-\caption@indent\relax}%
1513 \caption@parbox\caption@tempdima}
1514 \newcommand*\caption@make@indention{%
1515 \caption@ifhmode{%
1516 \ifdim\caption@indent=\z@
1517 \leavevmode
1518 \else
1519 \hskip-\caption@indent
1520 \fi}}
1521 \newcommand*\caption@make@rightmargin{%
1522 \hspace\caption@rightmargin}
1523 \newcommand*\caption@@make@epilogue{%
1524 \global\caption@starfalse}
1525 \newcommand*\caption@calcmargin{%
1526 \caption@calcmargin@hook
1527 \ifdim\caption@width=\z@
1528 \ifdim\captionmargin=\z@ \else
1529 \caption@leftmargin\captionmargin
1530 \caption@rightmargin\captionmargin
1531 \fi
1532 \ifx\caption@maxmargin\@undefined \else
1533 \ifdim\caption@leftmargin>\caption@maxmargin
1534 \caption@leftmargin\caption@maxmargin
1535 \fi
1536 \ifdim\caption@rightmargin>\caption@maxmargin
1537 \caption@rightmargin\caption@maxmargin
1538 \fi
1539 \fi
1540 \ifx\caption@minmargin\@undefined \else
1541 \ifdim\caption@leftmargin<\caption@minmargin
1542 \caption@leftmargin\caption@minmargin
1543 \fi
1544 \ifdim\caption@rightmargin<\caption@minmargin
1545 \caption@rightmargin\caption@minmargin
1546 \fi
1547 \fi
1548 \ifdim\caption@leftmargin=\caption@rightmargin \else
1549 \caption@ifoddpage{}{%
1550 \caption@tempdima\caption@leftmargin
1551 \caption@leftmargin\caption@rightmargin
1552 \caption@rightmargin\caption@tempdima}%
1553 \fi
1554 \caption@width\hsize
1555 \advance\caption@width by -\caption@leftmargin\relax
1556 \advance\caption@width by -\caption@rightmargin\relax
1557 \else
1558 \caption@leftmargin\hsize
1559 \advance\caption@leftmargin by -\caption@width\relax
1560 \divide\caption@leftmargin by 2\relax
1561 \caption@rightmargin\caption@leftmargin
1562 \fi
1563 \caption@Debug{%
1564 hsize=\the\hsize,
1565 width=\the\caption@width,\MessageBreak
1566 leftmargin=\the\caption@leftmargin,
1567 rightmargin=\the\caption@rightmargin}}
1568 \newcommand\caption@slc[4]{%
1569 \caption@Debug{Begin SLC}%
1570 \singlelinecaptiontrue
1571 \begingroup
1572 \caption@singleline
1573 \let\caption@justification\relax
1574 \caption@calcmargin % calculate \caption@width
1575 \caption@prepareslc
1576 \sbox\@tempboxa{\caption@@@make{#1}{#2}}%
1577 \ifdim\wd\@tempboxa>\caption@width
1578 \endgroup
1579 \singlelinecaptionfalse
1580 #4%
1581 \else
1582 \endgroup
1583 #3%
1584 \fi
1585 \caption@Debug{End SLC}}
1586 \newif\ifsinglelinecaption
1587 \newcommand*\caption@singleline{%
1588 \caption@xsetup\caption@slsty % Note: This could change \caption@format
1589 \caption@format % defines \caption@ifhmode, \caption@slfmt, and \caption@fmt
1590 \let\caption@fmt\caption@slfmt}
1591 \newcommand*\caption@multiline{%
1592 \caption@format} % defines \caption@ifhmode, \caption@slfmt, and \caption@fmt
1593 \newcommand*\AtCaptionSingleLineCheck{%
1594 \g@addto@macro\caption@prepareslc}
1595 \providecommand*\caption@prepareslc{}
1596 \AtCaptionSingleLineCheck{%
1597 \let\caption@protect\protect
1598 \caption@ifdefined\GTS@DisablePredefinedCmds\GTS@DisablePredefinedCmds\relax
1599 \let\label\caption@gobble
1600 \let\index\caption@gobble
1601 \let\glossary\caption@gobble
1602 \let\hypertarget\@gobbletwo
1603 \let\footnote\caption@footnote
1604 \let\footnotemark\caption@footnotemark
1605 \let\footnotetext\caption@footnotetext
1606 \let\@footnotetext\@gobble
1607 \let\H@@footnotetext\@gobble
1608 \let\H@@mpfootnotetext\@gobble
1609 \caption@ifdefined\H@@footnotemark
1610 {\let\@footnotemark\H@@footnotemark}%
1611 {}%
1612 \let\tablefootnote\caption@footnote
1613 \let\endnote\caption@endnote
1614 \let\endnotemark\caption@endnotemark
1615 \let\endnotetext\caption@endnotetext
1616 \let\@endnotetext\@gobble
1617 \let\acused\@gobble
1618 \let\AC@placelabel\@gobble
1619 \let\glsunset\@gobble
1620 \caption@ifdefined\GTS@DisableHook\GTS@DisableHook\relax
1621 \let\protect\caption@protect
1622 }
1623 \newcommand*\caption@footnote{%
1624 \kernel@ifnextchar[%]
1625 \@xfootnote
1626 {\caption@l@stepcounter\@mpfn
1627 \protected@xdef\@thefnmark{\thempfn}%
1628 \@footnotemark\@footnotetext}}
1629 \newcommand*\caption@footnotemark{%
1630 \kernel@ifnextchar[%]
1631 \@xfootnotemark
1632 {\caption@l@stepcounter{footnote}%
1633 \protected@xdef\@thefnmark{\thefootnote}%
1634 \@footnotemark}}
1635 \newcommand*\caption@footnotetext{%
1636 \kernel@ifnextchar[%]
1637 \@xfootnotenext
1638 {\protected@xdef\@thefnmark{\thempfn}%
1639 \@footnotetext}}
1640 \newcommand*\caption@endnote{%
1641 \kernel@ifnextchar[%]
1642 \@xendnote
1643 {\caption@l@stepcounter{endnote}%
1644 \protected@xdef\@theenmark{\theendnote}%
1645 \@endnotemark\@endnotetext}}
1646 \newcommand*\caption@endnotemark{%
1647 \kernel@ifnextchar[%]
1648 \@xendnotemark
1649 {\caption@l@stepcounter{endnote}%
1650 \protected@xdef\@theenmark{\theendnote}%
1651 \@endnotemark}}
1652 \newcommand*\caption@endnotetext{%
1653 \kernel@ifnextchar[%]
1654 \@xendnotenext
1655 {\protected@xdef\@theenmark{\theendnote}%
1656 \@endnotetext}}
1657 \newcommand*\caption@l@stepcounter[1]{%
1658 \advance\csname c@#1\endcsname\@ne\relax}
1659 \newcommand*\caption@applyfont{%
1660 \caption@justification\captionfont\captionsize}
1661 \newcommand\caption@@@make[2]{%
1662 \ifx\caption@fmt\@undefined\caption@format\fi
1663 \let\caption@lfmt\caption@labelformat
1664 \global\def\caption@tempa{gobbletwo}%
1665 \global\def\caption@tempb{}%
1666 \sbox\@tempboxa{%
1667 \let\caption@ignorespaces\ignorespaces
1668 \def\ignorespaces{%
1669 \global\def\caption@tempb{two}% "gobble" -> "gobbletwo" if \ignorespaces is used addtionally
1670 \caption@ignorespaces}%
1671 #1%
1672 {\global\let\caption@tempa\@undefined\aftergroup\@gobble}%
1673 {\global\def\caption@tempa{gobble\caption@tempb}}}%
1674 \ifdim\wd\@tempboxa=\z@
1675 \gdef\caption@tempa{none}%
1676 \fi
1677 \ifx\caption@tempa\@undefined \else
1678 \@expandtwoargs\caption@set{labelseparator}{\caption@tempa}%
1679 \fi
1680 \caption@ifempty{#2}{%
1681 \caption@set{labelseparator}{none}%
1682 \caption@set{textformat}{simple}%
1683 }%
1684 \caption@labelseparator % defines \caption@iflabelfont, \caption@labelsep and \caption@labelsep@name (the latter is needed by \caption@fmt)
1685 \@setpar{\@@par\caption@@par}\caption@@par
1686 \caption@applyfont
1687 \caption@fmt
1688 {\ifcaption@star\else
1689 \begingroup
1690 \captionlabelfont
1691 #1\relax\relax
1692 \endgroup
1693 \fi}%
1694 {\ifcaption@star\else
1695 \begingroup
1696 \caption@iflabelfont\captionlabelfont
1697 \relax\caption@labelsep
1698 \endgroup
1699 \fi}%
1700 {{\captiontextfont
1701 \caption@textstart
1702 \caption@ifstrut
1703 {\vrule\@height\ht\strutbox\@width\z@}%
1704 {}%
1705 \nobreak\hskip\z@skip % enable hyphenation
1706 \caption@textformat{#2}%
1707 \caption@ifstrut
1708 {\ifhmode\@finalstrut\strutbox\fi}%
1709 {}%
1710 \caption@textend}}}
1711 \newcommand*\caption@textstart{}
1712 \newcommand*\caption@textend{\par}
1713 \newcommand\caption@ifempty[1]{%
1714 \caption@if@empty{#1}%
1715 \caption@ifempty\@unused}
1716 \newcommand\caption@if@empty[1]{%
1717 \def\caption@tempa{#1}%
1718 \ifx\caption@tempa\@empty
1719 \let\caption@ifempty\@secondoftwo
1720 \else
1721 \expandafter\def\expandafter\caption@tempa\expandafter{%
1722 \caption@car#1\caption@if@empty\caption@nil}%
1723 \def\caption@tempb{\caption@if@empty}%
1724 \ifx\caption@tempa\caption@tempb
1725 \let\caption@ifempty\@secondoftwo
1726 \else
1727 \def\caption@tempb{\ignorespaces}%
1728 \ifx\caption@tempa\caption@tempb
1729 \expandafter\caption@if@empty\expandafter{\@gobble#1}%
1730 \else
1731 \def\caption@tempb{\label}%
1732 \ifx\caption@tempa\caption@tempb
1733 \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
1734 \else
1735 \def\caption@tempb{\index}%
1736 \ifx\caption@tempa\caption@tempb
1737 \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
1738 \else
1739 \def\caption@tempb{\glossary}%
1740 \ifx\caption@tempa\caption@tempb
1741 \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
1742 \else
1743 \let\caption@ifempty\@gobbletwo
1744 \fi
1745 \fi
1746 \fi
1747 \fi
1748 \fi
1749 \fi}
1750 \long\def\caption@car#1#2\caption@nil{#1}% same as \@car, but \long
1751 \newcommand*\caption@@par{%
1752 \parindent\caption@parindent\hangindent\caption@hangindent}%
1753 \newcommand*\DeclareCaptionType{%
1754 \caption@loadpackage{newfloat}{declare type}%
1755 \DeclareFloatingEnvironment}
1756 \@onlypreamble\DeclareCaptionType
1757 \newcommand*\ForEachCaptionType{%
1758 \@ifstar
1759 {\caption@foreach@type\@gobble}%
1760 {\caption@foreach@type\@iden}}
1761 \newcommand\caption@foreach@type[2]{%
1762 \caption@ifdefined\ForEachFloatingEnvironment
1763 {\ForEachFloatingEnvironment*{#2}}%
1764 {\def\@elt##1{#2}%
1765 \caption@ifdefined\c@figure\@elt\@gobble{figure}%
1766 \caption@ifdefined\c@table\@elt\@gobble{table}%
1767 \let\@elt\relax}%
1768 #1{\newfloat@addtohook{#2}}}
1769 \providecommand\newfloat@addtohook[1]{%
1770 \toks@=\expandafter{\newfloat@hook{##1}#1}%
1771 \edef\@tempa{\def\noexpand\newfloat@hook####1{\the\toks@}}%
1772 \@tempa}
1773 \providecommand*\newfloat@hook[1]{}
1774 \newcommand*\DeclareCaptionSubType{%
1775 \caption@teststar\caption@declaresubtype\@firstoftwo\@secondoftwo}
1776 \@onlypreamble\DeclareCaptionSubType
1777 \newcommand*\caption@declaresubtype[1]{%
1778 \@testopt{\caption@@declaresubtype#1}{alph}}
1779 \@onlypreamble\caption@declaresubtype
1780 \def\caption@@declaresubtype#1[#2]#3{%
1781 \@ifundefined{c@#3}%
1782 {\caption@Error{No float type '#3' defined}}%
1783 {\caption@@@declaresubtype{#1}{#2}{#3}{sub#3}}}
1784 \@onlypreamble\caption@@declaresubtype
1785 \newcommand*\caption@@@declaresubtype[4]{%
1786 \caption@ifdefined@subtype{#4}%
1787 {\caption@Info{Modify subtype `#4'}}%
1788 {\caption@Info{New subtype `#4'}%
1789 \@ifundefined{c@#4}%
1790 {\newcounter{#4}[#3]%
1791 \@namedef{#4name}{}%
1792 \@namedef{#4autorefname}{\csname #3autorefname\endcsname}%
1793 \@namedef{ext@#4}{\csname ext@#3\endcsname}%
1794 \caption@declaresublistentry{#3}%
1795 \caption@ifdefined\contentsuse{%
1796 \contentsuse{#4}{\csname ext@#4\endcsname}}{}%
1797 \caption@l@addto@list\caption@subtypelist{#4}%
1798 \caption@subtype@hook{#4}}%
1799 {\caption@subtypesource\caption@subtype@source{#4}%
1800 \caption@Error{The counter `#4' was already defined by\MessageBreak\caption@subtype@source}}}%
1801 #1% is \@firstoftwo in star form, and \@secondoftwo otherwise
1802 {\@namedef{p@#4}{}%
1803 \@namedef{the#4}{\csname the#3\endcsname.\@nameuse{#2}{#4}}}%
1804 {\@namedef{p@#4}{\csname the#3\endcsname}%
1805 \@namedef{the#4}{\@nameuse{#2}{#4}}}%
1806 \@namedef{theH#4}{\csname theH#3\endcsname.\arabic{#4}}}
1807 \@onlypreamble\caption@@@declaresubtype
1808 \newcommand*\caption@declaresublistentry{%
1809 \caption@ifdefined\l@chapter
1810 {\caption@@declaresublistentry\l@subsection}%
1811 {\caption@@declaresublistentry\l@subsubsection}}
1812 \@onlypreamble\caption@declaresublistentry
1813 \newcommand*\caption@@declaresublistentry[2]{%
1814 \ifx#1\@undefined
1815 \caption@@@declaresublistentry\relax\@dottedtocline\caption@nil{#2}%
1816 \else
1817 \expandafter\caption@@@declaresublistentry#1{}{}\@dottedtocline\caption@nil{#2}%
1818 \fi}
1819 \@onlypreamble\caption@@declaresublistentry
1820 \long\def\caption@@@declaresublistentry#1\@dottedtocline#2\caption@nil#3{%
1821 \caption@iftokens{#1}%
1822 {\caption@@@@declaresublistentry{#3}@{3.8em}{3.2em}\caption@nil}%
1823 {\caption@@@@declaresublistentry{#3}#2\caption@nil}}
1824 \@onlypreamble\caption@@@declaresublistentry
1825 \def\caption@@@@declaresublistentry#1#2#3#4#5\caption@nil{%
1826 \expandafter\caption@@@@@declaresublistentry\expandafter
1827 {\csname @dotted\csname ext@#1\endcsname line\endcsname}{#1}{#3}{#4}}
1828 \@onlypreamble\caption@@@@declaresublistentry
1829 \newcommand*\caption@@@@@declaresublistentry[4]{%
1830 \@namedef{l@sub#2}{#1{2}{#3}{#4}}%
1831 \expandafter\caption@@@@@@declaresublistentry
1832 \expandafter#1\expandafter{\csname ext@#2\endcsname depth}}
1833 \@onlypreamble\caption@@@@@declaresublistentry
1834 \newcommand*\caption@@@@@@declaresublistentry[2]{
1835 \ifx#1\relax
1836 \def#1##1{%
1837 \def\next{\@dottedtocline{##1}}%
1838 \@ifundefined{c@#2}{}{%
1839 \ifnum ##1>\@nameuse{c@#2}\relax
1840 \let\next\@gobblefour
1841 \else
1842 \c@tocdepth=\@nameuse{c@#2}\relax
1843 \fi}%
1844 \next}%
1845 \fi}
1846 \@onlypreamble\caption@@@@@@declaresublistentry
1847 \newcommand*\caption@subtypelist{}
1848 \newcommand*\caption@ifdefined@subtype{%
1849 \caption@ifin@list\caption@subtypelist}
1850 \newcommand*\caption@subtypesource[2]{%
1851 \caption@ifdefined@subtype{#2}%
1852 {\def#1{\noexpand\DeclareCaptionSubType (offered by the caption package)}}%
1853 {\caption@ifin@list\sf@counterlist{#2}%
1854 {\def#1{\noexpand\newsubfloat (offered by the subfig package)}}%
1855 {\def#1{an unknown document class or package}}}}
1856 \newcommand*\ForEachCaptionSubType{%
1857 \@ifstar
1858 {\caption@foreach@subtype\@gobble}%
1859 {\caption@foreach@subtype\@iden}}
1860 \newcommand\caption@foreach@subtype[2]{%
1861 \caption@for@list\caption@subtypelist{#2}%
1862 #1{\caption@addto@subtype@hook{#2}}}
1863 \providecommand\caption@addto@subtype@hook[1]{%
1864 \toks@=\expandafter{\caption@subtype@hook{##1}#1}%
1865 \edef\@tempa{\def\noexpand\caption@subtype@hook####1{\the\toks@}}%
1866 \@tempa}
1867 \providecommand*\caption@subtype@hook[1]{}
1868 \caption@ifdefined\@memresetsubcounter
1869 {\let\caption@memresetsubcounter\@memresetsubcounter
1870 \renewcommand*\@memresetsubcounter[1]{%
1871 \caption@ifdefined@subtype{sub#1}\@gobble\caption@memresetsubcounter{#1}}}%
1872 {}
1873 \caption@ifdocumentclass{unknown}{}{%
1874 \caption@ifdocumentclass{standard}{}{%
1875 \@pushfilename
1876 \edef\@currname{caption-\caption@documentclass}
1877 \edef\@currext{sto}
1878 \InputIfFileExists
1879 {\@currname.\@currext}%
1880 {}%
1881 {\@missingfileerror\@currname\@currext}%
1882 \@popfilename}}
1883 \captionsetup{style=default,position=default,listformat=default}
1884 \ProcessOptions*
1885 \endinput
1886 %%
1887 %% End of file `caption3.sty'.