[Tex/LaTex] Table of contents is red

colortable of contents

The problem goes away in the minimal example I created if I remove this:

\usepackage[colorlinks=true ,urlcolor=blue,urlbordercolor={0 1 1}]{hyperref}

However, in my real document, I have links that I want to be appeared as

www.http://tex.stackexchange.com

So, what to do to set the color of the contents back to black?


The minimal example is this:

\documentclass{article}

% If I uncomment that, the contents are colored red!
%\usepackage[colorlinks=true ,urlcolor=blue,urlbordercolor={0 1 1}]{hyperref}

\author{George Samaras}

%\usepackage{graphicx}
%\usepackage{amsmath}
%\usepackage{bm}
%\usepackage{enumitem}

\newcommand{\tab}{\hspace*{1.2em}}

\begin{document}

\title{Software \& algorithms survey for a distributed linear algebra library}

\maketitle

\begin{abstract}
 In this document, we list packages that aim to provide linear algebra operations (such us inversion) in a distributed environment. Moreover, we briefly present some relevant algorithms.
\end{abstract}\par

\tableofcontents

\section{bla}
fdhfkd
\subsection{foo}
dsjhkds
\end{document}

Best Answer

You can use \hypersetup to decalre settings later in the document.

\documentclass{article}

% If I uncomment that, the contents are colored red!
\usepackage{hyperref}

\author{George Samaras}

%\usepackage{graphicx}
%\usepackage{amsmath}
%\usepackage{bm}
%\usepackage{enumitem}

\newcommand{\tab}{\hspace*{1.2em}}

\hypersetup{colorlinks=true, linkcolor=black}

\begin{document}

\title{Software \& algorithms survey for a distributed linear algebra library}

\maketitle

\begin{abstract}
 In this document, we list packages that aim to provide linear algebra operations (such us inversion) in a distributed environment. Moreover, we briefly present some relevant algorithms.
\end{abstract}\par

\tableofcontents

\hypersetup{colorlinks=true ,urlcolor=blue,urlbordercolor={0 1 1}}

\section{bla}
fdhfkd
\subsection{foo}
dsjhkds
\end{document}

enter image description here

Related Question