where, how, and when to load xcolor options

On page 20 of the manual for beamer, you find

enter image description here

\documentclass[
  10pt,
  xcolor={usenames,dvipsnames},
]{beamer}

I recommend this way of typing long list of options to classes, so one has all of them in view and commenting/uncommenting them is easier.


The document class beamer load (among others also) package xcolor, so you not need to load it again. If you do, as you show in your question, you get clash between xcolor options. So, in your case just remove second line (with xcolor) in the code:

\documentclass[10pt,dvipsnames]{beamer}  
\usepackage{pgfpages}
\usepackage{tikz}

\begin{document}
\begin{frame}
    \begin{tikzpicture}
      \node[font=\Huge, text=Cyan] {Hello!};
    \end{tikzpicture}
\end{frame}
\end{document}

Please note, that the usenames option is obsolete according to documentation of the xcolor, so I omit this option in above MWE.

As stated in the @Skillmon comment: "If you don't want to specify global options (that's what options to the \verb+\documentclass+ are), you can also use \PassOptionsToPackage{usenames,dvipsnames}{xcolor} before xcolor gets loaded, i.e.:"

\PassOptionsToPackage{dvipsnames}{xcolor}
\documentclass[10pt]{beamer}
\usepackage{xcolor} % now option(s) doesn't clash,
                    % however you not need to load it again! 
\usepackage{tikz}
\usepackage{pgfpages}

\begin{document}
\begin{frame}
    \begin{tikzpicture}
      \node[font=\Huge, text=Cyan] {Hello!};
    \end{tikzpicture}
\end{frame}
\end{document}

In both cases, the result is the same:

enter image description here

Tags:

Beamer

Color