2

What I want to achieve is not so simple but I'll try my best to make myself clear. I have the following document:

\documentclass{article}

\usepackage{lipsum}
\usepackage{xcolor}
\usepackage{makeidx}
\makeindex

\begin{document}
\section*{List}
The index \texttt{testindex} appears in these locations: \printindex

\section{First}
\textcolor{red}{The index does not appear here.}
\clearpage

\subsection{First.First}
\textcolor{green}{The index appears here.\index{testindex}}
\clearpage

\section{Second}
\textcolor{red}{The index does not appear here.}
\clearpage

\subsection{Second.First}
\textcolor{red}{The index does not appear here.}
\clearpage

\subsubsection{Second.First.First}
\textcolor{green}{The index appears here.\index{testindex}}
\clearpage

\section{Third}
\textcolor{green}{The index appears here.\index{testindex}}
\clearpage

\end{document}

The \printindex command produces this output:

Index

What I want is a comma-separated list of the sections/subsections/subsubsections (whatever is more specific) of all occurrences and I want all of these values to be links to the specified locations, i.e. when I click on 1.1 that the document will jump to First.First. I generated the desired output (without the link behaviour) for a better understanding: Desired output

Can anyone help me?

cmhughes
  • 100,947
L. Scheuvens
  • 169
  • 1
  • 7

0 Answers0