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.

To use a footnote in a section one has to use the protect keyword to avoid an error... then when using the hyperref package you get another error:

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

With MWE:

\documentclass{book}

\usepackage{hyperref}
\scrollmode


\begin{document}

\chapter{test}
\section{Test Section\protect\footnote{my footnote}}
asdfasdfsadf


\end{document}

Any ideas how to fix this?

share|improve this question
add comment

2 Answers

up vote 10 down vote accepted

One way is to use optional argument for section like:

\section[Test section]{Test Section\footnote{my footnote}}

Then you don't have to protect anything.

share|improve this answer
add comment

Use \texorpdfstring in your section title as follows:

\documentclass{book}

\usepackage{hyperref}
\scrollmode

\begin{document}

\chapter{test}
\section{\texorpdfstring{Test Section\protect\footnote{my footnote}}{Test Section}}
asdfasdfsadf

\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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