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?
\texorpdfstring{$\mathcal{L}(\gamma)$}{Lg}? they're there around the(\gamma)– barbara beeton Sep 23 '16 at 20:04unicodeoption set forhyperref, allows a closer representation like ℒ(γ) for the pdf table of content.\subsection{The classes \texorpdfstring{$\mathcal{L}(\gamma)$}{ℒ(γ)}}works as expected, at least on my setup. This works even if unicode characters are not accepted in math mode. – Frédéric Grosshans Mar 20 '19 at 17:59\PassOptionsToPackage{unicode}{hyperref}before starting mybeamerdocument --- it should have a Q&A by itself, it's so useful. – Rmano Sep 06 '19 at 13:04\texorpdfstring{$t_2$}{t_2}. I changed it to\texorpdfstring{$t_2$}{t2}which creates no error. – Qbyte Sep 19 '20 at 14:18\texorpdfstring{$t_2$}{t\_2}? – egreg Sep 19 '20 at 16:15\texorpdfstringsome automatic converion seems to happen which is often not good. Some things come out reasonably well in plain text. Other expressions just disappear as apparently there was no good default plaintext alternative. – Marten Sep 23 '21 at 17:26