% \iffalse meta-comment
%
% Copyright (C) 1993 by LaTeX3 project.  All rights reserved.
% For additional copyright information see further down in this file.
% 
% This file is part of the LaTeX2e system (PRELIMINARY TEST RELEASE)
% ------------------------------------------------------------------
% 
%  This system 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.
% 
% 
% IMPORTANT NOTICE:
% 
% For error reports in case of UNCHANGED versions see readme files.
% 
% Please do not request updates from us directly.  Distribution is
% done through Mail-Servers and TeX organizations.
% 
% You are not allowed to change this file.
% 
% You are allowed to distribute this file under the condition that
% it is distributed together with all files mentioned in 00readme.l2e.
% 
% If you receive only some of these files from someone, complain!
% 
% You are NOT ALLOWED to distribute this file alone.  You are NOT
% ALLOWED to take money for the distribution or use of either this
% file or a changed version, except for a nominal charge for copying
% etc.
% \fi
% \iffalse
% LATEX VERSION 2e
% Copyright (C) 1992 by Leslie Lamport
% Copyright (C) 1993 by Leslie Lamport, LaTeX3 project
%
% LaTeX 2e kernel file for box commands
%
% \fi
%
% \def\filedate{1993/12/15}
% \def\fileversion{0.1d}

%    \begin{macrocode}
\message{boxes,}
%    \end{macrocode}
%
% \section*{Boxes}
%
% \DescribeMacro\makebox
% |\makebox[|\meta{wid}|][|\meta{pos}|]{|\meta{obj}|}|\\
% Puts \meta{obj} in an |\hbox| of width \meta{wid}, positioned by
% \meta{pos}. 
%
% The possible \meta{pos} are:\\
% \begin{tabular}{ll}
% |s| stretched,\\
% |l| flushleft,\\
% |r| flushright,\\
% |c| (default) centred.
% \end{tabular}
%
% If \meta{wid} is missing, then \meta{pos} is also missing and
% \meta{obj} is put in an |\hbox| of its natural width.
%
%  |\makebox(|\meta{x}|,|\meta{y}|)[|\meta{pos}|]{|\meta{obj}|}|\\
%  Puts \meta{obj} in an |\hbox| of width $x * |\unitlength|$
%            and height $y * |\unitlength|$.  
% \meta{pos} arguments are
%  |s|, |l|, |r| or |c| (default) for stretched, flushleft, flushright
%  or centred, and  |t| or |b|
%            for top, bottom -- or combinations like  |tr| or |rb|.
%            Default for horizontal and vertical are centered.
%
% \DescribeMacro\mbox
%  |\mbox{|\meta{obj}|}| The same as |\makebox{|\meta{obj}|}|, but is
%  more efficient as no checking for optional arguments is done.
%
% \DescribeMacro\newsavebox
%  |\newsavebox{\cmd}| : If |\cmd| is undefined, then defines it
%           to be a \TeX\ box register.
%
% \DescribeMacro\savebox
%  |\savebox{\cmd}| ... : |\cmd| is defined to be a \TeX\ box register,
%            and the '...' are any |\makebox| arguments.  It is
%            like |\makebox|, except it doesn't produce text but
%            saves the value in |\box| |\cmd|.
%
% \DescribeMacro\sbox
% |\sbox{|\meta{cmd}|}{|\meta{obj}|}| is an efficient abbreviation for
% |\savebox{|\meta{cmd}|}{|\meta{obj}|}|.
%
% \DescribeEnv{lrbox}
%  |\begin{lrbox}{|\meta{cmd}|}|\meta{text}|\end{lrbox}| is equivalent
%  to |\sbox{|\meta{cmd}|}{|\meta{text}|}| except that any white space
%  at the beginning and end of \meta{text} is ignored. 
%
% \DescribeMacro\framebox
%  |\framebox| ...  : like |\makebox|, except it puts a `frame' around
%            the box.  The frame is made of lines of thickness
%            |\fboxrule|, separated by space |\fboxsep| from the
%            text -- except for |\framebox(X,Y)| ... , where the
%            thickness of the lines is as for the picture environment,
%            and there is no separation added.
%
% \DescribeMacro\fbox
% |\fbox{|\meta{obj}|}| is an efficient abbreviation for
% |\framebox{|\meta{obj}|}|.
%
% \DescribeMacro\parbox
%  |\parbox[|\meta{pos}|][|\meta{height}|][|\meta{inner-pos}|]{|^^A
%                    \meta{width}|}{|\meta{text}|}| : 
% Makes a box with |\hsize| \meta{width}, positioned by \meta{pos} as
% follows: 
%              c : |\vcenter| (placed in |$...$| if not in math mode)
%              b : |\vbox|
%              t : |\vtop|
%         default value is c.
%    Sets |\hsize| := \meta{width} and calls |\@parboxrestore|, which
%    does the following:
%         Restores the original definitions of:
%
%              \begin{tabular}{l}
%              |\par|\\
%              |\\|\\
%              |\-|\\
%              |\'|\\
%              | \`|\\
%              |\=|
%              \end{tabular}
%
%         Resets the following parameters:
%
%              \begin{tabular}{l@{\quad=\quad}ll}
%              |\parindent|        & 0pt \\
%              |\parskip|          & 0pt           & added 20 Jan 87\\
%              |\linewidth|        & |\hsize|\\
%              |\@totalleftmargin| & 0pt\\
%              |\leftskip|         & 0pt\\
%              |\rightskip|        & 0pt\\
%              |\@rightskip|       & 0pt\\
%              |\parfillskip|      & 0pt plus 1fil\\
%              |\lineskip|         & |\normallineskip|\\
%              |\baselineskip|     & |\normalbaselineskip|
%              \end{tabular}
%
%         Calls |\sloppy|
%
%  Note: |\@arrayparboxrestore| same as |\@parboxrestore|
%         but it doesn't restore |\\|.
%
% \DescribeEnv{minipage}
% |minipage|  :  Similar to |\parbox|, except it also
%        makes this look like a page by setting
%
%              |\textwidth| == |\columnwidth| == box width
%
%        changes footnotes by redefining:\\%             
%              |\@mpfn|         == mpfootnote \\
%              |\thempfn|       == |\thempfootnote|\\
%              |\@footnotetext| == |\@mpfootnotetext|
%
%        resets the following list environment parameters:\\
%              |\@listdepth|    == |\@mplistdepth|\\
%        where  |\@mplistdepth| is initialized to zero,
%
%        and executes |\@minipagerestore| to allow the document
%        style to reset any other parameters it desires.
%        It sets |@minipage| true, and resets |\everypar| to set
%        it false.  This switch keeps |\addvspace| from putting space
%        at the top of a minipage.
%
%        Change added 24 May 89: |\minipage| sets |@minipage| globally;
%        |\endminipage| resets it false.
%
%
% \DescribeMacro\rule
% |\rule[|\meta{raised}|]{|\meta{width}|}{|\meta{height}|}| : 
% Makes a $\meta{width}*\meta{height}$ rule, raised \meta{raised}.
%
% \DescribeMacro\underline
% |\underline{|\meta{text}|}| : Makes an underlined hbox with
% \meta{text} in it. 
%
% \DescribeMacro\raisebox
% |\raisebox{|\meta{distance}|}[|\meta{height}|][|\meta{depth}^^A
%                 |]{|\meta{box}|}| : 
% Raises \meta{box} up by \meta{distance} length (down if
% \meta{distance} negative).  Makes \TeX\ think that the new box extends
% \meta{height} above the line and \meta{depth} below, for a total
% vertical length of \meta{height}+\meta{depth}.  Default values of 
% \meta{height} \& \meta{depth} = actual height and depth of box in new
% position. 
%
% \begin{macro}{\makebox}
% \changes{0.1a}{1993/12/03}
%         {modified}
% ...
%    \begin{macrocode}
\def\makebox{%
  \leavevmode
  \@ifnextchar(%)
    {\@makepicbox}%
    {\@ifnextchar[\@makebox\mbox}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\mbox}
% \changes{0.1a}{1993/12/03}
%         {extra group}
% ...
%    \begin{macrocode}
\def\mbox#1{\leavevmode\hbox{#1}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@makebox}
% \changes{0.1a}{1993/12/03}
%         {default changed from x to c}
% ...
%    \begin{macrocode}
\def\@makebox[#1]{%
  \@ifnextchar [{\@imakebox[#1]}{\@imakebox[#1][c]}}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\@begin@tempboxa}
% \changes{0.1a}{1993/12/03}
%         {macro added}
% \changes{0.1b}{1993/12/08}
%         {Extra braces for color support 
%          (braces removed from other macros)}
% \task{DPC}{@ovri OK ??}
% ...
%    \begin{macrocode}
\long\def\@begin@tempboxa#1#2{%
   \begingroup
     \setbox\@tempboxa#1{{#2}}%
     \def\width{\wd\@tempboxa}%
     \def\height{\ht\@tempboxa}%
     \def\depth{\dp\@tempboxa}%
     \let\totalheight\@ovri
     \totalheight\height
     \advance\totalheight\depth}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@end@tempboxa}
% \changes{0.1a}{1993/12/03}
%         {macro added}
% ...
%    \begin{macrocode}
\let\@end@tempboxa\endgroup
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bm@c}
% \begin{macro}{\bm@l}
% \begin{macro}{\bm@r}
% \begin{macro}{\bm@s}
% \begin{macro}{\bm@t}
% \begin{macro}{\bm@b}
% \changes{0.1a}{1993/12/03}
%         {macros added}
% Set up spacing.
%    \begin{macrocode}
\def\bm@c{\hss\unhbox\@tempboxa\hss}
\def\bm@l{\unhbox\@tempboxa\hss}\let\bm@t\bm@l
\def\bm@r{\hss\unhbox\@tempboxa}\let\bm@b\bm@r
\def\bm@s{\unhbox\@tempboxa}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\@imakebox}
% \changes{0.1a}{1993/12/03}
%         {macro modified}
% ...
%    \begin{macrocode}
\long\def\@imakebox[#1][#2]#3{%
  \@begin@tempboxa\hbox{#3}%
    \setlength\@tempdima{#1}%       support calc
    \hbox to\@tempdima{\csname bm@#2\endcsname}%
  \@end@tempboxa}  
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@makepicbox}
% \changes{0.1a}{1993/12/03}
%         {macro modified}
% ...
%    \begin{macrocode}
\def\@makepicbox(#1,#2){%
  \@ifnextchar[{\@imakepicbox(#1,#2)}{\@imakepicbox(#1,#2)[]}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@imakepicbox}
% picture mode version
%    \begin{macrocode}
\long\def\@imakepicbox(#1,#2)[#3]#4{%
  \vbox to#2\unitlength
   {\let\mb@b\vss \let\mb@l\hss\let\mb@r\hss
    \let\mb@t\vss 
    \@tfor\@tempa :=#3\do{%
      \if s\@tempa
        \let\mb@l\relax\let\mb@r\relax
      \else
        \expandafter\let\csname mb@\@tempa\endcsname\relax
      \fi}%
    \mb@t
    \hbox to #1\unitlength{\mb@l #4\mb@r}%
    \mb@b
    \kern\z@}}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\set@color}
% \changes{0.1a}{1993/12/03}
%         {macro added}
% \changes{0.1a}{1993/12/03}
%         {color support}
% ...
%    \begin{macrocode}
\let\set@color\relax
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\newsavebox}
% \changes{0.1a}{1993/12/03}
%         {Pass the whole of arg 1 to `@ifdefinable}
% Allocate a new `savebox'.
%    \begin{macrocode}
\def\newsavebox#1{\@ifdefinable{#1}{\newbox#1}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\savebox}
% unchanged
%    \begin{macrocode}
\def\savebox#1{%
  \@ifnextchar(%)
    {\@savepicbox#1}{\@ifnextchar[{\@savebox#1}{\sbox#1}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\sbox}
% \changes{0.1a}{1993/12/03}
%         {extra group}
% \changes{0.1a}{1993/12/03}
%         {color support}
% ...
%    \begin{macrocode}
\def\sbox#1#2{\setbox#1\hbox{{\set@color#2}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@savebox}
% \changes{0.1a}{1993/12/03}
%         {default c not x}
% ...
%    \begin{macrocode}
\def\@savebox#1[#2]{%
  \@ifnextchar [{\@isavebox#1[#2]}{\@isavebox#1[#2][c]}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@isavebox}
% \changes{0.1a}{1993/12/03}
%         {extra group}
% \changes{0.1a}{1993/12/03}
%         {color support}
%    \begin{macrocode}
\long\def\@isavebox#1[#2][#3]#4{%
  \setbox#1\hbox{{%
    \set@color\@imakebox[#2][#3]{#4}}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@savepicbox}
% ...
%    \begin{macrocode}
\def\@savepicbox#1(#2,#3){%
  \@ifnextchar[%]
    {\@isavepicbox#1(#2,#3)}{\@isavepicbox#1(#2,#3)[]}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@isavepicbox}
% \changes{0.1a}{1993/12/03}
%         {extra group}
% ...
%    \begin{macrocode}
\long\def\@isavepicbox#1(#2,#3)[#4]#5{%
  \setbox#1\hbox{{%
    \set@color\@imakepicbox(#2,#3)[#4]{#5}}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\lrbox}
% \changes{0.1a}{1993/12/03}
%         {macro added}
% \changes{0.1a}{1993/12/03}
%         {color support}
% \changes{0.1b}{1993/12/08}
%         {move `@endpefalse out of the inner group}
% ...
%    \begin{macrocode}
\def\lrbox#1{%
  \edef\@tempa{%
    \endgroup
    \setbox#1\hbox{%
      \begingroup\aftergroup}%
        \def\noexpand\@currenvir{\@currenvir}%
        \def\noexpand\@currenvline{\on@line}}%
  \@tempa
    \@endpefalse
    \bgroup
      \ignorespaces}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\endlrbox}
