summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/captcont/captcont.dtx
blob: 18841a3a0572233fef587c2808e2405348db2efe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
% \iffalse % captcont.dtx
% Retain figure/table number across multiple pages and provide correct
% output to List-of-Figures or List-of-Tables files.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 1997-2002 Steven Douglas Cochran
% 
% The captcont package is free software; it may be distributed under the
% conditions of the LaTeX Project Public License, either version 1.2 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.2 or later is part of all distributions of LaTeX version
% 1999/09/03 or later.
%
% The captcont package is distributed in the hope that it will be
% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
% LaTeX Project Public License for more details.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% @LaTeX-style-file{
%%    author     = "Steven Douglas Cochran",
%%    version    = "2.0",
%%    date       = "2002/02/14",
%%    time       = "11:59:17",
%%    filename   = "captcont.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      = "sdc+@CS.CMU.EDU (Internet)",
%%    codetable  = "ISO/ASCII",
%%    keywords   = "LaTeX, caption, float, figure, table, subfigure",
%%    supported  = "yes",
%%    abstract   = "LaTeX package for providing support for retaining
%%                  a figure or table number across several float
%%                  environments---usually over several pages.  It
%%                  also allows control over the contents of the
%%                  List-of-Figures and the List-of-Tables pages."
%% }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%<*driver>
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesFile{subfigure.dtx}
\documentclass{ltxdoc}
\usepackage{captcont}[2002/01/23]
\usepackage[TABTOPCAP,tight]{subfigure}[2002/01/23]
\setlength\hfuzz{100pt}
\setlength\vfuzz{100pt}
\clubpenalty=10000
\widowpenalty=10000
\displaywidowpenalty=5000
\brokenpenalty=5000
\begin{document}
  \DocInput{captcont.dtx}
\end{document}
%</driver>
%
%<*ltxdoc>
\AtBeginDocument{
%  \OnlyDescription % comment out for implementation details
  \EnableCrossrefs
  \RecordChanges
  \CodelineIndex}
\AtEndDocument{
  \PrintChanges
  \PrintIndex}
