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.

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?

share|improve this question

3 Answers 3

up vote 3 down vote accepted

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}}
share|improve this answer
1  
the problem here is a general one for \footnote in a moving argument; see the uk faq for solutions –  wasteofspace Mar 6 '13 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}
share|improve this answer
    
The footnote should also be avoided in table of contentes and headers. –  Leo Liu Oct 11 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 Oct 11 at 13:24

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}
share|improve this answer

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.