13

I use footnotes for citations in combination with the beamer package. I adapted the code from this question and everything works quice nicely - except when using overlays. Then the footnotes only show on one slide but are hidden afterwards as shown below.

enter image description here

So my question is: How can I accomplish that the footnotes appear on the same slide as the corresponding item? If that is not possible, the footnotes should at least be visible until the next frame appears.

Here is my MWE:

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage[style=numeric-comp, backend=biber, citetracker=true,sorting=none]{biblatex}
\usepackage{hyperref}

\addbibresource{biblatex-examples.bib}

\makeatletter
\newtoggle{cbx@togcite}
% Citation number in brackets
\renewcommand\@makefntext[1]{%
  \iftoggle{cbx@togcite}
    {{\normalfont[\@thefnmark]}\enspace #1}
    {{\normalfont\@thefnmark}\enspace #1}%
  \global\togglefalse{cbx@togcite}}

\DeclareCiteCommand{\sfcite}[\cbx@superscript]%
  {\usebibmacro{cite:init}%
   \let\multicitedelim=\supercitedelim
   \iffieldundef{prenote}
     {}
     {\BibliographyWarning{Ignoring prenote argument}}%
   \iffieldundef{postnote}
     {}
     {\BibliographyWarning{Ignoring postnote argument}}}
  {\usebibmacro{citeindex}%
   \usebibmacro{sfcite}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}}

\newbibmacro*{sfcite}{%
  \ifciteseen
  {}
  {\xappto\cbx@citehook{%
   \global\toggletrue{cbx@togcite}%
   \noexpand\footnotetext[\thefield{labelnumber}]{%
     \fullcite{\thefield{entrykey}}\addperiod}}}}

\newrobustcmd{\cbx@superscript}[1]{%
  \mkbibsuperscript{\mkbibbrackets{#1}}%
  \cbx@citehook%
  \global\let\cbx@citehook=\empty}

\let\cbx@citehook=\empty
\makeatother

\begin{document}
\begin{frame}
\frametitle{First Frame}
\begin{itemize}[<+->]
  \item First citation. \sfcite{reese} 
  \item Second citation.\sfcite{springer}
\end{itemize}
\end{frame}

\begin{frame}
\frametitle{Second Frame}
Third citation.\sfcite{glashow}
\end{frame}

\end{document}
2
  • It's not really a solution but if you add \only<2>{\sfcite{springer}} to the second \item you get at least the footnotes on the right slide.
    – Thorsten
    Commented Feb 22, 2012 at 17:28
  • @Thorsten, youre right and adding \only<2->{\sfcite{springer}} would be a workaround for more than 2 items.
    – maetra
    Commented Feb 22, 2012 at 17:44

2 Answers 2

8

The first slide has both footnotes instead of just the first one. This is less than ideal, but expected - you'll get the same result with \footfullcite.

On the second slide the citation commands are issued once more. The footnotes "disappear" because \ifciteseen returns true. Again this isn't what you want, but the result isn't surprising. The citation command can be modified to set a footnote for a given entry whenever \ifciteseen is false or its last footnote appeared on a previous overlay. The latter case is detected by equal frame numbers but different pages.

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage[style=numeric-comp,citetracker=true,sorting=none,backend=biber]{biblatex}
\usepackage{hyperref}

\addbibresource{biblatex-examples.bib}

\makeatletter
\newtoggle{cbx@togcite}
% Citation number in brackets
\renewcommand\@makefntext[1]{%
  \iftoggle{cbx@togcite}
    {{\normalfont[\@thefnmark]}\enspace #1}
    {{\normalfont\@thefnmark}\enspace #1}%
  \global\togglefalse{cbx@togcite}}

\DeclareCiteCommand{\sfcite}[\cbx@superscript]%
  {\usebibmacro{cite:init}%
   \let\multicitedelim=\supercitedelim
   \iffieldundef{prenote}
     {}
     {\BibliographyWarning{Ignoring prenote argument}}%
   \iffieldundef{postnote}
     {}
     {\BibliographyWarning{Ignoring postnote argument}}}
  {\usebibmacro{citeindex}%
   \ifciteseen
     {\ifnumequal{\value{page}}{\csuse{cbx@page@\thefield{entrykey}}}
       {}
       {\ifnumequal{\value{framenumber}}{\csuse{cbx@frame@\thefield{entrykey}}}
          {\usebibmacro{sfcite}}
          {}}}
     {\usebibmacro{sfcite}}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}}

\newbibmacro*{sfcite}{%
  \csnumgdef{cbx@page@\thefield{entrykey}}{\value{page}}%
  \csnumgdef{cbx@frame@\thefield{entrykey}}{\value{framenumber}}%
  \xappto\cbx@citehook{%
    \global\toggletrue{cbx@togcite}%
    \noexpand\footnotetext[\thefield{labelnumber}]{%
      \fullcite{\thefield{entrykey}}\addperiod}}}

\newrobustcmd{\cbx@superscript}[1]{%
  \mkbibsuperscript{\mkbibbrackets{#1}}%
  \cbx@citehook%
  \global\let\cbx@citehook=\empty}

\let\cbx@citehook=\empty
\makeatother

\begin{document}
\begin{frame}[b]
\frametitle{First Frame}
\begin{itemize}[<+->]
  \item First citation.\sfcite{reese} Recurrent citation.\sfcite{reese}
  \item Second citation.\sfcite{springer}
  \item Recurrent citation.\sfcite{springer}
\end{itemize}
\end{frame}

\begin{frame}[b]
\frametitle{Second Frame}
\begin{itemize}[<+->]
  \item Third citation.\sfcite{glashow}
  \item Recurrent citation.\sfcite{reese,springer,glashow}
\end{itemize}
\end{frame}

\begin{frame}[b]
\frametitle{Third Frame}
\begin{itemize}
  \item Recurrent citation.\sfcite{glashow}
  \item Recurrent citation.\sfcite{reese,springer,glashow}
\end{itemize}
\end{frame}

\end{document}

Here are the footnotes on the last slide from the first frame:

enter image description here

And the last slide of the second frame:

enter image description here

2

I had a similar issue that was solved in the following manner.

The citations disappear because each overlay is a new citation of the same cite, so, beamer is not the problem, indeed biblatex is. You have to check, for your special style (numeric-comp), how biblatex writes a new entry of a cited cite (i.e. ídem, ibidem, nothing, just a number). I use verbose style, so in the first citation biblatex writes the complete citation and uses the shorthand on the following. That's why changing citation to full instead of use of shorthand solve my problem. This last issue was solved using xpatch package.

In my case, preamble looks like:

\usepackage[style=verbose,autocite=footnote,notetype=footonly,babel=hyphen,backend=bibtex8]{biblatex}
\addbibresource{bibliography.bib}

\usepackage{xpatch}
\xpatchbibmacro{cite}{cite:short}{cite:full}{}{} 

\setbeamertemplate{footnote}{%
  \tiny%
  \parindent 1em\noindent%
  \raggedright
  \hbox to 1.8em{\hfil\insertfootnotemark}\insertfootnotetext\par%
}
\setlength\footnotesep{0pt}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .