18

How do I tell beamer that I want allowframebreaks allowed by default?

Something like noitemsep for itemize: \setlist[itemize]{noitemsep}

So that I don't have to do:

\begin{frame}[allowframebreaks]
    something
\end{frame}

but just:

\begin{frame}
    something
\end{frame}
mreq
  • 1,111
  • 2
    A short answer here is going to be 'you can't, at least easily', I'm afraid. Till was really not keen on the idea of auto-breaking frames, and the 'reset' for the appropriate key is buried inside \beamer@@@@frame. This can probably be removed using etoolbox, and the key then fixed as true using \setkeys{beamerframe}{allowframebreaks}. However, this is really against the whole concept of how beamer is structured. – Joseph Wright Mar 01 '13 at 20:15
  • I've read that I shouldn't use allowframebreaks, BUT: It makes my life easier and (as the programmer part of me says "keep the code DRY"). Don't have to make frames with identical headings as I can use manual \framebreak instead. – mreq Mar 01 '13 at 20:17
  • 5
    Writing a document isn't coding, and I suspect Till would say that two frames with the same title suggests that they are actually a (sub)section and you're abusing the title of the frame :-) More importantly, presentations are visual things, and therefore automatic breaking is very unlikely to make good decisions. – Joseph Wright Mar 01 '13 at 20:19
  • Just in case someone is looking at this question looking for a way to set default frame options (in general): my answer here might provide some help. – Juan A. Navarro Aug 22 '13 at 11:14
  • @JosephWright What if you want to use the section title as the frame title? – cfr Jul 02 '16 at 20:02
  • @cfr Use a style that puts the section name in the frame header, I guess – Joseph Wright Jul 02 '16 at 20:05

1 Answers1

16

Since everyone is telling you not to do it, here;s one way of doing it:-)

enter image description here

\documentclass{beamer}

\let\oldframe\frame
\renewcommand\frame[1][allowframebreaks]{\oldframe[#1]}

\begin{document}

\begin{frame}
\begin{enumerate}
\item    something \item    something \item    something
\item    something \item    something \item    something
\item    something \item    something \item    something
\item    something \item    something \item    something
\item    something \item    something \item    something
\item    something \item    something \item    something
\item    something \item    something \item    something
\item    something \item    something \item    something
\item    something \item    something \item    something
\item    something \item    something \item    something
\end{enumerate}
\end{frame}

\end{document}

That leaves breaking as the default option but if you specify any other option the default is not used so you need to include allowframebreaks whenever you have an option.

If you definitely always want it (rather than just having it as default if no option used) you can use instead of the above

 \renewcommand\frame[1][]{\oldframe[allowframebreaks,#1]}

so that allowframebreaks is always prepended to the option list.

David Carlisle
  • 757,742
  • @GonzaloMedina sure, but you can either include allowframebreaks whenever you have an option or if you definitely always want it (rather than just having it as default if no option used) you can use \renewcommand\frame[1][]{\oldframe[allowframebreaks,#1]} – David Carlisle Sep 13 '13 at 16:19
  • @GonzaloMedina OK will do – David Carlisle Sep 13 '13 at 16:30
  • Has this stopped working (texlive 2013), or is it just me? I redefine exactly as you say, and get "Extra }, or forgotten \endgroup" as soon as it reaches the first frame. If it's just me I'll investigate further... – alexis Oct 24 '15 at 16:00
  • 1
    @DavidCarlisle it doesn't work if you load the parameter fragile \begin{frame}[fragile] can you invistigate that please ? – Cfun Jul 02 '16 at 04:34
  • @SAM probably you're better to ask a new question ref this, someone who knows the beamer code will probably pick it up:-) – David Carlisle Jul 02 '16 at 08:56
  • 1
    For some reason this breaks when doing \frame{\titlepage}. – codeaviator Dec 11 '17 at 21:10