1

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

\documentclass[a4]{amsart}
\usepackage{amssymb}
\usepackage{amscd}
\usepackage{verbatim,ifthen}
\usepackage{color}
\usepackage{latexsym}
\usepackage{tikz}
\usepackage{wrapfig}
\usetikzlibrary{shapes}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{calc}
\usepackage{multicol}
\def\heading#1{\centerline{\bf #1 }\vskip 10pt}
\newcommand\nextpage{\vfill\eject}
\usepackage{hyperref}
\addtolength{\textwidth}{80pt}
\addtolength{\hoffset}{-40pt}
\renewcommand{\baselinestretch}{1.2}
\title[Short title]{Main Heading}
\author{Author}
\begin{document}

I have a contents page running, using the command

\begincontentpage 

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

https://arxiv.org/pdf/1703.00438.pdf

2 Answers 2

1

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.
0

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):

    \usepackage[linktocpage,linkcolor=blue,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:

    \usepackage[linktocpage,linkcolor=blue]{hyperref}
    \usepackage[ocgcolorlinks]{ocgx2}
    

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 .