-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubfig.dtx
executable file
·4714 lines (4711 loc) · 185 KB
/
subfig.dtx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% \iffalse % meta-comment
% subfig.dtx
% Sub-float macros for use with the LaTeX figure/table environments.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Copyright © 2003, 2004, 2005 Steven Douglas Cochran.
%
% This work (the subfig package) may be distributed and/or modified
% under the conditions of the LaTeX Project Public License, either
% version 1.3 of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
%
% This work has the LPPL maintenance status "author-maintained".
%
% This Current Maintainer of this work is Steven Douglas Cochran.
%
% This work consists of all files listed under "MANIFEST" in the
% README file distributed with the subfig package.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% @LaTeX-style-file{
%% author = "Steven Douglas Cochran",
%% version = "1.3",
%% date = "2005/07/05",
%% time = "04:19:08",
%% filename = "subfig.sty",
%% address = "Digital Mapping Laboratory,
%% School of Computer Science
%% Carnegie-Mellon University,
%% 5000 Forbes Avenue
%% Pittsburgh, PA 15213-3890
%% USA",
%% telephone = "+1 412.268.5654",
%% fax = "+1 412.268.5576",
%% email = "[email protected]",
%% codetable = "ISO/ASCII",
%% keywords = "LaTeX, float, sub-float, continued figure",
%% supported = "yes",
%% abstract = "LaTeX package for providing support for the
%% inclusion of small, `sub', figures and tables. It
%% simplifies the positioning, captioning and
%% labeling of them within a single figure or table
%% environment. In addition, this package allows
%% such sub-captions to be written to the List of
%% Figures or List of Tables if desired."
%% }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \fi
%
% \catcode`\^=14 ^ We will use a ^ for a comment.
%
% \def\filename{subfig.dtx}
% \def\fileversion{version 1.3}
% \def\filedate{2005/06/28} ^ Last code change
% \def\docdate{2005/07/05} ^ Last documentation change
%
% \CheckSum{1183}
%
% \iffalse
%<*driver>
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesFile{subfig.dtx}
\documentclass[a4paper]{ltxdoc}
\usepackage{hyperref}
\makeatletter
\@twosidetrue
\def\cmd#1{\cs{\expandafter\cmd@to@cs\string#1}}
\def\cmd@to@cs#1#2{#2}
\DeclareRobustCommand\cs[1]{\textbackslash #1}
%
% Widen the standard ltxdoc pagesize, just a little.
%
\setlength\topmargin {0pt}
\setlength\headheight {12pt}
\setlength\headsep {24pt}
\setlength\@tempdima {\paperheight}
\addtolength\@tempdima {-2in}
\addtolength\@tempdima {-\headheight}
\addtolength\@tempdima {-\headsep}
\divide\@tempdima \baselineskip
\@tempcnta \@tempdima
\setlength\textheight {\@tempcnta\baselineskip}
%
\setlength\textwidth {\paperwidth}
\addtolength\textwidth {-3in}
\addtolength\textwidth {-20pt}
\setlength\oddsidemargin {1in}
\addtolength\textwidth {20pt}
\setlength\evensidemargin {\oddsidemargin}
%
\setlength\marginparsep {8pt}
\setlength\marginparwidth {2in}
\makeatother
\RequirePackage[format=hang,justification=RaggedRight]{caption}[2005/06/26]
\RequirePackage[format=default,justification=justified,%
lofdepth=2,lotdepth=2,subrefformat=parens]{subfig}[2005/06/28]
% Create map and submap floats for example
\usepackage{float}
\newfloat{map}{tbph}{lom}
\restylefloat*{map}
\floatstyle{plain}
\floatname{map}{Map}
\captionsetup[map]{position=top}
\newsubfloat[position=top,listofformat=simple]{map}
\newcommand{\listofmaps}{\listof{map}{List of Maps}}
\setcounter{lomdepth}{2}
% Other packages
\usepackage{color}
\definecolor{lightgray}{gray}{.8}
\IfFileExists{booktabs.sty}{%
\usepackage{booktabs}%
}{%
\PackageWarning{subfig}%
{booktabs.sty is missing.\MessageBreak
I'm emulating the needed commands, but you should\MessageBreak
install it for better results.}%
\let\toprule\hline
\let\midrule\hline
\let\bottomrule\hline
}
% Handy temp values.
\newbox{\tempbox}
\newdimen{\tempdima}
\newdimen{\tempdimb}
% Make a SubFloat environment.
\makeatletter
\newbox\sf@box
\newenvironment{SubFloat}[2][]%
{\def\sf@one{#1}%
\def\sf@two{#2}%
\setbox\sf@box\hbox
\bgroup}%
{ \egroup
\ifx\@empty\sf@two\@empty\relax
\def\sf@two{\@empty}
\fi
\ifx\@empty\sf@one\@empty\relax
\subfloat[\sf@two]{\box\sf@box}%
\else
\subfloat[\sf@one][\sf@two]{\box\sf@box}%
\fi}
\makeatother
% Adjust internal stuff
\makeatletter
\IfFileExists{multirow.sty}{%
\usepackage{multirow}%
}{%
\PackageWarning{subfig}%
{multirow.sty is missing.\MessageBreak
I'm emulating the needed command, but you should\MessageBreak
install it for better results.}%
\def\multirow##1##2##3{%
\@tempcnta=##1%
\@tempdima\@tempcnta\ht\@arstrutbox
\advance\@tempdima\@tempcnta\dp\@arstrutbox
\ifnum\@tempcnta<0%
\@tempdima=-\@tempdima
\fi
\if*##2
\setbox0\vtop to \@tempdima{%
\vfill
\raggedright
\hbox{\strut##3\strut}%
\vfill}%
\else
\setbox0\vtop to \@tempdima{%
\hsize##2
\@parboxrestore
\vfill
\raggedright
\strut##3\strut\par
\vfill}%
\fi
\ht0\z@
\dp0\z@
\ifnum\@tempcnta<0%
\advance\@tempdima-\dp\@arstrutbox
\else
\@tempdima=\ht\@arstrutbox
\fi
\leavevmode
\vtop{%
\vskip-\@tempdima
\box0%
\vss}}}
\makeatother
% Penalty Settings
\setlength\hfuzz{100pt} \setlength\vfuzz{100pt} \clubpenalty=10000
\widowpenalty=10000 \displaywidowpenalty=5000 \brokenpenalty=5000
\begin{document}
\pagestyle{empty}
\DocInput{subfig.dtx}
\end{document}
%</driver>
%
%<*ltxdoc>
\AtBeginDocument{%
% \OnlyDescription % comment out for implementation details
\EnableCrossrefs
\RecordChanges
\CodelineIndex
}
\AtEndDocument{
\newpage
\PrintChanges
\newpage
\PrintIndex
}
%</ltxdoc>
%
% \fi
% \newcommand*{\Lopt}[1]{\textsf{#1}} ^ Package options
% \newcommand*{\Lfile}[1]{\texttt{#1}} ^ File names
% \newcommand*{\Lpack}[1]{\textsf{#1}} ^ Package names
% \newcommand*{\Lenv}[1]{\texttt{#1}} ^ Environment names
% \newcommand*{\Lcount}[1]{\textsl{\small#1}} ^ Counter names
% \newcommand*{\Lif}[1]{\textsc{\bf#1}} ^ \if names
% \newcommand*{\Lvar}[1]{``#1''} ^ variable names
% \newcommand*{\Lkv}[1]{`#1'} ^ keyword/value names
%
% ^^
% ^^ NOTE: Hacks added to make the final format (if any)
% ^^ are marked with the comment ``^finalhack''.
% ^^
%
% \changes{v1.0}{21 August 2003}{Created (based on the \Lpack{subfigure}
% package.}
% \changes{v1.2}{28 January 2004}{Changed the names \Lkv{topskip} to
% \Lkv{farskip}, and \Lkv{bottomskip} to \Lkv{nearskip}. Added
% a hyphen to ``sub-float'' and ``sub-caption'' where they occurs as
% regular text to match the usage in The \LaTeX\ Companion. Also fixed
% bug in the alternative code if the \Lpack{multirow} package is not found.}
% \changes{v1.3}{26 March 2004}{Lots of documentation changes. I hope
% that they are improvements!}
%
% \DoNotIndex{\@@@,\@auxout,\@bsphack,\@classoptionslist,\@currbox}
% \DoNotIndex{\@currext,\@currname\@dblarg,\@dottedtocline,\@ehd,\@empty}
% \DoNotIndex{\@esphack,\@expandtwoargs,\@firstofone,\@firstoftwo}
% \DoNotIndex{\@floatpenalty,\@for,\@gobble,\@ifnextchar}
% \DoNotIndex{\@ifpackageloaded,\@ifstar,\@ifundefined,\@largefloatcheck}
% \DoNotIndex{\@latex@error,\@minipagefalse,\@namedef,\@nameuse,\@ne}
% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@ptionlist,\@removeelement}
% \DoNotIndex{\@secondoftwo,\@setminipage,\@undefined}
% \DoNotIndex{\@unprocessedoptions,\@unusedoptionlist,\@xaddvskip}
% \DoNotIndex{\addcontentsline,\addtocounter,\advance,\alph,\arabic}
% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\begin,\begingroup}
% \DoNotIndex{\bfseries,\bgroup,\box,\cmd,\csname,\CurrentOption,\def}
% \DoNotIndex{\define@key,\do,\dp,\edef,\egroup,\else,\end,\endcsname}
% \DoNotIndex{\endgroup,\endinput,\expandafter,\fi,\footnotesize,\gdef}
% \DoNotIndex{\global,\hb@xt@,\hbox,\hrule,\hss,\ht,\if@minipage,\ifcase}
% \DoNotIndex{\ifdim,\ifnum,\ifx,\ignorespaces,\InputIfFileExists}
% \DoNotIndex{\itshape,\l@addto@macro,\label,\Large,\large,\lastskip}
% \DoNotIndex{\leaders,\leavevmode,\let,\long,\m@ne,\mdseries}
% \DoNotIndex{\NeedsTeXFormat,\newcounter,\newdimen,\newif,\newlabel}
% \DoNotIndex{\newskip,\next,\noexpand,\normalsize,\numberline,\or,\p@}
% \DoNotIndex{\PackageError,\PackageWarning,\pageref,\par,\parbox}
% \DoNotIndex{\protect,\protected@edef,\protected@write,\ProvidesPackage}
% \DoNotIndex{\ref,\refstepcounter,\relax,\RequirePackage,\rmfamily}
% \DoNotIndex{\romannumeral,\scriptsize,\scshape,\setbox,\setcounter}
% \DoNotIndex{\sffamily,\slshape,\small,\space,\string,\strip@period}
% \DoNotIndex{\the,\thepage,\thr@@,\ttfamily,\tw@,\typeout,\upshape}
% \DoNotIndex{\value,\vbox,\vrule,\vskip,\vtop,\wd,\xdef,\z@}
%
% ^ Allow a little more freedom in typesetting floats.
% \setcounter{topnumber}{8}
% \def\topfraction{.95}
% \setcounter{bottomnumber}{8}
% \def\bottomfraction{.95}
% \setcounter{totalnumber}{8}
% \def\textfraction{.05}
% \def\floatpagefraction{.95}
% \setcounter{dbltopnumber}{8}
% \def\dbltopfraction{.95}
% \def\dblfloatpagefraction{.9}
%
% ^ Useful hacks
% \def\eg{{\em e.g.}}
% \def\ie{{\em i.e.}}
% \def\etc{{\em etc.}}
%
% ^ Add some space above any footnotes.
% \skip\footins=1.5\baselineskip
%
% ^ Setup for illustrations.
% \def\sc{Short caption.}
% \def\lc{Non fuit causa cur postularet. Qui hoc intellegi
% potest? Naevio neque ex societatis ratione neque
% privatim quicquam debuit Quinctius.\par
% Quis huic rei testis est? Idem qui acerrimus
% adversarius; in hanc rem te, te inquam, testem,
% Naevi, citabo.}
% \def\lcX{Non fuit causa cur postularet. Qui hoc intellegi
% potest? Naevio neque ex societatis ratione neque
% privatim quicquam debuit Quinctius.\par
% Quis huic rei testis est? Idem qui acerrimus
% adversarius; in hanc rem te, te inquam, testem,
% Naevi, citabo.\par
% Annum et eo diutius post mortem C. Quincti fuit
% in Gallia tecum simul Quinctius.}
% \def\b{\fboxsep=-\fboxrule
% \fbox{\hbox to 2.0in{\vbox to 2mm{\vfil\null}\hfil}}}
% \def\B#1#2{%
% \fcolorbox{black}{#1}{%
% \hbox to 1.9in{\vbox to 4mm{\vss\hbox to 1.9in{%
% \hfil[\texttt{#2}]\hfil}\vss}}}}
% \def\g{\hspace{.5in}}
%
% ^ General drop for text.
% \def\drop#1#2{\smash{\lower#1\hbox{#2}}}
%
% \makeatletter
% ^ Remove some space above minipage footnotes.
% \skip\@mpfootins=2.6\p@
%
% ^ Define a raggedright for use in tabular's.
% \def\rr{%
% \@rightskip\@flushglue
% \rightskip\@rightskip
% \leftskip\z@
% \parindent\z@}
%
% ^ Turn off any list entries by ``eating'' any \addcontentsline stuff.
% \def\eatthree#1#2#3{}^
% \def\turnofflistentry{\let\addcontentsline=\eatthree}
%
% ^ Special \footnotetext command for placing footnotes in strange places.
% \def\tabFootnotetext#1{^
% \vbox{^
% \vskip\skip\@mpfootins
% \footnotesize
% \@parboxrestore
% \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}^
% \@makefntext{\rule{\z@}{\footnotesep}\ignorespaces#1\strut}}}
%
% ^ Templates for showing options.
% \newcommand{\figfont}[3]{%
% \captionsetup[subfigure]{#2=#3}^
% \subfloat[{Option [\texttt{#2=#3}].}]^
% [\sc]{\label{#1}\B{white}{#2=#3}}}
% \newcommand{\figfontlist}[3]{^
% \captionsetup[subfigure]{#2={#3}}^
% \subfloat[{Option [\texttt{#2=\{#3\}}].}]^
% [\sc]{\label{#1}\B{white}{#2=\{#3\}}}}
% \newcommand{\figfontlistS}[3]{^
% \captionsetup[subfigure]{#2={#3}}^
% \subfloat[{Option [\texttt{#2=\{#3\}}].}]^
% [\sc]{\label{#1}\B{lightgray}{#2=\{#3\}}}}
% \newcommand{\figshape}[3][\@empty]{^
% \begin{figure}^
% \centering
% \captionsetup[subfigure]{#3}^
% \subfloat[][\sc]{\b}\g\subfloat[][\lc\label{#2b}]{\b}^
% \ifx\@empty#1\relax
% \caption{Options [\texttt{#3}].}^
% \else
% \caption[Options [\texttt{#1}{].}]{Options [\texttt{#3}].}^
% \fi
% \label{#2}^
% \end{figure}}
%
% \makeatother
%
% \title{The \Lpack{Subfig} Package\footnote{This paper documents
% the \Lpack{subfig} package \fileversion, last revised
% \filedate.}\\[10pt]}
% \author{Steven Douglas Cochran\\[15pt]
% Digital Mapping Laboratory, School of Computer Science \\
% Carnegie-Mellon University, 5000 Forbes Avenue \\
% Pittsburgh, PA 15213--3890 \\
% USA\\[15pt]
% \texttt{[email protected]}\\
% \texttt{[email protected]}}
% \date{\docdate}
%
% \addtolength\oddsidemargin{-.5in}
% \maketitle\thispagestyle{empty}
%
% \begin{abstract}
% \noindent
% This article documents the \LaTeX\ package `\Lpack{subfig}', which
% provides support for the inclusion of small, `sub', figures and
% tables. It simplifies the positioning, captioning and labeling of
% such objects within a single \Lenv{figure} or \Lenv{table} environment
% and to continue a \Lenv{figure} or \Lenv{table} across multiple pages.
% In addition, this package allows such sub-captions to be written to a
% List-of-Floats page as desired. The `\Lpack{subfig}' package requires
% the `\Lpack{caption}' package by H.A. Sommerfeldt and replaces the
% older `\Lpack{subfigure}' package.
% \end{abstract}
%
% \cleardoublepage
% \addtolength\oddsidemargin{.5in}
% \setcounter{page}{1}
% \pagenumbering{roman}
% \pagestyle{myheadings}
% \markboth{The \Lpack{Subfig} Package}{\slshape\rightmark}
% \renewcommand{\sectionmark}[1]{\markright{\thesection\quad#1}}
%
% \tableofcontents
% \listoffigures
% \listoftables
% \listofmaps
%
% \cleardoublepage
% \setcounter{page}{1}
% \pagenumbering{arabic}
% \section{Introduction}
%
% This package provides support for the manipulation and reference of
% small or `sub' floats within a single floating (\eg, \Lenv{figure} or
% \Lenv{table}) environment\footnote{Section~\ref{sec:customfloat}
% describes how to add support for additional \Lenv{float}
% environments.} It is convenient to use this package when your
% sub-floats are to be separately captioned, referenced, or when such
% sub-captions are to be included on a List-of-Floats page.
%
% This package is a replacement for the \Lpack{subfigure} package, from
% which it was derived. However, the new \Lpack{subfig} package is not
% completely backward compatible (see section~\ref{sec:back-compat}.
% Therefore, a new name was called for. The newer package is smaller
% and easier to use than the older package, however, it now uses the
% following additional packages:
% \begin{tabbing}
% \qquad $\bullet\space$ \Lpack{ragged2e} \= (required) \kill
% \qquad $\bullet\space$ \Lpack{caption} \> (required)\\
% \qquad $\bullet\space$ \Lpack{everysel} \> (optional)\\
% \qquad $\bullet\space$ \Lpack{keyval} \> (required)\\
% \qquad $\bullet\space$ \Lpack{ragged2e} \> (optional)
% \end{tabbing}
% It will work without the \Lpack{ragged2e} and \Lpack{everysel}
% packages if you do not use the following justification options:
% \Lkv{Center}, \Lkv{RaggedRight} and \Lkv{RaggedLeft}. The other
% justification options \Lkv{center}, \Lkv{raggedright} and
% \Lkv{raggedleft} will work without the above two packages.
%
% {\scshape\bf Note}: If the \Lpack{ragged2e} package is present, than
% the \Lpack{caption} package will load it and it will, in turn, load
% the \Lpack{everysel} package. This happens whether or not you will
% be using the justification options that require it. If it cannot
% find the \Lpack{ragged2e} package, than the \Lpack{caption} package
% will print a message that \Lkv{RaggedRight}, \etc\ will not be
% available.
%
% \subsection{Do You Need This Package?}
%
% Before using the \Lpack{subfig} package, consider the following to
% see if you really need it.
% \begin{enumerate}
% \item If you simply want to center your figure on the page, then you
% can use |\centerline|, |\centering| or the \Lenv{center}
% environment to do so, see \cite[page 112]{Lamp94}.
% \item If your figure has a short width or if you wrap your figure in
% a |\parbox| or a \Lenv{minipage} of a short width, then you
% can place multiple figures or tables side-by-side\footnote{You
% might have to use the optional position arguments `[b]' or
% `[t]' if the figures are of different heights, see
% sections~\ref{sec:examples} and \ref{sec:faq:align} as well as
% \cite[page 218]{Lamp94}.}. For example, the following will
% put two images side-by-side in a single figure as shown in
% figure~\ref{fig:1figs}:
% \begin{verbatim}
% \begin{figure}%
% \centering
% \parbox{1.2in}{...figure code...}%
% \qquad
% \begin{minipage}{1.2in}%
% ...figure code...
% \end{minipage}%
% \caption{Here are two figures side-by-side.}%
% \label{fig:1figs}%
% \end{figure}
% \end{verbatim}
% \begin{figure}^
% \centering
% \parbox{1.2in}{^
% \fboxsep=-\fboxrule
% \fbox{\hbox to 1.2in{\vbox to 15mm{\null\vfil}\hfil}}}^
% \qquad
% \begin{minipage}{1.2in}^
% \fboxsep=-\fboxrule
% \fbox{\hbox to 1.2in{\vbox to 15mm{\null\vfil}\hfil}}^
% \end{minipage}^
% \caption{Here are two figures side-by-side.}^
% \label{fig:1figs}^
% \vspace{12pt}
% \end{figure}
% \item Finally, if you place the caption inside the |\parbox| or
% \Lenv{minipage}, then the width of the caption will be limited
% to the width of the parbox or minipage as shown in
% figures~\ref{fig:2figsA} and \ref{fig:2figsB}:
% \begin{verbatim}
% \begin{figure}%
% \centering
% \parbox{1.2in}{%
% ...figure code...
% \caption{First.}%
% \label{fig:2figsA}}%
% \qquad
% \begin{minipage}{1.2in}%
% ...figure code...
% \caption{Second.}%
% \label{fig:2figsB}%
% \end{minipage}%
% \end{figure}
% \end{verbatim}
% \begin{figure}^
% \centering
% \parbox{1.2in}{^
% \fboxsep=-\fboxrule
% \fbox{\hbox to 1.2in{\vbox to 15mm{\vfil\null}\hfil}}^
% \caption{First.}^
% \label{fig:2figsA}}^
% \qquad
% \begin{minipage}{1.2in}^
% \fboxsep=-\fboxrule
% \fbox{\hbox to 1.2in{\vbox to 15mm{\vfil\null}\hfil}}^
% \caption{Second.}^
% \label{fig:2figsB}^
% \end{minipage}^
% \vspace{12pt}
% \end{figure}
% \end{enumerate}
%
% For more information on typesetting figures and tables, see
% the book ``The \LaTeX\ Companion'' by Mittelbach and Goossens
% \cite[\textsection~5 \& 6]{Mitt-etal04} and the document ``Using
% Imported Graphics in \LaTeXe'' by Keith Reckdahl \cite{Reck97}.
%
% \section{Package Commands}
%
% In this section, we describe the commands defined by the
% \Lpack{subfig} package and three commands from the \Lpack{caption}
% package that are needed or very useful in setting and changing the
% package options.
%
% \subsection{Preamble Commands}
%
% In the preamble of your \LaTeX\ file, you may load the \Lpack{subfig}
% package, define new and extended options and create new sub-floats.
% See the documentation for the \Lpack{caption} package for other
% preamble commands that may be used to customize the caption portion of
% a sub-float.
%
% \subsubsection{The \cmd{\usepackage} Command}
% \begin{quote}
% |\usepackage|\oarg{KV-list}\{subfig\}
% \end{quote}
%
% \noindent
% The optional argument list to the \Lpack{subfig} package is in the
% form of a KV-list or ``Key-Value list'' (see \cite{Carl99} for more
% detail). The KV-list is composed of a comma-separated list of
% keywords with optional values. The keywords without a value indicate
% that a default value is to be used. This list is bound to the
% variable \Lvar{subfloat} and is re-evaluated each time a |\subfloat| is
% encountered. These initial values may also be viewed, removed or
% changed with the |\showcaptionsetup|[uniq]\{subfloat\},
% |\clearcaptionsetup|[subfloat] or
% |\captionsetup|[subfloat]\marg{KV-list} commands.
%
% \subsubsection{The \cmd{\newsubfloat} Command}
% \label{sec:newsubfloat}
% \begin{quote}\DescribeMacro{\newsubfloat}
% |\newsubfloat|\oarg{KV-list}\marg{float-name}
% \end{quote}
%
% \noindent
% This command creates all of the internal structures and commands
% needed to support the new subfloat (the corresponding float structure
% must already exist, see section~\ref{sec:customfloat}). For instance
% when the \Lvar{subfigure} is created the set of internals instantiated
% are shown in table~\ref{tab:newsubfloat}.
% \begin{table}
% \centering
% \caption{Example of internals created by a \cmd{\newsubfloat} ``subfigure''.}^
% \label{tab:newsubfloat}^
% \begin{tabular}{llp{2.2in}} \toprule
% {\bf Function/} & & \\
% {\bf \quad Keyword} & {\bf Default} & {\bf Description} \\ \midrule
% |\c@subfigure| & 0 & Internal counter variable. \\
% |\c@subfigure@save| & 0 & Internal variable to save last counter value
% in case of a continued figure. \\
% |\subfigurename| & & Name prepended to the subcaption
% number (empty by default). \\
% |\p@subfigure| & |\thefigure| & Figure number prepended to the subcaption
% number in references via |\ref|. \\
% |\thesubfigure| & |\alph{subfigure}| & Format of the subcaption number. \\
% |\ext@subfigure| & lof & List-of-Floats file extension. \\
% |\l@subfigure| & {\textbackslash@dottedxxxline\{figure\}}
% & Format of List-of-Floats entry. \\
% & \multicolumn{2}{l}{{\qquad\{lof\}\{2\}\{\textbackslash sf@indent\}}}
% \\
% & \multicolumn{2}{l}{{\qquad\qquad\{\textbackslash sf@numwidth\}\}}}
% \\
% |\c@lofdepth| & 1 & List-of-Floats depth variable. \\
% \Lkv{lofdepth} & 2 & Sets |\c@lofdepth|. \\ \bottomrule
% \end{tabular}
% \end{table}
%
% The two internals \cmd{\subfigurename} and \cmd{\thesubfigure} are left
% for easy adjustment by the user, the rest should not be directly
% changed under normal circumstances. Note that you may change the
% values of any counter variable |\c@cnt| with the counter functions
% |\setcounter| or |\addtocounter| (see \cite[pg.~194]{Lamp94}). Also,
% the internals |\sf@indent| and |\sf@numwidth| may be change with the
% keywords \Lkv{listofindent} and \Lkv{listofnumwidth}, respectively.
%
% Once the new float is created, the KV-list is placed at the top ``level''.
% For example the options for the above {\it subfigure\/} are added to the
% name \Lvar{subfigure}. See section~\ref{sec:layers} below, for more detail
% about option layers.
%
% \subsubsection{The \cmd{\DeclareCaptionListOfFormat} Command}
% \begin{quote}\DescribeMacro{\DeclareCaptionListOfFormat}
% |\DeclareCaptionListOfFormat|\marg{keyword value}\marg{code}
% \end{quote}
%
% \noindent
% The |\DeclareCaptionListOfFormat| command allows the specification of
% how the sub-caption references are shown on the List-of-Floats pages.
% See section~\ref{sec:lof} for more details on setting up and adjusting
% the List-of-Floats entries.
%
% The \marg{code} section is passed two parameters that may be used or ignored.
% These are the value of the associated \cmd{\p@<sub-float>} type and the
% \cmd{\the<sub-float>} respectively.
%
% \subsubsection{The \cmd{\DeclareSubrefFormat} Command}
% \label{sec:declaresubrefformat}
% \begin{quote}\DescribeMacro{\DeclareSubrefFormat}
% |\DeclareSubrefFormat|\marg{keyword value}\marg{code}
% \end{quote}
%
% \noindent
% The |\DeclareSubrefFormat| command allows the specification of how the
% \cmd{\subref*} command generates its reference to a sub-caption label in
% the text.
%
% The \marg{code} section is passed four parameters that may be used or
% ignored. The frist two are the values of the associated
% \cmd{\p@$<$sub-float$>$} type and the \cmd{\the$<$sub-float$>$}
% (\eg, \cmd{\p@subfigure} and \cmd{\thesubfigure}), like the
% \cmd{\DeclareCaptionListOfFormat} command. The second two are the
% {\em raw} values of the $<$float$>$ and the $<$sub-float$>$ counters.
%
% \subsection{General Commands}
%
% These commands are available within the body of the paper and the
% commands |\captionsetup|, |\showcaptionsetup| and |\clearcaptionsetup|
% are available anytime after loading either the \Lpack{caption} or
% \Lpack{subfig} packages.
%
% \subsubsection{The \cmd{\subfloat} Command}
% \begin{quote}\DescribeMacro{\subfloat}
% |\subfloat|\oarg{list\_entry}\oarg{sub-caption}\marg{body}
% \end{quote}
%
% \noindent
% This command creates the sub-float in the floating environment.
% In a \Lenv{figure} environment it creates a subfigure. The
% required argument contains the sub-float object or ``body''. This is
% the code that imports or creates the figure portion of the sub-float.
%
% The two optional arguments control the caption. If only one
% optional argument is present, than a caption label is generated
% and if any text is included in the optional argument, than it
% becomes the caption argument.
%
% Normally, if a caption is present, it is also included on the
% List-of-Floats page. However, if a second optional argument is
% present, than the first one controls what is on the List-of-Floats
% page and the second is the caption text. If the List-of-Floats
% argument is empty, than nothing is printed on the List-of-Floats
% page. Otherwise, if there is text in the List-of-Floats argument,
% than that text is used on the List-of-Floats page rather than the text
% in the other optional argument.
%
% See table~\ref{tab:calling} for more detail on the |\subfloat|
% command's arguments.
%
% \begin{table}^
% \centering
% \caption{\cmd{\subfloat} calling arguments.}^
% \label{tab:calling}^
% \vskip-11pt^
% \hbox to \linewidth{\hss\begingroup\small
% \begin{tabular}{llc} \\ \toprule
% {\normalsize Sub-float Command}
% & \hbox to 1in{\hss\normalsize List-of-Floats Caption}
% & \multicolumn{1}{r}{\hbox to .25in{^
% \hss\normalsize
% Sub-float Caption}}
% \\ \midrule
% \cmd{\subfloat}\{body\}
% & & \\
% \cmd{\subfloat}[\space]\{body\}
% & (b)\ \ . . . . . . . . . .
% & (b) \\
% \cmd{\subfloat}[Sub-caption.]\{body\}
% & (c) Sub-caption. . . .
% & (c) Sub-caption. \\
% \cmd{\subfloat}[\space][Sub-caption.]\{body\}
% & & (d) Sub-caption. \\
% \cmd{\subfloat}[\space][\space]\{body\}
% & & (e) \\
% \cmd{\subfloat}[List\_entry.][Sub-caption.]\{body\}
% & (f) List\_entry. . . .
% & (f) Sub-caption. \\
% \cmd{\subfloat}[List\_entry.][\space]\{body\}
% & (g) List\_entry. . . .
% & (g) \\ \bottomrule
% \end{tabular}
% \endgroup\hss}
% \vspace{-8pt}
% \end{table}
%
% \subsubsection{The \cmd{\subref} Command}
% \changes{v1.2}{23 January 2004}{Added documentation for the
% \cmd{\subref*} command.}
% \begin{quote}\DescribeMacro{\subref}\DescribeMacro{\subref*}
% |\subref|\marg{label}\\
% |\subref*|\marg{label}
% \end{quote}
%
% \noindent
% The |\subref| command is provided to give an alternative reference to
% a sub-float. The standard |\ref| command returns a label built by
% concatenating the |\p@float| $+$ |\thesubfloat|, which is often of the
% form ``1a''. The |\subref| command returns the label shown on the
% List-of-Floats page, which may be in the format ``(a)'' (\ie, if
% \Lkv{listofformat=subparens}, see section~\ref{sec:listsubcaptions}).
% This may be combined with a reference to the main caption to give
% something of the form ``1(a)'', or used within the main caption to
% refer to a specific local sub-float.
%
% By default, the starred form of the command simply returns the
% |\thesubfloat| value, which, for sub-floats is usually something
% like ``a''. However, this may be changed by setting \Lkv{subrefformat},
% similar to the above \Lkv{listofformat}, to a predefined format
% (see table~\ref{tab:keywords2} or to a unique format defined with the
% \cmd{\DeclareSubrefFormat} command (section~\ref{sec:declaresubrefformat}).
%
% \subsubsection{The \cmd{\ContinuedFloat} Command}
% \label{sec:cont}
% \begin{quote}\DescribeMacro{\ContinuedFloat}
% |\ContinuedFloat|
% \end{quote}
%
% \begin{figure}^
% \centering
% \subfloat[][]{^
% \fboxsep=-\fboxrule
% \fbox{\hbox to 1.2in{\vbox to 15mm{\null\vfil}\hfil}}}^
% \qquad
% \subfloat[][]{^
% \fboxsep=-\fboxrule
% \fbox{\hbox to 1.2in{\vbox to 15mm{\null\vfil}\hfil}}}
% \vskip-4pt
% \caption{Here are the first two figures of a continued figure.}^
% \label{fig:cont}^
% \end{figure}
%
% \begin{figure}^
% \ContinuedFloat
% \centering
% \subfloat[][]{^
% \fboxsep=-\fboxrule
% \fbox{\hbox to 1.2in{\vbox to 15mm{\null\vfil}\hfil}}}^
% \qquad
% \subfloat[][]{^
% \fboxsep=-\fboxrule
% \fbox{\hbox to 1.2in{\vbox to 15mm{\null\vfil}\hfil}}}
% \vskip-4pt
% \caption[]{Here are the last two figures of a continued figure.}^
% \label{fig:cont2}^
% \end{figure}
%
% \noindent
% It sometimes occurs, especially when using sub-floats, that a single
% figure needs to be continued across pages. The |\ContinuedFloat|
% command is placed at the beginning of the floating environment or
% after changing |\@captype| inside the floating environment to make the
% next figure, table or other floating |\caption| a continuation of the
% last float |\caption| of the same type. It does this by saving the
% sub-float numbering internally and keeping the float numbering
% from advancing.
%
% In order to keep subsequent float entries from appearing on the
% List-of-Floats page, you can use the |\caption| command with the
% optional argument present, but empty; as shown in
% figure~\ref{fig:cont} (and on the list-of-figures
% page).\footnote{Note: This only works if the \Lpack{caption} package
% is active. If the \Lkv{caption=true} option is used to load the
% \Lpack{caption} package or the \Lpack{subfig} package, than an empty
% optional argument to the \cmd{\caption} command generates a
% List-of-Floats entry with no caption text unless the document class
% redefines the \cmd{\caption} command otherwise.} We also suppress
% the sub-caption entry with the optional List-of-Floats page argument
% empty since there is no accompanying text.
%
% \begin{verbatim}
% \begin{figure}%
% \centering
% \subfloat[][]{...figure code...}%
% \qquad
% \subfloat[][]{...figure code...}
% \caption{Here are the first two figures of a continued figure.}%
% \label{fig:cont}%
% \end{figure}
%
% \begin{figure}%
% \ContinuedFloat
% \centering
% \subfloat[][]{...figure code...}%
% \qquad
% \subfloat[][]{...figure code...}
% \caption[]{Here are the last two figures of a continued figure.}%
% \label{fig:cont}%
% \end{figure}
% \end{verbatim}
%
% \subsubsection{The \cmd{\listsubcaptions} Command}
% \label{sec:listsubcaptions}
% \begin{quote}\DescribeMacro{\listsubcaptions}
% |\listsubcaptions|
% \end{quote}
%
% \noindent
% The last command provided by the \Lpack{subfig} package is the
% |\listsubcaptions|. This is automatically called in most cases by the
% |\caption| command and at the end of the \Lenv{float} environment.
% However, the following example shows a rare situation in which the
% user will every have to use the |\listsubcaptions| command as shown in
% the definition of the |\zaptype| command.
%
% \begin{quote}
% | \documentclass{article}|\\
% | \usepackage[lofdepth,lotdepth]{subfig}|\\
% \null\qquad\vdots\\
% | \makeatletter|\\
% | \def\zaptype#1{%|\\
% | \listsubcaptions % Finish the last set of sub-floats before|\\
% | \def\@captype{#1}}% switching to another float type.|\\
% | \makeatother|\\
% \null\qquad\vdots\\
% | \begin{document}|\\
% \null\qquad\vdots\\
% | \listoffigures|\\
% | \listoftables|\\
% | \clearpage|\\
% | \begin{table}%|\\
% | \begin{center}%|\\
% | \caption{Table caption.}%|\\
% | \subfloat[Tab one]{X}\quad|\\
% | \subfloat[Tab two]{X}\\|\\
% | %|\\
% | \zaptype{figure}%|\\
% | %|\\
% | \subfloat[Fig one]{Y}\quad|\\
% | \subfloat[Fig two]{Y}|\\
% | \caption{Figure caption.}%|\\
% | \end{center}%|\\
% | \end{table}|\\
% \null\qquad\vdots\\
% | \end{document}|
% \end{quote}
%
% \noindent
% {\scshape\bf Hint}: Don't change the List-of-Floats page properties
% of any sub-floats until just before you use a |\subfloat| command,
% or just after you have executed a |\listsubcaptions| command.
% Otherwise, the wrong \Lkv{listofformat} or spacing might use the new
% values for sub-floats that have not been fully processed yet.
%
% \subsubsection{The \cmd{\captionsetup} Command}
% \label{sec:layers}
% \begin{quote}\DescribeMacro{\captionsetup}
% |\captionsetup|\oarg{variable}\marg{KV-list}
% \end{quote}
%
% \noindent
% The |\captionsetup| command is actually part of the \Lpack{caption}
% package, but is very important is you want to adjust some option in
% the \Lpack{subfig} package. If the optional \Lvar{variable} is left
% out, than the settings are made at the global level; otherwise, the
% settings are bound to the variable and executed just before being
% used.
%
% \begin{figure}\centering
% \begin{picture}(270,180)(0,5)
% \put(5,155){\makebox(0,0){\large 1.}}
% \put(158,155){\oval(260,30)}
% \put(158,155){\makebox(0,0){(global)}}
% \put(072,140){\vector(0,-1){10}}
% \put(158,140){\vector(0,-1){10}}
% \put(244,140){\vector(0,-1){15}}
% \put(5,115){\makebox(0,0){\large 2.}}
% \put(072,115){\oval(62,30)}
% \put(072,115){\makebox(0,0){\Lvar{figure}}}
% \put(158,115){\oval(62,30)}
% \put(158,115){\makebox(0,0){\Lvar{table}}}
% \put(244,115){\makebox(0,0){{\bf\dots}other floats{\bf\dots}}}
% \put(072,100){\vector(0,-1){10}}
% \put(158,100){\vector(0,-1){10}}
% \put(244,105){\vector(0,-1){15}}
% \put(5,075){\makebox(0,0){\large 3.}}
% \put(158,075){\oval(260,30)}
% \put(158,075){\makebox(0,0){\Lvar{subfloat}}}
% \put(072,060){\vector(0,-1){10}}
% \put(158,060){\vector(0,-1){10}}
% \put(244,060){\vector(0,-1){15}}
% \put(5,035){\makebox(0,0){\large 4.}}
% \put(072,035){\oval(62,30)}
% \put(072,035){\makebox(0,0){\Lvar{subfigure}}}
% \put(158,035){\oval(62,30)}
% \put(158,035){\makebox(0,0){\Lvar{subtable}}}
% \put(244,035){\makebox(0,0){{\bf\dots}other sub-floats{\bf\dots}}}
% \end{picture}^
% \caption{Levels at which keyword/values pairs may be set to apply to,
% or override earlier keyword/values pairs, for floats and
% sub-floats.}^
% \label{fig:levels}^
% \end{figure}
%
% There are four ``levels'' at which you can define options to apply
% to a sub-float (figure~\ref{fig:levels}. The first level is the
% default or global values of the various options, which are set either
% by the package, by a configuration file or by the optional Key-Value
% list in the |\usepackage| command when loading the \Lpack{caption} package.
%
% The second ``level'' consists of those options bound to the various
% floats. These are set by the |\captionsetup| with the optional argument
% set to the float name. For example, the command:
% \begin{quote}
% |\captionsetup|[table]\{position=top\}
% \end{quote}
% would indicate that the \Lvar{table} caption will come before its
% subfigures rather than after, as is the default.
% The third ``level'' consists of those options bound to the special variable
% \Lvar{subfloat}. These are value that hold across all sub-floats, but which
% are different than the global or float values. One such item is the
% ``font'' size, which is usually either null or {\bf normalsized}, but which
% is set to be {\bf footnotesized} for the sub-float captions.
%
% The fourth ``level'' holds those options bound to a specific sub-float,
% say \Lvar{subfigure}. An example is the caption \Lkv{position} relative
% to the subfigure itself.
%
% \section{Options: Keywords and Values}
% \changes{v1.2}{22 January 2004}{Changed \Lkv{indent} to \Lkv{indention}.}
% \changes{v1.3}{10 October 2004}{Added \Lkv{caption}.}
%
% Table~\ref{tab:keywords} shows all of the formal keywords and values
% from both the \Lpack{caption} and the \Lpack{subfig} packages. These
% may be used on the |\usepackage| options line, or with the |\captionsetup|
% command.
%
% \begin{table}^
% \centering
% \caption[Keywords with defaults and values.]^
% {Keywords with defaults and values. (Note: Entries enclosed
% in `[\ ]' indicate initial values rather than defaults.)}^
% \label{tab:keywords}^
% \begin{tabular}{llll} \toprule
% \multicolumn{1}{c}{\drop{1ex}{\bf PACKAGE}}
% & \multicolumn{1}{c}{\drop{1ex}{\bf KEYWORD}}
% & \multicolumn{1}{c}{\bf DEFAULT}
% & \multicolumn{1}{c}{\drop{1ex}{\bf VALUE(S)}}
% \\
% & & \multicolumn{1}{c}{\bf / [INIT]}
% & \\ \midrule
% Caption & caption\footnotemark
% & true & $<$Boolean$>$ \\[5pt]
% \drop{-6pt}{Package}
% & config & ``caption.cfg'' & $<$filename$>$ \\[5pt]
% & font (size) & [default] & \multirow{8}{*}{^
% \begin{tabular}{@{}llll}
% default & & & \\[3pt]
% scriptsize & rm & md & up \\
% footnotesize & sf & bf & it \\
% small & tt & & sl \\
% normalsize & & & sc \\
% large & & & \\
% Large & & & \\
% \end{tabular}} \\
% & labelfont & [default] \\
% & textfont & [default] \\
% & & \\
% & & \\
% & & \\
% & & \\
% & & \\[5pt]
% & style & [default] & default \\
% & & & ruled \\[5pt]
% & singlelinecheck & true & $<$Boolean$>$ \\[5pt]
% & format & [default] & default \\