I'm looking to create a theorem and definition list with thmtools
's \listoftheorems
for my thesis.
I have the following theorem types (grouped by style)
- Lemma, Proposition, Corollary, Theorem
- Definition, Algorithm, Notation
- Example, Note
and associated theorem declarations.
When I tell \listoftheorems
to only show the first group (by \listoftheorems[ignoreall, show={lemmathm, propositionthm, corollarythm, theoremthm}]
(where lemmathm
, etc. are the environment names), the list also includes entries for the other two groups.
The list of definitions created by \listoftheorems[ignoreall, show={definitionthm}]
is correct however.
My command invocation doesn't seem to be wrong. I adapted it from the example in the thmtools
documentation
Is there a known problem with multiple filters (this is what it seems like)? Can someone provide a fix or work-around?
MWE
The following MWE reproduces the error on my system. I have stripped dependencies with potential bad interaction as far as I could. — Please excuse the German. ;)
\documentclass[11pt, a4paper, twoside, openany, hidelinks]{book}
%!%!%!%!%!%!
% packages %
%!%!%!%!%!%!
%
% decoding/ encoding
%
\usepackage[applemac]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
%
% fonts & symbols
%
\usepackage{bera}
\usepackage{amsmath}
\usepackage{amssymb}
%
% layout
%
\usepackage{amsthm, thmtools}
\usepackage{listings}
%!%!%!%!%!%!
% commands %
%!%!%!%!%!%!
%
% font commands
%
\newcommand{\berafamily}{\fontfamily{fve}\selectfont}
%%%%%%%%%%%%%%%%%%%%
% theorem commands %
%%%%%%%%%%%%%%%%%%%%
%
% Sub theorem counters.
%
\newcounter{subtheoremcounter}
\setcounter{subtheoremcounter}{0}
\declaretheoremstyle[
spaceabove=1em,
spacebelow=1em,
headfont=\normalsize\bfseries\berafamily,
bodyfont=\rmfamily\normalsize,
postheadspace=\parindent,
postheadhook={\hfill\newline\setcounter{subtheoremcounter}{0}},
qed=$\square$,
headpunct={.}]{proof-style}
\declaretheorem[numberwithin=chapter, style=proof-style, name=Theorem]{theoremthm}
\declaretheorem[numberlike=theoremthm, style=proof-style, name=Proposition]{propositionthm}
\declaretheorem[numberlike=theoremthm, style=proof-style, name=Lemma]{lemmathm}
\declaretheorem[numberlike=theoremthm, style=proof-style, name=Korollar]{corollarythm}
\declaretheoremstyle[
spaceabove=1em,
spacebelow=1em,
headfont=\normalsize\bfseries\berafamily,
bodyfont=\rmfamily\normalsize,
postheadspace=\parindent,
postheadhook={%
\hfill\newline%
\setcounter{subtheoremcounter}{0}},
qed=$\blacksquare$,
headpunct={.}]{definition-style}
\declaretheorem[numberlike=theoremthm, style=definition-style, name=Definition]{definitionthm}
\declaretheorem[numberlike=theoremthm, style=definition-style, name=Algorithm]{algorithmthm}
\declaretheorem[numberlike=theoremthm, style=definition-style, name=Notation]{notationthm}
\declaretheoremstyle[
spaceabove=1em,
spacebelow=1em,
headfont=\normalsize\bfseries\berafamily,
bodyfont=\rmfamily\normalsize,
postheadspace=\parindent,
postheadhook={\setcounter{subtheoremcounter}{0}},
qed=$\blacksquare$]{example-style}
\declaretheorem[numberlike=theoremthm, style=example-style, name=Beispiel]{examplethm}
\declaretheorem[numberlike=theoremthm, style=example-style, name=Bemerkung]{notethm}
\makeatletter
%
% Title, date, institute, etc.
%
\title{<Titel>}
\author{<Autor>}
\date{\today}
%!%!%!%!%!%!
% document %
%!%!%!%!%!%!
\begin{document}
\raggedbottom
%
% I. Front Matter
%
\frontmatter
%
% I.1 Title Page
%
\maketitle
%
% I.1 Inhaltsverzeichnis
%
\tableofcontents
%
% II. Main Matter
%
\mainmatter
\addcontentsline{toc}{part}{Hauptteil}
%
% II.1
%
\chapter{Das erste Kapitel!}
\section{Der erste Abschnitt!}
\begin{definitionthm}[Definition A]%
\ldots
\end{definitionthm}
\begin{lemmathm}[Lemma 1]%
\ldots
\end{lemmathm}
\begin{notationthm}[Notation]
\ldots
\end{notationthm}
\begin{propositionthm}[Proposition 2]%
\ldots
\end{propositionthm}
\begin{notethm}
\ldots
\end{notethm}
\begin{examplethm}
\ldots
\end{examplethm}
\begin{theoremthm}[Theorem 3]%
\ldots
\end{theoremthm}
\section{Der Zweite Abschnitt!}
\begin{definitionthm}[Definition B]%
\ldots
\end{definitionthm}
\begin{definitionthm}[Definition C]%
\ldots
\end{definitionthm}
\begin{lemmathm}[Lemma 4]%
\ldots
\end{lemmathm}
\begin{lemmathm}[Lemma 5]%
\ldots
\end{lemmathm}
\begin{propositionthm}[Proposition 6]%
\ldots
\end{propositionthm}
\chapter{Das Zweite Kapitel!}
\section{Der Erste Abschnitt!}
\begin{definitionthm}[Definition D]%
\ldots
\end{definitionthm}
\begin{notethm}
\ldots
\end{notethm}
\begin{lemmathm}[Lemma 7]%
\ldots
\end{lemmathm}
\begin{examplethm}
\ldots
\end{examplethm}
\begin{theoremthm}[Theorem 8]%
\ldots
\end{theoremthm}
\begin{examplethm}
\ldots
\end{examplethm}
\begin{notationthm}[Notation]
\ldots
\end{notationthm}
%
% III. Anhang
%
\newpage
\appendix
\chapter*{Anhang}
\addcontentsline{toc}{chapter}{Anhang}
%
% IV. Verzeichnisse
%
\backmatter
%\chapter*{Verzeichnisse}
\addcontentsline{toc}{chapter}{Verzeichnisse}
%
% IV.1 Theoreme
%
\renewcommand{\listtheoremname}{Theoremverzeichnis}
\addcontentsline{toc}{section}{Theoremverzeichnis}
\listoftheorems[showall, ignore={definitionthm, notationthm, notethm, examplethm}]
%
% IV.2 Definitionen
%
\renewcommand{\listtheoremname}{Definitionsverzeichnis}
\addcontentsline{toc}{section}{Definitionsverzeichnis}
\listoftheorems[ignoreall, show={definitionthm}]
%
% IV.3 Tabellen
%
%\section*{Tabellenverzeichnis}
\addcontentsline{toc}{section}{Tabellenverzeichnis}
\listoftables
%
% IV.4 Abbildungen
%
%\section*{Abbildungsverzeichnis}
\addcontentsline{toc}{section}{Abbildungsverzeichnis}
\listoffigures
%
% IV.5 Listings
%
%
%!ref http://stackoverflow.com/a/9480618
%
\renewcommand{\lstlistlistingname}{Listingverzeichnis}
\addcontentsline{toc}{section}{Listingverzeichnis}
\lstlistoflistings
\end{document}