josephwright / beamer

A LaTeX class for producing presentations and slides
Other
1.41k stars 142 forks source link

Footline Missing When Storing Frame in a Box #893

Open EagleoutIce opened 5 months ago

EagleoutIce commented 5 months ago

I (rather naively) tried to store a complete beamer frame in a box so that i can re-use important slides of my presentation together on one summary slide. However, no matter how I store the respective frame, the footline (and potentially other things I haven't found yet) are missing when using the box.

For example, the following:

\begin{frame}[label=hey]{Hey}
    Sample frame!
\end{frame}

\newsavebox\foo
\setbox\foo=\hbox{\vbox{%
    \againframe{hey}%
}}%

\begin{frame}{ho}
    \fboxsep0pt
    \fbox{\scalebox{.5}{\usebox\foo}}
\end{frame}

recreates "hey" correctly (regarding the title and framecontent), however, the footline is missing (no matter how i define the footline template).

I can (re-)create the footline manually like this:

\setbox\foo=\hbox{\vbox{%
    \againframe{hey}%
    \usebeamertemplate{footline}%
}}%

But now, the bounding box is wrong and the leftmargin of the text is ignored (generally it appears to me that the box has the bounding box of the text content, ignoring the title/headline as well).

I can fix this (hopefully correctly) by adding the \beamer@leftmargin:

\makeatletter
\setbox\foo=\hbox{\vbox{\hspace*{\beamer@leftmargin}\hbox{\vbox{%
    \againframe{hey}%
}}\usebeamertemplate{footline}}}%

While the frame "seems" correct to me, I have no idea

1) why the footline is missing when the frame is reused in a box and if this is to be considered a bug or if this is the result of my ignorance 2) if this is the "intended" way to re-create the frame 3) if other things will break when i do this (i have already found that tikzpictures using overlay and remember picture weirdly attach to the parent frame and i am not sure how to fix this).

I tried various other variations (with lrbox, adjustbox etc.) but none of them worked. Googling (and using ChatGPT) did not result in anything usable for me. Sorry to bother.

samcarter commented 5 months ago

IMHO, the safest way to re-use frames is to make a copy of the pdf and include the frames as images. This can even be automated, see e.g. https://tex.stackexchange.com/a/71003/36296

EagleoutIce commented 5 months ago

Thank you very much for pointing that out i didn't find this while searching. However, is there a reason for why exactly the footer does not show automatically when used this way?

samcarter commented 5 months ago

I didn't test because there is no compilable example and I didn't fancy puzzling the code fragments together, but if I had to guess: it is the same as https://github.com/josephwright/beamer/issues/485#issuecomment-416137564

(while yours isn't on the note page, it seems to be the same situation as yours is also within the page and thus the page decoration with header and footer won't kick in)