8

When adding a footnote to a frame title in Beamer using the code from another question, I get wrong numbering. Here you can see 1 above and 0 below:

Wrong numbers

This is an imaginary example. In reality, I need footnotes to cite the source of the material.

Here is the code:

\documentclass{beamer}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{times}
\usepackage[T1]{fontenc}

% https://tex.stackexchange.com/questions/22323/footnote-in-block-statement
\addtobeamertemplate{footnote}{\vspace{-6pt}}{\vspace{6pt}} 
\makeatletter 
 \renewcommand*{\footnoterule}{\kern -3pt \hrule \@width 2in \kern 8.6pt} 
\makeatother 

\begin{document}
   \begin{frame}{SCLP example\footnotemark}
         \footnotetext{To be continued.}
         An example of a soft constraint logic program.
    \end{frame}
\end{document}

There is a related question "Enumeration of footnotes wrong", but if I add

\addtocounter{footnote}{+1}  

before the text of my footnote, I get wrong enumeration once again: 2 above and 1 below.

On the other hand, I tried to replace numbers with stars in the whole document as described here:

\def\thefootnote{\fnsymbol{ctr}} 

However, pdfLaTeX wouldn't compile this code.

What else can I try?

sdk
  • 1,213

2 Answers2

7

This might form part of how the frame title is set. In fact, looking at your analysis, it is clear that the frame title is set after the frame contents. As such, avoiding insertion of counter-related commands in the title might be a workable quick-fix.

Here I've forced the counter to be incremented (\stepcounter{footnote}) to allow for correct display when using \footnotetext, and only typeset the number in the frame title using \textsuperscript{\thefootnote}:

enter image description here

\documentclass{beamer}% http://ctan.org/pkg/beamer

%\usepackage[english]{babel}
%\usepackage[utf8]{inputenc}
%\usepackage{times}
%\usepackage[T1]{fontenc}

% http://tex.stackexchange.com/questions/22323/footnote-in-block-statement
\addtobeamertemplate{footnote}{\vspace{-6pt}}{\vspace{6pt}} 
\makeatletter 
\renewcommand*{\footnoterule}{\kern -3pt \hrule \@width 2in \kern 8.6pt} 
\makeatother 

\begin{document}
\begin{frame}{SCLP example\textsuperscript{\thefootnote}}
  \stepcounter{footnote}\footnotetext{To be continued.}
  An example of a soft constraint logic program.
\end{frame}
\end{document}
Werner
  • 603,163
6

At least in your example, \footnote works inside the frame title.

\documentclass{beamer}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{times}
\usepackage[T1]{fontenc}

% http://tex.stackexchange.com/questions/22323/footnote-in-block-statement
\addtobeamertemplate{footnote}{\vspace{-6pt}}{\vspace{6pt}} 
\makeatletter 
 \renewcommand*{\footnoterule}{\kern -3pt \hrule \@width 2in \kern 8.6pt} 
\makeatother 

\begin{document}
   \begin{frame}{SCLP example\footnote{To be continued.}}
         An example of a soft constraint logic program.
    \end{frame}
\end{document}

EDIT: In response to your comment: Try to insert the following code snippet in your "full" document:

   \begin{frame}{SCLP example\addtocounter{footnote}{-1}\footnotemark}
         \stepcounter{footnote}\footnotetext{To be continued.}
         An example of a soft constraint logic program.
   \end{frame}
lockstep
  • 250,273
  • Indeed. But in my full document \footnote adds the footnote exactly in the same block with the title and not in the footer. I think, it's style-dependent. – sdk Mar 02 '12 at 20:44