TransWikia.com

Conditional formatting of footline, depending on whether footnotes are present

TeX - LaTeX Asked on December 31, 2020

I know this question has been asked in a similar fashion before, but I have not seen an elegant solution using addtobeamertemplate yet. I am using the beautiful metropolis style, in which the footline contains only the slide number in the very right corner. This leaves a lot of white space at the bottom. For most slides that is fine, but it looks a bit odd if I add the source of a data set into the footnote.

enter image description here

I would like to shift the footnote vertically. If I have a single footnote per slide, this can be accomplished very simply with the code:

addtobeamertemplate{footnote}{}{vskip-7mm}

Of couse it doesn’t work for multiple footnotes on the same slide since the negative space is added for each footnote. I thought it should be simple enough to add negative space to the beginning of the footline template using a global counter that is set to 1, whenever a footnote is added, and then set to 0 at the end of the slide. To my surprise, however, the following did not work:

documentclass{beamer}
usetheme[outer/progressbar=foot]{metropolis}

newcountfootinput
globalfootinput 0relax

addtobeamertemplate{footnote}{}{globalfootinput 1relax}

addtobeamertemplate{footline}{%
ifnumfootinput>0%
  vskip-7mm%
  globalfootinput 0relax%
fi%
}{}

begin{document}

begin{frame}
frametitle{Important Findings}

begin{enumerate}
item Description of data set 1footnote{Source of data set 1}
item Description of data set 2footnote{Source of data set 2}
end{enumerate}
end{frame}

end{document}

What am I missing? The reason why I am surprised is that the footnoterule is essentially defined in the same way in beamerbaseframesize.sty (using boxes instead of a counter).

One Answer

Is this what you're looking for?

documentclass{beamer}
usetheme[outer/progressbar=foot]{metropolis}

newcountfootinput
globalfootinput 0relax

addtobeamertemplate{footnote}{}{globalfootinput 1relax}


setbeamertemplate{footline}{vspace{6.7pt}} 
setbeamertemplate{logo}{%
usebeamercolor[fg]{footline}%  
usebeamerfont{page number in head/foot}%   
vspace{-7pt}   
usebeamertemplate*{frame numbering}hspace{5pt}%
}

begin{document}

begin{frame}
frametitle{Important Findings}

begin{enumerate}
item Description of data set 1footnote{Source of data set 1}
item Description of data set 2%footnote{Source of data set 2}
end{enumerate}
end{frame}

begin{frame}
frametitle{Important Findings}

begin{enumerate}
item Description of data set 1footnote{Source of data set 1}
item Description of data set 2footnote{Source of data set 2}
end{enumerate}
end{frame}

end{document}

beamer footline

Answered by phil-elkabat on December 31, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP