Error & warning lists

LaTeX error messages are built so that the first few words after the ! tell you who is complaining. A bare ! Missing $ inserted. comes from the TeX engine itself, ! LaTeX Error: from the LaTeX kernel, and ! Package hyperref Error: from the package it names. Once you can read that distinction, the very first line settles whether the fix belongs in your manuscript, in the load order of your preamble, or in somebody else's bug tracker. This page is an index of the messages people actually meet, quoted verbatim, each with what it really means and a pointer to the page that covers it in depth. Every message listed here was reproduced on TeX Live 2024.

The words after ! name the speaker: TeX, LaTeX, a package, or a warning

A line beginning with ! is an error and can stop the build; a line without ! is a warning or a note and the build carries on. The errors then split into three layers, and the words right after the ! say which. The bottom layer is the TeX engine, whose messages carry no prefix at all — ! Missing $ inserted. has read exactly the same for forty years, and plain TeX with no LaTeX loaded prints the identical sentence. The middle layer is the LaTeX kernel, ! LaTeX Error: …, and the top layer is packages and classes, ! Package X Error: … and ! Class X Error: …. The higher the layer, the friendlier the wording; the lower the layer, the closer to what TeX is genuinely stuck on. A message with no prefix usually means the syntax of the manuscript itself is broken.

Shape of the lineWho is speaking, and what it does to the build
! Missing $ inserted.the TeX engine itself; no prefix is the tell, and the manuscript syntax is broken
! LaTeX Error: ...the LaTeX kernel; a violation of LaTeX's own rules about environments, references or the preamble
! Package X Error: ...package X, by name; reading its own manual with texdoc X is usually the fastest next step
! Class X Error: ...document class X; in journal classes it is often a notice that a house rule was broken
LaTeX Warning: ...a kernel warning; the build succeeds and the exit status stays 0, which is how stale references survive
Package X Warning: ...a package warning; some end with on input line N and some deliberately do not
Overfull \hbox (...)straight from the paragraph builder; it carries neither ! nor the word Warning
Package X Info: ...information only; it stays in the .log and never reaches the terminal, but often explains a later failure

TeX engine errors: the messages with no prefix

This group reports that TeX can no longer move forward through the input, and the cause is almost always the pairing of braces, $ or &, or the way a number was written. The wording is curt because it was written before LaTeX existed. The upside is that these strings are identical on every distribution and in documents of every vintage, so they search well. What follows was reproduced on TeX Live 2024.

MessageWhat it really means, and the first move
! Undefined control sequence.the command at the right end of the upper line is undefined: a typo, a missing package, or a definition that comes too late
! Missing $ inserted.a math-only symbol appeared in text; _, ^ and \alpha are the usual triggers
! Missing } inserted.something ended while a { was still open; the cause is upstream of the reported position
! Too many }'s.a } too many; more often than not a { was dropped on an earlier line
! Extra alignment tab has been changed to \cr.a table row has more & than the column specification allows; count them against the preamble of the table
! Misplaced alignment tab character &.an & outside any table; for the character itself write \&
! Double subscript.two _ on one atom, as in x_1_2; group them, as in x_{12}
! Missing number, treated as zero.a length or count was expected and none was found; an empty argument such as \hspace{} is typical
! Illegal unit of measure (pt inserted).a number without a unit, as in \rule{1}{2pt}; add cm, pt or em
! Paragraph ended before \x was complete.a blank line landed inside an argument; a Runaway argument? line just above is the giveaway
! File ended while scanning use of \x.the file ran out before an argument was closed — the terminal stage of a missing }
! Missing \endcsname inserted.something unexpandable got inside \csname … \endcsname; suspect a constructed macro name
! TeX capacity exceeded, sorry [...]the brackets name the exhausted resource; [grouping levels=255] points at runaway recursion
! Emergency stop.TeX asked for input where none can be given — typically a missing file under a non-interactive mode

LaTeX kernel errors: the ones that start ! LaTeX Error:

These are breaches of LaTeX's conventions rather than of TeX's syntax, and because the wording is far more specific, the fix is usually unique. Mismatched environments, a misplaced \usepackage, a preamble-only command, a file that is not there — each of them is a rule LaTeX itself laid down. Remember that in the .log every one of these messages is followed by a help paragraph that says more than the single line on the terminal, so open the log whenever the wording is not enough.

MessageWhat it really means, and the first move
! LaTeX Error: File `x.sty' not found.the package is not installed, or misspelled; check with kpsewhich x.sty and install with tlmgr install x
! LaTeX Error: Environment x undefined.the package that defines the environment was never loaded; check the spelling of the name too
! LaTeX Error: \begin{x} on input line N ended by \end{y}.environments are crossed rather than nested; N is the line that opened, so read downward from there
! LaTeX Error: Command \x already defined.\newcommand was used on a name that exists; use \renewcommand if overwriting is intended
! LaTeX Error: Missing \begin{document}.something printable appeared in the preamble; a single non-blank character is enough to cause it
! LaTeX Error: Option clash for package x.a second load asked for an option the first load did not have; \PassOptionsToPackage is the fix
! LaTeX Error: Something's wrong--perhaps a missing \item.the list is empty, or text appears before the first \item
! LaTeX Error: There's no line here to end.\\ was used where no line had started, typically at the top of a paragraph or of a center block
! LaTeX Error: Not in outer par mode.a float was placed inside another float or box; a figure cannot live inside a figure or a minipage
! LaTeX Error: \caption outside float.\caption appeared outside a figure or table; wrap it in one, or use \captionof
! LaTeX Error: Can be used only in preamble.a preamble-only command such as \usepackage was used in the body
! LaTeX Error: \usepackage before \documentclass.\usepackage was used before \documentclass; only \RequirePackage works there
! LaTeX Error: Unknown option `x' for package `y'.the package never declared that option; check the spelling and the package version
! LaTeX Error: Unicode character X (U+NNNN)the character has no definition; under pdfLaTeX this covers CJK and emoji, while XeLaTeX and LuaLaTeX accept them

