| name | amsmath |
| description | LaTeX amsmath/amssymb/mathtools packages for mathematical typesetting. Use when helping users write equations, align math, use mathematical symbols, matrices, theorems, or any advanced math formatting. |
amsmath + amssymb + mathtools — Math Typesetting
CTAN: https://ctan.org/pkg/amsmath | https://ctan.org/pkg/mathtools
Manual: texdoc amsmath, texdoc mathtools
Setup
\usepackage{amsmath} % core math environments
\usepackage{amssymb} % extra symbols (loads amsfonts)
\usepackage{mathtools} % fixes + extensions for amsmath (loads amsmath)
\usepackage{amsthm} % theorem environments
% mathtools loads amsmath, so you can just use:
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{amsthm}
Equation Environments
Single Equations
% Numbered
\begin{equation}
E = mc^2
\label{eq:einstein}
\end{equation}
% Unnumbered
\begin{equation*}
E = mc^2
\end{equation*}
% or: \[ E = mc^2 \]
align — Multiple Aligned Equations
\begin{align}
f(x) &= x^2 + 2x + 1 \label{eq:f} \\
&= (x+1)^2 \label{eq:f2}
\end{align}
% Unnumbered: align*
% Suppress single number: \nonumber or \notag before \\
gather — Centered, No Alignment
\begin{gather}
x + y = 1 \\
x - y = 3
\end{gather}
multline — Long Single Equation
\begin{multline}
f(x) = a_0 + a_1 x + a_2 x^2 + a_3 x^3 \\
+ a_4 x^4 + a_5 x^5 + a_6 x^6
\end{multline}
First line left-aligned, last line right-aligned, middle centered.
split — Sub-alignment Inside equation
\begin{equation}
\begin{split}
f(x) &= a + b + c \\
&\quad + d + e
\end{split}
\end{equation}