When compiling with the parameter label
as in the MWE, allowframebreaks
doesn't work. Why not?
Is there any difference between setting a frame title as a frame
argument and by using \frametitle
?
\documentclass{beamer}
\usetheme{Warsaw}
\usepackage{blindtext}
\begin{document}
\begin{frame}[allowframebreaks,label=frame1]{Title}
%\frametitle{Title}
\framesubtitle{Sub-title}
\blindtext
Text........ Text........ Text........ Text........ Text........
Text........ Text........ Text........ Text........ Text........
Text........ Text........ Text........ Text........ Text........
Text........ Text........ Text........ Text........ Text........
\end{frame}
\end{document}
Best Answer
There can be a difference between setting the title as an argument to
frame
and using\frametitle
if the next thing TeX finds is a{
because this will be interpreted either as the start of the frame's subtitle or as the start of the frame's content.For example
demonstrates the difference between using the argument to
frame
and using the macro
In
beamerbaseframe.sty
, we findbeamerbaseframesize.sty
shows thatallowframebreaks
sets the togglebeamer@autobreak
totrue
. Back inbeamerbaseframe.sty
we find, for example,So the mechanism activated by passing the
label
option to theframe
environment is only used at all ifallowframebreaks
is not set totrue
.It is important to appreciate that the
label
option is not equivalent to saying\label{}
at any point. Thelabel
option is designed for something significantly more complex. Its main purpose is to support\againframe
. For this purpose it names each slide of the current frame. Each slide also gets a label. Iflabel=mylabel
, then the slides get labelsmylabel<1>
,mylabel<2>
etc. As a convenience, an additional label is set on the first slidemylabel
. So, assuming the frame has n slides, setting this option is equivalent to sayingThis mechanism serves no purpose if
allowframebreaks
is set because overlays are disabled in this case.Of course, you could code the option so that, if
allowframebreaks
istrue
, thenlabel
issues\label{}
on the first frame. However, this would be potentially confusing since it would mean that thelabel
option activated very different mechanisms depending on whether frames were allowed to be broken or not.