I use declaretheoremstyle
to define a theorem environment, and print a list of theorems in the end of my document:
\documentclass[12pt]{book}
\usepackage[english]{babel}
\usepackage[margin=2cm]{geometry}% just for the example
\usepackage{xcolor}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{mdframed}
\usepackage{etoolbox}
\declaretheoremstyle[
spaceabove=6pt, spacebelow=6pt,
headfont=\normalfont\bfseries,
postheadspace=1em,
notefont=\bfseries,
notebraces={(}{)},
bodyfont=\itshape,
shaded={bgcolor=yellow!20}
]{thmstyle}
\declaretheorem[style=thmstyle,name=Theorem]{theorem}
\begin{document}
\begin{theorem}[Somebody]
...
\end{theorem}
\begin{theorem}
...
\end{theorem}
\renewcommand{\listtheoremname}{List of Theorems}
\addcontentsline{toc}{section}{\listtheoremname}
\listoftheorems[ignoreall,show=theorem]
\end{document}
The theorems are numbered from the beginning to the end of the book, and from 1
:
However, I would like to number the theorems with chapter number (like Figures or Tables), for instance, 1.1
(the first theorem in Chapter 1), 1.2
(the first theorem in Chapter 2)...
Does anyone know how to do it?