0

I am currently writing a report for my internship on LaTeX. I am using TeXstudio since my file was becoming too large for free Overleaf to compile. I have many referencing in it, and I would like to change their colour to blue. I used the command below (I specified everything since I was trying to fix this), and my in-text references are indeed appearing blue (like "Fig.x" when citing a figure or "[x]" when citing an article) but my issue is that my TOC also appears blue. I found out that it was the "linkcolor=" controlling that but setting it to black also set my figures/part referencing to black as well. Is there a way to have these references blue, while keeping my TOC black? Thanks in advance.

    \usepackage[colorlinks=true,urlcolor=black,citecolor=blue,filecolor=black,linkcolor=black,pagecolor=black,menucolor=black]{hyperref}

1 Answer 1

0

You need to compile twice after adding like here \addtocontents{toc}{\protect\hypersetup{hidelinks}} right after \begin{document}.

\documentclass{article}
\usepackage{xcolor}
\usepackage[colorlinks=true,urlcolor=black,citecolor=blue,filecolor=black,linkcolor=blue,pagecolor=black,menucolor=black]{hyperref}

\begin{document}
\addtocontents{toc}{\protect\hypersetup{hidelinks}}
\tableofcontents
\section{1}

\section{2}
\end{document}
1
  • Ah thank you so much it worked!
    – Alexis L.
    Commented Jul 10 at 8:47

You must log in to answer this question.

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