0

I wanted to know if it is possible to have the table of contents in black like it appears in the picture: enter image description here

And also make the sections appears in blue when referencing them:

enter image description here

This is my current set up:

\hypersetup{
    colorlinks=true,
    linkcolor=black,
    filecolor=blue,      
    urlcolor=blue,
    citecolor=blue,
    %pdfpagemode=FullScreen,
}

1 Answers1

3

Something like this will do what you want:

\documentclass{article}

\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    allcolors=blue
}

\begin{document}

{\hypersetup{hidelinks}
\tableofcontents
}

\section{Section heading}
\label{sec}

Filler text.

\section{Another section heading}
\label{anothersec}

Filler text. §\ref{sec}. Filler text. §\ref{anothersec}.

\end{document}

output

David Purton
  • 25,884
  • Wow!!! You did it! Such a wonderful job! It works but, I have the preamble, meaning, all the packages, separated from the main.tex file. I can only alter the document from the preamble. By putting {\hypersetup{hidelinks} \tableofcontents below \begin{document} the table of contents appears in the first page and then comes the title page. How can we fix that? } –  May 23 '19 at 03:19
  • @Delan, you must have an existing \tableofcontents somewhere in your document. Just replace that line with {\hypersetup{hidelinks}\tableofcontents} – David Purton May 23 '19 at 03:20
  • I want to alter the whole document, yes! I am trying to find where \tableofcontents is. I am seeing that I have it like \input{tableofcontents} –  May 23 '19 at 03:23
  • Or you could use {\hypersetup{hidelinks}\input{tableofcontents}} – David Purton May 23 '19 at 03:25
  • It worked!!!! I did the following: {\hypersetup{hidelinks} \input{tableofcontents} } –  May 23 '19 at 03:25
  • I need list of figures and list of tables also in black. How can we alter that? Right now the table of contents is appearing in black and everything else, in blue. Which is fantastic. But I need to make both lists, figures and tables in black also, because it does not match the style then. But so far, you're a genius –  May 23 '19 at 03:28
  • 1
    @Delan. Same way. Just surround you list of figure and list of tables with {\hypersetup{hidelinks}…}. – David Purton May 23 '19 at 03:31
  • Done! It looks fantastic! Thank you very much! –  May 23 '19 at 03:33