4

I am using memoir and the \listoftheorems of the thmtools package. And while it seems to beautifully work and integrate in the table of contents, it does not appear in the index listing of the pdf reader (I used okular).

Is there a setting to make it appear there?

Here is an MWE creating a list of theorems and a table of contenst. The former appears in the latter, but not in the index of the pdf reader.

\documentclass{memoir}

\usepackage{amsthm}
\usepackage{thmtools}

\RequirePackage[
hidelinks,
breaklinks=true,
bookmarksnumbered=true,
pdfpagemode=UseOutlines,
bookmarksopen=true
]{hyperref} % not working?

\newtheorem{theorem}{Theorem}[section] 

\begin{document}

    \tableofcontents

    \listoftheorems

    \chapter{My}
    \begin{theorem}
        My first theorem.
    \end{theorem}

    \begin{theorem}
        My second theorem.
    \end{theorem}

    \section{Awesome}
    \section{Table}

        \begin{theorem}
            My third theorem.
        \end{theorem}
    \chapter{Of}
    \section{Contents}
    \section{Is}
    \section{Here}

\end{document}

2 Answers 2

3

Unrelated but, you should probably load hyperref last

This seems to help:

\usepackage{xpatch}
\xpatchcmd{\listoftheorems}{\@fileswfalse}{}{\typeout{yes}}{\typeout{no}}

thmtools (through thm-listof.sty) defines \listoftheorems via a local redefinition of \listoffigures. In this definition we find \@fileswfalse which in this case causes List of Theorems to not be added to the PDF bookmarks (no idea why). At least it comes back if I add the two lines above (after thmtools)

4
  • awesome, thanks, it works now! I found the line in thm-listof.sty that you mentioned. But I do not understand what your \typeoutcommand does. Could you add this shortly to the answer? The help I found here just said it prints a message to the terminal and the log file.
    – Tim
    Commented Oct 30, 2017 at 12:59
  • You can remove those. They just write to the log, whether or not the patching went well. Note: don't change anything in thm-listof.sty
    – daleif
    Commented Oct 30, 2017 at 13:08
  • And I adjusted my question so hyperref is loaded last.
    – Tim
    Commented Oct 30, 2017 at 16:49
  • @daleif this solution crashes with too many bookmarks, see here
    – user1
    Commented Feb 27, 2019 at 11:27
1

Another solution:

\documentclass{memoir}

\RequirePackage[
hidelinks,
breaklinks=true,
bookmarksnumbered=true,
pdfpagemode=UseOutlines,
bookmarksopen=true
]{hyperref} % not working?

\usepackage{amsthm}
\usepackage{thmtools}

\newtheorem{theorem}{Theorem}[section] 

\begin{document}

    \tableofcontents

   \begingroup
   \phantomsection\pdfbookmark{\listtheoremname}{\listtheoremname}
   \listoftheorems
   \endgroup  

    \chapter{My}
    \begin{theorem}
        My first theorem.
    \end{theorem}

    \begin{theorem}
        My second theorem.
    \end{theorem}

    \section{Awesome}
    \section{Table}

        \begin{theorem}
            My third theorem.
        \end{theorem}
    \chapter{Of}
    \section{Contents}
    \section{Is}
    \section{Here}

\end{document}

Source: amsbook+thmtools: `\listoftheorems` points to first page of document, not to list of theorems answer from @ChristianHupfer

5
  • Thanks, I also liked the answer and upvoted it. Unfortunately, that will only have an effect when I have more than 15 rep points.
    – Tim
    Commented Oct 30, 2017 at 13:00
  • Wont this fail if the list of theorems is rather long (fail as in point to the wrong page)
    – daleif
    Commented Oct 30, 2017 at 13:09
  • @daleif you are right. But if I reverse the order has much less posibilities to fail. I didn't manage to make it fail... Editing.
    – koleygr
    Commented Oct 30, 2017 at 13:28
  • @ciem you have them :)
    – koleygr
    Commented Oct 30, 2017 at 13:31
  • @koleygr yes (:
    – Tim
    Commented Oct 30, 2017 at 13:44

You must log in to answer this question.

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