Problems between acronym and Hyperref

Maxime U. Garcia 2013-05-06
less than 1 minute read

Normally, when you want to use an acronym in a title, you’re supposed to force the use of the short or the long version of the acronym, otherwise, when the Table of Contents is built, it will be the first appearance of your acronym, and you’ll have problem with your ToC.

In one of my section title, I used \acl{} to get the long version of my acronym in the title, but Hyperref (which is used to build the PDF bookmarks) thinks there is a problem with that, so I get this error:

Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):

To prevent that, you should use \texorpdfstring{}{} Between the first brackets, you put your acronym, in the second what should be written by Hyperref in the PDF bookmarks.

Finally it’s almost a completely useless solution, it’s easier to write the content without acronym in the first place, but this problem will happen with math symbols, so the trick could be interesting to know.

Your email address will not be published