Re: Bug: Latex Footnotes in headers

Jim Ottaway <[email protected]> Tue, 09 May 2006 20:17:07 +0100
Newsgroups gmane.emacs.wiki.general
Message-ID <[email protected]>
>>>>> hornedowl06  <[email protected]> writes:

> Seems there is a bug when trying to get footnotes on headings, following text
> causes error consistently.

> * Testing 
> The following will generate an error in both latex and pdf mode, but will
> work fine in html
> ** watch the footnoteq[1]

> Footnotes: 
> [1]  a footnote in a heading does not work 

That's because in LaTeX, which is used by the pdf mode as well, you
have to protect \footnote commands against their being expanded in
inappropriate places like the table of contents.

The correct code generated from

> ** watch the footnoteq[1]

> Footnotes: 
> [1]  a footnote in a heading does not work 

would be

\subsection{watch the footnote\protect\footnote{a footnote in a
   heading does not work, but a protected one does.}}


that is, with \protect added before the \footnote. It would be
temptingly simple to stick \protect before each and every \footnote,
whether in a section command or not, but this would not be a good
idea.

I wonder how difficult it would be to do this just for sections...

Regards,
-- 
Jim Ottaway