### 9 Typesetting Mathematics: Part I

#### 9.1 In-text Formula

Three ways to create an in-text formula:

\begin{math} ... \end{math}
$$...$$
$...$

Input:

 Does $x - y$ always   equal $$- y + x$$?

Output:

Input:

 Note that x is not   the same as $x$.

Output:

#### 9.2 Displayed Formula

Two ways to create a displayed formula:

\begin{displaymath} ... \end{displaymath}
$...$

Input:

 Let's consider the two functions   $f(x)=x-(x-2)(x-4)(x-6)(x-8)$   and   $g(x) = x + (x - 1) (x - 3) (x - 5) (x - 7)$   where $x > 0$.

Output:

#### 9.3 Subscripts, Mathematical Symbols, and More

Subscripts and superscripts are produced with _ and ^

Input:

 Let $x_i = i \cdot h^{2^i}$.

Output:

Input:

 Note that $x_n+1$ is not   the same as $x_{n+1}$.

Output:

LaTeX defines a number of other mathematical structures and symbols.

Input:

 Making Greek letters   is as easy as $\pi$.

Output:

Input:

 Thus, we have   $\int_{a}^{b} f(x) \, dx = \lim_{\| P \| \rightarrow 0} \sum_{i=1}^{n} f(x_{i}^{\ast}) \Delta x_{i}$   where $$\sum_{i=1}^{n} f(x_{i}^{\ast}) \Delta x_{i}$$ is \ldots

Output:

Note a displayed summation vs. an inline summation.

##### 9.3.1 Spacing in Math Mode
 \! negative thin space \; thick space \, thin space \ interword space \: medium space

Input:

 $\int \int z dx dy$

Output:

Input:

 $\int \! \! \int z \, dx \, dy$

Output:

##### 9.3.2 Changing Type Style in Math Mode
\mathit \mathrm \mathbf \mathsf
\mathtt \mathcal

Input:

 So we have $$\mathbf{a} + b$$.

Output:

#### 9.4 Numbered Displayed Formula

This is produced with the equation environment:

...

Input:

 \frac{\partial u}{\partial t} =         \lambda^{2}         \frac{\partial^{2} u}              {\partial x^{2}}

Output:

_______________________________________________________
Last updated: October 27, 2002
Site maintained by: Clyde Clements clyde@mathstat.dal.ca