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.

Fails
\documentclass{article}
\begin{document}
The root $\sqrt{x$ is defined for $x \geq 0$.
\end{document}
Fixed
\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.

Fails
\documentclass{article}
\begin{document}
The value $\mathbf{v$} is a vector.
\end{document}
Fixed
\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

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

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