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?

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
    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
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}
  • The footnote should also be avoided in table of contentes and headers. – Leo Liu Oct 11 '14 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 '14 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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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