3

When using the ltxdoc document class, index entries are misformatted, looking like this:

foomacro= \subitem *+\foomacro+, \usage{1}

rather than… however they’re supposed to look.

This sounds like a weird system-dependent thing, so here’s my distribution information:

  • ltxdoc.cls at version 2018/03/15 v2.0x
  • ltxbase package (including ltxdoc.cls) packaged 2018-05-29
  • Up-to-date packages as of 2018-10-25
  • MiKTeX 2.9.6840 64-bit
  • Windows 10

MWE

\documentclass{ltxdoc}
\PageIndex
\begin{document}
\DescribeMacro{foomacro}
Some description here\dots
\PrintIndex
\end{document}

Generated files

bad-index.idx:

\indexentry{foomacro=\verb!*+\foomacro+|usage}{1}

bad-index.ilg:

This is makeindex, version 2.15 [MiKTeX 2.9.6800 64-bit] (kpathsea + Thai support).
Scanning input file extra\bad-index.idx....done (1 entries accepted, 0 rejected).
Sorting entries...done (0 comparisons).
Generating output file extra\bad-index.ind....done (6 lines written, 0 warnings).
Output written in extra\bad-index.ind.
Transcript written in extra\bad-index.ilg.

bad-index.ind:

\begin{theindex}

  \item foomacro=\verb
    \subitem *+\foomacro+, \usage{1}

\end{theindex}

Screenshot:

Screenshot of garbled index

9999years
  • 433
  • 2
  • 12

1 Answers1

4

With things like the doc-package or the ltxdoc-class you need to call the makeindex-program

  • with the style-file gind.ist for creating the index,
  • with the style-file gglo.ist for creating the change-history.

I.e., if the following is saved as test.tex:

\documentclass{ltxdoc}
\PageIndex
\begin{document}
\DescribeMacro{foomacro}
Some description here\dots
\PrintIndex
\end{document}

, then for creating the index you need to invoke makeindex as follows:

makeindex -s gind.ist -o test.ind test.idx

, and for creating the change-history you need to invoke makeindex as follows:

makeindex -s gglo.ist -o test.gls test.glo

So the entire command-sequence is something like:

pdflatex test.tex
makeindex -s gind.ist -o test.ind test.idx
makeindex -s gglo.ist -o test.gls test.glo

(Repeat this command-sequence until all references etc match out correctly and the .log-file test.log does not contain warnings any more about the need of running LaTeX again.)

Ulrich Diez
  • 28,770