[Tex/LaTex] Set color to hyperlink except in the Table of Contents

hyperrefreporttable of contents

When I set \hypersetup{linkcolor=blue} to make the references of figures/tables blue, the TOC was also changed to blue. How can I change the link color to blue except change the default color (black) of the TOC?

Best Answer

There are many ways to achieve this, one way which

  • preserves the capability to click the links
  • allows coloured links before the table of contents

is to use { \hypersetup{hidelinks} \tableofcontents }. Pay attention to the curly brackets around the code, this puts the \hypersetup together with the table of contents inside a group, so it will not effect the remaining document.