Error & warning lists

A field guide to the messages LaTeX prints. Errors (!) stop the build; warnings do not, but often signal a real problem (a bad line, a broken reference). Here are the common ones, with what each means and the usual fix. (For how to read them and the ? prompt, see “Reading errors & debugging.”)

TeX errors

MessageCause & fix
! Undefined control sequenceAn unknown command — a typo, or a package not loaded
! Missing $ insertedA math symbol outside math mode — wrap it in $...$
! Too many }'sMore } than {
! Missing } insertedAn unclosed {
! Misplaced alignment tab character && used outside a table; for a literal one use \&

LaTeX errors

MessageCause & fix
LaTeX Error: File not foundA package/file is missing — install via tlmgr, check spelling
Environment undefinedUndefined environment — package not loaded, or a typo
\begin{x} ended by \end{y}Mismatched or overlapping \begin\end
Something's wrong--perhaps a missing \itemAn empty list, or text before the first \item
Command \x already definedRedefining an existing command — use \renewcommand

LaTeX warnings

MessageMeaning & fix
Overfull \hboxA line overran the margin — reword, hyphenate, or local \sloppy
Underfull \hboxA too-loose line (badness) — reword or adjust breaks
Reference undefinedA \ref/\label mismatch, or recompile once more
Citation undefinedUnknown bib key, or bibtex/biber not run
Label multiply definedThe same label is defined twice
Font shape undefinedA bad or uninstalled font; a default is substituted

Common misuse

  • Unclosed $ → math runs away. Always pair them.
  • Too many & → match the table’s column count; for a literal one use \&.
  • Misused \\ → use a blank line for paragraphs; \\ is not needed on a last line or right after a heading.
  • Brace mismatch { } → find it fast with your editor’s bracket matching.