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.

4.7. Boxes 91<br />

The optional argument inner pos states how the text is <strong>to</strong> be positioned<br />

internally, something that is only meaningful if height has been given. Its<br />

possible values are:<br />

t <strong>to</strong> push the text <strong>to</strong> the <strong>to</strong>p of the box,<br />

b <strong>to</strong> shove it <strong>to</strong> the bot<strong>to</strong>m,<br />

c <strong>to</strong> center it vertically,<br />

s <strong>to</strong> stretch it <strong>to</strong> fill up the whole box.<br />

In the last case, rubber lengths (Section 2.4.2) should be present where<br />

the vertical stretching is <strong>to</strong> take place.<br />

Note the difference between the external positioning argument pos <strong>and</strong><br />

the internal one inner pos: the former states how the box is <strong>to</strong> be aligned<br />

with the surrounding text, while the latter determines how the contents<br />

are placed within the box itself.<br />

Example:<br />

\begin{minipage}[t][2cm][t]{3cm}<br />

This is a minipage of height 2˜cm with the text<br />

at the <strong>to</strong>p.<br />

\end{minipage}\hrulefill<br />

\parbox[t][2cm][c]{3cm}{In this parbox, the text<br />

is centered on the same height.}\hrulefill<br />

\begin{minipage}[t][2cm][b]{3cm}<br />

In this third paragraph box, the text is at the bot<strong>to</strong>m.<br />

\end{minipage}<br />

This is a minipage<br />

of height 2 cm<br />

with the text at the<br />

<strong>to</strong>p.<br />

In this parbox, the<br />

text is centered on<br />

the same height.<br />

In this third paragraph<br />

box, the text<br />

is at the bot<strong>to</strong>m.<br />

The \hrulefill comm<strong>and</strong>s between the boxes show where the baselines<br />

are. All three boxes are the same size <strong>and</strong> differ only in their values of<br />

inner pos.<br />

4.7.6 Rule boxes<br />

A rule box is a basically a filled-in black rectangle. The syntax for the<br />

general comm<strong>and</strong> is:<br />

\rule[lift]{width}{height}<br />

which produces a solid rectangle of width width <strong>and</strong> height height, raised<br />

above the baseline by an amount lift. Thus \rule{8mm}{3mm} generates<br />

. Without the optional argument lift, the rectangle is set on the<br />

baseline of the current line of text.

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

Saved successfully!

Ooh no, something went wrong!