# Hyperref warning which doesn't affect the output of the PDF

I have encountered a hyperref warning but there are no visible negative consequences. Additionally, LaTeX complete without a complaint. I only found the warning by looking at the .log file.

Package hyperref Warning: Difference (2) between bookmark levels is greater
(hyperref)                than one, level fixed on input line 2366.


and

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


and

Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref)                removing superscript' on input line 2200.


Does anyone know what this means?

Those lines don't correspond to references either.

-

Package hyperref Warning: Difference (2) between bookmark levels is greater
(hyperref)                than one, level fixed on input line 2366.


The first warning can be caused by missing section levels. For example, a \subsubsection following a \section. If this is intentional, then I recommend package bookmark. It implements the bookmark managing in a robuster way that can deal with missing section levels. It is loaded after package hyperref:

\usepackage{hyperref}
\usepackage{bookmark}


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


This means, you have $ in the bookmark. Math is typeset by TeX that is not available by PDF viewers. If the bookmark title is ok, then you can ignore the warning. Otherwise an alternative string representation for the bookmark title can be given by \texorpdfstring: \texorpdfstring{$E=mc^2\$}{E=mc\texttwosuperior}


For larger support of math symbols I recommend Unicode encoding for bookmark titles, set by option unicode or pdfencoding=auto, and the new option psdextra:

\usepackage[pdfencoding=auto,psdextra]{hyperref}

-
I added \usepackage{bookmark} and the options to hyperref. I now have an option clash with hypcap. In my preamble, I have hyperref then hypcap with the option all. –  dustin Jun 14 '13 at 0:10
Load package bookmark after hyperref, because bookmark requires hyperref and loads it without options. This causes an option clash, if hyperref` is loaded later with options. –  Heiko Oberdiek Jun 14 '13 at 0:18
–  Werner Jun 14 '13 at 0:26