24

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?

2
  • 2
    That's not really what the footline is for, is it?
    – Seamus
    Commented Nov 16, 2010 at 23:55
  • 1
    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
    Commented Nov 18, 2010 at 0:14

4 Answers 4

18

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

\documentclass{beamer}    
\title{Adding extra text to footline}
\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}
}

\addtobeamertemplate{footline}{%
    % 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.

1
  • If you give the footline a background color by adding bg=blue, for example, to setbeamercolor{footline extra}, then you'll get a blue footline on every page, even when the footline has no content. I want the background to appear only when the footline has content, so I have added bg=\footlinebgcolor to setbeamercolor{footline extra}, \gdef\footlinebgcolor{blue} to the argument of \newcommand{\footlineextra}[1], and \gdef\footlinebgcolor{white} to the argument of \def\frame. That works, although I don't know whether it's really the right way to do it. Commented Jan 11, 2015 at 12:37
6

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}
}
1
  • This is a nice and simple approach. However, it produces an error when the extra text contains a linebreak. I replaced the #1 with \shortstack{#1} and that seems to work around the issue. Not sure if there's a better way.
    – avivr
    Commented Jan 25 at 4:29
2

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*}%
}
1
\defbeamertemplate{footline}{foot1}{<define footer 1 here>}
\defbeamertemplate{footline}{foot2}{<define footer 2 here>}
...

then before each frame

\setbeamertemplate{footline}[<foot name>]
1
  • 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
    Commented Nov 18, 2010 at 0:13

You must log in to answer this question.

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