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.
\documentclass{article}
\usepackage[tabel]{xcolor}
\begin{document}
Text.
\end{document}\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.
\documentclass{article}
\usepackage[a4paper]{amsmath}
\begin{document}
Text.
\end{document}\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.
\documentclass{article}
\usepackage[englsh]{babel}
\begin{document}
Text.
\end{document}\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
- Undefined control sequence.LaTeX met a command it does not know: usually a typo, or a command whose package is not loaded. The log's l. line ends with the culprit.
- Missing number, treated as zero.A command that needs a number or length (\vspace, \setcounter, a width) got a word or nothing. Give it a value such as 1em or 3.
- LaTeX Error: Command \<name> already defined.\newcommand or a package tried to define a name that already exists. Pick another name, use \renewcommand, or drop the clashing package.
- Illegal parameter number in definition of \<name>.A # in a definition does not refer to a declared argument: #1 without [1], #1 in an environment's end code, or a # in a URL. Fix the count or escape it.
- Use of \<name> doesn't match its definition.A command with a special argument syntax, such as \put(x,y) or a \def with delimiters, was called without that syntax. Follow its exact form.
- LaTeX Error: Environment <name> undefined\begin{…} names an environment no loaded package defines: load the package (amsmath for align), fix the spelling, or define it with \newtheorem.
Every example on this page was compiled with pdfLaTeX to check that it fails and is fixed as described. All LaTeX errors