I am trying to accomplish something like in this question and this question.
I have several authors contributing solutions to problems that are numbered using an externally imposed scheme, which I handle via the description
environment. I wrap each author's name in \index{}
and need the printed index to display the problem number as it appears in the external scheme. Right now I'm using the report document class, but could be persuaded to change.
I picked up a way to capture the external numbering using a modified \ref{}
command from here, but have not been able to get the index to display other than just the counter value.
For example:
\documentclass{report}
\usepackage{makeidx}
\makeindex
\usepackage{hyperref}
\newcounter{desccount}
\newcommand{\descitem}[1]{%
\item[#1] \refstepcounter{desccount}\label{#1}
}
\newcommand{\descref}[1]{\hyperref[#1]{#1}}
\begin{document}
\begin{description}
\descitem{1B.1} by \index{Smith}
\descitem{1B.3} by \index{Jones}
\descitem{1C.1} by \index{Smith}
\descitem{1E.11} by \index{Burton}
\end{description}
\printindex
\end{document}
I would like the resulting index of the document to be
Burton 1E.11
Jones 1B.3
Smith 1B.1, 1C.1
with hyperref
filling in the hyperlinks appropriately. The closest I've come is to use the memoir
document class and include a \renewcommand{\index}[1]{\specialindex{\jobname}{desccount}{#1}}
but this simply returns the value of desccount
and not the external numbering scheme. In the example given, the output I would get is
Burton 4
Jones 2
Smith 1, 3
which is not quite what I want. How can I have the index return the argument of \descitem
instead of the page number or the value of desccount
?
glossaries
package.glossaries
package either. I tried using thexindy
option with\GlsAddXdyLocation{descref}
but still only got the results ofdesccount
and not the external numbering system. Do you have any specific feedback on what to do with theglossaries
package in this case?