2

I'm trying to place an image as a border in the footer (footline) of a beamer presentation. I've noticed that if I use \setbeamertemplate{footline}[large] after the \begin{document}, the vertical placement is too low to show the image. If I use it before \begin{document}, then it gets placed correctly. In the final presentation, some slides (such as the title slide) will have this, but more will not, which is why I don't want to set it globally above \begin{document} and then suppress it on the slides which don't have it.

What I'm trying to do would look like:

\defbeamertheme{footline}{large}{
      \leavevmode
      \includegraphics[width=\paperwidth]{images/banner.pdf}
      \begin{tikzpicture}[overlay]
          \node at (-.845\paperwidth,.05\paperheight) {
          \includegraphics[width=.15\paperwidth]{images/logo.png}
          };
      \end{tikzpicture}
 }

 \begin{document}
 {\setbeamertemplate{footline}[large]
     \begin{frame}
         \titlepage
     \end{frame}
 }
 \begin{frame}{Frame without footline}
     Text
 \end{frame}
 \end{document}
2

You can solve it by recalculating head and foot dimension by \beamer@calculateheadfoot.

\documentclass[demo]{beamer}
\usepackage{tikz}
\title{Here is the Title}
\author{Author}
\date{\today}
\defbeamertemplate{footline}{large}{
      \leavevmode
      \includegraphics[width=\paperwidth]{images/banner.pdf}
      \begin{tikzpicture}[overlay]
          \node at (-.845\paperwidth,.05\paperheight) {
          \includegraphics[width=.15\paperwidth]{images/logo.png}
          };
      \end{tikzpicture}
}
\newcommand*{\resetsize}{\csname beamer@calculateheadfoot\endcsname}
\newcommand*{\enablefoot}{%
  \setbeamertemplate{footline}[large]
  \resetsize
}
\newcommand*{\disablefoot}{%
  \setbeamertemplate{footline}{}
  \resetsize
}
\begin{document}
\enablefoot
\begin{frame}
  \titlepage
\end{frame}
\disablefoot
\begin{frame}{Frame without footline}
  Text
\end{frame}
\end{document}

Remarks:

  • I used \csname beamer@calculateheadfoot\endcsname because this definition would cause an error:

    \newcommand*{\resetsize}{%
      \makeatletter
      \beamer@calculateheadfoot
      \makeatother}
    
  • I defined switches instead of using grouping by braces, because in my test document this method produced an additional empty frame.

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.