0

So, I am using the beamer-theme metropolis (if that matters), that has only the slide number in the footer by default. I added the author with the following:

\usetheme{metropolis}
\setbeamertemplate{frame footer}{\insertshortauthor~(\insertshortinstitute)}

Additionally, I would like to add the source of the data that I am showing on the slides. Currently I am working with this solution (Best way to give sources of images used in a beamer presentation):

\newcommand{\source}[1]{\begin{textblock*}{4cm}(8.7cm,8.6cm)
\begin{beamercolorbox}[ht=0.5cm,right]{framesource}
    \usebeamerfont{framesource}\usebeamercolor[fg]{framesource} Source: {#1}
\end{beamercolorbox}
\end{textblock*}}

It's quite nice, but I'd like the source to appear in the footer. A work-around could be to change \setbeamertemplate{frame footer}{...} on every page as suggested here: https://stackoverflow.com/questions/3103989/how-do-i-change-the-footer-footline-of-a-single-frame-in-beamer

{ % these braces make the change local to the single frame
    \setbeamertemplate{footline}{boo \insertframenumber}
    \begin{frame}[t]{Frame 2}
        B
    \end{frame}
}

But I would like to have a command like \source{} that I can add within a frame and that adds the text to the footer. Anyone knows a solution?

Here is a full MWE with the default theme:

\documentclass{beamer}

\usetheme{default}
\beamertemplatenavigationsymbolsempty
\author{Jane Doe}

\usepackage[absolute,overlay]{textpos}
\setbeamercolor{framesource}{fg=gray}
\setbeamerfont{framesource}{size=\tiny}

%Standard footer definition:
\setbeamertemplate{footline}[text line]{%
  \parbox{\linewidth}{\vspace*{-8pt}some text\hfill\insertshortauthor\hfill\insertpagenumber}}

%Source definition
\newcommand{\source}[1]{\begin{textblock*}{4cm}(8.7cm,8.6cm)
\begin{beamercolorbox}[ht=0.5cm,right]{framesource}
\usebeamerfont{framesource}\usebeamercolor[fg]{framesource} Source: {#1}
\end{beamercolorbox}
\end{textblock*}}

\begin{document}

\begin{frame}{Standard frame}
  Test  
\end{frame}

\begin{frame}{Frame with source}
  Test  
  \source{Jane et. al (2019)}
\end{frame}

{ % these braces make the change local to the single frame
   \setbeamertemplate{footline}[text line]{%
   \parbox{\linewidth}{\vspace*{-8pt}Here I want my data source to appear, but automatically !\hfill\insertshortauthor\hfill\insertpagenumber}}
\begin{frame}{Frame with adjusted footer}
    Test
\end{frame}
}

\end{document}

The last frame is what I want to achieve, but with the code of the frame before.

Felix Phl
  • 285

2 Answers2

3

Instead of modifying the footline for every frame, I would place such information in a footnote. This way you can also use bibliography tools, for example \footcite from biblatex to generate the information automatically.

\documentclass{beamer}

\usetheme{moloch}% modern fork of the metropolis theme \author{Jane Doe} \setbeamertemplate{frame footer}{some text\hfill\insertshortauthor} \setbeamertemplate{page number in head/foot}[framenumber] \renewcommand{\footnoterule}{} \setbeamercolor{framesource}{fg=gray} \setbeamerfont{framesource}{size=\tiny}

\defbeamertemplate{footnote}{unnumbered}{% \usebeamercolor[fg]{framesource}% \usebeamerfont{framesource}% \hfill\insertfootnotetext% }

\newcommand{\source}[1]{% \setbeamertemplate{footnote}[unnumbered]% \footnotetext{Source: #1}% }

\begin{document}

\begin{frame}{Standard frame} Test
\end{frame}

\begin{frame}{Frame with source} Test
\source{Jane et. al (2019)} \end{frame}

\end{document}

enter image description here

1

Being inspired by samcarter I found a solution that uses footnotes. It's quite what I was looking for, the only disadvantage is that I have to suppress the navigation symbols on the title and section pages as well as the "outstanding frames" of the metropolis theme, but maybe there are solutions available to suppress them automatically.

\documentclass{beamer}

\usetheme[progressbar=frametitle]{metropolis}
\author{Jane Doe}
\title{Dummy title}

\setbeamertemplate{footline}{}
\setbeamercolor{framesource}{fg=gray}
\setbeamercolor{footnote}{fg=gray}
\setbeamerfont{framesource}{size=\tiny}
\setbeamerfont{footnote}{size=\tiny}
\renewcommand{\footnoterule}{}

%Standard footer definition:
\setbeamertemplate{navigation symbols}{
    \parbox{10cm}{
    \textcolor{gray}{\rule{10cm}{.4pt}}\newline
    \vskip1pt
    \textcolor{gray}{%
        \tiny
        \hfill \insertshortauthor~\vline~\inserttitle~\vline~Folie~\insertframenumber\quad
        }
    \vskip3pt
    }
}

%New command for footnotes without counter
\newcommand\blfootnote[1]{%
  \begingroup
  \renewcommand\thefootnote{}\footnote{#1}%
  \addtocounter{footnote}{-1}%
  \endgroup
}


\begin{document}

\begingroup
\setbeamertemplate{navigation symbols}{}
\maketitle
\endgroup

\begin{frame}{Standard frame}
  Test  \blfootnote{that's pretty much what I am looking for}
\end{frame}

\end{document}

solution

Felix Phl
  • 285