Package errors: ! Package X Error: is X speaking

Messages in this layer were written by the named package itself, which means the same words appear in that package's manual — opening texdoc X and searching for the message is the shortest path. They are also concrete: this environment cannot be used here, this colour is not defined, this package cannot coexist with that one. The fix is often stated outright. The following were produced on TeX Live 2024.

MessageWhat it really means, and the first move
! Package biblatex Error: Incompatible package 'natbib'.biblatex and natbib cannot coexist; replace both with \usepackage[natbib=true]{biblatex}
! Package cleveref Error: cleveref must be loaded after hyperref!.a load-order requirement: cleveref goes after hyperref, and after varioref too
! Package amsmath Error: \begin{split} won't work here.split cannot stand alone; it has to sit inside equation or align
! Package xcolor Error: Undefined color `x'.the colour name is not defined; load a name set such as dvipsnames, or declare it with \definecolor
! Package babel Error: Unknown option 'x'.the language name is misspelled, or its language files are not installed
! Package pdftex.def Error: File `x.png' not found: using draft setting.the image is missing; a frame is typeset instead and the run continues, so check the path and the extension
! Package inputenc Error: ...almost never seen on TeX Live 2024: UTF-8 handling moved into the kernel and inputenc has little left to do

Warnings: they never stop the build, but ignoring them ships a wrong PDF

Warnings never stop the build and never change the exit status from 0, so a CI job calls the run a success. That is exactly what makes them dangerous: a PDF whose references still read ??, or whose numbers are one revision behind, is born here. Two of them in particular — LaTeX Warning: There were undefined references. and Label(s) may have changed. Rerun to get cross-references right. — are instructions to compile again, not warnings to be lived with. A build script should either detect those two lines and rerun, or hand the whole problem to latexmk.

MessageWhat it really means, and the first move
Overfull \hbox (12.3pt too wide) in paragraph at lines 4--5a line ran past the text block; the number is by how much, and under about 1pt it is not worth chasing
Underfull \hbox (badness 10000) in paragraph at lines 4--5a line was stretched too loosely; badness 10000 is the worst value, and stray \linebreak or \\ is a common trigger
Overfull \vbox (26.3pt too high) detected at line 4the overflow is vertical: a box could not be squeezed into the page
LaTeX Warning: Reference `x' on page 1 undefined on input line 3.the label is not in the .aux yet: either this is the first run, or the \label is misspelled
LaTeX Warning: Citation `x' on page 1 undefined on input line 3.bibtex or biber has not been run yet, or the key is not in the .bib
LaTeX Warning: Label `x' multiply defined.the same label exists twice; every \ref to it can only point at one of them
LaTeX Warning: There were undefined references.the end-of-run summary; ship with this line present and the PDF still contains ??
LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.numbering differs from the previous run; one more compilation clears it
LaTeX Font Warning: Font shape `OT1/cmr/bx/sc' undefineda combination such as bold plus small caps does not exist; a substitute is used, so only the look changes
Package hyperref Warning: Token not allowed in a PDF string (Unicode):maths in a heading cannot go into a PDF bookmark; split the two with \texorpdfstring{math}{plain}

Messages that no longer appear, and only survive in stale advice

Old answers found through search still quote messages that TeX Live 2024 no longer produces; not seeing the same string does not mean your installation is broken. The clearest case is the Unicode error. It used to read ! Package inputenc Error: Unicode character …; now that UTF-8 handling lives in the kernel it reads ! LaTeX Error: Unicode character 日 (U+65E5) with not set up for use with LaTeX. on the following line. And and no longer fail at all — measured, characters now split into those pdfLaTeX accepts and those it still refuses, such as CJK, emoji and . The xcolor option clash went the same way, for a reason the package-clash page explains.

  • Unicode characters — the message is now ! LaTeX Error: Unicode character 日 (U+65E5), not ! Package inputenc Error:. Under pdfLaTeX, and pass while CJK, emoji and still do not.
  • The xcolor option clash\usepackage[dvipsnames]{xcolor} followed by \usepackage[table]{xcolor} raises no error at all, because xcolor moved to key-value options.
  • caption with subfigure — the old “cannot be used in cooperation” error is gone; the .log merely records Package caption Info: subfigure package is loaded.
  • subfigure with subcaption — loading both produces no error. Instead \begin{subfigure} is swallowed by the old \subfigure command and you get unrelated-looking errors such as ! Missing number, treated as zero.