Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using dvipsnames option within xcolor with hyperref

613 views
Skip to first unread message

Dave94705

unread,
Dec 12, 2009, 5:35:05 PM12/12/09
to
I would like to use some of the predefined colors within the
dvipsnames option of xcolor for hyperref but I keep getting "LaTeX
Error: Option clash for package Xcolor" from this

\usepackage[dvipsnames]{xcolor}
\definecolor{linkcolor}{Emerald}
\definecolor{ColorForCite}{Blue}
\definecolor{URLLinkColor}{Mulberry}
\ifpdf%
\usepackage[debug=false,%
breaklinks=true,%
letterpaper=true,
colorlinks=true,%
linkcolor=ColorForLink,%
citecolor=ColorForCite,%
urlcolor=URLLinkColor%
]{hyperref}
\fi


if I use the old style definitions:

\definecolor{ColorForLink}{rgb}{1.0, 0.0, 0.0}
\definecolor{ColorForCite}{cmyk}{0.5 0 0 1}
\definecolor{URLLinkColor}{rgb}{0.0, 0.0, 1.0}

without [dvipsnames] things work fine. I am trying to directly create
a postscript file. Any idea how to use dvipsnames with xcolors and
hyperref?

Thanks, ds

Herbert Voss

unread,
Dec 12, 2009, 5:41:40 PM12/12/09
to
Am 12.12.2009 23:35, schrieb Dave94705:
> I would like to use some of the predefined colors within the
> dvipsnames option of xcolor for hyperref but I keep getting "LaTeX
> Error: Option clash for package Xcolor" from this
>
> \usepackage[dvipsnames]{xcolor}
> \definecolor{linkcolor}{Emerald}
> \definecolor{ColorForCite}{Blue}
> \definecolor{URLLinkColor}{Mulberry}
> \ifpdf%
> \usepackage[debug=false,%
> breaklinks=true,%
> letterpaper=true,
> colorlinks=true,%
> linkcolor=ColorForLink,%
> citecolor=ColorForCite,%
> urlcolor=URLLinkColor%
> ]{hyperref}
> \fi

documentclass{article}

\usepackage{ifpdf}

\usepackage[dvipsnames]{xcolor}
\colorlet{linkcolor}{Emerald}
\colorlet{ColorForCite}{Blue}
\colorlet{URLLinkColor}{Mulberry}


\ifpdf%
\usepackage[debug=false,%
breaklinks=true,%
letterpaper=true,
colorlinks=true,%
linkcolor=ColorForLink,%
citecolor=ColorForCite,%
urlcolor=URLLinkColor%
]{hyperref}
\fi

\begin{document}

foo
\end{document}

Herbert

Enrico Gregorio

unread,
Dec 12, 2009, 5:49:30 PM12/12/09
to
Dave94705 <david.jobm...@gmail.com> wrote:

With that code under pdflatex I get no error, after changing
the definitions into

\definecolor{linkcolor}{named}{Emerald}

and similarly for the others. Definitely no "Option clash" error.
OTOH, if you use latex to get a dvi file in order to obtain a
PostScript file later, with that code hyperref is not even loaded.

Ciao
Enrico

Heiko Oberdiek

unread,
Dec 12, 2009, 7:22:05 PM12/12/09
to
Dave94705 <david.jobm...@gmail.com> wrote:

> I would like to use some of the predefined colors within the
> dvipsnames option of xcolor for hyperref but I keep getting "LaTeX
> Error: Option clash for package Xcolor" from this
>
> \usepackage[dvipsnames]{xcolor}
> \definecolor{linkcolor}{Emerald}
> \definecolor{ColorForCite}{Blue}
> \definecolor{URLLinkColor}{Mulberry}
> \ifpdf%
> \usepackage[debug=false,%
> breaklinks=true,%
> letterpaper=true,
> colorlinks=true,%
> linkcolor=ColorForLink,%
> citecolor=ColorForCite,%
> urlcolor=URLLinkColor%
> ]{hyperref}
> \fi

No, hyperref doesn't load xcolor, thus check your .log file
to find the package or class that is loading xcolor. Also
pressing "h" as answer to the error gives you
detailled option lists about the clash. Load xcolor first
with all options or use \PassOptionsToPackage first
to solve the option clash.

Yours sincerely
Heiko <ober...@uni-freiburg.de>

Peter Flynn

unread,
Dec 13, 2009, 10:40:05 AM12/13/09
to
Dave94705 wrote:
> I would like to use some of the predefined colors within the
> dvipsnames option of xcolor

I used to do this but switched to using the svgnames option, which
provides a wider choice, and seems to work just fine.

///Peter

0 new messages