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.

132 Chapter 5. Mathematical Formulas<br />

<br />

x=1 +<br />

x=0<br />

\[ \left[ \int + \int \right]_{x=0}ˆ{x=1} \]<br />

The pair of brackets [ ] is adjusted <strong>to</strong> the size of the enclosed<br />

formula, as are the raised exponent <strong>and</strong> lowered<br />

index as well.<br />

The comm<strong>and</strong>s \left <strong>and</strong> \right must appear as a pair. For every<br />

\left comm<strong>and</strong> there must be a corresponding \right comm<strong>and</strong> somewhere<br />

afterwards. The pairs may be nested. The first \left is paired with<br />

the last \right; the following \left with the second last \right, <strong>and</strong> so<br />

on. There must be the same number of \right as \left comm<strong>and</strong>s in a<br />

nesting.<br />

The corresponding bracket symbols lbrack <strong>and</strong> rbrack may be perfectly<br />

arbitrary <strong>and</strong> do not need <strong>to</strong> be a logical pair.<br />

x + y + z =<br />

a<br />

b<br />

<br />

This set of brackets is admittedly unusual but<br />

permissible.<br />

\[ \vec{x} + \vec{y} + \vec{z} =<br />

\left( ... \right[ \]<br />

Sometimes a formula contains only a single opening or closing bracket<br />

without a corresponding counterpart. However, the \left. . . \right<br />

comm<strong>and</strong>s must still be given as a pair, but with a period ‘.’ as an invisible<br />

bracket symbol.<br />

⎧<br />

⎪⎨ −1 : x < 0<br />

y =<br />

⎪⎩<br />

0<br />

+1<br />

:<br />

:<br />

x = 0<br />

x > 0<br />

\[ y = \left\{ \begin{array}<br />

{r@{\quad:\quad}l}<br />

-1 & x0<br />

\end{array} \right. \]<br />

The array environment in the above example is described in Section 4.8.1<br />

<strong>and</strong> produces a table in math mode.<br />

The \left. . . \right comm<strong>and</strong>s may be applied <strong>to</strong> a <strong>to</strong>tal of 22 different<br />

symbols. These are<br />

( ( ) ) ⌊ \lfloor ⌋ \rfloor<br />

[ [ ] ] ⌈ \lceil ⌉ \rceil<br />

{ \{ } \} 〈 \langle 〉 \rangle<br />

| | \| ↑ \uparrow ⇑ \Uparrow<br />

/ / \ \backslash ↓<br />

<br />

\downarrow<br />

\updownarrow<br />

⇓<br />

<br />

\Downarrow<br />

\Updownarrow<br />

For example, \left|. . . \right| produces two vertical bars adjusted in<br />

height <strong>to</strong> contain the enclosed formula text.<br />

<br />

π<br />

Exercise 5.12: In Equation 5.3, generate cos<br />

2 z2<br />

<br />

π<br />

<strong>and</strong> sin<br />

2 z2<br />

<br />

instead of<br />

cos( π<br />

2 z2 ) <strong>and</strong> sin( π<br />

2 z2 ).

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

Saved successfully!

Ooh no, something went wrong!