summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/caption/fallback/v2.0/caption2.dtx
blob: 339aa29a8fd30b160ddd68f7dad3acc2ce7b2384 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
% \iffalse
% caption.dtx - The caption package
% (c) 1994-95 Axel Sommerfeldt (axel@hp1.ang-physik.uni-kiel.de)
%
%<*driver>
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\documentclass{ltxdoc}
\newlength\artparindent
\setlength\artparindent{\parindent}
\setlength\parindent{0pt}
\setlength\parskip{\smallskipamount}
\usepackage{caption2}[1995/10/09]
\IfFileExists{ltxdoc.cfg}{}{\OnlyDescription\RecordChanges\CodelineIndex}
\begin{document}
  \DocInput{caption2.dtx}
  \IfFileExists{ltxdoc.cfg}{}{\PrintChanges\PrintIndex}
\end{document}
%</driver>
% \fi
%
% \providecommand{\LaTeXcomp}{The \LaTeX{} Companion}
% \newcommand{\purerm}[1]{{\upshape\mdseries\rmfamily #1}}
% \newcommand{\puresf}[1]{{\upshape\mdseries\sffamily #1}}
% \newenvironment{Options}[1]%
%  {\begin{list}{}{\renewcommand{\makelabel}[1]{\texttt{##1}\hfil}%
%     \settowidth{\labelwidth}{\texttt{#1\space}}%
%     \setlength{\leftmargin}{\labelwidth}%
%     \addtolength{\leftmargin}{\labelsep}}}%
%  {\end{list}}
%
% \def\packageversion{2.0(BETA)}
% \def\packagedate{1995/10/09}
% \changes{v1.0}{27 Oct 94}{First release}
% \changes{v1.2}{28 Nov 94}{Works now with the {\tt figure*} and {\tt table*}
%                           environments, too}
% \changes{v2.0}{ 9 Oct 95}{Totally rewritten; many new commands and features}
%
% \title{The \puresf{caption} package\thanks{This package has version number
%        \packageversion, last revised \packagedate.}}
% \author{Axel Sommerfeldt\\
%         {\small axel@hp1.ang-physik.uni-kiel.de}}
% \date{1995/10/09}
% \maketitle
%
% \begin{abstract}
% The \textsf{caption} package provides many ways to customise the captions
% in floating environments such |figure|, |table|, |sidewaysfigure|, and
% |sidewaystable|.
% The following \LaTeXe\ packages are supported:
% float, longtable, and subfigure.
% But it works fine with the following packages as well:
% floatfig, rotating, supertabular, and wrapfig.
% \end{abstract}
%
% \section{Documentation? What documentation?}
% I'm sorry to say this, but there is no documentation provided with the
% new version of this package, yet. And it's still beta. I hope I can
% eleminate both circumstances in the near future; at the moment my spare time
% is very very very limited, so I decided to make this beta public.
%
% This new version is nearly compatible with the lastest official release
% (version 1.4b), so you can use the old documentation so far.
% Here is what differs this version from version 1.4b:
%
% \begin{itemize}
% \item
%   If the caption package will detect a loaded float package, it will
%   \emph{not} redefine the boxed style of floats anymore. If you want to
%   have the old behaviour, you have to specify the new option |boxed| to
%   the caption2 package.
% \item
%   Anything said about the subfigure package in the old doc isn't
%   true anymore; the caption package is now adapted to the new version
%   2.0 of this package. Especially the caption package will \emph{not}
%   redefine |\@thesubfigure| and |\@thesubtable| anymore and it will
%   \emph{not} set |\subcapsize| -- you have to do this now for yourself
%   if you want to, e.g.\ with the following code:
%   \begin{quote}
%       |\usepackage[normalsize]{subfigure}|\\
%       |\usepackage[large]{caption}|
%   \end{quote}
%
%   So you can load the caption2 package \emph{before} loading the subfigure
%   package now without problems, in fact this is recommend now. Don't care
%   about what the old doc or the doc of the subfigure package is telling you!
% \end{itemize}
%
% As a summary, the new caption package won't lead into different results
% of your documents just because of loading it (without options).
%
% If you are really interested in the (many!) new features of this totally
% rewritten package, take a look in the provided test document (test2.tex)
% to get a idea of the new commands and possibilities.
% And feel yourself free to write a email to me, if any questions occur.
%
% \subsection{Just a few notes\dots}
% If you use the new command |\setcaptionwidth| to set the absolut width of a
% caption, you are not allowed to change |\captionmargin| anymore!
% Instead, use the new command |\setcaptionmargin| to do this.
%
% Longtables will still take care of |\LTcapwidth|, even if you are setting
% your own width via |\setcaptionwidth| or |\setcaptionmargin|. To get rid
% of this, use the following code just after loading the caption2 package:
% \begin{quote}
%   |\dummycaptionstyle{longtable}{}|
% \end{quote}
% or just specify the new package option |longtable|.
%
% This package was developed and tested with following versions of the
% other packages:
% \begin{quote}\begin{tabular}{lll}
%   package   & version & date \\\hline
%   float     & 1.2c    & 1995/03/29 \\
%   longtable & 3.15    & 1995/06/15 \\
%   rotating  & 2.9     & 1995/04/07 \\
%   subfigure & 2.0     & 1995/03/06 \\
% \end{tabular}\end{quote}
%
% Maybe it will work with older versions, maybe not\dots
%
% BTW:
% If you are interested in rotated versions (like |sidewaysfigure| or
% |sidewaystable|) of new floats (defined with the float package), take a look
% at the rotfloat package, which comes from a very talented young man with a
% very german style of writing english docs (if he ever writes any!) and a
% very big mouth - myself |:-)|
%
% \section{Thanks}
% I would like to thank David Carlisle for his help writing the longtable
% support; without the changes in his package this wouldn't become possible.
%
% \changes{v1.1}{ 3 Nov 94}{New captiontype: {\tt centerlast}}
% \changes{v1.4}{30 Jan 95}{New option: {\tt nooneline}}
% \changes{v1.4}{29 Jan 95}{{\tt\protect\bslash captionsize} changed to
%                           {\tt\protect\bslash captionfont}}
% \changes{v1.2}{28 Nov 94}{Support of the {\sf float} package}
% \changes{v1.3}{ 8 Jan 95}{Support of {\tt\protect\bslash captionlabelfont} in
%                           subcaptions}
% \changes{v1.4b}{5 Apr 95}{Adapted to version 2.8 of the rotating package}
% \changes{v2.0}{ 9 Oct 95}{support of the longtable package}
%
% \StopEventually{
%   \begin{thebibliography}{9}
%   \bibitem{float}
%   Anselm Lingnau:
%   \textsl{An Improved Environment for Floats},
%   1995/03/25
%   \bibitem{rotating}
%   Sebastian Rahtz and Leonor Barroca:
%   \textsl{A style option for rotated objects in \LaTeX},
%   1994/10/02
%   \bibitem{rotfloat}
%   Axel Sommerfeldt:
%   \textsl{The rotfloat package},
%   1995/03/30
%   \bibitem{subfigure}
%   Steven Douglas Cochran:
%   \textsl{The subfigure package},
%   1995/03/06
%   \bibitem{A-W:GMS94}
%   Michel Goossens, Frank Mittelbach and Alexander Samarin:
%   \newblock \textsl{The {\LaTeX} Companion},
%   \newblock Addison-Wesley, Reading, Massachusetts, 1994.
%   \bibitem{Anne}
%   Anne Br\"uggemann-Klein:
%   \textsl{Einf\"uhrung in die Dokumentverarbeitung},
%   B.G. Teubner, Stuttgart, 1989
%   \bibitem{Kopka-E}
%   Helmut Kopka:
%   \textsl{\LaTeX -- Erweiterungsm\"oglichkeiten},
%   3. \"uberarbeitete Auf\/lage, Addison-Wesley, Bonn, 1991
%   \end{thebibliography}
% }
% \setlength{\parskip}{0pt plus 1pt}
%
% \CheckSum{647}
% \DoNotIndex{\\,\_,\ }
% \DoNotIndex{\@gobble,\@ifundefined,\@namedef,\@nameuse,\@tempdima}
% \DoNotIndex{\p@,\z@}
% \DoNotIndex{\active,\addtolength,\advance,\begin,\bfseries}
% \DoNotIndex{\catcode,\centering,\csname,\def,\divide}
% \DoNotIndex{\else,\empty,\end,\endcsname,\endgraf,\expandafter}
% \DoNotIndex{\fi,\footnotesize,\global}
% \DoNotIndex{\hangindent,\hbox,\hskip,\hspace,\hss}
% \DoNotIndex{\ifcase,\ifdim,\ifx,\itshape}
% \DoNotIndex{\Large,\large,\leavevmode,\leftskip,\let,\linewidth}
% \DoNotIndex{\mdseries,\message}
% \DoNotIndex{\newcommand,\newdimen,\newlength,\newif,\newsavebox,\noindent}
% \DoNotIndex{\normalsize,\or}
% \DoNotIndex{\par,\parbox,\parfillskip,\protect}
% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\rightskip}
% \DoNotIndex{\rmfamily}
% \DoNotIndex{\sbox,\scriptsize,\scshape,\setlength,\sffamily,\slshape,\small}
% \DoNotIndex{\space,\strut}
% \DoNotIndex{\textheight,\typeout,\ttfamily,\undefined,\upshape,\usebox}
% \DoNotIndex{\vsize,\vskip,\wd}
% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
% \DoNotIndex{\ExecuteOptions,\InputIfFileExists,\NeedsTeXFormat,\MessageBreak}
% \DoNotIndex{\PackageError,\PackageWarningNoLine,\ProcessOptions}
% \DoNotIndex{\ProvidesPackage}
%
% \clearpage
% \section{The (not well documented) code}
% \iffalse
%<*package>
% \fi
%
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesPackage{caption2}[1995/10/09 v2.0 caption package (AS)]
%
% package detection message
\let\caption@message\undefined
\newcommand*\caption@package[1]{%
  \ifx\caption@message\undefined
    \message{\space\space\space\space\space\space\space\space\space
             packages detected:}
    \let\caption@message\empty
  \fi
  \message{#1}}
%
% `internal' stuff
\newlength\realcaptionwidth
\newsavebox\captionbox
%
% Code initialisation, `normal' stuff
\newcommand*\captionsize{}
\newcommand*\captionfont{\captionsize}
\newcommand*\captionlabelfont{}
\newcommand*\captionlabeldelim{:}
\newdimen\captionlabelsep
  \sbox\captionbox{ }
  \setlength\captionlabelsep{\wd\captionbox}
\newdimen\captionmargin
\newdimen\captionwidth
% only used by captionstyle `indent', but can be used in user-defines styles
\newdimen\captionindent
\newif\ifonelinecaptions
\newif\iftakecaptionwidth
%
%\newcommand*\setcaptionfont[1]{%
%  \def\captionfont{#1}}
%\newcommand*\setcaptionlabelfont[1]{%
%  \def\captionlabelfont{#1}}
\newcommand*\setcaptionmargin[1]{%
  \setlength\captionmargin{#1}%
  \takecaptionwidthfalse}
\newcommand*\setcaptionwidth[1]{%
  \setlength\captionwidth{#1}%
  \takecaptionwidthtrue}
%
% \newcaptionstyle, \renewcaptionstyle & \defcaptionstyle
\newcommand\newcaptionstyle[2]{%
  \expandafter\ifx\csname caption@@#1\endcsname\relax
    \defcaptionstyle{#1}{#2}%
  \else
    \PackageError{caption}{Caption style `#1' already defined}{}%
  \fi}
\newcommand\renewcaptionstyle[2]{%
  \expandafter\ifx\csname caption@@#1\endcsname\relax
    \PackageError{caption}{Caption style `#1' undefined}{}%
  \else
    \defcaptionstyle{#1}{#2}%
  \fi}
\newcommand\defcaptionstyle[2]{%
  \@namedef{caption@@#1}{#2}}
\newcommand*\dummycaptionstyle[2]{%
  \defcaptionstyle{#1}{%
    \expandafter\ifx\csname caption@@\caption@style\expandafter\endcsname%
                    \csname caption@@#1\endcsname
      \PackageError{caption}{You can't use the caption style `#1' directy}{%
        The caption style `#1' is only a dummy and does not really exists.%
        \MessageBreak You have to redefine it (with \protect\renewcaptionstyle)
        before you can select\MessageBreak it with \protect\captionstyle.}%
    \else
      #2\usecaptionstyle{\caption@style}%
    \fi}}
%
% preimplemented types of captions, all with a label and text,
% separated by \captionlabeldelim
\newcaptionstyle{normal}{\caption@make{normal}}
\newcaptionstyle{center}{\caption@make{center}}
\newcaptionstyle{flushleft}{\caption@make{flushleft}}
\newcaptionstyle{flushright}{\caption@make{flushright}}
\newcaptionstyle{centerlast}{\caption@make{centerlast}}
\newcaptionstyle{hang}{\caption@make{hang}}
\newcaptionstyle{indent}{\caption@make{indent}}
%
% \captionstyle
\newcommand*\captionstyle[1]{%
  \expandafter\ifx\csname caption@@#1\endcsname\relax
    \PackageError{caption}{Undefined caption style `#1'}{}%
  \else
    \def\caption@style{#1}%
  \fi}
%
% Options
\DeclareOption{normal}{\captionstyle{normal}}
\DeclareOption{center}{\captionstyle{center}}
\DeclareOption{flushleft}{\captionstyle{flushleft}}
\DeclareOption{flushright}{\captionstyle{flushright}}
\DeclareOption{centerlast}{\captionstyle{centerlast}}
\DeclareOption{anne}{\ExecuteOptions{centerlast}}
\DeclareOption{hang}{\captionstyle{hang}}
\DeclareOption{isu}{\ExecuteOptions{hang}}
\DeclareOption{indent}{\captionstyle{indent}}
%
\DeclareOption{oneline}{\onelinecaptionstrue}
\DeclareOption{nooneline}{\onelinecaptionsfalse}
%
\DeclareOption{scriptsize}{\renewcommand*\captionsize{\scriptsize}}
\DeclareOption{footnotesize}{\renewcommand*\captionsize{\footnotesize}}
\DeclareOption{small}{\renewcommand*\captionsize{\small}}
\DeclareOption{normalsize}{\renewcommand*\captionsize{\normalsize}}
\DeclareOption{large}{\renewcommand*\captionsize{\large}}
\DeclareOption{Large}{\renewcommand*\captionsize{\Large}}
%
\DeclareOption{up}{\renewcommand*\captionlabelfont{\upshape}}
\DeclareOption{it}{\renewcommand*\captionlabelfont{\itshape}}
\DeclareOption{sl}{\renewcommand*\captionlabelfont{\slshape}}
\DeclareOption{sc}{\renewcommand*\captionlabelfont{\scshape}}
\DeclareOption{md}{\renewcommand*\captionlabelfont{\mdseries}}
\DeclareOption{bf}{\renewcommand*\captionlabelfont{\bfseries}}
\DeclareOption{rm}{\renewcommand*\captionlabelfont{\rmfamily}}
\DeclareOption{sf}{\renewcommand*\captionlabelfont{\sffamily}}
\DeclareOption{tt}{\renewcommand*\captionlabelfont{\ttfamily}}
%
\DeclareOption{boxed}{\AtEndOfPackage{%
  \ifx\caption@@ruled\undefined
    \PackageWarningNoLine{caption}{%
      Option `boxed' is set but there is no `float' package\MessageBreak
      around here, so this option will be totally ignored}
  \else
    \dummycaptionstyle{boxed}{}%
  \fi}}
\DeclareOption{ruled}{\AtEndOfPackage{%
  \ifx\caption@@ruled\undefined
    \PackageWarningNoLine{caption}{%
      Option `ruled' is set but there is no `float' package\MessageBreak
      around here, so this option will be totally ignored}
  \else
    \dummycaptionstyle{ruled}{\onelinecaptionsfalse\setcaptionmargin{0pt}}%
  \fi}}
%
\DeclareOption{longtable}{\AtEndOfPackage{%
  \ifx\caption@@longtable\undefined
    \PackageWarningNoLine{caption}{%
      Option `longtable' is set but there is no `longtable' package\MessageBreak
      around here, so this option will be totally ignored}
  \else
    \dummycaptionstyle{longtable}{}%
  \fi}}
%
\DeclareOption*{\AtEndOfPackage{%
  \InputIfFileExists{\CurrentOption.caption}{}{%
    \PackageError{caption}{File `\CurrentOption.caption' not found}{%
    You selected the unknown package option `\CurrentOption', so I
    thought you want to\MessageBreak
    input the definition file `\CurrentOption.caption' here
    -- but there is no one!}}}}
%
\ExecuteOptions{normal,oneline}
\ProcessOptions
%
% \@makecaption
\renewcommand\@makecaption[2]{%
  \vskip\abovecaptionskip
  \realcaptionwidth\linewidth
  \def\captionlabel{#1}%
  \def\captiontext{#2}%
  \usecaptionstyle{\caption@style}%
  \vskip\belowcaptionskip}
%
% Helpers for caption style authors
\newcommand*\caption@canterr[1]{%
  \PackageError{caption}{You can't use \protect#1
    in normal text}{The usage of \protect#1 is only
    allowed inside code declared with\MessageBreak \protect\defcaptionstyle,
    \protect\newcaptionstyle \space or \protect\renewcaptionstyle.}}
\newcommand\onelinecaption[2]{%
  \ifx\captiontext\undefined
    \caption@canterr{\onelinecaption}%
  \else
    \def\caption@temp{#2}%
    \ifonelinecaptions
      \sbox\captionbox{#1}%
      \ifdim\wd\captionbox >\realcaptionwidth
        \caption@temp
      \else
        {\centering\usebox{\captionbox}\par}%
      \fi
    \else
      \caption@temp
    \fi
    \let\caption@temp\undefined
  \fi}
\newcommand*\usecaptionmargin{%
  \ifx\captiontext\undefined
    \caption@canterr{\usecaptionmargin}%
  \else
    \iftakecaptionwidth
      \leftskip\realcaptionwidth
      \advance\leftskip by -\captionwidth
      \divide\leftskip by 2
      \rightskip\leftskip
      \realcaptionwidth\captionwidth
    \else
      \leftskip\captionmargin
      \rightskip\captionmargin
      \advance\realcaptionwidth by -2\captionmargin
    \fi
  \fi}
\newcommand*\usecaptionstyle[1]{%
  \ifx\captiontext\undefined
    \caption@canterr{\usecaptionstyle}%
  \else
    \@ifundefined{caption@@#1}%
      {\PackageError{caption}{Caption style `#1' undefined}{}}%
      {\@nameuse{caption@@#1}}
  \fi}
%
% equal code for normal, center, centerlast, hang, and indent
\newcommand*\caption@make[1]{%
  \usecaptionmargin\captionfont
  \def\caption@label{%
    {\captionlabelfont\captionlabel\captionlabeldelim}%
    \hskip\captionlabelsep}%
  \onelinecaption{\caption@label\captiontext}%
    {\@nameuse{caption@@@#1}}}
%
% the preimplemented caption styles
\newcommand*\caption@@@normal{%
  \caption@label\captiontext\par}
\newcommand*\caption@@@center{%
  \parbox[t]{\realcaptionwidth}{\centering
  \caption@label\captiontext\par}}%
\newcommand*\caption@@@flushleft{%
  \parbox[t]{\realcaptionwidth}{\raggedright
  \caption@label\captiontext\par}}%
\newcommand*\caption@@@flushright{%
  \parbox[t]{\realcaptionwidth}{\raggedleft
  \caption@label\captiontext\par}}%
\newcommand*\caption@@@centerlast{%
  \advance\leftskip by 0pt plus 1fil%
  \advance\rightskip by 0pt plus -1fil%
  \parfillskip0pt plus 2fil%
  \caption@label\captiontext\par}
\newcommand*\caption@@@hang{%
  \sbox\captionbox{\caption@label}%
  \hangindent\wd\captionbox\noindent
  \usebox\captionbox\captiontext\par}
\newcommand*\caption@@@indent{%
  \hangindent\captionindent\noindent
  \caption@label\captiontext\par}
%    \end{macrocode}
%
% \subsection*{Support of the float package}
%    \begin{macrocode}
\ifx\floatc@plain\undefined
\else
  \caption@package{float}
%
% interface float package -> caption package
  \newcommand\caption@floatc[3]{%
    \realcaptionwidth\linewidth
    \def\captionlabel{#2}%
    \def\captiontext{#3}%
    \usecaptionstyle{#1}}
%
% floatstyle plain verwendet jetzt den gesetzten captionstyle
  \renewcommand\floatc@plain{\caption@floatc{\caption@style}}
%
% floatstyle boxed auch (kann aber mit \renewcaptionstyle geaendert werden)
  \dummycaptionstyle{boxed}{\def\captionlabelfont{\bfseries}}
  \newcommand\floatc@boxed{\caption@floatc{boxed}}
% jetzt muessen wir nur noch dafuer sorgen, dass es auch (statt floatc@plain)
% in \fs@boxed verwendet wird...
  \let\caption@boxed\fs@boxed
  \renewcommand\fs@boxed{\let\floatc@plain\floatc@boxed\caption@boxed}
%
% floatstyle ruled, dies geht zum Glueck wieder geradeaus
  \newcaptionstyle{ruled}{{\bfseries\captionlabel} \captiontext\par}
  \renewcommand*\floatc@ruled{\caption@floatc{ruled}}
%
\fi
%    \end{macrocode}
%
% \subsection*{Support of the longtable package}
%    \begin{macrocode}
\ifx\LT@makecaption\undefined
\else
  \caption@package{longtable}
  \dummycaptionstyle{longtable}{\setcaptionwidth\LTcapwidth}
  \renewcommand\LT@makecaption[3]{%
    \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\linewidth{%
    \realcaptionwidth\linewidth
    \ifx#1\@gobble
      \def\captionlabel{}%
      \def\captionlabeldelim{}%
      \captionlabelsep\z@
    \else
      \def\captionlabel{#2}%
    \fi
    \def\captiontext{#3}%
    \usecaptionstyle{longtable}%
    \endgraf\vskip\baselineskip}%
    \hss}}}
\fi
%    \end{macrocode}
%
% \subsection*{Support of the subfigure package}
%    \begin{macrocode}
\newcommand*\addtosubcaption[1]{}
\@ifundefined{@makesubfigurecaption}{}{%
  \caption@package{subfigure}
%    \end{macrocode}
%
% \begin{macro}{\subcapsize}
%    \begin{macrocode}
  \newcommand*\subcapstyle[1]{%
    \expandafter\ifx\csname caption@@#1\endcsname\relax
      \PackageError{caption}{Undefined caption style `#1'}{}%
    \else
      \def\caption@substyle{#1}%
    \fi}
%    \end{macrocode}
% \end{macro}
%
% Detection of |\caption@substyle|.
%    \begin{macrocode}
  \subcapstyle{normal}
  \ifsubcaphang
    \subcapstyle{hang}
  \fi
  \ifsubcapcenter
    \subcapstyle{center}
  \fi
  \ifsubcapcenterlast
    \subcapstyle{centerlast}
  \fi
%    \end{macrocode}
%
% NOTE: \cs{subfigcapmargin} is \emph{not} a length, it's a command.
% So we make \cs{subfigcapwidth} also a command!
%    \begin{macrocode}
  \newif\iftakesubfigcapwidth
  \newcommand*\subfigcapwidth{0pt}
% only used by captionstyle `indent', but can be used in user-defines styles
  \newlength\subcapindent
%    \end{macrocode}
%
% \begin{macro}{\setsubcapmargin}
% \begin{macro}{\setsubcapwidth}
%    \begin{macrocode}
  \newcommand*\setsubcapmargin[1]{%
    \renewcommand*\subcapfigmargin{#1}%
    \takesubfigcapwidthfalse}
  \newcommand*\setsubcapwidth[1]{%
    \renewcommand*\subcapfigwidth{#1}%
    \takesubfigcapwidthtrue}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%    \begin{macrocode}
  \renewcommand\@makesubfigurecaption[2]{%
    \realcaptionwidth\@tempdima
    \def\captionlabel{#1}%
    \def\captiontext{#2}%
    \let\captionfont\subcapsize
    \let\captionlabelfont\relax
    \let\captionlabeldelim\empty
    \captionlabelsep0pt
    \ifsubcapnooneline\onelinecaptionsfalse\else\onelinecaptionstrue\fi
    \iftakesubfigcapwidth\takecaptionwidthtrue\else\takecaptionwidthfalse\fi
    \setlength\captionmargin{\subfigcapmargin}%
    \setlength\captionwidth{\subfigcapwidth}%
    \captionindent\subcapindent
    \hbox{\parbox[t]\@tempdima{\strut\usecaptionstyle{\caption@substyle}}}}
%    \end{macrocode}
%
%    \begin{macrocode}
  \renewcommand*\addtosubcaption[1]{%
    \let\caption@makesubfigurecaption\@makesubfigurecaption
    \renewcommand\@makesubfigurecaption[2]{%
      #1\caption@makesubfigurecaption}
    \let\@makesubtablecaption\@makesubfigurecaption}}
%    \end{macrocode}
%
% \subsection*{Cleaning up}
%    \begin{macrocode}
\ifx\caption@message\undefined
\else\message{^^J}\let\caption@message\undefined\fi
\let\caption@package\undefined
\let\caption@subcapsize\undefined
%    \end{macrocode}
% \clearpage
%
% \iffalse
%</package>
% \fi
%
% \Finale
%
\endinput