| 1 |
% \iffalse |
| 2 |
%% |
| 3 |
%% Package `multicap' to use with LaTeX2e |
| 4 |
%% Copyright 2002 John Vassilogiorgakis. |
| 5 |
%% |
| 6 |
%% Contact at: [email protected] |
| 7 |
%% |
| 8 |
%% This program may be distributed and/or modified under the |
| 9 |
%% conditions of the LaTeX Project Public License, either version 1.2 |
| 10 |
%% of this license or (at your option) any later version. |
| 11 |
%% The latest version of this license is in |
| 12 |
%% http://www.latex-project.org/lppl.txt |
| 13 |
%% and version 1.2 or later is part of all distributions of LaTeX |
| 14 |
%% version 1999/12/01 or later. |
| 15 |
%% |
| 16 |
%<*dtx> |
| 17 |
\ProvidesFile{multicap.dtx} |
| 18 |
%</dtx> |
| 19 |
%<package>\NeedsTeXFormat{LaTeX2e} |
| 20 |
%<package>\ProvidesPackage{multicap} |
| 21 |
%<*driver> |
| 22 |
\documentclass{ltxdoc} |
| 23 |
\usepackage[english]{babel} |
| 24 |
\usepackage{multicol,tabularx,multicap} |
| 25 |
\renewcommand{\thetable}{\os{\arabic{table}}} |
| 26 |
\newcommand{\os}{\oldstylenums} |
| 27 |
\setlength{\columnseprule}{.4pt} |
| 28 |
\setlength{\columnsep}{18pt} |
| 29 |
\setlength{\textwidth}{39pc} |
| 30 |
\setlength{\textheight}{54pc} |
| 31 |
\setlength{\parindent}{1em} |
| 32 |
\setlength{\parskip}{0pt plus 1pt} |
| 33 |
\setlength{\oddsidemargin}{0pc} |
| 34 |
\setlength{\marginparwidth}{0pc} |
| 35 |
\setlength{\topmargin}{-2.5pc} |
| 36 |
\setlength{\headsep}{20pt} |
| 37 |
\setlength{\columnsep}{1.5pc} |
| 38 |
\setcounter{columnbadness}{7000} |
| 39 |
\setcounter{finalcolumnbadness}{7000} |
| 40 |
\begin{document} |
| 41 |
\typeout |
| 42 |
{*********************************************************************** |
| 43 |
^^J* multicap.dtx requires multicol.sty, multicap.sty and tabular.sty * |
| 44 |
^^J***********************************************************************} |
| 45 |
\DocInput{multicap.dtx} |
| 46 |
\end{document} |
| 47 |
%</driver> |
| 48 |
% \fi |
| 49 |
% \ProvidesFile{multicap.dtx} |
| 50 |
[2002/05/04 v1.0 formatting captions inside multicols] |
| 51 |
% |
| 52 |
%% \CheckSum{194} |
| 53 |
% |
| 54 |
% \MakeShortVerb{\|} |
| 55 |
% |
| 56 |
% \GetFileInfo{multicap.dtx} |
| 57 |
% \title{The \texttt{`multicap'} \LaTeXe\ package\thanks{Version number \fileversion{}. |
| 58 |
% Last revised \filedate{}.}} |
| 59 |
% \author{John Vassilogiorgakis\\ |
| 60 |
% \texttt{[email protected]}} |
| 61 |
% \date{12th May 2002} |
| 62 |
% |
| 63 |
% \maketitle |
| 64 |
% |
| 65 |
% \begin{abstract} |
| 66 |
% This is a package for formating captions of column figures and column tabular material which cannot be floats |
| 67 |
% (i.e. outside a \texttt{figure} or \texttt{table} environment in standard \LaTeX) in the \texttt{multicols} |
| 68 |
% environment provided by the \textsf{multicol} |
| 69 |
% package. It also provides an easy way to customize your captions, either in single column or inside \texttt{multicols}. |
| 70 |
% \end{abstract} |
| 71 |
% |
| 72 |
% \tableofcontents |
| 73 |
% |
| 74 |
% \begin{multicols}{2}[\section{Introduction}]\hbadness=10000 |
| 75 |
% As it is known, the \textsf{multicol} package supports partially floats inside |
| 76 |
% \texttt{multicols} environment. To be exact, only the star versions of the floating environments |
| 77 |
% are supported, excluding the existence of column floats---i.e. only page wide floats can be used \cite{MB}. However, one can |
| 78 |
% put a column image or tabular material |
| 79 |
% with one or another way---with an |\includegraphics| |
| 80 |
% command, or a \texttt{tabularx} environment inside a |center| environment---getting satisfactory |
| 81 |
% results like the following: |
| 82 |
% \begin{center} |
| 83 |
% \begin{tabularx}{\linewidth}{p{35pt}>{$}X<{$}>{$}X<{$}} |
| 84 |
% \hline |
| 85 |
% &\mathbf{x_1}&\mathbf{x_2}\\\hline\hline |
| 86 |
% \os{1}.&(x-1,y-1)&(x+1,y+1)\\ |
| 87 |
% \os{2}.&(x,y-1)&(x,y+1)\\ |
| 88 |
% \os{3}.&(x+1,y-1)&(x-1,y+1)\\ |
| 89 |
% \os{4}.&(x-1,y)&(x+1,y)\\ |
| 90 |
% \hline |
| 91 |
% \end{tabularx} |
| 92 |
% \end{center} |
| 93 |
% The same thing can happen, of course, with `column figures'. The column material |
| 94 |
% is placed outside of a floating environment by simply specifying: |
| 95 |
% \begin{center} |
| 96 |
% \textit{... text before column material ...} |
| 97 |
% \begin{verbatim} |
| 98 |
% \begin{center} |
| 99 |
% \begin{tabularx}{\linewidth}{...} |
| 100 |
% ... |
| 101 |
% \end{tabularx} |
| 102 |
% \end{center} |
| 103 |
% \end{verbatim} |
| 104 |
% \textit{... text after column material ...} |
| 105 |
% \end{center} |
| 106 |
% The only thing left, is to add captions to this column material, as we would have done if this material were |
| 107 |
% inside a floating environment. Moreover, we want the numbering of these captions to be handled correctly, even |
| 108 |
% if a star-form of a floating environment appears and even if we are switching between |multicols| and single column layout. |
| 109 |
% Finally, we also want the text specified by the caption to appear in the |
| 110 |
% list of figures or tables and the references to this material to work correctly. |
| 111 |
% \end{multicols} |
| 112 |
% |
| 113 |
% \begin{multicols}{2}[\section{Usage}]\hbadness=10000 |
| 114 |
% The package loads with\begin{center} |
| 115 |
% \fbox{\cs{usepackage}\texttt{\{multicap\}}} |
| 116 |
% \end{center} |
| 117 |
% and it requires the \textsf{ifthen} package. |
| 118 |
% The \textsf{multicap} package defines the |\mfcaption| and |\mtcaption| commands, |
| 119 |
% which replace the |\caption| command outside of a floating environment; |
| 120 |
% for column figures and column tabular |
| 121 |
% material respectively, that are necessary outside of a floating environment inside |multicols|. |
| 122 |
% |
| 123 |
% The syntax of the commands is the same as the one of |\caption|'s: |
| 124 |
% ^^A \DescribeMacro{\mfcaption} |
| 125 |
% \begin{center} |
| 126 |
% \fbox{\cs{mfcaption}[\textit{short text}]\{\textit{long text}\}} |
| 127 |
% \end{center} |
| 128 |
% for formating captions of `column figures' and |
| 129 |
% ^^A \DescribeMacro{\mtcaption} |
| 130 |
% \begin{center} |
| 131 |
% \fbox{\cs{mtcaption}[\textit{short text}]\{\textit{long text}\}} |
| 132 |
% \end{center} |
| 133 |
% for formating captions of column tabular material (`column tables'). As in the case of the |\caption| |
| 134 |
% command, the optional argument \textit{short text} goes into the list of figures or tables. If this is not |
| 135 |
% specified, then the mandatory argument \textit{long text} does the job. |
| 136 |
% |
| 137 |
% Thus, the previous `orphan' tabular\footnote{Sorry for using the same example again and again.} can now have a caption like this: |
| 138 |
% \begin{center} |
| 139 |
% \begin{tabularx}{\linewidth}{p{35pt}>{$}X<{$}>{$}X<{$}} |
| 140 |
% \hline |
| 141 |
% &\mathbf{x_1}&\mathbf{x_2}\\\hline\hline |
| 142 |
% \os{1}.&(x-1,y-1)&(x+1,y+1)\\ |
| 143 |
% \os{2}.&(x,y-1)&(x,y+1)\\ |
| 144 |
% \os{3}.&(x+1,y-1)&(x-1,y+1)\\ |
| 145 |
% \os{4}.&(x-1,y)&(x+1,y)\\ |
| 146 |
% \hline |
| 147 |
% \end{tabularx} |
| 148 |
% \mtcaption[This captions produced with the \cs{mtcaption} command.]{Caption inside \texttt{multicols}.} |
| 149 |
% \end{center} |
| 150 |
% The command line arguments were: |
| 151 |
% \begin{verbatim} |
| 152 |
% \begin{center} |
| 153 |
% \begin{tabularx}{\linewidth}{...} |
| 154 |
% ... |
| 155 |
% \end{tabularx} |
| 156 |
% \mtcaption[This captions produced with the |
| 157 |
% \mtcaption command.]{Caption inside |
| 158 |
% \texttt{multicols}.} |
| 159 |
% \end{center} |
| 160 |
% \end{verbatim} |
| 161 |
% It is clear now, that you just put the column material---either this is a tabular material, a figure, a picture |
| 162 |
% loaded with an |\epsfig|, |\includegraphics| or anything relative---followed by an |\mfcaption|, for column `figures', |
| 163 |
% or an |\mtcaption| for `column tables', command inside a |center| environment and thats all. You have a caption for this |
| 164 |
% column material, as if it was inside a floating environment. Moreover, placing the whole stuff inside a \texttt{minipage} and |
| 165 |
% using the |\columnbreak| command, you can achieve good looking results by manually placing the column float |
| 166 |
% at the top or the bottom of the page. |
| 167 |
% |
| 168 |
% \subsection{Options and customization} |
| 169 |
% A tactic of many well known typographers and something that one encounters very often in well printed books, |
| 170 |
% is that the comments explaining what is shown in a floating element, are typesetting with a \textsf{sans serif font} and with a |
| 171 |
% completely different lead (baseline skip) and font size than the main document's. For example, you may have a book |
| 172 |
% typeseted in \os{10}/\os{12}, and the captions of the floats to be in \os{9}/\os{11}.\os{5} or something else, depending |
| 173 |
% from the kind of the font. Especially the use of \textsf{unmodulated sans serif fonts} with a smaller font size |
| 174 |
% than the main document's |
| 175 |
% and the appropriate lead, is something that harmonizes well enough with the narrow linewidth of the two column |
| 176 |
% output. |
| 177 |
% |
| 178 |
% \subsubsection{The \texttt{normal} option} |
| 179 |
% The captions produced by the |
| 180 |
% \verb+\mfcaption+, \verb+\mtcaption+ and \verb+\caption+ |
| 181 |
% commands with \textsf{multicap}, are typesetting the |\figurename| (or |\tablename|) and |
| 182 |
% the mandatory argument \textit{long text} with the |
| 183 |
% \textsf{sans serif font} defined by the |
| 184 |
% |\sfdefault| command. The number that is associated with the column float is typeseted with \textsc{small caps}, |
| 185 |
% if there exists this shape for the \textsf{sans}. If not, a |
| 186 |
% \begin{verbatim} |
| 187 |
% \renewcommand{\thefigure}{% |
| 188 |
% \textmormal{\textsc{\arabic{figure}}}} |
| 189 |
% \end{verbatim} |
| 190 |
% in the preamble solves the problem\footnote{Replace \cs{textsc} with \cs{oldstylenums} if you are typesetting with the |
| 191 |
% Computer Modern fonts.}, typesetting the counter with small caps but with the normal font this time. This |
| 192 |
% is to deal with the high level typographic demands, that wants the comments explaining what is shown in a float |
| 193 |
% to be typeseted with \textsf{sans} and the number associated with this floating element to be old style. |
| 194 |
% |
| 195 |
% ^^A \DescribeMacro{normal} |
| 196 |
% If you don't want this perspective, \textsf{multicap} offers the unique package |
| 197 |
% option |normal| that typesets all |
| 198 |
% captions in the usual way. This can be chosen by specifying |
| 199 |
% \begin{center} |
| 200 |
% \fbox{\cs{usepackage}\texttt{[normal]\{multicap\}}} |
| 201 |
% \end{center} |
| 202 |
% in the preamble. |
| 203 |
% |
| 204 |
% \subsubsection{Changing caption's \cs{fontsize} parameters} |
| 205 |
% Package |multicap| offers you also the possibility to easily change the |\fontsize| parameters of the captions. |
| 206 |
% This can be |
| 207 |
% done by simply changing the values of the |
| 208 |
% \begin{center}\fbox{\texttt{mcapsize}}\ \,and\,\ \fbox{\texttt{mcapskip}}\end{center} |
| 209 |
% counter variables with the |\setcounter| declaration. What really happens, is that the values of the above counters go |
| 210 |
% into the first and second argument respectively of the |\fontsize| command, that changes locally inside |\mfcaption|, |
| 211 |
% |\mtcaption| and |\caption|. |
| 212 |
% For example, if you want your captions to be typeseted in \os{9}/\os{11}, then you have to do in the |
| 213 |
% preamble the following declarations: |
| 214 |
% \begin{verbatim} |
| 215 |
% \setcounter{mcapsize}{9} |
| 216 |
% \setcounter{mcapskip}{11}. |
| 217 |
% \end{verbatim} |
| 218 |
% |
| 219 |
% We should emphasize at this point, that \textsf{multicap's} options, along with the \texttt{mcapsize} and \texttt{mcapskip} |
| 220 |
% parameters, take effect \textit{and} in the |\caption| command which the package redefines. Thus, the usage of \textsf{multicap} |
| 221 |
% is somehow wider, in the sense that these tuning options were not given especially for a multicolumn layout. The |
| 222 |
% truth is that in multiple columns such changes fit better, but a novice user can also use them to format his captions |
| 223 |
% of his single column layout. This is not true for the parameters discussing in the next sections, which act affects |
| 224 |
% only the two new commands |
| 225 |
% |\mfcaption| and |\mtcaption| and their usage is restricted only for multicolumn output. |
| 226 |
% |
| 227 |
% \subsubsection{The \cs{abvmcapskip} length} |
| 228 |
% The vertical space added between the column float and the caption produced either by the |\mfcaption| or |
| 229 |
% |\mtcaption| command, is controlled by the |
| 230 |
% \begin{center}\fbox{\cs{abvmcapskip}}\end{center} |
| 231 |
% length parameter, which |
| 232 |
% is equal to the value of \os{10}pt. It is not suggested to change this value (with the |\setlength| declaration), unless if you want |
| 233 |
% to typeset captions with an extremely different font size and |\baselineskip| |
| 234 |
% than the main document's. |
| 235 |
% |
| 236 |
% \subsubsection{The \cs{blwmcapskip} length} |
| 237 |
% From the other side now, if you decide not to use some of the |\mfcaption| and |\mtcaption| commands that appear in your |
| 238 |
% code, inside a |center| environment\footnote{I suggest not to do so.} |
| 239 |
% (i.e. you may want to put them inside the range of a |\centering| |
| 240 |
% command or anything of the above, |
| 241 |
% thus giving a more compact look on your multicolumn layout), there is the |
| 242 |
% possibility of changing the vertical space separating the caption from the following text by changing the |
| 243 |
% \begin{center}\fbox{\cs{blwmcapskip}}\end{center} length parameter (again with |\setlength|). The default value of |
| 244 |
% |\blwmcapskip| is equal to the |
| 245 |
% value of |\parsep|. |
| 246 |
% However, such a change will affect only the captions produced by the |\mfcaption| and |\mtcaption| commands that are |
| 247 |
% outside of a |center| environment. |
| 248 |
% |
| 249 |
% This tuning option is made possible, because placing one of the |\mfcaption| or |\mtcaption| |
| 250 |
% declarations outside of a |center| environment, the vertical space added between the \textit{text before column |
| 251 |
% material} and the column float, will be smaller than the vertical space that follows after the caption and before the |
| 252 |
% \textit{text after the column material}. This way, with the |\blwmcapskip|, you can |
| 253 |
% balance the vertical space before and after the column float. |
| 254 |
% |
| 255 |
% In any case, if you wish to have a more compact look using the |\centering| command for example, you should specify |
| 256 |
% something like this: |
| 257 |
% \begin{center}\textit{... text before column material ...} |
| 258 |
% \begin{verbatim} |
| 259 |
% \par{\centering |
| 260 |
% \begin{tabularx}{\linewidth}{...} |
| 261 |
% ... |
| 262 |
% \end{tabularx}} |
| 263 |
% \mtcaption{Another caption inside multicols.} |
| 264 |
% \end{verbatim} |
| 265 |
% \textit{... text after column material ...}\end{center} |
| 266 |
% leaving the |\mfcaption| or |\mtcaption| declarations outside the range of |\centering|\,\footnote{We would have done |
| 267 |
% the same thing, if we were using the \cs{caption} command.}.^^A \par |
| 268 |
% \begin{center} |
| 269 |
% \begin{tabularx}{\linewidth}{p{35pt}>{$}X<{$}>{$}X<{$}} |
| 270 |
% \hline |
| 271 |
% &\mathbf{x_1}&\mathbf{x_2}\\\hline\hline |
| 272 |
% \os{1}.&(x-1,y-1)&(x+1,y+1)\\ |
| 273 |
% \os{2}.&(x,y-1)&(x,y+1)\\ |
| 274 |
% \os{3}.&(x+1,y-1)&(x-1,y+1)\\ |
| 275 |
% \os{4}.&(x-1,y)&(x+1,y)\\ |
| 276 |
% \hline |
| 277 |
% \end{tabularx} |
| 278 |
% \mtcaption{Another caption inside \texttt{multicols}.} |
| 279 |
% \end{center} |
| 280 |
% |
| 281 |
% \subsection{Numbering} |
| 282 |
% When formating captions in |multicols| using the \textsf{multicap} package and a star-form of a floating |
| 283 |
% environment appears, the |\caption| command keeps |
| 284 |
% numbering the figure or table that spans all columns now correctly, continuing from where a |\mfcaption| or |
| 285 |
% |\mtcaption| command had stopped, depending from the kind of float. The same thing happens when the opposite occurs---when |
| 286 |
% switching from the page-wide float to the column float---and when switching from \texttt{multicols} to single |
| 287 |
% column and back. This happens because the |\mfcaption| uses the |figure| counter to count the column figures and |
| 288 |
% the |\mtcaption| command the |table| counter to number the column tables. So the interchange between |\mfcaption|, |
| 289 |
% |\mtcaption| and |\caption| and between one and multicolumn mode, does not affect the |
| 290 |
% numbering of the figures or tables that are handled correctly from the package. |
| 291 |
% \end{multicols} |
| 292 |
% |
| 293 |
% \begin{table}[h] |
| 294 |
% \begin{center} |
| 295 |
% \begin{tabularx}{.66\linewidth}{p{35pt}>{$}X<{$}>{$}X<{$}} |
| 296 |
% \hline |
| 297 |
% &\mathbf{x_1}&\mathbf{x_2}\\\hline\hline |
| 298 |
% \os{1}.&(x-1,y-1)&(x+1,y+1)\\ |
| 299 |
% \os{2}.&(x,y-1)&(x,y+1)\\ |
| 300 |
% \os{3}.&(x+1,y-1)&(x-1,y+1)\\ |
| 301 |
% \os{4}.&(x-1,y)&(x+1,y)\\ |
| 302 |
% \hline |
| 303 |
% \end{tabularx} |
| 304 |
% \caption{Table produced by the \texttt{table} environment.} |
| 305 |
% \end{center} |
| 306 |
% \end{table} |
| 307 |
% |
| 308 |
% \StopEventually{} |
| 309 |
% \begin{multicols}{2}[\section{Implementation}]\hbadness=10000 |
| 310 |
% \begin{macrocode} |
| 311 |
\NeedsTeXFormat{LaTeX2e}% |
| 312 |
\ProvidesPackage{multicap}[2002/05/04 |
| 313 |
v1.0 formatting captions inside multicols]% |
| 314 |
% \end{macrocode} |
| 315 |
% The package requires the \textsf{ifthen} package to test some conditions. |
| 316 |
% \begin{macrocode} |
| 317 |
\RequirePackage{ifthen}% |
| 318 |
% \end{macrocode} |
| 319 |
% We now define the |\@mcaptype| command which will switch between the normal font and the Sans. Next, we |
| 320 |
% define the default (|Sans|) and the the |normal| option, together with a warning for any unknown option to the package. |
| 321 |
% \begin{macrocode} |
| 322 |
\newcommand*{\@mcaptype}{\@empty}% |
| 323 |
\DeclareOption{Sans}% |
| 324 |
{\renewcommand*{\@mcaptype}{\textsf}}% |
| 325 |
\DeclareOption{normal}% |
| 326 |
{\renewcommand*{\@mcaptype}{\relax}}% |
| 327 |
\DeclareOption*{% |
| 328 |
\PackageWarning{multicap}{Unknown option |
| 329 |
`\CurrentOption'.\MessageBreak |
| 330 |
Going into default mode}% |
| 331 |
}% |
| 332 |
\ExecuteOptions{Sans}% |
| 333 |
\ProcessOptions*% |
| 334 |
% \end{macrocode} |
| 335 |
% The counter variables |`mcapsize'| and |`mcapskip'| which go to first and second argument of the |\fontsize| command |
| 336 |
% respectively are defined. The |\abvmcapskip| and |\blwmcapskip| lengths are defined too and their default values |
| 337 |
% are being given. |
| 338 |
% |
| 339 |
% \begin{macrocode} |
| 340 |
\newcounter{mcapsize}% |
| 341 |
\newcounter{mcapskip}% |
| 342 |
\newlength{\abvmcapskip}% |
| 343 |
\newlength{\blwmcapskip}% |
| 344 |
\setlength{\abvmcapskip}{10\p@}% |
| 345 |
\setlength{\blwmcapskip}{\parsep}% |
| 346 |
% \end{macrocode} |
| 347 |
% We define one box for each command |\mfcaption|, |\mtcaption|\ and |\caption| to make some length tests later. |
| 348 |
% \begin{macrocode} |
| 349 |
\newsavebox{\mf@tempbox}% |
| 350 |
\newsavebox{\mt@tempbox}% |
| 351 |
\newsavebox{\@temp@box}% |
| 352 |
% \end{macrocode} |
| 353 |
% We redefine the |center| environment so as to set the boolean |@cent@er| true when the environment starts and false when it ends. |
| 354 |
% \begin{macrocode} |
| 355 |
\newboolean{@cent@er}% |
| 356 |
\renewenvironment*{center}{% |
| 357 |
\setboolean{@cent@er}{true}\trivlist% |
| 358 |
\centering\item\relax}% |
| 359 |
{\setboolean{@cent@er}{false}\endtrivlist}% |
| 360 |
% \end{macrocode} |
| 361 |
% The command |\@mcap@fs| checks weather the values of the |`mcapsize'| and |`mcapskip'| have change, sends them to |\fontsize| and |
| 362 |
% stores them in the |\@mcap@size| command. |
| 363 |
% \begin{macrocode} |
| 364 |
\DeclareRobustCommand*{\@mcap@size}{\relax}% |
| 365 |
\newcommand*{\@mcap@fs}{% |
| 366 |
\ifthenelse{\equal{\value{mcapsize}}{0}% |
| 367 |
\and\equal{\value{mcapskip}}{0}}{}% |
| 368 |
{\renewcommand*{\@mcap@size}{% |
| 369 |
\fontsize{\value{mcapsize}}{% |
| 370 |
\value{mcapskip}% |
| 371 |
}% |
| 372 |
\selectfont% |
| 373 |
}% |
| 374 |
}% |
| 375 |
}% |
| 376 |
% \end{macrocode} |
| 377 |
% We are now ready to define the |\mfcaption| command. After an initial skip of |\abvmcapskip| (\os{10}pt) we increment the |figure| |
| 378 |
% counter with |\refstepcounter| so that the references to the column figures will work correctly. We check with |\@mcap@fs|, |
| 379 |
% if the values of |
| 380 |
% the |`mcapsize'| and |`mcapskip'| counters have been changed |
| 381 |
% and next we add the text specified in the |\mfcaption| command |
| 382 |
% to the list of figures. |
| 383 |
% \begin{macrocode} |
| 384 |
\newcommand*{\mfcaption}[2][\@empty]{% |
| 385 |
\\[\abvmcapskip]% |
| 386 |
\@mcap@fs% |
| 387 |
\refstepcounter{figure}% |
| 388 |
\ifthenelse% |
| 389 |
{\equal{\protect#1}{\protect\@empty}}% |
| 390 |
{\addcontentsline{lof}{figure}% |
| 391 |
{\protect\numberline{\thefigure}#2}}% |
| 392 |
{\addcontentsline{lof}{figure}% |
| 393 |
{\protect\numberline{\thefigure}#1}}% |
| 394 |
% \end{macrocode} |
| 395 |
% After the mandatory argument \textit{long text} has been stored in |\mf@tempbox|, |
| 396 |
% we compare the width of the \textit{long text} with that of |\linewidth|. If the comments |
| 397 |
% of the figure (\textit{long text}) |
| 398 |
% fit on a line, then they will be centered, otherwise |
| 399 |
% they will be typeset as a paragraph with width |\linewidth|. |
| 400 |
% \begin{macrocode} |
| 401 |
\sbox{\mf@tempbox}{% |
| 402 |
\@mcap@size\@mcaptype{% |
| 403 |
\figurename\ \textsc{\thefigure{}:} #2% |
| 404 |
}% |
| 405 |
}% |
| 406 |
\ifthenelse{\lengthtest{% |
| 407 |
\wd\mf@tempbox > \linewidth}}% |
| 408 |
{\begin{minipage}[t]{\linewidth}% |
| 409 |
\@mcap@size\@mcaptype{% |
| 410 |
\figurename\ \textsc{\thefigure{}:} #2}% |
| 411 |
\end{minipage}\par% |
| 412 |
}% |
| 413 |
{{\centering\usebox{\mf@tempbox}\\}}% |
| 414 |
% \end{macrocode} |
| 415 |
% An skip of |\blwmcapskip| follows, if we are not inside a |
| 416 |
% |center| environment. |
| 417 |
% \begin{macrocode} |
| 418 |
\ifthenelse{\boolean{@cent@er}}{}% |
| 419 |
{\vspace{\blwmcapskip}}% |
| 420 |
}% |
| 421 |
% \end{macrocode} |
| 422 |
% The |\mtcaption| command is defined by exact the same way. |
| 423 |
% \begin{macrocode} |
| 424 |
\newcommand*{\mtcaption}[2][\@empty]{% |
| 425 |
\\[\abvmcapskip]% |
| 426 |
\@mcap@fs% |
| 427 |
\refstepcounter{table}% |
| 428 |
\ifthenelse% |
| 429 |
{\equal{\protect#1}{\protect\@empty}}% |
| 430 |
{\addcontentsline{lot}{table}% |
| 431 |
{\protect\numberline{\thetable}#2}}% |
| 432 |
{\addcontentsline{lot}{table}% |
| 433 |
{\protect\numberline{\thetable}#1}}% |
| 434 |
\sbox{\mt@tempbox}{% |
| 435 |
\@mcap@size\@mcaptype{% |
| 436 |
\tablename\ \textsc{\thetable{}:} #2% |
| 437 |
}% |
| 438 |
}% |
| 439 |
\ifthenelse{\lengthtest{% |
| 440 |
\wd\mt@tempbox > \linewidth}}% |
| 441 |
{\begin{minipage}[t]{\linewidth}% |
| 442 |
\@mcap@size\@mcaptype{% |
| 443 |
\tablename\ \textsc{\thetable{}:} #2}% |
| 444 |
\end{minipage}\par% |
| 445 |
}% |
| 446 |
{{\centering\usebox{\mt@tempbox}\\}}% |
| 447 |
\ifthenelse{\boolean{@cent@er}}{}% |
| 448 |
{\vspace{\blwmcapskip}}% |
| 449 |
}% |
| 450 |
% \end{macrocode} |
| 451 |
% Finally, we redefine the kernel |\@makecaption| command, so as |\caption| can have the same `properties' with the |
| 452 |
% |\mfcaption| and |\mtcaption| commands. |
| 453 |
% \begin{macrocode} |
| 454 |
\renewcommand{\@makecaption}[2]{% |
| 455 |
\vspace{10\p@}% |
| 456 |
\@mcap@fs% |
| 457 |
\sbox{\@temp@box}% |
| 458 |
{\@mcap@size\@mcaptype{#1{}\textsc{:} #2}}% |
| 459 |
\ifthenelse{\lengthtest{% |
| 460 |
\wd\@temp@box > \linewidth}}% |
| 461 |
{\@mcap@size\@mcaptype{#1{}\textsc{:} #2}% |
| 462 |
\par% |
| 463 |
}% |
| 464 |
{\centering\@mcap@size\@mcaptype{% |
| 465 |
#1{}\textsc{:} #2% |
| 466 |
}% |
| 467 |
}% |
| 468 |
}% |
| 469 |
\endinput |
| 470 |
% \end{macrocode} |
| 471 |
% \end{multicols} |
| 472 |
% \listoftables |
| 473 |
% \begin{thebibliography}{8} |
| 474 |
% \bibitem{Canny}{M. Goossens, F. Mittelbach and A. Samarin, ``\textit{The \LaTeX\ Companion}'', Addison Wesley, |
| 475 |
% \oldstylenums{1994}.} |
| 476 |
% \bibitem{LTX}{The \textsc{\LaTeX3} Project, ``\textit{\LaTeXe\ for class and package writers}'', \os{1995}--\os{1998}.} |
| 477 |
% \bibitem{MB}{Frank Mittelbach, ``\textit{An environment for multicolumn output}'', \textsc{ctan}, file \textit{multicol.dtx}, |
| 478 |
% March, \os{2001}.} |
| 479 |
% \bibitem{RB}{R. Bringhurst, ``\textit{The Elements of Typographic Style}'', Hartley \textit{\&} Marks, \os{1996}.} |
| 480 |
% \end{thebibliography} |
| 481 |
% \Finale |
| 482 |
%% |
| 483 |
%% \CharacterTable |
| 484 |
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z |
| 485 |
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z |
| 486 |
%% Digits \0\1\2\3\4\5\6\7\8\9 |
| 487 |
%% Exclamation \! Double quote \" Hash (number) \# |
| 488 |
%% Dollar \$ Percent \% Ampersand \& |
| 489 |
%% Acute accent \' Left paren \( Right paren \) |
| 490 |
%% Asterisk \* Plus \+ Comma \, |
| 491 |
%% Minus \- Point \. Solidus \/ |
| 492 |
%% Colon \: Semicolon \; Less than \< |
| 493 |
%% Equals \= Greater than \> Question mark \? |
| 494 |
%% Commercial at \@ Left bracket \[ Backslash \\ |
| 495 |
%% Right bracket \] Circumflex \^ Underscore \_ |
| 496 |
%% Grave accent \` Left brace \{ Vertical bar \| |
| 497 |
%% Right brace \} Tilde \~} |
| 498 |
%% |
| 499 |
\endinput |
| 500 |
|