Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

beamer: span frames with theorem or proof?

2,355 views
Skip to first unread message

murrayE

unread,
Feb 21, 2010, 2:55:42 PM2/21/10
to
Beamer doesn't seem to allow one to begin a theorem environment, or a
proof environment, on one frame and not end it until another. At least
the following generates errors:

\documentclass{beamer}
\begin{document}

\begin{frame}
\begin{theorem}
text here
\end{frame}

\begin{frame}
and rest here
\end{theorem}
\end{frame}
\end{document}

Is there some work-around?

Marc van Dongen

unread,
Feb 21, 2010, 11:36:16 PM2/21/10
to
On Feb 21, 7:55 pm, murrayE <mur...@math.umass.edu> wrote:
> Beamer doesn't seem to allow one to begin a theorem environment, or a
> proof environment, on one frame and not end it until another. At least
> the following generates errors:

> \begin{frame}
> \begin{theorem}
> \end{frame}

Hi, this is a feature of LaTeX it insists you end any environment
before the
environment it's in.

\begin{x} \begin{y} \end{x} % not allowed.

Regards,


Marc van Dongen

Joris

unread,
Feb 22, 2010, 3:06:03 AM2/22/10
to

Yes, use \only.


\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{theorem}

\only<1>{text here}
\only<2>{and rest here}

Marc van Dongen

unread,
Feb 22, 2010, 4:55:14 AM2/22/10
to
On Feb 22, 4:36 am, Marc van Dongen <don...@cs.ucc.ie> wrote:


> Hi, this is a feature of LaTeX it insists you end any environment
> before the
> environment it's in.
>
> \begin{x} \begin{y} \end{x} % not allowed.

Perhaps I should have been suggested a solution: why not introduce a
new environment for continued
Regards,

Marc van Dongen

murrayE

unread,
Feb 22, 2010, 8:54:45 AM2/22/10
to

Understood! But then why don't the allowframebreaks option to the
frame environment, and the \framebreak command, work? That is, I
tried:

\begin{frame}[allowframebreaks]
\begin{theorem}
many lines of text here...

\framebreak

more text here

\end{theorem}
\end{frame}

murrayE

unread,
Feb 22, 2010, 9:10:36 AM2/22/10
to

That doesn't quite do it: The "Theorem" heading appears again on the
2nd overlay.

And if I have enough lines of text as argument to \only<1> to fill a
slide and then use the [allowframebreaks] option and the \framebreak
command, I don't see the 2nd overlay at all.

Joris

unread,
Feb 22, 2010, 9:57:36 AM2/22/10
to

you can also use \only to change the theorem headings, as in

\begin{theorem}[\only<1>{blablabla}\only<2>{blablabla (cont'd)]

or do any other number of similar things.

murrayE

unread,
Feb 22, 2010, 2:54:35 PM2/22/10
to

Unfortunately, that does NOT get rid of the "Theorem" heading on the
2nd slide, even if you use, say:

\begin{theorem}[\only<1>{}\only<2>{}]

Rather, now both slides begin with "Theorem()".

I need to get rid of the "Theorem" entirely on the 2nd slide. (Why:
because what I need to say is long. Actually, it's a \begin{proof|...
\end{proof} environment, and other math-like environments, where I
need more lines than will fit on one screen, so every line I can free
up counts.)

C Hanck

unread,
Feb 23, 2010, 3:10:44 AM2/23/10
to
below is a workaround I use for long proofs, HTH:

Christoph

\begin{frame}
\begin{thmn}\label{momgennormthm}
The moment-generating function of the normal distribution is given by
\[
M_X(t)=\exp\biggl\{\mu t+\frac{1}{2}\sigma^2t^2\biggr\}
\]
\end{thmn}
\begin{proof}\mbox{}
By definition of the moment-generating function
\begin{eqnarray*}
M_X(t)&=&\int_{-\infty}^\infty\exp\bigl\{xt\bigr\}\frac{1}{\sigma
\sqrt{2\pi}}\exp\Bigl\{-\frac{1}{2}\Bigl(\frac{x-\mu}{\sigma}
\Bigr)^2\Bigr\}\rd x\\
&=&\frac{1}{\sigma\sqrt{2\pi}}\int_{-\infty}^\infty\exp\Bigl\{-\frac{1}
{2\sigma^2}\Bigl[-2xt\sigma^2-(x-\mu)^2\Bigr]\Bigr\}\rd x
\end{eqnarray*}
One verifies directly that (a technique known as ``completing the
square'')
\[
-2xt\sigma^2+(x-\mu)^2=[x-(\mu+t\sigma^2)]^2-2\mu t\sigma^2-
t^2\sigma^4
\]
\renewcommand{\qedsymbol}{}
\end{proof}
\end{frame}

\begin{frame}
\begin{proof}[Proof ctd.]
Hence, we can write
\[
M_X(t)=\frac{1}{\sigma\sqrt{2\pi}}\int_{-\infty}^\infty\exp\Bigl\{-
\frac{1}{2\sigma^2}\Bigl[[x-(\mu+t\sigma^2)]^2-2\mu t\sigma^2-
t^2\sigma^4\Bigr]\Bigr\}\rd x
\]
We can then simplify and factor out all terms not involving $x$ to get
\[
M_X(t)=\exp\Bigl\{\mu t+\frac{1}{2}t^2\sigma^2\Bigr\}\int_{-\infty}^
\infty\frac{1}{\sigma\sqrt{2\pi}}\exp\Bigl\{-\frac{1}{2}\Bigl[\frac{x-
(\mu+t\sigma^2)}{\sigma}\Bigr]^2\Bigr\}\rd x
\]
Since the term inside the integral is a normal density with parameters
$\mu+t\sigma^2$ and $\sigma$, it integrates to 1, as shown in
\eqref{normdensint1}. Hence,
\begin{equation}\label{momgennorm}
M_X(t)=\exp\Bigl\{\mu t+\frac{1}{2}t^2\sigma^2\Bigr\}
\end{equation}
\end{proof}
\end{frame}

murrayE

unread,
Feb 23, 2010, 1:08:57 PM2/23/10
to

Your work-around is simple and effective in this situation. Thanks!

I guess I was trying too hard to maintain logical structure by keeping
a whole proof within a single \begin{proof}...\end{proof} environment.

0 new messages