2

I want to use multiple indexes in ltxdoc. But if I use the package imakeidx my defined "General Index" disappears and I get the standard "Index". Without imakeidx I do get what I want.

Is this a bug or a feature? Is there a workaround?

\documentclass{ltxdoc}
\usepackage{imakeidx}
\CodelineIndex\EnableCrossrefs

\begin{document}
\DescribeMacro{\mymacro}
\IndexPrologue{\section*{General Index}}
\PrintIndex
\end{document}
3

The imakeidx package changes the internals of index processing and printing.

First, use \indexsetup instead of \IndexPrologue and apply the \makeindex[options=-s gind.ist,title={General index}] for the general index.

For other indexes apply \makeindex[name=foo,...] where ... stands for other options, eventually.

Say \printindex for the default index and \printindex[foo] etc. for other indexes

\documentclass{ltxdoc}
\usepackage{imakeidx}
\CodelineIndex\EnableCrossrefs

\indexsetup{level=\section*}

\makeindex[name=other]
\makeindex[options=-s gind.ist,title={General Index}]

\begin{document}
\DescribeMacro{\mymacro}\index{mymacro}\index[other]{otherindexentry}
\printindex
\printindex[other]
\end{document}

enter image description here

  • Dear Christian, I don't understand why my example that shows the problem when I use your suggestion in my real .dtx file is deleted. Of course your example works, I just don't get it to work in the package I am writing. Isn't there anything in my 2nd M_not_WE that you can assist to find a working solution? Or stated otherwise: I really need some help! – Jack Feb 1 '18 at 19:36
  • @Jack: As your other question shows you have a totally different setup to this what you posted here. How should I know about those issues? I provided a working solution for your posted document. – user31729 Feb 3 '18 at 18:28
  • Well I suppose that's the price one pays for making a too minimal WE. As you might have noticed, I rephrased and reposted the question and I am checking that solution now. Regards – Jack Feb 4 '18 at 9:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.