LaTeX error "Missing } inserted": cause and fix
A group opened with { was still open when the formula, the environment or the table cell around it ended. TeX closed the group itself by inserting a }.
Why it happens
- A brace in a formula is not closed before the
$, as in$x^{2$. - A
{opened inside an environment is still open at its\end{...}, for example{\large Titlein acenterenvironment. - A group spans two table cells:
{\bfseries Name & Value}. A group cannot stay open across an&. - The error follows Missing { inserted: TeX first inserts the
{and then the}that matches it.
How to fix it
- Add the
}where the group should end:$x^{2}$. - Close every group inside the environment in which you opened it.
- In a table, format each cell on its own:
\textbf{Name} & \textbf{Value}. - If
Missing { insertedstands directly above this error in the log, fix that one. This error disappears with it.
A document that produces the message
\documentclass{article}
\begin{document}
The value is $x^{2$ in this case.
\end{document}The corrected document
\documentclass{article}
\begin{document}
The value is $x^{2}$ in this case.
\end{document}Both documents were compiled with pdfLaTeX from TeX Live 2023. The first produces the message, the second compiles without an error.
Finding the line in the editor
The editor lists every error and warning of a compile run with file and line. Select an entry and the cursor jumps to that line. See Error list with jump to the line.
Related pages
- Error Missing { inserted
- Error Extra }, or forgotten $
- Error Runaway argument?
- How-to Exponents and subscripts in LaTeX