I would like to create an index that refers to theorem numbers instead of the page numbers.
The following example creates the usual index with page numbers:
\documentclass[ngerman, 12pt]{article}
\usepackage{makeidx}
\makeindex
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}
This theorem is about apples \index{apple} and bananas\index{banana}.
\end{theorem}
\begin{theorem}
This theorem is about apples \index{apple} and pies\index{pie}.
\end{theorem}
\newpage
\begin{theorem}
This theorem is about bananas\index{banana}.
\end{theorem}
\printindex
\end{document}
The result looks like this:
Index
apple, 1
banana, 1, 2
pie, 1
However, I would need the theorem numbers in the index instead, i.e.
Index
apple, 1, 2
banana, 1, 3
pie, 2
Has anyone an idea how to do this? Thank you very much for your support!