The following works:
\documentclass[handout]{beamer}
\begin{document}
\begin{frame}<handout:1>[label=foo]
foo\onslide<all:2>bar
\end{frame}
\end{document}
The point is that you have two levels of overlay specifications:
Local overlay specs that influence the content of a frame, given by \pause
, \only
, overlay-aware commands and so on. These define the set of slides a frame consists of.
The global overlay spec you can give to the frame
environment or command. This further filters the set of slides defined by the local ones.
However, in handout
mode, beamer basically collapses all local overlay specifications to a single slide (unless explicitly told so by local handout:
or all:
alternatives, as in the code above). Hence, the filter on "global level" does not have any effect – it can only reduce the set of slides, not extend it.
A possible workaround is what I have sketched above: During development, use <all:...>
overlay specs to have each and every slide also in the handout. When the lecture is almost complete, add the global ones to decide what actually should be part of the handout. I have been using this strategy for a while and it works quite well.
Do note that this is extremely poorly tested. As in, hardly at all. The MWE works for me right now on this machine today. That is all.
Caveat emptor...
This creates a new class hackedbeamer.cls
which is essentially a wrapper around beamer.cls
. It is not possible to mimic exactly what the class does because it uses \DeclareOptionBeamer{}{}
to define the mode options passed to the class. I can't use that here because I need to define the option before the class is loaded and \DeclareOptionBeamer{}{}
defined. So I'm using a regular \DeclareOption{}{}
and hoping that the worst doesn't turn out too badly.
This makes no attempt to adjust for themes which handle modes differently. This includes the default outer theme.
Anyway, for what it is worth:
\begin{filecontents}{hackedbeamer.cls}
\NeedsTeXFormat{LaTeX2e}% LaTeX 2.09 can't be used (nor non-LaTeX)
[1994/12/01]% LaTeX date must December 1994 or later
\ProvidesClass{hackedbeamer}
\newif\ifhacked@beamer@exhandout\hacked@beamer@exhandoutfalse
\DeclareOption{exhandout}{\hacked@beamer@exhandouttrue}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{beamer}}
\ProcessOptions*
\LoadClass{beamer}
\ifhacked@beamer@exhandout
\AtEndOfClass{%
\gdef\beamer@currentmode{exhandout}%
\def\animate<#1>{\transduration<#1| handout:0| exhandout:0| trans:0>{0}}%
}
\fi
\endinput
\end{filecontents}
\documentclass
[exhandout]
{hackedbeamer}
\begin{document}
\begin{frame}
\[
1+1=\uncover<2-| handout:1| exhandout:0>{\alert<2| handout:0>{2}}
\]
\end{frame}
\end{document}
As written, the code produces a single slide:
Switching to handout produces a single slide which differs from the one above:
Switching to default mode produces two sides:
EDIT
I think the above method is cleaner but, if you don't want to use a parasitic class like hackedbeamer.cls
, you can avoid it as follows:
\documentclass
[handout]
{beamer}
% \makeatletter
% \gdef\beamer@currentmode{exhandout}%
% \def\animate<#1>{\transduration<#1| handout:0| exhandout:0| trans:0>{0}}%
% \makeatother
\begin{document}
\begin{frame}
\[
1+1=\uncover<2-| handout:1| exhandout:0>{\alert<2| handout:0>{2}}
\]
\end{frame}
\end{document}
When you want to enable exhandout
mode, uncomment the commented lines. When you want handout
, comment those lines and specify the class option. When you want default mode, comment those lines and comment the class option.
This is doing the same as the parasitic class does. It is just doing it in your preamble.
Either method seems a bit mysterious but this one feels like positive sleight of hand. Notice that the code above works despite exhandout
mode never being defined even thought the overlay specification uses it. I assume Beamer's parser must just discard any mode specification not relevant to the currently active mode.
Best Answer
For handouts, you can either comment out all the theme modifications and stay with the
default
theme or you can specify what would different casespresentation
,article
,handout
etc. be, using the\mode{}
command. For the frame borders, one can use a TikZ rectangle drawn on the border of the specialcurrent page
node. Here is a simple example: