Basically, I want to disable the colorlinks option (from the hyperref package) for the ToC, but keep it enabled for the rest of a (memoir) document.

This question has a workaround based on issuing \hypersetup{linkcolor=black} before \tableofcontents, but this doesn’t work for my case, since I already colour certain parts of the ToC, and hyperref’s colouring overrides this. Example:


\usepackage[colorlinks=false, hidelinks, linkcolor=cyan]{hyperref}





See \cref{chap:hello} for more information.







enter image description here

Note that the chapter 1 hyperlink is not coloured, since colorlinks=false. If I change it to true and remove hidelinks, I get:

enter image description here

I want a combination of the two, with orange chapter names and black section names in the ToC, and light blue hyperlinks in the rest of the document. Issuing \hypersetup{colorlinks=false} before \tableofcontents has no effect; it only results in the following warning:

Package hyperref Warning: Option `colorlinks' has already been used,
setting the option has no effect on input line 13

Is it possible to somehow disable colorlinks locally, or to make the ToC colouring commands (\cftchapterfont) override its effect? The solution needs to work with the memoir package (and ToC commands).

  • 1
    You could use locally \hypersetup{hidelinks} May 21 '14 at 10:27
  • 1
    @UlrikeFischer Brilliant! It never occured to me that hidelinks could be used locally when colorlinks could not. If you add it as an answer, I’ll accept it. May 21 '14 at 10:33

You could use locally \hypersetup{hidelinks}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.