Debian Codegraph @

texmf-dist/doc/latex/subfigure/test5.tex

raw
1 \documentclass{article}
2
3 \makeatletter
4 %% We pretend that we are a naughty class and are \let'ting our
5 %% \endfigure to the \end@float, etc.
6
7 \def\thefigure{\@arabic\c@figure}
8 \def\fps@figure{tbp}
9 \def\ftype@figure{1}
10 \def\ext@figure{lof}
11 \def\fnum@figure{Fig.~\thefigure}
12 \def\figure{\@float{figure}}
13 \let\endfigure\end@float
14 \@namedef{figure*}{\@dblfloat{figure}}
15 \@namedef{endfigure*}{\end@dblfloat}
16
17 \def\thetable{\@Roman\c@table}
18 \def\fps@table{tbp}
19 \def\ftype@table{2}
20 \def\ext@table{lot}
21 \def\fnum@table{TABLE~\thetable}
22 \def\table{%
23 \def\@floatboxreset{\reset@font\footnotesize\@setminipage}%
24 \@float{table}}
25 \let\endtable\end@float
26 \@namedef{table*}{%
27 \def\@floatboxreset{\reset@font\footnotesize\@setminipage}%
28 \@dblfloat{table}}
29 \@namedef{endtable*}{\end@dblfloat}
30 \makeatother
31
32 % Next we load the subfigure package and see if it finds the problem.
33 % To check this test result, you need to see the TTY listing or check
34 % the test5.log (which we save as test5B.ps).
35 \usepackage[FIGTOPCAP]{subfigure}
36 \setcounter{lofdepth}{2}
37
38 \newcommand{\figbox}[1]{%
39 \fbox{%
40 \vbox to 1in{%
41 \vfil
42 \hbox to 2in{%
43 \hfil
44 #1%
45 \hfil}%
46 \vfil}}}
47
48 \newcommand{\goodgap}{%
49 \hspace{\subfigcapskip}}
50
51 \begin{document}
52 \listoffigures
53 \newpage
54 \section{Fifth Test}
55 This test checks to see if the subfigure package reacts correctly to
56 the known sort of problem class. We check that the list-of-figures
57 page has the two subcaptions in addition to the main caption. If not,
58 than the nasty class has zapped us.
59
60 (We also need to check the test5.log file to insure that the problem
61 was identified by the subfigure package and a warning was issued.)
62
63 \begin{figure}%
64 \centering
65 \caption{Figure One.}%
66 \label{fig:first}%
67 \subfigure[One subone.\label{fig:first:A}]{\figbox{One subone}}%
68 \goodgap
69 \subfigure[One subtwo.\label{fig:first:B}]{\figbox{One subtwo}}%
70 \end{figure}
71
72 \end{document}