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


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.
    – daleif
    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)
    – daleif
    Jan 17, 2022 at 14:35
  • 1
    @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
    – daleif
    Jan 17, 2022 at 15:13

1 Answer 1


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 ?
    – 3isenHeim
    Dec 2, 2022 at 7:46

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.