Graphics, Figures & TablesOption Clash for Package

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Curious George
Posts: 9
Joined: Wed Apr 04, 2012 6:33 pm

Option Clash for Package

Post by Curious George »

Trying to use the x11names option for xcolor in a beamer presentation, getting an "option clash" error. Example below. What is going on?

Danke/gracias/merci/thanks for your help.

This is the code.

Code: Select all

\documentclass{beamer}
\usepackage[x11names]{xcolor}
\begin{document}
begin{frame}
This is a test
\end{frame}
\end{document}

The following error occurs.

Code: Select all

This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian) (format=pdflatex 2012.10.18)  18 APR 2013 17:35

...

! LaTeX Error: Option clash for package xcolor.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.3 \begin
          {document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
tom
Posts: 73
Joined: Thu Apr 18, 2013 4:02 am

Option Clash for Package

Post by tom »

Hi!

Because beamer loads xcolor, you have to use a trick to pass the option to the package.

Code: Select all

\PassOptionsToPackage{x11names}{xcolor}
\documentclass{beamer}
\begin{document}
\begin{frame}{Title}
  This is an x11 color: \fcolorbox{black}{SlateGray1}{test}.
\end{frame}
\end{document}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Option Clash for Package

Post by localghost »

According to Section 2.6 of the beamer user guide Tom's approach can be simplified a bit.

Code: Select all

\documentclass[xcolor=x11names]{beamer}
\usepackage[T1]{fontenc}

\begin{document}

\begin{frame}{Title}
  This is an x11 color: \fcolorbox{black}{SlateGray1}{test}.
\end{frame}

\end{document}
More than one single option for xcolor would require additional braces for grouping.

Code: Select all

\documentclass[xcolor={dvipsnames,x11names}]{beamer}

Thorsten
Post Reply