5

I created a simple latex beamer document shown below:

\documentclass{beamer}

\usepackage{default}

\begin{document}

\begin{frame}[allowframebreaks]\frametitle{Pages}
    \begin{itemize}
        \item First page\footnote{some text}
    \end{itemize}
\newpage
    \begin{itemize}
        \item next page
    \end{itemize}
\end{frame}
\end{document}

It uses a frame with the attribute allowframebreaks. There is a footnote on the first page, but it is printed on the last page of the frame sequence. I know that this is the specified target behaviour, but is it possible to change this? I would like to have the footnote on the same slide where it is supposed to be.

Thank You.

  • Just put the text in two frames. – Seamus Sep 16 '15 at 10:43
  • @Seamus Sure - thats the easiest way, but I would like to use the allowframebreaks attribute – thardes2 Sep 16 '15 at 11:22
5

The procedure of Beamer dealing with allowframebreaks is as follows

  • collect all materials on the page (including footnotes);
  • typeset materials and put them into a \vbox called \beamer@framebox;
    • at the same time, footnotes is put into a box called \beamer@footins;
  • if \beamer@framebox is less than one page, shipout this box;
    • if not, \vsplit the box and shipout one page;
    • loop until \beamer@framebox is empty;
  • attach \beamer@footins at the last page.

The lesson we learn from the preceding procedure is that we do not know which footnoteitem belongs which page. So we have three choices

  • put all footnote on the last page; this is the default behavior;
  • put all footnote on the first page; this is stupid;
  • put all footnote on every page; this is worth a try.

The following is the original definition

\def\beamer@autobreakframebox{%
  \global\setbox\beamer@splitbox=\box\voidb@x%
  \ifbeamer@autobreak%
    % Ok, frame was overful -> split it!
    \setbox\@tempboxa=\vsplit\beamer@framebox to\beamer@autobreakfactor\textheight%
    \global\setbox\beamer@splitbox=\box\beamer@framebox%
    \@tempdima=\ht\beamer@splitbox%
    \ifdim\@tempdima<\beamer@autobreaklastheight%
      \global\beamer@autobreaklastheight=\@tempdima\relax%
    \else%
      \setbox\@tempboxa=\vbox{\unvbox\@tempboxa\unvbox\beamer@splitbox}%
      \global\setbox\beamer@splitbox=\box\voidb@x%
    \fi%
    \setbox\beamer@framebox=\vbox to\textheight{\unvbox\@tempboxa%
      \vskip\beamer@framebottomskipautobreak%
      \ifvoid\beamer@splitbox%
        \ifvoid\beamer@footins%
        \else%
          \begingroup
            \usebeamercolor*[fg]{footnote}%
            \footnoterule%
            \unvbox \beamer@footins%
            \global\setbox\beamer@footins=\box\voidb@x%
          \endgroup  
        \fi%
      \fi%
      \beamer@exitcode%
    }%
  \else%
    \setbox\beamer@framebox=\vbox to\textheight{\unvbox\beamer@framebox%
      \vskip\beamer@framebottomskip%
      \ifvoid\beamer@footins%
      \else%
        \begingroup
          \usebeamercolor*[fg]{footnote}%
          \footnoterule%
          \unvbox \beamer@footins%
          \global\setbox\beamer@footins=\box\voidb@x%
        \endgroup 
      \fi%
      \beamer@exitcode}%
    \global\setbox\beamer@footins=\box\voidb@x%
  \fi%
  }

And we can modify the footnote part as follows

\def\beamer@autobreakframebox{%
  \global\setbox\beamer@splitbox=\box\voidb@x%
  \ifbeamer@autobreak%
    % Ok, frame was overful -> split it!
    \setbox\@tempboxa=\vsplit\beamer@framebox to\beamer@autobreakfactor\textheight%
    \global\setbox\beamer@splitbox=\box\beamer@framebox%
    \@tempdima=\ht\beamer@splitbox%
    \ifdim\@tempdima<\beamer@autobreaklastheight%
      \global\beamer@autobreaklastheight=\@tempdima\relax%
    \else%
      \setbox\@tempboxa=\vbox{\unvbox\@tempboxa\unvbox\beamer@splitbox}%
      \global\setbox\beamer@splitbox=\box\voidb@x%
    \fi%
    \setbox\beamer@framebox=\vbox to\textheight{\unvbox\@tempboxa%
      \vskip\beamer@framebottomskipautobreak%
      \ifvoid\beamer@footins%                          MODIFIED
      \else%                                           MODIFIED
        \begingroup%                                   MODIFIED
          \usebeamercolor*[fg]{footnote}%              MODIFIED
          \footnoterule%                               MODIFIED
          \unvcopy \beamer@footins%                    MODIFIED
        \endgroup%                                     MODIFIED
      \fi%                                             MODIFIED
      \ifvoid\beamer@splitbox%                         MODIFIED
          \global\setbox\beamer@footins=\box\voidb@x%  MODIFIED
      \fi%                                             MODIFIED
      \beamer@exitcode%
    }%
  \else%
    \setbox\beamer@framebox=\vbox to\textheight{\unvbox\beamer@framebox%
      \vskip\beamer@framebottomskip%
      \ifvoid\beamer@footins%
      \else%
        \begingroup
          \usebeamercolor*[fg]{footnote}%
          \footnoterule%
          \unvbox \beamer@footins%
          \global\setbox\beamer@footins=\box\voidb@x%
        \endgroup 
      \fi%
      \beamer@exitcode}%
    \global\setbox\beamer@footins=\box\voidb@x%
  \fi%
  }

Then we achieve the following

PS. the strange/scary jumping phenomenon is discussed here: beamer: allowframebreaks option and vertical spacing when using lists (itemize, enumerate, ...)

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.