In my need of writing a list of theorems I wrote the following code:

\documentclass[b5paper, twoside, 12pt]{memoir}
% packages
\usepackage{amsmath, amsthm, fancyhdr, geometry, hyperref, palatino, titlesec, titletoc}
\usepackage[italian]{babel}
\usepackage[applemac]{inputenc}
\usepackage{lipsum}
\newcommand{\ospace}[1]{\makebox[#1]{}}
% theorem environment definition
\newtheoremstyle{mytheorem}{0pt}{10pt}{\itshape}{}{\scshape}{~--~}{0pt}{}
\theoremstyle{mytheorem}
\newtheorem{mythm}{\hypertarget{thm\thesection.\themythm}{Theorem}}[section]
\renewcommand{\themythm}{\arabic{mythm}}
\newenvironment{thm}[1]{\newpage\begin{mythm}#1}{\end{mythm}}
\numberwithin{equation}{mythm}
\counterwithout{equation}{section}
% proof environment definition
\makeatletter
\renewenvironment{proof}{\pushQED{\qed}\trivlist\item[\hskip\labelsep\textsc{Dim.}]\mbox{}\vspace{5pt}\\*}{\popQED}
\makeatother
\begin{document}
\chapter{Chapter name}
\section{Section name}
% list of theorems
\textsc{Theorem 1} (Theorem 1 name (optional)) -- \hyperlink{thm\thesection.1}{\itshape{Theorem 1 thesis.}}
\vspace{0.5cm}

\ospace{-0.6cm}\textsc{Theorem 2} (Theorem 2 name (optional)) -- \hyperlink{thm\thesection.2}{\itshape{Theorem 2 thesis.}}

\begin{thm}[Theorem 1 name (optional)]
Theorem 1 thesis.
\end{thm}

\begin{proof}
Theorem 1 proof.
\end{proof}

\begin{thm}[Theorem 2 name (optional)]
Theorem 2 thesis.
\end{thm}

\begin{proof}
Theorem 2 proof.
\end{proof}
\end{document}


And it works fine, but it could be better. What I would like it to do is everytime I add a theorem it should automatically add it to the list at the beginning of the section, without me having to manually copy and paste it. It would also have to keep track of theorem numbering, that is if I already wrote two theorems (lets call them Th_1 and Th_2) and I decide to add a third theorem between the two, then the list should update accordingly (Th_1 stays Th_1, the new theorem becomes Th_2 and Th_2 goes to Th_3).

If this wasn't tricky enough, I would also want the theorems in the list to have clickable links to the actual theorems, like they have in the code above.

I don't know if I've been clear enough in my explanation, if you have any doubt feel free to ask.

• Your explanation is a bit confusing but I think using labels would help with referencing your theorems without having problems manually changing the numbering of the theorems. Dec 13, 2018 at 16:15

The thmtools package has a \listoftheorems command that produces a "table of contents" style list of the theorems. It can be customised in many ways, see the manual, section 1.5.