0

I am using TeXstudio 4.7.2 (git 4.7.2), Using Qt Version 6.6.0, compiled with Qt 6.6.0 R on an older Mac under Monterey 11.7.3.

I have the ugly red boxes around hyperlinks problem, which are showing in the compiled PDF. To remove these boxes, and to recolour the hyperlink text, I saw the question on better colours for hyperref. I read the answers, and I have looked at the manual. There is also a question on just changing header colours but I thought that would be overkill given I just want the same black colour in the ToC and there is a menucolor option.

What I would like is to have a navy blue text for all hyperlinks, and no boxes around any of them for the body of the document. The ToC would just be plain black with no boxes around the text.

My preamble now contains:

 \usepackage[table, dvipsnames]{xcolor}    
 \usepackage[colorlinks]{hyperref}
 \usepackage{cleveref}     

whereas before it was

 \usepackage[table]{xcolor}    
 \usepackage{hyperref}
 \usepackage{cleveref}    

I have inserted

 \hypersetup{
 linkcolor=NavyBlue,
 citecolor=NavyBlue,
 urlcolor=NavyBlue,
 menucolor=black,
 linkbordercolor=[rgb]{0,0,0},
 citebordercolor=[rgb]{0,0,0},
 urlbordercolor=[rgb]{0,0,0},
 menubordercolor=[rgb]{0,0,0}
 } 

And everything works perfectly except the TOC is NavyBlue and not black. I have tried using Black with a capital letter and removing the menucolor option completely. I still get NavyBlue. The bibliography (I'm using natbib) and glossary are fine (the glossary page number links are in blue, which I am okay with).

How do I get the ToC to render as black text? I would like to retain the functionality that the ToC text and the page number are both clickable links.

Michelle
  • 519
  • 1
  • 4
  • 15
  • 1
    The option menucolor is for "Color for Acrobat menu items" according to the manual, which is not the same as the TOC. These are 'normal' links, so they follow linkcolor. – Marijn Feb 04 '24 at 22:12
  • But \hypersetup{linkcolor=black} before \tableofcontents and \hypersetup{linkcolor=NavyBlue} after probably works to change the color temporarily. – Marijn Feb 04 '24 at 22:14
  • I had assumed menu was just another term for ToC :( I find it a bit odd one cannot apparently do the ToC as normal text colour, given that everything in the ToC is a clickable link and therefore doesn't need to be identified as such. – Michelle Feb 04 '24 at 22:16
  • Well, if the TOC has no color then you might think it is not linked at all, so coloring everything is not such a bad choice I think. – Marijn Feb 04 '24 at 22:19
  • I'm using a university's .cls and it looks like the ToC is defined in there. Rather than messing around with the .cls I will just leave it as is. You raise a good point about the colour making it very obvious the ToC entries are links. – Michelle Feb 04 '24 at 22:21
  • 1
    you can change the link color locally, so simply do \hypersetup{linkcolor=black} before the toc and \hypersetup{linkcolor=NavyBlue} after the toc. – Ulrike Fischer Feb 04 '24 at 22:33

0 Answers0