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 [2016/12/29 v1.2a LaTeX Kernel (Box Commands)]
38 \documentclass{ltxdoc}
39 \GetFileInfo{ltboxes.dtx}
42 \author{David Carlisle\and
47 \MaintainedByLaTeXTeam{latex}
55 % \changes{v1.1e}{1998/08/17}{(RmS) Minor Documentation fixes.}
56 % \section{\LaTeX\ Box commands}
59 % \DescribeMacro\makebox
60 % |\makebox[|\meta{wid}|][|\meta{pos}|]{|\meta{obj}|}|\\
61 % Puts \meta{obj} in an |\hbox| of width \meta{wid}, positioned by
64 % The possible \meta{pos} are:\\
69 % |c| (default) centred.
72 % If \meta{wid} is missing, then \meta{pos} is also missing and
73 % \meta{obj} is put in an |\hbox| of its natural width.
75 % |\makebox(|\meta{x}|,|\meta{y}|)[|\meta{pos}|]{|\meta{obj}|}|\\
76 % Puts \meta{obj} in an |\hbox| of width $x * |\unitlength|$
77 % and height $y * |\unitlength|$.
78 % \meta{pos} arguments are
79 % |s|, |l|, |r| or |c| (default) for stretched, flushleft, flushright
80 % or centred, and |t| or |b|
81 % for top, bottom -- or combinations like |tr| or |rb|.
82 % Default for horizontal and vertical are centered.
83 % Note that in this picture mode version of |\makebox| a [b] aligns on
84 % the \emph{bottom} of the text as documented. If you want to align on
85 % the \emph{baseline} use
86 % |\makebox( , )[b]{\raisebox{0pt}[\height][0pt]{xyz}}}|
87 % or |\makebox( , )[b]{\smash{xyz}}|
90 % |\mbox{|\meta{obj}|}| The same as |\makebox{|\meta{obj}|}|, but is
91 % more efficient as no checking for optional arguments is done.
93 % \DescribeMacro\newsavebox
94 % |\newsavebox{\cmd}| : If |\cmd| is undefined, then defines it
95 % to be a \TeX\ box register.
97 % \DescribeMacro\savebox
98 % |\savebox{\cmd}| ... : |\cmd| is defined to be a \TeX\ box register,
99 % and the '...' are any |\makebox| arguments. It is
100 % like |\makebox|, except it doesn't produce text but
101 % saves the value in |\box| |\cmd|.
103 % \DescribeMacro\sbox
104 % |\sbox{|\meta{cmd}|}{|\meta{obj}|}| is an efficient abbreviation for\\
105 % |\savebox{|\meta{cmd}|}{|\meta{obj}|}|.
107 % \DescribeEnv{lrbox}
108 % |\begin{lrbox}{|\meta{cmd}|}|\meta{text}|\end{lrbox}| is equivalent
110 % |\sbox{|\meta{cmd}|}{|\meta{text}|}|\\
111 % except that any white space at the beginning and end of \meta{text}
114 % \DescribeMacro\framebox
115 % |\framebox| ... : like |\makebox|, except it puts a `frame' around
116 % the box. The frame is made of lines of thickness
117 % |\fboxrule|, separated by space |\fboxsep| from the
118 % text -- except for |\framebox(X,Y)| ... , where the
119 % thickness of the lines is as for the picture environment,
120 % and there is no separation added.
122 % \DescribeMacro\fbox
123 % |\fbox{|\meta{obj}|}| is an abbreviation for
124 % |\framebox{|\meta{obj}|}|.
126 % \DescribeMacro\parbox
127 % |\parbox[|\meta{pos}|][|\meta{height}|][|\meta{inner-pos}|]{|^^A
128 % \meta{width}|}{|\meta{text}|}| :
129 % Makes a box with |\hsize| \meta{width}, positioned by \meta{pos} as
131 % c : |\vcenter| (placed in |$...$| if not in math mode)
134 % default value is c.
135 % Sets |\hsize| := \meta{width} and calls |\@parboxrestore|, which
136 % does the following:
137 % Restores the original definitions of:
148 % Resets the following parameters:
150 % \begin{tabular}{l@{\quad=\quad}ll}
151 % |\parindent| & 0pt \\
152 % |\parskip| & 0pt & added 20 Jan 87\\
153 % |\linewidth| & |\hsize|\\
154 % |\@totalleftmargin| & 0pt\\
155 % |\leftskip| & 0pt\\
156 % |\rightskip| & 0pt\\
157 % |\@rightskip| & 0pt\\
158 % |\parfillskip| & 0pt plus 1fil\\
159 % |\lineskip| & |\normallineskip|\\
160 % |\baselineskip| & |\normalbaselineskip|
165 % Note: |\@arrayparboxrestore| same as |\@parboxrestore|
166 % but it doesn't restore |\\|.
168 % \DescribeEnv{minipage}
169 % |minipage| : Similar to |\parbox|, except it also
170 % makes this look like a page by setting
172 % |\textwidth| == |\columnwidth| == box width
174 % changes footnotes by redefining:\\%
175 % |\@mpfn| == mpfootnote \\
176 % |\thempfn| == |\thempfootnote|\\
177 % |\@footnotetext| == |\@mpfootnotetext|
179 % resets the following list environment parameters:\\
180 % |\@listdepth| == |\@mplistdepth|\\
181 % where |\@mplistdepth| is initialized to zero,
183 % and executes |\@minipagerestore| to allow the document
184 % style to reset any other parameters it desires.
185 % It sets |@minipage| true, and resets |\everypar| to set
186 % it false. This switch keeps |\addvspace| from putting space
187 % at the top of a minipage.
189 % Change added 24 May 89: |\minipage| sets |@minipage| globally;
190 % |\endminipage| resets it false.
193 % \DescribeMacro\rule
194 % |\rule[|\meta{raised}|]{|\meta{width}|}{|\meta{height}|}| :
195 % Makes a $\meta{width}*\meta{height}$ rule, raised \meta{raised}.
197 % \DescribeMacro\underline
198 % |\underline{|\meta{text}|}| : Makes an underlined hbox with
201 % \DescribeMacro\raisebox
202 % |\raisebox{|\meta{distance}|}[|\meta{height}|][|\meta{depth}^^A
203 % |]{|\meta{box}|}| :\\
204 % Raises \meta{box} up by \meta{distance} length (down if
205 % \meta{distance} negative). Makes \TeX\ think that the new box extends
206 % \meta{height} above the line and \meta{depth} below, for a total
207 % vertical length of \meta{height}+\meta{depth}. Default values of
208 % \meta{height} \& \meta{depth} = actual height and depth of box in new
213 % \changes{v0.1e}{1994/03/02}{Remove need for drv file}
214 % \changes{v0.1e}{1994/03/02}{Add 2ekernel module}
215 % \changes{v1.0a}{1994/03/07}{Unify format with other Kernel files}
216 % \changes{v1.0f}{1994/05/11}
217 % {Superfluous braces removed from several commands}
218 % \changes{v1.0j}{1994/10/18}
219 % {stuff from ltpatch done}
220 % \changes{v1.0p}{1994/11/09}
221 % {more colour changes\ldots}
222 % \changes{v1.0q}{1994/11/17}
223 % {\cs{@tempa} to \cs{reserved@a}}
224 % \changes{v1.0t}{1995/05/07}{Use \cs{hb@xt@}}
225 % \changes{v1.0w}{1995/10/16}{Clarify makebox description}
231 % \begin{macro}{\makebox}
232 % \changes{v0.1a}{1993/12/03}
234 % |\makebox| User level command just looks for optional |[| or |(|.
235 % \changes{v1.1h}{2015/01/08}{Make Robust (latexrelease)}
238 %<latexrelease>\IncludeInRelease{2015/01/01}%
239 %<latexrelease> {\makebox}{Make \makebox robust}%
240 %<*2ekernel|latexrelease>
241 \DeclareRobustCommand\makebox{%
245 {\@ifnextchar[\@makebox\mbox}}%
246 %</2ekernel|latexrelease>
247 %<latexrelease>\EndIncludeInRelease
248 %<latexrelease>\IncludeInRelease{0000/00/00}%
249 %<latexrelease> {\makebox}{Make \makebox robust}%
250 %<latexrelease>\def\makebox{%
251 %<latexrelease> \leavevmode
252 %<latexrelease> \@ifnextchar(%)
253 %<latexrelease> \@makepicbox
254 %<latexrelease> {\@ifnextchar[\@makebox\mbox}}%
255 %<latexrelease>\expandafter\let\csname makebox \endcsname\@undefined
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>\expandafter\let\csname savebox \endcsname\@undefined
470 %<latexrelease>\EndIncludeInRelease
475 % \begin{macro}{\sbox}
476 % \changes{v0.1a}{1993/12/03}
478 % \changes{v0.1a}{1993/12/03}
480 % \changes{v1.0b}{1994/03/14}
481 % {Use \cs{color@setgroup}}
482 % \changes{v1.0j}{1994/10/18}
484 % Save |#1| in a box register.
486 \long\def\sbox#1#2{\setbox#1\hbox{%
487 \color@setgroup#2\color@endgroup}}
491 % \begin{macro}{\@savebox}
492 % \changes{v0.1a}{1993/12/03}
494 % Look for second optional argument.
496 \def\@savebox#1[#2]{%
497 \@ifnextchar [{\@isavebox#1[#2]}{\@isavebox#1[#2][c]}}
501 % \begin{macro}{\@isavebox}
502 % \changes{v0.1a}{1993/12/03}
504 % \changes{v0.1a}{1993/12/03}
506 % \changes{v1.0b}{1994/03/14}
507 % {Use \cs{color@setgroup}}
508 % \changes{v1.0d}{1994/04/15}
509 % {Added missing procent character.}
510 % \changes{v1.0v}{1995/07/20}
513 \long\def\@isavebox#1[#2][#3]#4{%
514 \sbox#1{\@imakebox[#2][#3]{#4}}}
518 % \begin{macro}{\@savepicbox}
519 % Picture mode version of |\savebox|.
521 \def\@savepicbox#1(#2,#3){%
523 {\@isavepicbox#1(#2,#3)}{\@isavepicbox#1(#2,#3)[]}}
527 % \begin{macro}{\@isavepicbox}
528 % \changes{v0.1a}{1993/12/03}
530 % \changes{v1.0b}{1994/03/14}
531 % {Use \cs{color@setgroup}}
532 % \changes{v1.0l}{1994/10/25}
533 % {missing percent (moved from ltpatch)}
534 % \changes{v1.0v}{1995/07/20}
536 % Picture mode version of |\savebox|.
538 \long\def\@isavepicbox#1(#2,#3)[#4]#5{%
539 \sbox#1{\@imakepicbox(#2,#3)[#4]{#5}}}
543 % \begin{macro}{\lrbox}
544 % \changes{v0.1a}{1993/12/03}
546 % \changes{v0.1a}{1993/12/03}
548 % \changes{v0.1b}{1993/12/08}
549 % {move \cs{@endpefalse} out of the inner group}
550 % \changes{v1.0b}{1994/03/14}
551 % {Use \cs{color@setgroup}}
552 % |lrbox|: the new environment form of |\sbox|. Use |\aftergroup| tricks
553 % to enable a \emph{local} assignment to be made to the box, in a way
554 % that it still has an effect \emph{outside} the |lrbox| environment.
560 \begingroup\aftergroup}%
561 \def\noexpand\@currenvir{\@currenvir}%
562 \def\noexpand\@currenvline{\on@line}}%
570 % \begin{macro}{\endlrbox}
571 % \changes{v0.1a}{1993/12/03}
573 % End the |lrbox| environment.
575 \def\endlrbox{\unskip\color@endgroup}
579 % \begin{macro}{\usebox}
582 \def\usebox#1{\leavevmode\copy #1\relax}
586 % \begin{macro}{\frame}
588 % The following definition of |\frame| was written by Pavel Curtis
589 % (Extra space removed 14 Jan 88)
590 % RmS 92/08/24: Replaced occurrence of |\@halfwidth| by |\@wholewidth|
598 \hrule \@height\@wholewidth
600 \vrule\@width\@wholewidth
602 \vrule\@width\@wholewidth}%
603 \hrule\@height\@wholewidth
604 \vskip-\@wholewidth}%
605 \hskip-\@wholewidth}}
609 % \begin{macro}{\fboxrule}
610 % \begin{macro}{\fboxsep}
611 % user level parameters,
619 % \begin{macro}{\fbox}
620 % Abbreviated framed box command.
621 % \changes{v0.1a}{1993/12/03}
623 % \changes{v1.0g}{1994/05/12}
624 % {New definition, merged with \cs{framebox}}
625 % \changes{v1.0i}{1994/06/01}
626 % {New version, using \cs{@frameb@x}}
627 % \changes{v1.0j}{1994/10/18}
629 % \changes{v1.0k}{1994/10/24}
630 % {Inner braces added (to fix latex/1061)}
631 % \changes{v1.0s}{1995/04/27}
632 % {Move \cs{leavevmode} for graphics/1512}
636 \setbox\@tempboxa\hbox{%
638 \kern\fboxsep{#1}\kern\fboxsep
644 % \begin{macro}{\framebox}
645 % Framed version of |\makebox|.
646 % \changes{v1.0g}{1994/05/12}
647 % {Merged \cs{fbox} and \cs{framebox}}
648 % \changes{v1.0i}{1994/06/01}
649 % {New version, so \cs{width} is correct in \cs{framebox}}
650 % \changes{v1.1h}{2015/01/08}{Make Robust (latexrelease)}
653 %<latexrelease>\IncludeInRelease{2015/01/01}%
654 %<latexrelease> {\framebox}{Make \framebox robust}%
655 %<*2ekernel|latexrelease>
656 \DeclareRobustCommand\framebox{%
658 \@framepicbox{\@ifnextchar[\@framebox\fbox}}%
659 %</2ekernel|latexrelease>
660 %<latexrelease>\EndIncludeInRelease
661 %<latexrelease>\IncludeInRelease{0000/00/00}%
662 %<latexrelease> {\framebox}{Make \framebox robust}%
663 %<latexrelease>\def\framebox{%
664 %<latexrelease> \@ifnextchar(%)
665 %<latexrelease> \@framepicbox{\@ifnextchar[\@framebox\fbox}}%
666 %<latexrelease>\expandafter\let\csname framebox \endcsname\@undefined
667 %<latexrelease>\EndIncludeInRelease
672 % \begin{macro}{\@framebox}
673 % Deal with optional arguments.
678 {\@iframebox[#1][c]}}
682 % \begin{macro}{\@iframebox}
683 % The handling the optional arguments.
684 % \changes{v1.0i}{1994/06/01}
685 % {New version, so \cs{width} is correct in \cs{framebox}}
686 % \changes{v1.0j}{1994/10/18}
687 % {\cs{leavevmode} moved to \cs{@frameb@x}}
688 % \changes{v1.0s}{1995/04/27}
689 % {Move \cs{leavevmode} for graphics/1512}
690 % In order to set the whole box, including the frame to the
691 % specified dimension, we first determine that dimension
692 % from the natural size of the text, |#3|.
695 \long\def\@iframebox[#1][#2]#3{%
697 \@begin@tempboxa\hbox{#3}%
698 \setlength\@tempdima{#1}%
699 \setbox\@tempboxa\hb@xt@\@tempdima
700 {\kern\fboxsep\csname bm@#2\endcsname\kern\fboxsep}%
701 \@frameb@x{\kern-\fboxrule}%
706 % \begin{macro}{\@frameb@x}
707 % Common part of |\framebox| and |\fbox|. |#1| is a negative kern
708 % in the |\framebox| case so that the vertical rules do not add to the
710 % \changes{v1.0i}{1994/06/01}
712 % \changes{v1.0j}{1994/10/18}
713 % {\cs{leavevmode} added}
714 % \changes{v1.0s}{1995/04/27}
715 % {Move \cs{leavevmode} for graphics/1512}
719 \advance\@tempdima\fboxsep
720 \advance\@tempdima\dp\@tempboxa
722 \lower\@tempdima\hbox{%
724 \hrule\@height\fboxrule
726 \vrule\@width\fboxrule
733 \vrule\@width\fboxrule}%
734 \hrule\@height\fboxrule}%
741 % \begin{macro}{\@framepicbox}
742 % Picture mode version.
744 \def\@framepicbox(#1,#2){%
745 \@ifnextchar[{\@iframepicbox(#1,#2)}{\@iframepicbox(#1,#2)[]}}
749 % \begin{macro}{\@iframepicbox}
750 % Picture mode version.
752 \long\def\@iframepicbox(#1,#2)[#3]#4{%
753 \frame{\@imakepicbox(#1,#2)[#3]{#4}}}
757 % \begin{macro}{\parbox}
758 % \changes{v0.1a}{1993/12/03}
759 % {Redefined to support extra optional arguments}
760 % \changes{v0.1d}{1993/12/15}
761 % {Changed default from `c' to `s'}
762 % The main vertical-box command for \LaTeX.
763 % \changes{v1.1h}{2015/01/08}{Make Robust (latexrelease)}
766 %<latexrelease>\IncludeInRelease{2015/01/01}%
767 %<latexrelease> {\parbox}{Make \parbox robust}%
768 %<*2ekernel|latexrelease>
769 \DeclareRobustCommand\parbox{%
772 {\@iiiparbox c\relax[s]}}%
773 %</2ekernel|latexrelease>
774 %<latexrelease>\EndIncludeInRelease
775 %<latexrelease>\IncludeInRelease{0000/00/00}%
776 %<latexrelease> {\parbox}{Make \parbox robust}%
777 %<latexrelease>\def\parbox{%
778 %<latexrelease> \@ifnextchar[%]
779 %<latexrelease> \@iparbox
780 %<latexrelease> {\@iiiparbox c\relax[s]}}%
781 %<latexrelease>\expandafter\let\csname parbox \endcsname\@undefined
782 %<latexrelease>\EndIncludeInRelease
787 % \begin{macro}{\@iparbox}
788 % \changes{v0.1d}{1993/12/15}
789 % {Changed default from `c' to `s'}
790 % Optional argument handling.
795 {\@iiiparbox{#1}\relax[s]}}
799 % \begin{macro}{\@iiparbox}
800 % Optional argument handling.
802 \def\@iiparbox#1[#2]{%
804 {\@iiiparbox{#1}{#2}}%
805 {\@iiiparbox{#1}{#2}[#1]}}
809 % \begin{macro}{\@iiiparbox}
810 % \begin{macro}{\@parboxto}
811 % \changes{v1.0j}{1994/10/18}
812 % {Macro added to remove misuse of \cs{@empty}}
813 % \changes{v0.1b}{1993/12/08}
814 % {\cs{endgraf} added due to extra group in \cs{@begin@tempboxa}}
815 % \changes{v1.0y}{1996/06/10}
816 % {(DPC) Changed \cs{endgraf} to \cs{@@par}}
817 % \changes{v1.1f}{1999/04/27}
818 % {(CAR) Changed \cs{@empty} to \cs{relax} as flag for natural
820 % \changes{v1.1g}{2006/05/18}
821 % {Ensure \cs{@parboxto} holds the value of \cs{@tempdimb} not the
822 % register itself (pr/3867)}
823 % The internal version of |\parbox|.
825 \let\@parboxto\@empty
826 \long\def\@iiiparbox#1#2[#3]#4#5{%
829 \setlength\@tempdima{#4}%
830 \@begin@tempboxa\vbox{\hsize\@tempdima\@parboxrestore#5\@@par}%
832 \setlength\@tempdimb{#2}%
833 \edef\@parboxto{to\the\@tempdimb}%
837 \else\ifmmode\vcenter
838 \else\@pboxswtrue $\vcenter
840 \@parboxto{\let\hss\vss\let\unhbox\unvbox
841 \csname bm@#3\endcsname}%
848 % \changes{v1.0c}{1994/04/12}
849 % {Remove \cs{@acci}, now defined in ltplain.dtx}
850 % \changes{v1.0c}{1994/04/12}
851 % {Remove \cs{@dischyph}, now defined in ltinit.dtx}
853 % \begin{macro}{\@arrayparboxrestore}
854 % Restore various paragraph parameters.
856 % The rational for allowing two normally global flags to be set
857 % locally here was stated originally by
858 % Donald Arsenau and extended by Chris Rowley.
859 % It is because these flags are only set globally to
860 % true by section commands, and these should never appear within
861 % boxes or, indeed, in any group; and they are only ever
862 % set globally to false when they are definitely true.
864 % If anyone is unhappy with this argument then both flags should be
865 % treated as in |\set@nobreak|; otherwise this command will be
867 % \changes{v1.1a}{1996/10/24}{Added local settings of flags: dangerous!!}
869 \def\@arrayparboxrestore{%
870 \let\if@nobreak\iffalse
871 \let\if@noskipsec\iffalse
875 % Redefined accents to allow changes in font encoding
876 % \changes{v1.0h}{1994/05/13}
877 % {New accent system, use \cs{let} not \cs{def}}
879 \let\'\@acci\let\`\@accii\let\=\@acciii
880 \parindent\z@ \parskip\z@skip
884 \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
885 \parfillskip\@flushglue \lineskip\normallineskip
886 \baselineskip\normalbaselineskip
891 % \begin{macro}{\parboxrestore}
892 % Restore various paragraph parameters, and also |\\|.
894 \def\@parboxrestore{\@arrayparboxrestore\let\\\@normalcr}
898 % \begin{macro}{\if@minipage}
899 % Switch that is true at the start of a minipage.
900 % \changes{v1.0z}{1996/07/26}{put \cs{global} into definition}
902 \def\@minipagefalse{\global\let\if@minipage\iffalse}
903 \def\@minipagetrue {\global\let\if@minipage\iftrue}
908 % \begin{macro}{\minipage}
909 % \changes{v0.1a}{1993/12/03}
910 % {Redefined to support extra optional arguments}
911 % \changes{v0.1d}{1993/12/15}
912 % {extra space removed.}
913 % \changes{v0.1d}{1993/12/15}
914 % {Changed default from `c' to `s'}
915 % Essentially an environment form of |\parbox|.
920 {\@iiiminipage c\relax[s]}}
924 % \begin{macro}{\@iminipage}
925 % \changes{v0.1d}{1993/12/15}
926 % {Changed default from `c' to `s'}
927 % Optional argument handling.
929 \def\@iminipage[#1]{%
932 {\@iiiminipage{#1}\relax[s]}}
936 % \begin{macro}{\@iiminipage}
937 % Optional argument handling.
939 \def\@iiminipage#1[#2]{%
941 {\@iiiminipage{#1}{#2}}%
942 {\@iiiminipage{#1}{#2}[#1]}}
946 % \begin{macro}{\@iiiminipage}
947 % \changes{v1.0e}{1994/04/21}
948 % {Extra \cs{bgroup} for colour}
949 % \changes{v1.0f}{1994/05/11}
950 % {Use new \cs{color@setgroup} concept.}
951 % Internal form of |minipage|.
952 % \changes{v1.1a}{1996/10/24}{Use it or lose it (@setminpage): Frank
953 % will want to lose it}
955 \def\@iiiminipage#1#2[#3]#4{%
958 \setlength\@tempdima{#4}%
959 \def\@mpargs{{#1}{#2}[#3]{#4}}%
960 \setbox\@tempboxa\vbox\bgroup
963 \textwidth\hsize \columnwidth\hsize
965 \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@
966 \let\@footnotetext\@mpfootnotetext
967 \let\@listdepth\@mplistdepth \@mplistdepth\z@
973 % \begin{macro}{\@minipagerestore}
974 % Hook so that other styles can reset other commands in a minipage.
976 \let\@minipagerestore=\relax
981 % \begin{macro}{\endminipage}
982 % \changes{LaTeX209}{1992/08/14}
983 % {(RmS) replaced \cs{vskip}-\cs{lastskip} by \cs{unskip}
985 % \changes{v1.0e}{1994/04/21}
986 % {Extra \cs{egroup} for colour}
987 % \changes{v1.0f}{1994/05/11}
988 % {Use new \cs{color@setgroup} concept.}
989 % \changes{v1.0n}{1994/11/05}
990 % {Colour resetting for footnotes moved to here: as for main
996 \ifvoid\@mpfootins\else
997 \vskip\skip\@mpfootins
1002 \@minipagefalse %% added 24 May 89
1005 \expandafter\@iiiparbox\@mpargs{\unvbox\@tempboxa}}
1009 % \begin{macro}{\@mplistdepth}
1010 % \begin{macro}{\@mpfootins}
1011 % Versions of |\@listdepth| and |\footins| local to minipage.
1013 \newcount\@mplistdepth
1014 \newinsert\@mpfootins
1019 % \begin{macro}{\@mpfootnotetext}
1020 % Minipage version of |\@footnotetext|.
1022 % Final |\strut| added 27 Mar 89, on suggestion by Don Hosek
1023 % \changes{LaTeX2.09}{1991/09/29}{(RmS) added \cs{reset@font}}
1024 % \changes{LaTeX2.09}{1992/11/26}{(RmS) added protection for \cs{edef}}
1025 % \changes{v0.1a}{1994/03/07}{Extra group for colour}
1026 % \changes{v1.0e}{1994/04/21}
1027 % {Extra \cs{endgraf} for colour}
1028 % \changes{v1.0f}{1994/05/11}
1029 % {Use new \cs{color@setgroup} concept.}
1030 % \changes{v1.0f}{1994/05/11}
1031 % {Use new \cs{normalcolor} and \cs{@finalstrut}.}
1032 % \changes{v1.0m}{1994/11/04}
1033 % {Added \cs{protected@edef}. ASAJ.}
1034 % \changes{v1.0n}{1994/11/05}
1035 % {Colour resetting for footnotes moved to endminipage: as for main
1037 % \changes{v1.0o}{1994/11/05}
1038 % {Colour groups restored here.}
1040 \long\def\@mpfootnotetext#1{%
1041 \global\setbox\@mpfootins\vbox{%
1043 \reset@font\footnotesize
1046 \protected@edef\@currentlabel
1047 {\csname p@mpfootnote\endcsname\@thefnmark}%
1050 \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
1059 % \begin{macro}{\rule}
1060 % Draw a rule of the specified size.
1061 % \changes{v1.1h}{2015/01/08}{Make Robust (latexrelease)}
1064 %<latexrelease>\IncludeInRelease{2015/01/01}%
1065 %<latexrelease> {\rule}{Make \rule robust}%
1066 %<*2ekernel|latexrelease>
1067 \DeclareRobustCommand\rule{\@ifnextchar[\@rule{\@rule[\z@]}}%
1068 %</2ekernel|latexrelease>
1069 %<latexrelease>\EndIncludeInRelease
1070 %<latexrelease>\IncludeInRelease{0000/00/00}%
1071 %<latexrelease> {\rule}{Make \rule robust}%
1072 %<latexrelease>\def\rule{\@ifnextchar[\@rule{\@rule[\z@]}}%
1073 %<latexrelease>\expandafter\let\csname rule \endcsname\@undefined
1074 %<latexrelease>\EndIncludeInRelease
1079 % \begin{macro}{\@rule}
1080 % Internal form of |\rule|.
1081 % \changes{v1.1c}{1998/06/04}{Support calc-expressions}
1083 \def\@rule[#1]#2#3{%
1086 \setlength\@tempdima{#1}%
1087 \setlength\@tempdimb{#2}%
1088 \setlength\@tempdimc{#3}%
1089 \advance\@tempdimc\@tempdima
1090 \vrule\@width\@tempdimb\@height\@tempdimc\@depth-\@tempdima}}
1094 % \begin{macro}{\@@underline}
1095 % Saved primitive |\underline|.
1097 \let\@@underline\underline
1101 % \begin{macro}{\underline}
1102 % \LaTeX\ version works outside math.
1103 % \task{???}{why the second `relax in `underline ?}
1107 \ifmmode\@@underline{#1}%
1108 \else $\@@underline{\hbox{#1}}\m@th$\relax\fi}
1112 % \begin{macro}{\raisebox}
1113 % \changes{v0.1a}{1993/12/03}
1114 % {redefined to support \cs{height}}
1115 % \changes{v1.0s}{1995/04/27}
1116 % {Move \cs{leavevmode} for graphics/1512}
1117 % Raise a box, and change its vertical dimensions.
1118 % \changes{v1.1h}{2015/01/08}{Make Robust (latexrelease)}
1121 %<latexrelease>\IncludeInRelease{2015/01/01}%
1122 %<latexrelease> {\raisebox}{Make \raisebox robust}%
1123 %<*2ekernel|latexrelease>
1124 \DeclareRobustCommand\raisebox[1]{%
1126 \@ifnextchar[{\@rsbox{#1}}{\@irsbox{#1}[]}}
1127 %</2ekernel|latexrelease>
1128 %<latexrelease>\EndIncludeInRelease
1129 %<latexrelease>\IncludeInRelease{0000/00/00}%
1130 %<latexrelease> {\raisebox}{Make \raisebox robust}%
1131 %<latexrelease>\def\raisebox#1{%
1132 %<latexrelease> \leavevmode
1133 %<latexrelease> \@ifnextchar[{\@rsbox{#1}}{\@irsbox{#1}[]}}
1134 %<latexrelease>\expandafter\let\csname raisebox \endcsname\@undefined
1135 %<latexrelease>\EndIncludeInRelease
1140 % \begin{macro}{\@rsbox}
1141 % Optional argument handling.
1144 \@ifnextchar[{\@iirsbox{#1}[#2]}{\@irsbox{#1}[#2]}}
1148 % \begin{macro}{\@argrsbox}
1149 % \changes{v0.1a}{1993/12/03}
1154 % \begin{macro}{\@irsbox}
1155 % \changes{v0.1a}{1993/12/03}
1156 % {redefined to support \cs{height}}
1157 % \changes{v0.1b}{1993/12/08}
1159 % \changes{v0.1c}{1993/12/09}
1160 % {fix another typo}
1161 % \changes{v0.1f}{1994/03/03}
1162 % {Replaced a missing \cs{else}}
1163 % \changes{v1.0s}{1995/04/27}
1164 % {Move \cs{leavevmode} for graphics/1512}
1165 % \changes{v1.0u}{1995/05/17}
1166 % {Removed surplus braces}
1167 % Internal version of |\raisebox| (less than two optional args).
1169 \long\def\@irsbox#1[#2]#3{%
1170 \@begin@tempboxa\hbox{#3}%
1171 \setlength\@tempdima{#1}%
1172 \ifx\\#2\\\else\setlength\@tempdimb{#2}\fi
1173 \setbox\@tempboxa\hbox{\raise\@tempdima\box\@tempboxa}%
1174 \ifx\\#2\\\else\ht\@tempboxa\@tempdimb\fi
1180 % \begin{macro}{\@iirsbox}
1181 % \changes{v0.1a}{1993/12/03}
1182 % {redefined to support \cs{height}}
1183 % \changes{v1.0s}{1995/04/27}
1184 % {Move \cs{leavevmode} for graphics/1512}
1185 % Internal version of |\raisebox| (two optional args).
1187 \long\def\@iirsbox#1[#2][#3]#4{%
1188 \@begin@tempboxa\hbox{#4}%
1189 \setlength\@tempdima{#1}%
1190 \setlength\@tempdimb{#2}%
1191 \setlength\dimen@{#3}%
1192 \setbox\@tempboxa\hbox{\raise\@tempdima\box\@tempboxa}%
1193 \ht\@tempboxa\@tempdimb
1194 \dp\@tempboxa\dimen@
1200 % \begin{macro}{\@finalstrut}
1201 % This macro adds a special strut the \emph{depth} of the box given as
1202 % |#1|, and height and width 0pt. It is used for ensuring that the
1203 % last line of a paragraph has the correct depth in `p' columns of
1204 % tables and in footnotes. In vertical mode nothing is done, as adding
1205 % the strut (as done in 2.09) would start a new paragraph. It would be
1206 % possible to inspect |\prevdepth| to check the depth of the
1207 % just-completed paragraph, but we do not do that here.
1208 % \changes{v1.0g}{1994/05/12}
1210 % Actually we do even less now, skip the vmode test as it broke tabular
1212 % \changes{v1.0p}{1994/11/09}
1213 % {Revert \cs{finalstrut} to 2.09 equivalent (from ltpatch)}.
1214 % \changes{v1.0x}{1995/10/31}
1215 % {Add \cs{nobreak} in horiz mode to allow hyphenation.
1218 % The |\nobreak| was added (1995/10/31) to allow hyphenation of the
1219 % final word of the paragraph.
1221 \def\@finalstrut#1{%
1222 \unskip\ifhmode\nobreak\fi\vrule\@width\z@\@height\z@\@depth\dp#1}
1227 % \subsection{Some low-level constructs}
1229 % The following commands are basically inherited from plain \TeX.
1231 % \begin{macro}{\leftline}
1232 % \begin{macro}{\rightline}
1233 % \begin{macro}{\centerline}
1234 % \begin{macro}{\@@line}
1235 % These macros place text on a full line either centred or left or
1238 \def\@@line{\hb@xt@\hsize}
1239 \def\leftline#1{\@@line{#1\hss}}
1240 \def\rightline#1{\@@line{\hss#1}}
1241 \def\centerline#1{\@@line{\hss#1\hss}}
1249 % \begin{macro}{\rlap}
1250 % \begin{macro}{\llap}
1251 % These macros place text to the left or right of the current
1252 % reference point without taking up space.
1255 \def\rlap#1{\hb@xt@\z@{#1\hss}}
1256 \def\llap#1{\hb@xt@\z@{\hss#1}}