\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
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
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
> 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>
I used to do this but switched to using the svgnames option, which
provides a wider choice, and seems to work just fine.
///Peter