Latest news 2024-10-15: New blog post: Tales for Our Times Book Launch.

glossaries package FAQ

I get the message “Token not allowed in a PDF string (PDFDocEncoding)” 🔗

Example warning:

Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding): (hyperref) removing `\Glsentrytext'
This is a warning from the hyperref package not an error. As mentioned in Using Glossary Terms Without Links, you can’t use non-expandable commands in PDF bookmarks. The command is ignored (hyperref tells you this in the “removing `\Glsentrytext'” part of the warning) so you end up with just the expandable part (the label) in the bookmark. Remember that, as stated in the user manual, the commands that convert the first letter to upper case are non-expandable and therefore can’t be used in the bookmarks. Use \texorpdfstring to provide alternative text for the bookmark or you can use hyperref’s \pdfstringdefDisableCommands to temporarily disable the command while the bookmark is written. (See the hyperref manual for further details.)

Note that the glossaries-extra package provides commands designed for use within chapter or section headings. (See the section New Commands Designed for Chapter/Section Headings in the user manual.) These commands use \texorpdfstring for the PDF bookmarks (but no case-changing will be applied for the PDF text).

2022-11-02 11:13:28


Permalink: https://www.dickimaw-books.com/faq.php?id=173
Alternative link: https://www.dickimaw-books.com/faq.php?itemlabel=pdfbookmark

Category: glossaries package
Topic: (La)TeX Errors