3

I am trying to understand an issue in Beamer that substantially reduces efficiency of using \includeonlyframes for the purpose of improving compilation times: whenever the slide lacks a label, it seems to undergo typesetting, even if its overlay specification is <all:0> or \includeonlyframes is active. On the contrary, if there is a label, the slide is discarded in an efficient manner.

Quoting my MWE from the corresponding issue in the Beamer repo on Github:

\documentclass{beamer}

\begin{document}
\begin{frame}<all:0>[label=SkipMe]
        1111111111111111111111111111111111111111111111111111111111111111
\end{frame}
\begin{frame}<all:0>
        2222222222222222222222222222222222222222222222222222222222222222
\end{frame}
\end{document}

Compiling the above produces one overfull hbox warning, when typesetting the second (unlabeled) slide. The first slide is not typeset at all.

Looking at base/beamerbaseframe.sty, I can (painstakingly) trace the difference to the use of \beamer@donoframe in the unlabeled (slow) case, vs. \beamer@doseveralframes in the labeled (fast) case. Their implementation strategies seem quite different, and I wonder if donoframe could adopt a faster approach.

0

1 Answer 1

0

well you could probably add a default label to every frame (I'm highjacking the environment key as it is just before the general keys are set):

\documentclass{beamer}
\makeatletter
\newcounter{myframecount}
\define@key{beamerframe}{environment}
 {%
  \stepcounter{myframecount}%
  \edef\beamer@againname{\themyframecount}%
{\let\@elt\beamer@labelsavecounter\beamer@overlaycounterresets}%
  \def\beamer@frameenvironmentsubst{#1}%
 }
\makeatother 
\begin{document}
\begin{frame}<all:0>[label=bad]
        1111111111111111111111111111111111111111111111111111111111111111
\end{frame}
\begin{frame}<all:0>
        2222222222222222222222222222222222222222222222222222222222222222
\end{frame}
\end{document}
6
  • Unfortunately this fails to compile when <all:0> overlay specifications are removed.
    – amonakov
    Dec 15, 2023 at 15:28
  • ah right. I added an edit. But I'm not completly sure that it doesn't fall over somewhere. Dec 15, 2023 at 15:36
  • Your answer is pristine, did your edit not reach the server somehow?
    – amonakov
    Dec 15, 2023 at 15:41
  • sorry got distracted. Perhaps one will need some additional code from the relabel key, but this is all not really documentated ... Dec 15, 2023 at 15:45
  • Thanks, but yeah, while this works for the MWE, it fails on a complex document.
    – amonakov
    Dec 15, 2023 at 15:50

You must log in to answer this question.

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