# Further customize color of hyperref links

I have tried to find a way to customize how internal links are colored, but I don't yet have the expertise in finding and redefining commands. In the LaTeX example below, I describe how I would like to change the colors of various links. Any ideas or examples are much appreciated.

\documentclass{article}

\usepackage[backref=true]{biblatex}
\begin{filecontents}{refs.bib}
@book{cit1,
title = {The backreferences should be yellow},
author = {Last, First}
}
\end{filecontents}
\bibliography{refs.bib}

\usepackage{color}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
urlcolor=blue,
citecolor=gray]{hyperref}

\begin{document}

\title{Title}
\maketitle
\tableofcontents
\listoffigures

\section{Table of content's links should be green}
\label{s1}
All text, captions, and section headers after the list of figures
should be black. The citation links should be gray.\autocite{cit1}
\subsection{Table of content's subsections links should be orange}
or this figure link \ref{f1} should be blue.

\begin{figure}[h]
\label{f1}
\end{figure}

\printbibliography

\end{document}

-
Welcome to TeX.SE! This sounds like an interesting question, but are you sure that you want such an output? Have you ever seen a document that uses so many different colours? It sounds like it might be a little overwhelming... –  cmhughes Feb 17 '13 at 2:11
@golbasche, you may accept my post if you think it answers your question. –  Umar Kalim Feb 18 '13 at 6:21
I know this output sounds ridiculous ;) However, I do not intend to make my document a rainbow of colors. I only chose these colors for an easy to see testing environment. I will choose more subtle colors and formats once I figure out how to change everything. Thanks! –  Kevin Feb 19 '13 at 0:36

The hyperref options can be configured using the \hypersetup command and colors are enabled by colorlinks=true.

A MWE is below. citecolor is set to gray. For the table of contents link colors, linkcolor is set to green before the \tableofcontents command. Similarly for the list of figures, linkcolor is set to red before the \listoffigures command. Later linkcolor is set to blue for the internal links.

\documentclass{article}
\usepackage{color}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage[backref=true,backend=biber,natbib=true,hyperref=true]{biblatex}
\bibliography{refs}

\usepackage{hyperref}
\hypersetup{
citecolor    = gray
}
\begin{document}

\title{Title}
\maketitle
\tableofcontents
\listoffigures

\section{Table of content's links should be green} \label{s1}
All text, captions, and section headers after the list of figures
should be black. The citation links should be gray~\cite{cit2}.
\subsection{Table of content's subsections links should be orange}
\ref{f1} should be blue.

\begin{figure}[h]
\label{f1}
\end{figure}
\nocite{*}

\printbibliography
\end{document}


Here is a screenshot of the output:

-
Thank you Umar. You got me one step closer. I would concede the request with the color orange. However, I'd still like to change the colors of the backref links. –  Kevin Feb 19 '13 at 0:38
Ah. It wasn't hard to figure out the last thing after looking at the code in more detail. I added \hypersetup{linkcolor=yellow} before \printbibliography and I got what I wanted. Thanks! –  Kevin Feb 19 '13 at 0:51