Debian Codegraph @

texmf-dist/tex/latex/caption/caption3_2019-09-01.sty

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