FormaTeX
FatalCommands & Packages

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

Causes the error
\documentclass{article}
\usepackage{hyperref}           % hyperref loads xcolor internally
\usepackage[dvipsnames]{xcolor} % Option clash!
\begin{document}
Hello
\end{document}
Fixed
\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.

One quick thing

We track anonymous usage — page views, feature usage, compilation events — to understand what works and what doesn't. No ads, no personal data, no third-party sharing.

Cookie policy