% \changes{0.1a}{1993/12/03}
%         {macro added}
% ...
%    \begin{macrocode}
\def\endlrbox{\unskip\egroup}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\usebox}
% unchanged
%    \begin{macrocode}
\def\usebox#1{\leavevmode\copy #1\relax}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frame}
%
%% The following definition of |\frame| was written by Pavel Curtis
%% (Extra space removed 14 Jan 88)
%% RmS 92/08/24: Replaced occurence of |\@halfwidth| by |\@wholewidth|
%    \begin{macrocode}
\long\def\frame#1{%
  \leavevmode
  \hbox{%
    \hskip-\@wholewidth
    \vbox{%
      \vskip-\@wholewidth
      \hrule \@height\@wholewidth
      \hbox{%
        \vrule\@width\@wholewidth 
        #1%
        \vrule\@width\@wholewidth}%
      \hrule\@height\@wholewidth
      \vskip-\@wholewidth}%
    \hskip-\@wholewidth}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\fboxrule}
% \begin{macro}{\fboxsep}
% user level parameters,
%    \begin{macrocode}
\newdimen\fboxrule
\newdimen\fboxsep
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\fbox}
%% (Extra space removed 21 Jun 1991)
% \changes{0.1a}{1993/12/03}
%         {extra group}
%    \begin{macrocode}
\long\def\fbox#1{%
  \leavevmode
  \setbox\@tempboxa\hbox{{#1}}%
  \@tempdima\fboxrule
  \advance\@tempdima\fboxsep\advance\@tempdima\dp\@tempboxa
  \hbox{%
    \lower\@tempdima\hbox{%
      \vbox{%
        \hrule\@height\fboxrule
        \hbox{%
          \vrule\@width\fboxrule 
          \hskip\fboxsep
          \vbox{%
            \vskip\fboxsep 
            \box\@tempboxa
            \vskip\fboxsep}%
          \hskip\fboxsep
          \vrule \@width\fboxrule}%
        \hrule\@height\fboxrule}}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\framebox}
% ...
%    \begin{macrocode}
\def\framebox{%
  \@ifnextchar(%)
    {\@framepicbox}{\@ifnextchar[{\@framebox}{\fbox}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@framebox}
% ...
%    \begin{macrocode}
\def\@framebox[#1]{%
  \@ifnextchar [{\@iframebox[#1]}{\@iframebox[#1][c]}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@iframebox}
%% (Extra space removed 21 Jun 1991)
%    \begin{macrocode}
\long\def\@iframebox[#1][#2]#3{%
  \leavevmode
  \savebox\@tempboxa[#1][#2]{\kern\fboxsep #3\kern\fboxsep}%
  \@tempdima\fboxrule
  \advance\@tempdima\fboxsep 
  \advance\@tempdima\dp\@tempboxa
  \hbox{%
    \lower\@tempdima\hbox{%
      \vbox{%
        \hrule\@height\fboxrule
        \hbox{%
          \vrule\@width\fboxrule
          \hskip-\fboxrule
          \vbox{%
            \vskip\fboxsep
            \box\@tempboxa
            \vskip\fboxsep}%
          \hskip-\fboxrule
          \vrule\@width\fboxrule}%
        \hrule\@height\fboxrule}}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@framepicbox}
% ...
%    \begin{macrocode}
\def\@framepicbox(#1,#2){%
  \@ifnextchar[{\@iframepicbox(#1,#2)}{\@iframepicbox(#1,#2)[]}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@iframepicbox}
% ...
%    \begin{macrocode}
\long\def\@iframepicbox(#1,#2)[#3]#4{%
  \frame{\@imakepicbox(#1,#2)[#3]{#4}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\parbox}
% \changes{0.1a}{1993/12/03}
%         {Redefined to support extra optional arguments}
% \changes{0.1d}{1993/12/15}
%         {Changed default from `c' to `s'}
% ...
%    \begin{macrocode}
\def\parbox{%
  \@ifnextchar[%]
    \@iparbox
    {\@iiiparbox c\@empty[s]}}
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\@iparbox}
% \changes{0.1d}{1993/12/15}
%         {Changed default from `c' to `s'}
% ...
%    \begin{macrocode}
\def\@iparbox[#1]{%
  \@ifnextchar[%]
    {\@iiparbox{#1}}%
    {\@iiiparbox{#1}\@empty[s]}}
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\@iiparbox}
% ...
%    \begin{macrocode}
\def\@iiparbox#1[#2]{%
  \@ifnextchar[%]
    {\@iiiparbox{#1}{#2}}%
    {\@iiiparbox{#1}{#2}[#1]}}
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\@iiiparbox}
% \changes{0.1b}{1993/12/08}
%         {`endgraf added due to extra group in `@begin@tempboxa}
% ...
%    \begin{macrocode}
\long\def\@iiiparbox#1#2[#3]#4#5{%
  \leavevmode 
  \@pboxswfalse
  \setlength\@tempdima{#4}%
  \@begin@tempboxa\vbox{\hsize\@tempdima\@parboxrestore#5\endgraf}%
    \ifx\@empty#2\else
      \setlength\@tempdimb{#2}%
      \def\@empty{to\@tempdimb}%
    \fi
    \if#1b\vbox
    \else\if #1t\vtop
    \else\ifmmode\vcenter
    \else\@pboxswtrue $\vcenter
    \fi\fi\fi
    \@empty{\let\hss\vss\let\unhbox\unvbox
       \csname bm@#3\endcsname}%
    \if@pboxsw \m@th$\fi
  \@end@tempboxa}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@dischyph}
% \begin{macro}{\@acci}
% \begin{macro}{\@accii}
% \begin{macro}{\@acciii}
% Accents and Hyphens.
% \task{???}{should not be set here}
%    \begin{macrocode}
\let\@dischyph=\-
%    \end{macrocode}
%% RmS 93/08/19 Redefined accents to allow changes in font encoding
%    \begin{macrocode}
\let\@acci=\'   \def\'{\@acci}
\let\@accii=\`  \def\`{\@accii}
\let\@acciii=\= \def\={\@acciii}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\@arrayparboxrestore}
% Restore various paragraph parameters.
%    \begin{macrocode}
\def\@arrayparboxrestore{%
  \let\par\@@par
  \let\-\@dischyph
%    \end{macrocode}
%% RmS 93/08/19 Redefined accents to allow changes in font encoding
%    \begin{macrocode}
  \def\'{\@acci}\def\`{\@accii}\def\={\@acciii}%
  \parindent\z@ \parskip\z@skip
  \everypar{}%
  \linewidth\hsize
  \@totalleftmargin\z@ 
  \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
  \parfillskip\@flushglue \lineskip\normallineskip
  \baselineskip\normalbaselineskip
  \sloppy}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\parboxrestore}
% Restore various paragraph parameters, and also |\\|.
%    \begin{macrocode}
\def\@parboxrestore{\@arrayparboxrestore\let\\\@normalcr}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\if@minipage}
% Switch that is true at the start of a minipage.
%    \begin{macrocode}
\newif\if@minipage \@minipagefalse
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\minipage}
% \changes{0.1a}{1993/12/03}
%         {Redefined to support extra optional arguments}
% \changes{0.1d}{1993/12/15}
%         {extra space removed.}
% \changes{0.1d}{1993/12/15}
%         {Changed default from `c' to `s'}
% ...
%    \begin{macrocode}
\def\minipage{%
  \@ifnextchar[%]
    \@iminipage
    {\@iiiminipage c\@empty[s]}}
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\@iminipage}
% \changes{0.1d}{1993/12/15}
%         {Changed default from `c' to `s'}
% ...
%    \begin{macrocode}
\def\@iminipage[#1]{%
  \@ifnextchar[%]
    {\@iiminipage{#1}}%
    {\@iiiminipage{#1}\@empty[s]}}
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\@iiminipage}
% ...
%    \begin{macrocode}
\def\@iiminipage#1[#2]{%
  \@ifnextchar[%]
    {\@iiiminipage{#1}{#2}}%
    {\@iiiminipage{#1}{#2}[#1]}}
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\@iiiminipage}
% ...
%    \begin{macrocode}
\def\@iiiminipage#1#2[#3]#4{%
  \leavevmode
  \@pboxswfalse
  \setlength\@tempdima{#4}%
  \def\@mpargs{{#1}{#2}[#3]{#4}}%
  \setbox\@tempboxa\vbox\bgroup
    \hsize\@tempdima
    \textwidth\hsize \columnwidth\hsize
    \@parboxrestore
    \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@
    \let\@footnotetext\@mpfootnotetext
    \let\@listdepth\@mplistdepth \@mplistdepth\z@
    \@minipagerestore\global\@minipagetrue %% \global added 24 May 89
    \everypar{\global\@minipagefalse\everypar{}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@minipagerestore}
% Hook so that other styles can reset other commands in a minipage.
%    \begin{macrocode}
 \let\@minipagerestore=\relax
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\endminipage}
%% RmS 92/08/14: replaced |\vskip-\lastskip| by |\unskip|
%%  (proposed by FMi)
%    \begin{macrocode}
\def\endminipage{%
  \par
  \unskip
  \ifvoid\@mpfootins\else
    \vskip\skip\@mpfootins
    \footnoterule
    \unvbox\@mpfootins
  \fi
  \global\@minipagefalse   %% added 24 May 89
  \egroup
  \expandafter\@iiiparbox\@mpargs{\unvbox\@tempboxa}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@mplistdepth}
% \begin{macro}{\@mpfootins}
% Versions of |\@listdepth| and |\footins| local to minipage.
%    \begin{macrocode}
\newcount\@mplistdepth
\newinsert\@mpfootins
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\@mpfootnotetext}
% Minipage version of |\@footnotetext|. unchanged.
%
%% Final |\strut| added 27 Mar 89, on suggestion by Don Hosek
%% RmS 91/09/29: added |\reset@font|
%% RmS 92/11/26: added protection for |\edef|
%    \begin{macrocode}
\long\def\@mpfootnotetext#1{%
  \global\setbox\@mpfootins\vbox{%
    \unvbox\@mpfootins
    \reset@font\footnotesize
    \hsize\columnwidth 
    \@parboxrestore
    \let\@tempa\protect\def\protect{\noexpand\protect\noexpand}%
    \edef\@currentlabel{\csname p@mpfootnote\endcsname\@thefnmark}%
    \let\protect\@tempa
    \@makefntext{\rule{\z@}{\footnotesep}\ignorespaces #1\strut}}}
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
\newif\if@pboxsw
%    \end{macrocode}
%
% \begin{macro}{\rule}
% unchanged
%    \begin{macrocode}
\def\rule{\@ifnextchar[{\@rule}{\@rule[\z@]}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@rule}
% ...
%    \begin{macrocode}
\def\@rule[#1]#2#3{%
  \@tempdima#3\advance\@tempdima #1%
  \leavevmode
  \hbox{\vrule\@width#2\@height\@tempdima\@depth-#1}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@underline}
% Saved primitive |\underline|.
%    \begin{macrocode}
\let\@@underline\underline
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\underline}
% \LaTeX\ version works outside math. 
% \task{???}{why the second `relax in `underline ?}
%    \begin{macrocode}
\def\underline#1{%
  \relax
  \ifmmode\@@underline{#1}%
  \else $\@@underline{\hbox{#1}}\m@th$\relax\fi}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\raisebox}
% \changes{0.1a}{1993/12/03}
%         {redefined to support `height}
% ...
%    \begin{macrocode}
\def\raisebox#1{\@ifnextchar[{\@rsbox{#1}}{\@irsbox{#1}[]}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@rsbox}
% ...
%    \begin{macrocode}
\def\@rsbox#1[#2]{%
  \@ifnextchar[{\@iirsbox{#1}[#2]}{\@irsbox{#1}[#2]}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@argrsbox}
% \changes{0.1a}{1993/12/03}
%         {macro removed}
% ...
% \end{macro}
%
% \begin{macro}{\@irsbox}
% \changes{0.1a}{1993/12/03}
%         {redefined to support `height}
% \changes{0.1b}{1993/12/08}
%         {fix typo}
% \changes{0.1c}{1993/12/09}
%         {fix another typo}
% ...
%    \begin{macrocode}
\long\def\@irsbox#1[#2]#3{%
  \@begin@tempboxa\hbox{#3}%
    \setlength\@tempdima{#1}%
    \ifx\\#2\\\else\setlength{\@tempdimb}{#2}\fi
    \setbox\@tempboxa\hbox{\raise\@tempdima\box\@tempboxa}%
    \leavevmode
    \ifx\\#2\\\ht\@tempboxa\@tempdimb\fi
    \box\@tempboxa
  \@end@tempboxa}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@iirsbox}
% \changes{0.1a}{1993/12/03}
%         {redefined to support `height}
% ...
%    \begin{macrocode}
\long\def\@iirsbox#1[#2][#3]#4{%
  \@begin@tempboxa\hbox{#4}%
    \setlength\@tempdima{#1}%
    \setlength\@tempdimb{#2}%
    \setlength\dimen@{#3}%
    \setbox\@tempboxa\hbox{\raise\@tempdima\box\@tempboxa}%
    \leavevmode
    \ht\@tempboxa\@tempdimb
    \dp\@tempboxa\dimen@
    \box\@tempboxa
  \@end@tempboxa}
%    \end{macrocode}
% \end{macro}
%
\endinput
