# List restated theorems only once

I like to take my notes in LaTeX, and to help my speed, I use restatable theorems so that I can quickly recall the text and re-insert it into my notes when the professor mentions it. However, the issue is when I want to use the \listoftheorems command to make a list of all of them at the beginning (to aid in quickly searching my notes), it repeats all the restated theorems. How can I stop it from doing this?

MWE

\documentclass[12pt,oneside]{book}
\usepackage[utf8]{inputenc}
\usepackage{amsthm,amsmath,amssymb,amsfonts}
\usepackage{thmtools}
\usepackage{multicol}
\usepackage{mathtools}
\usepackage{hyperref}
\hypersetup{
urlcolor=blue,
}

\declaretheorem[numberwithin=chapter]{theorem}
\declaretheorem[numberwithin=chapter]{definition}

\renewcommand{\listtheoremname}{List of Theorems and Definitions}
\begin{document}
\listoftheorems[ignoreall,show={theorem,definition}]
\vspace*{\baselineskip}
\hrule

\begin{restatable}[Defintition 1]{definition}{defn}
This is definition 1
\end{restatable}

\begin{restatable}[Theorem 1]{theorem}{thm}
This is theorem 1
\end{restatable}

We will now restate theorem 1,
\thm*

We will now restate Definition 1,
\defn*
\end{document}


The restatable theorems in thmtools first do a generic theorem definition which contains all the information about that theorem, and then just use that definition. The way it distinguishes the main statement of a theorem and a restatement is with the \ifthmt@thisistheone conditional. This conditional is false when you use \begin{restatable*} or \<theorem-command>* and true without the * argument.

However when writing the List of Theorems' entry, it is written unconditionally. This patch (add it to the preamble, after loading thmtools) adds the \ifthmt@thisistheone to the writing, so that it's done only for the main statement:

\usepackage{etoolbox}
\makeatletter
{\ifthmt@thisistheone
\else
\expandafter\@firstoftwo\expandafter\@gobbletwo
\fi}
{}{\FAILED}
\makeatother


\documentclass[12pt,oneside]{book}
\usepackage[utf8]{inputenc}
\usepackage{amsthm,amsmath,amssymb,amsfonts}
\usepackage{thmtools}
\usepackage{multicol}
\usepackage{mathtools}
\usepackage{hyperref}
\hypersetup{
urlcolor=blue,
}

\usepackage{etoolbox}
\makeatletter
{\ifthmt@thisistheone
\else
\expandafter\@firstoftwo\expandafter\@gobbletwo
\fi}
{}{\FAILED}
\makeatother

\declaretheorem[numberwithin=chapter]{theorem}
\declaretheorem[numberwithin=chapter]{definition}

\renewcommand{\listtheoremname}{List of Theorems and Definitions}
\begin{document}
\listoftheorems[ignoreall,show={theorem,definition}]
\vspace*{\baselineskip}
\hrule

\begin{restatable}[Defintition 1]{definition}{defn}
This is definition 1
\end{restatable}

\begin{restatable}[Theorem 1]{theorem}{thm}
This is theorem 1
\end{restatable}

We will now restate theorem 1,
\thm*

We will now restate Definition 1,
\defn*
\end{document}