4

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
\addcontentsline{toc}{chapter}{\protect\numberline{}List of Figures}
\listoffigures
\cleardoublepage
% ------------------------------------------
% List of Definitions
\chapter*{List of Definitions}
\markboth{List of Definitions}{List of Definitions}
\addcontentsline{toc}{chapter}{\numberline{}List of Definitions}

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

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

enter image description here

However, the List of Definitions is empty:

enter image description here

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)

enter image description here

2

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}

\addto\captionsenglish{%
  \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}

TOC page

enter image description here

List of definitions page

enter image description here

  • 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
  • 1
    @SoftTimur You have to redefine \listtheoremname before using \listoftheorems – egreg Jan 1 '15 at 15:05

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.