10

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?

3 Answers 3

4

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}}
1
  • 1
    the problem here is a general one for \footnote in a moving argument; see the uk faq for solutions Commented Mar 6, 2013 at 10:09
8

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}
2
  • The footnote should also be avoided in table of contentes and headers.
    – Leo Liu
    Commented Oct 11, 2014 at 6:03
  • @LeoLiu Well, that's rather obvious, isn't it? But there are always people who still want to use them there and TeX.sx is full with questions regarding footnotes is floats, captions, ... BTW: did you downvote this answer? If yes: care to tell why so I'd be able to improve it?
    – cgnieder
    Commented Oct 11, 2014 at 13:24
2

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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .