Why 'Option clash for package xcolor' happens when tikz, Beamer, and pgfplots coexist, how to fix load order, and how DrawFig export fits a clean preamble.
! LaTeX Error: Option clash for package xcolor.
If you search “tikz xcolor option clash” or “beamer xcolor conflict”, the figure is usually fine — xcolor was loaded twice with different options in the preamble. tikz, pgfplots, Beamer, and university templates all touch xcolor indirectly.
📌 Other 6 TikZ compile issues: TikZ won't compile? Seven common errors
\usepackage[dvips]{xcolor} early and something later does \usepackage[xetex]{xcolor}, you get Option clash.
Common setups:
xcolor; you add \usepackage{tikz} or load xcolor again manually.cls loads xcolor; the body adds options againpdftex / xetex / luatex options on xcolor\usepackage{xcolor} right after \documentclass, before other drawing packages:
\documentclass{article}
% pdfLaTeX:
\usepackage[pdftex]{xcolor}
% XeLaTeX: \usepackage[xetex]{xcolor}
% LuaLaTeX: \usepackage[luatex]{xcolor}
\usepackage{tikz}
\usepackage{xcolor}xcolor\usepackage[table]{xcolor}pgfplots libraries\PassOptionsToPackage (use with care)\documentclass:
\PassOptionsToPackage{dvipsnames}{xcolor}
\documentclass{beamer}
Templates differ by institution; back up main.tex before changing.
xcolor clash, the whole PDF fails — sometimes before tikzpicture runs. After fixing the preamble, if the figure still errors, check missing semicolon or missing tikzlibrary.
\definecolor tangled with package options. Paste into a preamble where xcolor load order is already fixed, then one final compile.
Pricing: Canvas editing and SVG/PNG/PDF export are free, no sign-in. TikZ export is 3 credits/use (sign-in; 30 credits/day). Details: credits rules.
\draw.