LaTeX errors explained

The 53 messages LaTeX and BibTeX print most, what each one means, and how to fix it. Every page has an example that fails and the same example fixed, compiled to check.

Help centre › LaTeX errors

Reading a LaTeX log. Errors start with !, and the line after them that starts with l. gives the line number and the text TeX had read when it stopped. Fix the first error first: later ones are often caused by it and disappear with it. Warnings (LaTeX Warning:) let the document compile but usually mean something is wrong in the output.

Commands and packages

Maths

  • Missing $ inserted.A maths-only character or command (_ ^ \alpha) appeared in text, or text appeared in maths. Wrap the maths in $ … $ or escape the character.
  • Double subscript.Two _ (or two ^) apply to the same symbol, as in x_i_j. Group them with braces: x_{i_j} or x_{ij}, x^{2^3} or {x^2}^3.
  • Missing \right. inserted.A \left has no matching \right in the same formula or line, or a \right has no \left. Pair them, or use \right. / \left. as invisible partners.
  • Display math should end with $$.A displayed equation was closed with a single $ or a $ appeared inside it. Use \[ … \] or an equation environment, and no $ inside.
  • LaTeX Error: Bad math environment delimiter.\[ or \( was used inside maths, or \] or \) without its opening. Close one formula before opening the next, and pair each delimiter.

Braces and environments

Tables and alignment

Document structure

Files and fonts

References and bibliography

Floats and layout