LaTeX Error: Unknown option `<opt>' for package `<pkg>'

A package was given an option it does not accept: a typo, an option meant for the class or another package, or a babel language name it does not know.

Help centre › LaTeX errors › Commands and packages · Error: the build stops or the output is wrong

What the log says

! LaTeX Error: Unknown option `a4paper' for package `amsmath'.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...

l.2 \usepackage[a4paper]{amsmath}

Also printed as: LaTeX Error: Unknown option '<opt>' for package <pkg>; Package babel Error: Unknown option

What it means

The options in square brackets of a \usepackage line must be ones that package declares. LaTeX found one the package does not know and cannot guess what was meant. Recent versions print the option and package with straight quotes; older ones with `…' quotes. The babel package reports an unknown language the same way under its own name.

Causes and fixes

Most common first. Each example is a complete document; the first fails with this message, the second is the same document fixed.

1. The option is misspelled

Check the option against the package documentation: tabel for table in xcolor, number for numbers in natbib, dvipsname for dvipsnames. Correct the spelling.

Fails
\documentclass{article}
\usepackage[tabel]{xcolor}
\begin{document}
Text.
\end{document}
Fixed
\documentclass{article}
\usepackage[table]{xcolor}
\begin{document}
Text.
\end{document}

2. The option belongs to the class or to another package

Paper size, font size and twocolumn are class options: write them in \documentclass[a4paper,11pt]{article}, not on a package. Options moved between \usepackage lines while editing a preamble cause the same error.

Fails
\documentclass{article}
\usepackage[a4paper]{amsmath}
\begin{document}
Text.
\end{document}
Fixed
\documentclass[a4paper]{article}
\usepackage{amsmath}
\begin{document}
Text.
\end{document}

3. babel does not know the language name

babel takes language names such as english, american, british, german, ngerman, french, spanish, turkish. A misspelled or unsupported name stops with "Package babel Error: Unknown option". Correct the name; for scripts pdfLaTeX cannot typeset, use XeLaTeX or LuaLaTeX with babel's font support.

Fails
\documentclass{article}
\usepackage[englsh]{babel}
\begin{document}
Text.
\end{document}
Fixed
\documentclass{article}
\usepackage[english]{babel}
\begin{document}
Text.
\end{document}

4. The option is newer than the installed package

An option added in a recent release is unknown to an older installation. Check the package's change log for when the option appeared; until the installation is updated, use the older way of getting the same effect.

In Manulyx

The editor shows the error on the \usepackage line with an explanation that the package received an option it does not recognize.

Write in Manulyx for free · Journal templates

More in commands and packages

Every example on this page was compiled with pdfLaTeX to check that it fails and is fixed as described. All LaTeX errors