%</ltxdoc>
%
% \fi
%
% \catcode`\^=14 ^^A We will use a ^ for a comment rather than ^^A.
% \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
% ^ NOTE: Hacks added to make the final format are marked ``^finalhack''.
%
% \changes{v1.0}{11 Oct 1996}{Initial revision.}
%
% \DoNotIndex{\@ehd,\@firstofone,\@for,\@gobble,\@ifundefined,\@latex@error}
% \DoNotIndex{\@ne,\@undefined,\addcontentsline,\addtolength,\advance,\alph}
% \DoNotIndex{\begingroup,\bfseries,\bgroup,\box,\csname,\DeclareOption}
% \DoNotIndex{\def,\do,\egroup,\else,\endcsname,\endgroup,\ExecuteOption}
% \DoNotIndex{\ExecuteOptions,\expandafter,\fi,\footnotesize,\gdef,\hbox}
% \DoNotIndex{\global,\hfil,\ifdim,\ifnum,\ifx,\ignorespaces,\itshape}
% \DoNotIndex{\Large,\large,\leavevmode,\let,\long,\mdseries,\multiply}
% \DoNotIndex{\NeedsTeXFormat,\newcommand,\newcounter,\newif,\noexpand}
% \DoNotIndex{\normalsize,\par,\parbox,\ProcessOptions,\protect}
% \DoNotIndex{\ProvidesPackage,\relax,\renewcommand,\rmfamily,\sbox}
% \DoNotIndex{\scriptsize,\scshape,\setbox,\setcounter,\setlength,\sffamily}
% \DoNotIndex{\slshape,\small,\space,\string,\strut,\ttfamily,\tw@,\typeout}
% \DoNotIndex{\undefined,\upshape,\usebox,\vbox,\vskip,\vtop,\wd,\xdef}
% \DoNotIndex{\z@skip,\@dblarg,\@ifstar,\@nameuse,\@parboxrestore}
% \DoNotIndex{\@setminipage,\edef,\if@minipage,\m@ne,\numberline}
% \DoNotIndex{\providecommand,\refstepcounter,\@makecaption,\@captype}
% \DoNotIndex{\@currentlabel}
%
% \CheckSum{156}
%
% ^ This command creates a rectangular box to represent
% ^ a figure in the examples given in this paper.
% \newcommand{\figbox}[1]{%
%   \fbox{^
%     \vbox to 15mm{^
%     \vfil
%     \hbox{^
%       \space
%       #1^
%       \space}^
%     \vfil}}}
% 
% ^ Allow a little more freedom in typesetting floats.
% \setcounter{topnumber}{8}
% \def\topfraction{.8}
% \setcounter{bottomnumber}{8}
% \def\bottomfraction{.8}
% \setcounter{totalnumber}{8}
% \def\textfraction{.2}
% \def\floatpagefraction{.8}
% \setcounter{dbltopnumber}{8}
% \def\dbltopfraction{.8}
% \def\dblfloatpagefraction{.8}
%
% ^ Add some space above any footnotes.
% \skip\footins=1.5\baselineskip
%
% ^ Make the \fbox stay just inside the box it "surrounds".
% \fboxsep=-\fboxrule
%
% ^ Make the subcaption label be centered.
% \subfiglabelskip=0pt
%
% \makeatletter
%
% ^ Create an EXAMPLE float environment.
% ^ NOTE: This is not complete --- just enough for this paper.
% \newcounter{example}
% \renewcommand\theexample{\@arabic\c@example}
% \def\fps@example{tbp}
% \def\ftype@example{3}
% \def\ext@example{loe}
% \def\fnum@example{\examplename~\theexample}
% \newenvironment{example}
%                {\@float{example}}
%                {\end@float}
% \newcommand\examplename{Example}
%
% ^ This command switches the caption type.
% \newcommand{\setcaptype}[1]{\renewcommand{\@captype}{#1}}
% 
% \makeatother
%
% \def\docdate{2002/02/14}
% \def\fileversion{v2.0}
% \def\filedate{2002/01/23}
% \def\filename{captcont.dtx}
%
% \title{The \Lpack{captcont} Package\footnote{This paper documents
%        the \Lpack{captcont} package v\fileversion, last revised \filedate.}}
% \author{Steven Douglas Cochran\\[5pt]
%         Digital Mapping Laboratory, School of Computer Science \\
%         Carnegie-Mellon University, 5000 Forbes Avenue \\
%         Pittsburgh, PA 15213--3890, USA\\[5pt]
%         \texttt{sdc+@cs.cmu.edu}}
% \date{\docdate}
%
% \maketitle
%
% \begin{abstract}
% \noindent
% This article documents the \LaTeX\ package `\Lpack{captcont}', which
% provides support for retaining a figure or caption number across
% several float environments---usually over several pages.  It allows
% control over the contents of the List-of-Figures and the
% List-of-Tables pages.  It should be compatible with all other packages
% that modify or extend the float environment and with the
% \Lpack{subfigure} package \cite{Coch02} in particular.
%\end{abstract}
% 
% \tableofcontents
%
% \newpage
% \section{Introduction}
% \enlargethispage{12pt} ^finalhack
% 
% The \Lpack{captcont} package provides support for figures and tables
% that continue or span two or more pages, but cannot be easily handled
% by another mechanism such as the \Lpack{longtable} package \cite{Carl00}
% or the \Lpack{supertabular} environment \cite{Braa-Jurr99}.  The reason
% for this is usually that the figure or table is made up of multiple
% small parts.  Therefore this package is typically used in conjunction
% the \Lpack{subfigure} package\cite{Coch02}.
% 
% This \LaTeXe\ package replaces the older \LaTeX2.09 style fragment
% written by Anonymous.  This is a complete re-implementation of the
% older style so that the List-of-Figures, List-of-Tables and the
% |\pageref| command have the correct page numbers.
% 
% \section{The User Interface}
% 
% To use this package place
% \begin{quote}
%   |\usepackage|\oarg{options}\{captcont\}
% \end{quote}
% 
% \noindent
% in the preamble of your document.  The supported options are shown in
% table~\ref{tab:options}.\footnote{If the \Lpack{subfigure} package is
% also loaded, then the \Lpack{subfigure} package options override
% these.}  This package redefines the |\caption| command and defines
% three new commands to work with it.  The new commands act very similar
% to the caption, but control when the \Lcount{figure} or \Lcount{table}
% counter is incremented and whether or not the caption text shows up in
% the List-of-Figures or List-of-Tables pages.  The commands are:
% 
% \begin{tabbing}
%   \qquad \=|\captcont|* \=\oarg{lst\_entry} \=\marg{caption}\kill
%          \>|\caption|   \>\oarg{lst\_entry} \>\marg{caption}\\
%          \>|\caption|*  \>\oarg{lst\_entry} \>\marg{caption}\\
%          \>|\captcont|  \>\oarg{lst\_entry} \>\marg{caption}\\
%          \>|\captcont|* \>\oarg{lst\_entry} \>\marg{caption}
% \end{tabbing}
% \noindent
% The |\captcont| and |\captcont|* commands do not increment the
% \Lcount{figure} or \Lcount{table} counters and the |\captcont|* and
% |\caption|* commands do not print to the List-of-Figures or
% List-of-Tables.
% 
% If the caption proceeds the figure ({\it i.e.\/}, \Lopt{figtopcap} or
% \Lopt{tabtopcap}), then for a series of \Lenv{float} environments that
% are to be considered as one \Lenv{figure} or \Lenv{table}, you begin
% the first with a |\caption| or |\caption*| and use |\captcont| or
% |\captcont*| in each of the the following ones.  If the caption
% follows the figure ({\it i.e.\/}, \Lopt{figbotcap} or
% \Lopt{tabbotcap}), then you do just the opposite and use |\captcont|
% or |\captcont*| on each of the series of \Lenv{float} environments
% that are to be considered as one \Lenv{figure} or \Lenv{table}, the
% use a |\caption| or |\caption*| on the very last one.
% 
% \begin{table}
%   \caption{\Lpack{captcont} package options.}
%   \label{tab:options}
%   \DeleteShortVerb{\|}
%   \centering
%   \begin{tabular}{l|l}
%     \hline
%     \multicolumn{1}{c|}{\bf Option}
%                      & \multicolumn{1}{c}{\bf Description} \\
%     \hline
%     \Lopt{figbotcap} & The figure caption follows the figure (default).\\
%     \Lopt{figtopcap} & The figure caption precedes the figure.\\ \hline
%     \Lopt{tabbotcap} & The table caption follows the figure.\\
%     \Lopt{tabtopcap} & The table caption precedes the figure (default).\\
%     \hline
%   \end{tabular}
%   \MakeShortVerb{\|}
% \end{table}
% 
% \section{Examples}
%
% Four examples are given below of the use of the \Lpack{captcont}
% package. The ``figures'' in each are drawn using the following command
% which creates a small box representing a figure in the example output
% and centers provided text in the box.  The height of the box is fixed
% at 15mm and the width varies with the provided text.
% \newpage ^finalhack
% 
% \begin{verbatim}
% \newcommand{\figbox}[1]{%
%   \fbox{%                    Frame the box to make the ``figure''
%     \vbox to 15mm{%          Make it 15mm tall
%     \vfil                    Vertically center this next \hbox
%     \hbox{%                   
%       \space
%       #1%                    Add the supplied text with spaces
%       \space}%
%     \vfil}}}
% \end{verbatim}
% 
% \subsection{Two Continued Figures}
% 
% Example~\ref{ex:one} shows the case of a set of three pages containing
% parts of one figure.  In this case the author desires that the caption
% of each page shows up in the List-of-Figures page.  The |\caption| 
% follows the figure body, so we use the |\captcont| command on the
% inital pages and the |\caption| on the last.
% 
% \begin{verbatim}
%   \listoffigures
%   ...
%   \begin{figure}[p]
%     \figbox{Figure~\ref{fig:ex1-1}, part 1, page \pageref{fig:ex1-1}}
%     \captcont{Figure one.}
%     \label{fig:ex1-1}
%   \end{figure}
%   \begin{figure}[p]
%     \figbox{Figure~\ref{fig:ex1-1}, part 2, page \pageref{fig:ex1-2}}
%     \captcont{Figure one. (cont)}
%     \label{fig:ex1-2}
%   \end{figure}
%   \begin{figure}[p]
%     \figbox{Figure~\ref{fig:ex1-1}, part 3, page \pageref{fig:ex1-3}}
%     \caption{Figure one. (cont)}
%     \label{fig:ex1-3}
%   \end{figure}
% \end{verbatim}
% 
% \begin{example}
%   \setcaptype{figure}^
%   \centering
%   \fbox{^
%     \begin{minipage}{2.3in}^
%       \begin{minipage}{2.1in}^
%         \vspace{.1in}^
%         \section*{ List of Figures}
%         \contentsline{figure}{\numberline{1}^
%                      {\ignorespaces Figure one.}}{2}^
%         \contentsline{figure}{\numberline{1}^
%                      {\ignorespaces Figure one. (cont)}}{3}^
%         \contentsline{figure}{\numberline{1}^
%                      {\ignorespaces Figure one. (cont)}}{4}^
%         \hspace{40pt}\dots
%         \vspace{21pt}^
%       \end{minipage}^
%     \end{minipage}}^
%   \quad
%   \fbox{^
%     \begin{minipage}{2.3in}^
%       \centering
%       \vspace{.1in}^
%       \figbox{Figure~\ref{fig:ex1-1}, part 1, page 2.}^
%       \vspace{-5pt}^
%       \captcont{Figure one.}^
%       \label{fig:ex1-1}^
%       \vspace{10pt}^
%       -2-
%       \vspace{.1in}^
%     \end{minipage}}\\[.1in]
%   \fbox{^
%     \begin{minipage}{2.3in}^
%       \centering
%       \vspace{.1in}^
%       \figbox{Figure~\ref{fig:ex1-2}, part 2, page 3.}^
%       \vspace{-5pt}^
%       \captcont{Figure one. (cont)}^
%       \label{fig:ex1-2}^
%       \vspace{10pt}^
%       -3-
%       \vspace{.1in}^
%     \end{minipage}}^
%   \quad
%   \fbox{^
%     \begin{minipage}{2.3in}^
%       \centering
%       \vspace{.1in}^
%       \figbox{Figure~\ref{fig:ex1-3}, part 3, page 4.}^
%       \vspace{-5pt}^
%       \caption{Figure one. (cont)}^
%       \label{fig:ex1-3}^
%       \vspace{10pt}^
%       -4-
%       \vspace{.1in}^
%     \end{minipage}}^
%   \setcaptype{example}^
%   \caption{Four pages showing a continued figure with
%            List-of-Figures entries for each.}
%   \label{ex:one}
% \end{example}
%
% \newpage ^finalhack
% Often, however, you do not want the continued captions to appear in
% the List-of-Figures.  Therefore the starred forms of the commands are
% available to suppress the addition of the caption text to the
% List-of-Figures, as shown in example~\ref{ex:two} where only the
% first caption appears.
%
% \begin{verbatim}
%   \listoffigures
%   ...
%   \begin{figure}[p]
%     \figbox{Figure~\ref{fig:ex2-1}, part 1, page \pageref{fig:ex2-1}}
%     \captcont{Figure two.}
%     \label{fig:ex2-1}
%   \end{figure}
%   \begin{figure}[p]
%     \figbox{Figure~\ref{fig:ex2-1}, part 2, page \pageref{fig:ex2-2}}
%     \captcont*{Figure one. (cont)}
%     \label{fig:ex2-2}
%   \end{figure}
%   \begin{figure}[p]
%     \figbox{Figure~\ref{fig:ex2-1}, part 3, page \pageref{fig:ex2-3}}
%     \caption*{Figure one. (cont)}
%     \label{fig:ex2-3}
%   \end{figure}
% \end{verbatim}
%
% \begin{example}^
%   \setcaptype{figure}^
%   \centering
%   \fbox{^
%     \begin{minipage}{2.3in}^
%       \begin{minipage}{2.1in}^
%         \vspace{.1in}^
%         \section*{ List of Figures}
%         \hspace{40pt}\dots
%         \vspace{3pt}^
%         \contentsline{figure}{\numberline{2}^
%                      {\ignorespaces Figure two.}}{5}^
%         \hspace{40pt}\dots
%         \vspace{30pt}^
%       \end{minipage}^
%     \end{minipage}}^
%   \quad
%   \fbox{^
%     \begin{minipage}{2.3in}^
%       \centering
%       \vspace{.1in}^
%       \figbox{Figure~\ref{fig:ex2-1}, part 1, page 5.}^
%       \vspace{-5pt}^
%       \captcont{Figure two.}^
%       \label{fig:ex2-1}^
%       \vspace{10pt}^
%       -5-
%       \vspace{.1in}^
%     \end{minipage}}\\[.1in]
%   \fbox{^
%     \begin{minipage}{2.3in}^
%      \centering
%      \vspace{.1in}^
%       \figbox{Figure~\ref{fig:ex2-2}, part 2, page 6.}^
%       \vspace{-5pt}^
%       \captcont*{Figure two. (cont)}^
%       \label{fig:ex2-2}^
%       \vspace{10pt}^
%       -6-
%       \vspace{.1in}^
%     \end{minipage}}^
%   \quad
%   \fbox{^
%     \begin{minipage}{2.3in}^
%       \centering
%       \vspace{.1in}^
%       \figbox{Figure~\ref{fig:ex2-3}, part 3, page 7.}^
%       \vspace{-5pt}^
%       \caption*{Figure two. (cont)}^
%       \label{fig:ex2-3}^
%       \vspace{10pt}^
%       -7-
%       \vspace{.1in}^
%   \end{minipage}}^
%   \setcaptype{example}^
%   \caption{Four pages showing a continued figure with
%            List-of-Figures entries for the first page only.}
%   \label{ex:two}
% \end{example}
%
% \subsection{A Continued Series of Subfigures}
%
% Example~\ref{ex:three} shows the interaction of the \Lpack{contcapt} and
% the \Lpack{subfigure} packages.  When the \Lpack{subfigure} package is
% also loaded, it overrides any options given with this package (it
% doesn't matter if it is loaded before or after the \Lpack{captcont}
% package).  For this and the following example, we assume that the
% \Lpack{subfigure} package was loaded with the options
% [\Lopt{FIGBOTCAP},\Lopt{TABTOPCAP}]; therefore, for continued figures
% and tables, we {\bf end} the series of continued figures and we {\bf
% begin} the series of continued tables with with a |\caption| or
% |\caption*| command.  The rest of the figure or tables parts use
% either the |\captcont| or the |\captcont*| command.
%
% \begin{example}^
%   \setcaptype{figure}^
%   \centering
%   \leavevmode
%   \small
%   \fbox{^
%   \begin{minipage}{2.3in}^
%     \centering
%     \vspace{.1in}^
%     \subfigure[]{\figbox{Subfigure 1A}}^
%     \quad
%     \subfigure[]{\figbox{Subfigure 1B}}\\
%     \subfigure[]{\figbox{Subfigure 1C}}^
%     \quad
%     \subfigure[]{\figbox{Subfigure 1D}}\\
%     \vspace{-5pt}^
%     \caption{This is a simple figure.}^
%     \label{fig:ex3-1}^
%     \vspace{10pt}^
%     -8-
%     \vspace{.1in}^
%   \end{minipage}}^
%   \quad
%   \fbox{^
%   \begin{minipage}{2.3in}^
%     \centering
%     \vspace{.1in}^
%     \subfigure[]{\figbox{Subfigure 2A}}^
%     \quad
%     \subfigure[]{\figbox{Subfigure 2B}}\\
%     \subfigure[]{\figbox{Subfigure 2C}}^
%     \quad
%     \subfigure[]{\figbox{Subfigure 2D}}\\
%     \vspace{-5pt}^
%     \captcont{This is a continued figure.}
%     \label{fig:ex3-2a}^
%     \vspace{10pt}^
%     -9-
%     \vspace{.1in}^
%   \end{minipage}}\\[.1in]
%   \fbox{^
%   \begin{minipage}{2.3in}^
%     \centering
%     \vspace{.1in}^
%     \subfigure[]{\figbox{Subfigure 2E}}^
%     \quad
%     \subfigure[]{\figbox{Subfigure 2F}}\\
%     \subfigure[]{\figbox{Subfigure 2G}}^
%     \quad
%     \subfigure[]{\figbox{Subfigure 2H}}^
%     \vspace{-5pt}^
%     \hfil\parbox{2.1in}{^
%       \captcont*{This is a continued figure (cont.)}
%     }\\
%     \label{fig:ex3-2b}^
%     \vspace{10pt}^
%     -10-
%     \vspace{.1in}^
%   \end{minipage}}^
%   \quad
%   \fbox{^
%   \begin{minipage}{2.3in}^
%     \centering
%     \vspace{.1in}^
%     \subfigure[]{\figbox{Subfigure 2I}}^
%     \quad
%     \subfigure[]{\figbox{Subfigure 2J}}\\
%     \subfigure[]{\figbox{Subfigure 2K}}^
%     \quad
%     \subfigure[]{\figbox{Subfigure 2L}}
%     \vspace{-5pt}^
%     \hfil\parbox{2.1in}{^
%       \caption*{This is a continued figure (cont.)}
%     }\\
%     \label{fig:ex3-2c}
%     \vspace{10pt}^
%     -11-
%     \vspace{.1in}^
%   \end{minipage}}^
%   \setcaptype{example}^
%   \caption{Four pages showing a regular figure with four subfigures
%            and a continued figure composed of twelve subfigures.}
%   \label{ex:three}
% \end{example}
% 
% \begin{verbatim}
%   \begin{figure}[p]%
%     \begin{center}%
%       \subfigure[]{\figbox{Subfigure 1A}}%
%       \quad
%       \subfigure[]{\figbox{Subfigure 1B}}\\
%       \subfigure[]{\figbox{Subfigure 1C}}%
%       \quad
%       \subfigure[]{\figbox{Subfigure 1D}}%
%     \end{center}%
%     \caption{This is a simple figure.}
%     \label{fig:ex3-1}
%   \end{figure}
% \end{verbatim}
%
% \newpage ^finalhack
% \enlargethispage{12pt} ^finalhack
%
% \begin{verbatim}
%   \begin{figure}[p]%
%     \begin{center}%
%       \subfigure[]{\figbox{Subfigure 2A}}%
%       \quad
%       \subfigure[]{\figbox{Subfigure 2B}}\\
%       \subfigure[]{\figbox{Subfigure 2C}}%
%       \quad
%       \subfigure[]{\figbox{Subfigure 2D}}%
%     \end{center}%
%     \captcont{This is a continued figure.}
%     \label{fig:ex3-2a}
%   \end{figure}
% \end{verbatim}
%   
% \begin{verbatim}
%   \begin{figure}[p]%
%     \begin{center}%
%       \subfigure[]{\figbox{Subfigure 2E}}%
%       \quad
%       \subfigure[]{\figbox{Subfigure 2F}}\\
%       \subfigure[]{\figbox{Subfigure 2G}}%
%       \quad
%       \subfigure[]{\figbox{Subfigure 2H}}%
%     \end{center}%
%     \captcont*{This is a continued figure (cont.)}
%     \label{fig:ex3-2b}
%   \end{figure}
%   
%   \begin{figure}[p]%
%     \begin{center}%
%       \subfigure[]{\figbox{Subfigure 2I}}%
%       \quad
%       \subfigure[]{\figbox{Subfigure 2J}}\\
%       \subfigure[]{\figbox{Subfigure 2K}}%
%       \quad
%       \subfigure[]{\figbox{Subfigure 2L}}%
%     \end{center}%
%     \caption*{This is a continued figure (cont.)}
%     \label{fig:ex3-2c}
%   \end{figure}
% \end{verbatim}
% 
% Here only the first two captions (for figures~\ref{fig:ex3-1} and
% \ref{fig:ex3-2a}) appear in the List-of-Tables. The correct figure
% and page numbers are generated by any |\label| commands for later use
% with |\ref| or |\pageref|.  When the \Lpack{subfigure} package is
% loaded this goes for the \cmd{\subref} command also.
%
% \subsection{A Continued Series of Subtables}
%
% Example~\ref{ex:four} also shows the interaction of the \Lpack{contcapt}
% and \Lpack{subfigure} packages.  Here the \Lpack{table} environment is
% used along with the \Lopt{TABTOPCAP} option which insures that the
% numbering for the subtables is correct when the |\caption| preceeds 
% them rather than following them.  As mentioned above, we use the
% |\caption| or |\caption*| command for the first \Lenv{float} environment
% and the |\captcont| or |\captcont*| command for the continued
% \Lenv{float}'s.
% 
% \begin{example}^
%   \setcaptype{table}^
%   \centering
%   \leavevmode
%   \small
%   \fbox{^
%   \begin{minipage}{2.3in}^
%     \centering
%     \caption{This is a simple table.}^
%     \label{tab:One}^
%     \vspace{4pt}^
%     \subtable[\label{tab:OneA}]{\figbox{Subtable 1A}}^
%     \quad
%     \subtable[\label{tab:OneB}]{\figbox{Subtable 1B}}\\
%     \subtable[\label{tab:OneC}]{\figbox{Subtable 1C}}^
%     \quad
%     \subtable[\label{tab:OneD}]{\figbox{Subtable 1D}}\par
%     \vspace{10pt}^
%     -12-
%     \vspace{.1in}^
%   \end{minipage}}^
%   \quad
%   \fbox{^
%   \begin{minipage}{2.3in}^
%     \centering
%     \caption{This is a continued table.}^
%     \vspace{4pt}^
%     \subtable[]{\figbox{Subtable 2A}}^
%     \quad
%     \subtable[]{\figbox{Subtable 2B}}\\
%     \subtable[]{\figbox{Subtable 2C}}^
%     \quad
%     \subtable[]{\figbox{Subtable 2D}}\par
%     \vspace{10pt}^
%     -13-
%     \vspace{.1in}^
%   \end{minipage}}\\[.1in]
%   \fbox{^
%   \begin{minipage}{2.3in}^
%     \centering
%     \hfil\parbox{2.1in}{^
%       \captcont*{This is a continued table (cont.)}^
%     }\\
%     \vspace{4pt}^
%     \subtable[]{\figbox{Subtable 2E}}^
%     \quad
%     \subtable[]{\figbox{Subtable 2F}}\\
%     \subtable[]{\figbox{Subtable 2G}}^
%     \quad
%     \subtable[]{\figbox{Subtable 2H}}\par
%     \vspace{10pt}^
%     -14-
%     \vspace{.1in}^
%   \end{minipage}}^
%   \quad
%   \fbox{^
%   \begin{minipage}{2.3in}^
%     \centering
%     \hfil\parbox{2.1in}{^
%       \captcont*{This is a continued table (cont.)}^
%     }\\
%     \vspace{4pt}^
%     \subtable[]{\figbox{Subtable 2I}}^
%     \quad
%     \subtable[]{\figbox{Subtable 2J}}\\
%     \subtable[]{\figbox{Subtable 2K}}^
%     \quad
%     \subtable[]{\figbox{Subtable 2L}}\par
%     \vspace{10pt}^
%     -15-
%     \vspace{.1in}^
%   \end{minipage}}^
%   \setcaptype{example}^
%   \caption{Four pages showing a regular table with four subtables
%            and a continued table composed of twelve subtables.}
%   \label{ex:four}
% \end{example}
% 
% \newpage ^finalhack
% \enlargethispage{12pt} ^finalhack
%
% \begin{verbatim}
%   \begin{table}[p]%
%     \caption{This is a simple table.}%
%     \label{tab:One}%
%     \begin{center}%
%       \subtable[\label{tab:OneA}]{\figbox{Subtable 1A}}%
%       \quad
%       \subtable[\label{tab:OneB}]{\figbox{Subtable 1B}}\\
%       \subtable[\label{tab:OneC}]{\figbox{Subtable 1C}}%
%       \quad
%       \subtable[\label{tab:OneD}]{\figbox{Subtable 1D}}%
%     \end{center}%
%   \end{table}
% 
%   \begin{table}[p]%
%     \caption{This is a continued table.}%
%     \label{tab:Two}%
%     \begin{center}%
%       \subtable[\label{tab:Two}]{\figbox{Subtable 2A}}%
%       \quad
%       \subtable[\label{tab:Two}]{\figbox{Subtable 2B}}\\
%       \subtable[\label{tab:Two}]{\figbox{Subtable 2C}}%
%       \quad
%       \subtable[\label{tab:Two}]{\figbox{Subtable 2D}}%
%     \end{center}%
%   \end{table}
%
%   \begin{table}[p]%
%     \captcont*{This is a continued table (cont.)}%
%     \begin{center}%
%       \subtable[\label{tab:Two}]{\figbox{Subtable 2E}}%
%       \quad
%       \subtable[\label{tab:Two}]{\figbox{Subtable 2F}}\\
%       \subtable[\label{tab:Two}]{\figbox{Subtable 2G}}%
%       \quad
%       \subtable[\label{tab:Two}]{\figbox{Subtable 2H}}%
%     \end{center}%
%   \end{table}
%
%   \begin{table}[p]%
%     \captcont*{This is a continued table (cont.)}%
%     \begin{center}%
%       \subtable[\label{tab:Two}]{\figbox{Subtable 2I}}%
%       \quad
%       \subtable[\label{tab:Two}]{\figbox{Subtable 2J}}\\
%       \subtable[\label{tab:Two}]{\figbox{Subtable 2K}}%
%       \quad
%       \subtable[\label{tab:Two}]{\figbox{Subtable 2L}}%
%     \end{center}%
%   \end{table}
% \end{verbatim}
%
% \clearpage ^finalhack
%
% \StopEventually{^
% \newpage ^finalhack
% \section*{Acknowledgement}
% I wish to thank William 'bil' L. Kleb (w.l.kleb@larc.nasa.gov) for 
% his willingness to proofread this document and his many valuable
% suggestions as to its improvement.
% 
% \begin{thebibliography}{6}^
% \bibitem{Coch02}^
%   Steven Douglas Cochran,
%   \emph{The \Lpack{subfigure} Package},
%   2002/02/14/.
%   (Available from CTAN as file \texttt{subfigure.dtx})
% \bibitem{Carl00}^
%   David Carlisle,
%   \emph{The \Lpack{longtable} package},
%   2000/10/22.
%   (Available from CTAN as file \texttt{longtable.dtx})
% \bibitem{Braa-Jurr99}^
%   Johannes Braams and Theo Jurriens,
%   \emph{The \Lpack{supertabular} environment},
%   1999/08/07.
%   (Available from CTAN as file \texttt{supertabular.dtx})
% \end{thebibliography}}
%
% \section{The Code}
% \iffalse
%<*package>
% \fi
% \subsection{Identification}
% 
% We start off by checking that we are loading into \LaTeXe\ and
% announcing the name and version of this package.
%
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesPackage{captcont}[2002/02/14 v2.0 captcont package]
%    \end{macrocode}
%
% \subsection{Declaration and Execution of the Options}
% 
% \begin{macro}{\iffiguretopcap}
% \begin{macro}{\iftabletopcap}
% 
% First we check if the flags \Lif{figuretopcap} and \Lif{tabletopcap}
% exist; if they are not present, than they are created.  These are used
% to remember the options and are also the same internal |\if|'s used by
% the \Lpack{subfigure} package for this purpose and so we check if the
% \Lpack{subfigure} package has already been loaded (by the existance of
% the |\@subfloat| command and if so, then we entirely skip loading the
% options.
% 
% However if the \Lpack{subfigure} package has not been loaded, we check
% for the options below and set the two |\if|'s accordingly.  By default
% \Lif{figuretopcap} is set false and \Lif{tabletopcap} is set true.  If
% the \Lpack{subfigure} package is loaded later, then it will override
% any settings made here!
% 
%    \begin{macrocode}
\@ifundefined{figuretopcaptrue}{\newif\iffiguretopcap}{}
\@ifundefined{tabletopcaptrue}{\newif\iftabletopcap}{}
\@ifundefined{@subfloat}{%
  \DeclareOption{figbotcap}{\figuretopcapfalse}
  \DeclareOption{figtopcap}{\figuretopcaptrue}
  \DeclareOption{tabbotcap}{\tabletopcapfalse}
  \DeclareOption{tabtopcap}{\tabletopcaptrue}
  \ExecuteOptions{figbotcap,tabtopcap}
  \ProcessOptions}{}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsection{The Updated \cmd{\caption} Commands}
%
% \begin{macro}{\caption}
% \begin{macro}{\caption*}
% \begin{macro}{\cc@caption}
% 
% First, we save the current |\caption| command as |\cc@caption|.  Then
% we redefine |\caption| to check for a trailing `*' so that we can
% choose the regular caption (|\cc@caption|) for a special caption
% (|\cc@scaption|) that does not add a line to the ``List-of'' pages.
% 
%    \begin{macrocode}
\let\cc@caption=\caption
%    \end{macrocode}
%
%    \begin{macrocode}
\renewcommand{\caption}{%
  \@ifstar\cc@scaption\cc@caption}
%    \end{macrocode}
%
% \end{macro}
%
% \begin{macro}{\cc@scaption}
% \begin{macro}{\cc@@scaption}
% 
% Next, we define the |\cc@scaption| and |\cc@@scaption| commands to do
% everything that the regular |\caption| command would have done, except
% for adding a line to the ``List-of'' pages.
% 
% If |\@captype| is undefined, then write out an error and `eat' ({\it
% i.e.\/}, throw away) the argument(s).  Otherwise, add one to the
% \Lcount{figure} or \Lcount{table} counter and define the
% |\@currentreference|, then call |\cc@@scaption| with the expanded
% arguments.
% 
% Note that we allow an optional argument for the |\cc@@scaption| even
% though this will never be used.  The reason for this is to allow the
% shift from |\caption| to |\caption*| or back, when deciding if
% something should or should not be shown in the ``List-of''
% pages, to be done with just the addition or removal of the `*'.
% 
%    \begin{macrocode}
\newcommand{\cc@scaption}{%
  \ifx\@captype\@undefined
    \@latex@error{\noexpand\caption* outside float}\@ehd
    \expandafter\@gobble
  \else
    \refstepcounter\@captype
    \expandafter\@firstofone
  \fi
  {\@dblarg{\cc@@scaption\@captype}}} 
%    \end{macrocode}
% 
% We add a |\par| to end the current horizontal list, then we normalize
% the paragraph setting parameters, however we call |\@setminipage| if
% the |\if@minipage| is still true to enable |\everypar| to make it
% false later.  (This is the case if the |\caption| is not the first
% entry in the \Lenv{float}) environment.
%
%    \begin{macrocode}
\long\def\cc@@scaption#1[#2]#3{%
  \par
  \begingroup
    \@parboxrestore
    \if@minipage
      \@setminipage
    \fi
%    \end{macrocode}
% 
% Next |\normalsize| is restored (we just assume something else was set)
% and we typeset the caption followed by another |\par|.  Unlike the
% regular |\caption| command, we skipped adding a line to the
% List-of-Figures or List-of-Tables.
% 
%    \begin{macrocode}
    \normalsize
    \@makecaption{\@nameuse{fnum@#1}}{\ignorespaces #3}\par
  \endgroup}
%    \end{macrocode}
%
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{Work with the \cmd{\label}/\cmd{\ref} Mechanism}
% \begin{macro}{\ccset@currentlabel}
% 
% We define this command to conditionally increment the \Lcount{figure} or
% \Lcount{table} counter according to the respective flag telling us if
% the |\caption| is normally placed before or after the figure or table.
% Then globally reset the \@currentlabel for use with the |\label|
% command.
% 
% Note that this leaves the counter with a possibly incorrect setting,
% so this should be used within a group to limit it's scope.
%
%    \begin{macrocode}
\newcommand{\ccset@currentlabel}[1]{%
  \@nameuse{if\@captype topcap}\else
    \advance\@nameuse{c@\@captype}\@ne
  \fi
  \global\edef\@currentlabel{%
    \@nameuse{p@#1}\@nameuse{the#1}}}
%    \end{macrocode}
% \end{macro}
%
% \subsection{The New Caption Continuation Commands}
% \enlargethispage{-12pt} ^ finalhack
%
% \begin{macro}{\captcont}
% \begin{macro}{\captcont*}
% 
% The |\captcont| and |\captcont*| commands are just like the
% corresponding |\caption| and |\caption*| command, except that they do
% not cause the \Lcount{figure} or \Lcount{table} counters to be
% incremented.
% 
% The first step is to check for a following `*' to decide if an entry
% on the ``List-of'' page is to be made.  The `*' version does
% not add an entry.
% 
%    \begin{macrocode}
\newcommand{\captcont}{%
  \@ifstar\cc@scaptcont\cc@captcont}
%    \end{macrocode}
%
% \begin{macro}{\cc@captcont}
% \begin{macro}{\cc@scaptcont}
% 
% Next, we define the |\cc@captcont| and |\cc@scaptcont| commands to check
% to insure that we are inside a \Lenv{float} environemnt.  If not, then
% we report an error and exit.  Otherwise we call the respective
% |\cc@@captcont| or |\cc@@scaptcont| command to finish the processing,
% without changing the current coutner value or updating the
% |\@currentreference| value.  Those will be done locally, as necessary,
% in the following commands.
% 
% Note that we have an optional argument for the |\cc@@scaptcont| even
% though this will never be used.  The reason for this, as above, is to
% allow the shift from |\captcont| to |\captcont*| or back to be done
% with just the addition or removal of the `*' when deciding if
% something should or should not be shown in the ``List-of''
% pages.
%
%    \begin{macrocode}
\newcommand{\cc@captcont}{%
  \ifx\@captype\@undefined
    \@latex@error{\noexpand\captcont outside float}\@ehd
    \expandafter\@gobble
  \else
    \expandafter\@firstofone
  \fi
  {\@dblarg{\cc@@captcont\@captype}}} 
