36

I'm writing a presentation in Beamer, where I present proofs which are longer than one frame. How to make Beamer to break it automatically to another frame? If it is not possible how am I supposed to remove the square (the end of proof) and put it in a right place in another frame?

3
  • 1
    Please check for the allowframebreaks option in the manual
    – percusse
    Aug 9, 2012 at 21:49
  • 3
    @percusse I don't think allowframebreaks will work when using the proof environment. Aug 10, 2012 at 0:00
  • @GonzaloMedina Indeed, you are right. That was a tongue-in-cheek comment as I wasn't sure if that would do it..
    – percusse
    Aug 10, 2012 at 0:35

3 Answers 3

31

If you are using the proof environment, then I am afraid that there's no automatic way to break the text (allowframebreaks won't work here, since we're dealing with a block).

You can define an environment that behaves as proof, but without using the end-mark; you then can use this new environment for the first frames of the proof and then, use the standard proof environment for the last frame; here's an example of the definition of such environment (which I called proofs) and its ussage:

\documentclass{beamer}
\usetheme{Warsaw}
\usepackage{lipsum}

\makeatletter
\newenvironment<>{proofs}[1][\proofname]{%
    \par
    \def\insertproofname{#1\@addpunct{.}}%
    \usebeamertemplate{proof begin}#2}
  {\usebeamertemplate{proof end}}
\makeatother

\begin{document}

\begin{frame}
\begin{proofs}
\lipsum[1]
\end{proofs}
\end{frame}

\begin{frame}
\begin{proofs}[\proofname\ (Cont.)]
\lipsum[1]
\end{proofs}
\end{frame}

\begin{frame}
\begin{proof}[\proofname\ (Cont.)]
\lipsum[1]
\end{proof}
\end{frame}

\end{document}

enter image description here

As requested in a comment, I have defined now three new environments: proofs, which uses a block with title given by \insertproofname (default "Proof") and suppresses the end-mark; proofc, which suppresses both the title and the end-mark, and proofe which suppresses the title but adds the end-mark; the first environment is to be used to start the proof, the second one, to continue the proof, and the third one, to end the proof:

\documentclass{beamer}
\usetheme{Warsaw}
\usepackage{lipsum}

\makeatletter
\newenvironment<>{proofs}[1][\proofname]{%
    \par
    \def\insertproofname{#1\@addpunct{.}}%
    \usebeamertemplate{proof begin}#2}
  {\usebeamertemplate{proof end}}
\newenvironment<>{proofc}{%
  \setbeamertemplate{proof begin}{\begin{block}{}}
    \par
    \usebeamertemplate{proof begin}}
  {\usebeamertemplate{proof end}}
\newenvironment<>{proofe}{%
    \par
    \pushQED{\qed}
    \setbeamertemplate{proof begin}{\begin{block}{}}
    \usebeamertemplate{proof begin}}
  {\popQED\usebeamertemplate{proof end}}
\makeatother

\begin{document}

\begin{frame}
\begin{proofs}
\lipsum[1]
\end{proofs}
\end{frame}

\begin{frame}
\begin{proofc}
\lipsum[1]
\end{proofc}
\end{frame}

\begin{frame}
\begin{proofe}
\lipsum[1]
\end{proofe}
\end{frame}

\end{document}
2
  • 1
    Thank you, probably the only possible solution. Would it be possible to modify it? I would prefer to have no name such as Proof (Cont.) on the second, third and so on slides..only Proof on the first slide and the square on the last slide.
    – Laura
    Aug 10, 2012 at 15:41
  • 1
    @Laura sure; I've updated my answer implementing the necessary environments. On a side note, don't forget to accept my answer if you consider it solved your problem; in case of doubt on how/why to accept answers, plese see How do you accept an answer?. Aug 10, 2012 at 16:41
12

One option to solve this is by 'brute force': since there exists the generic block environment for beamer classes, we can do the following:

    \begin{frame}

    \begin{block}{Proof}
    Here is the first part of my proof.
    \end{block}

    \end{frame}

    \begin{frame}

    \begin{block}{}
    This is where my proof continues, and ends.
    \qed
    \end{block}

    \end{frame}

Inside the second empty `{}' we can insert anything we would like our block to have as a title, or just leave it empty if we don't want anything there.

2
  • 2
    +1 Very simple useful solution !!
    – Nizar
    Mar 16, 2020 at 13:23
  • To eliminate the extra space of the empty block title you can also use \begin{block}{\vspace*{-1em}}
    – ws6079
    May 19, 2021 at 10:02
0

The allowframebreaks option is evil, but just as a proof of concept, here a solution with the tcolorbox inner theme:

\documentclass{beamer}
\usetheme{Warsaw}
\usepackage{lipsum}

\usepackage[most]{tcolorbox}
\useinnertheme{tcolorbox}
\tcbset{breakable,title after break=\insertblocktitle}

\begin{document}

\begin{frame}[allowframebreaks]
\begin{proof}
\lipsum[1]
\framebreak
\lipsum[1]
\end{proof}
\end{frame}

\end{document}

enter image description here

4
  • Hi @samcarter_is_at_topanswers.xyz I noticed that if I add in the preamble the line \setbeamertemplate{blocks}[rounded], then is not splitting well.
    – Oromion
    Jan 21, 2023 at 18:20
  • 1
    @Oromion It should work as long as you load the tcolorbox inner theme after the \setbeamertemplate{blocks}[rounded] (or remove \setbeamertemplate{blocks}[rounded] altogether, it won't have any effect on the tcolorboxes.) Jan 21, 2023 at 18:32
  • Thanks! It is working. i.imgur.com/y76lUcV.png
    – Oromion
    Jan 23, 2023 at 21:06
  • 1
    @Oromion Glad to hear it is working! I added this information to the theme documentation so it will be included in the next version of the theme. Jan 24, 2023 at 11:23

You must log in to answer this question.

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