I'm using an amsart document class with the following packages: -

\def\heading#1{\centerline{\bf #1 }\vskip 10pt}
\title[Short title]{Main Heading}

I have a contents page running, using the command


However, the hyperref package has the hyperlinks in a red box around the name of the section. I would like the hyperlinks to be on the page numbers and the page numbers to be in a different colour, for example, blue. This is seen in many journal articles. For example, here


2 Answers 2


The following options of package hyperref should help:

  • colorlinks colors the link text instead of using boxes;
  • linkcolor=blue chooses blue color for the links; if all kind of links (including citations, URL links, ...) should be blue, then option allcolors=blue sets the color for all;
  • linktocpage makes the page number instead of the section title as link in the table of contents.

This formatting can be achieved by using the hyperref option linktocpage and an option for producing colour links, instead of link rectangles.

For coloured links, there are two options

  • colorlinks (hyperref):


    Such links also appear as coloured links when printed on paper. If this is not desired,

  • ocgcolorlinks from the ocgx2 package can be used:


OCG colour links are coloured in the PDF viewer, but are printed on paper in the default text colour, usually black. A recent version (v0.24, 2017/03/30) of ocgx2 is required.

You must log in to answer this question.

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