4

I use the thmtools package in an amsbook document and compile with pdflatex. The hyperlink generated in the table of contents that should point to the list of theorems wrongly points to the first page of the document. A MWE can be found below.

I'm partially able to resolve the problem by adding

\cleardoublepage
\phantomsection\addcontentsline{toc}{chapter}{\listtheoremname}

just before \listoftheorems. Now the link correctly points to the list of theorems, but the table of contents contains two entries to the list of theorems.

I'd be very grateful if someone has hints on how to resolve this.

MWE:

\documentclass{amsbook}
\usepackage{amsthm,thmtools}
\usepackage{hyperref}

\declaretheorem[numberwithin=chapter,name=Theorem]{theorem}

\makeatletter
\providecommand\@dotsep{5}
\def\listtheoremname{List of theorems}
\makeatother

\begin{document}

\frontmatter
\title{Example}
\author{J. Doe}
\address{Earth}
\email{j.doe@earth.org}

\begin{abstract}
  Bla bla.
\end{abstract}

\maketitle
\setcounter{page}{4}

\tableofcontents
\listoftheorems

\mainmatter

\chapter{One}

\begin{theorem}
  Some theorem.
\end{theorem}

\backmatter
\end{document}
  • \phantomsection\pdfbookmark{\listtheoremname}{\listtheoremname} instead of \addcontentsline. – egreg Sep 17 '14 at 22:13
  • 2
    For me a \cleardoublepage\phantomsection\listoftheorems right after \tableofcontents is sufficient. Do you have some 'out-dated' tex distribution? – user31729 Sep 17 '14 at 22:20
  • @ChristianHupfer I'm using TeXLive 2012, but your suggestion works. I'm not sure why \listoftheorems doesn't work out of the box, but if you make it an answer, I'll accept it. And if I use \pdfbookmark, I also get the appropriate links in the PDF table of contents! – Dominique Sep 17 '14 at 22:34
5

For some reason, \listoftheorems from thmtools does not add correct hyperlinks, when adding a ToC entry to the List of Theorems. It does also not provide automatic bookmarking for the PDF outline.

Using a \cleardoublepage after \tableofcontents in conjunction with \phantomsection will provide the correct hyperlinking anchor.

\documentclass{amsbook}
\usepackage{amsthm,thmtools}
\usepackage{hyperref}

\declaretheorem[numberwithin=chapter,name=Theorem]{theorem}

\makeatletter
\providecommand\@dotsep{5}
\def\listtheoremname{List of theorems}
\makeatother

\begin{document}

\frontmatter
\title{Example}
\author{J. Doe}
\address{Earth}
\email{j.doe@earth.org}

\begin{abstract}
  Bla bla.
\end{abstract}

\maketitle
\setcounter{page}{4}

\tableofcontents
\cleardoublepage
\phantomsection
\pdfbookmark{\listtheoremname}{\listtheoremname}
\listoftheorems


\mainmatter

\chapter{One}

\begin{theorem}
  Some theorem.
\end{theorem}

\backmatter
\end{document}

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.