Multi-line derivations stay aligned on their relation signs, matrices look as they do in print, and equation numbers stay in place. All rows of an alignment are fitted to the same width, so the columns stay aligned as the text narrows.
Aligned systems and matrices
Multi-line derivations align on their relation symbols, and matrices are set by TEX:
A numbered alignment with several aligned columns, rows of unequal width, and equation numbers:
A piecewise definition in a cases environment, with some colour that changes with the theme:
\section*{Aligned systems and matrices}Multi-line derivations align on their relation symbols, and matrices are set
by \TeX:
\begin{align*} (f \circ g)'(x) &= f'\bigl(g(x)\bigr)\,g'(x), \\\frac{d}{dx}\int_{a}^{x} f(t)\,dt &= f(x), \\\begin{pmatrix} a & b \\ c & d \end{pmatrix}^{-1}&= \textcolor{blue}{\frac{1}{ad - bc}}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}.
\end{align*}A numbered alignment with several aligned columns, rows of unequal width,
and equation numbers:
\begin{align} a&=b & ccccccc^7&=d & e&=f \\ g&=h & i&=j & k&=\text{long entry}\end{align}A piecewise definition in a \texttt{cases} environment, with some colour that
changes with the theme:
\[\operatorname{sgn}(x)=\begin{cases}
\textcolor{blue}{+1} & \text{if } x > 0, \\\phantom{+}0 & \text{if } x =0, \\\textcolor{red}{-1} & \text{if } x < 0.
\end{cases}
\]