LaTeX Error: Environment <name> undefined

\begin{…} names an environment no loaded package defines: load the package (amsmath for align), fix the spelling, or define it with \newtheorem.

Help centre › LaTeX errors › Commands and packages · Error: the build stops or the output is wrong

What the log says

! LaTeX Error: Environment align undefined.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...

l.5 \begin{align}

What it means

LaTeX met \begin{name} and has no definition for an environment of that name. Either the package that provides it is not loaded, the name is misspelled, or the environment is one you are expected to define yourself (theorem-like environments). LaTeX usually continues, but the contents are typeset wrongly and more errors follow, so fix this one first.

Causes and fixes

Most common first. Each example is a complete document; the first fails with this message, the second is the same document fixed.

1. The package that defines the environment is not loaded

Many common environments are not part of LaTeX itself: align, gather, multline, cases, bmatrix and pmatrix come from amsmath; proof from amsthm; tabularx from tabularx; longtable from longtable; multicols from multicol; algorithm from algorithm; algorithmic from algpseudocode; subfigure and subtable from subcaption; tikzpicture from tikz. Add the \usepackage line to the preamble.

Fails
\documentclass{article}
\begin{document}
The model is
\begin{align}
  y &= ax + b
\end{align}
\end{document}
Fixed
\documentclass{article}
\usepackage{amsmath}
\begin{document}
The model is
\begin{align}
  y &= ax + b
\end{align}
\end{document}

2. A theorem-like environment was never declared

theorem, lemma, definition and corollary do not exist until you declare them with \newtheorem in the preamble (some journal classes declare them for you; the standard classes do not).

Fails
\documentclass{article}
\begin{document}
\begin{theorem}
Every bounded monotone sequence converges.
\end{theorem}
\end{document}
Fixed
\documentclass{article}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}
Every bounded monotone sequence converges.
\end{theorem}
\end{document}

3. The environment name is misspelled

Look at the name in the message: itemise for itemize, equation* without amsmath, figures for figure, Table for table (names are case sensitive). Correct both the \begin and the \end.

Fails
\documentclass{article}
\begin{document}
\begin{itemise}
  \item First point
\end{itemise}
\end{document}
Fixed
\documentclass{article}
\begin{document}
\begin{itemize}
  \item First point
\end{itemize}
\end{document}

4. The environment belongs to another document class

Text moved between templates brings environments with it: abstract exists in article and report but not in book; IEEEkeywords only in the IEEE class; keywords and highlights only in some journal classes. Use what the current class provides, or define a small replacement with \newenvironment.

In Manulyx

The editor shows the error beside the \begin line, and for the common environments it names the package to load and the exact \usepackage line to add.

Write in Manulyx for free · Journal templates

More in commands and packages

Every example on this page was compiled with pdfLaTeX to check that it fails and is fixed as described. All LaTeX errors