From 3654c4373a2f4db8d4ab771937ad318a6921ac37 Mon Sep 17 00:00:00 2001
From: Andrew Dunning <adunning@users.noreply.github.com>
Date: Thu, 7 Sep 2017 22:06:51 +0100
Subject: [PATCH] Use xcolor for colorlinks option

Beamer loads `xcolor` rather than `color`, and thus the `dvipsnames` option doesn't take effect. This also provides a wider range of colour selections with the `svgnames` option. Closes #3877.
---
 data/templates/default.latex | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/data/templates/default.latex b/data/templates/default.latex
index a5f7e7030..f64c74069 100644
--- a/data/templates/default.latex
+++ b/data/templates/default.latex
@@ -1,7 +1,7 @@
 \PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
 \PassOptionsToPackage{hyphens}{url}
 $if(colorlinks)$
-\PassOptionsToPackage{usenames,dvipsnames}{color}
+\PassOptionsToPackage{dvipsnames,svgnames}{xcolor}
 $endif$
 %
 \documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$paper,$endif$$if(beamer)$ignorenonframetext,$if(handout)$handout,$endif$$if(aspectratio)$aspectratio=$aspectratio$,$endif$$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
@@ -126,6 +126,9 @@ $endif$
 $if(verbatim-in-note)$
 \usepackage{fancyvrb}
 $endif$
+$if(colorlinks)$
+\usepackage{xcolor}
+$endif$
 \usepackage{hyperref}
 \hypersetup{
 $if(title-meta)$
@@ -348,7 +351,7 @@ $if(beamer)$
 $else$
 {
 $if(colorlinks)$
-\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$black$endif$}
+\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$$endif$}
 $endif$
 \setcounter{tocdepth}{$toc-depth$}
 \tableofcontents