[Tex/LaTex] Write “chapter” before list of figures

chaptersnamingtable of contentsthmtools

if I use the \listoffigures command LaTeX creates a new chapter (I'm using the book class), but there is no chapter heading. Is it like it uses \chapter*{List of figures}. Of course this is what we want most of the cases, but what can I do to obtain a:

Chapter 3
List of figures

Actually I need these for the command \listoftheorems from the thmtools package, but it should be the same.

Best Answer

Since \listoftheorems uses internally \listoffigures, you can use the etoolbox package to patch \listoffigures changing the default \chapter* to \chapter (for a solution using amsbook, please see the second example below):

\documentclass{book}
\usepackage{amsmath}
\usepackage{thmtools}
\usepackage{etoolbox}

\declaretheorem[name=Theorem]{theo}

\begin{document}

\listoffigures

\patchcmd{\listoffigures}{\chapter*}{\chapter}{}{}
\listoftheorems
\clearpage
\begin{theo}[a]
Test theorem
\end{theo}
\begin{theo}[b]
Test theorem
\end{theo}
\begin{theo}[c]
Test theorem
\end{theo}
\begin{theo}[d]
Test theorem
\end{theo}

\end{document}

enter image description here

A similar patch can be easily done for other lists if required. For example, for the list of tables, one would say

\patchcmd{\listoftables}{\chapter*}{\chapter}{}{}

A request has been made to perform a similar modification but using amsbook; in this case, some additional work has to be done:

\documentclass{amsbook}
\usepackage{amsmath}
\usepackage{thmtools}
\usepackage{etoolbox}

\declaretheorem[name=Theorem]{theo}

\begin{document}

\listoffigures

\makeatletter
\patchcmd{\@starttoc}{\@makeschapterhead}{\@makechapterhead}{}{}
\def\@dotsep{1000}
\def\listoftheorems{\refstepcounter{chapter}\@starttoc{loe}\listtheoremname}
\def\l@figure{\@tocline{0}{3pt plus2pt}{0pt}{}{}}
\makeatother
\listoftheorems

\clearpage

\begin{theo}[a]
Test theorem
\end{theo}
\begin{theo}[b]
Test theorem
\end{theo}
\begin{theo}[c]
Test theorem
\end{theo}
\begin{theo}[d]
Test theorem
\end{theo}

\end{document}

enter image description here

Related Question