The thmtools package provides a \listoftheorems command that generates a list of theorems/definitions/etc.

Here's a MWE:




\renewcommand{\listtheoremname}{List of definitions}



\section{First Section}

\begin{defn}[Some definition]
definition text

\section{Second Section}

\begin{thm}[Some Theorem]
theorem text

\section{Third Section}

\begin{defn}[Another definition]
definition text

definition without title

theorem without title


PROBLEM: I'd like to display section names in the List of definitions. The desired effect would look roughly as follows:

1. First Section

1.1 Definition (Some definition) ................................ 1

3. Third Section

3.1 Definition (Another definition) ............................ 1

3.2 Definition ........................................................... 1

I've been trying to adopt the suggestions of this excellent answer, but with little success. The suggested solution is a patch (via etoolbox) to the \thmtlo command from thmtools that annotates chapter breaks in the .loe file; the difficulty lies in that \thmtools has no equivalent command for annotating sections. Looking at the \thmtools documentation, the relevant command is defined on page 29, line 770. My naive attempt was to emulate that chunk of the code in the preamble of the MWE, in which I essentially just replace every occurrence of "chapter" with "section"; i.e., include the following code:

\ifcsname c@section\endcsname
      \ifnum \value{section}=\thmtlo@oldsection\relax\else

Sadly, this doesn't work at all, as the .loe file remains unchanged.

  • thmtools does a weird stuff there ... :-( – user31729 Jun 15 '15 at 18:27
  • @ChristianHupfer, Indeed. What is your feeling about it? Is what I'm asking impossible to implement with thmtools? – Nikita Jun 17 '15 at 16:35
  • Not impossible, but extremely difficult. I suspect, it's easier to build the \listoftheorems on your own, with tocloft, for example. I'll try to provide a solution, but it will take time – user31729 Jun 17 '15 at 20:50

if you are still trying to solve this question, I found a way.

First, in the thm-listof.sty file you have to comment out this line:


then, using etoolbox (and probably some other package I forgot), add this in the header of your .tex file:



      \addtocontents{lof}{\protect\contentsline {chapter}%
        {\protect\numberline {\thischapternumber} {\thischaptertitle}}{}{} }


Which works as long as the first entry in the chapter is a definition. Once I finished writing my thesis, I might add a working example.

  • This seems to focus on adding a chapter title rather than a section title (as requested by the OP). Additionally, how would you handle sections that don't have a definition in them? – Werner Jan 18 '16 at 22:44

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.