Boxes

These next three commands for making LR-boxes all existed in LATEX 2.09. They have been enhanced in two ways.
\begin{decl}
\vert\makebox\vert \oarg{width} \oarg{pos} \arg {text} \\
\vert\fr...
...
\vert
\savebox \vert \arg {cmd} \oarg{width} \oarg{pos} \arg {text}
\end{decl}
One small but far-reaching change for LATEX2e is that, within the width argument only, four special lengths can be used. These are all dimensions of the box that would be produced by using simply ||text:
 ||    its height above the baseline;
 ||    its depth below the baseline;
 ||    the sum of || and ||;
 ||    its width.
Thus, to put `hello' in the centre of a box of twice its natural width, you would use:
   \makebox[2\width]{hello}
Or you could put f into a square box, like this: \framebox{\makebox[\totalheight]{\itshape f\/}}
   \framebox{\makebox[\totalheight]{\itshape f\/}}
Note that it is the total width of the framed box, including the frame, which is set to ||. The other change is a new possibility for pos: |s| has been added to |l| and |r|. If pos is |s| then the text is stretched the full length of the box, making use of any `rubber lengths' (including any inter-word spaces) in the box's contents. If no such `rubber length' is present, an `underfull box' will probably be produced.
\begin{decl}
\vert\parbox \vert \oarg{pos} \oarg{height} \oarg{inner-pos} \arg {...
...oarg{inner-pos} \arg {width}\\
\m {text}\\
\vert\end{minipage}\vert
\end{decl}
As for the box commands above, ||, ||, etc. may be used in the height argument to denote the natural dimensions of the box. The inner-pos argument is new in LATEX2e. It is the vertical equivalent to the pos argument for ||, etc, determining the position of text within the box. The inner-pos may be any one of |t|, |b|, |c|, or |s|, denoting top, bottom, centred, or `stretched' alignment respectively. When the inner-pos argument is not specified, LATEX gives it same value as pos (this could be the latter's default value).
\begin{decl}
\vert\begin{lrbox}\vert \arg {cmd}\\
\m {text}\\
\vert\end{lrbox}\vert
\end{decl}
This is an environment which does not directly print anything. Its effect is to save the typeset text in the bin cmd. Thus it is like | | cmd text, except that any white space before or after the contents text is ignored. This is very useful as it enables both the | command and the \texttt{verbatim} environment to be used within \m{text}. It also makes it possible to define, for example, a `framed box' environment. This is done by first using this environment to save some text in a bin \m{cmd} and then calling \fbox{\usebox{\vert\m {cmd}\vert}}|. The following example defines an environment, called |fmpage|, that is a framed version of |minipage|.
   \newsavebox{\fmbox}
   \newenvironment{fmpage}[1]
     {\begin{lrbox}{\fmbox}\begin{minipage}{#1}}
     {\end{minipage}\end{lrbox}\fbox{\usebox{\fmbox}}}