Debian Codegraph @

texmf-dist/tex/latex/caption/caption3_2011-11-01.sty

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