josephwright / beamer

A LaTeX class for producing presentations and slides
Other
1.35k stars 139 forks source link

calculate the head/footheight at the start of each frame instead of only at the start of the document #845

Closed samcarter closed 1 year ago

samcarter commented 1 year ago

Currently beamer calculates the head/footheight at the start of the document. This makes it complicate to change the height of these elements during the presentation (e.g. if title/section pages should have a taller headline).

One could avoid this problem by calculating head/footheight at the start of each frame.

The disadvantage of this approach is performance. For example a test document with about 100 frames takes

Test document:

\documentclass{beamer}

\usepackage{pgffor}

\usetheme{Warsaw}

\begin{document}

\section{title} 
\begin{frame}
\frametitle{title}
    abc
\end{frame} 

\section{Annexes}   
\setbeamertemplate{headline}{}
\begin{frame}
\frametitle{title}
    abc
\end{frame} 

\foreach \macro in {0,...,100}{
\begin{frame}
    abc
\end{frame} 
}
\end{document}
josephwright commented 1 year ago

Looks reasonable to me: a one-off calc is likely to be premature optimisation

samcarter commented 1 year ago

@josephwright Thanks for having a look!