2

I am getting the following error with the example given at the end:

Option clash for package xcolor.

Example:

\documentclass{beamer}
\usetheme{Warsaw} 
\usepackage{amsmath,amsfonts,amssymb,pxfonts,eulervm,xspace}
\usepackage{graphicx}
\usecolortheme{dolphin}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}

\useinnertheme{circles}
\useoutertheme{smoothbars}
\usepackage{geometry}

\oddsidemargin = -2cm
\usepackage{pdfpages}
\setcounter{framenumber}{-1}

\usepackage{tcolorbox}
\usepackage[spanish, es-tabla]{babel}
\usepackage[utf8]{inputenc}
\begin{document}
    contenidos...
\end{document}
0

2 Answers 2

3

This is due to beamer already loading xcolor. Two workarounds:

Do not load xcolor with options, and

  • write in the preamble:

    \PassOptionsToPackage{dvipsnames,svgnames,table}{xcolor}

(Note usenames is obsolete)

  • Add dvipsnames,svgnames,table to the class options.
0

Another option: from beamer manuel, pp 19:

\documentclass[xcolor=⟨list of options⟩]{beamer}

In your case:

\documentclass[xcolor={dvipsnames,svgnames,table}]{beamer}
\usetheme{Warsaw}
\usecolortheme{dolphin}
\useinnertheme{circles}
\useoutertheme{smoothbars}
\usepackage{amsmath,amsfonts,amssymb,pxfonts,eulervm,xspace}
\usepackage{graphicx}

\usepackage{geometry}

\oddsidemargin = -2cm
\usepackage{pdfpages}
\setcounter{framenumber}{-1}

\usepackage{tcolorbox}
\usepackage[spanish, es-tabla]{babel}
\usepackage[utf8]{inputenc}

\begin{document}
\begin{center}
    \begin{tabular}{>{\columncolor{DarkMagenta}\color{white}}cc}
    a & b   \\
    c & d   \\
    \end{tabular}
\end{center}
\end{document}

enter image description here

8
  • Only the obsolete usenames is given as an argument to xcolor in your code.
    – cfr
    Dec 21, 2015 at 2:11
  • According to beamer documentation, should be given all. I tested table option and it work.
    – Zarko
    Dec 21, 2015 at 2:28
  • Compare what you've quoted from the documentation with what you've written. table works for the same reason it works in Bernard's answer. It is not being passed via the xcolor option of the class, though. It is being passed as a distinct option.
    – cfr
    Dec 21, 2015 at 2:31
  • Well, than I do not understand the Beamer documentation. Anyway, I tested my solution and it works, meaning, that dvipsnames as well svgnames are passed to xcolor package. The same is valid for option (parameter) table.
    – Zarko
    Dec 21, 2015 at 2:48
  • Yes, but Bernard already showed that. Of course it works. There is a difference between \documentclass[xcolor=dvipsnames,svgnames,table]{beamer} and \documentclass[xcolor={dvipsnames,svgnames,table}]{beamer}. The former passes svgnames and table as independent options. Only dvipsnames is passed as xcolor=dvipsnames to Beamer. The latter passes xcolor={dvipsnames,svgnames,table} to Beamer.
    – cfr
    Dec 21, 2015 at 2:59

Not the answer you're looking for? Browse other questions tagged .