3

I want to have an url colored in cyan in a beamer presentation. The following code is not working and produces a link in pink.

\documentclass[
xcolor = svgnames,
hyperref = {colorlinks = true, urlcolor = cyan},
]{beamer}

\begin{document}
\begin{frame}{Not the good color}
\url{https://tex.stackexchange.com}
\end{frame}
\end{document}

Meanwhile, passing the option through hypersetup works:

\documentclass[
xcolor = svgnames
]{beamer}
\hypersetup{
    colorlinks = true,
    urlcolor   = cyan,
}

\begin{document}
\begin{frame}{The good color}
\url{https://tex.stackexchange.com}
\end{frame}
\end{document}

If relevant I am using pdflatex version 3.14159265-2.6-1.40.21 (TeX Live 2020/Arch Linux).

4
  • To get the correct result, in your first code, remove spaces from hyperref options: hyperref={colorlinks=true,urlcolor=cyan}. Apr 25, 2021 at 7:36
  • 1
    In fact, the only problematic space is the one after hyperref =. So you can use hyperref ={colorlinks = true, urlcolor = cyan}... Apr 25, 2021 at 7:49
  • Oh my! And I thought I was being clever with spaces around the equal signs. I find it more readable that way.
    – bela83
    Apr 25, 2021 at 8:17
  • 1
    keyval lists in documentclass options are not really supported, so they have some glitches. I would recommend to use \hypersetup for all options which can be set with it, and the hyperref option of beamer only for the ones which really need to be set when hyperref is loaded. Apr 25, 2021 at 9:48

1 Answer 1

5

To get the correct result, in the hyperref option of your first code, remove the space between = and {:

\documentclass[
xcolor = svgnames,
hyperref ={colorlinks = true, urlcolor = cyan},
]{beamer}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .