28.03.2013 Views

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

92 Chapter 4. Displayed Text<br />

The parameters lift, width, <strong>and</strong> height are all lengths (Section 2.4.1). If<br />

lift has a negative value, the rectangle is set below the baseline.<br />

It is also possible <strong>to</strong> have a rule box of zero width. This creates an<br />

invisible line with the given height. Such a construction is called a strut<br />

<strong>and</strong> is used <strong>to</strong> force a horizontal box <strong>to</strong> have a desired height or depth<br />

that is different from that of its contents. For this purpose, \vspace is<br />

inappropriate because it adds additional vertical space <strong>to</strong> that which is<br />

already there.<br />

For example: \fbox{Text} produces Text . In order <strong>to</strong> print Text ,<br />

one has <strong>to</strong> tell T E X that the box contents extend above <strong>and</strong> below the<br />

baseline by the desired amounts. This was done with \fbox{\rule[-2mm]<br />

{0cm}{6mm}Text}. What this says is that the text <strong>to</strong> be framed consists<br />

of ‘an invisible bar beginning 2 mm below the baseline, 6 mm long,<br />

followed by the word Text’. The vertical bar indeed remains unseen, but<br />

it determines the upper <strong>and</strong> lower edges of the frame.<br />

4.7.7 Nested boxes<br />

The box comm<strong>and</strong>s described above may be nested <strong>to</strong> any desired level.<br />

Including an LR box within a parbox or a minipage causes no obvious<br />

conceptual difficulties. The opposite, a parbox within an LR box, is also<br />

possible, <strong>and</strong> is easy <strong>to</strong> visualize if one keeps in mind that every box is a<br />

unit, treated by L AT E X as a single character of the corresponding size.<br />

A parbox inside an \fbox comm<strong>and</strong> has the effect that the<br />

entire parbox is framed. The present structure was made with<br />

\fbox{\fbox{\parbox{10cm}{A parbox...}}}<br />

This is a parbox of width 10 cm inside a framebox inside a<br />

second framebox, which thus produces the double framing<br />

effect.<br />

Enclosing a parbox inside a \raisebox allows vertical<br />

displacements of any desired amount. The two boxes<br />

here both have positioning [b], but the one at the right<br />

has been produced with:<br />

\raisebox{1cm}{\begin{minipage}[b]{2.5cm}<br />

a b c d e ... x y z\\<br />

\underline{baseline}<br />

\end{minipage} }<br />

a b c d e f g h i<br />

j k l m n o p q r<br />

s t u v w x y z<br />

baseline<br />

which displaces it upwards by 1 cm. baseline<br />

A very useful structure is one in which minipage environments are<br />

positioned relative <strong>to</strong> one another inside an enclosing minipage. The<br />

positioning argument of the outside minipage can be used <strong>to</strong> align its

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!