Debian Codegraph @

texmf-dist/source/latex/subfigure/subfigure.dtx

raw
1 % \iffalse % subfigure.dtx
2 % Subfigure/subtable macros for use with the LaTeX figure/table environments.
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 % Copyright (C) 1986-2002 Steven Douglas Cochran
5 %
6 % The subfigure package is free software; it may be distributed under
7 % the conditions of the LaTeX Project Public License, either version 1.1
8 % of this license or (at your option) any later version. The latest
9 % version of this license is in:
10 % http://www.latex-project.org/lppl.txt
11 % and version 1.1 or later is part of all distributions of LaTeX version
12 % 1999/06/01 or later.
13 %
14 % The captcont package is distributed in the hope that it will be
15 % useful, but WITHOUT ANY WARRANTY; without even the implied warranty
16 % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 % LaTeX Project Public License for more details.
18 %
19 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20 %% @LaTeX-style-file{
21 %% author = "Steven Douglas Cochran",
22 %% version = "2.1.5",
23 %% date = "2005/04/29",
24 %% time = "14:24:08",
25 %% filename = "subfigure.sty",
26 %% address = "Digital Mapping Laboratory, School of Computer Science
27 %% Carnegie-Mellon University, 5000 Forbes Avenue
28 %% Pittsburgh, PA 15213-3890, USA",
29 %% telephone = "+1 412.268.5654",
30 %% fax = "+1 412.268.5576",
31 %% email = "[email protected]",
32 %% codetable = "ISO/ASCII",
33 %% keywords = "LaTeX, float, figure, table, captcont",
34 %% supported = "yes",
35 %% abstract = "LaTeX package for providing support for the
36 %% inclusion of small, `sub', figures and tables. It
37 %% simplifies the positioning, captioning and
38 %% labeling of them within a single figure or table
39 %% environment. In addition, this package allows
40 %% such subcaptions to be written to the List of
41 %% Figures or List of tables if desired."
42 %% }
43 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
44 %
45 %<*driver>
46 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
47 \ProvidesFile{subfigure.dtx}
48 \documentclass{ltxdoc}
49 \usepackage[tight,TABTOPCAP]{subfigure}[2005/04/29]
50 \setlength\hfuzz{100pt}
51 \setlength\vfuzz{100pt}
52 \clubpenalty=10000
53 \widowpenalty=10000
54 \displaywidowpenalty=5000
55 \brokenpenalty=5000
56 \begin{document}
57 \DocInput{subfigure.dtx}
58 \end{document}
59 %</driver>
60 %
61 %<*ltxdoc>
62 \AtBeginDocument{
63 % \OnlyDescription % comment out for implementation details
64 \EnableCrossrefs
65 \RecordChanges
66 \CodelineIndex}
67 \AtEndDocument{
68 \PrintChanges
69 \PrintIndex}
70 %</ltxdoc>
71 %
72 % \fi
73 % \catcode`\^=14 ^^A We will use a ^ for a comment rather than ^^A.
74 % \newcommand*{\Lopt}[1]{\textsf{#1}} ^ Package options
75 % \newcommand*{\Lfile}[1]{\texttt{#1}} ^ File names
76 % \newcommand*{\Lpack}[1]{\textsf{#1}} ^ Package names
77 % \newcommand*{\Lenv}[1]{\texttt{#1}} ^ Environment names
78 % \newcommand*{\Lcount}[1]{\textsl{\small#1}} ^ Counter names
79 % \newcommand*{\Lif}[1]{\textsc{\bf#1}} ^ \if names
80 % ^ NOTE: Hacks added to make the final format are marked ``^finalhack''.
81 %
82 % \changes{v1.0}{05 Mar 1986}{Created.}
83 %
84 % \changes{v1.1}{02 Nov 1988}{Initial revision.}
85 %
86 % \changes{v1.2}{30 Aug 1989}{Added a separate bottom margin and
87 % expanded the comments.}
88 %
89 % \changes{v1.3}{22 Oct 1990}{Changed test for empty subcaption inside
90 % of \cmd{\@subfigure} to compare tokens and not the subcaption vs.\
91 % \cmd{\@empty}. The former (incorrect) test caused an error when the
92 % first two letters of the subcaption were the same.}
93 %
94 % \changes{v1.4}{27 Jun 1992}{Added a hack to allow the \cmd{\label}
95 % command to be used within the body of the subfigure giving a
96 % reference label in the form \cmd{\arabic{thefigure}\thesubfigure}.
97 % Added standard file header for style.}
98 %
99 % \changes{v1.5}{11 Aug 1992}{Fixed a bug which caused a problem with
100 % subcaptions that contained expressions like \cmd{\sqrt}; This was
101 % pointed out by Tom Scavo (scavo\@cie.uoregon.edu). A separate bug
102 % was fixed which caused different sized subcaptions to be misaligned;
103 % This problem was pointed out by Simon Marshall
104 % (S.Marshal\@Hull.ac.uk). Also cleaned up the code a mite and
105 % {\bf changed} the figure spacing so that if no optional section is
106 % given, then the figure is only followed by \cmd{\subfigbottomskip}
107 % and not that plus $(\cmd{\subfigcapskip}+\cmd{\strut}\hbox{height})$.
108 % This should make it easier to adjust spacing as desired.}
109 %
110 % \changes{v1.6}{13 May 1993}{Changed to use the \cmd{\thefigure}
111 % command in building the referenced label. The old form caused a
112 % problem when used with the report.sty as pointed out by Andrew
113 % Anselmo (anselmo\@cumesb.mech.columbia.edu). Also modified to
114 % restrict the scope of the subfigure \cmd{\label} to the body of the
115 % subfigure. Added \cmd{\@thesubfigure} to allow a separate labeling
116 % of the subfigure in the figure and in the text. By default it is
117 % the same as \cmd{\thesubfigure} with space appended. Added some
118 % code to print the subfigure captions to the List-of-Figures file
119 % if desired. Finally, added the corresponding support for subtables
120 % as well as subfigures. NOTE: the optional subcaption is now a moving
121 % argument and any fragile commands that appear in the subcaption must
122 % be preceded by a \cmd{\protect} (just like that of the \cmd{\caption}
123 % command).}
124 %
125 % \changes{v2.0}{06 Mar 1995}{This version of \cmd{\subfigure} is the
126 % first to be ported to \LaTeXe\ (with backward compatibility to
127 % \LaTeX2.09). \cmd{\subfigure} and \cmd{\subtable} are now identical
128 % and the environment controls internal differences between them. Now,
129 % the subcaption setting portion of \cmd{\@subfloat} is broken into the
130 % separate commands \cmd{\@makesubfigurecaption} and
131 % \cmd{\@makesubtablecaption} to allow a separate hook for the
132 % modification of how the subcaption is constructed and to allow the
133 % subtable and subfigure captions to be different. In addition, support
134 % of the \Lopt{normal}, \Lopt{hang}, \Lopt{center}, \Lopt{centerlast},
135 % \Lopt{nooneline}; \Lopt{scriptsize}, \ldots, \Lopt{Large}; \Lopt{up},
136 % \Lopt{it}, \Lopt{sl}, \Lopt{sc}, \Lopt{md}, \Lopt{bf}, \Lopt{rm},
137 % \Lopt{sf}, and \Lopt{tt} package options were added for compatibility
138 % with the caption.sty by H.A. Sommerfeldt.}
139 %
140 % \changes{v2.1}{23 Jan 2002}{Upgraded to fix a \cmd{\protect} bug that
141 % crept in due to changes in \LaTeXe\ and to enhance the interaction
142 % with the ``List-of'' files. Backward compatibility with \LaTeX2.09 is
143 % \textbf{not} supported. This version allows optional subcaption
144 % strings for the ``List-of'' files and the companion captcont.sty
145 % allows further extensions. Added check for \Lfile{subfigure.cfg} file
146 % for automatic configuration. Added more options for adjustment of the
147 % look-and-feel of the subcaption. Added the ability to independently
148 % move the float caption and subcaption before or after the figure.
149 % Removed extra space from the top of a figure at the top of a page and
150 % some accidental whitespace. Reduced the default space around the
151 % figure and made it actual skips. Updated the documentation to
152 % describe the new changes and to make some points more clear.}
153 %
154 % \DoNotIndex{\@@@,\@auxout,\@bsphack,\@dottedtocline,\@empty,\@esphack}
155 % \DoNotIndex{\@flushglue,\@for,\@gobble,\@ifnextchar,\@ifpackageloaded}
156 % \DoNotIndex{\@ifstar,\@ifundefined,\@minipagefalse,\@nameuse,\@ne}
157 % \DoNotIndex{\@rightskip,\@tempboxa,\@tempcnta,\@tempdima}
158 % \DoNotIndex{\@tempdimb,\@tempskipb,\@xaddvskip,\addcontentsline}
159 % \DoNotIndex{\addtolength,\advance,\alph,\arabic,\AtBeginDocument}
160 % \DoNotIndex{\AtEndOfPackage,\begingroup,\bfseries,\bgroup,\box}
161 % \DoNotIndex{\DeclareOption,\def,\do,\edef,\egroup,\else,\endgroup}
162 % \DoNotIndex{\ExecuteOption,\ExecuteOptions,\ext@figure,\ext@table}
163 % \DoNotIndex{\familydefault,\fi,\footnotesize,\fontfamily,\fontseries}
164 % \DoNotIndex{\fontshape,\gdef,\global,\hbox,\hfil,\hskip,\hss,\if@minipage}
165 % \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifx,\ignorespaces,\InputIfFileExists}
166 % \DoNotIndex{\itshape,\label,\lastskip,\leftskip,\Large,\large,\leavevmode}
167 % \DoNotIndex{\let,\long,\m@ne,\mdseries,\multiply,\NeedsTeXFormat}
168 % \DoNotIndex{\newcommand,\newcounter,\newdimen,\newif,\newlabel,\newskip}
169 % \DoNotIndex{\noexpand,\normalsize,\numberline,\or,\p@,\par,\parbox}
170 % \DoNotIndex{\parfillskip,\parindent,\ProcessOptions,\protect}
171 % \DoNotIndex{\protected@write,\protected@edef,\providecommand}
172 % \DoNotIndex{\ProvidesPackage,\ref,\refstepcounter,\relax,\renewcommand}
173 % \DoNotIndex{\RequirePackage,\rightskip,\rmfamily,\sbox,\scriptsize}
174 % \DoNotIndex{\scshape,\selectfont,\seriesdefault,\setbox,\setcounter}
175 % \DoNotIndex{\setlength,\sffamily,\shapedefault,\slshape,\small,\space}
176 % \DoNotIndex{\string,\strut,\thefigure,\thepage,\thetable,\ttfamily,\tw@}
177 % \DoNotIndex{\typeout,\undefined,\upshape,\usebox,\vbox,\vskip,\vspace}
178 % \DoNotIndex{\vtop,\wd,\xdef,\z@,\z@skip}
179 %
180 % \CheckSum{787}%
181 % ^ Allow a little more freedom in typesetting floats.
182 % \setcounter{topnumber}{8}
183 % \def\topfraction{.8}
184 % \setcounter{bottomnumber}{8}
185 % \def\bottomfraction{.8}
186 % \setcounter{totalnumber}{8}
187 % \def\textfraction{.2}
188 % \def\floatpagefraction{.8}
189 % \setcounter{dbltopnumber}{8}
190 % \def\dbltopfraction{.8}
191 % \def\dblfloatpagefraction{.8}
192 %
193 % ^ Add some space above any footnotes.
194 % \skip\footins=1.5\baselineskip
195 %
196 % \makeatletter
197 %
198 % ^ Remove some space above minipage footnotes.
199 % \skip\@mpfootins=2.6\p@
200 %
201 % ^ Define a raggedright for use in tabular's.
202 % \newcommand{\rr}{^
203 % \@rightskip\@flushglue
204 % \rightskip\@rightskip
205 % \leftskip\z@
206 % \parindent\z@}
207 %
208 % ^ Turn off any list entries by ``eating'' any \addcontentsline stuff.
209 % \newcommand*{\eatthree}[3]{}^
210 % \newcommand*{\turnofflistentry}{\let\addcontentsline=\eatthree}
211 %
212 % ^ Print text (#2) only if reference (r@#1) is defined.
213 % \newcommand{\PrintIfDefined}[3]{^
214 % \@bsphack
215 % \@ifundefined{r@#1}{#3}{#2}^
216 % \@esphack}
217 %
218 % \makeatother
219 %
220 % \def\docdate{2005/03/15}
221 % \def\fileversion{v2.1.5}
222 % \def\filedate{2002/03/15}
223 % \def\filename{subfigure.dtx}
224 %
225 % \title{The \Lpack{subfigure} Package\footnote{This paper documents
226 % the \Lpack{subfigure} package \fileversion, last revised \filedate.}}
227 % \author{Steven Douglas Cochran\\[5pt]
228 % Digital Mapping Laboratory, School of Computer Science \\
229 % Carnegie-Mellon University, 5000 Forbes Avenue \\
230 % Pittsburgh, PA 15213--3890, USA\\[5pt]
231 % \texttt{[email protected]}}
232 % \date{\docdate}
233 %
234 % \maketitle
235 %
236 % \begin{abstract}
237 % \noindent
238 % This article documents the \LaTeX\ package `\Lpack{subfigure}', which
239 % provides support for the inclusion of small, `sub', figures and
240 % tables. It simplifies the positioning, captioning and labeling of
241 % such objects within a single \Lenv{figure} or \Lenv{table}
242 % environment. In addition, this package allows such subcaptions to be
243 % written to a List-of-Figures or List-of-Tables if desired. The
244 % `\Lpack{subfigure}' package also cooperates with the `\Lpack{caption}'
245 % and `\Lpack{caption2}' packages by H.A. Sommerfeldt
246 % \cite{Somm95a,Somm95b}, the `\Lpack{ccaption}' and `\Lpack{tocloft}'
247 % packages \cite{Wils01,Wils01B} by Peter Wilson, the `\Lpack{hyperref}'
248 % package by Sebastian Rahtz \cite{Raht02}, the `\Lpack{captcont}' package
249 % \cite{Coch02}, and should be compatible with all other packages that
250 % modify or extend the \Lenv{float} environment or the \cmd{\caption} or
251 % \cmd{\label} commands.
252 %
253 % \end{abstract}
254 %
255 % \newpage
256 % \tableofcontents
257 %
258 % \newpage
259 % \setcounter{lotdepth}{2}^
260 % \listoftables
261 % \setcounter{lofdepth}{2}^
262 % \listoffigures
263 %
264 % \newpage
265 % \section{Introduction}
266 % \enlargethispage{24pt}^finalhack
267 %
268 % This package provides support for the manipulation and reference of
269 % small or `sub' figures and tables within a single \Lenv{figure} or
270 % \Lenv{table} environment\@.\footnote{Section~\ref{sec:customfloat}
271 % describes how to add support for additional \Lenv{float}
272 % environments.} It is convenient to use this package when your
273 % subfigures are to be separately captioned, referenced, or when such
274 % subcaptions are to be included in the List-of-Figures.
275 %
276 % Before using the \Lpack{subfigure} package, consider the following to
277 % see if you really need it. If you simply want to center your figure,
278 % then you can use |\centerline|, |\centering| or the \Lenv{center}
279 % environment to do so. If your figure has a short width or if you wrap
280 % your figure in a |\parbox| or a \Lenv{minipage} of a short width, then
281 % you can place multiple figures or tables side-by-side. For example,
282 % the following will put two images side-by-side in a single figure as
283 % shown in figure~\ref{fig:1figs}:\footnote{You might have to use the
284 % optional position arguments `[b]' or `[t]' if the figures are of
285 % different heights.}
286 %
287 % \begin{verbatim}
288 % \begin{figure}%
289 % \centering
290 % \parbox{1.2in}{...figure code...}%
291 % \qquad
292 % \begin{minipage}{1.2in}%
293 % ...figure code...
294 % \end{minipage}%
295 % \caption{Here are two figures side-by-side.}%
296 % \label{fig:1figs}%
297 % \end{figure}
298 % \end{verbatim}
299 % \vspace{-1\baselineskip}
300 % \begin{figure}^
301 % \abovecaptionskip=6pt^
302 % \centering
303 % \parbox{1.2in}{^
304 % \fboxsep=-\fboxrule
305 % \fbox{\hbox to 1.2in{\vbox to 15mm{\null\vfil}\hfil}}}^
306 % \qquad
307 % \begin{minipage}{1.2in}^
308 % \fboxsep=-\fboxrule
309 % \fbox{\hbox to 1.2in{\vbox to 15mm{\null\vfil}\hfil}}^
310 % \end{minipage}^
311 % \caption{Here are two figures side-by-side.}^
312 % \label{fig:1figs}^
313 % \vspace{-10pt}
314 % \end{figure}
315 %
316 % \noindent
317 % Further, if you place the caption inside the |\parbox| or
318 % \Lenv{minipage}, then the width of the caption will be limited to the
319 % width of the parbox or minipage as shown in figures~\ref{fig:2figsA}
320 % and \ref{fig:2figsB}:
321 %
322 % \begin{verbatim}
323 % \begin{figure}%
324 % \centering
325 % \parbox{1.2in}{%
326 % ...figure code...
327 % \caption{First.}%
328 % \label{fig:2figsA}}%
329 % \qquad
330 % \begin{minipage}{1.2in}%
331 % ...figure code...
332 % \caption{Second.}%
333 % \label{fig:2figsB}%
334 % \end{minipage}%
335 % \end{figure}%
336 % \end{verbatim}
337 % \vspace{-\baselineskip}
338 % \begin{figure}^
339 % \abovecaptionskip=2pt^
340 % \centering
341 % \parbox{1.2in}{^
342 % \fboxsep=-\fboxrule
343 % \fbox{\hbox to 1.2in{\vbox to 15mm{\vfil\null}\hfil}}^
344 % \caption{First.}^
345 % \label{fig:2figsA}}^
346 % \qquad
347 % \begin{minipage}{1.2in}^
348 % \fboxsep=-\fboxrule
349 % \fbox{\hbox to 1.2in{\vbox to 15mm{\vfil\null}\hfil}}^
350 % \caption{Second.}^
351 % \label{fig:2figsB}^
352 % \end{minipage}^
353 % \vspace{-10pt}
354 % \end{figure}
355 %
356 % For more information on typesetting figures and tables, see the
357 % document ``Using Imported Graphics in \LaTeXe'' by Keith Reckdahl
358 % \cite{Reck97}.
359 %
360 % \section{The User Interface}
361 % \vspace{-5pt}^finalhack
362 % \enlargethispage{12pt}^finalhack
363 %
364 % To use this package place
365 % \begin{quote}
366 % |\usepackage|\oarg{options}\marg{subfigure}
367 % \end{quote}
368 % in the preamble of your document. The supported options are shown in
369 % table~\ref{tab:options}.
370 % \DescribeMacro{\subfigure}
371 % \DescribeMacro{\subtable}
372 % Within a \Lenv{figure} or \Lenv{table}
373 % environment, you can use the following commands to create a subfigure
374 % or subtable ``box'' with an optional subcaption underneath.
375 % \vspace{-2pt}
376 % \begin{quote}
377 % |\subfigure|\oarg{list\_entry}\oarg{subcaption}\marg{figure}\\
378 % |\subtable|\oarg{list\_entry}\oarg{subcaption}\marg{figure}
379 % \end{quote}
380 % \vspace{-2pt}
381 %
382 % \noindent
383 % If a subcaption argument is given (including the null subcaption
384 % `{\ttfamily [$\;$]}') then the subfigure is labeled with a counter
385 % formatted by the command `|\thesubfigure|' which returns, by default,
386 % `(a)', `(b)', etc. The counter used for labeling the subfigures is
387 % \Lcount{subfigure} and is incremented for each subfigure regardless of
388 % whether a subcaption was printed. The internals of the |\subtable|
389 % command are symmetric to those of the |\subfigure| command. Further,
390 % if a List-of-Figures (or List-of-Tables) is generated, then the
391 % \meta{list\_entry} argument controls how the caption text is used
392 % there. Table~\ref{tab:calling} shows the possibilities.
393 %
394 % \changes{v2.1.4}{30 Apr 2002}{Changed the label and caption defaults
395 % from \cmd{\rmfamily}\cmd{\mdseries}\cmd{\upshape} to
396 % \cmd{\familydefault}\cmd{\seriesdefault} \cmd{\shapedefault}.}
397 % \DeleteShortVerb{\|}
398 % \begin{table}
399 % \def\M#1{\vspace*{#1}}
400 % \centering
401 % \caption{\Lpack{subfigure} package options.}
402 % \label{tab:options}
403 % \vspace{8pt}
404 % \fbox{\begin{tabular}{|p{0.36\textwidth}|p{0.63\textwidth}|} \hline
405 % \multicolumn{1}{|c|}{{\large\bf\strut Option}}
406 % & \multicolumn{1}{c|}{{\large\bf Description}}
407 % \\ \hline\hline
408 % \Lopt{normal} & \rr Provides `normal' subcaptions, this is the
409 % default. \\ \hline
410 % \raisebox{-1.4ex}{\Lopt{hang}, \Lopt{isu}}
411 % & \rr Causes the label to be a hanging
412 % indentation to the subcaption paragraph.
413 % (\Lopt{isu} is a synonym for \Lopt{hang}.)
414 % \\ \hline
415 % \raisebox{-1.4ex}{\Lopt{center}}
416 % & \rr Causes each line of the paragraph to be
417 % separately centered. Overrides
418 % \Lopt{centerlast}.\\ \hline
419 % \raisebox{-1.4ex}{\Lopt{centerlast}, \Lopt{anne}}
420 % & \rr Causes the last line only to be centered.
421 % Overrides \Lopt{nooneline}. (\Lopt{anne} is
422 % a synonym for \Lopt{centerlast}.) \\ \hline
423 % \raisebox{-2.6ex}{\Lopt{nooneline}}
424 % & \rr If a subcaption fits on one line it will, by
425 % default, be centered. This option
426 % treats a single line like a mid-line of a
427 % multi-line caption.\\ \hline
428 % \raisebox{-1.4ex}{\Lopt{raggedright}}
429 % & \rr Causes the subcaption text to be raggedright.
430 % Overrides \Lopt{center} and \Lopt{centerlast}.
431 % \\ \hline\hline
432 % \Lopt{scriptsize{\rm,} footnotesize{\rm,} small{\rm,}\hfil\null\linebreak
433 % normalsize{\rm,} large{\rm,} Large}
434 % & \rr Sets the font size of the subcaptions (both
435 % the label and the text), \Lopt{footnotesize}
436 % is default. \\ \hline
437 % \M{1.8ex}
438 % \Lopt{rm{\rm,} sf{\rm,} tt{\rm,} md{\rm,} bf{\rm,}\efill
439 % up{\rm,} it{\rm,} sl{\rm,} sc{\rm,}}\hfil\null\linebreak
440 % \Lopt{RM{\rm,} SF{\rm,} TT{\rm,} MD{\rm,} BF{\rm,}\efill
441 % UP{\rm,} IT{\rm,} SL{\rm,} SC}
442 % & \rr The lowercase commands set the font attributes
443 % of the subcaption label. The capitalized version
444 % sets the font attributes of the text. Family,
445 % shape and style attributes may be mixed.
446 % The default is to set the document defaults for
447 % the family, series and shape.\\ \hline\hline
448 % \M{4ex}
449 % \Lopt{figbotcap}{\rm,} \Lopt{tabbotcap}{\rm,}\hfil\null\linebreak
450 % \Lopt{FIGBOTCAP}{\rm,} \Lopt{TABBOTCAP}
451 % & \rr Sets the figure or table numbering based on
452 % the assumption that the figure or table caption
453 % comes after the subfigures or subtables. The
454 % capitalized version also places the subcaption
455 % after the figure (``\Lopt{FIGBOTCAP}'' and
456 % ``\Lopt{TABBOTCAP}'' are the default settings).
457 % \\ \hline
458 % \M{3.9ex}
459 % \Lopt{figtopcap}{\rm,} \Lopt{tabtopcap}{\rm,}\hfil\null\linebreak
460 % \Lopt{FIGTOPCAP}{\rm,} \Lopt{TABTOPCAP}
461 % & \rr Sets the figure or table numbering based on
462 % the assumption that the figure or table caption
463 % precedes the subfigures or subtables. The
464 % capitalized version also places the subcaption
465 % before the figure (``\Lopt{TABTOPCAP}'' is the
466 % preferred table setting, see
467 % section~\ref{sec:position} for details).
468 % \\ \hline\hline
469 % \M{2.6ex}
470 % \Lopt{loose}{\rm,} \Lopt{tight}
471 % & \rr The (default) \Lopt{loose} option sets the
472 % historically normal whitespace around the subfloat.
473 % The \Lopt{tight} option sets less space around the
474 % subfigure (this is the preferred setting).
475 % \\ \hline
476 % \end{tabular}}%
477 % \end{table}
478 % \MakeShortVerb{\|}
479 %
480 % \begin{table}
481 % \centering
482 % \caption{\cmd{\subfigure} calling arguments.}
483 % \label{tab:calling}
484 % \begingroup\small
485 % \begin{tabular}{llc} \\ \hline
486 % {\normalsize Subfigure Command}
487 % & {\normalsize LoF/LoT}
488 % & \multicolumn{1}{r}{\hbox to .25in{%
489 % \hss\normalsize
490 % Subfigure Caption}}
491 % \\ \hline
492 % \cmd{\subfigure}\{\dots fig\dots\}
493 % & & \\
494 % \cmd{\subfigure}[~]\{\dots fig\dots\}
495 % & (b)\ \ . . . . . . . . . .
496 % & (b) \\
497 % \cmd{\subfigure}[Subcaption.]\{\dots fig\dots\}
498 % & (c) Subcaption. . . .
499 % & (c) Subcaption. \\
500 % \cmd{\subfigure}[\space][Subcaption.]\{\dots fig\dots\}
501 % & & (d) Subcaption. \\
502 % \cmd{\subfigure}[\space][\space]\{\dots fig\dots\}
503 % & & (e) \\
504 % \cmd{\subfigure}[List\_entry.][Subcaption.]\{\dots fig\dots\}
505 % & (f) List\_entry. . . .
506 % & (f) Subcaption. \\
507 % \cmd{\subfigure}[List\_entry.][~]\{\dots fig\dots\}
508 % & (g) List\_entry. . . .
509 % & (g) \\ \hline
510 % \end{tabular}
511 % \endgroup
512 % \vspace{-8pt}
513 % \end{table}
514 %
515 % If you wish to reference a specific subfigure or subtable, you can
516 % include a |\label| inside the body of either the \meta{subcaption} or
517 % \meta{figure} argument to the command (but not the \meta{list\_entry}
518 % argument). If supplied by itself, the \meta{subcaption} is a ``moving
519 % argument''\footnote{See \cite[\textsection~4.7 and
520 % \textsection~C.1.3]{Lamp94} for a more detailed description of
521 % ``moving arguments'' and ``fragile'' commands.} and, therefore, any
522 % ``fragile'' commands contained within it must be |\protect|'ed. If
523 % the \meta{list\_entry} argument is supplied, then the
524 % \meta{subcaption} is not a ``moving argument''; however, the
525 % \meta{list\_entry} is.
526 %
527 % {\bf Note:} since the |\subfigure| and |\subtable| commands have optional
528 % arguments, delimited with square brackets, before their required argument,
529 % you cannot use the `]' character at the top level of either the
530 % \meta{subcaption} or \meta{list\_entry} argument. To overcome this
531 % problem, you must wrap the portion of the text containing the `]'
532 % character (or the entire argument), in a pair of curly brackets (see
533 % \cite[\textsection~C.1.1]{Lamp94} for more detail). For example:
534 %
535 % \begin{verbatim}
536 % \subfigure[This does not $sqrt[3]{8}$ work.]{... figure text ...}
537 % \subfigure[This works {$sqrt[3]{8}$} fine.]{... figure text ...}
538 % \subfigure[{This also works $sqrt[3]{8}$ fine.}]{... figure text ...}
539 % \end{verbatim}
540 %
541 % One final note, the |\subfigure| and |\subtable| commands are
542 % actually identical and it is the surrounding environment that defines
543 % actually identical and it is the surrounding environment that defines
544 % whether a subtable or subfigure will be generated and not which command
545 % is used. At the user level, the choice of names is purely cosmetic
546 % (and historical). Therefore you can use |\subfigure| for any float
547 % ({\it e.g.\/}, \Lenv{figure}, \Lenv{table}, or other) environment.
548 %
549 % \subsection{Format Options}
550 % \label{sec:format}
551 %
552 % There are six options for formatting the layout of the caption label
553 % and text. The first is \Lopt{normal}, which produces the style shown
554 % in figure~\ref{fig:format-01}. The other options may be used in
555 % various combinations to produce the layouts shown in
556 % figures~\ref{fig:format-02} thru \ref{fig:format-14}. Note that some
557 % combinations, like \Lopt{center} and \Lopt{centerlast} do not make
558 % sense since \Lopt{center} overrides \Lopt{centerlast}. Also,
559 % \Lopt{nooneline}, when combined with either \Lopt{center} or
560 % \Lopt{centerlast} has no effect (unless the \Lopt{hang} option is
561 % also set); and, \Lopt{raggedright} overrides both \Lopt{center} and
562 % \Lopt{centerlast}.
563 %
564 % \begingroup
565 % \def\sc{Short.}
566 % \def\lc{This is a long caption of gibberish: Aafas d taed
567 % gaihgghn adf irin sadf aets etsd na.}
568 % \def\b{\fboxsep=-\fboxrule
569 % \fbox{\hbox to 2.0in{\vbox to 2mm{\vfil\null}\hfil}}}
570 % \def\g{\hspace{.5in}}
571 % \subfigtopskip=20pt
572 % \subfigcapskip=-3pt
573 % \subfigbottomskip=0pt
574 % \abovecaptionskip=5pt
575 % \begin{figure}^
576 % \centering
577 % \turnofflistentry
578 % \subcaphangfalse
579 % \subcapcenterfalse
580 % \subcapcenterlastfalse
581 % \subcapnoonelinefalse
582 % \subcapraggedrightfalse
583 % \subfigure[\sc]{\b}\g\subfigure[\lc]{\b}\\
584 % \caption{Format option [\Lopt{normal}].}^
585 % \label{fig:format-01}^
586 % \subcapnoonelinetrue
587 % \subfigure[][\sc]{\b}\g\subfigure[][\lc]{\b}\\
588 % \caption{Format option [\Lopt{nooneline}].}^
589 % \label{fig:format-02}^
590 % \subcapcenterlasttrue
591 % \subcapnoonelinefalse
592 % \subfigure[][\sc]{\b}\g\subfigure[][\lc]{\b}\\
593 % \caption{Format option [\Lopt{centerlast}]; \Lopt{centerlast} overrides
594 % \Lopt{nooneline}.\footnotemark}
595 % \label{fig:format-03}^
596 % \subcapcentertrue
597 % \subcapcenterlastfalse
598 % \subfigure[][\sc]{\b}\g\subfigure[][\lc]{\b}\\
599 % \caption{Format option [\Lopt{center}]; \Lopt{center} overrides
600 % \Lopt{nooneline} and \Lopt{centerlast}.}^
601 % \label{fig:format-04}^
602 % \subcaphangtrue
603 % \subcapcenterfalse
604 % \subfigure[][\sc]{\b}\g\subfigure[][\lc]{\b}\\
605 % \caption{Format option [\Lopt{hang}].}
606 % \label{fig:format-05}
607 % \subcapnoonelinetrue
608 % \subfigure[][\sc]{\b}\g\subfigure[][\lc]{\b}\\
609 % \caption{Format options [\Lopt{hang},\Lopt{nooneline}].}
610 % \label{fig:format-06}
611 % \subcapcenterlasttrue
612 % \subcapnoonelinefalse
613 % \subfigure[][\sc]{\b}\g\subfigure[][\lc]{\b}\\
614 % \caption{\Lpack{Subfigure}\ format options [\Lopt{hang},^
615 % \Lopt{centerlast}].}
616 % \label{fig:format-07}
617 % \vspace{2\baselineskip}
618 % \begin{minipage}{\linewidth}
619 % \footnotetext{\raise1ex\hbox to 0pt{\hss\tiny\thefootnote}^
620 % So this is the same as [\Lopt{centerlast},\Lopt{nooneline}]. Only
621 % the shortest number of options to achieve an effect is shown.
622 % Adding any combination of overridden options has no effect.}
623 % \end{minipage}
624 % \end{figure}
625 %
626 % \begin{figure}
627 % \turnofflistentry
628 % \centering
629 % \subcaphangtrue
630 % \subcapcenterfalse
631 % \subcapcenterlasttrue
632 % \subcapnoonelinetrue
633 % \subcapraggedrightfalse
634 % \subfigure[][\sc]{\label{fig:format-08A}\b}\g\subfigure[][\lc]{\b}\\
635 % \caption{Format options [\Lopt{hang},\Lopt{centerlast},\Lopt{nooneline}].}
636 % \label{fig:format-08}
637 % \subcapcentertrue
638 % \subcapcenterlastfalse
639 % \subcapnoonelinefalse
640 % \subfigure[][\sc]{\b}\g\subfigure[][\lc]{\b}\\
641 % \caption{Format options [\Lopt{hang},\Lopt{center}];
642 % \Lopt{center} overrides \Lopt{centerlast}.}
643 % \label{fig:format-09}
644 % \subcapnoonelinetrue
645 % \subfigure[][\sc]{\label{fig:format-10A}\b}\g\subfigure[][\lc]{\b}\\
646 % \caption{Format options [\Lopt{hang},\Lopt{center},\Lopt{nooneline}];
647 % \Lopt{center} overrides \Lopt{centerlast}.}
648 % \label{fig:format-10}
649 % \subcaphangfalse
650 % \subcapcenterfalse
651 % \subcapnoonelinefalse
652 % \subcapraggedrighttrue
653 % \subfigure[][\sc]{\b}\g\subfigure[][\lc]{\b}\\
654 % \caption{Format option [\Lopt{raggedright}];
655 % \Lopt{raggedright} overrides \Lopt{center} and \Lopt{centerlast}.}
656 % \label{fig:format-11}
657 % \subcapnoonelinetrue
658 % \subfigure[][\sc]{\b}\g\subfigure[][\lc]{\b}\\
659 % \caption{Format options [\Lopt{raggedright},\Lopt{noonelirne}];
660 % \Lopt{raggedright} overrides \Lopt{center} and \Lopt{centerlast}.}
661 % \label{fig:format-12}
662 % \subcaphangtrue
663 % \subcapnoonelinefalse
664 % \subfigure[][\sc]{\b}\g\subfigure[][\lc]{\b}\\
665 % \caption{Format options [\Lopt{hang},\Lopt{raggedright}];
666 % \Lopt{raggedright} overrides \Lopt{center} and \Lopt{centerlast}.}
667 % \label{fig:format-13}
668 % \subcapnoonelinetrue
669 % \subfigure[][\sc]{\label{fig:format-14A}\b}\g\subfigure[][\lc]{\b}\\
670 % \caption{\Lpack{Subfigure}\ format options [\Lopt{hang},\Lopt{raggedright},
671 % \Lopt{nooneline}]; \Lopt{raggedright} overrides \Lopt{center}
672 % and \Lopt{centerlast}.}
673 % \label{fig:format-14}
674 % \end{figure}
675 % \endgroup
676 %
677 % \addtocontents{lof}{^
678 % \string\contentsline
679 % {figure}
680 % {\numberline{\ref{fig:format-01}--\ref{fig:format-14}}^
681 % {\ignorespaces \Lpack{Subfigure}\ format options.}}^
682 % {\pageref{fig:format-01}--\pageref{fig:format-14}}}
683 %
684 % \subsection{Font Size and Style Options}
685 % \label{sec:font}
686 %
687 % There are twenty-four options for setting the font of the subcaption.
688 % The first six set the size of both the subcaption label and text.
689 % They are: \Lopt{scriptsize}, \Lopt{footnotesize} (default),
690 % \Lopt{small}, \Lopt{normalsize}, \Lopt{large}, and \Lopt{Large}.
691 % Their effect is shown in figure~\ref{fig:font1}.
692 %
693 % The next nine, \Lopt{rm}: \Lopt{sf}, \Lopt{tt}, \Lopt{md}, \Lopt{bf},
694 % \Lopt{up}, \Lopt{it}, \Lopt{sl}, and \Lopt{sc}, set the family, series
695 % or shape of the subcaption label, as shown in
696 % figures~\ref{fig:font2A}--~\ref{fig:font2I}. The last nine:
697 % \Lopt{RM}, \Lopt{SF}, \Lopt{TT}, \Lopt{MD}, \Lopt{BF}, \Lopt{UP},
698 % \Lopt{IT}, \Lopt{SL}, and \Lopt{SC}, do the same for the text of the
699 % subcaption, as shown in figure~\ref{fig:font2J}--\ref{fig:font2R}.
700 % These size and style options may be combined in 3456 ways to set the
701 % label and text of the subcaption (as long as the selected font
702 % combination exists\@!) The font family for the text and label may be
703 % set as roman (\Lopt{rm}/\Lopt{RM}), sans serif (\Lopt{sf}/\Lopt{SF}),
704 % and typewriter (\Lopt{tt}/\Lopt{TT}). These may be combined with
705 % those for the font series, medium (\Lopt{md}/\Lopt{MD}) and bold
706 % (\Lopt{bf}/\Lopt{BF}); and the font shape, upright
707 % (\Lopt{up}/\Lopt{UP}), italic (\Lopt{it}/\Lopt{IT}), slanted
708 % (\Lopt{sl}/\Lopt{SL}), and small caps (\Lopt{sc}/\Lopt{SC}).
709 %
710 % \begin{figure}^
711 % \def\b{\fboxsep=-\fboxrule
712 % \fbox{\hbox to 2.0in{\vbox to 2mm{\vfil\null}\hfil}}}^
713 % \subfigtopskip=8pt^
714 % \subfigcapskip=0pt^
715 % \subfigbottomskip=4pt^
716 % \centering
717 % {\renewcommand{\subcapsize}{\scriptsize}^
718 % \subfigure[][Font option {[scriptsize]}.]{\b}}\qquad
719 % {\renewcommand{\subcapsize}{\footnotesize}^
720 % \subfigure[][Font option {[footnotesize]}.]{\b}}\\
721 % {\renewcommand{\subcapsize}{\small}^
722 % \subfigure[][Font option {[small]}.]{\b}}\qquad
723 % {\renewcommand{\subcapsize}{\normalsize}^
724 % \subfigure[][Font option {[normalsize]}.]{\b}}\\
725 % {\renewcommand{\subcapsize}{\large}^
726 % \subfigure[][Font option {[large]}.]{\b}}\qquad
727 % {\renewcommand{\subcapsize}{\Large}^
728 % \subfigure[][Font option {[Large]}.]{\b}}%
729 % \caption[\Lpack{Subfigure} font size options.]{%
730 % \Lpack{Subfigure} font size options. (Default:
731 % \Lopt{footnotesize}).}^
732 % \label{fig:font1}^
733 % \end{figure}
734 %
735 % \begin{figure}^
736 % \def\b{\fboxsep=-\fboxrule
737 % \fbox{\hbox to 2.0in{\vbox to 2mm{\vfil\null}\hfil}}}^
738 % \subfigtopskip=8pt^
739 % \subfigcapskip=0pt^
740 % \subfigbottomskip=4pt^
741 % \centering
742 % \begin{minipage}{2.0in}^
743 % {\renewcommand{\subcaplabelfont}{\rmfamily}^
744 % \subfigure[][Subcaption label font option {[\Lopt{rm}]}.]{\b^
745 % \label{fig:font2A}}}\\
746 % {\renewcommand{\subcaplabelfont}{\sffamily}^
747 % \subfigure[][Subcaption label font option {[\Lopt{sf}]}.]{\b}}\\
748 % {\renewcommand{\subcaplabelfont}{\ttfamily}^
749 % \subfigure[][Subcaption label font option {[\Lopt{tt}]}.]{\b}}\\
750 % {\renewcommand{\subcaplabelfont}{\mdseries}^
751 % \subfigure[][Subcaption label font option {[\Lopt{md}]}.]{\b}}\\
752 % {\renewcommand{\subcaplabelfont}{\bfseries}^
753 % \subfigure[][Subcaption label font option {[\Lopt{bf}]}.]{\b}}\\
754 % {\renewcommand{\subcaplabelfont}{\upshape}^
755 % \subfigure[][Subcaption label font option {[\Lopt{up}]}.]{\b}}\\
756 % {\renewcommand{\subcaplabelfont}{\itshape}^
757 % \subfigure[][Subcaption label font option {[\Lopt{it}]}.]{\b}}\\
758 % {\renewcommand{\subcaplabelfont}{\slshape}^
759 % \subfigure[][Subcaption label font option {[\Lopt{sl}]}.]{\b}}\\
760 % {\renewcommand{\subcaplabelfont}{\scshape}^
761 % \subfigure[][Subcaption label font option {[\Lopt{sc}]}.]{^
762 % \label{fig:font2I}\b}}\\
763 % \end{minipage}^
764 % \qquad
765 % \begin{minipage}{2.0in}^
766 % {\renewcommand{\subcapfont}{\rmfamily}^
767 % \subfigure[][Subcaption font option {[\Lopt{RM}]}.]{^
768 % \label{fig:font2J}\b}}\\
769 % {\renewcommand{\subcapfont}{\sffamily}^
770 % \subfigure[][Subcaption font option {[\Lopt{SF}]}.]{\b}}\\
771 % {\renewcommand{\subcapfont}{\ttfamily}^
772 % \subfigure[][Subcaption font option {[\Lopt{TT}]}.]{\b}}\\
773 % {\renewcommand{\subcapfont}{\mdseries}^
774 % \subfigure[][Subcaption font option {[\Lopt{MD}]}.]{\b}}\\
775 % {\renewcommand{\subcapfont}{\bfseries}^
776 % \subfigure[][Subcaption font option {[\Lopt{BF}]}.]{\b}}\\
777 % {\renewcommand{\subcapfont}{\upshape}^
778 % \subfigure[][Subcaption font option {[\Lopt{UP}]}.]{\b}}\\
779 % {\renewcommand{\subcapfont}{\itshape}^
780 % \subfigure[][Subcaption font option {[\Lopt{IT}]}.]{\b}}\\
781 % {\renewcommand{\subcapfont}{\slshape}^
782 % \subfigure[][Subcaption font option {[\Lopt{SL}]}.]{\b}}\\
783 % {\renewcommand{\subcapfont}{\scshape}^
784 % \subfigure[][Subcaption font option {[\Lopt{SC}]}.]{^
785 % \label{fig:font2R}\b}}^
786 % \end{minipage}^
787 % \caption[\Lpack{Subfigure} font style options.]{%
788 % \Lpack{Subfigure} font style options. (Default:
789 % \Lopt{rm,md,up,RM,MD,UP}). Note: The above single options
790 % are loaded after the default settings and multiple options are
791 % allowed, see the text, section~\ref{sec:font}.}^
792 % \label{fig:font2}^
793 % \end{figure}
794 %
795 % \subsection{Caption Position Options}
796 % \enlargethispage{12pt}^finalhack
797 % \label{sec:position}
798 %
799 % There are eight options that control the {\em position\/} of the
800 % subcaption and how the subcaption {\em numbering\/} is related to the
801 % ``containing'' figure or table's caption. The following shows only
802 % the subfigure-related options, but the subtable options are symmetric.
803 %
804 % The first option, \Lopt{figbotcap} tells the subfigure command that
805 % the ``containing'' figure's |\caption| occurs {\bf after} the
806 % subfigures. This information is needed to decide if the current
807 % figure counter shows the number for the last figure (\Lopt{figbotcap})
808 % or for the current one (\Lopt{figtopcap}, see below).
809 %
810 % The second option, \Lopt{figtopcap} tells the subfigure command that
811 % the ``containing'' figure's |\caption| occurs {\bf before} the
812 % subfigures. The subcaption is automatically placed below the figure
813 % for each of these options.
814 %
815 % The third option, \Lopt{FIGBOTCAP}, is similar to \Lopt{figbotcap},
816 % except that it also forces the subcaption to be placed under the
817 % figure. This is the default setting for figures (and \Lopt{TABBOTCAP}
818 % for tables) and is shown in figure~\ref{fig:position1}.
819 %
820 % The fourth option, \Lopt{FIGTOPCAP}, is similar to \Lopt{figtopcap},
821 % except that it forces the subcaption to be placed above the figure
822 % box. (While not the default, it is the preferred format for tables,
823 % which uses the option \Lopt{TABTOPCAP}\@.) An example of this option
824 % is shown in figure~\ref{fig:position2}. Note that the baseline of the
825 % subfigure is along the top of the two subfigures. See
826 % section~\ref{sec:custom-position} for another way of positioning the
827 % caption when captions are placed above the figure or table.
828 %
829 % \begin{figure}^
830 % \subfigtopskip=8pt^
831 % \subfigcapskip=0pt^
832 % \subfigbottomskip=4pt^
833 % \abovecaptionskip=5pt^
834 % \centering
835 % \subfigure[First caption.]{^
836 % \fbox{\hbox to 1.5in{\vbox to 15mm{\vfil\null}\hfil}}}^
837 % \hspace{0.2in}^
838 % \subfigure[Second long, long, long, long, long, long, caption.]{^
839 % \fbox{\hbox to 1.5in{\vbox to 10mm{\vfil\null}\hfil}}}^
840 % \caption{Subcaption position option [\Lopt{FIGBOTCAP}].}
841 % \label{fig:position1}^
842 % \end{figure}
843 %
844 % \begin{figure}^
845 % \subfigtopskip=8pt^
846 % \subfigcapskip=0pt^
847 % \subfigbottomskip=0pt^
848 % \belowcaptionskip=5pt^
849 % \caption{Subcaption position option: [\Lopt{FIGTOPCAP}].}^
850 % \label{fig:position2}^
851 % \centering
852 % \figuretopcaptrue
853 % \subfiguretopcaptrue
854 % \subfigure[First caption.]{^
855 % \fbox{\hbox to 1.5in{\vbox to 15mm{\vfil\null}\hfil}}}^
856 % \hspace{0.2in}^
857 % \subfigure[Second long, long, long, long, long, long caption.]{^
858 % \fbox{\hbox to 1.5in{\vbox to 10mm{\vfil\null}\hfil}}}^
859 % \setcounter{subfigure}{0}^
860 % \vspace{-18pt}
861 % \end{figure}
862 %
863 % \subsection{Recent Changes and Backward Compatibility}
864 % \enlargethispage{24pt}^finalhack
865 % \label{sec:back-compat}
866 %
867 % There are some significant changes in this version of the
868 % \Lpack{subfigure} package. One of them was to pack the subfigure
869 % tighter together by removing the space at the top of the subfigure at
870 % the beginning of a page, or minipage, and to reduce the spacing around
871 % the subfigure, see table~\ref{tab:spacing}. If you have been using an
872 % older version of the \Lpack{subfigure} package ({\it i.e.\/}, version
873 % 2.0 or eariler) than the default (\Lopt{loose}) setting will not cause
874 % any change in your existing documents.\footnote{If you have been using
875 % a beta release version of \Lpack{subfigure} 2.1, than you will need to
876 % use the \Lopt{tight} option in order to maintain the ``look-and-feel''
877 % that you are used to.}
878 %
879 % If you want to use the new and preferred, \Lopt{tight} option, your
880 % subfigures will take up less space and should provide a more balanced
881 % visual appearance for your paper.
882 %
883 % The second significant change is the ability to make the text on the
884 % List-of-Figures page different than that in the subcaption. The use
885 % of a second optional argument to the |\subfigure| command is shown in
886 % table~\ref{tab:calling}. This should not cause any compatibility
887 % problems.
888 %
889 % The third significant change is the it is now possible to have the
890 % captions and subcaptions come before or after the corresponding
891 % figure/table portion. While the default settings support the old view
892 % of the subcaptions following the figure/table and, in turn, followed
893 % by the main caption. The preferred format is for figures to retain
894 % that layout and for tables to have both their subcaption and main
895 % captions come before the table portion. This preferred setting may be
896 % specified by adding the option \Lopt{TABTOPCAP} when loading the
897 % \Lpack{subfigure} package.
898 %
899 % The fourth update is that the font style options have been generalized
900 % so that an option from each of the family, series and shape, may be
901 % combined, as long as that combination exists; and you can set the font
902 % of the label and text separately. In addition, the the |\space| that
903 % separated the label from the text in the subcaption has been replaced
904 % with a horizontal skip of |\subfiglabelskip| which has the default
905 % value of |0.33em plus 0.07em minus 0.03em|. This extension should not
906 % cause any compatibility problems.
907 %
908 % The last major change is that there is now a |\subref| command that
909 % allows a reference to the subfigure without the figure number. An
910 % example of the use of this command is shown later in
911 % section~\ref{sec:ex3}. Associated with this change is that the
912 % |\label| command will accept an optional argument, for use with the
913 % \Lpack{hyperref} package, when used within the scope of the
914 % |\subfigure| or |\subtable|, see section~\ref{sec:hyperref} for details.
915 %
916 % \DeleteShortVerb{\|}
917 % \MakeShortVerb{\/}
918 % \begin{table}^
919 % \def\pz{\phantom{0}}^
920 % \centering
921 % \caption{\Lpack{Subfigure} spacing changes.}^
922 % \label{tab:spacing}^
923 % \vspace{4pt}^
924 % \begin{tabular}{|l|c|c|c|} \hline
925 % \multicolumn{1}{|c|}{\bf{\Lpack{subfigure}}}
926 % & \multicolumn{1}{c|}{{\bf Old (v2.0)}}
927 % & \multicolumn{1}{c|}{\bf\Lopt{loose}}
928 % & \multicolumn{1}{c|}{\bf\Lopt{tight}} \\
929 % \multicolumn{1}{|c|}{{\bf Constant}}
930 % & \multicolumn{1}{c|}{{\bf Value}}
931 % & \multicolumn{1}{c|}{{\bf Option}}
932 % & \multicolumn{1}{c|}{{\bf Option}}
933 % \\ \hline
934 % /\subfigtopskip/ & 10 pt & 10 pt & 5 pt \\
935 % /\subfigcapskip/ & 10 pt & 10 pt & 0 pt \\
936 % /\subfigcaptopadj/ & | &\pz0 pt & 3 pt \\
937 % /\subfigbottomskip/ & 10 pt & 10 pt & 5 pt \\
938 % /\subfigcapmargin/ & 10 pt & 10 pt & 0 pt \\
939 % /\subfiglabelskip/ & | & 0.33 em &
940 % \vtop{\hbox to 1.2in{0.33 em plus 0.07 em}
941 % \hbox to 1.2in{\hfill minus 0.03 em}}
942 % \\[8pt] \hline
943 % \end{tabular}^
944 % \end{table}
945 % \DeleteShortVerb{\/}
946 % \MakeShortVerb{\|}
947 %
948 % The \Lpack{subfigure} package checks for and loads a configuration
949 % file called \Lfile{subfigure.cfg} which is placed anywhere that \LaTeX\
950 % will look for classes or packages (see
951 % section~\ref{sec:customization}). By default, the \Lfile{subfigure.sty}
952 % file tries to look unchanged from older versions. In order to
953 % have it automatically use the preferred settings, you can add a
954 % configuration file containing the options \Lopt{tight} to reduce the
955 % extra whitespace around the subfigures and \Lopt{TABTOPCAP} to show
956 % that table captions will come before the table and the the subcaptions
957 % for tables should be set above the subtable. The following line is all
958 % you need in your configuration file:
959 %
960 % \iffalse
961 %<*newconf>
962 % \fi
963 % \begin{macrocode}
964 \ExecuteOptions{tight,TABTOPCAP}
965 % \end{macrocode}
966 % \iffalse
967 %</newconf>
968 % \fi
969 %
970 % You could also load the subfigure package with the options with the
971 % following in your \LaTeX\ preamble:
972 % \begin{quote}
973 % |\usepackage[tight,TABTOPCAP]{subfigure}|
974 % \end{quote}
975 %
976 % \subsection{Frequently Asked Questions}
977 % \label{sec:faq}
978 %
979 % The four most frequently asked questions about the \Lpack{subfigure}
980 % package are:
981 %
982 % \begin{enumerate}
983 % \item ``My subfigures are not aligned along their bottoms. Why?''
984 %
985 % Remember! The \Lpack{subfigure} package aligns subfigure along
986 % their baselines with the subcaption (if any) sticking out above or
987 % below. The above problem is usually due to using a \Lenv{minipage},
988 % \Lenv{tabular} or \Lenv{array} environment that, by default,
989 % places the baseline at the center of the box that it generates.
990 % If the two subfigures are different sizes, or if one subfigure is
991 % generated in some other way with its baseline not at the expected
992 % place (perhaps an |\includegraphics|), then the subfigures will be
993 % misaligned. One solution is to use the environment options `[t]'
994 % or `[b]' to move the baseline to the top or bottom rather than the
995 % center.
996 %
997 % \item ``How can I get my figures/subfigures to line up the way I want?''
998 %
999 % A similar question, but this one is caused by extra whitespace in
1000 % the source text generating spaces next to the figures, and |\par|'s
1001 % generated by blanklines. The main thing is {\it be aware\/} that
1002 % extra whitespace can move figures and subfigures around, sometimes
1003 % a lot and sometimes just a little so that they look ``wrong''.
1004 % Placing too many `\%'s at the end of the lines is better than too
1005 % few in the figure and table environments. (See the discussion of
1006 % ``white space'' in section~\ref{sec:examples}.)
1007 %
1008 % \item ``I have too many subfigures for one page, How can I spread
1009 % them over two or more pages and continue the numbering?''
1010 % \begin{description}
1011 % \item[Option 1:] Adjust the \Lcount{figure} and \Lcount{subfigure}
1012 % counters (or the \Lcount{table} and
1013 % \Lcount{subtable} counters) as needed before and
1014 % after each figure (or table) See, for example
1015 % \emph{Using Imported Graphics in \LaTeXe}
1016 % \cite[\textsection~30]{Reck97}.
1017 % \item[Option 2:] Use the \Lpack{ccaption} package by Peter Wilson
1018 % \cite{Wils01}.
1019 % \item[Option 3:] Use the simpler \Lpack{captcont} package by
1020 % Steven Cochran \cite{Coch02}.
1021 % \end{description}
1022 % All of these options work well. Of the packages, the
1023 % \Lpack{ccaption} package is bigger and offers more control over
1024 % what is done (and things to do) at the expense of being a little
1025 % harder to use. The \Lpack{captcont} package is easier to use,
1026 % but only provides for continued floats.
1027 % \newpage^finalhack
1028 % \item ``Why do I get a garbled caption or an error when I use
1029 % square brackets?''
1030 % \vspace{-2pt}
1031 % \begin{verbatim}
1032 % \subfigure[SHIFT: ``register[3] $<<=$ 3;'']{... figure text ...}
1033 % \end{verbatim}
1034 % \vspace{-12pt}
1035 % Since the |\subfigure| and |\subtable| commands have optional
1036 % arguments, delimited with square brackets, before their required
1037 % argument, you cannot use the `]' character at the top level of
1038 % either the \meta{subcaption} or \meta{list\_entry} argument. To
1039 % overcome this problem, you must wrap all or the portion of the text
1040 % containing the `]' character, in a pair of curly brackets
1041 % (see \cite[\textsection~C.1.1]{Lamp94} for more detail). For example:
1042 % \begin{verbatim}
1043 % \subfigure[SHIFT: ``register{[3]} $<<=$ 3;'']{... figure text ...}
1044 % \end{verbatim}
1045 % \vspace{-16pt}
1046 % \noindent
1047 % or
1048 % \vspace{-4pt}
1049 % \begin{verbatim}
1050 % \subfigure[{SHIFT: ``register[3] $<<=$ 3;''}]{... figure text ...}.
1051 % \end{verbatim}
1052 % \vspace{-12pt}
1053 % \end{enumerate}
1054 %
1055 % \section{Three Examples}
1056 % \label{sec:examples}
1057 %
1058 % The easiest way to show the use of this package is to give a few
1059 % examples. The two most important things to remember when working
1060 % with the \Lpack{subfigure} package are that (1) the subfigures are
1061 % aligned along their baselines (see figure~\ref{fig:layout} and
1062 % section~\ref{sec:customlayout}) and (2) that whitespace in the
1063 % \Lenv{figure} environment are significant and affect the layout.
1064 %
1065 % The baseline of the subfigure is usually at the bottom of the
1066 % subfigure or (when the subcaption appears at the top) at the bottom of
1067 % the subcaption {\em and\/} the |\subfigcapskip| space---which is usually
1068 % the same as the top of the subfigure. However sometimes, especially
1069 % when using the \Lenv{tabular}, \Lenv{array}, or \Lenv{minipage}
1070 % environments to build the figure, the baseline appears elsewhere. The
1071 % above environments are all aligned at their center by default but that
1072 % may be changed with the optional `{\bf [t]}' or `{\bf [b]}' arguments.
1073 % As a last resort you can wrap all of your figures in a |\vtop| box with
1074 % a |\vbox to 0pt{\null}| at the top followed by the figure.
1075 %
1076 % If your figure is not quite centered or where you want it to be, the
1077 % problem is often a space character being placed to one side or the
1078 % other of the figure. Some general rules of thumb are:\footnote{See
1079 % chapters 7 and 8 of ``The \TeX book'' \cite{Knut86} for details.}
1080 % \begin{itemize}\itemsep0pt
1081 % \item Two end-of-lines following each other (ignoring any
1082 % whitespace) are turned into a |\par| or paragraph break.
1083 % \item Multiple whitespace (including the end-of-line) are
1084 % compressed into a single space.
1085 % \item The spaces after a macro command name ({\it e.g.\/}, |\foo|)
1086 % are ignored.
1087 % \item A `\%' character at the end of the line suppresses the
1088 % end-of-line and all of the spaces (if any) at the
1089 % beginning of the next line.
1090 % \end{itemize}
1091 %
1092 % To suppress significant extra whitespace, you can add some `\%'
1093 % characters at the end of each line that doesn't end with a command name.
1094 % This is more than is required, but extra `\%' usually don't cause a
1095 % problem.
1096 %
1097 % The other case where things are not correctly centered is when the
1098 % subfigure uses only the label for the subcaption. This is often the
1099 % case when the description for each subfigure is given in the figure
1100 % caption rather than in each subcaption. In this case, the default
1101 % label has the form `(a)\ \ ' where the trailing space is defined by
1102 % |\subfiglabelskip|. In this case the style should redefine this space
1103 % as `0pt' so that the label is perfectly centered (see
1104 % section~\ref{sec:ex3}, below for an example).
1105 %
1106 % \subsection{A Simple Example}
1107 % \enlargethispage{12pt}
1108 %
1109 % The first example, shown in figure~\ref{3figs}, specifies |\centering|
1110 % \DescribeMacro{\subfigure}
1111 % to horizontally center the set of subfigures, and uses |\\| and
1112 % some horizontal space (using |\qquad|) to control the placement of
1113 % the subfigures. Note that the alignment of the top two subfigures
1114 % is along the bottom of the figure portion of each.
1115 %
1116 % \begin{figure}^
1117 % \centering
1118 % \fboxsep=-\fboxrule
1119 % \fbox{^
1120 % \begin{minipage}{4.0in}^
1121 % \vspace{10pt}^
1122 % \centering
1123 % \begin{minipage}{3.5in}^
1124 % \subfigtopskip=3pt^
1125 % \subfigcapskip=-2pt^
1126 % \subfigbottomskip=5pt^
1127 % \subfigcapmargin=3pt^
1128 % \abovecaptionskip=5pt^
1129 % \centering
1130 % \subfigure[First.]{^
1131 % \fbox{\hbox to 20mm{\vbox to 15mm{\vfil\null}\hfil}}}\qquad
1132 % \subfigure[Second figure.]{^
1133 % \fbox{\hbox to 20mm{\vbox to 10mm{\vfil\null}\hfil}}}\\[6pt]
1134 % \subfigure[Third.]{\label{3figs-c}^
1135 % \fbox{\hbox to 20mm{\vbox to 10mm{\vfil\null}\hfil}}}\\
1136 % \caption{Three subfigures.}^
1137 % \label{3figs}^
1138 % \rr
1139 % \vspace{15pt}^
1140 % Figure~\ref{3figs} contains two top `subfigures' and
1141 % figure~\ref{3figs-c}.$\!$\footnotemark
1142 % \end{minipage}^
1143 % \vspace{4pt}^
1144 % \end{minipage}}
1145 % \vspace{-5pt}^
1146 % \end{figure}
1147 % \footnotetext{In this and later boxed figures, the boxes are intended to
1148 % represent a portion of the page in which the figure occurs. This is
1149 % usually to show the figure along with some text or to show the effect
1150 % of some option on multiple pages.}
1151 %
1152 % \begin{verbatim}
1153 % \begin{figure}%
1154 % \centering
1155 % \subfigure[First.]{...}\qquad
1156 % \subfigure[Second figure.]{...}\\
1157 % \subfigure[Third.]{\label{3figs-c}...}%
1158 % \caption{Three subfigures.}
1159 % \label{3figs}
1160 % \end{figure}
1161 % ...
1162 % Figure~\ref{3figs} contains two top `subfigures' and
1163 % figure~\ref{3figs-c}.
1164 % \end{verbatim}
1165 %
1166 % \subsection{A More Advanced Example}
1167 %
1168 % A second example, shown in figure~\ref{fig:ex2}, demonstrates how to
1169 % change the subfigure labels and have the subfigure captions printed in
1170 % the List-of-Figures.
1171 %
1172 % The first |\renewcommand| changes the reference to |\thesubfigure| to
1173 % return both the figure number and the subfigure number separated with
1174 % a period. The next two |\renewcommand|'s turn off the |\p@subfigure|
1175 % (since it is now included in |\thesubfigure| and adds the colon and
1176 % space to the subfigure label. Later in the file, the
1177 % \Lcount{lofdepth} is set to ``2'' so allow the subfigure captions to
1178 % show and the |\listoffigures| is loaded. Finally, the \Lenv{figure}
1179 % is defined and a little following text is given that refers to it.
1180 %
1181 % \begin{verbatim}
1182 % \renewcommand{\thesubfigure}{\thefigure.\arabic{subfigure}}
1183 % \makeatletter
1184 % \renewcommand{\p@subfigure}{}
1185 % \renewcommand{\@thesubfigure}{\thesubfigure:\hskip\subfiglabelskip}
1186 % \makeatother
1187 % ...
1188 % \setcounter{lofdepth}{2}
1189 % \listoffigures
1190 % ...
1191 % \begin{figure}%
1192 % \centering
1193 % \subfigure[First.]{%
1194 % \label{fig:first}%
1195 % ...}%
1196 % \qquad
1197 % \subfigure[Second.]{%
1198 % \label{fig:second}%
1199 % ...}%
1200 % \caption{Two subfigures.}
1201 % \end{figure}
1202 % ...
1203 % See figures~\ref{fig:first} and \ref{fig:second}.
1204 % \end{verbatim}%
1205 %
1206 % \begin{figure}^
1207 % \centering
1208 % \fboxsep=-\fboxrule
1209 % \renewcommand{\thesubfigure}{\thefigure.\arabic{subfigure}}^
1210 % \makeatletter
1211 % \renewcommand{\p@subfigure}{}^
1212 % \renewcommand{\@thesubfigure}{\thesubfigure:\hskip\subfiglabelskip}^
1213 % \makeatother
1214 % \fbox{^
1215 % \begin{minipage}{4.0in}^
1216 % \centering
1217 % \begin{minipage}{3.5in}^
1218 % \setcounter{lofdepth}{2}^
1219 % \vspace{.1in}^
1220 % \section*{ List of Figures}^
1221 % \vspace{-15pt}^
1222 % \hspace{40pt}\dots
1223 % \vspace{3pt}^
1224 % \contentsline{figure}{\numberline{\ref{fig:ex2}}^
1225 % {\ignorespaces Two subfigures.}}{\pageref{fig:ex2}}^
1226 % \contentsline{subfigure}{\numberline{\ref{fig:first}}^
1227 % {\ignorespaces First.}}{\pageref{fig:first}}^
1228 % \contentsline{subfigure}{\numberline{\ref{fig:second}}^
1229 % {\ignorespaces Second.}}{\pageref{fig:second}}^
1230 % \hspace{40pt}\dots
1231 % \vspace{8pt}^
1232 % \end{minipage}^
1233 % \end{minipage}}\\
1234 % \fbox{^
1235 % \begin{minipage}{4.0in}^
1236 % \centering
1237 % \begin{minipage}{3.5in}^
1238 % \subfigtopskip=3pt^
1239 % \subfigcapskip=-2pt^
1240 % \abovecaptionskip=5pt^
1241 % \vspace{10pt}^
1242 % \centering
1243 % \subfigure[First.]{^
1244 % \label{fig:first}^
1245 % \fbox{\hbox to 22mm{\vbox to 15mm{\vfil\null}\hfil}}}^
1246 % \hspace{14pt}^
1247 % \subfigure[Second.]{^
1248 % \label{fig:second}^
1249 % \fbox{\hbox to 22mm{\vbox to 15mm{\vfil\null}\hfil}}}\\
1250 % \caption{Two subfigures.}^
1251 % \label{fig:ex2}^
1252 % \rr
1253 % \vspace{15pt}^
1254 % See figures~\ref{fig:first} and \ref{fig:second}.
1255 % \vspace{4pt}^
1256 % \end{minipage}^
1257 % \end{minipage}}^
1258 % \vspace{-8pt}
1259 % \end{figure}
1260 % \vspace{-12pt}^finalhack
1261 %
1262 % \subsection{An Example Without Subcaption Text}
1263 % \label{sec:ex3}
1264 %
1265 % The last example, shown in figure~\ref{fig:ex3}, demonstrates a
1266 % \DescribeMacro{\subref}
1267 % \DescribeMacro{\Subref}
1268 % \enlargethispage{12pt}
1269 % commonly required format where the subfigure are just labeled and the
1270 % description occurs in the main caption. This is easy to do by using
1271 % the ``empty'' optional caption arguments ``[\space ][\space ]''. This
1272 % creates a label for the subfigure in the text, but it does not show on
1273 % the List-of-Figures page. However, by default the caption may not be
1274 % perfectly centered, so |\subfiglabelskip| is reduced to zero points to
1275 % ensure that there is not any extra space hidden in the subcaption. To
1276 % refer to the subfigure label within the text or the main caption, you
1277 % can use the |\subref| command, which is similar to the |\ref| command,
1278 % but does not carry the figure number. (The |\Subref| command is the
1279 % same but sets it with |\subcaplabelfont|).
1280 %
1281 % \begin{figure}^
1282 % \centering
1283 % \fboxsep=-\fboxrule
1284 % \subfiglabelskip=0pt
1285 % \fbox{^
1286 % \begin{minipage}{4.0in}^
1287 % \centering
1288 % \begin{minipage}{3.5in}^
1289 % \setcounter{lofdepth}{2}^
1290 % \vspace{.1in}^
1291 % \section*{ List of Figures}^
1292 % \vspace{-15pt}^
1293 % \hspace{40pt}\dots
1294 % \vspace{3pt}^
1295 % \contentsline{figure}{\numberline{\ref{fig:ex3}}^
1296 % {\ignorespaces A set of four subfigures.}}^
1297 % {\pageref{fig:ex3}}^
1298 % \hspace{40pt}\dots
1299 % \vspace{8pt}^
1300 % \end{minipage}^
1301 % \end{minipage}}\\
1302 % \fbox{^
1303 % \begin{minipage}{4.0in}^
1304 % \centering
1305 % \begin{minipage}{3.5in}^
1306 % \subfigtopskip=3pt^
1307 % \subfigcapskip=-2pt^
1308 % \subfigbottomskip=3pt^
1309 % \abovecaptionskip=5pt^
1310 % \vspace{7pt}^
1311 % \centering
1312 % \makeatletter
1313 % \subfigure[][]{^
1314 % \label{fig:ex3-a}^
1315 % \fbox{\hbox to 1.2in{\vbox to 15mm{\null\vfil}\hfil}}}%
1316 % \hspace{8pt}%
1317 % \subfigure[][]{^
1318 % \label{fig:ex3-b}^
1319 % \fbox{\hbox to 1.2in{\vbox to 15mm{\null\vfil}\hfil}}}\\
1320 % \subfigure[][]{^
1321 % \label{fig:ex3-c}^
1322 % \fbox{\hbox to 1.2in{\vbox to 15mm{\null\vfil}\hfil}}}%
1323 % \hspace{8pt}%
1324 % \subfigure[][]{^
1325 % \label{fig:ex3-d}^
1326 % \fbox{\hbox to 1.2in{\vbox to 15mm{\null\vfil}\hfil}}}%
1327 % \caption[A set of four subfigures.]{A set of four subfigures:
1328 % \subref{fig:ex3-a} describes the first subfigure;
1329 % \subref{fig:ex3-b} describes the second subfigure;
1330 % \subref{fig:ex3-c} describes the third subfigure; and,
1331 % \subref{fig:ex3-d} describes the last subfigure.}^
1332 % \label{fig:ex3}^
1333 % \rr
1334 % \vspace{15pt}^
1335 % The text references the main figure as figure~\ref{fig:ex3}
1336 % or part of it as figures~\ref{fig:ex3-a}--\subref{fig:ex3-c}.
1337 % \vspace{4pt}^
1338 % \end{minipage}^
1339 % \end{minipage}}^
1340 % \vspace{-12pt}
1341 % \end{figure}
1342 %
1343 % \enlargethispage{12pt}
1344 % \begin{verbatim}
1345 % \subfiglabelskip=0pt
1346 % ...
1347 % \listoffigures
1348 % ...
1349 % \begin{figure}%
1350 % \centering
1351 % \subfigure[][]{%
1352 % \label{fig:ex3-a}%
1353 % ...figure code...}%
1354 % \hspace{8pt}%
1355 % \subfigure[][]{%
1356 % \label{fig:ex3-b}%
1357 % ...figure code...}\\
1358 % \subfigure[][]{%
1359 % \label{fig:ex3-c}%
1360 % ...figure code...}%
1361 % \hspace{8pt}%
1362 % \subfigure[][]{%
1363 % \label{fig:ex3-d}%
1364 % ...figure code...}%
1365 % \caption[A set of four subfigures.]{A set of four subfigures:
1366 % \subref{fig:ex3-a} describes the first subfigure;
1367 % \subref{fig:ex3-b} describes the second subfigure;
1368 % \subref{fig:ex3-c} describes the third subfigure; and,
1369 % \subref{fig:ex3-d} describes the last subfigure.}%
1370 % \label{fig:ex3}%
1371 % \end{figure}
1372 % ...
1373 % The text references the main figure as figure~\ref{fig:ex3} or part
1374 % of it as figures~\ref{fig:ex3-a}--\subref{fig:ex3-c}.
1375 % \end{verbatim}%
1376 %
1377 % \section{Customization}
1378 % \label{sec:customization}
1379 %
1380 % The following sections describe the internal parameters used by the
1381 % \Lpack{subfigure} package to define the layout of the subfigures
1382 % or tables, as well as the labels and captions the accompany them.
1383 % In addition, adjustments to the entries on a ``List-of'' page and
1384 % the addition of new \Lenv{float} environments are described.
1385 %
1386 % Adjusting these values allows extensive customization of the
1387 % \Lpack{subfigure} package. If you want to customize the package, an
1388 % alternative to actually changing the code is to create a a file called
1389 % \Lfile{subfigure.cfg} and place it anywhere that \LaTeX\ will look for
1390 % classes or packages. Any changes placed in the file will affect the
1391 % predefined parameters and you can override the default settings. Any
1392 % user options will be processed after this file is loaded.
1393 %
1394 % In order to change the major commands in the \Lpack{subfigure} package
1395 % with this configure file, you will need to use the |\AtEndOfPackage|
1396 % command to defer that portion of your changes until the end of the
1397 % package.
1398 %
1399 % \subsection{Changing the Layout}
1400 % \enlargethispage{15pt}^finalhack
1401 % \label{sec:customlayout}
1402 %
1403 % \noindent
1404 % The layout of the |\subfigure| or |\subtable| is defined by several
1405 % internal values which may be changed to customize appearance of the
1406 % object. The following illustration shows the relationship of these
1407 % values. Figure~\ref{fig:layout-A} shows the standard layout with the
1408 % caption following the figure. The figure is vertically centered with
1409 % |\subfigtopskip| of space added above, then |\subfigcapskip| of
1410 % space is added below the figure followed by the subcaption and,
1411 % finally, |\subfigbottomskip| of space added at the bottom. The baseline
1412 % is located at the bottom of the figure. It is along this baseline that
1413 % adjacent subfigure boxes are aligned. Figure~\ref{fig:layout-C} shows
1414 % the case where the caption precedes the figure ({\it ie.\/},
1415 % |\subfiguretopcaptrue| or |\subtabletopcaptrue|). In this case the
1416 % various boxes and glue are reversed,$\!$\footnote{The \cmd{\subfigtopskip}
1417 % and \cmd{\subfigbottomskip} actually follow the \Lif{figuretopcap}
1418 % and \Lif{tabletopcap} flags, so that the actual top spacing used is
1419 % \cmd{\subfigtopskip} when the flags are {\bf false} and
1420 % \cmd{\subfigbottomskip} when they are {\bf true}.}
1421 % except that the |\subfigcapskip| is increased by |\subfigcaptopadj|.
1422 % The other two cases, figures~\ref{fig:layout-B} and
1423 % \subref{fig:layout-D}, show the cases where there is no caption. Note
1424 % that the |\subfigcapskip| is left out when there is no caption.
1425 % Note also, for all of these cases, that the space at the top of the
1426 % subfigure is automatically removed for items that are the first box
1427 % in a vertical list or other than the first box in a horizontal list.
1428 % This allows tighter packing of the subfigures and the full use of
1429 % the page or \Lenv{minipage}.
1430 %
1431 % Each of these values |\subfigtopskip|, |\subfigcapskip|, and
1432 % |\subfigbottomskip|; as well as |\subfigcapmargin| and
1433 % |\subfiglabelskip| (the latter not shown in figure~\ref{fig:layout})
1434 % may be changed from their defaults (see
1435 % table~{\PrintIfDefined{tab:defaults}{\ref{tab:defaults}}{\ref{tab:spacing}}})
1436 % to adjust the subfigure for the current layout style. In addition,
1437 % they may all assume negative values, which in some cases may solve
1438 % problems with the layout. Even though these constants are ``skips'',
1439 % only the last two (|\subfigcapmargin| and |\subfiglabelskip|) will
1440 % shrink or expand since the others assume their natural size in the
1441 % subfigure box and are fixed at that size.
1442 %
1443 % \begin{figure}[p]
1444 % \subfigtopskip=10pt^
1445 % \subfigcapskip=4pt^
1446 % \subfigbottomskip=12pt^
1447 % \abovecaptionskip=3pt^
1448 % \centering
1449 % \fboxsep=-\fboxrule
1450 % \newbox{\tempbox}
1451 % \newdimen{\tempdima}
1452 % \newdimen{\tempdimb}
1453 % \setbox\tempbox\hbox{
1454 % $\stackrel{\longleftrightarrow}{\cs{subfigcapmargin}}$}
1455 % \setbox\tempbox\hbox{\cs{subfigcapmargin}}
1456 % \tempdimb \wd\tempbox
1457 % \setbox\tempbox\hbox to \tempdimb{^
1458 % \kern -.5mm\hbox{$\leftarrow$}\kern -.5mm^
1459 % \leaders\hrule width1pt height2.6pt depth-2.2pt\hfill
1460 % \kern -.13mm$\rightarrow$}
1461 % \tempdima \wd\tempbox
1462 % \advance\tempdima 1mm
1463 % \tempdimb \tempdima
1464 % \multiply\tempdimb -2
1465 % \advance\tempdimb 4.5in
1466 % \advance\tempdimb -4mm
1467 % \subfigure[Standard layout {[FIGBOTCAP] or [TABBOTCAP]}.]{
1468 % \label{fig:layout-A}
1469 % \fbox{\parbox{4.5in}{
1470 % \vspace{1pt}
1471 % \hbox to 4.5in{
1472 % \hspace{1.5in}
1473 % $\left\updownarrow\vrule width0pt height11pt depth1pt\right.$
1474 % (\cs{subfigtopskip})
1475 % \hfil}
1476 % \fbox{\vbox to 45pt{
1477 % \vskip1pt
1478 % \vskip\baselineskip
1479 % \vfil
1480 % \hbox to 4.5in{
1481 % \hfil
1482 % {\scshape subfigure} or {\scshape subtable}
1483 % \hfil}
1484 % \vfil
1485 % \vbox to 0pt{%
1486 % \vss
1487 % \hbox to 4.5in{
1488 % \hspace{9pt}
1489 % {\small Baseline}
1490 % \hfil}}
1491 % \vspace{1pt}}}
1492 % \hbox to 4.5in{
1493 % \hspace{1.5in}
1494 % $\left\updownarrow\vrule width0pt height11pt depth1pt\right.$
1495 % \cs{subfigcapskip}
1496 % \hfil}
1497 % \hbox to 4.5in{
1498 % \hbox to\tempdima{
1499 % \vbox to 20pt{
1500 % \vfil
1501 % \copy\tempbox
1502 % \vfil
1503 % \hbox{\kern .5mm\cs{subfigcapmargin}}
1504 % \vfil}}
1505 % \fbox{\vbox to 20pt{
1506 % \vfil
1507 % \hbox to\tempdimb{
1508 % \hfil
1509 % {\scshape subcaption}
1510 % \hfil}
1511 % \vfil}}
1512 % \hbox to\tempdima{
1513 % \vbox to 20pt{
1514 % \vfil
1515 % \copy\tempbox
1516 % \vfil
1517 % \hbox{\kern .5mm\cs{subfigcapmargin}}
1518 % \vfil}}
1519 % \hfill}
1520 % \hbox to 4.5in{
1521 % \hspace{1.5in}
1522 % $\left\updownarrow\vrule width0pt height11pt depth1pt\right.$
1523 % \cs{subfigbottomskip}
1524 % \hfil}}}}
1525 %
1526 % \subfigure[Standard layout {[FIGBOTCAP] or [TABBOTCAP]} with no
1527 % caption present.]{
1528 % \label{fig:layout-B}
1529 % \fbox{\parbox{4.5in}{
1530 % \vspace{1pt}
1531 % \hbox to 4.5in{
1532 % \hspace{1.5in}
1533 % $\left\updownarrow\vrule width0pt height11pt depth1pt\right.$
1534 % (\cs{subfigtopskip})
1535 % \hfil}
1536 % \fbox{\vbox to 45pt{
1537 % \vskip1pt
1538 % \vskip\baselineskip
1539 % \vfil
1540 % \hbox to 4.5in{
1541 % \hfil
1542 % {\scshape subfigure} or {\scshape subtable}
1543 % \hfil}
1544 % \vfil
1545 % \hbox to 4.5in{
1546 % \hspace{9pt}
1547 % {\small Baseline}
1548 % \hfil}
1549 % \vspace{1pt}}}
1550 % \hbox to 4.5in{
1551 % \hspace{1.5in}
1552 % $\left\updownarrow\vrule width0pt height11pt depth1pt\right.$
1553 % \cs{subfigbottomskip}
1554 % \hfil}}}}
1555 %
1556 % \subfigure[Reversed layout {[FIGTOPCAP] or [TABTOPCAP]}.]{
1557 % \label{fig:layout-C}
1558 % \fbox{\parbox{4.5in}{
1559 % \vspace{1pt}
1560 % \hbox to 4.5in{
1561 % \hspace{1.5in}
1562 % $\left\updownarrow\vrule width0pt height11pt depth1pt\right.$
1563 % (\cs{subfigbottomskip})
1564 % \hfil}
1565 % \hbox to 4.5in{
1566 % \hbox to\tempdima{
1567 % \vbox to 20pt{
1568 % \vfil
1569 % \copy\tempbox
1570 % \vfil
1571 % \hbox{\kern -.5mm\cs{subfigcapmargin}}
1572 % \vfil}}
1573 % \fbox{\vbox to 20pt{
1574 % \vfil
1575 % \hbox to\tempdimb{
1576 % \hfil
1577 % {\scshape subcaption}
1578 % \hfil}
1579 % \vfil}}
1580 % \hbox to\tempdima{
1581 % \vbox to 20pt{
1582 % \vfil
1583 % \box\tempbox
1584 % \vfil
1585 % \hbox{\kern -.5mm\cs{subfigcapmargin}}
1586 % \vfil}}
1587 % \hfill}
1588 % \hbox to 4.5in{
1589 % \hbox to 0pt{
1590 % \hspace{9pt}
1591 % \smash{\raisebox{-6.5pt}{\small Baseline}}
1592 % \hss}
1593 % \hspace{1.5in}
1594 % $\left\updownarrow\vrule width0pt height11pt depth1pt\right.$
1595 % \cs{subfigcapskip}$+$\cs{subfigcaptopadj}
1596 % \hfil}
1597 % \fbox{\vbox to 45pt{
1598 % \vfil
1599 % \hbox to 4.5in{
1600 % \hfil
1601 % {\scshape subfigure} or {\scshape subtable}
1602 % \hfil}
1603 % \vfil}}
1604 % \hbox to 4.5in{
1605 % \hspace{1.5in}
1606 % $\left\updownarrow\vrule width0pt height11pt depth1pt\right.$
1607 % \cs{subfigtopskip}
1608 % \hfil}}}}
1609 %
1610 % \subfigure[Reversed layout {[FIGTOPCAP] or [TABTOPCAP]} with no
1611 % caption present.]{
1612 % \label{fig:layout-D}
1613 % \fbox{\parbox{4.5in}{
1614 % \vspace{1pt}
1615 % \hbox to 4.5in{
1616 % \hbox to 0pt{
1617 % \hspace{9pt}
1618 % \smash{\raisebox{-6.5pt}{\small Baseline}}
1619 % \hss}
1620 % \hspace{1.5in}
1621 % $\left\updownarrow\vrule width0pt height11pt depth1pt\right.$
1622 % (\cs{subfigbottomskip})
1623 % \hfil}
1624 % \fbox{\vbox to 45pt{
1625 % \vfil
1626 % \hbox to 4.5in{
1627 % \hfil
1628 % {\scshape subfigure} or {\scshape subtable}
1629 % \hfil}
1630 % \vfil}}
1631 % \hbox to 4.5in{
1632 % \hspace{1.5in}
1633 % $\left\updownarrow\vrule width0pt height11pt depth1pt\right.$
1634 % \cs{subfigtopskip}
1635 % \hfil}}}}
1636 % \caption{Subfigure and subtable layout.}
1637 % \label{fig:layout}
1638 % \end{figure}
1639 %
1640 % \subsection{Adjusting the Subcaption}
1641 % \label{sec:customlabel}
1642 %
1643 % The subfigure label has three forms. The first is the one that
1644 % \DescribeMacro{\subref}
1645 % \DescribeMacro{\Subref}
1646 % appears in the text when you use the |\ref| command; the second is the
1647 % one that appears on the List-of-Figures page and may be used to
1648 % reference individual subfigures within the figure and subfigure captions,
1649 % using the |\subref| or |\Subref| commands; and the third is the fully
1650 % formatted version used under the subfigure as the label part of the caption.
1651 %
1652 % The |\ref| command yields the string, saved by the |\label| command,
1653 % composed by concatenating the value of |\p@subfigure| to
1654 % |\thesubfigure|. By default these are defined by: ``|\thefigure|''
1655 % and ``|(\alph{subfigure})|'', respectively, which produces a reference
1656 % of the figure number followed by the subfigure letter in parentheses.
1657 %
1658 % The label used on the List-of-Figures page may be retrieved with the
1659 % |\subref| command (this value is saved by the |\label| command when
1660 % the |\label| command is used within the scope of the subfigure. This is
1661 % the string defined by |\@@thesubfigure|, which, by default, is the
1662 % value ``|\thesubfigure|'' (or ``|(\alph{subfigure})|'').
1663 %
1664 % The label used with the subcaption text is defined by the internal
1665 % value |\@thesubfigure|, which, by default, has the
1666 % value\hfil\null\linebreak
1667 % \centerline{``\cmd{\thesubfigure}\cmd{\hskip}\cmd{\subfiglabelskip}''.}
1668 % It is prefixed by |\subcapsize\subcaplabelfont| and followed by the
1669 % subcaption text which is set with |\subcapfont|.
1670 %
1671 % \changes{v2.1.4}{30 Apr 2002}{Changed the label and caption defaults
1672 % from \cmd{\rmfamily}\cmd{\mdseries}\cmd{\upshape} to
1673 % \cmd{\familydefault}\cmd{\seriesdefault} \cmd{\shapedefault}.}
1674 % Note that by default |\subcaplabelfont| has the default value
1675 % ``|{\familydefault| |\seriesdefault\shapedefault}|''. The package
1676 % options described in table~\ref{tab:options} allow you to set these
1677 % values for your paper. If you update the |\@subfigure| command, you
1678 % should include any separator character or spacing between the label
1679 % and the start of the subcaption text. The default is
1680 % |\hskip\subfiglabelskip| placed after the label.
1681 %
1682 % Finally, the text of the subcaption is prefixed by |\subcapfont| which
1683 % may be changed using the set of nine lower-case font options described
1684 % in table~\ref{tab:options}\@.$\!$\footnote{It is also prefixed by
1685 % \cmd{\subcapsize} as part of the overall label and caption.} \ One other
1686 % way of changing the layout of the lapel and caption is by replacing
1687 % the |\@makesubfigurecaption| or |\@makesubtablecaption| command (which
1688 % by default are identical).
1689 %
1690 % \subsection{Adjusting the Subfigure and Subtable Counters}
1691 % \label{sec:counters}
1692 %
1693 % To create some special effects, such as continuing the subfigure
1694 % \DescribeMacro{\c@figure}
1695 % \DescribeMacro{\c@table}
1696 % numbering across several pages as part of one long continued figure,
1697 % you can back off the number change from a caption with the command:
1698 % \begin{quote}
1699 % |\addtocounter{|\Lcount{figure}|}{|-1|}|
1700 % \end{quote}
1701 % within the \Lenv{figure} environment. In addition, you can adjust for
1702 % previous subfigures or subtables with one of the following (here
1703 % we assume that two subfigures or subtables appeared in the previous
1704 % pages:
1705 % \begin{quote}
1706 % |\addtocounter{|\Lcount{subfigure}|}{|2|}|
1707 % \end{quote}
1708 % \vspace{-5pt}
1709 % \noindent
1710 % or
1711 % \vspace{-5pt}
1712 % \begin{quote}
1713 % |\addtocounter{|\Lcount{subtable}|}{|2|}|.
1714 % \end{quote}
1715 %
1716 % Two other things that may be necessary, if you switch between figures
1717 % and tables in the same \Lenv{figure} environment ({\it e.g.\/}, by
1718 % changing |\@captype|, see section~\ref{sec:float_env}), is to add the
1719 % command |\listsubcaptions| following the last subfigure when the
1720 % subfigure is using the \Lopt{TOPCAP} or \Lopt{topcap} option. This is
1721 % necessary to flush the list of subcaptions before the next
1722 % \Lenv{subfigure} or \Lenv{subtable}. This also may be necessary if
1723 % you switch between |\figuretopcaptrue| and |\figuretopcapfalse|. The
1724 % other thing that may be required in some cases, is to reset the
1725 % subfigure counter by entering:
1726 % \begin{quote}
1727 % |\setcounter{|\Lcount{subfigure}|}{|0|}|
1728 % \end{quote}
1729 % \noindent
1730 % This should only be necessary if you are dynamically switching between
1731 % different \Lpack{subfigure} options, or changing the |\@captype|,
1732 % within a float environment.
1733 %
1734 % \subsection{Modifying the List-of-Figures and List-of-Tables}
1735 % \label{sec:listof}
1736 %
1737 % To generate a List-of-Figures, or List-of-Tables, page you need to
1738 % \DescribeMacro{\l@subfigure}
1739 % \DescribeMacro{\@dottedxxxline}
1740 % add a |\listoffigures| or |\listoftables| command where
1741 % you want the list to appear. These
1742 % commands also cause the appropriate captions and subcaptions to be
1743 % written to a file with the extensions \Lfile{lof} (\Lfile{lot}). If
1744 % you want the subcaption text to appear in the List-of-Figures or
1745 % List-of-Tables page, you need to change the value of the counter
1746 % \Lcount{lofdepth} (\Lcount{lotdepth}) counter from its default of `1'.
1747 % For example, to have the \Lpack{subfigure} subcaptions to appear on
1748 % the List-of-Figures, add the following to the preamble of your
1749 % paper:
1750 % \begin{quote}
1751 % |\setcounter{|\Lcount{lofdepth}|}{2}|
1752 % \end{quote}
1753 %
1754 % If you want to change how the subcaption appears on the ``List-of''
1755 % pages you can change its format by redefining the |\l@subfigure|
1756 % or |\l@subtable| command. Usually you will want to use the
1757 % |\@dottedxxxline| command
1758 % \PrintIfDefined{sec:dl}{(section~\ref{sec:dl},
1759 % page~\pageref{sec:dl})\space}{} to help with the formatting. For
1760 % instance the default value of |\l@subfigure| is:
1761 %
1762 % \begin{verbatim}
1763 % \newcommand{\l@subfigure}{%
1764 % \@dottedxxxline{\ext@subfigure}{2}{3.8em}{2.5em}}
1765 % \end{verbatim}
1766 % \vspace{-10pt}
1767 %
1768 % \noindent
1769 % The arguments of the |\@dottedxxxline| command are:
1770 % \begin{quote}
1771 % \begin{enumerate}
1772 % \itemsep -\parsep
1773 % \item \underline{\smash{\textsf{Type}}}. The usual values are
1774 % : \Lfile{lof} or \Lfile{lot}. The internal
1775 % values |\ext@subfigure| and |\ext@subtable| stand for
1776 % these extensions.
1777 % \item \underline{\textsf{Level}}. By default this is `2'
1778 % for the \Lcount{subfigure} and \Lcount{subtable}. If the level
1779 % is greater than \Lcount{\meta{Type}depth} (where
1780 % \underline{\smash{\meta{Type}}} is the first argument, above),
1781 % then no line is produced.
1782 % \item \underline{\textsf{Indent}}. Total indentation
1783 % from the left margin.
1784 % \item \underline{\textsf{Numwidth}}. Width of box for the
1785 % label number if the \underline{\textsf{Title}} has a
1786 % |\numberline| command. This is also the amount of extra
1787 % indentation added to second and later lines of a multiple
1788 % line entry.
1789 % \item \underline{\textsf{Title}}. Contents of entry ({\it e.g.\/} the
1790 % \meta{list\_entry} or \meta{subcaption}).
1791 % \item \underline{\smash{\textsf{Page}}}. The page number of the
1792 % figure or table.
1793 % \end{enumerate}
1794 % \end{quote}
1795 %
1796 % \noindent
1797 % The final two arguments, \underline{\textsf{title}} and
1798 % \underline{\smash{\textsf{page}}}, are automatically appended to the
1799 % value of |\l@subfigure| (and symmetrically for |\l@subtable|).
1800 %
1801 % For example, to change the amount of space reserved for the label
1802 % (if, for instance, you have a lot of figures and the and you need extra
1803 % space for the figure number) you could widen the
1804 % \texttt{2.5em} space for the label to \texttt{4.0em}:
1805 % \begin{verbatim}
1806 % \makeatletter
1807 % \renewcommand{\l@subfigure}{%
1808 % \@dottedxxxline{\ext@subfigure}{2}{3.8em}{4.0em}}
1809 % \makeatother
1810 % \end{verbatim}
1811 %
1812 % \subsection{Aligning Captions Above the Figure}
1813 % \label{sec:custom-position}
1814 %
1815 % \begin{figure}^
1816 % \figuretopcaptrue
1817 % \subfigtopskip=-5pt^
1818 % \subfigcapskip=-3pt^
1819 % \subfigbottomskip=2pt^
1820 % \centering
1821 % \caption{Caption position option: [\Lopt{figtopcap}] with changing
1822 % settings of \cmd{\subfiguretopcap}.}^
1823 % \label{fig:position3}^
1824 % \subfiguretopcapfalse
1825 % \subfigure[First caption.]{\hbox to 1.5in{\hfil\null}}^
1826 % \hspace{0.2in}^
1827 % \subfigure[Second long, long, long, long,
1828 % long, long, long, long caption.]{^
1829 % \hbox to 1.5in{\hfil\null}}\\[5pt]
1830 % \subfiguretopcaptrue
1831 % \subfigure{\fbox{\hbox to 1.5in{\vbox to 15mm{\vfil\null}\hfil}}}^
1832 % \hspace{0.2in}^
1833 % \subfigure{\fbox{\hbox to 1.5in{\vbox to 10mm{\vfil\null}\hfil}}}^
1834 % \setcounter{subfigure}{0}
1835 % \end{figure}
1836 %
1837 % \noindent
1838 % For unbalanced sets of captions placed, above the figures or tables,
1839 % \DescribeMacro{\subfiguretopcaptrue}
1840 % \DescribeMacro{\subfiguretopcapfalse}
1841 % \DescribeMacro{\figuretopcaptrue}
1842 % the caption portion looks unbalanced, such as the ones in
1843 % figure~\ref{fig:position2}. If you prefer to have the caption portion
1844 % aligned along the top rather than the bottom, as shown in
1845 % figure~\ref{fig:position3}, you can use the
1846 % \Lopt{figtopcap} option as in figure~\ref{fig:position2}, but use
1847 % two ``empty'' subfigures to position the captions followed by
1848 % two more containing the figures, but without captions. The code
1849 % to produce this example is:
1850 %
1851 % \begin{verbatim}
1852 % \begin{figure}%
1853 % \centering
1854 % \caption{Caption position option: [\Lopt{figtopcap}] with changing
1855 % settings of \subfiguretopcap.}%
1856 % \label{fig:position3}%
1857 % \subfiguretopcapfalse
1858 % \subfigure[First caption.]{\hbox to 1.5in{\hfil\null}}%
1859 % \hspace{0.2in}%
1860 % \subfigure[Second long, long, long, long,
1861 % long, long, long, long caption.]{%
1862 % \hbox to 1.5in{\hfil\null}}\\[5pt]
1863 % \subfiguretopcaptrue
1864 % \subfigure{\fbox{\hbox to 1.5in{\vbox to 15mm{\vfil\null}\hfil}}}%
1865 % \hspace{0.2in}%
1866 % \subfigure{\fbox{\hbox to 1.5in{\vbox to 10mm{\vfil\null}\hfil}}}%
1867 % \end{figure}
1868 % \end{verbatim}
1869 %
1870 % This example makes use of one of the four flags that control how the
1871 % caption labels are numbered and where the subcaption appears. Two are
1872 % for |\subfigure| and two for |\subtable|. The first of each set tell
1873 % the |\subfigure| or |\subtable| command that the related main caption
1874 % appears before or after the set of subfloats. |\figuretopcaptrue| and
1875 % |\tabletopcaptrue| indicate that the caption appears before and
1876 % |\figureotopcapfalse| and |\tabletopcapfalse| indicate that the it
1877 % appears after. The other two flags force the subcaption to be placed
1878 % before (|\subfiguretopcaptrue| and |\subtabletopcaptrue|) or after the
1879 % actual subfigure or subtable (|\subfiguretopcapfalse| and
1880 % |\subtabletopcapfalse|).
1881 %
1882 % There are two difficulties with this approach, first, you need to keep
1883 % changing the setting of |\subfiguretopcap|, and second, if you have
1884 % more than one row of subfigures or subtables, then you will need to
1885 % fiddle with the counter (see section~\ref{sec:counters} to keep the
1886 % numbers straight. The reason that this format is not supported by the
1887 % \Lpack{subfigure} package is that you need information about all of
1888 % the subfigure or subtables on a row to box the figures correctly and
1889 % this information is not available locally.
1890 %
1891 % \subsection{Adding Subfloats to New Environments}
1892 % \enlargethispage{15pt}^finalhack
1893 % \label{sec:customfloat}
1894 %
1895 % It is easy to add a \Lenv{subfloat} command to a new environment. For
1896 % instance, let us assume we have a new \Lenv{float}
1897 % environment\footnote{For information on creating new float
1898 % environments, see any of the following: \cite{Lamp01}, \cite{Wils01}
1899 % or \cite{Ling01}.} called ``\Lenv{map}'' in which various maps are
1900 % displayed and for which a List-of-Maps is to be generated in the
1901 % contents section. If we wanted to have \Lenv{submaps}, then we could
1902 % define the following:
1903 %
1904 % \vspace{-4pt}
1905 % \begin{verbatim}
1906 % \makeatletter
1907 % \newcounter{submap}[map]
1908 % \newif\ifmaptopcap
1909 % \newif\ifsubmaptopcap
1910 % \newcommand{\p@submap}{\themap}
1911 % \newcommand{\thesubmap}{(\alph{submap})}
1912 % \newcommand{\@thesubmap}{\themap\hskip\subfiglabelskip}
1913 % \newcommand{\@@thesubmap}{\themap}
1914 % \newcommand{\ext@submap}{\ext@map}
1915 % \newcommand{\l@submap}{\@dottedxxxline{\ext@submap}{2}{3.8em}{2.5em}}
1916 % \newcounter{lomdepth}
1917 % \setcounter{lomdepth}{1}
1918 % \newcommand{\submap}{\subfigure}
1919 % \newcommand{\@makesubmapcaption}{\@makesubfigurecaption}
1920 % \ifhyperrefloaded
1921 % \newcommand\theHsubmap{\themap.\arabic{submap}}
1922 % \newcommand{\toclevel@submap}{1}
1923 % \fi
1924 % \makeatother
1925 % \end{verbatim}
1926 % \vspace{-14pt}
1927 %
1928 % The first and last lines make the character `@' act like a letter
1929 % between them and therefore it may be part of a command name used there.
1930 % First a new counter for the \Lpack{submap} is created along with two
1931 % conditionals that define where the position ({\i.e.\/}, above or
1932 % below) of the main caption and subcaption is with respect to the
1933 % submap. Then the four commands that define the \Lpack{submap} label
1934 % are created. The first two, |\p@submap| and |\thesubmap| define the
1935 % standard label returned by |\ref|. The next, |\@thesubmap| gives the
1936 % label as shown under or over the submap with the subcaption and the
1937 % last, |\@@thesubmap| shows how the label is displayed on the List-of-Maps
1938 % and/or referenced with the |\subref| command.
1939 %
1940 % The next four lines show where and how to print to the List-of-Maps
1941 % page: |\ext@submap| gives the List-of-Maps file extension; |\l@submap|
1942 % shows how to print the submap line on the List-of-Maps page; and the last
1943 % two lines show how to create and set the counter \Lcount{lomdepth}, which
1944 % controls how many caption levels are shown on the page when it is printed.
1945 %
1946 % The next two lines create the |\submap| and |\@makesubmapcaption|
1947 % commands by making them the same as the |\subfigure| and
1948 % |\@makesubfigurecaption| commands.
1949 %
1950 % The last four lines conditionally create the |\theHsubmap| and
1951 % |\toclevel@submap| commands which are used by the \Lpack{hyperref}
1952 % Package to name the item and to control the presence of the item
1953 % bookmark.
1954 %
1955 % Of course, this is where the \Lpack{ccaption} package \cite{Wils01}
1956 % comes in handy since it will do all of the above with one command:
1957 %
1958 % \vspace{-4pt}
1959 % \begin{verbatim}
1960 % \newsubfloat{map}
1961 % \end{verbatim}
1962 % \vspace{-10pt}
1963 %
1964 %
1965 % \subsection{Interaction with Other Parts of \LaTeX}
1966 % In the following sections, the interaction of the \Lpack{subfigure}
1967 % package with other parts of \LaTeX\ is documented. These ``other
1968 % parts'' may be either part of the the \LaTeX\ base or contributed
1969 % packages or classes.
1970 %
1971 % \subsubsection{\TeX 's ``Mouth''}
1972 % The most important thing to remember when laying out your figures
1973 % within a \Lenv{float} environment is that spaces take room. If you
1974 % have an extra space between two figures, then they will be separated
1975 % by a little bit.
1976 %
1977 % \TeX 's state varies as it reads a line of text from a file. It
1978 % ignores some spaces and carriage-returns and converts others to
1979 % |\space|'s or |\par|'s. You can use a `|%|' to insure that you only
1980 % have real spaces where you want them. To understand which spaces
1981 % are significant, you should read chapters~7 and 8 of the \TeX book
1982 % \cite{Knut86}. However, the main source of unexpected
1983 % extra spacing is carriage-returns which are turned in to |\space|'s.
1984 % As a general rule: if in doubt, then add a `|%|' immediately after
1985 % the last significant character of the line.
1986 %
1987 % \subsubsection{The Float Environment}
1988 % \label{sec:float_env}
1989 %
1990 % Although the \Lpack{subfigure} package was designed to work within a
1991 % \Lenv{float} environment ({\it e.g.\/}, \Lenv{figure} or
1992 % \Lenv{table}), it can be used outside with the following two caveats:
1993 % \begin{enumerate}\itemsep=5pt
1994 % \item You need to define |\@captype|. This is usually either
1995 % \Lenv{figure} or \Lenv{table}. For example add the following
1996 % to the preamble of your document:
1997 % \begin{verbatim}
1998 % \makeatletter
1999 % \newcommand{\change_cap_type}[1]{%
2000 % \renewcommand{\@captype}{#1}}
2001 % \makeatother
2002 % \end{verbatim}\vspace{-15pt}
2003 % Then use the new command to switch in the middle of a given
2004 % \Lenv{float} environment, say from ``figure'' to ``table'' with
2005 % the command |\change_cap_type{table}|.
2006 % \item If you want to define references using |\label|, then you also
2007 % need to redefine the \LaTeX\ internal |\@currentlabel|. For
2008 % example:
2009 % \begin{verbatim}
2010 % \makeatletter
2011 % \edef\@currentlabel{\p@subfigure\thesubfigure}
2012 % \makeatother
2013 % \end{verbatim}\vspace{-15pt}
2014 % before using the |\label| command. NOTE: Many other commands change
2015 % |\@currentlabel|, including all of the ``section'' commands,
2016 % |\caption|, \Lenv{equation}'s, and \Lenv{theorem}'s.
2017 % \end{enumerate}
2018 %
2019 % \subsubsection{Interaction with Other Packages}
2020 %
2021 % \changes{v2.1}{22 Jan 2001}{Added \Lpack{ccaption} reference.}
2022 %
2023 % \changes{v2.1}{11 Oct 1996}{Revised subsubsection on use with
2024 % the caption package and extended this section to talk about the
2025 % \Lpack{captcont} package.}
2026 %
2027 % \noindent
2028 % The only packages that directly interact with the \Lpack{subfigure}
2029 % package are the \Lpack{caption}/\Lpack{caption2} packages by
2030 % H.A. Sommerfeldt \cite{Somm95a,Somm95b}, the \Lpack{ccaption} package
2031 % and \Lpack{tocloft} packages by Peter Wilson \cite{Wils01,Wils01B},
2032 % and the \Lpack{captcont} package by S.D. Cochran \cite{Coch02}.
2033 %
2034 % \paragraph{\Lpack{caption}}
2035 %
2036 % If you load the \Lpack{subfigure} package {\bf before} the
2037 % \Lpack{caption} package, then the \Lpack{caption} package will detect
2038 % that fact and will change the |\subcapsize| when the options
2039 % \Lopt{scriptsize}, \ldots, \Lopt{Large} are specified (overriding such
2040 % options used when loading the \Lpack{subfigure} package). In
2041 % addition, it redefines |\@thesubfigure| and |\@thesubtable| to use
2042 % |\captionlabelfont|. It also uses an older layout of
2043 % |\@thesubsubfigure| and |\@thesubtable|.
2044 %
2045 % The best plan is to load the \Lpack{caption} package {\bf before} the
2046 % \Lpack{subfigure} package. In addition, you should try to coordinate
2047 % the ``look and feel'' of the two packages. This limits you a little
2048 % since, although the two packages have similar options, the options in
2049 % the \Lpack{caption} package do not combine the same way. You can pick
2050 % one from each column:\par\null
2051 %
2052 % \DeleteShortVerb{\|}
2053 % \noindent\hfil\begin{tabular}{*{4}{p{17mm}|}p{17mm}}
2054 % \rr \Lopt{normal}, \Lopt{hang}, \Lopt{center}, \Lopt{centerlast} &
2055 % \rr \Lopt{nooneline} &
2056 % \rr \Lopt{scriptsize}, \Lopt{footnotesize}, \Lopt{small},
2057 % \Lopt{normalsize}, \Lopt{large}, \Lopt{Large} &
2058 % \rr \Lopt{up}, \Lopt{it}, \Lopt{sl}, \Lopt{sc}, \Lopt{md},
2059 % \Lopt{bf}, \Lopt{rm}, \Lopt{sf}, \Lopt{tt} &
2060 % \rr (Other options---see package.)
2061 % \end{tabular}
2062 % \MakeShortVerb{\|}
2063 % \vskip14pt
2064 %
2065 % \paragraph{\Lpack{caption2}}
2066 %
2067 % This package acts similarly to the \Lpack{caption} package. If you
2068 % specify the \Lopt{subfigure} it will try to support the subfigure
2069 % package, if you specify \Lopt{nosubfigure} than it will not. If
2070 % neither option is specified, than load order matters. If loaded
2071 % {\bf before} the \Lpack{subfigure} package, than it will not try to
2072 % support the package and if loaded {\bf after} it will.
2073 %
2074 % Again, the best plan is to load the \Lpack{caption2} package
2075 % {\bf before} the \Lpack{subfigure} package, and specify the
2076 % \Lopt{nosubfigure} option. In addition, you should try to coordinate
2077 % the ``look and feel'' of the two packages. This limits you a little
2078 % since, although the two packages have similar options, they are not
2079 % exactly the same; however, most of the good looking combinations are
2080 % easily available. You can pick one from each column:\par\null
2081 %
2082 % \DeleteShortVerb{\|}
2083 % \noindent\hfil\begin{tabular}{*{5}{p{17mm}|}p{17mm}}
2084 % \rr \Lopt{nosubfigure}, \Lopt{subfigure} &
2085 % \rr \Lopt{normal}, \Lopt{hang}, \Lopt{center}, \Lopt{centerlast}
2086 % \Lopt{flushleft}, \Lopt{indent} &
2087 % \rr \Lopt{oneline}, \Lopt{nooneline} &
2088 % \rr \Lopt{scriptsize}, \Lopt{footnotesize}, \Lopt{small},
2089 % \Lopt{normalsize}, \Lopt{large}, \Lopt{Large} &
2090 % \rr \Lopt{up}, \Lopt{it}, \Lopt{sl}, \Lopt{sc}, \Lopt{md},
2091 % \Lopt{bf}, \Lopt{rm}, \Lopt{sf}, \Lopt{tt}^,
2092 %^ \Lopt{UP}, \Lopt{IT}, \Lopt{SL}, \Lopt{SC}, \Lopt{MD},
2093 %^ \Lopt{BF}, \Lopt{RM}, \Lopt{SF}, \Lopt{TT}
2094 % &
2095 % \rr (Other options---see package.)
2096 % \end{tabular}
2097 % \MakeShortVerb{\|}
2098 %
2099 % \paragraph{\Lpack{ccaption}}
2100 %
2101 % The \Lpack{ccaption} package provides for all sorts of extensions and
2102 % style options for \Lenv{float} |\captions|. It also provides for the
2103 % use of the |\caption| command outside of a \Lenv{float} environment and
2104 % a mechanism for creating new types of \Lenv{float} environments.
2105 %
2106 % In order to use it with the \Lpack{subfigure} package, you need to
2107 % pass the \Lopt{subfigure} option when loading it:
2108 %
2109 % \begin{quote}
2110 % |\usepackage|[subfigure]\{ccaption\}
2111 % \end{quote}
2112 %
2113 % \paragraph{\Lpack{tocloft}}
2114 %
2115 % The \Lpack{tocloft} package gives the user the ability to easily
2116 % configure the ``List-of'' pages. It takes a \Lopt{subfigure} option
2117 % so it doesn't matter which package is loaded first.
2118 %
2119 % \begin{quote}
2120 % |\usepackage|[subfigure]\{tocloft\}
2121 % \end{quote}
2122 %
2123 % \paragraph{\Lpack{hyperref}}
2124 % \label{sec:hyperref}
2125 %
2126 % \changes{v2.1.2}{26 Mar 2002}{Improved coordination with the hyperref
2127 % package.}
2128 %
2129 % \changes{v2.1.1}{15 Mar 2002}{Added coordination with the hyperref
2130 % package. There is some interaction with the \cmd{label} command as
2131 % pointed out by [email protected].}
2132 %
2133 % The \Lpack{hyperref} package extends the functionality of all of the
2134 % \LaTeX\ cross-referencing commands to produce hypertext links. In
2135 % addition, it provides new commands to allow the user to insert
2136 % hypertext links. When used with the \Lpack{subfigure} package, they
2137 % may be loaded in any order; however, it might be better if the
2138 % \Lpack{subfigure} package is loaded {\bf first}.
2139 %
2140 % To more fully support the \Lpack{hyperref} package, the |\label|
2141 % \DescribeMacro{\subfloat@label}
2142 % command, when used within the scope of the |\subfigure| or |\subtable|
2143 % commands takes an optional argument (note the parentheses rather than
2144 % square brackets):
2145 % \vspace{-2pt}
2146 % \begin{quote}
2147 % |\label|\parg{bookmark}\marg{key}
2148 % \end{quote}
2149 % \vspace{-2pt}
2150 %
2151 % \noindent
2152 % We would like to use the subcaption as the bookmark text, but the
2153 % |\label| command is often processed before the subcaption. Therefore,
2154 % this optional argument may be used to supply this information if
2155 % desired. By default a bookmark field of the form
2156 % ``Subfigure\textvisiblespace 1(a)'' will be generated.
2157 % \footnote{If the document class is \Lpack{report} or other class that
2158 % defines \cmd{\thechapter}, than the default bookmark field will be of the
2159 % form ``Subfigure\textvisiblespace 1 \textvisiblespace 1(a)''.}
2160 %
2161 %
2162 % \paragraph{\Lpack{captcont}}
2163 %
2164 % This package may be used with or without the \Lpack{subfigure} package
2165 % \DescribeMacro{\caption}
2166 % \DescribeMacro{\caption*}
2167 % \DescribeMacro{\captcont}
2168 % \DescribeMacro{\captcont*}
2169 % to extend figure or table numbering across multiple pages. This
2170 % package knows about how the \Lpack{subfigure} package interacts with
2171 % the List-of-Figures and List-of-Tables and does the right thing when
2172 % used with \Lenv{subfigure}'s and \Lenv{subtable}'s.
2173 %
2174 % The \Lpack{captcont} package may be loaded either {\bf before} or
2175 % {\bf after} the \Lpack{subfigure} and it has four options:
2176 % \Lopt{figbotcap} or \Lopt{figtopcap} and \Lopt{tabbotcap} or
2177 % \Lopt{tabtopcap}. These are the same as the \Lpack{subfigure}
2178 % options. When the \Lpack{captcont} package is used with the
2179 % \Lpack{subfigure} package, only the \Lpack{subfigure} options matter.
2180 % Any given with the \Lpack{captcont} package are ignored.
2181 %
2182 % The thing to remember about the \Lpack{captcont} package is that if
2183 % you normally place the |\caption| {\bf before} your subfigures or
2184 % subtables ({\it i.e.\/}, \Lopt{figtopcap} or \Lopt{tabtopcap}
2185 % respectively), then you start a series of continued \Lenv{figure}'s
2186 % with the |\caption[*]| and use |\contcapt[*]| in each of the rest of
2187 % the figures. If you {\bf follow} your subfigures or subtables with a
2188 % caption ({\it i.e.\/}, \Lopt{figbotcap} or \Lopt{tabbotcap}
2189 % respectively), then you start the series with the |\contcapt[*]| in
2190 % the first \Lenv{figure} environment and all but the last where you use
2191 % the |\caption[*]|.
2192 %
2193 % \subsubsection{Creating a \Lenv{subfigure} Environment}
2194 %
2195 % \changes{v2.1.4}{24 Apr 2002}{Added \cmd{\label} command handling
2196 % example in the \Lenv{subfloat} environment, thanks to Lars Clausen.}
2197 %
2198 % Some people have wanted to use the \Lenv{verbatim} environment within
2199 % \DescribeEnv{subfloat}
2200 % the \cmd{\subfigure} command and run into the restriction that the
2201 % \Lenv{verbatim} environment cannot be nested. To include verbatim text in
2202 % a subfigure, you can define a new environment, in which verbatim
2203 % text may be enclosed, and which calls the \cmd{\subfigure} command.
2204 % \vspace{-2pt}
2205 % \begin{verbatim}
2206 % \newbox\subfigbox % Create a box to hold the subfigure.
2207 % \makeatletter
2208 % \newenvironment{subfloat}% % Create the new environment.
2209 % {\def\caption##1{\gdef\subcapsave{\relax##1}}%
2210 % \let\subcapsave=\@empty % Save the subcaption text.
2211 % \let\sf@oldlabel=\label
2212 % \def\label##1{\xdef\sublabsave{\noexpand\label{##1}}}%
2213 % \let\sublabsave\relax % Save the label key.
2214 % \setbox\subfigbox\hbox
2215 % \bgroup}% % Open the box...
2216 % {\egroup % ... close the box and call \subfigure.
2217 % \let\label=\sf@oldlabel
2218 % \subfigure[\subcapsave]{\box\subfigbox}}%
2219 % \makeatother
2220 % \end{verbatim}
2221 % \enlargethispage{12pt}^finalhack
2222 % \noindent
2223 % The following is an example of this \Lenv{subfloat} environment begin
2224 % used to produce figure~\ref{fig:verbatim}. Note that you need to
2225 % supply the width of the \Lenv{verbatim}; here we use a section using a
2226 % \Lenv{minipage}).
2227 % \begingroup
2228 % \newbox\subfigbox
2229 % \makeatletter
2230 % \newenvironment{subfloat}^
2231 % {\def\caption##1{\gdef\subcapsave{\relax##1}}^
2232 % \let\subcapsave=\@empty
2233 % \let\sf@oldlabel=\label
2234 % \def\label##1{\xdef\sublabsave{\noexpand\label{##1}}}^
2235 % \let\sublabsave\relax
2236 % \setbox\subfigbox\hbox
2237 % \bgroup}^
2238 % {\egroup
2239 % \let\label=\sf@oldlabel
2240 % \subfigure[\subcapsave]{\box\subfigbox\sublabsave}}^
2241 % \makeatother
2242 % \begin{figure}
2243 % \centering
2244 % \subfigtopskip=0pt^
2245 % \subfigcapskip=0pt^
2246 % \subfigbottomskip=0pt^
2247 % \begin{subfloat}^
2248 % \begin{minipage}{2.1in}
2249 % \begin{verbatim}
2250 % This text should be
2251 % verbatim. And not
2252 % messed with in any way !
2253 % \end{verbatim}
2254 % \end{minipage}^
2255 % \caption{First subcaption.}^
2256 % \label{fig:verbone}
2257 % \end{subfloat}^
2258 % \hspace{10pt}^
2259 % \begin{subfloat}^
2260 % \begin{minipage}{2.1in}
2261 % \begin{verbatim}
2262 % This text (also)should be
2263 % verbatim. And not
2264 % messed with in any way !
2265 % \end{verbatim}
2266 % \end{minipage}^
2267 % \caption{Second subcaption.}^
2268 % \label{fig:verbtwo}
2269 % \end{subfloat}
2270 % \caption{Subfigures~\subref{fig:verbone} and \subref{fig:verbtwo}
2271 % show examples of using verbatim text in a subfigure.}
2272 % \label{fig:verbatim}
2273 % \end{figure}
2274 % \endgroup
2275 % \begin{quote}\
2276 % |\begin{figure}| \\
2277 % | \centering|
2278 % | \begin{subfloat}%| \\
2279 % | \begin{minipage}{2.1in}| \\
2280 % | \begin{verbatim}| \\
2281 % | This text should be| \\
2282 % |verbatim. And not| \\
2283 % | messed with in any way !| \\
2284 % | \end{verbatim}| \\
2285 % | \end{minipage}%| \\
2286 % | \caption{First subcaption.}%| \\
2287 % | \label{fig:verbone}| \\
2288 % | \end{subfloat}%| \\
2289 % | \qquad| \\
2290 % | \begin{subfloat}%| \\
2291 % | \begin{minipage}{2.1in}| \\
2292 % | \begin{verbatim}| \\
2293 % | This text (also)should be| \\
2294 % |verbatim. And not| \\
2295 % | messed with in any way !| \\
2296 % | \end{verbatim}| \\
2297 % | \end{minipage}%| \\
2298 % | \caption{Second subcaption.}%| \\
2299 % | \label{fig:verbtwo}| \\
2300 % | \end{subfloat}| \\
2301 % | \caption{Subfigures~\subref{fig:verbone} and \subref{fig:verbtwo}| \\
2302 % | show examples of using verbatim text in a subfigure.}| \\
2303 % | \label{fig:verbatim}| \\
2304 % |\end{figure}|
2305 % \end{quote}
2306 %
2307 %
2308 % \StopEventually{^
2309 % \section{Acknowledgements}
2310 %
2311 % This package was originally written to automatically line up some
2312 % figure boxes and place labels under them for a paper that I was
2313 % writing. I thought it useful and uploaded it to the internet
2314 % community and later to CTAN. Many people have asked questions or
2315 % given comments which collectively have changed and improved the
2316 % usefulness of this package.
2317 %
2318 % A few people have contributed more than most and I want to thank
2319 % them publicly, but in no particular order:
2320 %
2321 % \begin{itemize}\itemsep=-2pt^finalhack
2322 % \item{\bf Harald Axel Sommerfeldt} for the work that he did to adjust
2323 % his \Lpack{caption} and \Lpack{caption2} packages as necessary to
2324 % support the \Lpack{subfigure} package when they are loaded together.
2325 % \item {\bf Peter Wilson} for the work that he did to adjust his
2326 % \Lpack{ccaption} package (and other packages) as necessary to support
2327 % the \Lpack{subfigure} package when they are loaded together.
2328 % \item {\bf William `bil' L. Kleb} for his extensive list of errors and
2329 % suggestions to this documentation.
2330 % \item{\bf Axel Reichert} for his request for a `hang' caption style
2331 % since the subcaptions tend to have a short width. And, for his
2332 % request for some way of referencing the individual subfigures in
2333 % the main caption without the figure number.
2334 % \item{\bf Harald Harders} for his suggestion of the \cmd{\subref}
2335 % command and modifying \cmd{\label} within the \Lpack{subfigure}
2336 % package to save local references to the subfigures that are often
2337 % needed.
2338 % \item{\bf Heiko Oberdiek} and {\bf James A. Bednar} for their help
2339 % with coexisting with the \Lpack{hyperref} and \Lpack{html} packages.
2340 % Also, {\bf Ingele Roelens} for pointing out some further compatibility
2341 % problems when using the \Lpack{hyperref} package with PDF\LaTeX.
2342 % \item{\bf Frederic Darboux} for searching out and finding several
2343 % incompatibilities with other packages.
2344 % \item{\bf David Kastrup} for the code to check for class or packages
2345 % using \cmd{\let} on \cmd{\end@float} and the like.
2346 % \end{itemize}
2347 %
2348 % \newpage^finalhack
2349 %
2350 % \begin{thebibliography}{6}^\itemsep=-2pt^finalhack
2351 % \itemsep=0.8pt
2352 % \bibitem{Somm95a}^
2353 % Harald Axel Sommerfeldt,
2354 % \emph{The \Lpack{caption} Package},
2355 % Version 1.4b, 1995/04/05.
2356 % (Available from CTAN as file \texttt{caption.dtx}.)
2357 % \bibitem{Somm95b}^
2358 % Harald Axel Sommerfeldt,
2359 % \emph{The \Lpack{caption} Package},
2360 % Version 2.0(beta), 1995/10/09.
2361 % (Available from CTAN as file \texttt{caption2.dtx}.)
2362 % \bibitem{Wils01}^
2363 % Peter Wilson,
2364 % \emph{The \Lpack{ccaption} Package},
2365 % Version 1.0a, 2001/08/15.
2366 % (Available from CTAN as file \texttt{ccaption.dtx}.)
2367 % \bibitem{Wils01B}^
2368 % Peter Wilson,
2369 % \emph{The \Lpack{tocloft} Package},
2370 % Version 2.2, 2001/14/17.
2371 % (Available from CTAN as file \texttt{ccaption.dtx}.)
2372 % \bibitem{Raht02}^
2373 % Sebastian Rahtz,
2374 % \emph{Hypertext marks in \LaTeX},
2375 % 2002/04/05/.
2376 % (Available from CTAN as file \texttt{hyperref.dtx}.)
2377 % \bibitem{Coch02}^
2378 % Steven Douglas Cochran,
2379 % \emph{The \Lpack{captcont} Package},
2380 % 2002/02/14/.
2381 % (Available from CTAN as file \texttt{captcont.dtx}.)
2382 % \bibitem{Reck97}^
2383 % Keith Reckdahl,
2384 % \emph{Using Imported Graphics in \LaTeXe},
2385 % 1997/12/15.
2386 % (Available from CTAN as file \texttt{epslatex.pdf})
2387 % \bibitem{Lamp94}^
2388 % Leslie Lamport,
2389 % \emph{LaTeX User's Guide and Reference Manual}, 2nd edition,
2390 % Addison-Wesley, Reading, Massachusetts,
2391 % 1994.
2392 % \bibitem{Knut86}^
2393 % Donald Ervin Knuth,
2394 % \emph{The \TeX book},
2395 % Addison-Wesley, Reading, Massachusetts,
2396 % 1986.
2397 % \bibitem{Lamp01}^
2398 % Leslie Lamport, Frank Mittelbach, and Johannes Braams,
2399 % \emph{Standard Document Classes for \LaTeX\ version 2e}
2400 % Version 1.4e, 2001/04/01.
2401 % (Available from CTAN as file \texttt{classes.dtx}.)
2402 % \bibitem{Ling01}^
2403 % Anselm Lingnau,
2404 % \emph{An Improved Environment for Floats.}
2405 % Version 1.3d, 2001/11/08.
2406 % (Available from CTAN as file \texttt{float.dtx}.)
2407 % \end{thebibliography}}
2408 %
2409 % \newpage^finalhack
2410 %
2411 % \section{The Code}
2412 % \iffalse
2413 %<*package>
2414 % \fi
2415 % \subsection{Identification}
2416 %
2417 % \changes{v2.1}{23 Jan 2002}{Updated the release date.}
2418 %
2419 % \changes{v2.1}{11 Oct 1996}{Removed compatibility with \LaTeX2.09.}
2420 %
2421 % Announce the \Lpack{subfigure} package.
2422 %
2423 % \begin{macrocode}
2424 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
2425 \ProvidesPackage{subfigure}[2002/03/15 v2.1.5 subfigure package]
2426 % \end{macrocode}
2427 %
2428 % \subsection{Check for Nasty Classes}
2429 % \changes{v2.1.5}{29 Apr 2005}{At the request of David Kastrup, added
2430 % code to check for classes that use \cmd{\let} on \cmd{\end@figure}
2431 % and similar; and to print a warning and fix the problem if detected.}
2432 %
2433 % \begin{macro}{\sf@floatfix}
2434 %
2435 % Some ``broken'' document classes use \cmd{\let} on \cmd{\end@figure}
2436 % and similar, which are used as hooks in the end-processing of, in
2437 % this case, figures. The following code, courtesy of David Kastrup
2438 % (dak\@gnu.org) fixes the problem and prints a warning.
2439 % \begin{macrocode}
2440 \def\sf@floatfix#1#2{%
2441 \ifx#1#2%
2442 \ifx#1\@undefined\else
2443 \PackageWarningNoLine{subfigure}{%
2444 Your document class has a bad definition^^J
2445 of \string#1, most likely^^J
2446 \string\let\string#1=\string#2^^J
2447 which has now been changed to^^J
2448 \string\def\string#1{\string#2}^^J
2449 because otherwise subsequent changes to \string#2^^J
2450 (like done by several packages changing float behaviour)^^J
2451 can't take effect on \string#1.^^J
2452 Please complain to your document class author}%
2453 \def#1{#2}%
2454 \fi
2455 \fi}
2456 % \end{macrocode}
2457 %
2458 % \begin{macrocode}
2459 \begingroup
2460 \def\next#1#2{%
2461 \endgroup
2462 \sf@floatfix\endfigure\end@float
2463 \sf@floatfix\endtable\end@float
2464 \sf@floatfix#1\end@dblfloat
2465 \sf@floatfix#2\end@dblfloat}
2466 \expandafter\next\csname endfigure*\expandafter\endcsname
2467 \csname endtable*\endcsname
2468 % \end{macrocode}
2469 %
2470 % \end{macro}
2471 %
2472 % \subsection{Check for the \Lpack{hyperref} Package}
2473 %
2474 % \changes{v2.1.4}{02 Jul 2002}{Added the \cmd{\theHsubfigure} and
2475 % \cmd{\theHsubtable} commands to avoid duplicate names in a PDF
2476 % file when using the \Lpack{hyperref} Package.}
2477 %
2478 % \changes{v2.1.3}{17 Apr 2002}{Changed \cmd{\newcommand} to
2479 % \cmd{\providecommand} to allow other packages to set the
2480 % \cmd{\toclevel@subfigure} and \cmd{\toclevel@subtable}.}
2481 %
2482 % \changes{v2.1.2}{26 Mar 2002}{Changed to simplify the interaction
2483 % with the hyperref package and avoid loading nameref.}
2484 %
2485 % \changes{v2.1.1}{15 Mar 2002}{Added coordination with the hyperref
2486 % package.}
2487 %
2488 % \begin{macro}{\toclevel@subfigure}
2489 % \begin{macro}{\toclevel@subtable}
2490 %
2491 % After every package is loaded, check to see if the \Lpack{hyperref}
2492 % package was among them, if so, then make sure that the |\ifhyperrefloaded|
2493 % switch is set so that the |\subfloat@label| command will write the correct
2494 % form of the |\newlabel| to the \Lfile{aux} file. Also define the
2495 % ``TOC level'' of the subfigure and subtable. We fix these at one since
2496 % the default figure and table levels are zero. Finally, we add definitions
2497 % for |\theHsubfigure| and |\theHsubtable| to avoid duplicate names in
2498 % the PDF file when using the \Lpack{hyperref} Package.
2499 %
2500 % \begin{macrocode}
2501 \newif\ifhyperrefloaded
2502 \AtBeginDocument{%
2503 \@ifpackageloaded{hyperref}{%
2504 \hyperrefloadedtrue
2505 \providecommand\theHsubfigure{\thefigure.\arabic{subfigure}}%
2506 \providecommand\theHsubtable{\thetable.\arabic{subtable}}%
2507 \providecommand{\toclevel@subfigure}{1}%
2508 \providecommand{\toclevel@subtable}{1}}{}}
2509 % \end{macrocode}
2510 %
2511 % \end{macro}
2512 % \end{macro}
2513 %
2514 % \subsection{Initialization and Shared Constants}
2515 % \begin{macro}{\ifsubcaphang}
2516 % \begin{macro}{\ifsubcapcenter}
2517 % \begin{macro}{\ifsubcapcenterlast}
2518 % \begin{macro}{\ifsubcapnooneline}
2519 % \begin{macro}{\ifsubcapraggedright}
2520 %
2521 % \changes{v2.1}{23 Jan 2002}{Added.}
2522 %
2523 % These five flags control how the style in which the subfloat label and
2524 % caption are printed. The \Lif{subcaphang} flag is first checked and
2525 % if true, causes the subcaption label to be typeset separately and
2526 % placed to the upper left of the space available for the subcaption.
2527 % The \Lif{subcapcenter} flag centers each line of the subcaption. The
2528 % \Lif{subcapcenterlast} centers the last line of the subcaption (this
2529 % is a {\sc nop} if the \Lif{subcapcenter} flag is true. If the
2530 % \Lif{subcapnooneline} is false, then the label plus the text of the
2531 % subcaption are centered. If it is true, than the other flags may
2532 % cause something different to happen. The purpose of this flag,
2533 % generally, is to cause a single line to be left justified when there
2534 % is a very short caption. The last flag is the \Lif{subcapraggedright}
2535 % which typsets its text without lining up the right side. This is
2536 % useful for the subcaptions since they are usually short and prone to
2537 % generating hyphenated words unless allowed to be ragged.
2538 %
2539 % \begin{macrocode}
2540 \newif\ifsubcaphang
2541 \newif\ifsubcapcenter
2542 \newif\ifsubcapcenterlast
2543 \newif\ifsubcapnooneline
2544 \newif\ifsubcapraggedright
2545 % \end{macrocode}
2546 % \end{macro}
2547 % \end{macro}
2548 % \end{macro}
2549 % \end{macro}
2550 % \end{macro}
2551 %
2552 % \noindent
2553 % Table~\ref{tab:defaults} gives the initial (default) values of the
2554 % internals that are used to control the placement and printing of the
2555 % subfloats.
2556 %
2557 % \changes{v2.1.4}{30 Apr 2002}{Changed the label and caption defaults
2558 % from \cmd{\rmfamily}\cmd{\mdseries}\cmd{\upshape} to
2559 % \cmd{\familydefault}\cmd{\seriesdefault} \cmd{\shapedefault}.}
2560 % \DeleteShortVerb{\|}
2561 % \MakeShortVerb{\/}
2562 % \begin{table}^
2563 % \def\pz{\phantom{0}}^
2564 % \def\M#1{\vspace*{#1}}
2565 % \caption[Default values of the Subfigure constants.]%
2566 % {Default values of the Subfigure constants. These
2567 % values are set during the options processing (see
2568 % section~\ref{sec:startup}).}^
2569 % \label{tab:defaults}^
2570 % \vspace{5pt}^
2571 % \begin{minipage}{4.8in}^
2572 % \setlength\tabcolsep{5pt}^
2573 % \rr
2574 % \begin{tabular}{|l|c|p{1.3in}|p{1.963in}|}\hline
2575 % \multicolumn{1}{|c|}{\raisebox{-1.5ex}{\bf Command}}
2576 % & \multicolumn{1}{c|}{\bf \Lopt{loose}}
2577 % & \multicolumn{1}{c|}{\bf \Lopt{tight}}
2578 % &
2579 % \multicolumn{1}{c|}{\raisebox{-1.5ex}{\bf Description}}
2580 % \\
2581 % & \multicolumn{1}{c|}{\bf Option}
2582 % & \multicolumn{1}{c|}{\bf Option}
2583 % & \\ \hline
2584 % \raisebox{-2.1ex}{\cmd{\subfigtopskip}}
2585 % & \raisebox{-2.1ex}{10 pt}
2586 % & \M{0.6ex}\hfil 5 pt
2587 % & \rr Length from the top of the subfloat
2588 % box to the beginning of the figure.
2589 % \\ \hline
2590 % \raisebox{-1.5ex}{\cmd{\subfigcapskip}}
2591 % & \raisebox{-1.5ex}{10 pt}
2592 % & \M{0.0ex}\hfil 0 pt
2593 % & \rr Length between the baseline of the
2594 % subcaption and the figure.
2595 % \\ \hline
2596 % \raisebox{-2.1ex}{\cmd{\subfigcaptopadj}}
2597 % & \raisebox{-2.1ex}{\pz0 pt}
2598 % & \M{0.4ex}\hfil 3 pt
2599 % & \rr Length added to /\subfigcapskip/
2600 % when the caption is above the figure.
2601 % \\ \hline
2602 % \raisebox{-2.1ex}{\cmd{\subfigbottomskip}}
2603 % & \raisebox{-2.1ex}{10 pt}
2604 % & \M{0.7ex}\hfil 5 pt
2605 % & \rr Length from the bottom of the
2606 % subcaption to the bottom of the
2607 % subfloat.
2608 % \\ \hline
2609 % \raisebox{-3.5ex}{\cmd{\subfigcapmargin}}
2610 % & \raisebox{-3.5ex}{10 pt}
2611 % & \M{2.0ex}\hfil 0 pt
2612 % & \rr Indentation of the subcaption from
2613 % the sides of the subfloat box. (This
2614 % should always be positive or zero.)
2615 % \\ \hline
2616 % \raisebox{-1.5ex}{\cmd{\subfiglabelskip}}
2617 % & \raisebox{-1.5ex}{0.33 em}
2618 % & \raggedleft 0.33 em plus 0.07 em minus 0.03 em
2619 % & \rr Space between the label and the
2620 % text of the subcaption.
2621 % \\ \hline
2622 % \raisebox{-1.5ex}{\cmd{\subcapsize}}
2623 % & \multicolumn{2}{c|}{\raisebox{-1.5ex}{footnotesize}}
2624 % & \rr Size for the text portion of the
2625 % subcaption font.
2626 % \\ \hline
2627 % \raisebox{-1.5ex}{\cmd{\subcaplabelfont}}
2628 % & \multicolumn{2}{c|}{\raisebox{-1.5ex}{(Default family, series and shape)}}
2629 % & \rr Font for the label portion of the
2630 % subcaption.
2631 % \\ \hline
2632 % \raisebox{-1.5ex}{\cmd{\subcapfont}}
2633 % & \multicolumn{2}{c|}{\raisebox{-1.5ex}{(Default family, series and shape)}}
2634 % & \rr Font for the text portion of the
2635 % subcaption.
2636 % \\ \hline
2637 % \end{tabular}
2638 % \end{minipage}
2639 % \end{table}
2640 % \DeleteShortVerb{\/}
2641 % \MakeShortVerb{\|}
2642 %
2643 % \begin{macro}{\subfigtopskip}
2644 % \begin{macro}{\subfigcapskip}
2645 % \begin{macro}{\subfigcaptopadj}
2646 % \begin{macro}{\subfigbottomskip}
2647 %
2648 % \changes{v2.1}{22 Jan 1997}{Reduced the space to the values separating
2649 % subfloat caption and figure box and its top and bottom. Added
2650 % \cmd{\subfigcaptopadj} in case it is needed in styles that with figure
2651 % subcaptions on the bottom and table subcaptions on the top.}
2652 %
2653 % See figure~\ref{fig:layout} for details of where these take effect.
2654 % Generally the |\subfigtopskip| appears between the figure or table and
2655 % the edge of the box. |\subfigbottomskip| appears between the
2656 % subcaption and the edge of the box. If the subcaption follows the
2657 % figure or table, then |\subfigcapskip| is placed before it along with
2658 % ({\it i.e.\/}, in addition to) a |\baselineskip|. If the subcaption
2659 % comes before the figure or table then |\subfigcapskip| is placed
2660 % after it along with |\subfigcaptopadj|. Although several of the above
2661 % are {\tt skip}'s they are typset at their base size and will not
2662 % shrink or expand.
2663 %
2664 % \begin{macrocode}
2665 \newskip\subfigtopskip \subfigtopskip = 5\p@
2666 \newskip\subfigcapskip \subfigcapskip = 0\p@
2667 \newdimen\subfigcaptopadj \subfigcaptopadj = 3\p@
2668 \newskip\subfigbottomskip \subfigbottomskip = 5\p@
2669 % \end{macrocode}
2670 % \end{macro}
2671 % \end{macro}
2672 % \end{macro}
2673 % \end{macro}
2674 %
2675 % \begin{macro}{\subfigcapmargin}
2676 %
2677 % \changes{v2.1}{22 Jan 1997}{Reduced \cmd{\subfigcapmargin} to zero.}
2678 % \begin{macro}{\subfiglabelskip}
2679 %
2680 % \changes{v2.1}{23 Jan 2002}{Added to replace the space between the
2681 % subcaption label and text.}
2682 %
2683 % These two values are used to typeset the subcaption The width of the
2684 % subcaption is the same as that of its associated figure or table
2685 % width. |\subfigcapmargin| is placed on either side of the caption and
2686 % |\subfiglabelskip| is placed between the subcaption label and the
2687 % subcaption text. Depending on the manner of typesetting the
2688 % subcaption, this may shrink or expand. By default, the
2689 % |\subfigcapmargin| is zero to allow as much room of the subcaption as
2690 % possible.
2691 %
2692 % \begin{macrocode}
2693 \newdimen\subfigcapmargin \subfigcapmargin = \z@
2694 \newskip\subfiglabelskip \subfiglabelskip = 0.33em plus 0.07em minus 0.03em
2695 % \end{macrocode}
2696 % \end{macro}
2697 % \end{macro}
2698 %
2699 % \begin{macro}{\subcapsize}
2700 %
2701 % |\subcapsize| is used to set the size of both the subcaption label and
2702 % the subcaption text. The options allow it to be set to any of the
2703 % following: |\scriptsize|, |\footnotesize|, |\small|, |\normalsize|,
2704 % |\large|, |\Large|. It may also be set to |\tiny|, |\LARGE|, |\huge|
2705 % or |\HUGE| by hand if need be for special instances.
2706 %
2707 % \begin{macrocode}
2708 \newcommand*{\subcapsize}{}
2709 % \end{macrocode}
2710 % \end{macro}
2711 %
2712 % \begin{macro}{\subcaplabelfont}
2713 % \begin{macro}{\subcaplabelfont@f}
2714 %
2715 % \changes{v2.1.4}{30 Apr 2002}{Changed the \cmd{\subcaplabelfont@f}
2716 % default value to \cmd{\familydefault}.}
2717 %
2718 % \begin{macro}{\subcaplabelfont@c}
2719 %
2720 % \changes{v2.1.4}{30 Apr 2002}{Changed the \cmd{\subcaplabelfont@c}
2721 % default value to \cmd{\seriesdefault}.}
2722 %
2723 % \begin{macro}{\subcaplabelfont@s}
2724 %
2725 % \changes{v2.1.4}{30 Apr 2002}{Changed the \cmd{\subcaplabelfont@s}
2726 % default value to \cmd{\shapedefault}.}
2727 %
2728 % The |\subcaplabelfont| is composed of three parts, the font family,
2729 % such as roman, san serif or typewriter; the font series, such as
2730 % medium or bold; and the font shape, such as italic, slanted, small
2731 % caps or upright. These are combined along with the |\subcapsize| to
2732 % select the font for the subcaption label.
2733 %
2734 % \begin{macrocode}
2735 \newcommand*{\subcaplabelfont}{%
2736 \subcaplabelfont@f\subcaplabelfont@c\subcaplabelfont@s}
2737 \newcommand*{\subcaplabelfont@f}{\fontfamily{\familydefault}\selectfont}
2738 \newcommand*{\subcaplabelfont@c}{\fontseries{\seriesdefault}\selectfont}
2739 \newcommand*{\subcaplabelfont@s}{\fontshape{\shapedefault}\selectfont}
2740 % \end{macrocode}
2741 % \end{macro}
2742 % \end{macro}
2743 % \end{macro}
2744 % \end{macro}
2745 %
2746 % \begin{macro}{\subcapfont}
2747 %
2748 % \changes{v2.1}{11 Dec 1996}{Added.}
2749 %
2750 % \begin{macro}{\subcapfont@f}
2751 %
2752 % \changes{v2.1.4}{30 Apr 2002}{Changed the \cmd{\subcapfont@f} default
2753 % value to \cmd{\familydefault}.}
2754 %
2755 % \begin{macro}{\subcapfont@c}
2756 %
2757 % \changes{v2.1.4}{30 Apr 2002}{Changed the \cmd{\subcapfont@s} default
2758 % value to \cmd{\seriesdefault}.}
2759 %
2760 % \begin{macro}{\subcapfont@s}
2761 %
2762 % \changes{v2.1.4}{30 Apr 2002}{Changed the \cmd{\subcapfont@s} default
2763 % value to \cmd{\shapedefault}.}
2764 %
2765 % The |\subcapfont| is the same as the |\subcaplabelfont| except that it
2766 % is applied to the subcaption text rather than the label.
2767 %
2768 % \begin{macrocode}
2769 \newcommand*{\subcapfont}{%
2770 \subcapfont@f\subcapfont@c\subcapfont@s}
2771 \newcommand*{\subcapfont@f}{\fontfamily{\familydefault}\selectfont}
2772 \newcommand*{\subcapfont@c}{\fontseries{\seriesdefault}\selectfont}
2773 \newcommand*{\subcapfont@s}{\fontshape{\shapedefault}\selectfont}
2774 % \end{macrocode}
2775 % \end{macro}
2776 % \end{macro}
2777 % \end{macro}
2778 % \end{macro}
2779 %
2780 % \begin{macro}{\ifsf@tight}
2781 %
2782 % Create an `if' to control whether the check for the top-of-page is
2783 % performed in the |\@subfloat| command. This is necessary to preserve
2784 % the look-and-feel of the older versions of this package. The
2785 % \Lopt{loose} option turns this flag off (no check) and the
2786 % \Lopt{tight} option turns it on (do the check).
2787 %
2788 % \begin{macrocode}
2789 \newif\ifsf@tight \sf@tighttrue
2790 % \end{macrocode}
2791 % \end{macro}
2792 %
2793 % \subsection{Subfigure Constants}
2794 % \label{sec:fig_constants}
2795 % \begin{macro}{\c@subfigure}
2796 % Subfigure counter.
2797 %
2798 % \begin{macrocode}
2799 \newcounter{subfigure}[figure]
2800 % \end{macrocode}
2801 % \end{macro}
2802 %
2803 % \begin{macro}{\iffiguretopcap}
2804 %
2805 % \changes{v2.1}{23 Jan 2002}{Added check for existing
2806 % \cmd{\figuretopcaptrue} so that this package will work with the
2807 % captcont package.}
2808 %
2809 % \changes{v2.1}{22 Jan 1997}{Added to control label numbering for
2810 % captions at the top vs.\ at the bottom.}
2811 %
2812 % \begin{macro}{\ifsubfiguretopcap}
2813 %
2814 % \changes{v2.1}{15 Nov 1997}{Added to control placement of the
2815 % subcaption at the top vs.\ at the bottom.}
2816 %
2817 % These control how the \Lpack{subfigure} \Lcount{caption} numbering is
2818 % obtained and where the figure caption and subcaption should appear
2819 % relative to the body of the \Lenv{subfigure}. The boolean
2820 % |\iffiguretopcap| indicates that the \Lcount{caption} counter is
2821 % current and there is no need to increment it. The boolean
2822 % |\ifsubfiguretopcap| indicates that the subcaption will be printed
2823 % above the body portion of the \Lpack{subfigure}.
2824 %
2825 % \begin{macrocode}
2826 \@ifundefined{figuretopcaptrue}{\newif\iffiguretopcap}{}
2827 \newif\ifsubfiguretopcap
2828 % \end{macrocode}
2829 % \end{macro}
2830 % \end{macro}
2831 %
2832 % \begin{macro}{\p@subfigure}
2833 % \begin{macro}{\thesubfigure}
2834 % \begin{macro}{\@thesubfigure}
2835 % \begin{macro}{\@@thesubfigure}
2836 %
2837 % \changes{v2.1}{23 Jan 2002}{Added.}
2838 %
2839 % The |\thesubfigure| command defines the label for text references
2840 % (prefixed by |\p@subfigure|). This is the value saved by the |\label|
2841 % and retrieved by the |\ref| commands. In the case of a
2842 % conflict between this package and a prior one over the definition
2843 % of |\thesubfigure|, this package will win. This is insured by first
2844 % specifying the |\providecommand| for the |\thesubfigure| and then
2845 % |\renewcommand|. This is necessary because some packages incorrectly
2846 % insert this command.
2847 %
2848 % The |\@thesubfigure| value defines the the caption label complete
2849 % offset from the beginning of the caption text. It is used in the
2850 % subfigure caption and normally takes the label portion as defined
2851 % by |\thesubfigure|.
2852 %
2853 % Finally, the value defined by |\@@thesubfigure| is also saved by the
2854 % |\label| command and may be retrieved with the |\subref| command. This is
2855 % often useful in the subcaption or caption text when referring to the
2856 % individual subfigures. This value is also the one that is used in
2857 % the List-of-Figures.
2858 %
2859 % These multiple ``views'' of the \Lcount{subfigure} counter allow a
2860 % style to define the way the label looks in the figure, for example
2861 % ``{\bf (a)}\textvisiblespace''. Then references to it with |\ref|
2862 % have the form ``2.1a'', and with |\subref| ``(a)'' (This latter form
2863 % is also used to label references in the List-of-Figures section).
2864 %
2865 % \begin{macrocode}
2866 \let\p@subfigure=\thefigure
2867 \providecommand*{\thesubfigure}{(\alph{subfigure})}
2868 \renewcommand*{\thesubfigure}{(\alph{subfigure})}
2869 \newcommand*{\@thesubfigure}{\thesubfigure\hskip\subfiglabelskip}
2870 \newcommand*{\@@thesubfigure}{\thesubfigure}
2871 % \end{macrocode}
2872 % \end{macro}
2873 % \end{macro}
2874 % \end{macro}
2875 % \end{macro}
2876 %
2877 % \begin{macro}{\ext@subfigure}
2878 % \begin{macro}{\l@subfigure}
2879 %
2880 % \changes{v2.1}{11 Oct 1996}{Changed the indentation of the
2881 % List-of-Figures line from 2.3em to 2.5em.}
2882 %
2883 % \begin{macro}{\c@lofdepth}
2884 %
2885 % These values define how and if the subfigure caption will appear in a
2886 % List-of-Figures file. |\ext@subfigure| defines the default subfigure
2887 % file extension (which is the same as |\ext@figure| --- the
2888 % List-of-Figures file, \Lcount{lof}). |\l@subfigure|
2889 % shows how to print an \Lfile{lof} subfigure line and defines that line
2890 % at level two. |\c@lofdepth| is an extension of the Table-of-Contents
2891 % depth value and controls the depth to which captions in the file are
2892 % printed to the actual page. By default, the subcaptions are not.
2893 %
2894 % \begin{macrocode}
2895 \let\ext@subfigure=\ext@figure
2896 % \end{macrocode}
2897 %
2898 % \begin{macrocode}
2899 \newcommand*{\l@subfigure}{%
2900 \@dottedxxxline{\ext@subfigure}{2}{3.8em}{2.5em}}
2901 % \end{macrocode}
2902 %
2903 % \begin{macrocode}
2904 \newcounter{lofdepth}
2905 \setcounter{lofdepth}{1}
2906 % \end{macrocode}
2907 % \end{macro}
2908 % \end{macro}
2909 % \end{macro}
2910 %
2911 % \subsection{Subtable Constants}
2912 % This section is symmetric to section~\ref{sec:fig_constants}.
2913 % \begin{macro}{\c@subtable}
2914 % Subtable counter.
2915 %
2916 % \begin{macrocode}
2917 \newcounter{subtable}[table]
2918 % \end{macrocode}
2919 % \end{macro}
2920 %
2921 % \begin{macro}{\iftabletopcap}
2922 %
2923 % \changes{v2.1}{23 Jan 2002}{Added check for existing
2924 % \cmd{\tabeltopcaptrue} so that this package will work with the
2925 % captcont package.}
2926 %
2927 % \changes{v2.1}{22 Jan 1997}{Added to control label numbering for
2928 % captions at the top vs.\ at the bottom.}
2929 %
2930 % \begin{macro}{\ifsubtabletopcap}
2931 % \changes{v2.1}{15 Nov 1997}{Added to control placement of the
2932 % subcaption at the top vs.\ at the bottom.}
2933 %
2934 % These define the form that the subcaption prefix is generated. The
2935 % boolean |\iftabletopcap| works with the numbering of the subcaption
2936 % label and uses the current \Lcount{table} counter value if true and
2937 % the next value if false. The boolean |\ifsubtabletopcap| sets the
2938 % subcaption before the main body of the subfigure, if true; and, after
2939 % it, if false.
2940 %
2941 % \begin{macrocode}
2942 \@ifundefined{tabletopcaptrue}{\newif\iftabletopcap}{}
2943 \newif\ifsubtabletopcap
2944 % \end{macrocode}
2945 % \end{macro}
2946 % \end{macro}
2947 %
2948 % \begin{macro}{\p@subtable}
2949 % \begin{macro}{\thesubtable}
2950 % \begin{macro}{\@thesubtable}
2951 % \begin{macro}{\@@thesubtable}
2952 %
2953 % \changes{v2.1}{23 Jan 2002}{Added.}
2954 %
2955 % The |\thesubtable| command defines the label for text references
2956 % (prefixed by |\p@subtable|), while the |\@thesubtable| command defines
2957 % what appears in the subcaption under or over the subtable. The
2958 % |\@@thesubtable| command defines an alternative reference to the label
2959 % for use in the subcaption and caption of the table (see the discussion
2960 % above for the equivalent figure values). The latter form is also used
2961 % for the List-of-Tables label. As above, the |\thesubtable| command is
2962 % twice specified
2963 %
2964 % \begin{macrocode}
2965 \let\p@subtable=\thetable
2966 \providecommand*{\thesubtable}{(\alph{subtable})}
2967 \renewcommand*{\thesubtable}{(\alph{subtable})}
2968 \newcommand*{\@thesubtable}{\thesubtable\hskip\subfiglabelskip}
2969 \newcommand*{\@@thesubtable}{\thesubtable}
2970 % \end{macrocode}
2971 % \end{macro}
2972 % \end{macro}
2973 % \end{macro}
2974 % \end{macro}
2975 %
2976 % \begin{macro}{\ext@subtable}
2977 % \begin{macro}{\l@subtable}
2978 %
2979 % \changes{v2.1}{11 Oct 1996}{Changed the indentation of the
2980 % List-of-Tables line from 2.3em to 2.5em.}
2981 %
2982 % \begin{macro}{\c@lotdepth}
2983 %
2984 % These define how and if the subtable caption will appear in a
2985 % List-of-Tables file. |\ext@subtable| defines the default subtable
2986 % file extension (which is the same as |\ext@table| --- the
2987 % List-of-Tables file, \Lcount{lot}). |\l@subtable| shows how to print
2988 % an \Lfile{lot} subtable line and defines that line at level two.
2989 % |\c@lotdepth| is an extension of the table-of-contents depth value and
2990 % controls the depth to which captions in the file are printed to the
2991 % actual page. By default, the subcaptions are not printed.
2992 %
2993 % \begin{macrocode}
2994 \let\ext@subtable=\ext@table
2995 % \end{macrocode}
2996 %
2997 % \begin{macrocode}
2998 \newcommand*{\l@subtable}{%
2999 \@dottedxxxline{\ext@subtable}{2}{3.8em}{2.5em}}
3000 % \end{macrocode}
3001 %
3002 % \begin{macrocode}
3003 \newcounter{lotdepth}
3004 \setcounter{lotdepth}{1}
3005 % \end{macrocode}
3006 % \end{macro}
3007 % \end{macro}
3008 % \end{macro}
3009 %
3010 % \subsection{Declaration of Options}
3011 %
3012 % The following options allow general compatibility with the
3013 % \Lpack{caption} and \Lpack{caption2} packages by H.A. Sommerfeldt
3014 % \cite{Somm95a}. There are six different subcaption layout options
3015 % supported: \Lopt{normal}, \Lopt{hang} (or \Lopt{isu}), \Lopt{center},
3016 % \Lopt{centerlast} (or \Lopt{anne}), \Lopt{nooneline} and
3017 % \Lopt{raggedright}. The \Lopt{hang} subcaption may be combined with
3018 % the \Lopt{center} or \Lopt{centerlast} options. The \Lopt{nooneline}
3019 % may be combined with any of the other options (but it's effect is
3020 % negated or looks bad with either of \Lopt{center} or \Lopt{centerlast}
3021 % unless the \Lopt{hang} option is also used). \Lopt{raggedright}
3022 % overrides the \Lopt{center} or \Lopt{centerlast} options.
3023 %
3024 % \begin{macrocode}
3025 \DeclareOption{normal}{%
3026 \subcaphangfalse
3027 \subcapcenterfalse
3028 \subcapcenterlastfalse
3029 \subcapnoonelinefalse
3030 \subcapraggedrightfalse}
3031 % \end{macrocode}
3032 %
3033 % \begin{macrocode}
3034 \DeclareOption{hang}{\subcaphangtrue}
3035 \DeclareOption{center}{\subcapcentertrue}
3036 \DeclareOption{centerlast}{\subcapcenterlasttrue}
3037 \DeclareOption{nooneline}{\subcapnoonelinetrue}
3038 \DeclareOption{raggedright}{\subcapraggedrighttrue}
3039 % \end{macrocode}
3040 %
3041 % \begin{macrocode}
3042 \DeclareOption{isu}{\ExecuteOption{hang}}
3043 \DeclareOption{anne}{\ExecuteOption{centerlast}}
3044 % \end{macrocode}
3045 %
3046 % \newpage^finalhack
3047 %
3048 % \noindent
3049 % There are options for six different font sizes available.
3050 %
3051 % \begin{macrocode}
3052 \DeclareOption{scriptsize}{\renewcommand*{\subcapsize}{\scriptsize}}
3053 \DeclareOption{footnotesize}{\renewcommand*{\subcapsize}{\footnotesize}}
3054 \DeclareOption{small}{\renewcommand*{\subcapsize}{\small}}
3055 \DeclareOption{normalsize}{\renewcommand*{\subcapsize}{\normalsize}}
3056 \DeclareOption{large}{\renewcommand*{\subcapsize}{\large}}
3057 \DeclareOption{Large}{\renewcommand*{\subcapsize}{\Large}}
3058 % \end{macrocode}
3059 %
3060 % \noindent
3061 % There are eighteen options available to set the font attributes of the
3062 % subcaptions. The first nine affect only the subcaption label
3063 % The last nine affect only the subcaption text.
3064 %
3065 % \changes{v2.1}{22 Jan 1997}{Changed order of font options.}
3066 %
3067 % \changes{v2.1}{15 Nov 1997}{Added nine new options to set the format
3068 % of the caption text separately from the caption label.}
3069 %
3070 % \begin{macrocode}
3071 \DeclareOption{rm}{\renewcommand*{\subcaplabelfont@f}{\rmfamily}}
3072 \DeclareOption{sf}{\renewcommand*{\subcaplabelfont@f}{\sffamily}}
3073 \DeclareOption{tt}{\renewcommand*{\subcaplabelfont@f}{\ttfamily}}
3074 \DeclareOption{md}{\renewcommand*{\subcaplabelfont@c}{\mdseries}}
3075 \DeclareOption{bf}{\renewcommand*{\subcaplabelfont@c}{\bfseries}}
3076 \DeclareOption{up}{\renewcommand*{\subcaplabelfont@s}{\upshape}}
3077 \DeclareOption{it}{\renewcommand*{\subcaplabelfont@s}{\itshape}}
3078 \DeclareOption{sl}{\renewcommand*{\subcaplabelfont@s}{\slshape}}
3079 \DeclareOption{sc}{\renewcommand*{\subcaplabelfont@s}{\scshape}}
3080 % \end{macrocode}
3081 %
3082 % \begin{macrocode}
3083 \DeclareOption{RM}{\renewcommand*{\subcapfont@f}{\rmfamily}}
3084 \DeclareOption{SF}{\renewcommand*{\subcapfont@f}{\sffamily}}
3085 \DeclareOption{TT}{\renewcommand*{\subcapfont@f}{\ttfamily}}
3086 \DeclareOption{MD}{\renewcommand*{\subcapfont@c}{\mdseries}}
3087 \DeclareOption{BF}{\renewcommand*{\subcapfont@c}{\bfseries}}
3088 \DeclareOption{IT}{\renewcommand*{\subcapfont@s}{\itshape}}
3089 \DeclareOption{SL}{\renewcommand*{\subcapfont@s}{\slshape}}
3090 \DeclareOption{SC}{\renewcommand*{\subcapfont@s}{\scshape}}
3091 \DeclareOption{UP}{\renewcommand*{\subcapfont@s}{\upshape}}
3092 % \end{macrocode}
3093 %
3094 % \noindent
3095 % There are eight options available to control the caption placement
3096 % and the proper numbering in association with the figure or table
3097 % caption placement. The first four affect only the caption numbering
3098 % by informing the internals that the associated figure or table
3099 % caption appears before or after the subfloat. The second four do
3100 % this and, in addition, shift the subfloat caption to the bottom or
3101 % top of the subfloat. The |\subfigure| and |\subtable| commands each
3102 % have a set of flags since it is often the case that a document style
3103 % requires that figure captions follow the figure and table captions
3104 % precede the table.
3105 %
3106 % \begin{macrocode}
3107 \DeclareOption{figbotcap}{\figuretopcapfalse}
3108 \DeclareOption{figtopcap}{\figuretopcaptrue}
3109 \DeclareOption{tabbotcap}{\tabletopcapfalse}
3110 \DeclareOption{tabtopcap}{\tabletopcaptrue}
3111 % \end{macrocode}
3112 %
3113 % \begin{macrocode}
3114 \DeclareOption{FIGBOTCAP}{\ExecuteOptions{figbotcap}\subfiguretopcapfalse}
3115 \DeclareOption{FIGTOPCAP}{\ExecuteOptions{figtopcap}\subfiguretopcaptrue}
3116 \DeclareOption{TABBOTCAP}{\ExecuteOptions{tabbotcap}\subtabletopcapfalse}
3117 \DeclareOption{TABTOPCAP}{\ExecuteOptions{tabtopcap}\subtabletopcaptrue}
3118 % \end{macrocode}
3119 %
3120 % \begin{macro}{\subfigtopskip}
3121 % \begin{macro}{\subfigcapskip}
3122 % \begin{macro}{\subfigcaptopadj}
3123 % \begin{macro}{\subfigbottomskip}
3124 % \begin{macro}{\subfigcapmargin}
3125 % \begin{macro}{\subfiglabelskip}
3126 %
3127 % \noindent
3128 % The last two options control the overall ``look-and-feel'' of the
3129 % subfloat. The \Lopt{loose} option is the default and makes the
3130 % subfloat look like it always has with lots of extra room around the
3131 % subfigure and subcaption.
3132 %
3133 % \begin{macrocode}
3134 \DeclareOption{loose}{%
3135 \subfigtopskip = 10\p@
3136 \subfigcapskip = 10\p@
3137 \subfigcaptopadj = 0\p@
3138 \subfigbottomskip = 10\p@
3139 \subfigcapmargin = 10\p@
3140 \subfiglabelskip = 0.33em
3141 % \end{macrocode}
3142 % \end{macro}
3143 % \end{macro}
3144 % \end{macro}
3145 % \end{macro}
3146 % \end{macro}
3147 % \end{macro}
3148 %
3149 % \begin{macro}{\@thesubfigure}
3150 % \begin{macro}{\@thesubtable}
3151 % Next, it replaces the glue at the end of the subcaption label with a
3152 % |\space| like the older version of the \Lpack{subfigure} package.
3153 %
3154 % \begin{macrocode}
3155 \renewcommand*{\@thesubfigure}{\thesubfigure\space}
3156 \renewcommand*{\@thesubtable}{\thesubtable\space}
3157 % \end{macrocode}
3158 % \end{macro}
3159 % \end{macro}
3160 %
3161 % \begin{macro}{\ifsf@tight}
3162 %
3163 % Finally, set the \Lif{sf@tight} flag to make the |\@subfloat| command
3164 % skip its check for the top of a page or minipage and to always add
3165 % its topmost vertical spacing. (For more details about the
3166 % |\@subfloat| command, see section~\ref{sec:mainmacros}.)
3167 %
3168 % \begin{macrocode}
3169 \sf@tightfalse}
3170 % \end{macrocode}
3171 % \end{macro}
3172 %
3173 %
3174 % \begin{macro}{\subfigtopskip}
3175 % \begin{macro}{\subfigcapskip}
3176 % \begin{macro}{\subfigcaptopadj}
3177 % \begin{macro}{\subfigbottomskip}
3178 % \begin{macro}{\subfigcapmargin}
3179 % \begin{macro}{\subfiglabelskip}
3180 %
3181 % The \Lopt{tight} option is the is the preferred version and has less white
3182 % space around the subfloat. It also will omit the space above the subfloat
3183 % at the top of the page or minipage.
3184 %
3185 % \begin{macrocode}
3186 \DeclareOption{tight}{%
3187 \subfigtopskip = 5\p@
3188 \subfigcapskip = 0\p@
3189 \subfigcaptopadj = 3\p@
3190 \subfigbottomskip = 5\p@
3191 \subfigcapmargin = \z@
3192 \subfiglabelskip = 0.33em plus 0.07em minus 0.03em
3193 % \end{macrocode}
3194 %
3195 % \end{macro}
3196 % \end{macro}
3197 % \end{macro}
3198 % \end{macro}
3199 % \end{macro}
3200 % \end{macro}
3201 %
3202 % \begin{macro}{\@thesubfigure}
3203 % \begin{macro}{\@thesubtable}
3204 % Next, it keeps the glue at the end of the subcaption label to allow
3205 % better subcaption fitting.
3206 %
3207 % \begin{macrocode}
3208 \renewcommand*{\@thesubfigure}{\thesubfigure\hskip\subfiglabelskip}
3209 \renewcommand*{\@thesubtable}{\thesubtable\hskip\subfiglabelskip}
3210 % \end{macrocode}
3211 % \end{macro}
3212 % \end{macro}
3213 %
3214 % \begin{macro}{\ifsf@tight}
3215 %
3216 % Finally, set the \Lif{sf@tight} flag to make the |\@subfloat| command
3217 % check for the top of a page or minipage and to skip adding any vertical
3218 % space there. (For more details about the |\@subfloat| command, see
3219 % section~\ref{sec:mainmacros}.)
3220 %
3221 % \begin{macrocode}
3222 \sf@tighttrue}
3223 % \end{macrocode}
3224 % \end{macro}
3225 %
3226 % \newpage^finalhack
3227 %
3228 % \subsection{Execution of Options}
3229 % \label{sec:startup}
3230 %
3231 % \changes{v2.1}{11 Oct 1996}{Added a check for a local configuration file.}
3232 %
3233 % \changes{v2.1}{15 Nov 1997}{Added the \Lopt{FIGBOTCAP} and
3234 % \Lopt{TABBOTCAP} options.}
3235 %
3236 % \changes{v2.1.4}{30 Apr 2002}{Changed the subcaption label defaults
3237 % to be hard coded above and no longer in the options list.}
3238 %
3239 % The \Lopt{normal} type of subcaption is preselected, the standard
3240 % subcaption size is set to \Lopt{footnotesize}, and the font for both
3241 % the subcaption label and text is set above to the global defaults for
3242 % family, series, and shape. Also, the subcaptions for the subfigure
3243 % and subtable are placed after the figure box and it is assumed that
3244 % the figure or table caption follows all of the associated subfloats.
3245 % Finally, the \Lopt{loose} form is selected in order to cause minimal
3246 % change to existing papers using the \Lpack{subfigure} package.
3247 %
3248 % The preferred form would be to have the \Lopt{TABTOPCAP} and
3249 % \Lopt{tight} be the defaults, but this would adversely affect the
3250 % existing papers that have used the official releases of this package.
3251 %
3252 % \begin{macrocode}
3253 \ExecuteOptions{normal,footnotesize,FIGBOTCAP,TABBOTCAP,loose}
3254 \InputIfFileExists{subfigure.cfg}{%
3255 \typeout{****************************************^^J%
3256 * Local config file subfigure.cfg used *^^J%
3257 ****************************************}}{}
3258 \ProcessOptions
3259 % \end{macrocode}
3260 %
3261 % \subsection{The Subfigure and Subtable Commands}
3262 % \label{sec:mainmacros}
3263 %
3264 % \changes{v2.1}{23 Jan 2002}{Added setting \cmd{\label} to
3265 % \cmd{\subfloat@label}.}
3266 %
3267 % \changes{v2.1}{11 Oct 1996}{Added command lines. The subfigure
3268 % command was updated to allow a second optional argument. This
3269 % causes changes all the way down to the \cmd{\@subcaption} command.}
3270 %
3271 % \begin{macro}{\subfigure}
3272 % \label{sec:subfigure}
3273 %
3274 % \changes{v2.1.2}{26 Mar 2002}{Added check to see if \cmd{\subfig@oldlabel}
3275 % is defined and if not to save the current definition.}
3276 %
3277 % \changes{v2.1}{22 Jan 1997}{Changed the counter advance to occur
3278 % only if the related boolean is false. This allows \cmd{\caption}'s
3279 % to occur before the subfloats rather than after.}
3280 %
3281 % \changes{v2.1}{07 Mar 1997}{Moved \cmd{\leavevmode} to \cmd{\@subfloat}.}
3282 %
3283 % The |\subfigure| command acts as cover function for the |\@subfloat|
3284 % command. It locally changes the |\label| command to our special version
3285 % that supports the |\subref|'s (see section~\ref{sec:patches}). It
3286 % insures that the proper counter is used and has the correct value.
3287 % Since the caption is usually generated later, we must locally
3288 % anticipate the future value of its counter by adding one to it within
3289 % a local group. Upon leaving |\subfigure|, the old value is restored.
3290 %
3291 % \begin{macrocode}
3292 \newcommand*{\subfigure}{%
3293 \bgroup
3294 \let\subfig@oldlabel=\label
3295 \let\label=\subfloat@label
3296 \@nameuse{if\@captype topcap}\else
3297 \advance\@nameuse{c@\@captype}\@ne
3298 \fi
3299 \refstepcounter{sub\@captype}%
3300 \@ifnextchar [%
3301 {\@subfigure}%
3302 {\@subfigure[\@empty]}}
3303 % \end{macrocode}
3304 % \end{macro}
3305 %
3306 % \begin{macro}{\subtable}
3307 %
3308 % The |\subtable| command is identical to |\subfigure|. The of names
3309 % at the user level is purely cosmetic (and historical).
3310 %
3311 % \begin{macrocode}
3312 \let\subtable=\subfigure
3313 % \end{macrocode}
3314 % \end{macro}
3315 %
3316 %
3317 % \begin{macro}{\@subfigure}
3318 % \changes{v2.1.4}{07 Jun 2002}{Added curly brackets around the
3319 % argument when passing it on as an optional argument.}
3320 %
3321 % Here we are still setting up for the main |\@subfloat| command. We
3322 % check for a second optional argument. If one is not found, than any
3323 % optional argument from the last |\subfigure| or |\subtable| becomes
3324 % the main caption and we give |\@empty| as the default list-entry
3325 % caption. If we see another optional argument, then we make that one
3326 % the main caption and use any prior optional argument as the list-entry
3327 % caption. See Table~\ref{tab:calling} for how this looks to the user.
3328 %
3329 % \begin{macrocode}
3330 \def\@subfigure[#1]{%
3331 \@ifnextchar [%
3332 {\@subfloat{sub\@captype}[{#1}]}%
3333 {\@subfloat{sub\@captype}[\@empty{#1}][{#1}]}}
3334 % \end{macrocode}
3335 % \end{macro}
3336 %
3337 % \begin{macro}{\@subfloat}
3338 %
3339 % \changes{v2.1.4}{24 Apr 2002}{Changed \cmd{\@subfloat} to globally
3340 % reset the figure/table counter if it was incremented so that any
3341 % subfloat body that resets the counters globally will not cause
3342 % errors ({\it e.g.\/}, the \Lpack{tabularx} package}
3343 %
3344 % \changes{v2.1}{23 Jan 2002}{Now using \cmd{\@nameuse} to build names.
3345 % Made the \cmd{\def} a \cmd{\long}\cmd{\def}.}
3346 %
3347 % \changes{v2.1}{22 Apr 1998}{Added some percents to keep out whitespace}
3348 %
3349 % \changes{v2.1}{07 Mar 1997}{Changed the addition of the
3350 % \cmd{\subfigtopskip} to be added only if not at the top of the
3351 % float and only in vertical mode. Moved \cmd{\leavevmode} from
3352 % \cmd{\subfigure} to after the topskip addition.}
3353 %
3354 % \changes{v2.1}{17 Jan 1997}{Added swap of the top and bottom space
3355 % when in TOPCAP mode.}
3356 %
3357 % This is the common code for setting up the subfloat box and drawing
3358 % the subcaption under it. The two skips are used only here to keep
3359 % track of what vertical space is to be placed before and after the
3360 % figure.
3361 %
3362 % The first argument is the type of object being generated: that is,
3363 % a |subfigure| or a |subtable|. The second and third are the
3364 % \texttt{subcaption} and \texttt{subfigure} arguments from the
3365 % calling |\subfigure| or |\subtable| command.
3366 %
3367 % \begin{macrocode}
3368 \newskip\subfig@top
3369 \newskip\subfig@bottom
3370 % \end{macrocode}
3371 %
3372 % If \Lif{ifsf@tight} is true, then the |\@subfloat| command checks to
3373 % see if it is at the top of a page or a minipage and will suppress the
3374 % top vertical space in that case; otherwise, it always adds the space.
3375 %
3376 % \begin{macrocode}
3377 \long\def\@subfloat#1[#2][#3]#4{%
3378 \@tempcnta=1
3379 \ifsf@tight
3380 \if@minipage
3381 \@tempcnta=\z@
3382 \else\ifdim \lastskip=\z@ \else
3383 \@tempcnta=2
3384 \fi\fi
3385 \fi
3386 % \end{macrocode}
3387 %
3388 % Based on the |\iffiguretopcap| or |\iftabletopcap| flags we
3389 % select which vertical space is to be placed above and below the figure
3390 % or table and save it in |\subfig@top| and |\subfig@bottom|.
3391 %
3392 % \begin{macrocode}
3393 \@nameuse{if\@captype topcap}%
3394 \subfig@top=\subfigbottomskip
3395 \subfig@bottom=\subfigtopskip
3396 \else
3397 \subfig@top=\subfigtopskip
3398 \subfig@bottom=\subfigbottomskip
3399 \fi
3400 % \end{macrocode}
3401 %
3402 % The |\leavevmode| is here to inhibit any \LaTeX\ errors that the
3403 % surreounding environment might generate if we stay in vertical mode.
3404 % Then it determines the width of the figure or table by placing it in a
3405 % box and testing the box.
3406 %
3407 % \begin{macrocode}
3408 \leavevmode
3409 \setbox\@tempboxa \hbox{#4}%
3410 \@tempdima=\wd\@tempboxa
3411 % \end{macrocode}
3412 %
3413 % Finally we put the figure together in a vertical box. At the very top
3414 % goes any vertical space, but only if we are not at the top of the page
3415 % or minipage as determined above.
3416 %
3417 % \begin{macrocode}
3418 \vtop\bgroup
3419 \vbox\bgroup
3420 \ifcase\@tempcnta
3421 \@minipagefalse
3422 \or
3423 \vspace{\subfig@top}%
3424 \or
3425 \ifdim \lastskip=\z@ \else
3426 \@tempskipb\subfig@top\relax\@xaddvskip
3427 \fi
3428 \fi
3429 % \end{macrocode}
3430 %
3431 % Next, based on the `topcap' flags, we check if the subcaption or the
3432 % figure goes next. If it is the subcaption, then we add some extra
3433 % |\subfigcaptopadj| space between the subcaption and the figure and
3434 % table in addtion to the regular |\subfigcapskip| space. This finishes
3435 % off the top box and establishes our baseline.
3436 %
3437 % After that we add in either the figure or subcaption (whichever we
3438 % have not typeset yet and follow it with the bottom vertical space.
3439 % (see figure~\ref{fig:layout-C} for a diagram of this layout).
3440 %
3441 % Finally, we globally ({\bf !}) reset the \Lcount{figure} or
3442 % \Lcount{table} counter, if we incremented it at the beginning of the
3443 % |\subfigure| or |\subtable| command so that any functions used inside
3444 % the command body which globally sets the counters ({\it e.g.\/}, the
3445 % \Lpack{tabularx} package) will not cause problems.
3446 %
3447 % \begin{macrocode}
3448 \@nameuse{if#1topcap}%
3449 \ifx \@empty#3\relax \else
3450 \@subcaption{#1}{#2}{#3}%
3451 \vskip\subfigcapskip
3452 \vskip\subfigcaptopadj
3453 \fi\egroup
3454 \box\@tempboxa
3455 \else
3456 \box\@tempboxa\egroup
3457 \ifx \@empty#3\relax \else
3458 \vskip\subfigcapskip
3459 \@subcaption{#1}{#2}{#3}%
3460 \fi
3461 \fi
3462 \vspace{\subfig@bottom}%
3463 \egroup
3464 \@nameuse{if\@captype topcap}\else
3465 \global\advance\@nameuse{c@\@captype}\m@ne
3466 \fi
3467 \egroup}
3468 % \end{macrocode}
3469 % \end{macro}
3470 %
3471 % \begin{macro}{\@subfigcaptionlist}
3472 %
3473 % \begin{macro}{\@subcaption}
3474 %
3475 % \changes{v2.1}{23 Jan 2002}{Now using \cmd{\@nameuse} to build names.
3476 % Also use \@@thesubfigure and \@@thesubtable stored label.}
3477 %
3478 % \begin{macro}{\listsubcaptions}
3479 %
3480 % \changes{v2.1.4}{09 Jul 2002}{Changed \cmd{\@tempa} to \cmd{\sf@temp}
3481 % at the request of Donald Arseneau to remove the potential of problems
3482 % with others using the same variable.}
3483 % \changes{v2.1}{22 Oct 1996}{Added to allow the user to cause a dump
3484 % of the currently queued subcaptions to the ``List-of'' page. This
3485 % is necessary when the \cmd{caption} is placed before the subfloats
3486 % as is often the case for subtables.}
3487 %
3488 % \changes{v2.1}{11 Oct 1996}{Fixed \cmd{\protect} related bug caused by
3489 % a change in \LaTeX3.}
3490 % \begin{macro}{\@listsubcaptions}
3491 %
3492 % \changes{v2.1}{23 Jan 2002}{Added checks for undefined \cmd{\@captype}
3493 % and \cmd{ext@<\@captype>} just in case the \cmd{caption} is called
3494 % outside the \Lenv{float} or the current float type does not support
3495 % subfigures.}
3496 %
3497 % \changes{v2.1}{11 Oct 1996}{Added to print the queued subcaptions.
3498 % This is also used by the \Lpack{captcont} package to correctly print
3499 % the subcaptions.}
3500 %
3501 % \changes{v2.1}{17 Jan 1997}{Changed the source of the label for the
3502 % ``List-of'' pages to use the \cmd{\thesubfigure} or \cmd{\thesubtable}
3503 % value rather than the \cmd{\@currentlabel}. This usually will be
3504 % cleaner since the figure number won't be repeated.}
3505 %
3506 % \changes{v2.1}{05 Jan 1998}{Changed \cmd{\edef} to \cmd{\def} and added
3507 % back the \cmd{\protect} due to changes in the use of the
3508 % \cmd{\@subcaption}.}
3509 %
3510 % The following series of commands control exactly how the subcaption is
3511 % typeset. The |\@subcaption| command adds the subcaption to the current
3512 % list of subcaptions to be added to the ``List-of'' page as soon as
3513 % the major caption is declared (see |\@caption| below).
3514 % ({\scshape Note}: only one list is kept because that seems right;
3515 % if there is a mix of tables and figures, they will be grouped
3516 % under the next |\caption|\@.) Next |\@subcaption| calls the
3517 % appropriate float-type specific command to decide how to size and shape
3518 % the subcaption text.
3519 %
3520 % \begin{macrocode}
3521 \newcommand*{\@subfigcaptionlist}{}
3522 % \end{macrocode}
3523 % \begin{macrocode}
3524 \newcommand{\@subcaption}[3]{%
3525 \ifx \relax#2\relax \else
3526 \bgroup
3527 \let\label=\@gobble
3528 \let\protect=\string
3529 \def\@subcaplabel{\@nameuse{@@the#1}}%
3530 \xdef\@subfigcaptionlist{%
3531 \@subfigcaptionlist,%
3532 {\protect\numberline{\@subcaplabel}\noexpand{\ignorespaces #2}}}%
3533 \egroup
3534 \fi
3535 \@nameuse{@make#1caption}{\@nameuse{@the#1}}{#3}}
3536 % \end{macrocode}
3537 %
3538 % \begin{macrocode}
3539 \newcommand*{\listsubcaptions}{%
3540 \@ifstar
3541 {\gdef\@subfigcaptionlist{}}%
3542 {\@listsubcaptions{\@captype}}}
3543 % \end{macrocode}
3544 %
3545 % \begin{macrocode}
3546 \newcommand*{\@listsubcaptions}[1]{%
3547 \@ifundefined{@captype}{}{%
3548 \@ifundefined{ext@sub#1}{}{%
3549 \@for \sf@temp:=\@subfigcaptionlist \do {%
3550 \ifx \@empty\sf@temp\relax \else
3551 \addcontentsline
3552 {\@nameuse{ext@sub#1}}%
3553 {sub#1}%
3554 {\sf@temp}%
3555 \fi}}}%
3556 \gdef\@subfigcaptionlist{}}
3557 % \end{macrocode}
3558 % \end{macro}
3559 % \end{macro}
3560 % \end{macro}
3561 % \end{macro}
3562 %
3563 % \begin{macro}{\@makesubfigurecaption}
3564 % \begin{macro}{\@makesubtablecaption}
3565 %
3566 % \changes{v2.1}{17 Jan 1997}{Added the new font control.}
3567 %
3568 % By default, the |\@subfigurecaption| and |\@subtablecaption|
3569 % commands are identical. Unlike the standard |\@makecaption| command,
3570 % we assume that the first argument (the label number produced by
3571 % the |\@thesubfigure| or the |\@thesubtable|) contains any trailing
3572 % separator characters or spacing (which makes it easier to customize).
3573 %
3574 % \newpage^finalhack
3575 %
3576 % The |\@makesubfigurecaption| command first checks the size of the
3577 % caption typeset as a single line. It knocks off twice the
3578 % |\subfigcapmargin| (at it's regular size) to determine the with of the
3579 % caption and label.
3580 %
3581 % \begin{macrocode}
3582 \newcommand{\@makesubfigurecaption}[2]{%
3583 \setbox\@tempboxa\hbox{%
3584 \subcapsize
3585 {\subcaplabelfont #1}%
3586 {\subcapfont\ignorespaces #2}}%
3587 \@tempdimb=-\subfigcapmargin
3588 \multiply\@tempdimb\tw@
3589 \advance\@tempdimb\@tempdima
3590 % \end{macrocode}
3591 %
3592 % Next it creates a horizontal box of that width and if the label plus
3593 % the text was too wide or if the \Lif{subcapnooneline} flag is true,
3594 % then it sends off the label and subcaption to |\subfig@caption| to
3595 % typset as a paragraph. NOTE: |\subfig@caption| assumes that
3596 % |\@tempbdimb| has the calculated width for the paragraph.
3597 %
3598 % If the label plus the text will fit and the \Lif{subcapnooneline} flag
3599 % is false, then we just return them (from box |\@tempboxa|).
3600 %
3601 % \begin{macrocode}
3602 \hbox to\@tempdima{%
3603 \hss
3604 \ifdim \wd\@tempboxa >\@tempdimb
3605 \subfig@caption{#1}{#2}%
3606 \else\ifsubcapnooneline
3607 \subfig@caption{#1}{#2}%
3608 \else
3609 \box\@tempboxa
3610 \fi\fi
3611 \hss}}
3612 % \end{macrocode}
3613 %
3614 % \begin{macrocode}
3615 \let\@makesubtablecaption=\@makesubfigurecaption
3616 % \end{macrocode}
3617 % \end{macro}
3618 % \end{macro}
3619 %
3620 % \begin{macro}{\subfig@caption}
3621 %
3622 % \changes{v2.1}{23 Jan 2002}{Added \cmd{\subcapfont} and
3623 % \cmd{\ignorespaces} before the caption text. So that it does not
3624 % interfere with the label font settings. This fixes a bug found by
3625 % Axel Sommerfeldt.}
3626 %
3627 % \begin{macro}{\subfig@captionpar}
3628 %
3629 % \changes{v2.1}{23 Jan 2002}{Simplified by removing the font settings.
3630 % It is up to the caller to enforce these! This fixes a bug found by
3631 % Axel Sommerfeldt.}
3632 %
3633 % \changes{v2.1}{17 Jan 1997}{Added the new font control.}
3634 %
3635 % These commands are called to typeset a multiple-line subcaption (or a
3636 % single line when \Lif{subcapnooneline} is true). Depending on the
3637 % \Lif{subcapcenter} and \Lif{subcapcenterlast} flags, the text will be
3638 % justified (both false), centered (\Lif{subcapcenter} true), or
3639 % justified with the last line centered (only the flag
3640 % \Lif{subcapcenterlast} set true).
3641 %
3642 % \begin{macrocode}
3643 \newcommand{\subfig@caption}[2]{%
3644 \ifsubcaphang
3645 \sbox{\@tempboxa}{\subcapsize\subcaplabelfont #1}%
3646 \addtolength{\@tempdimb}{-\wd\@tempboxa}%
3647 \usebox{\@tempboxa}%
3648 \subfig@captionpar{\@tempdimb}{%
3649 {\subcapfont\ignorespaces #2}}%
3650 \else
3651 \subfig@captionpar{\@tempdimb}{%
3652 {\subcaplabelfont #1}%
3653 {\subcapfont\ignorespaces #2}}%
3654 \fi}
3655 % \end{macrocode}
3656 %
3657 % \begin{macrocode}
3658 \newcommand{\subfig@captionpar}[2]{%
3659 \parbox[t]{#1}{%
3660 \subcapsize
3661 \ifsubcapraggedright
3662 \setlength{\leftskip}{\z@}%
3663 \setlength{\@rightskip}{\@flushglue}%
3664 \setlength{\rightskip}{\@rightskip}%
3665 \setlength{\parindent}{\z@}%
3666 \else\ifsubcapcenter
3667 \setlength{\leftskip}{\@flushglue}%
3668 \setlength{\rightskip}{\@flushglue}%
3669 \setlength{\parfillskip}{\z@skip}%
3670 \else\ifsubcapcenterlast
3671 \addtolength{\leftskip}{\z@ plus 1fil}%
3672 \addtolength{\rightskip}{\z@ plus -1fil}%
3673 \setlength{\parfillskip}{\z@ plus 2fil}%
3674 \fi\fi\fi
3675 #2}}
3676 % \end{macrocode}
3677 % \end{macro}
3678 % \end{macro}
3679 %
3680 % \subsection{Patches to the Standard Environment}
3681 % \label{sec:patches}
3682 %
3683 % The following adjust the standard environment for the
3684 % \Lpack{subfigure} package. They are designed as wrappers to the
3685 % current definition of the standard commands to minimize any chance of
3686 % conflict with other packages or to extend \LaTeX.
3687 %
3688 % \begin{macro}{\@dottedxxxline}
3689 % \label{sec:dl}
3690 % This is a generalized wrapper for the |\@dottedtocline| command.
3691 % It checks for the level based on the output file (first argument)
3692 % and not using only |\@tocdepth|. (See section~\ref{sec:listof}
3693 % for a description of the arguments.)
3694 %
3695 % \begin{macrocode}
3696 \newcommand*{\@dottedxxxline}[6]{%
3697 \ifnum #2>\@nameuse{c@#1depth}\else
3698 \@dottedtocline{0}{#3}{#4}{#5}{#6}
3699 \fi}
3700 % \end{macrocode}
3701 % \end{macro}
3702 %
3703 % \begin{macro}{\subfig@end@float}
3704 % \begin{macro}{\subfig@end@dblfloat}
3705 % \begin{macro}{\end@float}
3706 % \begin{macro}{\end@dblfloat}
3707 %
3708 % \changes{v2.1}{05 Jan 1998}{Added this section to minimize the need
3709 % for \cmd{\listofcaptions}.}
3710 %
3711 % These commands patch the end of the \Lenv{float} environment so that it will
3712 % dump out the subcaptions if any remain at this point. This can occur
3713 % when using the \Lopt{TOPCAP} options.
3714 % \begin{macrocode}
3715 \let\subfig@end@float=\end@float
3716 % \end{macrocode}
3717 %
3718 % \begin{macrocode}
3719 \renewcommand*{\end@float}{%
3720 \@listsubcaptions{\@captype}%
3721 \subfig@end@float}
3722 % \end{macrocode}
3723 %
3724 % \begin{macrocode}
3725 \let\subfig@end@dblfloat=\end@dblfloat
3726 % \end{macrocode}
3727 %
3728 % \begin{macrocode}
3729 \renewcommand*{\end@dblfloat}{%
3730 \@listsubcaptions{\@captype}%
3731 \subfig@end@dblfloat}
3732 % \end{macrocode}
3733 % \end{macro}
3734 % \end{macro}
3735 % \end{macro}
3736 % \end{macro}
3737 %
3738 % \newpage^finalhack
3739 % \enlargethispage{3\baselineskip}^finalhack
3740 %
3741 % \begin{macro}{\subfig@oldcaption}
3742 % \begin{macro}{\@caption}
3743 %
3744 % \changes{v2.1}{23 Jan 2002}{Now using \cmd{\@nameuse} to build names.
3745 % Added a check for topcap flag. If it is not defined, we assume that
3746 % this float type does not support subfigures.}
3747 %
3748 % \changes{v2.1}{05 Jan 1998}{Changed to print the subcaptions before
3749 % or after the caption, depending on the TOPCAP setting of the current
3750 % environment.}
3751 %
3752 % Next, we redefine the current |\@caption| command to dump any
3753 % subcaptions saved. First the `old' caption command is called to
3754 % add the line to the ``List-of'' file and then the list of
3755 % subcaptions, |\@subfigcaptionlist| is written to the same file.
3756 % Lastly, the |\@subfigcaptionlist| is reinitialized.
3757 %
3758 % \begin{macrocode}
3759 \let\subfig@oldcaption=\@caption
3760 % \end{macrocode}
3761 %
3762 % \begin{macrocode}
3763 \long\def\@caption#1[#2]#3{%
3764 \@ifundefined{if#1topcap}%
3765 {\subfig@oldcaption{#1}[{#2}]{#3}}%
3766 {\@nameuse{if#1topcap}%
3767 \@listsubcaptions{#1}%
3768 \subfig@oldcaption{#1}[{#2}]{#3}%
3769 \else
3770 \subfig@oldcaption{#1}[{#2}]{#3}%
3771 \@listsubcaptions{#1}%
3772 \fi}}
3773 % \end{macrocode}
3774 % \end{macro}
3775 % \end{macro}
3776 %
3777 % \begin{macro}{\subfig@oldlabel}
3778 %
3779 % To support the redefinition of the |\label| command within the body of
3780 % the subfloats, we will use |\subfig@oldlabel| to save the current
3781 % definition of |\label| and create the |\subfloat@label| command to take its
3782 % place during the processing of the |\subfigure| command. Since the
3783 % definition of |\label| may change as packages are loaded, we save the
3784 % definition each time that |\label| is replaced with |\sub@label|
3785 % (see \ref{sec:subfigure} above).
3786 %
3787 % \begin{macrocode}
3788 \let\subfig@oldlabel=\relax
3789 % \end{macrocode}
3790 % \end{macro}
3791 %
3792 % \begin{macro}{\subfloat@label}
3793 % \begin{macro}{\sub@label}
3794 %
3795 % \changes{v2.1.4}{02 Jul 2002}{Added reference to this command via
3796 % the name \cmd{subfloat@label} to avoid packages that replace the
3797 % name without the support of the optional argument. The old name
3798 % is still here to decoy the other packages. Added chapter number
3799 % in the automatically generated label to increase uniqueness.}
3800 %
3801 % One difference from the regular |\label| command is that there is an
3802 % optional argument (note with parentheses rather than square brackets)
3803 % that is only used with the \Lpack{hyperref} package to define the
3804 % {\em bookmark\/} argument to the label. Typically, this would be a
3805 % copy or paraphrase of the subcaption text. If this is not given and
3806 % the \Lpack{hyperref} package is being used, then the {\em bookmark\/}
3807 % argument is of the form ``Subfigure\textvisiblespace 1(a)''.
3808 %
3809 % \begin{macrocode}
3810 \newcommand*{\subfloat@label}{%
3811 \@ifnextchar(
3812 {\sf@sub@label}
3813 {\sf@sub@label(Sub\@captype\space
3814 \@ifundefined{thechapter}{}{%
3815 \@nameuse{thechapter}\space}%
3816 \@nameuse{p@sub\@captype}%
3817 \@nameuse{thesub\@captype}.)}}
3818 % \end{macrocode}
3819 % \begin{macrocode}
3820 \let\sub@label\subfloat@label
3821 % \end{macrocode}
3822 %
3823 % \end{macro}
3824 % \end{macro}
3825 %
3826 % \begin{macro}{\sf@sub@label}
3827 %
3828 % \changes{v2.1.4}{02 Jul 2002}{Moved \cmd{\relax} from the
3829 % \cmd{\sf@@sub@label} to here.}
3830 %
3831 % \changes{v2.1.1}{15 Mar 2002}{Added coordination with the hyperref
3832 % package.}
3833 %
3834 % The |\sf@sub@label| parses the optional argument and (if the
3835 % \Lpack{hyperref} Package is loaded) saves the {\em bookmark\/} text
3836 % as |\@currentlabelname|. It then calls the |\sf@@sub@label| command
3837 % to the real processing of the label.
3838 %
3839 % \begin{macrocode}
3840 \def\sf@sub@label(#1)#2{%
3841 \ifhyperrefloaded
3842 \protected@edef\@currentlabelname{%
3843 \expandafter\strip@period #1\relax.\relax\@@@}%
3844 \fi
3845 \sf@@sub@label{#2}}
3846 % \end{macrocode}
3847 % \end{macro}
3848 %
3849 % \begin{macro}{\sf@@sub@label}
3850 %
3851 % \changes{v2.1.4}{02 Jul 2002}{Moved \cmd{\relax} from here to the
3852 % \cmd{\sf@sub@label}.}
3853 %
3854 % \changes{v2.1.2}{26 Mar 2002}{Changed to simplify the operation and
3855 % to avoid a bug in the hyperref package.}
3856 %
3857 % \changes{v2.1.1}{15 Mar 2002}{Added coordination with the hyperref
3858 % package.}
3859 %
3860 % In order to support the \Lpack{hyperref} package we check if it was
3861 % loaded and use the proper form of the |\newlabel| command. |\sf@@sub@label|
3862 % operates by first calling the old |\label| definition (which adds a
3863 % |\newlabel| command to the \Lfile{*.aux} file) and then adds another
3864 % |\newlabel| command to the \Lfile{*.aux} file with a similar reference
3865 % name (with `sub@' prepended) and the value of |\@@thesubfigure| or
3866 % |\@@thesubtable|.
3867 %
3868 % If the |\ifhyperrefloaded| flag is set, then the |\newlabel| command
3869 % has three extra fields, the first is the value of |\@currentlabelname|,
3870 % which is either of the form ``Subfigure\textvisiblespace1(a)'' or
3871 % was defined by the optional argument to |\label| (actually
3872 % |\sub@label|). The second extra field is the hypertext anchor name
3873 % and the third is unused. Otherwise, the we us the standard |\newlabel|
3874 % form to write the sub-reference.
3875 %
3876 % \begin{macrocode}
3877 \newcommand*{\sf@@sub@label}[1]{%
3878 \@bsphack
3879 \subfig@oldlabel{#1}%
3880 \ifhyperrefloaded
3881 \protected@write\@auxout{}{%
3882 \string\newlabel{sub@#1}%
3883 {{\@nameuse{@@thesub\@captype}}%
3884 {\thepage}%
3885 {\expandafter\strip@period\@currentlabelname\relax.\relax\@@@}%
3886 {\@currentHref}%
3887 {}}}%
3888 \else
3889 \protected@write\@auxout{}{%
3890 \string\newlabel{sub@#1}%
3891 {{\@nameuse{@@thesub\@captype}}%
3892 {\thepage}}}%
3893 \fi
3894 \@esphack}
3895 % \end{macrocode}
3896 %
3897 % \end{macro}
3898 %
3899 % \begin{macro}{\subref}
3900 %
3901 % The |\subref| command is the same as the |\ref| command except that
3902 % |\@@thesubtable| instead of |\p@subfigure\thesubfigure| or
3903 % |\p@subtable\thesubtable|. This is often of use for local references
3904 % within the figure where the figure number may be assumed; or, for ease
3905 % in constructing a range of references within a figure with many
3906 % subfigures.
3907 %
3908 % \begin{macrocode}
3909 \newcommand\subref[1]{%
3910 \ref{sub@#1}}
3911 % \end{macrocode}
3912 %
3913 % \end{macro}
3914 %
3915 % \begin{macro}{\Subref}
3916 %
3917 % \changes{v2.1.2}{26 Mar 2002}{Changed \cmd{\subref*} to \cmd{\Subref} to
3918 % avoid problems in writing to the \Lfile{aux} file.}
3919 %
3920 % \changes{v2.1}{23 Jan 2002}{Added \cmd{\subref*} at the request of Benoit
3921 % Hudson (bhudson\@cs.cmu.edu).}
3922 %
3923 % The |\Subref| command is the same as |\subref|, except that it adds
3924 % |\subcaplabelfont| before the reference so that it uses the same font
3925 % (except that the current font size is maintained).
3926 %
3927 % \begin{macrocode}
3928 \newcommand\Subref[1]{%
3929 {\subcaplabelfont
3930 \ref{sub@#1}}}
3931 % \end{macrocode}
3932 % \end{macro}
3933 %
3934 % \iffalse
3935 %</package>
3936 % \fi
3937 %
3938 % \Finale
3939 %
3940 \endinput