beamer
beamer copied to clipboard
Custom modes
It would be nice to be able to extend the current available modes to customized ones, just as asked in this question.
Adding custom modes is not the problem:
\documentclass{beamer}
\makeatletter
\gdef\beamer@currentmode{foo} % comment/uncomment this line
\makeatother
\begin{document}
\begin{frame}
abc
\only<foo>{test}
\end{frame}
\end{document}
Just trying to add them as documentclass options is tricky...
For the use-case decribed in the question, about creating two different versions of the same mode, I would suggest the beameraudience package:
\documentclass[handout]{beamer}
\usepackage[
audience=exthandout
]{beameraudience}
\begin{document}
\begin{frame}
abc
\only<handout>{all \showcontentfor{exthandout}{ext}}
\end{frame}
\end{document}
@samcarter:
-
I would love to be able to declare the
foomode at\documentclass's level! :) -
I wasn't aware of the
beameraudiencepackage: thanks! Would be nice if its features could be added tobeamer.
This feature seems easy to be added---just add the following to beamer.cls:
\DeclareOptionBeamer{custommode}{%
\def\beamer@custommode{#1}%
\def\beamer@articlemode{article}%
\def\beamer@secondmode{second}%
\ifx\beamer@custommode\@empty\else%
\ifx\beamer@custommode\beamer@articlemode\else%
\ifx\beamer@custommode\beamer@secondmode\else%
\xdef\beamer@currentmode{\beamer@custommode}%
\fi%
\fi%
\fi%
}
All the custom modes are treated as presentation. This option is also valid for predefined modes like handout and trans.