0

I'm creating a LaTeX document (on Overleaf) filled with mathematical theorems and proofs. To quickly overview which theorems have been proven, I need a custom table of contents (TOC) that organizes theorems under specific headings at the beginning of the document. I've defined a command:

\newRegister{Content}{Heading}

to mark theorem statements. Content is a brief description or name of the theorem, and

Heading is the category. The TOC should list these under their Heading, with clickable

Content leading to their location in the document.

Example entries:

\newRegister{In1}{Headline1}
\newRegister{In2}{Headline1}
\newRegister{In3}{Headline3}

The TOC should automatically organize and display them as:

Headline1
    In1
    In2
Headline3
    In3

How can I implement a dynamic, clickable TOC based on \newRegister entries?

Thanks for any guidance!

I can manually make the TOC with following code. But is their a more general approach for command \printRegister whitch allows me to insert any kind of headline and formula (e.g. \newRegister{in4}{Headline4} in the document tag) without any more adjustment of the command \printregister?

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}

\newcommand{\newRegister}[2]{ \noindent\hyperlink{#1}{#1}\ \hypertarget{#1}{} }

\newcommand{\printRegister}{ \section*{Inhaltsverzeichnis} \noindent\textbf{Headline1}\ \newRegister{In1}{Headline1} \newRegister{In2}{Headline1} \noindent\textbf{Headline3}\ \newRegister{In3}{Headline3} }

\begin{document}

\printRegister

\section*{Theoreme}

\subsection*{Headline1}
\newRegister{In1}{Headline1}
some content

\newRegister{In2}{Headline1}
some more content

\subsection*{Headline3}
\newRegister{In3}{Headline3}
content

\end{document}

0 Answers0