%    \end{macrocode}
%
% \end{macro}
%
%    \begin{macrocode}
\newcommand{\cc@scaptcont}{%
  \ifx\@captype\@undefined
    \@latex@error{\noexpand\captcont* outside float}\@ehd
    \expandafter\@gobble
  \else
    \expandafter\@firstofone
  \fi
  {\@dblarg{\cc@@scaptcont\@captype}}} 
%    \end{macrocode}
%
% \end{macro}
%
% \begin{macro}{\cc@@captcont}
% \begin{macro}{\cc@@scaptcont}
% 
% These two commands do the real work and finish up the ``captcont''
% processing.  They both insert a |\par| to finish off the prior
% horizontal list (if any) and then {\bf locally} update the
% \Lcount{figure} or \Lcount{table} counter (if necessary) and {\bf
% globally} set the |\@currentlabel| value using |\ccset@currentlabel|,
% defined above.
% 
% The difference between them is that |\cc@@captcont| then writes to the
% ``List-of'' page, while |\cc@@scaptcont| does not.  They both
% then finish just like the |\cc@@scaption| command, by resetting the
% paragraph and font parameters and then calling |\@makecaption| to
% typeset the caption followed by a |\par|.
%
%    \begin{macrocode}
\long\def\cc@@captcont#1[#2]#3{%
  \par
  \begingroup
    \ccset@currentlabel{#1}%
    \addcontentsline{\@nameuse{ext@#1}}{#1}%
      {\protect\numberline{\@nameuse{the#1}}{\ignorespaces #2}}%
    \@parboxrestore
    \if@minipage
      \@setminipage
    \fi
    \normalsize
    \@makecaption{\@nameuse{fnum@#1}}{\ignorespaces #3}\par
  \endgroup}
%    \end{macrocode}
%
% \end{macro}
%
%    \begin{macrocode}
\long\def\cc@@scaptcont#1[#2]#3{%
  \par
  \begingroup
    \ccset@currentlabel{#1}%
    \@parboxrestore
    \if@minipage
      \@setminipage
    \fi
    \normalsize
    \@makecaption{\@nameuse{fnum@#1}}{\ignorespaces #3}\par
  \endgroup}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \iffalse
%</package>
% \fi
%
% \Finale
%