Post Format

Empty Index Entries in Texinfo

Working on a book formatted with GNU Texinfo, I ran into a mysterious error when processing the Texinfo source through TeX (via texi2pdf):

(Variable Index) [145] (Concept Index) [146] (./c.cps
./c.cps:1: Extra }, or forgotten \endgroup.
l.1 , 145}

I saw no related error or warning out of Makeinfo, and TeX was unhelpfully not saying anything about which Texinfo source line the error was coming from. Other clues suggested that the error has to do with indexing, and that it has to do with an index entry pointing to page 145 or maybe 146.

Looking at the PDF output, I backtracked to the relevant portion of the Texinfo source, and saw something like this:

@cindex function pointers
@cindex

A normal-looking index entry followed by an empty index entry! I removed the empty index entry and reran TeX; all was fine.

Evidently empty index entries are not handled well in Texinfo or texi2pdf or TeX or wherever the actual failing is coming from. A more helpful error message would be nice, but in the meantime, remember to avoid blank index entries!

Leave a Reply

Required fields are marked *.