Process index of l3doc file / of .dtx file

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.

• You'll probably need a specific .ist file for the kernel .dtx files. Jan 17, 2022 at 14:31
• And you do: makeindex -s gind.ist l3prop.idx then it compiles as it should (I looked in the manual for ltxdoc which is probably the predecessor of l3doc) Jan 17, 2022 at 14:35
• @daleif thanks for pointing out the mistake, I corrected the question Jan 17, 2022 at 14:35
• Yes, this works. Thanks Jan 17, 2022 at 14:40
• Now a days you just run TeX on it tex l3doc.dtx. But it depends on the setup, some still come with a .dtx and a .ins and running LaTeX on the .ins produces the .sty or .cls Jan 17, 2022 at 15:13

1 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
`
• How can I register this as a compile command in TeXstudio ? Dec 2, 2022 at 7:46