! LaTeX Error: Option clash for package X means the same package was loaded twice with different options — usually because something already loaded X (without your option) before your \usepackage. A package can be loaded only once.
Why it happens
A package loads only once. So if your \usepackage[opt]{X} runs after X was already loaded (by the class, by another package, or by an earlier \usepackage{X} with different options), the options conflict — an “Option clash.” Classic example: a package pulls in xcolor with no options, and then you write \usepackage[table]{xcolor}.
The fix
- Put
\PassOptionsToPackage{opt}{X}before X is loaded (at the very top of the preamble, or before whatever pulls X in) — the option then applies at first load. - Consolidate to a single
\usepackagewith all options, loaded earlier than anything that auto-loads it. - Reorder: load the package you want to option before the one that pulls it in.
% X が読まれる前に(プリアンブル冒頭)/ before X loads, at the very top
\PassOptionsToPackage{table}{xcolor}
\documentclass{article}
% 以降どこかで \usepackage{xcolor} されても table が効く
% (table applies even if something else loads xcolor later)Other clashes
Beyond option clashes, packages can conflict by redefining the same things. For instance, hyperref interferes with many packages and is conventionally loaded near the end. Follow each package’s README and the log’s hints, and adjust load order or compatibility options as needed.