Option Clash for Package
! LaTeX Error: Option clash for package XXX.
What this error means
The same package is being loaded twice with different options, which LaTeX does not allow. This often happens when one package internally loads another with different settings than you specified.
FormaTeX smart compile
FormaTeX smart compile detects common option clash patterns and reorders package loading automatically.
Common causes
- Loading a package explicitly with options after it was already loaded by another package
- Loading the same package twice with different option lists
- A package internally loading a dependency with conflicting settings
How to fix it
Load the package with your desired options as early as possible — before any package that might load it automatically. If a dependency causes the conflict, load it first with your options, then load the dependent package.
Code examples
\documentclass{article}
\usepackage{hyperref} % hyperref loads xcolor internally
\usepackage[dvipsnames]{xcolor} % Option clash!
\begin{document}
Hello
\end{document}\documentclass{article}
\usepackage[dvipsnames]{xcolor} % Load xcolor first with your options
\usepackage{hyperref} % hyperref reuses xcolor without conflict
\begin{document}
Hello
\end{document}Related errors
Test the fix live
Paste your LaTeX into the playground and compile instantly.

