Next: , Previous: \makebox, Up: Boxes


20.5 \parbox

Synopsis:

     \parbox[position][height][inner-pos]{width}{text}

The \parbox command produces a box whose contents are created in paragraph mode. It should be used to make a box small pieces of text, with nothing fancy inside. In particular, you shouldn't use any paragraph-making environments inside a \parbox argument. For larger pieces of text, including ones containing a paragraph-making environment, you should use a minipage environment (see minipage).

\parbox has two mandatory arguments:

width
the width of the parbox;
text
the text that goes inside the parbox.

The optional position argument allows you to align either the top or bottom line in the parbox with the baseline of the surrounding text (default is top).

The optional height argument overrides the natural height of the box.

The inner-pos argument controls the placement of the text inside the box, as follows; if it is not specified, position is used.

t
text is placed at the top of the box.
c
text is centered in the box.
b
text is placed at the bottom of the box.
s
stretch vertically; the text must contain vertically stretchable space for this to work.