我想要实现的目标并不是那么简单,但我会尽力让自己清楚。我有以下文件:
\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}
\printindex 命令产生以下输出:
我想要的是所有出现的节/子节/子子节(无论更具体)的逗号分隔列表,并且我希望所有这些值都是指向指定位置的链接,即当我单击 1.1 时,文档将跳转到 First.First。为了更好地理解,我生成了所需的输出(没有链接行为):
谁能帮我?