Paragraph ended before \<name> was complete.
A blank line (paragraph break) appeared inside an argument or maths environment that cannot contain one, often because a } or \end{…} is missing.
Help centre › LaTeX errors › Braces and environments · Error: the build stops or the output is wrong
What the log says
Runaway argument?
{sec:intro
! Paragraph ended before \label was complete.
<to be read again>
\par
l.4 What it means
The command named in the message reads an argument that may not contain a paragraph break (a blank line or \par), and it met one before the argument ended. Either the closing } is missing, so the argument ran on into the next paragraph, or there really is a blank line inside something that does not allow it, such as an align or split environment.
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. A closing brace is missing in a short argument
\label, \ref, \cite, \url and similar commands take one-line arguments. Add the missing }; the text after Runaway argument? shows where the argument started.
\documentclass{article}
\begin{document}
\section{Introduction}\label{sec:intro
Our first result.
\end{document}\documentclass{article}
\begin{document}
\section{Introduction}\label{sec:intro}
Our first result.
\end{document}2. A blank line inside align, split, gather or multline
These amsmath environments read their whole body as one argument, and a blank line ends it early: the message names \align, \split, \gather or \multline. Remove the empty line, or put % on it.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
a &= b + c \\
d &= e
\end{align}
\end{document}\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
a &= b + c \\
d &= e
\end{align}
\end{document}3. An environment opened inside the equation is never closed
If \begin{split} (or aligned, cases) has no \end{split}, its body runs on: to the next blank line, which gives this message, or to \end{equation}, which gives \begin{split} … ended by \end{equation}. Add the missing \end{…} before the end of the equation.
4. A section title with a blank line in it
A heading whose } comes after a blank line (a title closed too late, or one missing its } with a later stray }) runs into the next paragraph; the message then names an internal command such as \@sect. Close the title on the same line. If no } follows at all, TeX reads on to the end of the file and reports File ended while scanning use of … instead.
\documentclass{article}
\begin{document}
\section{Introduction
Our first result.}
\end{document}\documentclass{article}
\begin{document}
\section{Introduction}
Our first result.
\end{document}Finding the line when the line number does not help
- The
l.<n>line is usually the blank line itself; the mistake is just above it, in the command named in the message. - When the name has an
@in it (\@sect,\@caption), it is the internal command behind something you wrote, such as\sectionor\caption.
In Manulyx
The editor shows the error beside the line with an explanation; when an environment inside an equation is not closed, it marks the unclosed \begin in the gutter.
Write in Manulyx for free · Journal templates
More in braces and environments
- Extra }, or forgotten $.A closing brace } has no matching {. Count the braces on the reported line, or look for a $ that closes maths inside a {…} group.
- Missing } inserted.A { group was still open when maths or a table cell ended. Close the brace before the $ or & that ends it.
- LaTeX Error: \begin{<a>} on input line <n> ended by \end{<b>}An environment is closed by the wrong \end: a misspelled \end, environments closed in the wrong order, or a missing \end{…} further up.
Every example on this page was compiled with pdfLaTeX to check that it fails and is fixed as described. All LaTeX errors