Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
Hyperref warning - Token not allowed in a PDF string

The following code:

\subsection{The classes $\mathcal{L}(\gamma)$}

generates the errors:

Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref)                removing `math shift' on input line 1938.


Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref)                removing `\gamma' on input line 1938.


Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref)                removing `math shift' on input line 1938.

What do I have to do to keep \gamma in the subsection, so that it is also listed in the table of contents?

share|improve this question

marked as duplicate by Werner, Jake, Gonzalo Medina, Mico, Thorsten Apr 27 '12 at 5:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

up vote 46 down vote accepted

The PDF bookmarks are a different thing than the table of contents. The bookmarks are not typeset by TeX: they simply are strings of characters, so no math or general formatting instructions are allowed.

The easiest method to avoid the warnings is to use \texorpdfstring:

\subsection{The classes \texorpdfstring{$\mathcal{L}(\gamma)$}{Lg}}

where in the second argument you put the best approximation possible; after all the bookmarks are only a guide for consulting the document.

share|improve this answer
2  
Ahh, I see, those are PDF bookmarks, thanks! –  Chris Apr 26 '12 at 23:14
    
Thanks for answering this, even though the question was a duplicate: I couldn't tell if maths mode in section titles would work the same as in the other answers to this problem. –  David Roberts May 7 at 0:39

Not the answer you're looking for? Browse other questions tagged or ask your own question.