- Aligned formulas
- The align math environment is used for simple and annotated align. Each line in this environment is an equation, which LaTeX
automatically numbers.
- Simple align
- Simple align is used to align two or more formulas.
- \begin{align}
- r^{2} &= s^{2} + t^{2}   \label{E:eqn1}\\
- 2u + 1 &= v + w^{\alpha}   \label{E:eqn2}\\
- x   &= \frac{y + z}{\sqrt{s+2u}}   \label{E:eqn3}
- \end{align}
- Rules:
- Separate the lines with \\.
- In each line, indecate the alignment point with &.
- Place a \notag in each line (at the end of the line before \\) that you do not wish numbered.
- Place \label in each numbered line you may want to reference with \ref or \eqref.
- Annotated align
- Annotated align will align the formulas and the annotation (explanatory text) separaely:
- \begin{align} \label{E:Doalign}
- x &= x \wedge (y \vee z)
- & & \text{(by distributivity)}\\
-   &= (x \wedge y) \vee (x \wedge z)
- & & \text{(by condition (M))} \notag \\
-   &= y \vee z. \notag
- \end{align}
- The rules for annotated align are similar to the rules of simple align. In each line, in addition to the alignment point ( marked by &), there is
also a mark for the start of the annotation: & &.
- Cases
- The cases construct is a subsidiary math environment; it must be used in a displayed math environment or in an equation environment.
- \[
- f(x) =
- \begin{cases}
- -x^{2},   &\text{if $x < 0$;}\\
- \alpha + x,   &\text{if $0 \leq x \leq 1$;}\\
- x^{2},   &\text{otherwise}\\
- \end{cases}
- \]
- Rules:
- Separate the lines with \\.
- In each line, indecate the alignment point for the annotation with &.
- View these three types of alignment.