I have very often met the Package hyperref Warning: Token not allowed in a PDF string. Being fed up about it and curious to know what it meant, I was about to ask the n-th duplicate of that questions. Fortunately I bumped into this question just in time and solved the problem. Another question was naturally opened in the process: what are these pdf bookmarks, what is their use, and how do I make them appear in the pdf? And since I had a \cdot in a section title, is it possible to have a high dot in a bookmark, as \texttwosuperior seems to make it possible for a 2?
Asked
Active
Viewed 1,413 times
7
1 Answers
5
Examples, how to generate the dots (middle and above):
\documentclass{article}
\usepackage[
pdfencoding=auto, % or option "unicode"
psdextra, % additional math macros are supported in bookmarks
]{hyperref}[2012/08/13]% psdextra is a quite new feature
\usepackage{bookmark}% recommended
\begin{document}
\section{middle dot: $\cdot$}
\section{U+00B7: \texorpdfstring{$\cdot$}{\unichar{"00B7}}}
\section{dot above: \texorpdfstring{\.{}}{\textdotaccent}}
\section{U+02D9: \texorpdfstring{\.{}}{\unichar{"02D9}}}
\end{document}
The first \section generates warnings because of $ characters:
Package hyperref Warning: Token not allowed in a PDF string (Unicode):
(hyperref) removing `math shift' on input line 10.
Either they can be ignored or they can be avoided by:
\section{middle dot: \ensuremath{\cdot}}\section{middle dot: \texorpdfstring{$\cdot$}{\cdot}}
Heiko Oberdiek
- 271,626

.pdffile as a piece of paper (or whatever) positioned between pages of a real book: It lets you easily find some portions of content (say a figure,table,chapter, section etc.) from the bookmark view in your reader. You can add basically anywhere a bookmark with a comment like\pdfbookmark... – Apr 22 '14 at 14:39\usepackage[utf8]{inputenc}ORxelatex, you can just place the unicode char for\cdotin the text, which isU+00B7or as a copy-paste template·– Henri Menke Apr 22 '14 at 15:21