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}
Zarko
  • 296,517
Leila
  • 181

2 Answers2

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.
Bernard
  • 271,350
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

Zarko
  • 296,517
  • Only the obsolete usenames is given as an argument to xcolor in your code. – cfr Dec 21 '15 at 02:11
  • According to beamer documentation, should be given all. I tested table option and it work. – Zarko Dec 21 '15 at 02: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 '15 at 02: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 '15 at 02: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 '15 at 02:59
  • Try \documentclass[xcolor=dvipsnames,handout,svgnames,table]{beamer} and \documentclass[xcolor={dvipsnames,handout,svgnames,table}]{beamer}. – cfr Dec 21 '15 at 03:02
  • I try both, but don't observe the difference. I will correct my answer as you suggest. – Zarko Dec 21 '15 at 03:53
  • You need 2 slides. Try `\documentclass[xcolor={dvipsnames,handout,svgnames,table}]{beamer}

    \begin{document} \begin{frame} abc \onslide<2-> def \end{frame} \end{document}versus\documentclass[xcolor={dvipsnames,svgnames,table},handout]{beamer}

    \begin{document} \begin{frame} abc \onslide<2-> def \end{frame} \end{document}` You should get 1 slide in the first case, 2 in the second. (I'm surprised there's no complaint in the first, but I guess it just ignores the option.)

    – cfr Dec 21 '15 at 04:02