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.

104 Chapter 4. Displayed Text<br />

The entries ‘Day’ <strong>and</strong> ‘Subj.’ are raised in the same way as ‘Demoted’ was in<br />

the soccer table. To simplify its application, one can introduce a user-defined<br />

comm<strong>and</strong> with<br />

\newcomm<strong>and</strong>{\rb}[1]{\raisebox{1.5ex}[0pt]{#1}} (see Section 8.3.2)<br />

so that \rb{entry} behaves the same as \raisebox{1.5ex}[0pt]{entry}. This<br />

can be used, for example, as \rb{ Mon.} or \rb{UNIX} <strong>to</strong> elevate the entries by<br />

the necessary amount.<br />

In all the above examples, the entries in the individual columns are<br />

each a single line. Some tables contain certain columns with several lines<br />

of text that are somewhat separated from the rest of the row:<br />

Model Description Price<br />

FBD 360 Desk<strong>to</strong>p: XP3600+ Processor, 512 MB DDR-RAM,<br />

80 GB hard disk, 16x DVD drive, 32x CDRW drive,<br />

64 MB TV output, Windows XP, 15” moni<strong>to</strong>r<br />

FBD 480 Desk<strong>to</strong>p DeLuxe: same as FBD 360 but with<br />

XP4800+ Processor, 48x CDRW drive, 17” moni<strong>to</strong>r<br />

FBT 240 Lap<strong>to</strong>p: XP2400+, 512 MB RAM, 40 GB hard disk,<br />

56 kb modem, 32x speed DVD/CD-RW drive, 2x USB,<br />

15” display, Windows XP, Infrared interface<br />

999.00<br />

1399.00<br />

1299.00<br />

The above table is made up of three columns, the first left justified,<br />

the third right justified. The middle column contains several lines of text<br />

with a line width of 7.5 cm. This is generated with the column formatting<br />

symbol p{width}. The whole column formatting argument in this example<br />

is {lp{7.5cm}r}.<br />

\begin{tabular}{lp{7.5cm}r}<br />

\bfseries Model & Description & \bfseries Price \\[1ex]<br />

FBD 360 &\small{\bfseries Desk<strong>to</strong>p}: XP3600+ Processor,<br />

512˜MB DDR-RAM, 80˜GB hard disk, 16x DVD drive,<br />

32x CDRW drive, 64˜MB TV˜output,<br />

Windows˜XP, 15’’ moni<strong>to</strong>r & 999.00\\<br />

. . . . . . . . . . . .<br />

15’’ display, Windows˜XP, Infrared interface& 1299.00<br />

\end{tabular}<br />

The text for the middle column is simply typed in, being broken up<br />

in<strong>to</strong> lines of width 8.0 cm au<strong>to</strong>matically. The column is separated from<br />

the others with the & symbol in the usual way.<br />

Warning: The line termination comm<strong>and</strong> \\ is ambiguous within a p<br />

column, for it can either start a whole new row, or if \raggedright or<br />

\centering have been given, it ends a line of text within that column<br />

entry. In this case, if this is the last column in the row, the only way <strong>to</strong>

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

Saved successfully!

Ooh no, something went wrong!