Missing } inserted.
A { group was still open when maths or a table cell ended. Close the brace before the $ or & that ends it.
Help centre › LaTeX errors › Braces and environments · Error: the build stops or the output is wrong
What the log says
! Missing } inserted.
<inserted text>
}
l.3 The root $\sqrt{x$
is defined for x >= 0.What it means
TeX reached a point where every open group must already be closed (the closing $ of a formula, the end of a table cell or of a display) while a { was still open. It inserted a } to recover. The fix is to put the closing brace where you meant it, before that point.
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 brace opened inside a formula is not closed before the closing $
$\sqrt{x$ or $\frac{a}{b$ leave a group open when maths ends. Add the missing } inside the formula.
\documentclass{article}
\begin{document}
The root $\sqrt{x$ is defined for $x \geq 0$.
\end{document}\documentclass{article}
\begin{document}
The root $\sqrt{x}$ is defined for $x \geq 0$.
\end{document}2. A $ placed inside a group that started outside maths
Inline maths must open and close inside the same group. In $\textbf{x$} the closing $ sits inside the \textbf group. Put both $ signs on the same side of the braces.
\documentclass{article}
\begin{document}
The value $\mathbf{v$} is a vector.
\end{document}\documentclass{article}
\begin{document}
The value $\mathbf{v}$ is a vector.
\end{document}3. A \left without its \right, or a group spanning & or \\ in an alignment
In align, array or a table, each cell is its own group: a {, or a \left(, opened in one cell must close in that cell. Split it per line with \bigl( … \bigr) or with \left( … \right. and \left. … \right).
Finding the line when the line number does not help
- TeX reports the place where it had to close the group, which is after the real mistake: look backwards from the
l.<n>line for the{that was never closed.
In Manulyx
The editor shows the error beside the line with an explanation, and the compile log is parsed into a list of problems.
Write in Manulyx for free · Journal templates
More in braces and environments
- Runaway argument?A command's argument was never closed, so TeX read on to the end of a paragraph or of the file. Add the missing } after the argument.
- 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.
- 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