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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5.4.2 Ordinary text within a formula<br />

5.4. Additional elements 133<br />

It is often necessary <strong>to</strong> include some normal text within a formula, for<br />

example single words such as <strong>and</strong>, or, if, <strong>and</strong> so on. In this case one<br />

must switch <strong>to</strong> LR mode (Section 4.7.1) while staying in math mode. This<br />

is carried out with the comm<strong>and</strong> \mbox{normal text} given inside the<br />

formula, <strong>to</strong>gether with horizontal spacing comm<strong>and</strong>s such as \quad or<br />

\hspace. For example:<br />

Xn = Xk if <strong>and</strong> only if Yn = Yk <strong>and</strong> Zn = Zk<br />

\[ X_n = X_k \qquad\mbox{if <strong>and</strong> only if}\qquad<br />

Y_n = Y_k \quad\mbox{<strong>and</strong>}\quad Z_n = Z_k \]<br />

In order <strong>to</strong> set a longer piece of text beside a displayed formula, as<br />

in some of the above examples, it is more appropriate <strong>to</strong> put both the<br />

formula <strong>and</strong> the text in their own parboxes or minipages, placed side by<br />

side with the proper vertical positioning.<br />

On the other h<strong>and</strong>, if letters from text fonts are required as mathematical<br />

symbols, they should be entered with the math alphabet comm<strong>and</strong>s:<br />

\mathrm \mathtt \mathbf<br />

\mathsf \mathit \mathcal<br />

We have already met \mathcal in Section 5.3.2 on calligraphic letters. All<br />

these comm<strong>and</strong>s function the same way: they set their argument in the<br />

corresponding font.<br />

B 0 (x) T i<br />

j<br />

$\mathbf{B}ˆ0(x)$ \quad $\mathsf{T}ˆi_j$<br />

The comm<strong>and</strong> \mathnormal in Section 5.3.1 also belongs <strong>to</strong> this group.<br />

The difference between it <strong>and</strong> \mathit is that it sets its argument in the<br />

regular math italic font, while the latter uses the normal text italic. The<br />

letters are the same, but the spacing is different.<br />

$\mathnormal{differ} \ne \mathit{differ}$<br />

dif f er = differ<br />

All the math alphabet comm<strong>and</strong>s set their text in math mode, which<br />

means that spaces are ignored as usual. This is not the case for text<br />

placed in an \mbox.<br />

5.4.3 Matrices <strong>and</strong> arrays<br />

a11 a12 · · · a1n<br />

.<br />

.<br />

. ..<br />

.<br />

an1 an2 · · · ann<br />

Structures like the one at the left are the<br />

basis for matrices, determinants, system of<br />

equations, <strong>and</strong> so on. They will all be referred<br />

<strong>to</strong> here as arrays.

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

Saved successfully!

Ooh no, something went wrong!