LaTeX error "Argument of \align has an extra }": cause and fix
TeX was reading an argument that ends at a fixed marker, for example at ] or at \end{align}, and met a } that closes more than was opened inside that argument. The message names the command that was reading, often an internal one.
Why it happens
- A surplus
}stands insidealign,gatheror anotheramsmathenvironment that reads its whole content as one argument.tabularxdoes the same. - The
[of an optional argument is not closed inside braces:\frac{\sqrt[3{x}}{2}. The message then names\@sqrt. \verbis used inside the argument of another command, as in\section{\verb|x|}. LaTeX reports\verb illegal in argumentfirst.- The error follows another one in the same line, for example Missing \endcsname inserted.
How to fix it
- Count the braces in the line the log names and delete the surplus
}. - Close the optional argument:
\sqrt[3]{x}. - Inside arguments, write
\texttt{...}instead of\verb. - If another error stands above this one for the same line, fix that one first.
A document that produces the message
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
a &= \frac{1}{2}} \\
b &= 2
\end{align}
\end{document}The corrected document
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
a &= \frac{1}{2} \\
b &= 2
\end{align}
\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 Too many }'s
- Error Extra }, or forgotten $
- Error Runaway argument?
- Package
amsmath