# Removing footnotes from pdf bookmarks

I have

   \section{My Title\footnote{ My Footnote 1}\footnote{My Footnote 2}}


. Both pdfLatex and Latex automatically creates bookmarks from my section headers. That's what I want. But they also include the footnotes. So an example of bookmark is

   "My Title My foootnote 1 My Footnote 2"


. But I want only

   "My Title"


How do I achieve this?

-

You can easily use the optional argument of \section for a different title text in the TOC and in bookmarks:

\section[My Title]{My Title\footnote{ My Footnote 1}\footnote{My Footnote 2}}

-
 the problem here is a general one for \footnote in a moving argument; see the uk faq for solutions – wasteofspace Mar 6 at 10:09

Assuming your using hyperref you can disable the \footnote command for all pdf-strings by adding the following to your preabmle:

\pdfstringdefDisableCommands{%
\def\footnote#1{}%
}


Complete example:

\documentclass{article}

% \footnote is a fragile command so can cause troubles in moving
% arguments like in \section. Let's make it robust:
\usepackage{etoolbox}
\robustify{\footnote}

% load hyperref and disable the \footnote command in bookmarks:
\usepackage{hyperref}
\pdfstringdefDisableCommands{%
\def\footnote#1{}%
}
\begin{document}

\section{My Title\footnote{ My Footnote 1}\footnote{My Footnote 2}}

\end{document}

-

Another possibility is to use the macro \texorpdfstring from the package hyperref.

This macro switch the text used in the bookmarks of the PDF file.

\texorpdfstring{text that will appear in the document}{text used in the bookmark}

-