4

Here I load xcolor options (dvipsnames) at the very top, so all the xcolor friends don't have to sweat it, but options are like politics at Thanksgiving: s*** hits the fan no matter what:

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

Apologies, I tried to select the text in overleaf but when I let go of the mouse the selection disappears (it's that been kind of day):

enter image description here

5
  • 3
    beamer load xcolor, so you nod need to load it again and had not to load it with different options as you declare in document class. So, in your case just remove second line (with xcolor) in the code: \documentclass[10pt,usenames,dvipsnames]{beamer} \usepackage{pgfpages}
    – Zarko
    Oct 22 '20 at 21:39
  • 3
    If you don't want to specify global options (that's what options to the \documentclass are), you can also use \PassOptionsToPackage{usenames,dvipsnames}{xcolor} before xcolor gets loaded (so before \documentclass in this case). Please note that the usenames option is obsolete according to xcolor's documentation.
    – Skillmon
    Oct 22 '20 at 21:49
  • 2
    do you need any options? xcolor is already loaded, you can't load it again? Oct 22 '20 at 23:19
  • 1
    Thanks all for the extremely helpful replies. In hindsight, it should have been obvious to me from lines 1-2 both having [dvipsnames...] that xcolor was being loaded by beamer. @Zarko if you want to place your comment in an answer I'll accept it.
    – mkk
    Oct 26 '20 at 17:19
  • 1
    It's moments like these that help me [slowly] transition from pasting fragments of code found on the internet to writing latex "with intention", haha
    – mkk
    Oct 26 '20 at 17:26
2

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

1
  • super clear explanation. Fi ally I get I :)
    – JeT
    Oct 26 '20 at 21:39
3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.