[Tex/LaTex] Avoid Option clash for package xcolor

colorpdftex

I've looked at other questions about option clash for package xcolor to no avail. Tried putting xcolor before hyperref and tikz, tried adding options [usenames, dvispsnames] to documentclass, and I still get the error. It also appears to always find the error on line 14, regardless of what is on line 14.

How do I fix this?

Here's a MWE:

\documentclass[letterpaper, usenames, dvipsnames]{article}

\usepackage{graphicx}
\usepackage{float}
\usepackage[letterpaper, top=1.125in, bottom=1.125in, left=0.75in, right=0.75in, footskip=0.00in]{geometry}
\usepackage{fancyhdr}
\usepackage{listings}
\usepackage{pxfonts}
\usepackage[usenames, dvipsnames]{xcolor}
\usepackage[toc, page]{appendix}
\usepackage[printwatermark]{xwatermark}
\usepackage{tikz}
\usepackage{hyperref}
% Make the links blue, to follow the Web convention. Using xcolor syntax, internal links will be
% 70 % blue, the remainder black, and URLs 80 % blue (brighter)
\hypersetup{colorlinks, linkcolor={blue!70!black}, citecolor={blue!50!black}, urlcolor={blue!80!black}}


\DeclareGraphicsExtensions{.png,.pdf,.jpg,.mps}


% Setup Draft watermark %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newsavebox\mybox
\savebox\mybox{\tikz[color=red,opacity=0.3]\node{DRAFT};}
\newwatermark*[allpages, angle=45, scale=6, xpos=-20, ypos=15]{\usebox\mybox}


\begin{document}
Test
\end{document}

Best Answer

Replace

\usepackage[usenames, dvipsnames]{xcolor}

with

\PassOptionsToPackage{usenames,dvipsnames}{xcolor}

and then let tikz load the package.

Or add whichever options tikz wants to the options you load xcolor with. For example,

\usepackage[usenames,dvipsnames,rgb]{xcolor}