How-to

How to Control Equation Numbering in LaTeX

The fix

LaTeX numbers equations automatically inside equation and align. Suppress a number with \nonumber (or \notag) before \\; force a custom label with \tag{...}; group lines as 1a, 1b with the subequations environment (amsmath). Reference an equation with \label and \eqref.

Example

\usepackage{amsmath}
\begin{align}
  E &= mc^2 \label{eq:e} \\
  F &= ma \notag
\end{align}
See \eqref{eq:e}.

\begin{subequations}
\begin{align}
  a &= 1 \\
  b &= 2
\end{align}
\end{subequations}

Frequently asked questions

How do I remove the number from one equation?

Put \nonumber (or \notag) before the \\ on that line inside align, or use a starred environment (equation*, align*) to remove all numbers in the block.

How do I reference an equation?

Add \label{eq:key} on the line and cite it with \eqref{eq:key} (from amsmath), which prints the number in parentheses, e.g. (3).

How do I get sub-numbers like (1a) and (1b)?

Wrap the equations in the subequations environment from amsmath; each numbered inner line becomes 1a, 1b, and so on.

Try the fix in LetX

Open the editor, paste your code, and compile in 1 second to see the error clear — free, in your browser.

Open LetX Free