Process index of l3doc file / of .dtx file

docstripexpl3indexingl3doc

I understand that .dtx files are a way to both document and implement a package in one file together.

Also, in newer versions, usually pdflatex package.dtx should typeset the documentation.

I wanted to try this for some examples to check out such .dtx files, but I am unable to do this properly for the LaTeX3 kernel files.

In particular, getting l3prop.dtx from

https://github.com/latex3/latex3/blob/195f85d5c8df68ca32ac0c7d5559efa27f0fa63d/l3kernel/l3prop.dtx

and running pdflatex on it produces the documentation with missing Index.
So after running makeindex l3prop.idx on the generated aux file as usual, and running pdflatex l3prop.dtx again, I get the error

LaTeX Error: Text for \verb command ended by end of line.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.4     \subitem \verb*&
                        
? 

and in fact the corresponding l3prop.ind contains this code and does not seem to be correct (in fact I cannot find a terminating * in it for the \verb* command).

latexmk l3prop.dtx also does not seem to do the job, it runs into the same error.

I also produced a sample .tex document, just contain a minimal l3doc class as a .tex file, and here also typesetting the index with \PrintIndex goes wrong in the same way, so it seems to have to do with the l3doc class.

So my question would be on how to process this .dtx file – or more general a l3doc document to properly typeset the index as well.

I assume it is just a question of calling the correct index generation programs / script etc that I do not know of.

Best Answer

Whenever a document is written in ltxdoc or the new l3doc the index needs a driver/configuration. If we look in the manual for ltxdoc we see that the following is the normal recommended call to makeindex for this type of documents:

makeindex -s gind.ist file.idx
Related Question