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:

E=mc2(1)E = mc^2 \qquad (1)

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, , , Greek letters — work without any changes.
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:

E=mc2E = mc^2

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:

SyntaxNumbered?Package needed?
\[ ... \]NoNone
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:

  1. Label the equation with \label{...} inside the equation environment.
  2. 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, like eq:energy or eq:main. This makes labels easy to recognize in a large document.
  • The \label command must appear inside the equation environment, either before or after the formula itself.
  • The \eqref command, provided by , automatically adds parentheses around the number. A plain command also exists and prints the bare number without parentheses, but is preferred for equations because parenthesized numbers match standard mathematical convention.
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!

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal