Debian Codegraph @

texmf-dist/tex/latex/caption/caption3_2020-07-29.sty

raw
1 %%
2 %% This is file `caption3_2020-07-29.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% fallback/v3.4/caption3.dtx (with options: `package')
8 %%
9 %% Copyright (C) 1994-2022 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 \ProvidesPackage{caption3}[2022/04/06 v1.13b caption3 kernel (AR)]
40 \providecommand\caption@FixArabTeX{%
41 \def\caption@tempa##1{}%
42 \ifx\caption@tempa\@gobble
43 \PackageInfo{caption3}{Fixing ArabTeX}%
44 \long\def\@gobble##1{}%
45 \fi}
46 \caption@FixArabTeX
47 \AtBeginDocument{%
48 \caption@FixArabTeX
49 \let\caption@FixArabTeX\@undefined}
50 \providecommand*\@nameundef[1]{%
51 \expandafter\let\csname #1\endcsname\@undefined}
52 \begingroup\expandafter\expandafter\expandafter\endgroup
53 \expandafter\ifx\csname currentgrouplevel\endcsname\relax
54 \PackageInfo{caption3}{TeX engine: TeX}
55 \let\caption@ifeTeX\@secondoftwo
56 \providecommand\l@addto@macro[2]{%
57 \begingroup
58 \toks@\expandafter{#1#2}%
59 \xdef\caption@addto@temp{\the\toks@}%
60 \endgroup
61 \let#1\caption@addto@temp}
62 \else
63 \PackageInfo{caption3}{TeX engine: e-TeX}
64 \let\caption@ifeTeX\@firstoftwo
65 \providecommand\l@addto@macro[2]{%
66 \edef#1{\unexpanded\expandafter{#1#2}}}
67 \fi
68 \def\bothIfFirst#1#2{%
69 \protected@edef\caption@tempa{#1}%
70 \ifx\caption@tempa\@empty \else
71 #1#2%
72 \fi}
73 \def\bothIfSecond#1#2{%
74 \protected@edef\caption@tempa{#2}%
75 \ifx\caption@tempa\@empty \else
76 #1#2%
77 \fi}
78 \newcommand*\caption@ifundefined[1]{%
79 \ifx#1\@undefined
80 \expandafter\@firstoftwo
81 \else\ifx#1\relax
82 \expandafter\expandafter\expandafter\@firstoftwo
83 \else
84 \expandafter\expandafter\expandafter\@secondoftwo
85 \fi\fi}
86 \newcommand*\caption@ifdefined[1]{%
87 \ifx#1\@undefined
88 \expandafter\@secondoftwo
89 \else\ifx#1\relax
90 \expandafter\expandafter\expandafter\@secondoftwo
91 \else
92 \expandafter\expandafter\expandafter\@firstoftwo
93 \fi\fi}
94 \newcommand*\caption@ifinlist{%
95 \@expandtwoargs\caption@@ifinlist}
96 \newcommand*\caption@@ifinlist[2]{%
97 \begingroup
98 \def\@tempa##1,#1,##2\@nil{%
99 \endgroup
100 \ifx\relax##2\relax
101 \expandafter\@secondoftwo
102 \else
103 \expandafter\@firstoftwo
104 \fi}%
105 \@tempa,#2,#1,\@nil}%
106 \newcommand*\caption@ifin@list[2]{%
107 \caption@ifempty@list#1%
108 {\@secondoftwo}%
109 {\@expandtwoargs\caption@@ifinlist{#2}{#1}}}
110 \newcommand*\caption@g@addto@list[2]{%
111 \caption@ifempty@list#1{\gdef#1{#2}}{\g@addto@macro#1{,#2}}}
112 \newcommand*\caption@l@addto@list[2]{%
113 \caption@ifempty@list#1{\def#1{#2}}{\l@addto@macro#1{,#2}}}
114 \newcommand*\caption@g@removefrom@list[2]{%
115 \caption@l@removefrom@list#1{#2}%
116 \global\let#1#1}
117 \newcommand*\caption@l@removefrom@list[2]{%
118 \caption@ifempty@list#1{}{\@expandtwoargs\@removeelement{#2}#1#1}}
119 \newcommand*\caption@for@list[2]{%
120 \caption@ifempty@list#1{}{%
121 \def\caption@tempb##1{#2}%
122 \@for\caption@tempa:=#1\do{%
123 \expandafter\caption@tempb\expandafter{\caption@tempa}}}}
124 \newcommand*\caption@ifempty@list[1]{%
125 \ifx#1\@undefined
126 \expandafter\@firstoftwo
127 \else\ifx#1\relax
128 \expandafter\expandafter\expandafter\@firstoftwo
129 \else\ifx#1\@empty
130 \expandafter\expandafter\expandafter\expandafter
131 \expandafter\expandafter\expandafter\@firstoftwo
132 \else
133 \expandafter\expandafter\expandafter\expandafter
134 \expandafter\expandafter\expandafter\@secondoftwo
135 \fi\fi\fi}
136 \newcommand*\caption@setbool[1]{%
137 \expandafter\caption@set@bool\csname caption@if#1\endcsname}
138 \newcommand*\caption@set@bool[2]{%
139 \caption@ifinlist{#2}{1,true,yes,on}{%
140 \let#1\@firstoftwo
141 }{\caption@ifinlist{#2}{0,false,no,off}{%
142 \let#1\@secondoftwo
143 }{%
144 \caption@Error{Undefined boolean value `#2'}%
145 }}}
146 \newcommand*\caption@ifbool[1]{\@nameuse{caption@if#1}}
147 \newcommand*\caption@undefbool[1]{\@nameundef{caption@if#1}}
148 \newcommand*\caption@teststar[3]{\@ifstar{#1{#2}}{#1{#3}}}
149 \newcommand*\caption@teststar@[3]{%
150 \@ifstar{#1{#2}}{\caption@ifatletter{#1{#2}}{#1{#3}}}}
151 \AtBeginDocument{\let\caption@teststar@\caption@teststar}
152 \newcommand*\caption@ifatletter{%
153 \ifnum\the\catcode`\@=11
154 \expandafter\@firstoftwo
155 \else
156 \expandafter\@secondoftwo
157 \fi}
158 \AtBeginDocument{\let\caption@ifatletter\@secondoftwo}
159 \newcommand*\caption@withoptargs[1]{%
160 \@ifstar
161 {\def\caption@tempa{*}\caption@@withoptargs{#1}}%
162 {\def\caption@tempa{}\caption@@withoptargs{#1}}}
163 \def\caption@@withoptargs#1{%
164 \@ifnextchar[%]
165 {\caption@@@withoptargs{#1}}%
166 {\caption@@@@withoptargs{#1}}}
167 \def\caption@@@withoptargs#1[#2]{%
168 \l@addto@macro\caption@tempa{[{#2}]}%
169 \caption@@withoptargs{#1}}
170 \def\caption@@@@withoptargs#1{%
171 \def\caption@tempb{#1}%
172 \expandafter\caption@tempb\expandafter{\caption@tempa}}
173 \DeclareRobustCommand*\caption@gobble{%
174 \caption@withoptargs\@gobbletwo}
175 \let\caption@begindocumenthook\@empty
176 \let\caption@@begindocumenthook\@empty
177 \def\caption@AtBeginDocument{%
178 \caption@teststar\g@addto@macro
179 \caption@@begindocumenthook\caption@begindocumenthook}
180 \AtBeginDocument{%
181 \caption@InfoNoLine{Begin \noexpand\AtBeginDocument code}%
182 \def\caption@AtBeginDocument{%
183 \@ifstar{\g@addto@macro\caption@@begindocumenthook}\@firstofone}%
184 \caption@begindocumenthook
185 \let\caption@begindocumenthook\relax
186 \def\caption@AtBeginDocument{%
187 \@ifstar\@firstofone\@firstofone}%
188 \caption@@begindocumenthook
189 \let\caption@@begindocumenthook\relax
190 \caption@InfoNoLine{End \noexpand\AtBeginDocument code}}
191 \newcommand*\caption@Info[1]{%
192 \PackageInfo{caption}{#1}}
193 \newcommand*\caption@InfoNoLine[1]{%
194 \caption@Info{#1\@gobble}}
195 \newcommand*\caption@Warning[1]{%
196 \caption@WarningNoLine{#1\on@line}}
197 \newcommand*\caption@WarningNoLine[1]{%
198 \PackageWarning{caption}{#1.^^J\caption@wh\@gobbletwo}}
199 \newcommand*\caption@wh{%
200 See the caption package documentation for explanation.}
201 \newcommand*\caption@Error[1]{%
202 \PackageError{caption}{#1}\caption@eh}
203 \newcommand*\caption@eh{%
204 If you do not understand this error, please take a closer look\MessageBreak
205 at the documentation of the `caption' package, especially the\MessageBreak
206 section about errors.\MessageBreak\@ehc}
207 \let\caption@KV@err\caption@Error
208 \RequirePackage{keyval}[1997/11/10]
209 \providecommand*\undefine@key[2]{%
210 \@nameundef{KV@#1@#2}\@nameundef{KV@#1@#2@default}}
211 \providecommand*\@preamble@keys{}
212 \providecommand*\@onlypreamble@key[2]{\@cons\@preamble@keys{{#1}{#2}}}
213 \@onlypreamble\@onlypreamble@key
214 \@onlypreamble\@preamble@keys
215 \providecommand*\@notprerr@key[1]{\KV@err{Can be used only in preamble}}
216 \caption@AtBeginDocument*{%
217 \def\@elt#1#2{\expandafter\let\csname KV@#1@#2\endcsname\@notprerr@key}%
218 \@preamble@keys
219 \let\@elt\relax}
220 \newcommand*\DeclareCaptionOption{%
221 \caption@teststar\caption@declareoption\AtEndOfPackage\@gobble}
222 \@onlypreamble\DeclareCaptionOption
223 \newcommand*\caption@declareoption[2]{%
224 #1{\undefine@key{caption}{#2}}\caption@declare@option{#2}}
225 \@onlypreamble\caption@declareoption
226 \newcommand*\caption@declare@option{%
227 \define@key{caption}}
228 %% no \@onlypreamble\caption@declare@option, will be used by \captionsetup
229 \newcommand*\DeclareCaptionOptionNoValue{%
230 \caption@teststar\caption@declareoption@novalue\AtEndOfPackage\@gobble}
231 \@onlypreamble\DeclareCaptionOptionNoValue
232 \newcommand\caption@declareoption@novalue[3]{%
233 \caption@declareoption{#1}{#2}[\KV@err]{%
234 \caption@option@novalue{#2}{##1}{#3}}}
235 \@onlypreamble\caption@declareoption@novalue
236 \newcommand*\caption@option@novalue[2]{%
237 \ifx\KV@err#2%
238 \expandafter\@firstofone
239 \else
240 \KV@err{No value allowed for #1}%
241 \expandafter\@gobble
242 \fi}
243 \newif\ifcaptionsetup@star
244 \newcommand*\captionsetup{%
245 \caption@teststar@\@captionsetup\@gobble\@firstofone}
246 \newcommand*\@captionsetup[1]{%
247 \captionsetup@startrue#1\captionsetup@starfalse
248 \@ifnextchar[%]
249 \caption@setup@options\caption@setup}
250 \newcommand*\caption@setup{%
251 \caption@setkeys{caption}}
252 \def\caption@setup@options[#1]{%
253 \@ifnextchar[%]
254 {\caption@stepthecounter
255 \@expandtwoargs\caption@setup@options@@{#1}{@\caption@thecounter}}%
256 {\caption@setup@options@{#1}}}
257 \def\caption@setup@options@@#1#2[#3]#4{%
258 \caption@declare@option{#2}[]{\caption@setup@options@{#3}{#4}}%
259 \caption@setup@options@{#1}{#2}}
260 \newcommand*\caption@setup@options@[2]{%
261 \@bsphack
262 \ifcaptionsetup@star\captionsetup@starfalse\else\caption@addtooptlist{#1}\fi
263 \caption@checkoptions{#2}%
264 \expandafter\caption@l@addto@list\csname caption@opt@#1\endcsname{#2}%
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{\protect\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 \ifx\caption@keydepth\@empty \captionsetup@starfalse \fi
373 \@esphack}
374 \let\caption@keydepth\@empty
375 \newcommand*\caption@ExecuteOptions[2]{%
376 \expandafter\@expandtwoargs\csname caption@setkeys@#1\endcsname{#1}{#2}}%
377 \@onlypreamble\caption@ExecuteOptions
378 \newcommand*\caption@ProcessOptions{%
379 \caption@teststar\caption@@ProcessOptions\@gobble\@firstofone}
380 \@onlypreamble\caption@ProcessOptions
381 \newcommand\caption@@ProcessOptions[2]{%
382 \let\@tempc\relax
383 \let\caption@tempa\@empty
384 #1{% \@firstofone -or- \@gobble
385 \@for\CurrentOption:=\@classoptionslist\do{%
386 \@ifundefined{KV@#2@\CurrentOption}{}{%
387 \@ifundefined{KV@#2@\CurrentOption @default}{%
388 \PackageInfo{#2}{Global option `\CurrentOption' ignored}%
389 }{%
390 \PackageInfo{#2}{Global option `\CurrentOption' processed}%
391 \edef\caption@tempa{\caption@tempa\CurrentOption,}%
392 \@expandtwoargs\@removeelement\CurrentOption
393 \@unusedoptionlist\@unusedoptionlist
394 }%
395 }%
396 }%
397 \let\CurrentOption\@empty
398 }%
399 \caption@ExecuteOptions{#2}{\caption@tempa\@ptionlist{\@currname.\@currext}}%
400 \AtEndOfPackage{\let\@unprocessedoptions\relax}}
401 \@onlypreamble\caption@@ProcessOptions
402 \newcommand\caption@SetupOptions[2]{%
403 \@namedef{caption@setkeys@#1}##1##2{#2}%
404 \expandafter\@onlypreamble\csname caption@setkeys@#1\endcsname
405 \@cons\caption@SetupOptions@list{{#1}}}
406 \@onlypreamble\caption@SetupOptions
407 \newcommand*\caption@SetupOptions@list{}
408 \@onlypreamble\caption@SetupOptions@list
409 \let\caption@onefilewithoptions\@onefilewithoptions
410 \def\@onefilewithoptions#1[#2]{%
411 \begingroup
412 \def\@tempa{%
413 \endgroup
414 \caption@onefilewithoptions{#1}[{#2}]}%
415 \def\@tempb{#1}%
416 \def\@elt##1{%
417 \def\@tempc{##1}%
418 \ifx\@tempb\@tempc
419 \def\@tempa{%
420 \endgroup
421 \caption@ExecuteOptions{#1}{#2}%
422 \caption@onefilewithoptions{#1}[]}%
423 \fi}
424 \caption@SetupOptions@list
425 \@tempa}
426 \@onlypreamble\caption@onefilewithoptions
427 \newdimen\captionmargin
428 \newdimen\captionmargin@
429 \newdimen\captionwidth
430 \newdimen\caption@tempdima
431 \DeclareCaptionOption{margin}{\setcaptionmargin{#1}}
432 \DeclareCaptionOption{margin*}{\setcaptionmargin*{#1}}
433 \DeclareCaptionOption{width}{\setcaptionwidth{#1}}
434 \DeclareCaptionOption{width*}{\setcaptionwidth*{#1}}
435 \DeclareCaptionOption{calcmargin}{\caption@setcalcmargin{#1}}
436 \DeclareCaptionOption{calcmargin*}{\caption@setcalcmargin*{#1}}
437 \DeclareCaptionOption{calcwidth}{\caption@setcalcwidth{#1}}
438 \DeclareCaptionOption{calcwidth*}{\caption@setcalcwidth*{#1}}
439 \DeclareCaptionOption{twoside}[1]{\caption@set@bool\caption@iftwoside{#1}}
440 \DeclareCaptionOptionNoValue{oneside}{\caption@set@bool\caption@iftwoside0}
441 \DeclareCaptionOption{minmargin}{\caption@setoptcmd\caption@minmargin{#1}}
442 \DeclareCaptionOption{maxmargin}{\caption@setoptcmd\caption@maxmargin{#1}}
443 \newcommand*\setcaptionmargin{%
444 \caption@resetcalcmargin
445 \caption@setmargin}
446 \newcommand*\caption@setmargin{%
447 \caption@teststar\caption@@setmargin\@gobble\@firstofone}
448 \newcommand*\caption@@setmargin[2]{%
449 #1{\captionwidth\z@}%
450 \caption@@@setmargin#2,#2,\@nil}
451 \def\caption@@@setmargin#1,#2,#3\@nil{%
452 \setlength\captionmargin@{#2}%
453 \setlength\captionmargin{#1}%
454 \addtolength\captionmargin@{-\captionmargin}}
455 \newcommand*\setcaptionwidth{%
456 \caption@resetcalcmargin
457 \caption@setwidth}
458 \newcommand*\caption@setwidth{%
459 \caption@teststar\caption@@setwidth\@gobble\@firstofone}
460 \newcommand*\caption@@setwidth[2]{%
461 #1{\captionmargin\z@\captionmargin@\z@}%
462 \setlength\captionwidth{#2}}%
463 \newcommand*\caption@resetcalcmargin{%
464 \let\caption@calcmargin@hook\@empty}
465 \newcommand*\caption@setcalcmargin{%
466 \caption@teststar{\caption@@setcalcmargin\caption@setmargin}%
467 \@secondoftwo\@firstoftwo}
468 \newcommand*\caption@@setcalcmargin[3]{%
469 #2{\caption@resetcalcmargin
470 \l@addto@macro\caption@calcmargin@hook{#1{#3}}}%
471 {\l@addto@macro\caption@calcmargin@hook{#1*{#3}}}}
472 \newcommand*\caption@setcalcwidth{%
473 \caption@teststar{\caption@@setcalcmargin\caption@setwidth}%
474 \@secondoftwo\@firstoftwo}
475 \newcommand*\caption@thecounter{0}
476 \newcommand*\caption@stepthecounter{%
477 \@tempcnta\caption@thecounter
478 \advance\@tempcnta\@ne
479 \xdef\caption@thecounter{\the\@tempcnta}}
480 \newcommand*\caption@newlabel{\@newl@bel{caption@r}}
481 \newcommand*\caption@thepage{\the\c@page}
482 \newcommand*\caption@label[1]{%
483 \caption@@label
484 \protected@write\@auxout{\let\caption@thepage\relax}%
485 {\string\caption@newlabel{#1}{\caption@thepage}}}
486 \newcommand*\caption@@label{%
487 \global\let\caption@@label\relax
488 \protected@write\@auxout{}%
489 {\string\providecommand*\string\caption@newlabel[2]{}}}
490 \newcommand*\caption@pageref[1]{%
491 \expandafter\ifx\csname caption@r@#1\endcsname\relax
492 \G@refundefinedtrue % => 'There are undefined references.'
493 \@latex@warning{Reference `#1' on page \thepage \space undefined}%
494 \else
495 \expandafter\let\expandafter\caption@thepage\csname caption@r@#1\endcsname
496 \fi}
497 \newcommand*\caption@ifoddpage{%
498 \caption@iftwoside{%
499 \caption@label\caption@thecounter
500 \caption@pageref\caption@thecounter
501 \ifodd\caption@thepage
502 \let\caption@ifoddpage\@firstoftwo
503 \else
504 \let\caption@ifoddpage\@secondoftwo
505 \fi
506 }{\let\caption@ifoddpage\@firstoftwo}%
507 \caption@ifoddpage}
508 \newcommand*\caption@setoptcmd[2]{%
509 \caption@ifinlist{#2}{0,false,no,off}{\let#1\@undefined}{\def#1{#2}}}
510 \newdimen\caption@indent
511 \newdimen\caption@parindent
512 \newdimen\caption@hangindent
513 \DeclareCaptionOption{indent}[\leftmargini]{% obsolete!
514 \setlength\caption@indent{#1}}
515 \DeclareCaptionOption{indention}[\leftmargini]{%
516 \setlength\caption@indent{#1}}
517 \DeclareCaptionOption{parindent}{%
518 \setlength\caption@parindent{#1}}
519 \DeclareCaptionOption{hangindent}{%
520 \setlength\caption@hangindent{#1}}
521 \DeclareCaptionOption{parskip}{%
522 \l@addto@macro\caption@@par{\setlength\parskip{#1}}}
523 \newcommand*\DeclareCaptionStyle[1]{%
524 \@testopt{\caption@declarestyle{#1}}{}}
525 \@onlypreamble\DeclareCaptionStyle
526 \def\caption@declarestyle#1[#2]#3{%
527 \global\@namedef{caption@sls@#1}{#2}%
528 \global\@namedef{caption@sty@#1}{#3}}
529 \@onlypreamble\caption@declarestyle
530 \DeclareCaptionOption{style}{\caption@setstyle{#1}}
531 \DeclareCaptionOption{style*}{\caption@setstyle*{#1}}
532 \newcommand*\caption@setstyle{%
533 \caption@teststar\caption@@setstyle\@gobble\@firstofone}
534 \newcommand*\caption@@setstyle[2]{%
535 \@ifundefined{caption@sty@#2}%
536 {#1{\caption@Error{Undefined style `#2'}}}%
537 {\expandafter\let\expandafter\caption@sty\csname caption@sty@#2\endcsname
538 \ifx\caption@setstyle@flag\@undefined
539 \let\caption@setstyle@flag\relax
540 \caption@resetstyle
541 \caption@xsetup\caption@sty
542 \let\caption@setstyle@flag\@undefined
543 \else
544 \caption@xsetup\caption@sty
545 \fi
546 \expandafter\let\expandafter\caption@sls\csname caption@sls@#2\endcsname
547 \expandafter\caption@l@addto@list\expandafter\caption@opt@singleline
548 \expandafter{\caption@sls}}}
549 \newcommand*\caption@resetstyle{%
550 \caption@setup{%
551 box=none,boxcolor=white,parbox=parbox,%
552 format=plain,labelformat=default,labelsep=colon,textformat=simple,%
553 justification=justified,font=,size=,labelfont=,textfont=,%
554 margin=0pt,minmargin=0,maxmargin=0,%
555 indent=0pt,parindent=0pt,hangindent=0pt,%
556 slc,rule,strut}%
557 \caption@clearsetup{singleline}}
558 \DeclareCaptionStyle{base}[indent=0pt,justification=centering]{}
559 \DeclareCaptionStyle{default}[indent=0pt,justification=centering]{%
560 box=default,format=default,labelsep=default,textformat=default,%
561 justification=default,font=default,labelfont=default,textfont=default}
562 \DeclareCaptionOption{singlelinecheck}[1]{\caption@set@bool\caption@ifslc{#1}}
563 \DeclareCaptionOption{slc}[1]{\KV@caption@singlelinecheck{#1}}
564 \newcommand*\DeclareCaptionBox[2]{%
565 \global\long\@namedef{caption@box@#1}##1##2{#2}}
566 \@onlypreamble\DeclareCaptionBox
567 \DeclareCaptionOption{box}{\caption@setbox{#1}}
568 \DeclareCaptionOption{parbox}{\caption@set@box\caption@parbox{#1}}
569 \newcommand*\caption@setbox{%
570 \caption@set@box\caption@box}
571 \newcommand*\caption@set@box[2]{%
572 \@ifundefined{caption@box@#2}%
573 {\caption@Error{Undefined box `#2'}}%
574 {\expandafter\let\expandafter#1\csname caption@box@#2\endcsname}}
575 \DeclareCaptionBox{empty}{}
576 \DeclareCaptionBox{none}{#2}
577 \DeclareCaptionBox{parbox}{\parbox[b]{#1}{#2}}
578 \DeclareCaptionBox{colorbox}{\colorbox{\caption@boxcolor}{%
579 \setlength\caption@tempdima{#1}%
580 \addtolength\caption@tempdima{-2\fboxsep}%
581 \linewidth\caption@tempdima
582 \hsize\caption@tempdima
583 #2}}
584 \DeclareCaptionOption{boxcolor}{\def\caption@boxcolor{#1}}
585 \DeclareCaptionOption{boxsep}{\setlength\fboxsep{#1}}
586 \def\caption@box@default{\caption@box@none}
587 \newcommand*\DeclareCaptionFormat{%
588 \caption@teststar\caption@declareformat\@gobble\@firstofone}
589 \@onlypreamble\DeclareCaptionFormat
590 \newcommand*\caption@declareformat[2]{%
591 \@dblarg{\caption@@declareformat#1{#2}}}
592 \@onlypreamble\caption@declareformat
593 \long\def\caption@@declareformat#1#2[#3]#4{%
594 \global\expandafter\let\csname caption@ifh@#2\endcsname#1%
595 \global\long\@namedef{caption@slfmt@#2}##1##2##3{#3}%
596 \global\long\@namedef{caption@fmt@#2}##1##2##3{#4}}
597 \@onlypreamble\caption@@declareformat
598 \DeclareCaptionOption{format}{\caption@setformat{#1}}
599 \newcommand*\caption@setformat[1]{%
600 \@ifundefined{caption@fmt@#1}%
601 {\caption@Error{Undefined format `#1'}}%
602 {\expandafter\let\expandafter\caption@ifh\csname caption@ifh@#1\endcsname
603 \expandafter\let\expandafter\caption@slfmt\csname caption@slfmt@#1\endcsname
604 \expandafter\let\expandafter\caption@fmt\csname caption@fmt@#1\endcsname}}
605 \newcommand*\DeclareCaptionDefaultFormat[1]{%
606 \expandafter\def\expandafter\caption@fmt@default\expandafter
607 {\csname caption@fmt@#1\endcsname}%
608 \expandafter\def\expandafter\caption@slfmt@default\expandafter
609 {\csname caption@slfmt@#1\endcsname}%
610 \expandafter\def\expandafter\caption@ifh@default\expandafter
611 {\csname caption@ifh@#1\endcsname}}
612 \@onlypreamble\DeclareCaptionDefaultFormat
613 \DeclareCaptionFormat{plain}{#1#2#3\par}
614 \DeclareCaptionFormat{hang}[#1#2#3\par]{%
615 \caption@ifin@list\caption@lsepcrlist\caption@lsepname
616 {\caption@Error{%
617 The option `labelsep=\caption@lsepname' does not work\MessageBreak
618 with `format=hang'}}%
619 {\@hangfrom{#1#2}%
620 \advance\caption@parindent\hangindent
621 \advance\caption@hangindent\hangindent
622 \caption@@par#3\par}}
623 \DeclareCaptionDefaultFormat{plain}
624 \newcommand*\DeclareCaptionLabelFormat[2]{%
625 \global\@namedef{caption@lfmt@#1}##1##2{#2}}
626 \@onlypreamble\DeclareCaptionLabelFormat
627 \DeclareCaptionOption{labelformat}{\caption@setlabelformat{#1}}
628 \newcommand*\caption@setlabelformat[1]{%
629 \@ifundefined{caption@lfmt@#1}%
630 {\caption@Error{Undefined label format `#1'}}%
631 {\expandafter\let\expandafter\caption@lfmt\csname caption@lfmt@#1\endcsname}}
632 \DeclareCaptionLabelFormat{empty}{}
633 \DeclareCaptionLabelFormat{simple}{\bothIfFirst{#1}{\nobreakspace}#2}
634 \DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{\nobreakspace}(#2)}
635 \DeclareCaptionLabelFormat{brace}{\bothIfFirst{#1}{\nobreakspace}#2)}
636 \DeclareCaptionLabelFormat{autodot}{\bothIfFirst{#1}{\nobreakspace}#2\autodot}
637 \DeclareCaptionLabelFormat{unnumbered}{#1}
638 \def\caption@lfmt@default{\caption@lfmt@simple}
639 \newcommand\DeclareCaptionLabelSeparator{%
640 \caption@teststar\caption@declarelabelseparator\@gobble\@firstofone}
641 \@onlypreamble\DeclareCaptionLabelSeparator
642 \newcommand\caption@declarelabelseparator[3]{%
643 \global\@namedef{caption@iflf@#2}{#1}%
644 \global\long\@namedef{caption@lsep@#2}{#3}%
645 \caption@@declarelabelseparator{#2}#3\\\@nil}
646 \@onlypreamble\caption@declarelabelseparator
647 \long\def\caption@@declarelabelseparator#1#2\\#3\@nil{%
648 \def\@tempa{#3}\ifx\@tempa\@empty \else
649 \caption@g@addto@list\caption@lsepcrlist{#1}%
650 \fi}
651 \@onlypreamble\caption@@declarelabelseparator
652 \DeclareCaptionOption{labelsep}{\caption@setlabelseparator{#1}}
653 \DeclareCaptionOption{labelseparator}{\caption@setlabelseparator{#1}}
654 \newcommand*\caption@setlabelseparator[1]{%
655 \@ifundefined{caption@lsep@#1}%
656 {\caption@Error{Undefined label separator `#1'}}%
657 {\edef\caption@lsepname{#1}%
658 \expandafter\let\expandafter\caption@iflf\csname caption@iflf@#1\endcsname
659 \expandafter\let\expandafter\caption@lsep\csname caption@lsep@#1\endcsname}}
660 \DeclareCaptionLabelSeparator{none}{}
661 \DeclareCaptionLabelSeparator{colon}{: }
662 \DeclareCaptionLabelSeparator{period}{. }
663 \DeclareCaptionLabelSeparator{space}{ }
664 \DeclareCaptionLabelSeparator*{quad}{\quad}
665 \DeclareCaptionLabelSeparator*{newline}{\captionnewline}
666 \DeclareCaptionLabelSeparator*{endash}{\space\textendash\space}
667 \newcommand*\captionnewline{\\}
668 \newcommand*\caption@setdefaultlabelsep[1]{%
669 \ifx\caption@lsep\caption@lsep@default
670 \caption@set@default@labelsep{#1}%
671 \caption@setlabelseparator{default}%
672 \else
673 \caption@set@default@labelsep{#1}%
674 \fi}
675 \newcommand*\caption@set@default@labelsep[1]{%
676 \def\caption@lsep@default{\@nameuse{caption@lsep@#1}}%
677 \def\caption@iflf@default{\@nameuse{caption@iflf@#1}}}
678 \caption@set@default@labelsep{colon}
679 \newcommand*\DeclareCaptionTextFormat[2]{%
680 \global\long\@namedef{caption@tfmt@#1}##1{#2}}
681 \@onlypreamble\DeclareCaptionTextFormat
682 \DeclareCaptionOption{textformat}{\caption@settextformat{#1}}
683 \DeclareCaptionOption{strut}[1]{\caption@set@bool\caption@ifstrut{#1}}
684 \newcommand*\caption@settextformat[1]{%
685 \@ifundefined{caption@tfmt@#1}%
686 {\caption@Error{Undefined text format `#1'}}%
687 {\expandafter\let\expandafter\caption@tfmt\csname caption@tfmt@#1\endcsname}}
688 \DeclareCaptionTextFormat{empty}{%
689 \caption@get@label#1\caption@makeanchor{}\@nil
690 \caption@thelabel
691 \global\let\caption@thelabel\relax}
692 \long\def\caption@get@label#1\caption@makeanchor#2#3\@nil{%
693 \def\caption@tempa{#2}%
694 \ifx\caption@tempa\@empty
695 \caption@getlabel#1\label{}\@nil
696 \else
697 \caption@getlabel#2\label{}\@nil
698 \fi}
699 \DeclareCaptionTextFormat{simple}{#1}
700 \DeclareCaptionTextFormat{period}{#1.}
701 \def\caption@tfmt@default{\caption@tfmt@simple}
702 \long\def\caption@getlabel#1\label#2#3\@nil{%
703 \def\@tempa{#2}%
704 \ifx\@tempa\@empty
705 \let\caption@thelabel\relax
706 \else
707 \def\@tempb{*}%
708 \ifx\@tempa\@tempb
709 \def\caption@thelabel{\label*}%
710 \caption@@getlabel#3\@nil
711 \else
712 \def\caption@thelabel{\label}%
713 \caption@@getlabel{#2}#3\@nil
714 \fi
715 \fi}
716 \long\def\caption@@getlabel#1#2\@nil{%
717 \def\@tempa{#1}%
718 \def\@tempb{[}%
719 \ifx\@tempa\@tempb
720 \caption@@@getlabel#1#2\@nil
721 \else
722 \l@addto@macro\caption@thelabel{{#1}}%
723 \fi}
724 \long\def\caption@@@getlabel[#1]#2\@nil{%
725 \l@addto@macro\caption@thelabel{[{#1}]}%
726 \caption@@getlabel#2\@nil}
727 \let\caption@thelabel\relax
728 \newcommand*\DeclareCaptionFont{%
729 \@ifnextchar[%]
730 \caption@declare@font
731 \caption@declarefont}
732 \@onlypreamble\DeclareCaptionFont
733 \def\caption@declare@font[#1]#2{%
734 \global\@namedef{caption@fnt@#2@package}{#1}%
735 \caption@@declarefont{#2}}
736 \@onlypreamble\caption@declare@font
737 \newcommand*\caption@declarefont[1]{%
738 \global\@nameundef{caption@fnt@#1@package}%
739 \caption@@declarefont{#1}}
740 \@onlypreamble\caption@declarefont
741 \newcommand*\caption@@declarefont[2]{%
742 \define@key{caption@fnt}{#1}[]{\caption@addto@fnt{#1}{#2}}%
743 \caption@@@declarefont{#1}{#2}}
744 \@onlypreamble\caption@@declarefont
745 \newcommand*\caption@@@declarefont[2]{}% will be used by \DeclareCaptionJustification
746 \@onlypreamble\caption@@@declarefont
747 \newcommand*\caption@addto@fnt[2]{%
748 \expandafter\let\expandafter\caption@package\csname caption@fnt@#1@package\endcsname
749 \caption@ifdefined\caption@package
750 {\caption@requirepackage\caption@package{#1}}% load package, if necessary
751 {}%
752 \l@addto@macro\caption@fnt{#2}}
753 \newcommand*\DeclareCaptionDefaultFont[2]{%
754 \global\@namedef{caption#1@default}{#2}}
755 \@onlypreamble\DeclareCaptionDefaultFont
756 \DeclareCaptionOption{font}{\caption@setfont{font}{#1}}
757 \DeclareCaptionOption{font+}{\caption@addtofont{font}{#1}}
758 \DeclareCaptionDefaultFont{font}{}
759 \DeclareCaptionOption{labelfont}{\caption@setfont{labelfont}{#1}}
760 \DeclareCaptionOption{labelfont+}{\caption@addtofont{labelfont}{#1}}
761 \DeclareCaptionDefaultFont{labelfont}{}
762 \DeclareCaptionOption{textfont}{\caption@setfont{textfont}{#1}}
763 \DeclareCaptionOption{textfont+}{\caption@addtofont{textfont}{#1}}
764 \DeclareCaptionDefaultFont{textfont}{}
765 \newcommand*\caption@setfont[1]{%
766 \expandafter\let\csname caption#1\endcsname\@empty
767 \caption@addtofont{#1}}
768 \newcommand*\caption@addtofont[2]{%
769 \begingroup
770 \expandafter\let\expandafter\caption@fnt\csname caption#1\endcsname
771 \define@key{caption@fnt}{default}[]{%
772 \l@addto@macro\caption@fnt{\csname caption#1@default\endcsname}}%
773 \caption@setkeys[caption]{caption@fnt}{#2}%
774 \global\let\caption@tempa\caption@fnt
775 \endgroup
776 \expandafter\let\csname caption#1\endcsname\caption@tempa}
777 \newcommand*\caption@font{%
778 \caption@teststar\caption@@font\@firstofone
779 {\caption@setkeys[caption]{caption@fnt}}}
780 \newcommand*\caption@@font[2]{%
781 \begingroup
782 \def\caption@fnt{\endgroup}%
783 #1{#2}%
784 \caption@fnt}
785 \DeclareCaptionFont{normalcolor}{\normalcolor}
786 \DeclareCaptionFont{color}{\color{#1}}
787 \DeclareCaptionFont{normalfont}{\normalfont}
788 \DeclareCaptionFont{up}{\upshape}
789 \DeclareCaptionFont{it}{\itshape}
790 \DeclareCaptionFont{sl}{\slshape}
791 \DeclareCaptionFont{sc}{\scshape}
792 \DeclareCaptionFont{md}{\mdseries}
793 \DeclareCaptionFont{bf}{\bfseries}
794 \DeclareCaptionFont{rm}{\rmfamily}
795 \DeclareCaptionFont{sf}{\sffamily}
796 \DeclareCaptionFont{tt}{\ttfamily}
797 \DeclareCaptionFont{tiny}{\tiny}
798 \DeclareCaptionFont{scriptsize}{\scriptsize}
799 \DeclareCaptionFont{footnotesize}{\footnotesize}
800 \DeclareCaptionFont{small}{\small}
801 \DeclareCaptionFont{normalsize}{\normalsize}
802 \DeclareCaptionFont{large}{\large}
803 \DeclareCaptionFont{Large}{\Large}
804 \DeclareCaptionFont{LARGE}{\LARGE}
805 \DeclareCaptionFont{huge}{\huge}
806 \DeclareCaptionFont{Huge}{\Huge}
807 \newcommand\caption@smaller{%
808 \ifx\@currsize\tiny
809 \relax
810 \else\ifx\@currsize\scriptsize
811 \tiny
812 \else\ifx\@currsize\footnotesize
813 \scriptsize
814 \else\ifx\@currsize\small
815 \footnotesize
816 \else\ifx\@currsize\normalsize
817 \small
818 \else\ifx\@currsize\large
819 \normalsize
820 \else\ifx\@currsize\Large
821 \large
822 \else\ifx\@currsize\LARGE
823 \Large
824 \else\ifx\@currsize\huge
825 \LARGE
826 \else\ifx\@currsize\Huge
827 \huge
828 \else
829 \caption@Warning{%
830 Cannot determine current font size.\MessageBreak
831 Try setting it with `size=' explicitly}%
832 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
833 \DeclareCaptionFont{smaller}{\caption@smaller}
834 \newcommand\caption@larger{%
835 \ifx\@currsize\tiny
836 \scriptsize
837 \else\ifx\@currsize\scriptsize
838 \footnotesize
839 \else\ifx\@currsize\footnotesize
840 \small
841 \else\ifx\@currsize\small
842 \normalsize
843 \else\ifx\@currsize\normalsize
844 \large
845 \else\ifx\@currsize\large
846 \Large
847 \else\ifx\@currsize\Large
848 \LARGE
849 \else\ifx\@currsize\LARGE
850 \huge
851 \else\ifx\@currsize\huge
852 \Huge
853 \else\ifx\@currsize\Huge
854 \relax
855 \else
856 \caption@Warning{%
857 Cannot determine current font size.\MessageBreak
858 Try setting it with `size=' explicitly}%
859 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
860 \DeclareCaptionFont{larger}{\caption@larger}
861 \DeclareCaptionFont{singlespacing}{}
862 \DeclareCaptionFont{normal}{%
863 \caption@font*{%
864 \KV@caption@fnt@normalcolor\@unused
865 \KV@caption@fnt@normalfont\@unused
866 \KV@caption@fnt@normalsize\@unused
867 \KV@caption@fnt@singlespacing\@unused}}
868 \DeclareCaptionOption{size}{\caption@setfont{size}{#1}}
869 \DeclareCaptionDefaultFont{size}{}
870 \newcommand*\DeclareCaptionJustification{%
871 \def\caption@@@declarefont##1##2{%
872 \global\@namedef{caption@hj@##1}{##2}% for compatibility to v1.0, needed by floatrow package
873 \let\caption@@@declarefont\@gobbletwo}%
874 \DeclareCaptionFont}
875 \@onlypreamble\DeclareCaptionJustification
876 \newcommand*\DeclareCaptionDefaultJustification[1]{%
877 \global\@namedef{caption@hj@default}{#1}% for compatibility to v1.0
878 \DeclareCaptionDefaultFont{@hj}{#1}}
879 \@onlypreamble\DeclareCaptionDefaultJustification
880 \DeclareCaptionOption{justification}{\caption@setjustification{#1}}
881 \DeclareCaptionDefaultJustification{}
882 \newcommand*\caption@setjustification{\caption@setfont{@hj}}
883 \DeclareCaptionJustification{justified}{}
884 \DeclareCaptionJustification{centering}{\centering}
885 \DeclareCaptionJustification{centerfirst}{\centerfirst}
886 \DeclareCaptionJustification{centerlast}{\centerlast}
887 \DeclareCaptionJustification{raggedleft}{\raggedleft}
888 \DeclareCaptionJustification{raggedright}{\raggedright}
889 \providecommand\centerfirst{%
890 \let\\\@centercr
891 \edef\caption@normaladjust{%
892 \leftskip\the\leftskip
893 \rightskip\the\rightskip
894 \parfillskip\the\parfillskip\relax}%
895 \leftskip\z@\@plus -1fil%
896 \rightskip\z@\@plus 1fil%
897 \parfillskip\z@skip
898 \noindent\hskip\z@\@plus 2fil%
899 \@setpar{\@@par\@restorepar\caption@normaladjust}}
900 \providecommand\centerlast{%
901 \let\\\@centercr
902 \leftskip\z@\@plus 1fil%
903 \rightskip\z@\@plus -1fil%
904 \parfillskip\z@\@plus 2fil\relax}
905 \caption@ifundefined\abovecaptionskip{%
906 \newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@}}{}
907 \caption@ifundefined\belowcaptionskip{%
908 \newlength\belowcaptionskip\setlength\belowcaptionskip{0\p@}}{}
909 \DeclareCaptionOption{aboveskip}{\setlength\abovecaptionskip{#1}}
910 \DeclareCaptionOption{belowskip}{\setlength\belowcaptionskip{#1}}
911 \DeclareCaptionOption{skip}{\setlength\abovecaptionskip{#1}}
912 \newcommand*\caption@rule{\caption@ifrule\caption@hrule\relax}
913 \newcommand*\caption@hrule{\hrule\@height\z@}
914 \DeclareCaptionOption{rule}[1]{\caption@set@bool\caption@ifrule{#1}}
915 \DeclareCaptionOption{position}{\caption@setposition{#1}}
916 \DeclareCaptionOption{figureposition}{%
917 \captionsetup*[figure]{position=#1}}
918 \@onlypreamble@key{caption}{figureposition}
919 \DeclareCaptionOption{tableposition}{%
920 \captionsetup*[table]{position=#1}}
921 \@onlypreamble@key{caption}{tableposition}
922 \newcommand*\caption@setposition[1]{%
923 \caption@ifinlist{#1}{d,default}{%
924 \let\caption@position\caption@defaultpos
925 }{\caption@ifinlist{#1}{t,top,above}{%
926 \let\caption@position\@firstoftwo
927 }{\caption@ifinlist{#1}{b,bottom,below}{%
928 \let\caption@position\@secondoftwo
929 }{\caption@ifinlist{#1}{a,auto}{%
930 \let\caption@position\@undefined
931 }{%
932 \caption@Error{Undefined position `#1'}%
933 }}}}}
934 \let\caption@defaultpos\@undefined
935 \newcommand*\caption@iftop{%
936 \ifx\caption@position\@undefined
937 \let\caption@position\@secondoftwo
938 \fi
939 \caption@position}
940 \newcommand*\caption@fixposition{%
941 \ifx\caption@position\@undefined
942 \caption@autoposition
943 \fi}
944 \newcommand*\caption@autoposition{%
945 \ifvmode
946 \edef\caption@tempa{\the\prevdepth}%
947 \caption@Debug{\protect\prevdepth=\caption@tempa}%
948 \ifdim\prevdepth>-\p@
949 \let\caption@position\@secondoftwo
950 \else
951 \let\caption@position\@firstoftwo
952 \fi
953 \else
954 \caption@Debug{no \protect\prevdepth}%
955 \let\caption@position\@secondoftwo
956 \fi}
957 \newcommand*\caption@setautoposition[1]{%
958 \def\caption@autoposition{\caption@setposition{#1}}}
959 \newcommand*\caption@beginhook{}
960 \newcommand*\caption@endhook{}
961 \newcommand*\AtBeginCaption{\l@addto@macro\caption@beginhook}
962 \newcommand*\AtEndCaption{\l@addto@macro\caption@endhook}
963 \DeclareCaptionOption{list}[1]{\caption@setlist{#1}}
964 \DeclareCaptionOption{listof}[1]{\caption@setlist{#1}}
965 \newcommand*\caption@setlist{\caption@set@bool\caption@iflist}
966 \DeclareCaptionOption{listtype}{\caption@setlisttype{#1}}
967 \DeclareCaptionOption{listtype+}{\caption@setlisttype@ext{#1}}
968 \newcommand*\caption@setlisttype{%
969 \caption@setlisttype@ext{}%
970 \caption@@setlisttype\caption@listtype}
971 \newcommand*\caption@@setlisttype[2]{%
972 \edef#1{#2}%
973 \ifx#1\@empty \let#1\@undefined \fi}
974 \newcommand*\caption@setlisttype@ext{%
975 \caption@@setlisttype\caption@listtype@ext}
976 \newcommand*\DeclareCaptionListFormat[2]{%
977 \global\@namedef{caption@lstfmt@#1}##1##2{#2}}
978 \@onlypreamble\DeclareCaptionListFormat
979 \DeclareCaptionOption{listformat}{\caption@setlistformat{#1}}
980 \newcommand*\caption@setlistformat[1]{%
981 \@ifundefined{caption@lstfmt@#1}%
982 {\caption@Error{Undefined list format `#1'}}%
983 {\expandafter\let\expandafter\caption@lstfmt
984 \csname caption@lstfmt@#1\endcsname}}
985 \DeclareCaptionListFormat{empty}{}
986 \DeclareCaptionListFormat{simple}{#1#2}
987 \DeclareCaptionListFormat{parens}{#1(#2)}
988 \DeclareCaptionListFormat{subsimple}{#2}
989 \DeclareCaptionListFormat{subparens}{(#2)}
990 \newcommand*\caption@setdefaultlistformat[1]{%
991 \ifx\caption@lstfmt\caption@lstfmt@default
992 \caption@set@default@listformat{#1}%
993 \caption@setlistformat{default}%
994 \else
995 \caption@set@default@listformat{#1}%
996 \fi}
997 \newcommand*\caption@set@default@listformat[1]{%
998 \def\caption@lstfmt@default{\@nameuse{caption@lstfmt@#1}}}
999 \caption@set@default@listformat{subsimple}
1000 \DeclareCaptionOption{debug}[1]{%
1001 \caption@set@bool\caption@ifdebug{#1}%
1002 \caption@ifdebug
1003 {\let\caption@Debug\caption@Info}%
1004 {\let\caption@Debug\@gobble}}
1005 \DeclareOption{debug}{\setkeys{caption}{debug}}
1006 \setkeys{caption}{debug=0}
1007 \caption@setbool{documentclass}{1}
1008 \caption@ifundefined\caption@documentclass{%
1009 \@ifclassloaded{beamer}{%
1010 \caption@InfoNoLine{beamer document class detected}%
1011 \def\caption@documentclass{beamer}%
1012 }{\@ifclassloaded{elsarticle}{%
1013 \caption@InfoNoLine{elsarticle document class detected}%
1014 \def\caption@documentclass{elsarticle}%
1015 }{\@ifclassloaded{memoir}{%
1016 \caption@InfoNoLine{memoir document class detected}%
1017 \def\caption@documentclass{memoir}%
1018 }{\caption@ifdefined\scr@caption{%
1019 \caption@InfoNoLine{KOMA-Script document class detected}%
1020 \def\caption@documentclass{koma}%
1021 }{\caption@ifdefined\@captionheadfont{%
1022 \caption@InfoNoLine{AMS or SMF document class detected}%
1023 \def\caption@documentclass{ams}%
1024 }{\caption@ifdefined\CaptionFonts{%
1025 \caption@InfoNoLine{NTG document class detected}%
1026 \def\caption@documentclass{ntg}%
1027 }{\caption@ifdefined\cph@font{%
1028 \caption@ifdefined\cpb@font\@firstoftwo\@secondoftwo
1029 }{%
1030 \@secondoftwo
1031 }{%
1032 \caption@InfoNoLine{thesis document class detected}%
1033 \def\caption@documentclass{thesis}%
1034 }{%
1035 % article|report|book [2005/09/16 v1.4f Standard LaTeX document class]
1036 \long\def\caption@tempa#1#2{%
1037 \vskip\abovecaptionskip
1038 \sbox\@tempboxa{#1: #2}%
1039 \ifdim \wd\@tempboxa >\hsize
1040 #1: #2\par
1041 \else
1042 \global \@minipagefalse
1043 \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
1044 \fi
1045 \vskip\belowcaptionskip}}
1046 \ifx\caption@tempa\@makecaption
1047 \caption@InfoNoLine{Standard document class detected}%
1048 \else
1049 \caption@InfoNoLine{%
1050 Unknown document class (or package),\MessageBreak
1051 standard defaults will be used}%
1052 \caption@InfoNoLine{\string\@makecaption\space=\space\meaning\@makecaption\@gobble}%
1053 \caption@setbool{documentclass}{0}%
1054 \fi
1055 \def\caption@documentclass{base}%
1056 }}}}}}%
1057 }{}
1058 \newcommand*\caption@ifclassloaded[1]{%
1059 \edef\caption@tempa{#1}%
1060 \ifx\caption@tempa\caption@documentclass
1061 \expandafter\@firstoftwo
1062 \else
1063 \expandafter\@secondoftwo
1064 \fi}
1065 \caption@ifclassloaded{elsarticle}{%
1066 \DeclareCaptionDefaultFont{font}{\footnotesize}
1067 }{}
1068 \caption@ifclassloaded{ams}{%
1069 \let\captionmargin\captionindent % set to 3pc by AMS class
1070 \begingroup\edef\@tempa{\endgroup
1071 \noexpand\caption@g@addto@list\noexpand\caption@sty@default
1072 {margin=\the\captionmargin
1073 \caption@ifdefined\smf@makecaption{,maxmargin=.1\linewidth}{}}}
1074 \@tempa
1075 \caption@g@addto@list\caption@sls@default{margin*=.5\captionmargin}
1076 \DeclareCaptionLabelSeparator{default}{.\enspace}
1077 \DeclareCaptionDefaultFont{font}{\@captionfont}
1078 \DeclareCaptionDefaultFont{labelfont}{\@captionheadfont}
1079 \DeclareCaptionDefaultFont{textfont}{\@captionfont\upshape}
1080 \captionsetup[figure]{position=b}
1081 \captionsetup[table]{position=t}
1082 }{}
1083 \caption@ifclassloaded{beamer}{%
1084 \newcommand*\caption@ifbeamertemplate[1]{%
1085 \begingroup
1086 \let\beamer@@tmpl@caption@ORI\beamer@@tmpl@caption
1087 \@nameuse{beamer@@tmpop@caption@#1}%
1088 \ifx\beamer@@tmpl@caption@ORI\beamer@@tmpl@caption
1089 \endgroup\expandafter\@firstoftwo
1090 \else
1091 \endgroup\expandafter\@secondoftwo
1092 \fi}
1093 \DeclareCaptionLabelFormat{default}{%
1094 \caption@ifbeamertemplate{numbered}%
1095 \caption@lfmt@simple
1096 \caption@lfmt@unnumbered
1097 {#1}{#2}}
1098 \DeclareCaptionLabelFormat{default@magyar}{%
1099 \caption@ifbeamertemplate{numbered}%
1100 \caption@lfmt@simple@magyar
1101 \caption@lfmt@unnumbered
1102 {#1}{#2}}
1103 \@ifundefined{@@magyar@captionfix}\AtBeginDocument\@firstofone{%
1104 \@ifundefined{@@magyar@captionfix}{}{%
1105 \g@addto@macro\@@magyar@captionfix{%
1106 \let\caption@lfmt@simple@magyar\caption@lfmt@simpleMagyar
1107 \let\caption@lfmt@simpleMagyar\caption@lfmt@default@magyar}}}
1108 \caption@declarelabelseparator
1109 {\caption@ifbeamertemplate{caption name own line}\@gobble\@firstofone}
1110 {default}
1111 {\caption@ifbeamertemplate{caption name own line}{\\}%
1112 {\usebeamertemplate{caption label separator}}}
1113 \DeclareCaptionDefaultFont{font}{%
1114 \usebeamerfont*{caption}%
1115 \usebeamercolor[fg]{caption}}
1116 \DeclareCaptionDefaultFont{labelfont}{%
1117 \setbeamercolor*{caption}{}% avoid setting "caption" color additionally
1118 \usebeamercolor[fg]{caption name}%
1119 \setbeamerfont*{caption}{}% avoid setting "caption" font additionally
1120 \usebeamerfont{caption name}}
1121 \DeclareCaptionDefaultJustification{\raggedright}
1122 \DeclareOption{beamerclass}{%
1123 \renewcommand\caption@ifslc{%
1124 \caption@ifbeamertemplate{caption name own line}\@secondoftwo\@firstoftwo}
1125 % Since the beamer class do not offer a `list of figures' we switch this support off.
1126 \captionsetup{list=0}}
1127 \PassOptionsToPackage{beamerclass}{caption3}
1128 \defbeamertemplate{caption}{caption3}{%
1129 \caption@make\insertcaptionname\insertcaptionnumber\insertcaption}
1130 \DeclareOption{beamer}{%
1131 % \usebeamertemplate**{caption} will set font
1132 \DeclareCaptionDefaultFont{font}{}%
1133 \setbeamertemplate{caption}[caption3]}
1134 }{}
1135 \caption@ifclassloaded{koma}{%
1136 \DeclareCaptionFormat{default}[#1#2#3\par]{%
1137 \ifdofullc@p
1138 \caption@ifin@list\caption@lsepcrlist\caption@lsepname
1139 {\caption@Error{%
1140 The option `labelsep=\caption@lsepname' does not work\MessageBreak
1141 with \noexpand\setcaphanging (which is set by default)}}%
1142 {\caption@fmt@hang{#1}{#2}{#3}}%
1143 \else
1144 #1#2%
1145 \ifdim\cap@indent<\z@
1146 \par
1147 \noindent\hspace*{-\cap@indent}%
1148 \else\if@capbreak
1149 \par
1150 \fi\fi
1151 #3\par
1152 \fi}
1153 \DeclareCaptionLabelSeparator{default}{\captionformat}
1154 \DeclareCaptionDefaultFont{font}{\scr@fnt@caption}
1155 \DeclareCaptionDefaultFont{labelfont}{\scr@fnt@captionlabel}
1156 \let\caption@KV@parindent\KV@caption@parindent
1157 \DeclareCaptionOption{parindent}[]{%
1158 \ifx,#1,%
1159 \caption@Debug{Option `parindent' ignored}%
1160 \else
1161 \caption@KV@parindent{#1}%
1162 \fi}%
1163 \let\caption@KV@parskip\KV@caption@parskip
1164 \DeclareCaptionOption{parskip}[]{%
1165 \ifx,#1,%
1166 \caption@Debug{Option `parskip' ignored}%
1167 \else
1168 \caption@KV@parskip{#1}%
1169 \fi}%
1170 }{}
1171 \caption@ifclassloaded{ntg}{%
1172 \DeclareCaptionDefaultFont{labelfont}{\CaptionLabelFont}
1173 \DeclareCaptionDefaultFont{textfont}{\CaptionTextFont}
1174 }{}
1175 \caption@ifclassloaded{thesis}{%
1176 \DeclareCaptionDefaultFormat{hang}
1177 \DeclareCaptionDefaultFont{labelfont}{\cph@font}
1178 \DeclareCaptionDefaultFont{textfont}{\cpb@font}
1179 }{}
1180 \caption@ifdefined\ArabiCoreLoaded{%
1181 \newcommand\caption@rl[1]{\if@rl\textRL{#1}\else\textLR{#1}\fi}
1182 \def\fnum@figure{\figurename\nobreakspace\thefigure}%
1183 \def\fnum@table{\tablename\nobreakspace\thetable}%
1184 \DeclareCaptionLabelSeparator{arabi}{ : }
1185 \DeclareCaptionLabelSeparator{default}{%
1186 \if@rl\caption@lsep@arabi\else\caption@lsep@colon\fi}
1187 }{%
1188 \let\caption@rl\@firstofone
1189 }
1190 \caption@ifdefined\FB@makecaption{%
1191 \ifx\@makecaption\STD@makecaption
1192 \DeclareCaptionLabelSeparator{default}{\CaptionSeparator}
1193 \def\caption@frenchb{% supress frenchb warning
1194 \let\STD@makecaption\@makecaption
1195 \let\FB@makecaption\@makecaption}
1196 \else
1197 \ifx\@makecaption\@undefined\else
1198 \caption@InfoNoLine{%
1199 The definition of \protect\@makecaption\space
1200 has been changed,\MessageBreak
1201 frenchb will NOT customize it}%
1202 \fi
1203 \fi
1204 }{}
1205 \caption@ifdefined\frenchTeXmods{%
1206 \DeclareCaptionDefaultFont{textfont}{\itshape}%
1207 \DeclareCaptionLabelSeparator{default}{\captionseparator\space}%
1208 }{}
1209 \DeclareCaptionListFormat{subperiod}{#2.}
1210 \def\caption@tempa#1{%
1211 \@ifpackagewith{babel}{#1}{%
1212 \caption@InfoNoLine{#1 babel option is loaded}%
1213 \expandafter\addto\csname extras#1\endcsname{%
1214 % change default labelsep and listformat
1215 \caption@setdefaultlabelsep{period}%
1216 \caption@setdefaultlistformat{subperiod}}%
1217 \expandafter\addto\csname noextras#1\endcsname{%
1218 % change default labelsep and listformat
1219 \caption@setdefaultlabelsep{colon}%
1220 \caption@setdefaultlistformat{subsimple}}%
1221 }{}}
1222 \caption@tempa{hungarian}
1223 \caption@tempa{magyar}
1224 \newcommand*\caption@xpackage[2]{%
1225 \expandafter\ifx\csname ver@#2.\caption@pkgextension\endcsname\relax
1226 \expandafter\@firstofone
1227 \else
1228 \expandafter\@gobbletwo
1229 \fi
1230 {#1{#2}}}
1231 \let\caption@pkgextension\@pkgextension
1232 \newcommand*\caption@loadpackage{%
1233 \caption@xpackage\caption@@loadpackage}
1234 \newcommand*\caption@@loadpackage[2]{%
1235 \caption@Info{Option `#2' requires the `#1' package}%
1236 \RequirePackage{#1}\relax}
1237 \newcommand*\caption@requirepackage{%
1238 \caption@xpackage\caption@@requirepackage}
1239 \newcommand*\caption@@requirepackage[2]{%
1240 \@cons\caption@packagelist{{#1}{#2}}}% load package later on
1241 \newcommand*\caption@pkg@list{}
1242 \newcommand*\caption@packagelist{}
1243 \@onlypreamble\caption@packagelist
1244 \caption@AtBeginDocument{%
1245 \def\caption@tempa{\endgroup}%
1246 \begingroup
1247 \def\@elt#1#2{%
1248 \g@addto@macro\caption@tempa{%
1249 \caption@loadpackage{#1}{#2}}}%
1250 \caption@packagelist
1251 \caption@tempa
1252 \renewcommand*\caption@@loadpackage[2]{%
1253 \caption@Error{Option `#2' requires the `#1' package}}%
1254 \let\caption@@requirepackage\caption@@loadpackage
1255 }
1256 \newcommand*\caption@usepackage[3]{%
1257 \IfCaptionOptionCheck
1258 {\caption@requirepackage{#1}{#2}}%
1259 {\let\KV@prefix@ORI\KV@prefix
1260 \let\@tempc@ORI\@tempc
1261 \caption@loadpackage{#1}{#2}%
1262 #3%
1263 \let\@tempc\@tempc@ORI
1264 \let\KV@prefix\KV@prefix@ORI}}
1265 \newcommand*\caption@newfloat{\caption@usepackage{newfloat}}
1266 \DeclareCaptionOption{figurename}{\caption@SetName{figure}{#1}}
1267 \@onlypreamble@key{caption}{figurename}
1268 \DeclareCaptionOption{tablename}{\caption@SetName{table}{#1}}
1269 \@onlypreamble@key{caption}{tablename}
1270 \DeclareCaptionOption{listfigurename}{\caption@SetName{listfigure}{#1}}
1271 \@onlypreamble@key{caption}{listfigurename}
1272 \DeclareCaptionOption{listtablename}{\caption@SetName{listtable}{#1}}
1273 \@onlypreamble@key{caption}{listtablename}
1274 \newcommand*\caption@SetName[2]{%
1275 \caption@newfloat{#1name}{\newfloat@setname{#1}{#2}}}
1276 \@onlypreamble\caption@SetName
1277 \DeclareCaptionOption{name}{%
1278 \IfCaptionOptionCheck{}{\caption@setname\@captype{#1}}}
1279 \newcommand*\caption@setname[2]{%
1280 \@namedef{#1name}{#2}}
1281 \DeclareCaptionOption{figurewithin}{\caption@within{figure}{#1}}
1282 \DeclareCaptionOptionNoValue{figurewithout}{\caption@within{figure}{none}}
1283 \DeclareCaptionOption{tablewithin}{\caption@within{table}{#1}}
1284 \DeclareCaptionOptionNoValue{tablewithout}{\caption@within{table}{none}}
1285 \newcommand*\caption@within[2]{%
1286 \caption@newfloat{#1within}{\newfloat@setwithin{#1}{#2}}}
1287 \DeclareCaptionOption{within}{%
1288 \caption@newfloat{within}{\newfloatsetup{within=#1}}}
1289 \DeclareCaptionOptionNoValue{without}{%
1290 \caption@newfloat{without}{\newfloatsetup{without}}}
1291 \DeclareCaptionJustification[ragged2e]{Justified}{\justifying}
1292 \DeclareCaptionJustification[ragged2e]{Centering}{\Centering}
1293 \DeclareCaptionJustification[ragged2e]{RaggedLeft}{\RaggedLeft}
1294 \DeclareCaptionJustification[ragged2e]{RaggedRight}{\RaggedRight}
1295 \DeclareCaptionFont[sansmath]{sansmath}{\sansmath}
1296 \DeclareCaptionFont{singlespacing}{%
1297 \caption@ifdefined\setspace@singlespace{%
1298 \setstretch\setspace@singlespace}{}}% normally 1
1299 \DeclareCaptionFont[setspace]{onehalfspacing}{\onehalfspacing}
1300 \DeclareCaptionFont[setspace]{doublespacing}{\doublespacing}
1301 \DeclareCaptionFont[setspace]{stretch}{\setstretch{#1}}
1302 \caption@AtBeginDocument{%
1303 \def\@tempa{2005/06/28 ver: 1.3 subfig package}%
1304 \expandafter\ifx\csname [email protected]\endcsname\@tempa
1305 \caption@InfoNoLine{subfig package v1.3 is loaded}%
1306 \let\caption@setfloattype\@gobble
1307 \let\@dottedxxxline\sf@NEW@dottedxxxline
1308 \let\sf@subfloat\sf@NEW@subfloat
1309 \fi
1310 \let\sf@NEW@dottedxxxline\@undefined
1311 \let\sf@NEW@subfloat\@undefined}
1312 \def\sf@NEW@dottedxxxline#1#2#3#4#5#6#7{%
1313 \begingroup
1314 \caption@setfloattype{#1}%
1315 \caption@setoptions{subfloat}%
1316 \caption@setoptions{sub#1}%
1317 \ifnum #3>\@nameuse{c@#2depth}\else
1318 \@dottedtocline{\z@}{#4}{#5}{#6}{#7}%
1319 \fi
1320 \endgroup}
1321 \def\sf@NEW@subfloat{%
1322 \begingroup
1323 \@nameuse{caption@warmup}%
1324 \caption@setfloattype\@captype
1325 \sf@ifpositiontop{%
1326 \maincaptiontoptrue
1327 }{%
1328 \maincaptiontopfalse
1329 }%
1330 \caption@setoptions{subfloat}%
1331 \caption@setoptions{sub\@captype}%
1332 \let\sf@oldlabel=\label
1333 \let\label=\subfloat@label
1334 \ifmaincaptiontop\else
1335 \advance\@nameuse{c@\@captype}\@ne
1336 \fi
1337 \refstepcounter{sub\@captype}%
1338 \setcounter{sub\@captype @save}{\value{sub\@captype}}%
1339 \@ifnextchar [% %] match left bracket
1340 {\sf@@subfloat}%
1341 {\sf@@subfloat[\@empty]}}
1342 %%\@ifl@aded{dtx}{subfig}{\caption@loadpackage{ragged2e}{}}{} % not needed
1343 \DeclareCaptionOption{lofdepth}[2]{\caption@ifdefined\c@lofdepth{\setcounter{lofdepth}{#1}}{}}
1344 \DeclareCaptionOption{lotdepth}[2]{\caption@ifdefined\c@lotdepth{\setcounter{lotdepth}{#1}}{}}
1345 \captionsetup{style=default,position=default,%
1346 list,listformat=default,twoside=\if@twoside 1\else 0\fi}
1347 \ProcessOptions*
1348 \newcommand\caption@addcontentsline[2]{%
1349 \caption@ifcontentsline{#2}{%
1350 \begingroup
1351 \let\@tempa\@gobble
1352 \caption@ifdefined\caption@listtype
1353 {\let\@tempa\@firstofone}%
1354 {\edef\caption@listtype{#1}}%
1355 \caption@ifdefined\caption@listtype@ext
1356 {\edef\caption@listtype{\caption@listtype\caption@listtype@ext}%
1357 \let\@tempa\@firstofone}%
1358 {}%
1359 \@tempa
1360 {\caption@Debug{addcontentsline: #1 => \caption@listtype}%
1361 \@namedef{the\caption@listtype}{\@nameuse{the#1}}}%
1362 \expandafter\caption@@addcontentsline\expandafter{\caption@listtype}{#2}%
1363 \endgroup}%
1364 \caption@addsubcontentslines{#1}}
1365 \newcommand\caption@@addcontentsline[2]{%
1366 {\let\\\space
1367 \@ifundefined{ext@#1}%
1368 {\caption@Error{No float type '#1' defined}}%
1369 {\def\captionlisttype{#1}%
1370 \caption@add@contentsline
1371 {\csname ext@#1\endcsname}%
1372 {#1}%
1373 {\caption@lstfmt{\@nameuse{p@#1}}{\@nameuse{the#1}}}%
1374 {\ignorespaces #2}%
1375 \caption@chkfloat{#1}{#2}}}}
1376 \newcommand*\caption@add@contentsline{%
1377 \caption@@@addcontentsline}
1378 \newcommand*\caption@@@addcontentsline[4]{%
1379 \addcontentsline{#1}{#2}{\protect\numberline{#3}{#4}}}
1380 \let\caption@chkfloat\@gobbletwo
1381 \newcommand\caption@ifcontentsline[1]{%
1382 \caption@iflist
1383 {\def\@tempa{#1}}%
1384 {\let\@tempa\@empty}%
1385 \ifx\@tempa\@empty
1386 \expandafter\@gobble
1387 \else
1388 \expandafter\@firstofone
1389 \fi}
1390 \newcommand*\caption@addsubcontentslines[1]{}
1391 \newif\ifcaption@star
1392 \newcommand*\caption@fnum[1]{\caption@lfmt{\@nameuse{#1name}}{\@nameuse{the#1}}}
1393 \newcommand\caption@make[2]{\caption@@make{\caption@lfmt{#1}{#2}}}
1394 \newcommand\caption@@make[2]{%
1395 \begingroup
1396 \caption@@make@{#1}{#2}%
1397 \endgroup
1398 \caption@@make@epilogue}
1399 \newcommand\caption@@make@[2]{%
1400 \caption@stepthecounter
1401 \caption@beginhook
1402 \caption@box\hsize{%
1403 \caption@ifslc{\caption@slc{#1}{#2}\caption@singleline\relax}{}%
1404 \caption@calcmargin
1405 \caption@tempdima\captionmargin
1406 \ifdim\captionmargin@=\z@ \else
1407 \caption@ifoddpage{}{\advance\caption@tempdima\captionmargin@}%
1408 \fi
1409 \caption@ifh{\advance\caption@tempdima\caption@indent}%
1410 \hspace\caption@tempdima
1411 \caption@tempdima\captionwidth
1412 \caption@ifh{\advance\caption@tempdima-\caption@indent}%
1413 \caption@parbox\caption@tempdima{%
1414 \caption@ifh{%
1415 \ifdim\caption@indent=\z@
1416 \leavevmode
1417 \else
1418 \hskip-\caption@indent
1419 \fi}%
1420 \caption@@@make{#1}{#2}}%
1421 \caption@tempdima\captionmargin
1422 \ifdim\captionmargin@=\z@ \else
1423 \caption@ifoddpage{\advance\caption@tempdima\captionmargin@}{}%
1424 \fi
1425 \hspace\caption@tempdima
1426 }%
1427 \caption@endhook}
1428 \newcommand\caption@@make@epilogue{%
1429 \global\caption@starfalse}
1430 \newcommand*\caption@calcmargin{%
1431 \caption@calcmargin@hook
1432 \ifx\caption@maxmargin\@undefined \else
1433 \ifdim\captionmargin>\caption@maxmargin\relax
1434 \captionmargin\caption@maxmargin\relax
1435 \fi
1436 \fi
1437 \ifx\caption@minmargin\@undefined \else
1438 \ifdim\captionmargin<\caption@minmargin\relax
1439 \captionmargin\caption@minmargin\relax
1440 \fi
1441 \fi
1442 \ifdim\captionwidth=\z@
1443 \captionwidth\hsize
1444 \advance\captionwidth by -2\captionmargin
1445 \advance\captionwidth by -\captionmargin@
1446 \else
1447 \captionmargin\hsize
1448 \advance\captionmargin by -\captionwidth
1449 \divide\captionmargin by 2
1450 \captionmargin@\z@
1451 \fi
1452 \caption@Debug{%
1453 \string\hsize=\the\hsize,
1454 \string\captionwidth=\the\captionwidth,\MessageBreak
1455 \string\captionmargin=\the\captionmargin,
1456 \string\captionmargin@=\the\captionmargin@}%
1457 }
1458 \newcommand\caption@slc[4]{%
1459 \caption@Debug{Begin SLC}%
1460 \singlelinecaptiontrue
1461 \begingroup
1462 \caption@singleline
1463 \let\caption@hj\@empty
1464 \caption@calcmargin % calculate \captionwidth
1465 \caption@prepareslc
1466 \sbox\@tempboxa{\caption@@@make{#1}{#2}}%
1467 \ifdim\wd\@tempboxa>\captionwidth
1468 \endgroup
1469 \singlelinecaptionfalse
1470 #4%
1471 \else
1472 \endgroup
1473 #3%
1474 \fi
1475 \caption@Debug{End SLC}}
1476 \newif\ifsinglelinecaption
1477 \newcommand*\caption@singleline{%
1478 \caption@xsetup\caption@opt@singleline
1479 \let\caption@fmt\caption@slfmt}
1480 \providecommand*\caption@prepareslc{}
1481 \g@addto@macro\caption@prepareslc{%
1482 \let\label\caption@gobble
1483 \let\hypertarget\@gobbletwo
1484 \let\caption@footnote@ORI\footnote
1485 \def\footnote{\caption@withoptargs\caption@footnote}%
1486 \let\caption@footnotemark@ORI\footnotemark
1487 \def\footnotemark{\caption@withoptargs\caption@footnotemark}%
1488 \let\caption@footnotetext@ORI\@footnotetext
1489 \let\@footnotetext\caption@gobble
1490 \let\caption@endnote@ORI\endnote
1491 \def\endnote{\caption@withoptargs\caption@endnote}%
1492 \let\caption@endnotemark@ORI\endnotemark
1493 \def\endnotemark{\caption@withoptargs\caption@endnotemark}%
1494 \let\caption@endnotetext@ORI\@endnotetext
1495 \let\@endnotetext\caption@gobble
1496 \let\pagenote\caption@gobble
1497 \let\acused\@gobble
1498 \let\AC@placelabel\@gobble
1499 \let\glsunset\@gobble
1500 }
1501 \newcommand\caption@footnote[2]{%
1502 \caption@footnotemark{#1}}
1503 \newcommand\caption@footnotemark[1]{%
1504 \begingroup
1505 \let\stepcounter\caption@l@stepcounter
1506 \caption@footnotemark@ORI#1\relax
1507 \endgroup}
1508 \newcommand\caption@endnote[2]{%
1509 \caption@endnotemark{#1}}
1510 \newcommand\caption@endnotemark[1]{%
1511 \begingroup
1512 \let\stepcounter\caption@l@stepcounter
1513 \caption@endnotemark@ORI#1\relax
1514 \endgroup}
1515 \newcommand*\caption@l@stepcounter[1]{%
1516 \advance\csname c@#1\endcsname\@ne\relax}
1517 \caption@ifclassloaded{beamer}{%
1518 \g@addto@macro\caption@prepareslc{%
1519 \def\footnote{%
1520 \begingroup
1521 \let\stepcounter\caption@l@stepcounter
1522 \renewcommand<>\beamer@framefootnotetext[1]{%
1523 \endgroup}%
1524 \let\@footnotetext\beamer@framefootnotetext
1525 \caption@footnote@ORI}}}{}
1526 \newcommand*\caption@applyfont{%
1527 \caption@hj\captionfont\captionsize}
1528 \newcommand\caption@@@make[2]{%
1529 \sbox\@tempboxa{#1}%
1530 \ifdim\wd\@tempboxa=\z@
1531 \let\caption@lsep\relax
1532 \fi
1533 \caption@ifempty{#2}{%
1534 \let\caption@lsep\@empty
1535 \let\caption@tfmt\@firstofone
1536 }%
1537 \@setpar{\@@par\caption@@par}\caption@@par
1538 \caption@applyfont
1539 \caption@fmt
1540 {\ifcaption@star\else
1541 \begingroup
1542 \captionlabelfont
1543 #1%
1544 \endgroup
1545 \fi}%
1546 {\ifcaption@star\else
1547 \begingroup
1548 \caption@iflf\captionlabelfont
1549 \relax\caption@lsep
1550 \endgroup
1551 \fi}%
1552 {{\captiontextfont
1553 \captiontextstart
1554 \caption@ifstrut
1555 {\vrule\@height\ht\strutbox\@width\z@}%
1556 {}%
1557 \nobreak\hskip\z@skip % enable hyphenation
1558 \caption@tfmt{#2}%
1559 \caption@ifstrut
1560 {\ifhmode\@finalstrut\strutbox\fi}%
1561 {}%
1562 \captiontextend}}}
1563 \newcommand*\captiontextstart{}
1564 \newcommand*\captiontextend{\par}
1565 \newcommand\caption@ifempty[1]{%
1566 \caption@if@empty{#1}%
1567 \caption@ifempty\@unused}
1568 \newcommand\caption@if@empty[1]{%
1569 \def\caption@tempa{#1}%
1570 \ifx\caption@tempa\@empty
1571 \let\caption@ifempty\@secondoftwo
1572 \else
1573 \expandafter\def\expandafter\caption@tempa\expandafter{%
1574 \caption@car#1\caption@if@empty\caption@nil}%
1575 \def\caption@tempb{\caption@if@empty}%
1576 \ifx\caption@tempa\caption@tempb
1577 \let\caption@ifempty\@secondoftwo
1578 \else
1579 \def\caption@tempb{\ignorespaces}%
1580 \ifx\caption@tempa\caption@tempb
1581 \expandafter\caption@if@empty\expandafter{\@gobble#1}%
1582 \else
1583 \def\caption@tempb{\label}%
1584 \ifx\caption@tempa\caption@tempb
1585 \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
1586 \else
1587 \def\caption@tempb{\index}%
1588 \ifx\caption@tempa\caption@tempb
1589 \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
1590 \else
1591 \def\caption@tempb{\glossary}%
1592 \ifx\caption@tempa\caption@tempb
1593 \expandafter\caption@if@empty\expandafter{\@gobbletwo#1}%
1594 \else
1595 \let\caption@ifempty\@gobbletwo
1596 \fi
1597 \fi
1598 \fi
1599 \fi
1600 \fi
1601 \fi}
1602 \long\def\caption@car#1#2\caption@nil{#1}% same as \@car, but \long
1603 \newcommand*\caption@@par{%
1604 \parindent\caption@parindent\hangindent\caption@hangindent}%
1605 \newcommand*\DeclareCaptionType{%
1606 \caption@loadpackage{newfloat}{}%
1607 \DeclareFloatingEnvironment}
1608 \@onlypreamble\DeclareCaptionType
1609 \newcommand*\ForEachCaptionType{%
1610 \@ifstar
1611 {\caption@foreach@type\@gobble}%
1612 {\caption@foreach@type\@iden}}
1613 \newcommand\caption@foreach@type[2]{%
1614 \caption@ifdefined\ForEachFloatingEnvironment
1615 {\ForEachFloatingEnvironment*{#2}}%
1616 {\def\@elt##1{#2}%
1617 \caption@ifdefined\c@figure\@elt\@gobble{figure}%
1618 \caption@ifdefined\c@table\@elt\@gobble{table}%
1619 \let\@elt\relax}%
1620 #1{\newfloat@addtohook{#2}}}
1621 \providecommand\newfloat@addtohook[1]{%
1622 \toks@=\expandafter{\newfloat@hook{##1}#1}%
1623 \edef\@tempa{\def\noexpand\newfloat@hook####1{\the\toks@}}%
1624 \@tempa}
1625 \providecommand*\newfloat@hook[1]{}
1626 \newcommand*\DeclareCaptionSubType{%
1627 \caption@teststar\caption@declaresubtype\@firstoftwo\@secondoftwo}
1628 \@onlypreamble\DeclareCaptionSubType
1629 \newcommand*\caption@declaresubtype[1]{%
1630 \@testopt{\caption@@declaresubtype{#1}}{alph}}
1631 \@onlypreamble\caption@declaresubtype
1632 \def\caption@@declaresubtype#1[#2]#3{%
1633 \@ifundefined{c@#3}%
1634 {\caption@Error{No float type '#3' defined}}%
1635 {\caption@@@declaresubtype{#1}{#2}{#3}{sub#3}}}
1636 \@onlypreamble\caption@@declaresubtype
1637 \newcommand*\caption@@@declaresubtype[4]{%
1638 \caption@ifin@list\caption@subtypelist{#4}%
1639 {\caption@Debug{Modify subtype `#4'}}%
1640 {\caption@Debug{New subtype `#4'}%
1641 \newcounter{#4}[#3]%
1642 \@namedef{ext@#4}{\csname ext@#3\endcsname}%
1643 \caption@declaresublistentry{#3}%
1644 \caption@l@addto@list\caption@subtypelist{#4}%
1645 \caption@subtype@hook{#4}%
1646 \caption@ifdefined\contentsuse{%
1647 \contentsuse{#4}{\csname ext@#4\endcsname}}{}%
1648 \@namedef{#4name}{}%
1649 \@namedef{#4autorefname}{\csname #3autorefname\endcsname}}%
1650 #1% is \@firstoftwo in star form, and \@secondoftwo otherwise
1651 {\@namedef{p@#4}{}%
1652 \@namedef{the#4}{\csname the#3\endcsname.\@nameuse{#2}{#4}}}%
1653 {\@namedef{p@#4}{\csname the#3\endcsname}%
1654 \@namedef{the#4}{\@nameuse{#2}{#4}}}%
1655 \@namedef{theH#4}{\csname theH#3\endcsname.\arabic{#4}}}
1656 \@onlypreamble\caption@@@declaresubtype
1657 \newcommand*\caption@declaresublistentry{%
1658 \caption@ifdefined\l@chapter
1659 {\caption@@declaresublistentry\l@subsection}%
1660 {\caption@@declaresublistentry\l@subsubsection}}
1661 \@onlypreamble\caption@declaresublistentry
1662 \newcommand*\caption@@declaresublistentry[2]{%
1663 \ifx#1\@undefined
1664 \caption@@@declaresublistentry\relax\@dottedtocline\caption@nil{#2}%
1665 \else
1666 \expandafter\caption@@@declaresublistentry#1{}{}\@dottedtocline\caption@nil{#2}%
1667 \fi}
1668 \@onlypreamble\caption@@declaresublistentry
1669 \long\def\caption@@@declaresublistentry#1\@dottedtocline#2\caption@nil#3{%
1670 \def\@tempa{#1}%
1671 \ifx\@tempa\@empty
1672 \caption@@@@declaresublistentry{#3}#2\caption@nil
1673 \else
1674 \caption@@@@declaresublistentry{#3}@{3.8em}{3.2em}\caption@nil
1675 \fi}
1676 \@onlypreamble\caption@@@declaresublistentry
1677 \def\caption@@@@declaresublistentry#1#2#3#4#5\caption@nil{%
1678 \expandafter\caption@@@@@declaresublistentry\expandafter
1679 {\csname @dotted\csname ext@#1\endcsname line\endcsname}{#1}{#3}{#4}}
1680 \@onlypreamble\caption@@@@declaresublistentry
1681 \newcommand*\caption@@@@@declaresublistentry[4]{%
1682 \@namedef{l@sub#2}{#1{2}{#3}{#4}}%
1683 \expandafter\caption@@@@@@declaresublistentry
1684 \expandafter#1\expandafter{\csname ext@#2\endcsname depth}}
1685 \@onlypreamble\caption@@@@@declaresublistentry
1686 \newcommand*\caption@@@@@@declaresublistentry[2]{
1687 \ifx#1\relax
1688 \def#1##1{%
1689 \def\next{\@dottedtocline{##1}}%
1690 \@ifundefined{c@#2}{}{%
1691 \ifnum ##1>\@nameuse{c@#2}\relax
1692 \let\next\@gobblefour
1693 \else
1694 \c@tocdepth=\@nameuse{c@#2}\relax
1695 \fi}%
1696 \next}%
1697 \fi}
1698 \@onlypreamble\caption@@@@@@declaresublistentry
1699 \newcommand*\caption@subtypelist{}
1700 \newcommand*\caption@ifsubtype{%
1701 \caption@ifin@list\caption@subtypelist}
1702 \newcommand*\ForEachCaptionSubType{%
1703 \@ifstar
1704 {\caption@foreach@subtype\@gobble}%
1705 {\caption@foreach@subtype\@iden}}
1706 \newcommand\caption@foreach@subtype[2]{%
1707 \caption@for@list\caption@subtypelist{#2}%
1708 #1{\caption@addto@subtype@hook{#2}}}
1709 \providecommand\caption@addto@subtype@hook[1]{%
1710 \toks@=\expandafter{\caption@subtype@hook{##1}#1}%
1711 \edef\@tempa{\def\noexpand\caption@subtype@hook####1{\the\toks@}}%
1712 \@tempa}
1713 \providecommand*\caption@subtype@hook[1]{}
1714 \newcommand*\caption@savesubcounters{%
1715 \caption@for@list\caption@subtypelist{\caption@savecounter{##1}}}
1716 \newcommand*\caption@savecounter[1]{%
1717 \edef\caption@tempa{%
1718 \noexpand\l@addto@macro\noexpand\caption@restore@counters
1719 {\noexpand\setcounter{#1}{\number\value{#1}}}}%
1720 \caption@tempa}
1721 \newcommand*\caption@restorecounters{%
1722 \caption@restore@counters
1723 \global\let\caption@restore@counters\@empty}
1724 \newcommand*\caption@restore@counters{}
1725 \endinput
1726 %%
1727 %% End of file `caption3_2020-07-29.sty'.