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.
handout
mode to hide answers andpresentation
mode to display answers?