# How do I insert text into the footline of a specific slide in Beamer?

I'm trying to insert references into a beamer footline. These references are different for each slide, so I cannot include them in the footline template - unless there is then some way to later define them per-slide.

I have tried to simply include the after a \vfill, but the location of the line then varies with each slide, and this is not what I want.

How do I insert references (or really, just any custom text) into the footline of a specific slide in beamer?

-
That's not really what the footline is for, is it? –  Seamus Nov 16 '10 at 23:55
I've used the term footline to make it easy to understand where I want to place the text, but you could consider the question as simply "How do I place text relative to the bottom of the page in beamer?" –  saffsd Nov 18 '10 at 0:14

This provides a new template/font/color footline extra and a macro \footlineextra to add text to the footline.

\documentclass{beamer}
\author{R.J.~Drofnats}
\institute{University of St. Anford}

\useoutertheme{infolines}% for example, ymmv

\makeatletter
% add a macro that saves its argument
\newcommand{\footlineextra}[1]{\gdef\insertfootlineextra{#1}}
\newbox\footlineextrabox

% add a beamer template that sets the saved argument in a box.
% The * means that the beamer font and color "footline extra" are automatically added.
\defbeamertemplate*{footline extra}{default}{
\begin{beamercolorbox}[ht=2.25ex,dp=1ex,leftskip=\Gm@lmargin]{footline extra}
\insertfootlineextra
%\par\vspace{2.5pt}
\end{beamercolorbox}
}

% set the box with the extra footline material but make it add no vertical space
\setbox\footlineextrabox=\vbox{\usebeamertemplate*{footline extra}}
\vskip -\ht\footlineextrabox
\vskip -\dp\footlineextrabox
\box\footlineextrabox%
}
{}

% patch \begin{frame} to reset the footline extra material
\let\beamer@original@frame=\frame
\def\frame{\gdef\insertfootlineextra{}\beamer@original@frame}
\footlineextra{}
\makeatother

\setbeamercolor{footline extra}{fg=structure.fg}% for instance

\begin{document}

\begin{frame}\maketitle\end{frame}

\begin{frame}{foo}
\begin{itemize}
\item one
\item two
\item three
\end{itemize}
\footlineextra{Source: Mr. Lee'' by the Bobbettes}
\end{frame}

\begin{frame}{bar}
\begin{itemize}
\item Able
\item Baker
\item Charlie
\end{itemize}
\footlineextra{Source: \emph{What do People Do All Day?} by Richard Scarry}
\end{frame}

\begin{frame}{baz}
No footlineextra here
\end{frame}

\end{document}


Having spent an hour on this I must quit but a nice addition would be to make \footlineextra overlay-specification aware.

-
That's perfect! Many many thanks. –  saffsd Nov 19 '10 at 4:27
\defbeamertemplate{footline}{foot1}{<define footer 1 here>}
\defbeamertemplate{footline}{foot2}{<define footer 2 here>}
...


then before each frame

\setbeamertemplate{footline}[<foot name>]

-
Thanks, that seems like a real pain though. Is there any way to set it up so that I have a command to invoke in the frame? A bit like \frametitle{}, maybe something like \footlineextra{}? –  saffsd Nov 18 '10 at 0:13

I do this too, here's my hack that's roughly similar to the tikz approach posted earlier.

\usepackage[absolute,overlay]{textpos}

\setbeamertemplate{footline}{}

\newcommand{\MyfootnoteBlock}[1]{%
\begin{textblock*}{11cm}(1cm,9.1cm)%
#1%
\end{textblock*}%
}

-

Adding an alternative that doesn't use the footline template. This is in response to the comment on my previous answer. (Requires \usepackage{tikz})

\newcommand{\footlineextra}[1]{
\begin{tikzpicture}[remember picture,overlay]
\node[yshift=2ex,anchor=south west] at (current page.south west) {\usebeamerfont{author in head/foot}\hspace{2ex}#1};
\end{tikzpicture}
}

-

i just tried matthews solution with overlays. did anyone work on the overlay question?

in principle onslide etc works but i need to add +1 to the layer number where the footline text should appear. of course i then also get one slide more than i need... what do i do wrong and how can solve that issue?

\documentclass{beamer}

\makeatletter
\newcommand{\footref}[1]{\gdef\insertfootref{#1}}
\let\beamer@original@frame=\frame
\def\frame{\gdef\insertfootref{}\beamer@original@frame}\footref{}
\makeatother
\setbeamertemplate{footline}{\vskip-.5em\ \insertfootref}
\def\testref{Author \textit{Appl. Phys. Lett.} \textbf{XY} (2014) abcd}

\begin{document}

\begin{frame}{onslide2 lets appear ref also on 1st slide}
\footref{\onslide<2>{\testref}}
Test frame \visible<2>{with reference in footline after first overlay}
\end{frame}

\begin{frame}{onslide3 lets appear ref on 2nd and 3rd slide}
\footref{\onslide<3>{\testref}}
Test frame with \visible<2>{reference in footline after first overlay and}\\
a third frame which i do not need...
\end{frame}

\end{document}


ok... got it working. simply adding \only{} while defining the \footref command in the above MWE and then using \footref{\testref}<2> within the frame does the trick.

-
Could you edit the MWE to show where you added the \only{}? –  erik Apr 23 at 21:50