Numbered Display Equations
Introduction
Welcome back to Advanced Math Notation! You have reached lesson five of six, which means only one lesson remains after this one. So far in this course, you have added accents to math symbols, auto-sized delimiters, combined multiple notation elements into layered expressions, and typeset big operators like sums, products, and integrals. That is an impressive toolkit.
Up to this point, every display equation we wrote used the \[ ... \] shorthand. That approach works well for standalone formulas, but it never assigns the equation a number. In real papers, textbooks, and reports, important equations are numbered so they can be referred to later in the text. This lesson teaches you how to create numbered display equations, suppress the number when you do not need it, and cross-reference equations by label so the numbers stay correct even as your document changes.
Why Numbered Equations Matter
Imagine reading a physics paper that says "substituting the result from the energy equation above into the momentum relation two pages back." Without equation numbers, the reader has to hunt through the document to find the right formula. Numbered equations solve this problem by giving every key result a clear address — the same way street numbers help you find a specific building.
LaTeX goes one step further: it can automatically manage those numbers for you. If you insert a new equation in the middle of your document, every number after it updates on the next compilation. Combined with a labeling system, you can write references like "see Equation (3)" and trust that the number will always point to the correct formula, no matter how many edits you make.
The `equation` Environment
The equation environment is LaTeX's built-in way to produce a numbered display equation. Its structure will feel familiar because it follows the same \begin / \end pattern you have used for other environments throughout this path. Here is a minimal example:
When compiled, this produces the formula centered on its own line with a number in the right margin:
A few things to note:
- The math inside the environment is written exactly the same way as between
\[ ... \]. All the commands you already know —\frac,\sum,\sqrt, Greek letters — work without any changes. - LaTeX assigns the number automatically, starting at 1 and incrementing with each new
equationenvironment in the document. - You do not place dollar signs or
\[ ... \]inside the environment. Theequationenvironment already enters math mode for you.
Think of equation as the "upgrade" from \[ ... \] that adds a number on the side. Everything else about how you write the math stays the same.
Unnumbered Equations with `equation*`
Not every display equation deserves a number. Intermediate algebra steps or brief illustrations often look better without one. For these cases, LaTeX provides the starred variant, equation*. This environment requires the amsmath package, so make sure your preamble includes:
With that package loaded, you can write:
The output is a centered display equation with no number in the margin:
This is visually identical to what \[ ... \] produces. The starred form exists so you have a consistent environment-based syntax for both numbered and unnumbered cases. Here is a quick comparison:
| Syntax | Numbered? | Package needed? |
|---|---|---|
\[ ... \] | No | None |
\begin{equation} ... \end{equation} | Yes | None |
\begin{equation*} ... \end{equation*} | No | amsmath |
A good rule of thumb: use the numbered equation environment for any result you plan to reference later, and use equation* or \[ ... \] for supporting steps that do not need a number.
Labeling and Cross-Referencing Equations
Assigning a number to an equation is only half the story. The real power comes from labels and cross-references, which let you mention an equation by number anywhere in your document without hard-coding the value. If equations are added or removed, every reference updates automatically on the next compilation — no manual renumbering required.
The workflow has two parts:
- Label the equation with
\label{...}inside theequationenvironment. - Reference it later with
\eqref{...}wherever you need the number.
Here is a complete example:
In the compiled output, \eqref{eq:energy} is replaced by the equation's number wrapped in parentheses, such as (1). The sentence would read: "Equation (1) shows the mass-energy equivalence."
There are a few practical points to keep in mind:
- Label names are free-form text, but the convention is to start with
eq:followed by a short descriptive tag, likeeq:energyoreq:main. This makes labels easy to recognize in a large document. - The
\labelcommand must appear inside theequationenvironment, either before or after the formula itself. - The
\eqrefcommand, provided by amsmath, automatically adds parentheses around the number. A plain\refcommand also exists and prints the bare number without parentheses, but\eqrefis preferred for equations because parenthesized numbers match standard mathematical convention. - After adding or changing labels, you may need to compile twice. The first pass records the label, and the second pass fills in the correct number at every
\eqreflocation. This two-pass behavior is similar to what you saw with the table of contents earlier in the learning path.
One last typographic detail: the tilde (~) before \eqref in the example inserts a non-breaking space. It prevents LaTeX from placing a line break between the word "Equation" and the number, keeping them together on the same line. This small touch is standard practice in professional documents and well worth making a habit.
Conclusion and Next Steps
In this lesson, you learned how to produce numbered display equations with the equation environment, suppress numbering with equation*, and build a label-and-reference workflow using \label and \eqref. These tools let LaTeX manage equation numbers for you, so your references stay accurate no matter how much your document grows or changes.
Up next, you will put all of this into practice by writing numbered and unnumbered equations, attaching labels, and building cross-references that update automatically. Let LaTeX handle the bookkeeping while you focus on the math — and in the next lesson, we will take things further with multi-line aligned equations!
