1

I'm using the amsart class and would like to know how to

  1. in the "Contents" output, to only have sections' page numbers with clickable colored borders and the sections' names completely neutral (i.e. no colors, no hyperlinking on section names); and also
  2. have "colorlinks = false" for everything else.

Here is a sample:

\documentclass[a4paper, 12pt]{amsart}


\usepackage{hyperref, xcolor}
\usepackage{cite}

\hypersetup{backref, colorlinks=false, 
linkcolor=red, 
linkbordercolor = red,          
citebordercolor = green, 
pdfborder = {0 0 1 [1 0] }}


\begin{document}
\title{test}            

\maketitle

\tableofcontents

\section{Introduction}

In \cite[Thm 1]{work}...see section \S\ref{next} next

\section{Next}\label{next}


\begin{thebibliography}{99}
\bibitem[work]{work} \textit{July, 2013}
\end{thebibliography}

\end{document}

So in the output of the above example, I want the red boxes not over the sections' names, only their page number. The following post almost answers my question, but the sections in toc are not neutral: coloring the page numbers in the table of contents

1

Using linktoc=page or linktocpage, in the hyperref setup, allows you get sections' page numbers with red colored borders while the section name remains plain text.

This option doesn't change the rest of the document.

\documentclass[a4paper, 12pt]{amsart}
\usepackage{hyperref, xcolor}
\usepackage{cite}
\hypersetup{
    backref,
    colorlinks=false,
    linktocpage,
    pdfborder = {0 0 1 [1 0] }
    }

\begin{document}
\title{test}            

\maketitle

\tableofcontents

\section{Introduction}

In \cite[Thm 1]{work}...see section \S\ref{next} next

\section{Next}\label{next}

\begin{thebibliography}{99}
\bibitem[work]{work} \textit{July, 2013}
\end{thebibliography}
\end{document}

desc

  • Thank you!! btw, how does one compile tex code as you've done on stackexchange? – Quetzalcoatl Jul 3 '13 at 18:08
  • I'm not sure I'm understanding your question. I compiled the code on my pc, I took a screenshot and I uploaded it as an image. AFAIK, there's no way to compile tex code directly on this website. – bersanri Jul 4 '13 at 7:30

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.