1 % \iffalse meta-comment
4 % The LaTeX3 Project and any individual authors listed elsewhere
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
10 % It may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3c
12 % of this license or (at your option) any later version.
13 % The latest version of this license is in
14 % http://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX
16 % version 2005/12/01 or later.
18 % This file has the LPPL maintenance status "maintained".
20 % The list of all files belonging to the LaTeX base distribution is
21 % given in the file `manifest.txt'. See also `legal.txt' for additional
24 % The list of derived (unpacked) files belonging to the distribution
25 % and covered by LPPL is defined by the unpacking scripts (with
26 % extension .ins) which are part of the distribution.
31 %%% From File: ltboxes.dtx
35 \ProvidesFile{ltboxes.dtx}
36 [2015/01/08 v1.1h LaTeX Kernel (Box Commands)]
38 \documentclass{ltxdoc}
39 \GetFileInfo{ltboxes.dtx}
42 \author{David Carlisle\and
47 \MaintainedByLaTeXTeam{latex}
56 % \changes{v1.1e}{1998/08/17}{(RmS) Minor Documentation fixes.}
57 % \section{\LaTeX\ Box commands}
60 % \DescribeMacro\makebox
61 % |\makebox[|\meta{wid}|][|\meta{pos}|]{|\meta{obj}|}|\\
62 % Puts \meta{obj} in an |\hbox| of width \meta{wid}, positioned by
65 % The possible \meta{pos} are:\\
70 % |c| (default) centred.
73 % If \meta{wid} is missing, then \meta{pos} is also missing and
74 % \meta{obj} is put in an |\hbox| of its natural width.
76 % |\makebox(|\meta{x}|,|\meta{y}|)[|\meta{pos}|]{|\meta{obj}|}|\\
77 % Puts \meta{obj} in an |\hbox| of width $x * |\unitlength|$
78 % and height $y * |\unitlength|$.
79 % \meta{pos} arguments are
80 % |s|, |l|, |r| or |c| (default) for stretched, flushleft, flushright
81 % or centred, and |t| or |b|
82 % for top, bottom -- or combinations like |tr| or |rb|.
83 % Default for horizontal and vertical are centered.
84 % Note that in this picture mode version of |\makebox| a [b] aligns on
85 % the \emph{bottom} of the text as documented. If you want to align on
86 % the \emph{baseline} use
87 % |\makebox( , )[b]{\raisebox{0pt}[\height][0pt]{xyz}}}|
88 % or |\makebox( , )[b]{\smash{xyz}}|
91 % |\mbox{|\meta{obj}|}| The same as |\makebox{|\meta{obj}|}|, but is
92 % more efficient as no checking for optional arguments is done.
94 % \DescribeMacro\newsavebox
95 % |\newsavebox{\cmd}| : If |\cmd| is undefined, then defines it
96 % to be a \TeX\ box register.
98 % \DescribeMacro\savebox
99 % |\savebox{\cmd}| ... : |\cmd| is defined to be a \TeX\ box register,
100 % and the '...' are any |\makebox| arguments. It is
101 % like |\makebox|, except it doesn't produce text but
102 % saves the value in |\box| |\cmd|.
104 % \DescribeMacro\sbox
105 % |\sbox{|\meta{cmd}|}{|\meta{obj}|}| is an efficient abbreviation for\\
106 % |\savebox{|\meta{cmd}|}{|\meta{obj}|}|.
108 % \DescribeEnv{lrbox}
109 % |\begin{lrbox}{|\meta{cmd}|}|\meta{text}|\end{lrbox}| is equivalent
111 % |\sbox{|\meta{cmd}|}{|\meta{text}|}|\\
112 % except that any white space at the beginning and end of \meta{text}
115 % \DescribeMacro\framebox
116 % |\framebox| ... : like |\makebox|, except it puts a `frame' around
117 % the box. The frame is made of lines of thickness
118 % |\fboxrule|, separated by space |\fboxsep| from the
119 % text -- except for |\framebox(X,Y)| ... , where the
120 % thickness of the lines is as for the picture environment,
121 % and there is no separation added.
123 % \DescribeMacro\fbox
124 % |\fbox{|\meta{obj}|}| is an abbreviation for
125 % |\framebox{|\meta{obj}|}|.
127 % \DescribeMacro\parbox
128 % |\parbox[|\meta{pos}|][|\meta{height}|][|\meta{inner-pos}|]{|^^A
129 % \meta{width}|}{|\meta{text}|}| :
130 % Makes a box with |\hsize| \meta{width}, positioned by \meta{pos} as
132 % c : |\vcenter| (placed in |$...$| if not in math mode)
135 % default value is c.
136 % Sets |\hsize| := \meta{width} and calls |\@parboxrestore|, which
137 % does the following:
138 % Restores the original definitions of:
149 % Resets the following parameters:
151 % \begin{tabular}{l@{\quad=\quad}ll}
152 % |\parindent| & 0pt \\
153 % |\parskip| & 0pt & added 20 Jan 87\\
154 % |\linewidth| & |\hsize|\\
155 % |\@totalleftmargin| & 0pt\\
156 % |\leftskip| & 0pt\\
157 % |\rightskip| & 0pt\\
158 % |\@rightskip| & 0pt\\
159 % |\parfillskip| & 0pt plus 1fil\\
160 % |\lineskip| & |\normallineskip|\\
161 % |\baselineskip| & |\normalbaselineskip|
166 % Note: |\@arrayparboxrestore| same as |\@parboxrestore|
167 % but it doesn't restore |\\|.
169 % \DescribeEnv{minipage}
170 % |minipage| : Similar to |\parbox|, except it also
171 % makes this look like a page by setting
173 % |\textwidth| == |\columnwidth| == box width
175 % changes footnotes by redefining:\\%
176 % |\@mpfn| == mpfootnote \\
177 % |\thempfn| == |\thempfootnote|\\
178 % |\@footnotetext| == |\@mpfootnotetext|
180 % resets the following list environment parameters:\\
181 % |\@listdepth| == |\@mplistdepth|\\
182 % where |\@mplistdepth| is initialized to zero,
184 % and executes |\@minipagerestore| to allow the document
185 % style to reset any other parameters it desires.
186 % It sets |@minipage| true, and resets |\everypar| to set
187 % it false. This switch keeps |\addvspace| from putting space
188 % at the top of a minipage.
190 % Change added 24 May 89: |\minipage| sets |@minipage| globally;
191 % |\endminipage| resets it false.
194 % \DescribeMacro\rule
195 % |\rule[|\meta{raised}|]{|\meta{width}|}{|\meta{height}|}| :
196 % Makes a $\meta{width}*\meta{height}$ rule, raised \meta{raised}.
198 % \DescribeMacro\underline
199 % |\underline{|\meta{text}|}| : Makes an underlined hbox with
202 % \DescribeMacro\raisebox
203 % |\raisebox{|\meta{distance}|}[|\meta{height}|][|\meta{depth}^^A
204 % |]{|\meta{box}|}| :\\
205 % Raises \meta{box} up by \meta{distance} length (down if
206 % \meta{distance} negative). Makes \TeX\ think that the new box extends
207 % \meta{height} above the line and \meta{depth} below, for a total
208 % vertical length of \meta{height}+\meta{depth}. Default values of
209 % \meta{height} \& \meta{depth} = actual height and depth of box in new
214 % \changes{v0.1e}{1994/03/02}{Remove need for drv file}
215 % \changes{v0.1e}{1994/03/02}{Add 2ekernel module}
216 % \changes{v1.0a}{1994/03/07}{Unify format with other Kernel files}
217 % \changes{v1.0f}{1994/05/11}
218 % {Superfluous braces removed from several commands}
219 % \changes{v1.0j}{1994/10/18}
220 % {stuff from ltpatch done}
221 % \changes{v1.0p}{1994/11/09}
222 % {more colour changes\ldots}
223 % \changes{v1.0q}{1994/11/17}
224 % {\cs{@tempa} to \cs{reserved@a}}
225 % \changes{v1.0t}{1995/05/07}{Use \cs{hb@xt@}}
226 % \changes{v1.0w}{1995/10/16}{Clarify makebox description}
232 % \begin{macro}{\makebox}
233 % \changes{v0.1a}{1993/12/03}
235 % |\makebox| User level command just looks for optional |[| or |(|.
236 % \changes{v1.1h}{2015/01/08}{Make Robust (latexrelease)}
239 %<latexrelease>\IncludeInRelease{2015/01/01}%
240 %<latexrelease> {\makebox}{Make \makebox robust}%
241 %<*2ekernel|latexrelease>
242 \DeclareRobustCommand\makebox{%
246 {\@ifnextchar[\@makebox\mbox}}%
247 %</2ekernel|latexrelease>
248 %<latexrelease>\EndIncludeInRelease
249 %<latexrelease>\IncludeInRelease{0000/00/00}%
250 %<latexrelease> {\makebox}{Make \makebox robust}%
251 %<latexrelease>\def\makebox{%
252 %<latexrelease> \leavevmode
253 %<latexrelease> \@ifnextchar(%)
254 %<latexrelease> \@makepicbox
255 %<latexrelease> {\@ifnextchar[\@makebox\mbox}}%
256 %<latexrelease>\EndIncludeInRelease
261 % \begin{macro}{\mbox}
262 % \changes{v0.1a}{1993/12/03}
264 % \changes{v1.0j}{1994/10/18}
266 % The basic horizontal box command for \LaTeX.
268 \long\def\mbox#1{\leavevmode\hbox{#1}}
272 % \begin{macro}{\@makebox}
273 % \changes{v0.1a}{1993/12/03}
274 % {default changed from x to c}
275 % Look for a possible second optional argument (defaults to |c|).
278 \@ifnextchar [{\@imakebox[#1]}{\@imakebox[#1][c]}}
283 % \begin{macro}{\@begin@tempboxa}
284 % \changes{v0.1a}{1993/12/03}
286 % \changes{v0.1b}{1993/12/08}
287 % {Extra braces for color support
288 % (braces removed from other macros)}
289 % \changes{v1.0f}{1994/05/11}
290 % {Use new \cs{color@setgroup} concept.}
291 % Helper macro for supporting |\height|, |\width| etc. Grab |#1| into
292 % |\@tempboxa| and measure it.
294 \long\def\@begin@tempboxa#1#2{%
296 \setbox\@tempboxa#1{\color@begingroup#2\color@endgroup}%
297 \def\width{\wd\@tempboxa}%
298 \def\height{\ht\@tempboxa}%
299 \def\depth{\dp\@tempboxa}%
300 \let\totalheight\@ovri
302 \advance\totalheight\depth}
306 % \begin{macro}{\@end@tempboxa}
307 % \changes{v0.1a}{1993/12/03}
309 % End the group started by |\@begin@tempboxa|, so that the scope of
310 % |\height| only includes the `length' argument to the user-command.
312 \let\@end@tempboxa\endgroup
316 % \begin{macro}{\bm@c}
317 % \begin{macro}{\bm@l}
318 % \begin{macro}{\bm@r}
319 % \begin{macro}{\bm@s}
320 % \begin{macro}{\bm@t}
321 % \begin{macro}{\bm@b}
322 % \changes{v0.1a}{1993/12/03}
326 \def\bm@c{\hss\unhbox\@tempboxa\hss}
327 \def\bm@l{\unhbox\@tempboxa\hss}\let\bm@t\bm@l
328 \def\bm@r{\hss\unhbox\@tempboxa}\let\bm@b\bm@r
329 \def\bm@s{\unhbox\@tempboxa}
338 % \begin{macro}{\@imakebox}
339 % \changes{v0.1a}{1993/12/03}
341 % Internal form of |\makebox|.
343 \long\def\@imakebox[#1][#2]#3{%
344 \@begin@tempboxa\hbox{#3}%
345 \setlength\@tempdima{#1}% support calc
346 \hb@xt@\@tempdima{\csname bm@#2\endcsname}%
351 % \begin{macro}{\@makepicbox}
352 % \changes{v0.1a}{1993/12/03}
354 % Picture mode form of |\makebox|.
356 \def\@makepicbox(#1,#2){%
357 \@ifnextchar[{\@imakepicbox(#1,#2)}{\@imakepicbox(#1,#2)[]}}
361 % \begin{macro}{\@imakepicbox}
362 % picture mode version
364 \long\def\@imakepicbox(#1,#2)[#3]#4{%
365 \vbox to#2\unitlength
366 {\let\mb@b\vss \let\mb@l\hss\let\mb@r\hss
368 \@tfor\reserved@a :=#3\do{%
370 \let\mb@l\relax\let\mb@r\relax
372 \expandafter\let\csname mb@\reserved@a\endcsname\relax
375 \hb@xt@ #1\unitlength{\mb@l #4\mb@r}%
378 % This kern ensures that a |b| option aligns on the bottom of the
379 % text rather than the baseline. this is the documented behaviour in
380 % the \LaTeX Book. The kern is removed in compatibility mode.
387 % \begin{macro}{\set@color}
388 % \changes{v0.1a}{1993/12/03}
390 % \changes{v0.1a}{1993/12/03}
392 % This macro is initially a no-op, but the colour package will redefine
393 % it to insert a |\special|.
399 % \begin{macro}{\color@begingroup}
400 % \changes{v1.0b}{1994/03/14}
401 % {macro added for colour support}
402 % \begin{macro}{\color@endgroup}
403 % \changes{v1.0b}{1994/03/14}
404 % {macro added for colour support}
405 % \begin{macro}{\color@setgroup}
406 % \changes{v1.0f}{1994/05/11}
407 % {macro added for colour support}
408 % \begin{macro}{\normalcolor}
409 % \changes{v1.0g}{1994/05/12}
410 % {macro added for colour support}
411 % \begin{macro}{\color@hbox}
412 % \changes{v1.0n}{1994/11/05}
413 % {macro added for colour support}
414 % \begin{macro}{\color@vbox}
415 % \changes{v1.0r}{1994/11/18}
416 % {macro added for colour support}
417 % \begin{macro}{\color@endbox}
418 % \changes{v1.0n}{1994/11/05}
419 % {macro added for colour support}
420 % These macros are initially a no-op, but the colour package will
421 % redefine them to be |\begingroup|, |\endgroup|,
422 % |\begingroup\set@color|,\\ |\hbox\bgroup\color@begingroup|,
423 % |\color@endgroup\egroup|.
424 % and \meta{set to main document colour} respectively.
426 \let\color@begingroup\relax
427 \let\color@endgroup\relax
428 \let\color@setgroup\relax
429 \let\normalcolor\relax
430 \let\color@hbox\relax
431 \let\color@vbox\relax
432 \let\color@endbox\relax
442 % \begin{macro}{\newsavebox}
443 % \changes{v0.1a}{1993/12/03}
444 % {Pass the whole of arg 1 to \cs{@ifdefinable}}
445 % Allocate a new `savebox'.
447 \def\newsavebox#1{\@ifdefinable{#1}{\newbox#1}}
451 % \begin{macro}{\savebox}
452 % Save |#1| in a box register.
453 % \changes{v1.1h}{2015/01/08}{Make Robust (latexrelease)}
456 %<latexrelease>\IncludeInRelease{2015/01/01}%
457 %<latexrelease> {\savebox}{Make \savebox robust}%
458 %<*2ekernel|latexrelease>
459 \DeclareRobustCommand\savebox[1]{%
461 {\@savepicbox#1}{\@ifnextchar[{\@savebox#1}{\sbox#1}}}%
462 %</2ekernel|latexrelease>
463 %<latexrelease>\EndIncludeInRelease
464 %<latexrelease>\IncludeInRelease{0000/00/00}%
465 %<latexrelease> {\savebox}{Make \savebox robust}%
466 %<latexrelease>\def\savebox#1{%
467 %<latexrelease> \@ifnextchar(%)
468 %<latexrelease> {\@savepicbox#1}{\@ifnextchar[{\@savebox#1}{\sbox#1}}}%
469 %<latexrelease>\EndIncludeInRelease
474 % \begin{macro}{\sbox}
475 % \changes{v0.1a}{1993/12/03}
477 % \changes{v0.1a}{1993/12/03}
479 % \changes{v1.0b}{1994/03/14}
480 % {Use \cs{color@setgroup}}
481 % \changes{v1.0j}{1994/10/18}
483 % Save |#1| in a box register.
485 \long\def\sbox#1#2{\setbox#1\hbox{%
486 \color@setgroup#2\color@endgroup}}
490 % \begin{macro}{\@savebox}
491 % \changes{v0.1a}{1993/12/03}
493 % Look for second optional argument.
495 \def\@savebox#1[#2]{%
496 \@ifnextchar [{\@isavebox#1[#2]}{\@isavebox#1[#2][c]}}
500 % \begin{macro}{\@isavebox}
501 % \changes{v0.1a}{1993/12/03}
503 % \changes{v0.1a}{1993/12/03}
505 % \changes{v1.0b}{1994/03/14}
506 % {Use \cs{color@setgroup}}
507 % \changes{v1.0d}{1994/04/15}
508 % {Added missing procent character.}
509 % \changes{v1.0v}{1995/07/20}
512 \long\def\@isavebox#1[#2][#3]#4{%
513 \sbox#1{\@imakebox[#2][#3]{#4}}}
517 % \begin{macro}{\@savepicbox}
518 % Picture mode version of |\savebox|.
520 \def\@savepicbox#1(#2,#3){%
522 {\@isavepicbox#1(#2,#3)}{\@isavepicbox#1(#2,#3)[]}}
526 % \begin{macro}{\@isavepicbox}
527 % \changes{v0.1a}{1993/12/03}
529 % \changes{v1.0b}{1994/03/14}
530 % {Use \cs{color@setgroup}}
531 % \changes{v1.0l}{1994/10/25}
532 % {missing percent (moved from ltpatch)}
533 % \changes{v1.0v}{1995/07/20}
535 % Picture mode version of |\savebox|.
537 \long\def\@isavepicbox#1(#2,#3)[#4]#5{%
538 \sbox#1{\@imakepicbox(#2,#3)[#4]{#5}}}
542 % \begin{macro}{\lrbox}
543 % \changes{v0.1a}{1993/12/03}
545 % \changes{v0.1a}{1993/12/03}
547 % \changes{v0.1b}{1993/12/08}
548 % {move \cs{@endpefalse} out of the inner group}
549 % \changes{v1.0b}{1994/03/14}
550 % {Use \cs{color@setgroup}}
551 % |lrbox|: the new environment form of |\sbox|. Use |\aftergroup| tricks
552 % to enable a \emph{local} assignment to be made to the box, in a way
553 % that it still has an effect \emph{outside} the |lrbox| environment.
559 \begingroup\aftergroup}%
560 \def\noexpand\@currenvir{\@currenvir}%
561 \def\noexpand\@currenvline{\on@line}}%
569 % \begin{macro}{\endlrbox}
570 % \changes{v0.1a}{1993/12/03}
572 % End the |lrbox| environment.
574 \def\endlrbox{\unskip\color@endgroup}
578 % \begin{macro}{\usebox}
581 \def\usebox#1{\leavevmode\copy #1\relax}
585 % \begin{macro}{\frame}
587 % The following definition of |\frame| was written by Pavel Curtis
588 % (Extra space removed 14 Jan 88)
589 % RmS 92/08/24: Replaced occurrence of |\@halfwidth| by |\@wholewidth|
597 \hrule \@height\@wholewidth
599 \vrule\@width\@wholewidth
601 \vrule\@width\@wholewidth}%
602 \hrule\@height\@wholewidth
603 \vskip-\@wholewidth}%
604 \hskip-\@wholewidth}}
608 % \begin{macro}{\fboxrule}
609 % \begin{macro}{\fboxsep}
610 % user level parameters,
618 % \begin{macro}{\fbox}
619 % Abbreviated framed box command.
620 % \changes{v0.1a}{1993/12/03}
622 % \changes{v1.0g}{1994/05/12}
623 % {New definition, merged with \cs{framebox}}
624 % \changes{v1.0i}{1994/06/01}
625 % {New version, using \cs{@frameb@x}}
626 % \changes{v1.0j}{1994/10/18}
628 % \changes{v1.0k}{1994/10/24}
629 % {Inner braces added (to fix latex/1061)}
630 % \changes{v1.0s}{1995/04/27}
631 % {Move \cs{leavevmode} for graphics/1512}
635 \setbox\@tempboxa\hbox{%
637 \kern\fboxsep{#1}\kern\fboxsep
643 % \begin{macro}{\framebox}
644 % Framed version of |\makebox|.
645 % \changes{v1.0g}{1994/05/12}
646 % {Merged \cs{fbox} and \cs{framebox}}
647 % \changes{v1.0i}{1994/06/01}
648 % {New version, so \cs{width} is correct in \cs{framebox}}
649 % \changes{v1.1h}{2015/01/08}{Make Robust (latexrelease)}
652 %<latexrelease>\IncludeInRelease{2015/01/01}%
653 %<latexrelease> {\framebox}{Make \framebox robust}%
654 %<*2ekernel|latexrelease>
655 \DeclareRobustCommand\framebox{%
657 \@framepicbox{\@ifnextchar[\@framebox\fbox}}%
658 %</2ekernel|latexrelease>
659 %<latexrelease>\EndIncludeInRelease
660 %<latexrelease>\IncludeInRelease{0000/00/00}%
661 %<latexrelease> {\framebox}{Make \framebox robust}%
662 %<latexrelease>\def\framebox{%
663 %<latexrelease> \@ifnextchar(%)
664 %<latexrelease> \@framepicbox{\@ifnextchar[\@framebox\fbox}}%
665 %<latexrelease>\EndIncludeInRelease
670 % \begin{macro}{\@framebox}
671 % Deal with optional arguments.
676 {\@iframebox[#1][c]}}
680 % \begin{macro}{\@iframebox}
681 % The handling the optional arguments.
682 % \changes{v1.0i}{1994/06/01}
683 % {New version, so \cs{width} is correct in \cs{framebox}}
684 % \changes{v1.0j}{1994/10/18}
685 % {\cs{leavevmode} moved to \cs{@frameb@x}}
686 % \changes{v1.0s}{1995/04/27}
687 % {Move \cs{leavevmode} for graphics/1512}
688 % In order to set the whole box, including the frame to the
689 % specified dimension, we first determine that dimension
690 % from the natural size of the text, |#3|.
693 \long\def\@iframebox[#1][#2]#3{%
695 \@begin@tempboxa\hbox{#3}%
696 \setlength\@tempdima{#1}%
697 \setbox\@tempboxa\hb@xt@\@tempdima
698 {\kern\fboxsep\csname bm@#2\endcsname\kern\fboxsep}%
699 \@frameb@x{\kern-\fboxrule}%
704 % \begin{macro}{\@frameb@x}
705 % Common part of |\framebox| and |\fbox|. |#1| is a negative kern
706 % in the |\framebox| case so that the vertical rules do not add to the
708 % \changes{v1.0i}{1994/06/01}
710 % \changes{v1.0j}{1994/10/18}
711 % {\cs{leavevmode} added}
712 % \changes{v1.0s}{1995/04/27}
713 % {Move \cs{leavevmode} for graphics/1512}
717 \advance\@tempdima\fboxsep
718 \advance\@tempdima\dp\@tempboxa
720 \lower\@tempdima\hbox{%
722 \hrule\@height\fboxrule
724 \vrule\@width\fboxrule
731 \vrule\@width\fboxrule}%
732 \hrule\@height\fboxrule}%
739 % \begin{macro}{\@framepicbox}
740 % Picture mode version.
742 \def\@framepicbox(#1,#2){%
743 \@ifnextchar[{\@iframepicbox(#1,#2)}{\@iframepicbox(#1,#2)[]}}
747 % \begin{macro}{\@iframepicbox}
748 % Picture mode version.
750 \long\def\@iframepicbox(#1,#2)[#3]#4{%
751 \frame{\@imakepicbox(#1,#2)[#3]{#4}}}
755 % \begin{macro}{\parbox}
756 % \changes{v0.1a}{1993/12/03}
757 % {Redefined to support extra optional arguments}
758 % \changes{v0.1d}{1993/12/15}
759 % {Changed default from `c' to `s'}
760 % The main vertical-box command for \LaTeX.
761 % \changes{v1.1h}{2015/01/08}{Make Robust (latexrelease)}
764 %<latexrelease>\IncludeInRelease{2015/01/01}%
765 %<latexrelease> {\parbox}{Make \parbox robust}%
766 %<*2ekernel|latexrelease>
767 \DeclareRobustCommand\parbox{%
770 {\@iiiparbox c\relax[s]}}%
771 %</2ekernel|latexrelease>
772 %<latexrelease>\EndIncludeInRelease
773 %<latexrelease>\IncludeInRelease{0000/00/00}%
774 %<latexrelease> {\parbox}{Make \parbox robust}%
775 %<latexrelease>\def\parbox{%
776 %<latexrelease> \@ifnextchar[%]
777 %<latexrelease> \@iparbox
778 %<latexrelease> {\@iiiparbox c\relax[s]}}%
779 %<latexrelease>\EndIncludeInRelease
784 % \begin{macro}{\@iparbox}
785 % \changes{v0.1d}{1993/12/15}
786 % {Changed default from `c' to `s'}
787 % Optional argument handling.
792 {\@iiiparbox{#1}\relax[s]}}
796 % \begin{macro}{\@iiparbox}
797 % Optional argument handling.
799 \def\@iiparbox#1[#2]{%
801 {\@iiiparbox{#1}{#2}}%
802 {\@iiiparbox{#1}{#2}[#1]}}
806 % \begin{macro}{\@iiiparbox}
807 % \begin{macro}{\@parboxto}
808 % \changes{v1.0j}{1994/10/18}
809 % {Macro added to remove misuse of \cs{@empty}}
810 % \changes{v0.1b}{1993/12/08}
811 % {\cs{endgraf} added due to extra group in \cs{@begin@tempboxa}}
812 % \changes{v1.0y}{1996/06/10}
813 % {(DPC) Changed \cs{endgraf} to \cs{@@par}}
814 % \changes{v1.1f}{1999/04/27}
815 % {(CAR) Changed \cs{@empty} to \cs{relax} as flag for natural
817 % \changes{v1.1g}{2006/05/18}
818 % {Ensure \cs{@parboxto} holds the value of \cs{@tempdimb} not the
819 % register itself (pr/3867)}
820 % The internal version of |\parbox|.
822 \let\@parboxto\@empty
823 \long\def\@iiiparbox#1#2[#3]#4#5{%
826 \setlength\@tempdima{#4}%
827 \@begin@tempboxa\vbox{\hsize\@tempdima\@parboxrestore#5\@@par}%
829 \setlength\@tempdimb{#2}%
830 \edef\@parboxto{to\the\@tempdimb}%
834 \else\ifmmode\vcenter
835 \else\@pboxswtrue $\vcenter
837 \@parboxto{\let\hss\vss\let\unhbox\unvbox
838 \csname bm@#3\endcsname}%
845 % \changes{v1.0c}{1994/04/12}
846 % {Remove \cs{@acci}, now defined in ltplain.dtx}
847 % \changes{v1.0c}{1994/04/12}
848 % {Remove \cs{@dischyph}, now defined in ltinit.dtx}
850 % \begin{macro}{\@arrayparboxrestore}
851 % Restore various paragraph parameters.
853 % The rational for allowing two normally global flags to be set
854 % locally here was stated originally by
855 % Donald Arsenau and extended by Chris Rowley.
856 % It is because these flags are only set globally to
857 % true by section commands, and these should never appear within
858 % boxes or, indeed, in any group; and they are only ever
859 % set globally to false when they are definitely true.
861 % If anyone is unhappy with this argument then both flags should be
862 % treated as in |\set@nobreak|; otherwise this command will be
864 % \changes{v1.1a}{1996/10/24}{Added local settings of flags: dangerous!!}
866 \def\@arrayparboxrestore{%
867 \let\if@nobreak\iffalse
868 \let\if@noskipsec\iffalse
872 % Redefined accents to allow changes in font encoding
873 % \changes{v1.0h}{1994/05/13}
874 % {New accent system, use \cs{let} not \cs{def}}
876 \let\'\@acci\let\`\@accii\let\=\@acciii
877 \parindent\z@ \parskip\z@skip
881 \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
882 \parfillskip\@flushglue \lineskip\normallineskip
883 \baselineskip\normalbaselineskip
888 % \begin{macro}{\parboxrestore}
889 % Restore various paragraph parameters, and also |\\|.
891 \def\@parboxrestore{\@arrayparboxrestore\let\\\@normalcr}
895 % \begin{macro}{\if@minipage}
896 % Switch that is true at the start of a minipage.
897 % \changes{v1.0z}{1996/07/26}{put \cs{global} into definition}
899 \def\@minipagefalse{\global\let\if@minipage\iffalse}
900 \def\@minipagetrue {\global\let\if@minipage\iftrue}
905 % \begin{macro}{\minipage}
906 % \changes{v0.1a}{1993/12/03}
907 % {Redefined to support extra optional arguments}
908 % \changes{v0.1d}{1993/12/15}
909 % {extra space removed.}
910 % \changes{v0.1d}{1993/12/15}
911 % {Changed default from `c' to `s'}
912 % Essentially an environment form of |\parbox|.
917 {\@iiiminipage c\relax[s]}}
921 % \begin{macro}{\@iminipage}
922 % \changes{v0.1d}{1993/12/15}
923 % {Changed default from `c' to `s'}
924 % Optional argument handling.
926 \def\@iminipage[#1]{%
929 {\@iiiminipage{#1}\relax[s]}}
933 % \begin{macro}{\@iiminipage}
934 % Optional argument handling.
936 \def\@iiminipage#1[#2]{%
938 {\@iiiminipage{#1}{#2}}%
939 {\@iiiminipage{#1}{#2}[#1]}}
943 % \begin{macro}{\@iiiminipage}
944 % \changes{v1.0e}{1994/04/21}
945 % {Extra \cs{bgroup} for colour}
946 % \changes{v1.0f}{1994/05/11}
947 % {Use new \cs{color@setgroup} concept.}
948 % Internal form of |minipage|.
949 % \changes{v1.1a}{1996/10/24}{Use it or lose it (@setminpage): Frank
950 % will want to lose it}
952 \def\@iiiminipage#1#2[#3]#4{%
955 \setlength\@tempdima{#4}%
956 \def\@mpargs{{#1}{#2}[#3]{#4}}%
957 \setbox\@tempboxa\vbox\bgroup
960 \textwidth\hsize \columnwidth\hsize
962 \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@
963 \let\@footnotetext\@mpfootnotetext
964 \let\@listdepth\@mplistdepth \@mplistdepth\z@
970 % \begin{macro}{\@minipagerestore}
971 % Hook so that other styles can reset other commands in a minipage.
973 \let\@minipagerestore=\relax
978 % \begin{macro}{\endminipage}
979 % \changes{LaTeX209}{1992/08/14}
980 % {(RmS) replaced \cs{vskip}-\cs{lastskip} by \cs{unskip}
982 % \changes{v1.0e}{1994/04/21}
983 % {Extra \cs{egroup} for colour}
984 % \changes{v1.0f}{1994/05/11}
985 % {Use new \cs{color@setgroup} concept.}
986 % \changes{v1.0n}{1994/11/05}
987 % {Colour resetting for footnotes moved to here: as for main
993 \ifvoid\@mpfootins\else
994 \vskip\skip\@mpfootins
999 \@minipagefalse %% added 24 May 89
1002 \expandafter\@iiiparbox\@mpargs{\unvbox\@tempboxa}}
1006 % \begin{macro}{\@mplistdepth}
1007 % \begin{macro}{\@mpfootins}
1008 % Versions of |\@listdepth| and |\footins| local to minipage.
1010 \newcount\@mplistdepth
1011 \newinsert\@mpfootins
1016 % \begin{macro}{\@mpfootnotetext}
1017 % Minipage version of |\@footnotetext|.
1019 % Final |\strut| added 27 Mar 89, on suggestion by Don Hosek
1020 % \changes{LaTeX2.09}{1991/09/29}{(RmS) added \cs{reset@font}}
1021 % \changes{LaTeX2.09}{1992/11/26}{(RmS) added protection for \cs{edef}}
1022 % \changes{v0.1a}{1994/03/07}{Extra group for colour}
1023 % \changes{v1.0e}{1994/04/21}
1024 % {Extra \cs{endgraf} for colour}
1025 % \changes{v1.0f}{1994/05/11}
1026 % {Use new \cs{color@setgroup} concept.}
1027 % \changes{v1.0f}{1994/05/11}
1028 % {Use new \cs{normalcolor} and \cs{@finalstrut}.}
1029 % \changes{v1.0m}{1994/11/04}
1030 % {Added \cs{protected@edef}. ASAJ.}
1031 % \changes{v1.0n}{1994/11/05}
1032 % {Colour resetting for footnotes moved to endminipage: as for main
1034 % \changes{v1.0o}{1994/11/05}
1035 % {Colour groups restored here.}
1037 \long\def\@mpfootnotetext#1{%
1038 \global\setbox\@mpfootins\vbox{%
1040 \reset@font\footnotesize
1043 \protected@edef\@currentlabel
1044 {\csname p@mpfootnote\endcsname\@thefnmark}%
1047 \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
1056 % \begin{macro}{\rule}
1057 % Draw a rule of the specified size.
1058 % \changes{v1.1h}{2015/01/08}{Make Robust (latexrelease)}
1061 %<latexrelease>\IncludeInRelease{2015/01/01}%
1062 %<latexrelease> {\rule}{Make \rule robust}%
1063 %<*2ekernel|latexrelease>
1064 \DeclareRobustCommand\rule{\@ifnextchar[\@rule{\@rule[\z@]}}%
1065 %</2ekernel|latexrelease>
1066 %<latexrelease>\EndIncludeInRelease
1067 %<latexrelease>\IncludeInRelease{0000/00/00}%
1068 %<latexrelease> {\rule}{Make \rule robust}%
1069 %<latexrelease>\def\rule{\@ifnextchar[\@rule{\@rule[\z@]}}%
1070 %<latexrelease>\EndIncludeInRelease
1075 % \begin{macro}{\@rule}
1076 % Internal form of |\rule|.
1077 % \changes{v1.1c}{1998/06/04}{Support calc-expressions}
1079 \def\@rule[#1]#2#3{%
1082 \setlength\@tempdima{#1}%
1083 \setlength\@tempdimb{#2}%
1084 \setlength\@tempdimc{#3}%
1085 \advance\@tempdimc\@tempdima
1086 \vrule\@width\@tempdimb\@height\@tempdimc\@depth-\@tempdima}}
1090 % \begin{macro}{\@@underline}
1091 % Saved primitive |\underline|.
1093 \let\@@underline\underline
1097 % \begin{macro}{\underline}
1098 % \LaTeX\ version works outside math.
1099 % \task{???}{why the second `relax in `underline ?}
1103 \ifmmode\@@underline{#1}%
1104 \else $\@@underline{\hbox{#1}}\m@th$\relax\fi}
1108 % \begin{macro}{\raisebox}
1109 % \changes{v0.1a}{1993/12/03}
1110 % {redefined to support \cs{height}}
1111 % \changes{v1.0s}{1995/04/27}
1112 % {Move \cs{leavevmode} for graphics/1512}
1113 % Raise a box, and change its vertical dimensions.
1114 % \changes{v1.1h}{2015/01/08}{Make Robust (latexrelease)}
1117 %<latexrelease>\IncludeInRelease{2015/01/01}%
1118 %<latexrelease> {\raisebox}{Make \raisebox robust}%
1119 %<*2ekernel|latexrelease>
1120 \DeclareRobustCommand\raisebox[1]{%
1122 \@ifnextchar[{\@rsbox{#1}}{\@irsbox{#1}[]}}
1123 %</2ekernel|latexrelease>
1124 %<latexrelease>\EndIncludeInRelease
1125 %<latexrelease>\IncludeInRelease{0000/00/00}%
1126 %<latexrelease> {\raisebox}{Make \raisebox robust}%
1127 %<latexrelease>\def\raisebox#1{%
1128 %<latexrelease> \leavevmode
1129 %<latexrelease> \@ifnextchar[{\@rsbox{#1}}{\@irsbox{#1}[]}}
1130 %<latexrelease>\EndIncludeInRelease
1135 % \begin{macro}{\@rsbox}
1136 % Optional argument handling.
1139 \@ifnextchar[{\@iirsbox{#1}[#2]}{\@irsbox{#1}[#2]}}
1143 % \begin{macro}{\@argrsbox}
1144 % \changes{v0.1a}{1993/12/03}
1149 % \begin{macro}{\@irsbox}
1150 % \changes{v0.1a}{1993/12/03}
1151 % {redefined to support \cs{height}}
1152 % \changes{v0.1b}{1993/12/08}
1154 % \changes{v0.1c}{1993/12/09}
1155 % {fix another typo}
1156 % \changes{v0.1f}{1994/03/03}
1157 % {Replaced a missing \cs{else}}
1158 % \changes{v1.0s}{1995/04/27}
1159 % {Move \cs{leavevmode} for graphics/1512}
1160 % \changes{v1.0u}{1995/05/17}
1161 % {Removed surplus braces}
1162 % Internal version of |\raisebox| (less than two optional args).
1164 \long\def\@irsbox#1[#2]#3{%
1165 \@begin@tempboxa\hbox{#3}%
1166 \setlength\@tempdima{#1}%
1167 \ifx\\#2\\\else\setlength\@tempdimb{#2}\fi
1168 \setbox\@tempboxa\hbox{\raise\@tempdima\box\@tempboxa}%
1169 \ifx\\#2\\\else\ht\@tempboxa\@tempdimb\fi
1175 % \begin{macro}{\@iirsbox}
1176 % \changes{v0.1a}{1993/12/03}
1177 % {redefined to support \cs{height}}
1178 % \changes{v1.0s}{1995/04/27}
1179 % {Move \cs{leavevmode} for graphics/1512}
1180 % Internal version of |\raisebox| (two optional args).
1182 \long\def\@iirsbox#1[#2][#3]#4{%
1183 \@begin@tempboxa\hbox{#4}%
1184 \setlength\@tempdima{#1}%
1185 \setlength\@tempdimb{#2}%
1186 \setlength\dimen@{#3}%
1187 \setbox\@tempboxa\hbox{\raise\@tempdima\box\@tempboxa}%
1188 \ht\@tempboxa\@tempdimb
1189 \dp\@tempboxa\dimen@
1195 % \begin{macro}{\@finalstrut}
1196 % This macro adds a special strut the \emph{depth} of the box given as
1197 % |#1|, and height and width 0pt. It is used for ensuring that the
1198 % last line of a paragraph has the correct depth in `p' columns of
1199 % tables and in footnotes. In vertical mode nothing is done, as adding
1200 % the strut (as done in 2.09) would start a new paragraph. It would be
1201 % possible to inspect |\prevdepth| to check the depth of the
1202 % just-completed paragraph, but we do not do that here.
1203 % \changes{v1.0g}{1994/05/12}
1205 % Actually we do even less now, skip the vmode test as it broke tabular
1207 % \changes{v1.0p}{1994/11/09}
1208 % {Revert \cs{finalstrut} to 2.09 equivalent (from ltpatch)}.
1209 % \changes{v1.0x}{1995/10/31}
1210 % {Add \cs{nobreak} in horiz mode to allow hyphenation.
1213 % The |\nobreak| was added (1995/10/31) to allow hyphenation of the
1214 % final word of the paragraph.
1216 \def\@finalstrut#1{%
1217 \unskip\ifhmode\nobreak\fi\vrule\@width\z@\@height\z@\@depth\dp#1}
1222 % \subsection{Some low-level constructs}
1224 % The following commands are basically inherited from plain \TeX.
1226 % \begin{macro}{\leftline}
1227 % \begin{macro}{\rightline}
1228 % \begin{macro}{\centerline}
1229 % \begin{macro}{\@@line}
1230 % These macros place text on a full line either centred or left or
1233 \def\@@line{\hb@xt@\hsize}
1234 \def\leftline#1{\@@line{#1\hss}}
1235 \def\rightline#1{\@@line{\hss#1}}
1236 \def\centerline#1{\@@line{\hss#1\hss}}
1244 % \begin{macro}{\rlap}
1245 % \begin{macro}{\llap}
1246 % These macros place text to the left or right of the current
1247 % reference point without taking up space.
1250 \def\rlap#1{\hb@xt@\z@{#1\hss}}
1251 \def\llap#1{\hb@xt@\z@{\hss#1}}