On Mon, Jan 20, 2025 at 07:28:00AM +0000, Werner LEMBERG wrote: > Perhaps an additional auxiliary file will do? All entries in the > `.toc` file could contain a hook; if this hook is undefined, nothing > happens. The other file could then properly define the very hook that > is to be used to insert the necessary data.
It would probably work, but I don't think it is worth the complication. I have committed changes to add an entry for the table of contents, but not the short table of contents. (It's probably the former people want, anyway, and more would clutter the outline. I figured the PDF outline pane itself in a PDF viewer is about as useful as the short table of contents, whereas the full table of contents allows people to browse the contents in a more luxurious allowance of screen space.) I have tested this with etex, pdftex, luatex and xetex. The "table of contents" string is also translated in the outline. Depending on the language and the translation, non-ASCII characters may be used to display the string (with Polish ("Spis treści"), Hungarian ("Tartalomjegyzék") and Finnish ("Sisällysluettelo")) as I have recently made changes to use UTF-16 (an encoding used by the PDF format for some strings) in PDF outlines if required. (The PDF outlines only contain the Unicode characters if UTF-8 was used in the Texinfo source for the characters, and not compositions with TeX accents.) Please let me know if it works okay.