1

I am trying to color a hyperlink in my cv with a non-standard blue in overleaf. When I load xcolor package, it gives me the error

LaTex Error: Option clash for package xcolor

Am I right in thinking that the moderncv package already loads xcolor by itself and therefore clashes? And if so, why does it not find colors from the reference (https://www.overleaf.com/learn/latex/Using_colours_in_LaTeX#Reference_guide)?

Updated (working) MWE:

\PassOptionsToPackage{dvipsnames}{xcolor}
\documentclass[11pt,a4paper,roman]{moderncv}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.77]{geometry}

\moderncvcolor{blue} \moderncvstyle{classic}

\name{John}{Doe} \title{updated \today}
\address{Fantasialand}{}{} \title{Tex MWE}

\begin{document} \makecvtitle

\section{} \cvitem{1.}{\href{https://www.wikipedia.de/}{\color{Turquoise}{Go to Stackexchange}}}

\clearpage \end{document}

Papayapap
  • 421
  • The MWE you inlcuded does result in a different error message due to the # in the url. – leandriis Jan 25 '21 at 21:23
  • 1
    Apart from that, xcolor does not define a color named turquoise, it only defines Turquoise. To be able to use the latter color in the moderncv class, add \PassOptionsToPackage{svgnames}{xcolor} or \PassOptionsToPackage{dvipsnames}{xcolor} before \documentclass, depending on which of the two Turquoisecolors you want to use. – leandriis Jan 25 '21 at 21:30
  • Thank you, changed the MWE above but it still does not work. Also tried to position \PassOptionsToPackage{dvipsnames}{xcolor} in different places and still did not work – Papayapap Jan 25 '21 at 21:36
  • 2
    @Papayapap: The color name is now missing a "u". You used Turqoise while, the color ns named Turquoise. – leandriis Jan 25 '21 at 21:37
  • @leandriis, aah, indeed. Thank you so much for taking the time! – Papayapap Jan 25 '21 at 21:38
  • 1
    You also can load the [dvipsnames] option as an option of \documentclass. – Bernard Jan 25 '21 at 23:34

0 Answers0