# Generate automatically a list of definitions (user-defined theorem environment) in appendix

In the following code, I define a theorem environment definition and write a figure and a definition:

\documentclass[12pt]{book}
\usepackage[francais, english]{babel}
\usepackage{amsthm}
\begin{document}

\newtheorem{definition}{Definition}

\tableofcontents
\chapter{Chapter}
\section{Section}
\begin{figure}
a
\caption{haha}
\end{figure}
\begin{definition}[title]
body
\end{definition}

% ------------------------------------------
% List of figures
\listoffigures
\cleardoublepage
% ------------------------------------------
% List of Definitions
\chapter*{List of Definitions}
\markboth{List of Definitions}{List of Definitions}

\makeatletter
\@starttoc{lod}
\makeatother
\end{document}


The List of Figures can be correctly generated in the appendix:

However, the List of Definitions is empty:

Does anyone know what to do to make the auto-generation of the list of definitions work?

Edit 1: The solution of @egreg works fine for me in a separate file. When I adapt it to my huge tex files, I have got the following message while compilation. Could anyone help? (Sorry that I could not make the code simpler and copy here)

Use thmtools and tocbibind

\documentclass[12pt]{book}
\usepackage[T1]{fontenc}
\usepackage[french,english]{babel}

\usepackage{amsthm,thmtools}
\usepackage[nottoc]{tocbibind}

\declaretheorem[name=Theorem]{theorem}
\declaretheorem[name=Definition]{definition}

\renewcommand{\listtheoremname}{List of Definitions}%
}

\begin{document}

\tableofcontents
\chapter{Chapter}
\section{Section}
\begin{figure}
a
\caption{haha}
\end{figure}
\begin{definition}[title]
body
\end{definition}

\begin{theorem}
Body
\end{theorem}

% List of figures
\listoffigures

% List of Definitions
\listoftheorems[ignoreall,show=definition]

\end{document}


### List of definitions page

• Thank you, that works... But if I add \listoftheorems[ignoreall,show=theorem], the title of that page is still List of Definitions... How could I specify different titles for different lists? – SoftTimur Jan 1 '15 at 11:46
• I have got an error while adopting your solution to my tex files... Please see OP... – SoftTimur Jan 1 '15 at 11:54
• @SoftTimur You need to use \declaretheorem for this to work, not \newtheorem – egreg Jan 1 '15 at 12:11
• I did use \declaretheorem instead of \newtheorem... – SoftTimur Jan 1 '15 at 12:16
• @SoftTimur You have to redefine \listtheoremname before using \listoftheorems – egreg Jan 1 '15 at 15:05