Commits

Till Tantau  committed b934697

*** empty log message ***

  • Participants
  • Parent commits f86817e

Comments (0)

Files changed (19)

File base/beamer.cls

 \newif\ifbeamer@draftmode
 \newif\ifbeamer@suppressreplacements % decides whether fonts should be substituted
 \newif\ifbeamer@frameswithnotesonly
+\newif\ifbeamer@ignorenonframe
 
 
 \RequirePackage{beamerbaseoptions}
 \beamer@compressfalse
 \beamer@draftmodefalse
 \beamer@frameswithnotesonlyfalse
+\beamer@ignorenonframefalse
 
 \DeclareOptionBeamer{compress}
 {\beamer@compresstrue}
 \DeclareOptionBeamer{vtex}{}% Used by hyperref
 \DeclareOptionBeamer{ps2pdf}{}% Used by hyperref
 
+\DeclareOptionBeamer{ignorenonframetext}{\beamer@ignorenonframetrue}
+
 \def\beamer@size{{size11.clo}}
 \DeclareOptionBeamer{bigger}{\def\beamer@size{{size12.clo}}}
 \DeclareOptionBeamer{smaller}{\def\beamer@size{{size10.clo}}}
 \RequirePackage{beamerbasemisc}
 % Miscellaneous commands
 
-\RequirePackage{beamerbasedecode}
-% Overlay stuff
-
 \RequirePackage{beamerbaseoverlay}
 % Overlay stuff
 

File base/beamerbasearticle.sty

 
 \ProcessOptions
 
-\article
+\mode<article>
+{  
+\RequirePackage{keyval}
 
 \ifbeamer@articlexcolor
   \RequirePackage[override]{xcolor}
 \RequirePackage{beamerbasemisc}
 % Miscellaneous commands
 
+\RequirePackage{beamerbaseoverlay}
+% Overlay stuff
+
 \RequirePackage{beamerbasetitle}
 % Commands for constructing the title page
 
 \RequirePackage{beamerbaseframe}
 % Commands for constructing frames
 
-\RequirePackage{beamerbasenotes}
-% Commands for constructing frames
-
 \RequirePackage{beamerbaseframecomponents}
 % Headlines, sidebars, columns
 
 \RequirePackage{beamerbasecolor}
 % Headlines, sidebars, columns
 
-\RequirePackage{beamerbasedecode}
-% Overlay stuff
-
-\RequirePackage{beamerbaseoverlay}
-% Overlay stuff
+\RequirePackage{beamerbasenotes}
+% Commands for constructing frames
 
 \RequirePackage{beamerbasetoc}
 % Table of Contents Format
 
 \RequirePackage{beamerbasenavigation}
 % Navigation buttons
-
-\common
-
-\endinput
+}
 
 %%% Local Variables: 
 %%% mode: latex

File base/beamerbasecolor.sty

 % of the GNU Public License, version 2.
 
 
-\presentation
+\mode<presentation>
 
 %
 % Average background color management
 
 \beamersetaveragebackground{white}
 
-\article
+\mode
+<article>
 {
   \def\beamersetaveragebackground#1{}
   
 \colorlet{beamerexample}{green!50!black}
 \colorlet{beamerstructure}{structure}
 
-\article
+\mode
+<article>
 {
   \ifbeamer@articlexcolor
     \definecolor{alert}{rgb}{1,0,0}
   \def\beamer@postscriptcolorhack{}%
 \fi
 
-\common
+\mode
+<all>
 
 
 %%% Local Variables: 

File base/beamerbasecompatibility.sty

     % Fix spanish.ldf's meddling with < and > 
     %
     \@ifundefined{deactivatequoting}{}{\deactivatequoting}}
-  \begingroup\beamer@origdocument}
+  \begingroup\beamer@origdocument%
+  \ifbeamer@ignorenonframe%
+    \expandafter\mode\expandafter*%
+  \fi}
 
 \AtBeginDocument{\def\es@itemize#1#2#3#4{}}% fix spanish.ldf's with \itemize 
 

File base/beamerbasedecode.sty

 % of the GNU Public License, version 2.
 
 
-
-\common
-
 %
 % News
 %
 \newif\ifbeamer@localanotherslide
 
 
+%
+%
+% Empty test
+%
+%
+\long\def\beamer@ifempty#1{\beamer@xifempty#1@@..\@nil}
+\long\def\beamer@xifempty#1#2@#3#4#5\@nil{%
+  \ifx#3#4\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
+
+
 % Sets dowhat to doif, if \beamer@slideinframe is in the specified
 % interval. Example: 5-7,-3,9,11,13- would mean pages
 % 1,2,3,5,6,7,9,11,13,14,15,16,... 
 \def\beamer@default{default}
 \def\beamer@articlemode{article}
 \def\beamer@presentationmode{presentation}
-\def\beamer@modestop{stop}
 \def\beamer@modeall{all}
+\def\beamer@ovmodestop{stop}
 \def\beamer@decodefind#1:#2:{%
-  \def\beamer@mode{#1}%
+  \def\beamer@ovmode{#1}%
   \beameratdecodeaction{#2}%
   \expandafter\futurelet\expandafter\next\expandafter\beamer@checkcat\beamer@spec:%
-  \ifx\beamer@mode\beamer@modestop%
+  \ifx\beamer@ovmode\beamer@ovmodestop%
     \expandafter\beamer@@decode\beamer@decodefound,!%
     \let\beamer@next=\relax%
   \else
-    \ifx\beamer@mode\beamer@currentmode%
+    \ifx\beamer@ovmode\beamer@currentmode%
       \beamer@@decodefound%
     \else%
-      \ifx\beamer@mode\beamer@modeall%
+      \ifx\beamer@ovmode\beamer@modeall%
         \beamer@@decodefound%
       \else%
-        \ifx\beamer@mode\beamer@presentationmode%
+        \ifx\beamer@ovmode\beamer@presentationmode%
           \ifx\beamer@currentmode\beamer@articlemode\else%
             \beamer@@decodefound%
           \fi%
 
 \def\beamer@checkcat#1:{%
   \ifcat\next a%
-    \gdef\beamer@mode{#1}%
+    \gdef\beamer@ovmode{#1}%
     \gdef\beamer@decodefound{0}%
     \gdef\beamer@spec{+}%
   \fi%
 
 
 
-%
-%
-% Basic overlay commands
-%
-%
-
-\long\def\beamer@ifnextcharospec#1#2{%
-  \def\reserved@a{#1}%
-  \def\reserved@b{#2}%
-  \futurelet\@let@token\beamer@ifnch}
-\def\beamer@ifnch{%
-  \ifx\@let@token<%
-    \let\reserved@c\reserved@a%
-  \else%
-    \let\reserved@c\reserved@b%
-  \fi%
-  \reserved@c}
-
-%
-% \only
-%
-\def\only{\@ifnextchar<{\beamer@only}{\beamer@@only}}
-\long\def\beamer@only<#1>#2{%
-  \def\beamer@doifnotinframe{}\def\beamer@doifinframe{#2}%
-  {\setbox0=\hbox{\beamer@decode#1| stop:0| }}\beamer@donow}
-\long\def\beamer@@only#1{\beamer@ifnextcharospec{\beamer@@@only{#1}}{#1}}
-\long\def\beamer@@@only#1<#2>{%
-  \def\beamer@doifnotinframe{}\def\beamer@doifinframe{#1}%
-  {\setbox0=\hbox{\beamer@decode#2| stop:0| }}\beamer@donow}
-
-%
-% \alt and \altenv
-%
-\def\alt{\@ifnextchar<{\beamer@alt}{\beamer@alttwo}}
-\long\def\beamer@alttwo#1#2{\beamer@ifnextcharospec{\beamer@altget{#1}{#2}}{#1}}
-\long\def\beamer@altget#1#2<#3>{%
-  \def\beamer@doifnotinframe{#2}\def\beamer@doifinframe{#1}%
-  {\setbox0=\hbox{\beamer@decode#3| stop:0| }}\beamer@donow}
-\long\def\beamer@alt<#1>#2#3{%
-  \def\beamer@doifnotinframe{#3}\def\beamer@doifinframe{#2}%
-  {\setbox0=\hbox{\beamer@decode#1| stop:0| }}\beamer@donow}
-
-
-\def\altenv{\@ifnextchar<{\beamer@altenv}{\beamer@@@altenv}}
-\def\beamer@altenv<#1>{\beamer@@altenv{<#1>}}
-\long\def\beamer@@@altenv#1#2#3#4{\beamer@ifnextcharospec{\beamer@altenvsort{#1}{#2}{#3}{#4}}{\beamer@@altenv{}{#1}{#2}{#3}{#4}}}
-\long\def\beamer@altenvsort#1#2#3#4<#5>{\beamer@@altenv{<#5>}{#1}{#2}{#3}{#4}}
-\long\def\beamer@@altenv#1#2#3#4#5{\alt#1{\long\def\beamer@eoenv{#3}#2}{\long\def\beamer@eoenv{#5}#4}}
-\def\endaltenv{\beamer@eoenv}
-
-%
-% \action and actionenv
-%
-\def\beamer@plus{+}
-
-\def\action{\@ifnextchar<{\beamer@parsedaction}{\beamer@parsedaction<+>}}
-\long\def\beamer@parsedaction<#1>#2{%
-  \def\beamer@doifnotinframe{}\def\beamer@doifinframe{}%
-  {{\setbox0=\hbox{\beamer@decode#1| stop:0| }}}%
-  \ifx\beamer@decodefound\beamer@plus%
-    \long\def\beamer@todo{#2}%
-  \else%
-    \expandafter\long\expandafter\def\expandafter\beamer@todo%
-    \expandafter{\expandafter\uncover\expandafter<\beamer@decodefound>{#2}}%
-  \fi%
-  \expandafter\beamer@processactions\beamer@decaction{}%
-  \beamer@todo}
-
-\def\beamer@processactions#1{%
-  \beamer@ifempty{#1}{}{%
-    \expandafter\beamer@@processactions\expandafter{\beamer@todo}#1}}
-\long\def\beamer@@processactions#1#2<#3>{%
-  \expandafter\long\expandafter\def\expandafter\beamer@todo\expandafter{%
-    \csname#2\endcsname<#3>{#1}}%
-  \beamer@processactions}
-
-\def\actionenv{\beamer@ifnextcharospec{\beamer@parsedactionenv}{\beamer@parsedactionenv<+>}}
-\def\beamer@parsedactionenv<#1>{%
-  \def\beamer@doifnotinframe{}\def\beamer@doifinframe{}%
-  {{\setbox0=\hbox{\beamer@decode#1| stop:0| }}}%
-  \ifx\beamer@decodefound\beamer@plus%
-    \def\beamer@todobegin{}%
-    \def\beamer@todoend{}%
-  \else%
-    \edef\beamer@todobegin{\noexpand\begin{uncoverenv}<\beamer@decodefound>}%
-    \def\beamer@todoend{\end{uncoverenv}}
-  \fi%
-  \expandafter\beamer@processactionsbegin\beamer@decaction{}%
-  \expandafter\beamer@processactionsend\beamer@decaction{}%
-  \beamer@todobegin}
-\def\endactionenv{\beamer@todoend}
-
-\def\beamer@processactionsbegin#1{%
-  \beamer@ifempty{#1}{}{%
-    \expandafter\beamer@@processactionsbegin\expandafter{\beamer@todobegin}#1}}
-\long\def\beamer@@processactionsbegin#1#2<#3>{%
-  \def\beamer@todobegin{\begin{#2env}<#3>#1}%
-  \beamer@processactionsbegin}
-
-
-\def\beamer@processactionsend#1{%
-  \beamer@ifempty{#1}{}{%
-    \expandafter\beamer@@processactionsend\expandafter{\beamer@todoend}#1}}
-\long\def\beamer@@processactionsend#1#2<#3>{%
-  \def\beamer@todoend{#1\end{#2env}}%
-  \beamer@processactionsend}
-
-
-%
-% \temporal
-%
-\def\@temporal<#1>#2#3#4{% past, present, future
-  \def\beamer@doifnotinframe{\beamer@picked}\def\beamer@doifinframe{#3}%
-  {\setbox0=\hbox{\beamer@localanotherslidefalse\beamer@decode#1| stop:0|
-      \ifbeamer@localanotherslide\gdef\beamer@picked{#2}\else\gdef\beamer@picked{#4}\fi}}\beamer@donow}
-
-
-%
-% \newoverlaycommand
-%
-\def\beameroriginal#1{\csname @orig\string#1\endcsname}
-
-
-\newcount\beamer@argscount
-
-%
-% newenvironment extension
-%
-\let\beamer@orignewenvironment=\newenvironment
-
-\def\newenvironment{\@ifnextchar<{\beamer@newenv}{\beamer@orignewenvironment}}
-\def\beamer@newenv<>{\@star@or@long\beamer@new@environment}
-\def\beamer@new@environment#1{\@ifnextchar[{\beamer@@newenv{#1}}{\beamer@newenvnoopt{#1}{0}}}
-\def\beamer@@newenv#1[#2]{\@ifnextchar[{\beamer@newenvopt{#1}{#2}}{\beamer@newenvnoopt{#1}{#2}}}
-\long\def\beamer@newenvnoopt#1#2#3#4{%
-  \expandafter\newcommand\expandafter<\expandafter>\csname#1\endcsname[#2]{#3}%
-  \expandafter\long\expandafter\def\csname end#1\endcsname{#4}%
-}
-\long\def\beamer@newenvopt#1#2[#3]#4#5{%
-  \expandafter\newcommand\expandafter<\expandafter>\csname#1\endcsname[#2][#3]{#4}%
-  \expandafter\long\expandafter\def\csname end#1\endcsname{#5}%
-}
-
-
-\let\beamer@origrenewenvironment=\renewenvironment
-
-\def\renewenvironment{\@ifnextchar<{\beamer@renewenv}{\beamer@origrenewenvironment}}
-\def\beamer@renewenv<>#1{%
-  \edef\beamer@do{\csname original#1\endcsname=\expandafter\noexpand\csname#1\endcsname}
-  \expandafter\let\beamer@do%
-  \edef\beamer@do{\csname endoriginal#1\endcsname=\expandafter\noexpand\csname end#1\endcsname}
-  \expandafter\let\beamer@do%
-  \newenvironment<>{#1}}
-
-
-%
-% newcommand extension
-%
-\let\beamer@orignewcommand=\newcommand
-
-\def\newcommand{\@ifnextchar<{\beamer@newcom}{\beamer@orignewcommand}}
-\def\beamer@newcom<>{\@star@or@long\beamer@new@command}
-\def\beamer@new@command#1{\@ifnextchar[{\beamer@@newcom{#1}}{\beamer@newcomnoopt{#1}{0}}}
-\def\beamer@@newcom#1[#2]{\@ifnextchar[{\beamer@newcomopt{#1}{#2}}{\beamer@newcomnoopt{#1}{#2}}}
-\long\def\beamer@newcomnoopt#1#2#3{%
-  \ifnum#2=0\relax%
-    \expandafter\def\expandafter#1\expandafter{\expandafter\beamer@sortzero\expandafter{\csname beamerx@\string#1\endcsname}}%
-  \else
-    \expandafter\def\expandafter#1\expandafter{\expandafter\beamer@sort\expandafter{\csname beamerx@\string#1\endcsname}{#2}}%
-  \fi%
-  \beamer@argscount=#2\relax%
-  \advance\beamer@argscount by 1\relax%
-  \expandafter\newcommand\csname beamerx@\string#1\endcsname[\beamer@argscount]{#3}%
-}
-\long\def\beamer@newcomopt#1#2[#3]#4{%
-  \expandafter\def\expandafter#1\expandafter{\expandafter\beamer@presort\expandafter{\csname beamerx@\string#1\endcsname}{#2}{#3}}%
-  \beamer@argscount=#2\relax%
-  \advance\beamer@argscount by 1\relax%
-  \expandafter\newcommand\csname beamerx@\string#1\endcsname[\beamer@argscount]{#4}%
-}
-
-\let\beamer@origrenewcommand=\renewcommand
-
-\def\renewcommand{\@ifnextchar<{\beamer@renewcom}{\beamer@origrenewcommand}}
-\def\beamer@renewcom<>#1{%
-  \expandafter\def\expandafter\beamer@name\expandafter{\csname @orig\string#1\endcsname}%
-  \expandafter\let\beamer@name=#1\relax%
-  \newcommand<>#1}
-
-
-\long\def\beamer@presort#1#2#3{%
-  \long\def\beamer@todo{#1}%
-  \def\beamer@ospec{}%
-  \beamer@argscount=#2\relax%
-  \beamer@prechecka{#3}}
-\long\def\beamer@prechecka#1{\@ifnextchar<{\beamer@preget{#1}}{\beamer@precheckb{#1}}}
-\long\def\beamer@preget#1<#2>{\def\beamer@ospec{<#2>}\beamer@precheckb{#1}}
-\long\def\beamer@precheckb#1{\@ifnextchar[{\beamer@pregetb}{\beamer@pregetb[#1]}}
-\long\def\beamer@pregetb[#1]{%
-  \expandafter\long\expandafter\def\expandafter\beamer@todo\expandafter{\beamer@todo{#1}}%
-  \advance\beamer@argscount by-1\relax%
-  \beamer@parseargs%
-} 
-
-\def\beamer@sortzero#1{\beamer@ifnextcharospec{\beamer@sortzeroread{#1}}{#1{}}}
-\def\beamer@sortzeroread#1<#2>{#1{<#2>}}
-
-
-\def\beamer@sort#1#2{%
-  \long\def\beamer@todo{#1}%
-  \def\beamer@ospec{}%
-  \beamer@argscount=#2\relax%
-  \beamer@parseargs}
-
-\def\beamer@parseargs{%
-  \ifnum\beamer@argscount=0%
-    \let\next=\beamer@finalargscheck%
-  \else%
-    \let\next=\beamer@lookforarg%
-  \fi%
-  \next}
-\def\beamer@lookforarg{%
-  \@ifnextchar<\beamer@foundspec\beamer@readarg}
-\def\beamer@foundspec<#1>{%
-  \def\beamer@ospec{<#1>}%
-  \beamer@lookforarg}
-\long\def\beamer@readarg#1{%
-  \expandafter\long\expandafter\def\expandafter\beamer@todo\expandafter{\beamer@todo{#1}}%
-  \advance\beamer@argscount by-1\relax%
-  \beamer@parseargs%
-}
-
-\def\beamer@finalargscheck{\beamer@ifnextcharospec\beamer@finalspec\beamer@finalnospec}
-\def\beamer@finalspec<#1>{\def\beamer@ospec{<#1>}\beamer@finalnospec}
-\def\beamer@finalnospec{%
-  \expandafter\beamer@todo\expandafter{\beamer@ospec}}
-
-
-
 %%% Local Variables: 
 %%% mode: latex
 %%% TeX-master: "~/texmf/tex/latex/beamer/examples/beamerexample1.tex"

File base/beamerbaseframe.sty

 % 
 
 
-\presentation
+\mode<presentation>
 
 \newbox\beamer@framebox
 
   \@ifnextchar[{\beamer@@@frame<#1>}{\beamer@@@frame<#1>[]}}
 \def\beamer@@@frame<#1>[#2]{%
   \beamer@savemode%
-  \def\beamer@mode{\common}%
+  \def\beamer@mode{\mode<all>}%
   \def\beamer@frametemplate{}%
   \def\beamer@againname{}%
   \setkeys{beamerframe}{#2}%
     \clearpage\beamer@notesactions%
   }
 }
-\def\beamer@reseteecodes{\gdef\beamer@entrycode{}\gdef\beamer@exitcode{}\beamer@resumemode}
+\def\beamer@reseteecodes{\gdef\beamer@entrycode{}\gdef\beamer@exitcode{}%
+  \beamer@slideinframe=1\relax\beamer@resumemode}
 
 \def\beamer@checkifinlist#1,#2\relax{
   \def\beamer@temp{#1}%
 
 
 
-\article
+\mode
+<article>
 {
   \def\frame{\@ifnextchar<\beamer@frame{\beamer@frame<+>}}
-  \def\beamer@frame{\begingroup\catcode`:=12\catcode`|=12\beamer@@@frame}% Hackery for french style
-  \def\beamer@@@frame<#1>{\endgroup\@ifnextchar[{\beamer@@frame<#1>}{\beamer@@frame<#1>[]}}
-  \def\beamer@@frame<#1>[#2]{%
+  \def\beamer@frame<#1>{\@ifnextchar[{\beamer@@frame<#1>}{\beamer@@frame<#1>[]}}
+  \long\def\beamer@@frame<#1>[#2]{%
     \beamer@slideinframe=1\relax%
     \refstepcounter{framenumber}%
     \beamer@slideinframe=0\relax%
   \def\includeonlyframes#1{}% no effect
 }
 
+
+\mode
+<all>
+{
+  \beamer@slideinframe=1\relax%
+}
+
+
+
 %
 % Frame counter
 %
-\common
+\mode
+<all>
 {
   \newcounter{framenumber}
   \def\insertframenumber{\@arabic\c@framenumber}
   \expandafter\beamer@temp\beamer@templet}%
 }
 
-\article
+\mode
+<article>
 {
   \def\againframe{\@ifnextchar<{\beamer@againframe}{\beamer@againframe<>}}
   \def\beamer@againframe<#1>{\@ifnextchar[{\beamer@@againframe<#1>}{\beamer@@againframe<#1>[]}}
 
 
 
-\common
+\mode
+<all>
 % End in common mode
 
 

File base/beamerbaseframecomponents.sty

 
 
 
-\presentation
+\mode<presentation>
 
 %
 % Setting the left and right margin
 }
 
 
-\article
+\mode
+<article>
 {
   \def\beamersetleftmargin#1{}
   \def\beamersetrightmargin#1{}
 % Background management
 %
 %
-\common
+\mode
+<all>
 {
   \long\def\usebackgroundtemplate#1{%
     \gdef\beamer@backgroundtemplate{#1}}
   \def\beamer@colclose{}\ignorespaces}%
   {\beamer@colclose\def\beamer@colclose{}\beamer@colexitcode\end{actionenv}}%
   
-\article
+\mode
+<article>
 {
   % do sth. more intelligent in the future
-  \newenvironment{columns}[1][]{}{}
+  \newenvironment<>{columns}[1][]{}{}
 }
 
 
 %
 %
 
-\common
+\mode
+<all>
 {
 \def\beamer@columnname{column}
 \def\column{%
   \def\beamer@colclose{\end{minipage}\hfill\end{actionenv}\ignorespaces}%
   \begin{actionenv}#3%
   \begin{minipage}[#1]{#2}%
-    \raggedright}
+    \raggedright
+}
+  
    
-\article
+\mode
+<article>
 {
-  \newenvironment{beamer@columnenv}[2][]{}{}
-  \newcommand{\beamer@columncom}[2][]{}
+  \newenvironment<>{beamer@columnenv}[2][]{}{}
+  \newcommand<>{\beamer@columncom}[2][]{}
 }
 
    
 
 
 
-\common
+\mode
+<all>
 
 %%% Local Variables: 
 %%% mode: latex

File base/beamerbaselocalstructure.sty

 
 
 
-\presentation
+\mode<presentation>
 
 \RequirePackage{enumerate}
 
   }}
 
 
-\article
+\mode
+<article>
 {
   \newcommand\frametitle[2][]{\gdef\insertframetitle{#2}\beamer@headrenderer}
   \long\def\useframetitletemplate#1{\def\beamer@headrenderer{#1}}
 \usestructuretemplate{\color{beamerstructure}}{}
 
 
-\article
+\mode
+<article>
 {
   \newenvironment{alertenv}{\begin{altenv}%
     {\begin{itshape}}{\end{itshape}}{}{}}{\end{altenv}}
-  \newenvironment{alertenv}{\begin{altenv}%
+  \newenvironment{structureenv}{\begin{structureenv}%
     {\begin{bfseries}}{\end{bfseries}}{}{}}{\end{altenv}}
   
   \newcommand{\alert}{\only{\emph}}
 %
 %
 
-\common
+\mode
+<all>
 {
   \long\def\useblocktemplate#1#2{%
     \def\beamer@beginblocktemplate{#1}
 }
 
 
-\article
+\mode
+<article>
 {
   \useblocktemplate{\par\medskip{\noindent\textbf{\insertblockname}}\par\noindent\ignorespaces}{\medskip}
   \usealertblocktemplate{\par\medskip{\noindent\textbf{\emph{\insertblockname}}}\par\noindent\ignorespaces}{\medskip}
   \useexampleblocktemplate{\par\medskip{\noindent\emph{\insertblockname}}\par\noindent\ignorespaces}{\medskip}
 }
 
-\common
+\mode
+<all>
 {
 
   \ifbeamer@blocks
 \usetemplatequotation{\itshape}{}
 
 
-\article
+\mode
+<article>
 {
   \renewenvironment<>{verse}{\begin{actionenv}#1\begin{originalverse}}{\end{originalverse}\end{actionenv}}
   \renewenvironment<>{quotation}{\begin{actionenv}#1\begin{originalquotation}}{\end{originalquotation}\end{actionenv}}
   {\par\color{beamerstructure!65}}
 
 
-\article
+\mode
+<article>
 {
   \AtBeginDocument{
     \renewcommand<>{\bibitem}{\beameroriginal{\bibitem}}%should actually suppress
   {\small\structure{\insertcaptionname:} \insertcaption}}
 
 
-\common
+\mode
+<all>
 
 
 %%% Local Variables: 

File base/beamerbasemisc.sty

 % This program can be redistributed and/or modified under the terms
 % of the GNU Public License, version 2.
 
-
-
-\presentation
-
-%
-%
-% Empty test
-%
-%
-\long\def\beamer@ifempty#1{\beamer@xifempty#1@@..\@nil}
-\long\def\beamer@xifempty#1#2@#3#4#5\@nil{%
-  \ifx#3#4\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
-
+\mode
+<presentation>
 
 % Calculate maximum number of sections/subsections per part
 \beamer@subsectionmax=0\relax
   \beamer@ststart#1\beamer@stend%
 }
 
+\mode
+<all>
 
 
-\common
-
 %%% Local Variables: 
 %%% mode: latex
 %%% TeX-master: "~/texmf/tex/latex/beamer/examples/beamerexample1.tex"

File base/beamerbasemodes.sty

 % This program can be redistributed and/or modified under the terms
 % of the GNU Public License, version 2.
 
+\RequirePackage{beamerbasedecode}
 
 %
 % Presentation/article stuff
     \endlinechar`\^^M \catcode`\^^M=12 \beamer@processline}
 
 {\catcode`\^^M=12\endlinechar=-1%
- \long\gdef\beamer@processline#1^^M{%
-   \def\beamer@test{#1}%
-    \ifx\beamer@test\beamer@stoparticle%
-      \let\next=\article%
+  \long\gdef\beamer@processline#1^^M{%
+    \def\beamer@test{#1}%
+    \ifx\beamer@test\beamer@stopmode%
+      \let\next=\mode%
     \else%
-      \ifx\beamer@test\beamer@stoppresentation%
-        \let\next=\presentation%
+      \ifx\beamer@test\beamer@stoparticle%
+        \let\next=\article%
       \else%
-        \ifx\beamer@test\beamer@stopcommon%
-          \let\next=\common%
+        \ifx\beamer@test\beamer@stoppresentation%
+          \let\next=\presentation%
         \else%
-          \ifx\beamer@test\beamer@stopdocument%
-            \let\next=\beamer@enddocument%
-          \else
-            \ifx\beamer@test\beamer@begindocument%
-              \let\next=\beamer@startdocument%
+          \ifx\beamer@test\beamer@stopcommon%
+            \let\next=\common%
+          \else%
+            \ifx\beamer@test\beamer@stopdocument%
+              \let\next=\beamer@enddocument%
             \else
-              \let\next=\beamer@processline%
-          \fi%  
-          \fi%  
+              \ifx\beamer@test\beamer@begindocument%
+                \let\next=\beamer@startdocument%
+              \else
+                \let\next=\beamer@processline%
+              \fi%  
+            \fi%  
+          \fi%
         \fi%
       \fi%
     \fi%
 \def\beamer@startdocument{\beamer@closer\begin{document}\def\beamer@closer{}\common}
 \def\beamer@closer{}
 {\escapechar=-1\relax%
+  \xdef\beamer@stopmode{\string\\mode}
   \xdef\beamer@stoparticle{\string\\article}
   \xdef\beamer@stoppresentation{\string\\presentation}
   \xdef\beamer@stopcommon{\string\\common}
   \xdef\beamer@stopdocument{\string\\end\string\{document\string\}}
   \xdef\beamer@begindocument{\string\\begin\string\{document\string\}}
-  \xdef\beamer@stopsection{\string\\section}
-  \xdef\beamer@stopsubsection{\string\\subsection}
-  \xdef\beamer@stoppart{\string\\part}
-  \xdef\beamer@stopframe{\string\\frame}
 }
 \newbox\beamer@commentbox
 \def\beamer@startcommentinframe{%
 
 \def\beamer@outsidemode{\afterassignment\beamer@treat\let\beamer@nexttoken=}
 \def\beamer@treat{%
-  \ifx\beamer@nexttoken\frame\let\next=\beamer@stopoutsidemode%
-  \else\ifx\beamer@nexttoken\note\let\next=\beamer@stopoutsidemode%
-  \else\ifx\beamer@nexttoken\noteitems\let\next=\beamer@stopoutsidemode%
-  \else\ifx\beamer@nexttoken\appendix\let\next=\beamer@stopoutsidemode%
-  \else\ifx\beamer@nexttoken\againframe\let\next=\beamer@stopoutsidemode%
-  \else\ifx\beamer@nexttoken\section\let\next=\beamer@stopoutsidemode%
-  \else\ifx\beamer@nexttoken\subsection\let\next=\beamer@stopoutsidemode%
-  \else\ifx\beamer@nexttoken\part\let\next=\beamer@stopoutsidemode%
-  \else\ifx\beamer@nexttoken\article\let\next=\beamer@stopoutsidemode%
-  \else\ifx\beamer@nexttoken\common\let\next=\beamer@stopoutsidemode%
-  \else\ifx\beamer@nexttoken\presentation\let\next=\beamer@stopoutsidemode%
-  \else\ifx\beamer@nexttoken\end\let\next=\beamer@checkenddoc%
-  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
+  \ifx\beamer@nexttoken\frame\let\next=\beamer@stopoutsidemode\fi%
+  \ifx\beamer@nexttoken\notes\let\next=\beamer@stopoutsidemode\fi%
+  \ifx\beamer@nexttoken\noteitems\let\next=\beamer@stopoutsidemode\fi%
+  \ifx\beamer@nexttoken\appendix\let\next=\beamer@stopoutsidemode\fi%
+  \ifx\beamer@nexttoken\againframe\let\next=\beamer@stopoutsidemode\fi%
+  \ifx\beamer@nexttoken\section\let\next=\beamer@stopoutsidemode\fi%
+  \ifx\beamer@nexttoken\subsection\let\next=\beamer@stopoutsidemode\fi%
+  \ifx\beamer@nexttoken\part\let\next=\beamer@stopoutsidemode\fi%
+  \ifx\beamer@nexttoken\article\let\next=\beamer@stopoutsidemode\fi%
+  \ifx\beamer@nexttoken\mode\let\next=\beamer@stopoutsidemode\fi%
+  \ifx\beamer@nexttoken\common\let\next=\beamer@stopoutsidemode\fi%
+  \ifx\beamer@nexttoken\presentation\let\next=\beamer@stopoutsidemode\fi%
+  \ifx\beamer@nexttoken\end\let\next=\beamer@checkenddoc\fi%
   \next}
 
 \def\beamer@stopoutsidemode{\beamer@nexttoken}
   \next}
 \def\beamer@enddoc{document}
 
-\def\articleoutsideframe{%
+\def\beamer@modeoutsideframe{%
   \beamer@closer%
-  \gdef\beamer@mode{\articleoutsideframe}%
+  \gdef\beamer@mode{\beamer@modeoutsideframe}%
   \ifbeamer@inpresentation%
     \let\next=\beamer@outsidemode%
     \gdef\beamer@closer{}%
   \beamer@mode\par}
 \def\beamer@common{\gdef\beamer@mode{\common}}
 
+%
+% Mode command
+%
+\def\mode{\@ifstar\beamer@modeoutsideframe\beamer@@@mode}
+\def\beamer@@@mode<#1>{\beamer@closer\@ifnextchar\bgroup{\beamer@modeinline<#1>}{\beamer@switchmode<#1>}}
+\long\def\beamer@modeinline<#1>#2{%
+  \gdef\beamer@closer{}%
+  \def\beamer@doifnotinframe{\@gobble}\def\beamer@doifinframe{\@firstofone}%
+  {\beamer@saveanother\beamer@slideinframe=1\relax%
+   \setbox0=\hbox{\beamer@decode#1| stop:0| }%
+   \beamer@restoreanother}\beamer@donow{#2}%
+  \beamer@mode\par}
+\def\beamer@switchmode<#1>{%
+  \gdef\beamer@mode{\beamer@switchmode<#1>}%
+  \def\beamer@doifnotinframe{%
+    \let\next=\beamer@startcomment%
+    \gdef\beamer@closer{\endgroup}%
+  }%
+  \def\beamer@doifinframe{%
+    \let\next=\relax%
+    \gdef\beamer@closer{}%
+   }%
+  {\beamer@saveanother\beamer@slideinframe=1\relax%
+   \setbox0=\hbox{\beamer@decode#1| stop:0| }%
+   \beamer@restoreanother}\beamer@donow%
+  \next}
 
-\common
+\mode<all>
 
 \def\beamer@savemode{\expandafter\gdef\expandafter\beamer@savedmode\expandafter{\beamer@mode}}
 \def\beamer@resumemode{\beamer@savedmode}

File base/beamerbasenavigation.sty

 % of the GNU Public License, version 2.
 
 
-\presentation
+\mode<presentation>
 
 %
 % Navigation buttons
   \hyperlink{Navigation#2}}}
 
 
-\common
+\mode
+<all>
 
 %%% Local Variables: 
 %%% mode: latex

File base/beamerbasenotes.sty

 
 
 
-\presentation
+\mode<presentation>
 
 \newbox\beamer@frameboxcopy
 
 }
 
 
-\article
+\mode
+<article>
 {
   \long\def\note#1{}
-  \long\def\notes#1{}
   \long\def\noteitems#1{}
-  \long\def\noteitem#1{}
+  \newcommand<>\note[1]{}
+  \newcommand<>\noteitem[1]{}
 }
 
 
 
-\common
-% End in common mode
+\mode
+<all>
 
 
 %%% Local Variables: 

File base/beamerbaseoptions.sty

 \long\def\beamer@dokv#1[#2]#3{\define@key{\@currname}{#1}[#2]{#3}}
 
 
-\common
-
 %%% Local Variables: 
 %%% mode: latex
 %%% TeX-master: "~/texmf/tex/latex/beamer/examples/beamerexample1.tex"

File base/beamerbaseoverlay.sty

 % of the GNU Public License, version 2.
 
 
-\presentation
+%
+%
+% Basic overlay commands
+%
+%
+
+\long\def\beamer@ifnextcharospec#1#2{%
+  \def\reserved@a{#1}%
+  \def\reserved@b{#2}%
+  \futurelet\@let@token\beamer@ifnch}
+\def\beamer@ifnch{%
+  \ifx\@let@token<%
+    \let\reserved@c\reserved@a%
+  \else%
+    \let\reserved@c\reserved@b%
+  \fi%
+  \reserved@c}
+
+%
+% \only
+%
+\def\only{\@ifnextchar<{\beamer@only}{\beamer@@only}}
+\long\def\beamer@only<#1>#2{%
+  \def\beamer@doifnotinframe{}\def\beamer@doifinframe{#2}%
+  {\setbox0=\hbox{\beamer@decode#1| stop:0| }}\beamer@donow}
+\long\def\beamer@@only#1{\beamer@ifnextcharospec{\beamer@@@only{#1}}{#1}}
+\long\def\beamer@@@only#1<#2>{%
+  \def\beamer@doifnotinframe{}\def\beamer@doifinframe{#1}%
+  {\setbox0=\hbox{\beamer@decode#2| stop:0| }}\beamer@donow}
+
+%
+% \alt and \altenv
+%
+\def\alt{\@ifnextchar<{\beamer@alt}{\beamer@alttwo}}
+\long\def\beamer@alttwo#1#2{\beamer@ifnextcharospec{\beamer@altget{#1}{#2}}{#1}}
+\long\def\beamer@altget#1#2<#3>{%
+  \def\beamer@doifnotinframe{#2}\def\beamer@doifinframe{#1}%
+  {\setbox0=\hbox{\beamer@decode#3| stop:0| }}\beamer@donow}
+\long\def\beamer@alt<#1>#2#3{%
+  \def\beamer@doifnotinframe{#3}\def\beamer@doifinframe{#2}%
+  {\setbox0=\hbox{\beamer@decode#1| stop:0| }}\beamer@donow}
+
+
+\def\altenv{\@ifnextchar<{\beamer@altenv}{\beamer@@@altenv}}
+\def\beamer@altenv<#1>{\beamer@@altenv{<#1>}}
+\long\def\beamer@@@altenv#1#2#3#4{\beamer@ifnextcharospec{\beamer@altenvsort{#1}{#2}{#3}{#4}}{\beamer@@altenv{}{#1}{#2}{#3}{#4}}}
+\long\def\beamer@altenvsort#1#2#3#4<#5>{\beamer@@altenv{<#5>}{#1}{#2}{#3}{#4}}
+\long\def\beamer@@altenv#1#2#3#4#5{\alt#1{\long\def\beamer@eoenv{#3}#2}{\long\def\beamer@eoenv{#5}#4}}
+\def\endaltenv{\beamer@eoenv}
+
+%
+% \action and actionenv
+%
+\def\beamer@plus{+}
+
+\def\action{\@ifnextchar<{\beamer@parsedaction}{\beamer@parsedaction<+>}}
+\long\def\beamer@parsedaction<#1>#2{%
+  \def\beamer@doifnotinframe{}\def\beamer@doifinframe{}%
+  {{\setbox0=\hbox{\beamer@decode#1| stop:0| }}}%
+  \ifx\beamer@decodefound\beamer@plus%
+    \long\def\beamer@todo{#2}%
+  \else%
+    \expandafter\long\expandafter\def\expandafter\beamer@todo%
+    \expandafter{\expandafter\uncover\expandafter<\beamer@decodefound>{#2}}%
+  \fi%
+  \expandafter\beamer@processactions\beamer@decaction{}%
+  \beamer@todo}
+
+\def\beamer@processactions#1{%
+  \beamer@ifempty{#1}{}{%
+    \expandafter\beamer@@processactions\expandafter{\beamer@todo}#1}}
+\long\def\beamer@@processactions#1#2<#3>{%
+  \expandafter\long\expandafter\def\expandafter\beamer@todo\expandafter{%
+    \csname#2\endcsname<#3>{#1}}%
+  \beamer@processactions}
+
+\def\actionenv{\beamer@ifnextcharospec{\beamer@parsedactionenv}{\beamer@parsedactionenv<+>}}
+\def\beamer@parsedactionenv<#1>{%
+  \def\beamer@doifnotinframe{}\def\beamer@doifinframe{}%
+  {{\setbox0=\hbox{\beamer@decode#1| stop:0| }}}%
+  \ifx\beamer@decodefound\beamer@plus%
+    \def\beamer@todobegin{}%
+    \def\beamer@todoend{}%
+  \else%
+    \edef\beamer@todobegin{\noexpand\begin{uncoverenv}<\beamer@decodefound>}%
+    \def\beamer@todoend{\end{uncoverenv}}
+  \fi%
+  \expandafter\beamer@processactionsbegin\beamer@decaction{}%
+  \expandafter\beamer@processactionsend\beamer@decaction{}%
+  \beamer@todobegin}
+\def\endactionenv{\beamer@todoend}
+
+\def\beamer@processactionsbegin#1{%
+  \beamer@ifempty{#1}{}{%
+    \expandafter\beamer@@processactionsbegin\expandafter{\beamer@todobegin}#1}}
+\long\def\beamer@@processactionsbegin#1#2<#3>{%
+  \def\beamer@todobegin{\begin{#2env}<#3>#1}%
+  \beamer@processactionsbegin}
+
+
+\def\beamer@processactionsend#1{%
+  \beamer@ifempty{#1}{}{%
+    \expandafter\beamer@@processactionsend\expandafter{\beamer@todoend}#1}}
+\long\def\beamer@@processactionsend#1#2<#3>{%
+  \def\beamer@todoend{#1\end{#2env}}%
+  \beamer@processactionsend}
+
+
+%
+% \temporal
+%
+\def\@temporal<#1>#2#3#4{% past, present, future
+  \def\beamer@doifnotinframe{\beamer@picked}\def\beamer@doifinframe{#3}%
+  {\setbox0=\hbox{\beamer@localanotherslidefalse\beamer@decode#1| stop:0|
+      \ifbeamer@localanotherslide\gdef\beamer@picked{#2}\else\gdef\beamer@picked{#4}\fi}}\beamer@donow}
+
+
+%
+% \newoverlaycommand
+%
+\def\beameroriginal#1{\csname @orig\string#1\endcsname}
+
+
+\newcount\beamer@argscount
+
+%
+% newenvironment extension
+%
+\let\beamer@orignewenvironment=\newenvironment
+
+\def\newenvironment{\@ifnextchar<{\beamer@newenv}{\beamer@orignewenvironment}}
+\def\beamer@newenv<>{\@star@or@long\beamer@new@environment}
+\def\beamer@new@environment#1{\@ifnextchar[{\beamer@@newenv{#1}}{\beamer@newenvnoopt{#1}{0}}}
+\def\beamer@@newenv#1[#2]{\@ifnextchar[{\beamer@newenvopt{#1}{#2}}{\beamer@newenvnoopt{#1}{#2}}}
+\long\def\beamer@newenvnoopt#1#2#3#4{%
+  \expandafter\newcommand\expandafter<\expandafter>\csname#1\endcsname[#2]{#3}%
+  \expandafter\long\expandafter\def\csname end#1\endcsname{#4}%
+}
+\long\def\beamer@newenvopt#1#2[#3]#4#5{%
+  \expandafter\newcommand\expandafter<\expandafter>\csname#1\endcsname[#2][#3]{#4}%
+  \expandafter\long\expandafter\def\csname end#1\endcsname{#5}%
+}
+
+
+\let\beamer@origrenewenvironment=\renewenvironment
+
+\def\renewenvironment{\@ifnextchar<{\beamer@renewenv}{\beamer@origrenewenvironment}}
+\def\beamer@renewenv<>#1{%
+  \edef\beamer@do{\csname original#1\endcsname=\expandafter\noexpand\csname#1\endcsname}
+  \expandafter\let\beamer@do%
+  \edef\beamer@do{\csname endoriginal#1\endcsname=\expandafter\noexpand\csname end#1\endcsname}
+  \expandafter\let\beamer@do%
+  \newenvironment<>{#1}}
+
+
+%
+% newcommand extension
+%
+\let\beamer@orignewcommand=\newcommand
+
+\def\newcommand{\@ifnextchar<{\beamer@newcom}{\beamer@orignewcommand}}
+\def\beamer@newcom<>{\@star@or@long\beamer@new@command}
+\def\beamer@new@command#1{\@ifnextchar[{\beamer@@newcom{#1}}{\beamer@newcomnoopt{#1}{0}}}
+\def\beamer@@newcom#1[#2]{\@ifnextchar[{\beamer@newcomopt{#1}{#2}}{\beamer@newcomnoopt{#1}{#2}}}
+\long\def\beamer@newcomnoopt#1#2#3{%
+  \ifnum#2=0\relax%
+    \expandafter\def\expandafter#1\expandafter{\expandafter\beamer@sortzero\expandafter{\csname beamerx@\string#1\endcsname}}%
+  \else
+    \expandafter\def\expandafter#1\expandafter{\expandafter\beamer@sort\expandafter{\csname beamerx@\string#1\endcsname}{#2}}%
+  \fi%
+  \beamer@argscount=#2\relax%
+  \advance\beamer@argscount by 1\relax%
+  \expandafter\newcommand\csname beamerx@\string#1\endcsname[\beamer@argscount]{#3}%
+}
+\long\def\beamer@newcomopt#1#2[#3]#4{%
+  \expandafter\def\expandafter#1\expandafter{\expandafter\beamer@presort\expandafter{\csname beamerx@\string#1\endcsname}{#2}{#3}}%
+  \beamer@argscount=#2\relax%
+  \advance\beamer@argscount by 1\relax%
+  \expandafter\newcommand\csname beamerx@\string#1\endcsname[\beamer@argscount]{#4}%
+}
+
+\let\beamer@origrenewcommand=\renewcommand
+
+\def\renewcommand{\@ifnextchar<{\beamer@renewcom}{\beamer@origrenewcommand}}
+\def\beamer@renewcom<>#1{%
+  \expandafter\def\expandafter\beamer@name\expandafter{\csname @orig\string#1\endcsname}%
+  \expandafter\let\beamer@name=#1\relax%
+  \newcommand<>#1}
+
+
+\long\def\beamer@presort#1#2#3{%
+  \long\def\beamer@todo{#1}%
+  \def\beamer@ospec{}%
+  \beamer@argscount=#2\relax%
+  \beamer@prechecka{#3}}
+\long\def\beamer@prechecka#1{\@ifnextchar<{\beamer@preget{#1}}{\beamer@precheckb{#1}}}
+\long\def\beamer@preget#1<#2>{\def\beamer@ospec{<#2>}\beamer@precheckb{#1}}
+\long\def\beamer@precheckb#1{\@ifnextchar[{\beamer@pregetb}{\beamer@pregetb[#1]}}
+\long\def\beamer@pregetb[#1]{%
+  \expandafter\long\expandafter\def\expandafter\beamer@todo\expandafter{\beamer@todo{#1}}%
+  \advance\beamer@argscount by-1\relax%
+  \beamer@parseargs%
+} 
+
+\def\beamer@sortzero#1{\beamer@ifnextcharospec{\beamer@sortzeroread{#1}}{#1{}}}
+\def\beamer@sortzeroread#1<#2>{#1{<#2>}}
+
+
+\def\beamer@sort#1#2{%
+  \long\def\beamer@todo{#1}%
+  \def\beamer@ospec{}%
+  \beamer@argscount=#2\relax%
+  \beamer@parseargs}
+
+\def\beamer@parseargs{%
+  \ifnum\beamer@argscount=0%
+    \let\next=\beamer@finalargscheck%
+  \else%
+    \let\next=\beamer@lookforarg%
+  \fi%
+  \next}
+\def\beamer@lookforarg{%
+  \@ifnextchar<\beamer@foundspec\beamer@readarg}
+\def\beamer@foundspec<#1>{%
+  \def\beamer@ospec{<#1>}%
+  \beamer@lookforarg}
+\long\def\beamer@readarg#1{%
+  \expandafter\long\expandafter\def\expandafter\beamer@todo\expandafter{\beamer@todo{#1}}%
+  \advance\beamer@argscount by-1\relax%
+  \beamer@parseargs%
+}
+
+\def\beamer@finalargscheck{\beamer@ifnextcharospec\beamer@finalspec\beamer@finalnospec}
+\def\beamer@finalspec<#1>{\def\beamer@ospec{<#1>}\beamer@finalnospec}
+\def\beamer@finalnospec{%
+  \expandafter\beamer@todo\expandafter{\beamer@ospec}}
+
+
+
+
+\mode<presentation>
 
 
 % commands for smuggling skips past
 \beamer@coveringdepth=0
 
 
-\article
+\mode
+<article>
 {
   \def\beamersetuncovermixins#1#2{}
 }
 
 \newcommand{\unpause}{\beamer@endpause\gdef\beamer@endpause{}}
 
-\article
+\mode
+<article>
 {
   \newcommand\pause[1][]{}
 }
 \let\beamer@@trivlist=\@trivlist
 
 
-\article
+\mode
+<article>
 {
   \AtBeginDocument{%
     \let\beamer@origitem=\item
 %
 %
 
-\common
+\mode
+<all>
 {
   \let\beamer@verb@egroup=\verb@egroup
 
 %
 
 
-\common
+\mode
+<all>
 {
+  \newcommand\beamer@gobbleoptional[2][]{}
   \newcommand\beamer@gobbleoptionalinsp[2][]{\ignorespaces}
 }
 
 \newenvironment{onlyenv}{\begin{altenv}{}{}{\begingroup\setbox0=\vbox\bgroup}{\egroup\endgroup}}{\end{altenv}}
 \renewcommand<>{\color}{\alt#1{\beameroriginal{\color}}{\beamer@gobbleoptionalinsp}}
 
-\article
+\mode
+<article>
 {
   \newcommand{\uncover}{\alt{\@firstofone}{\@gobble}}
   \newcommand{\visible}{\alt{\@firstofone}{\@gobble}}
   }
 }
 
-\common
+\mode
+<all>
 {
   \renewcommand<>{\textbf}{\only#1{\beameroriginal{\textbf}}}
   \renewcommand<>{\textit}{\only#1{\beameroriginal{\textit}}}
 
 \renewcommand<>{\hypertarget}[2]{\only#3{\beameroriginal{\hypertarget}{#1}{#2}}}
 
-\article
+\mode
+<article>
 {
   \AtBeginDocument{
     % These have to be done late...
 
 \newcommand<>{\emph}[1]{{\only#2{\itshape}#1}}
 
-\article
+\mode
+<article>
 {
   \renewcommand<>{\emph}{\only#1{\beameroriginal\emph}}
 }
   \box\beamer@areabox%
 }
 
-\article
+\mode
+<article>
 {
   \newenvironment{overlayarea}[2]{}{}% no effect
 }
   \setbox\beamer@animcurrent=\vbox\bgroup\begin{minipage}[t]{\beamer@animwd}%
 }
 
-\article
+\mode
+<article>
 {
   \newenvironment{overprint}[1][]%
     {\begin{onlyenv}}
   \edef\beamer@temp{{pdfpagetransition={#2 \beamer@transdir\space\beamer@dur}}}
   \expandafter\hypersetup\beamer@temp}
 
-\article
+\mode
+<article>
 {
-  \def\beamer@dotrans#1{\@ifnextchar[{\beamer@@dotrans{#1}}{\beamer@@dotrans{#1}[]}}
-  \def\beamer@@dotrans#1[#2]{}
+  \newcommand\beamer@dotrans[2][]{}
 }
 
-\common
+\mode
+<all>
 {
   \newcommand<>{\transblindshorizontal}[1][]{\only#2{\beamer@dotrans[#1]{Blinds /Dm /H}}}
   \newcommand<>{\transblindsvertical}[1][]{\only#2{\beamer@dotrans[#1]{Blinds /Dm /V}}}
 
 \newcommand<>{\transduration}[1]{\only#2{\hypersetup{pdfpageduration=#1}}}
 
-\article
+\mode
+<article>
 {
   \newcommand<>{\transduration}[1]{}
 }
   \fi%  
 }
 
-\article
+\mode
+<article>
 {
   \def\animate<#1>{}
   \def\animatevalue<#1-#2>#3#4#5{#3=#4}
 \def\beamer@label<#1>#2{\alt<#1>{\beamer@origlabel{#2}\beamer@nameslide{#2}}{}}
 \def\beamer@label@in@display<#1>#2{\alt<#1>{\beamer@origlabel@in@display{#2}\beamer@nameslide{#2}}{}}  
 
-\article
+\mode
+<article>
 {
   \AtBeginDocument{
     % Has to be done late...
 
 
 
-\common
+\mode
+<all>
 
 %%% Local Variables: 
 %%% mode: latex

File base/beamerbasesection.sty

 % of the GNU Public License, version 2.
 
 
-\presentation
+\mode<presentation>
+
+
+\mode
+<all>
+{
+  \def\beamer@secgobble{\@ifnextchar*{\beamer@secstargobble}{\beamer@gobbleoptional}}
+  \def\beamer@secstargobble*{\beamer@gobbleoptional}
+}
 
 
 %
 \renewcommand\thepart{\@arabic\c@part}
 \beamer@partstartpage=1
 
-\def\part{\@ifnextchar[\@part\@@part}
-\long\def\@@part#1{\@part[#1]{#1}}
-\long\def\@part[#1]#2{%
+\newcommand<>{\part}{\alt#1{\@dblarg\beamer@part}{\beamer@gobbleoptional}}
+\long\def\beamer@part[#1]#2{%
   \beamer@savemode%
   \refstepcounter{part}%
   \def\beamer@partname{#2}%
   \xdef\partlink{{Navigation\the\c@page}{\noexpand\beamer@partname}}%
   \xdef\partlinkshort{{Navigation\the\c@page}{\noexpand\beamer@partnameshort}}%
   \beamer@tempcount=\c@page\advance\beamer@tempcount by -1%
-  \addtocontents{nav}{\protect\headcommand{\protect\beamer@partpages{\the\beamer@partstartpage}{\the\beamer@tempcount}}}%
-  \addtocontents{nav}{\protect\headcommand{\protect\beamer@sectionpages{\the\beamer@sectionstartpage}{\the\beamer@tempcount}}}%
-  \addtocontents{nav}{\protect\headcommand{\protect\beamer@subsectionpages{\the\beamer@subsectionstartpage}{\the\beamer@tempcount}}}%
+  \addtocontents{nav}{\protect\headcommand{%
+      \protect\beamer@partpages{\the\beamer@partstartpage}{\the\beamer@tempcount}}}%
+  \addtocontents{nav}{\protect\headcommand{%
+      \protect\beamer@sectionpages{\the\beamer@sectionstartpage}{\the\beamer@tempcount}}}%
+  \addtocontents{nav}{\protect\headcommand{%
+      \protect\beamer@subsectionpages{\the\beamer@subsectionstartpage}{\the\beamer@tempcount}}}%
   \beamer@partstartpage=\c@page%
   \beamer@sectionstartpage=\c@page%
   \beamer@subsectionstartpage=\c@page%
     \beamer@insertshort{\expandafter\hyperlink\partlinkshort}%
   }}
 
-\common
+\mode
+<all>
 {
   \long\def\AtBeginPart#1{%
     \def\beamer@atbeginpart{#1}}
 }
 
 
+\mode
+<article>
+{
+  \ifx\part\@undefined%
+  \else
+    \renewcommand<>{\part}{\alt#1{\beameroriginal\part}{\beamer@gobbleoptional}}
+  \fi
+}
+
+
 %
 % Section Definitions
 %
 \beamer@sectionstartpage=1\relax
 \beamer@tocsectionnumber=0\relax
 
-\def\section{\@ifnextchar[\@section\@@section}
-\def\@@section{\@ifnextchar*\@@ssection\@@@section}
-\long\def\@@ssection*#1{\@section[#1]{}}
-\long\def\@@@section#1{\@section[#1]{#1}}
-\long\def\@section[#1]#2{%
+\newcommand<>{\section}{\alt#1{\@ifnextchar[\beamer@section\beamer@@section}{\beamer@secgobble}}
+
+\def\beamer@@section{\@ifnextchar*\beamer@@ssection\beamer@@@section}
+\long\def\beamer@@ssection*#1{\beamer@section[#1]{}}
+\long\def\beamer@@@section#1{\beamer@section[#1]{#1}}
+\long\def\beamer@section[#1]#2{%
   \beamer@savemode%
   \refstepcounter{section}%
   \beamer@ifempty{#2}%
 \def\beamer@breakhere{}
 
 
-\common
+\mode
+<all>
 {
   \def\AtBeginSection{\@ifnextchar[{\beamer@AtBeginSection}{\beamer@@AtBeginSection}}
   \long\def\beamer@@AtBeginSection#1{\beamer@AtBeginSection[#1]{#1}}
   \AtBeginSection{}
 }
 
+\mode
+<article>
+{
+  \renewcommand<>{\section}{\alt#1{\beameroriginal\section}{\beamer@secgobble}}
+}
+
 
 %
 % Subsection Definitions
 
 \beamer@subsectionstartpage=1
 
-\def\subsection{\@ifnextchar[\@subsection\@@subsection}
-\def\@@subsection{\@ifnextchar*\@@ssubsection\@@@subsection}
-\long\def\@@ssubsection*#1{%
-  \beamer@ifempty{#1}{\beamer@untitledsubsection}{\@subsection[#1]{}}}
-\def\@@@subsection#1{\@subsection[#1]{#1}}
-\def\@subsection[#1]#2{%
+\newcommand<>{\subsection}{\alt#1{\@ifnextchar[\beamer@subsection\beamer@@subsection}{\beamer@secgobble}}
+
+\def\beamer@@subsection{\@ifnextchar*\beamer@@ssubsection\beamer@@@subsection}
+\long\def\beamer@@ssubsection*#1{%
+  \beamer@ifempty{#1}{\beamer@untitledsubsection}{\beamer@subsection[#1]{}}}
+\def\beamer@@@subsection#1{\beamer@subsection[#1]{#1}}
+\def\beamer@subsection[#1]#2{%
   \beamer@savemode%
   \refstepcounter{subsection}%
   \beamer@ifempty{#2}{\long\def\subsecname{#1}\long\def\lastsubsection{#1}}
   \def\lastsubsection{}}
 
 
-\common
+\mode
+<all>
 {
   \def\AtBeginSubsection{\@ifnextchar[{\beamer@AtBeginSubsection}{\beamer@@AtBeginSubsection}}
   \long\def\beamer@@AtBeginSubsection#1{\beamer@AtBeginSubsection[#1]{#1}}
   \AtBeginSubsection{}
 }
 
+\mode
+<article>
+{
+  \renewcommand<>{\subsection}{\alt#1{\beameroriginal\subsection}{\beamer@secgobble}}
+}
+
 
 %
 % Appendix stuff
 %
-\def\appendix{%
-  \part{\appendixname}
-  \addtocontents{nav}{\protect\headcommand{\protect\beamer@appendixpages{\the\c@page}}}}
 
+\newcommand<>\appendix{%
+  \only#1{\part{\appendixname}
+  \addtocontents{nav}{\protect\headcommand{\protect\beamer@appendixpages{\the\c@page}}}}}
 
-\common
+\mode
+<article>
+{
+  \ifx\appendix\@undefined
+  \else
+    \renewcommand<>{\appendix}{\only#1{\beameroriginal\appendix}}
+  \fi
+}
+
+
+\mode
+<all>
 
 %%% Local Variables: 
 %%% mode: latex

File base/beamerbasetemplates.sty

 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
 
 
-\presentation
+\mode<presentation>
 
 
 \RequirePackage{pgfshade}
   \end{pgfpicture}%    
   }}
 
-\article
+\mode
+<article>
 {
   \newcommand{\beamertemplatesolidbackgroundcolor}[1]{}
   \newcommand{\beamertemplateshadingbackground}[2]{}
   \usebibitemtemplate{\color{beamerstructure}\scriptsize\raise1.25pt\hbox{$\blacktriangleright$}}
 }
 
-\article
+\mode
+<article>
 {
   \newcommand{\beamertemplatebookbibitems}{}
   \newcommand{\beamertemplatearticlebibitems}{}
   {\opaqueness<1->{2}}}
 
 
-\article
+\mode
+<article>
 {
   \def\beamertemplatetransparentcovereddynamic{}
   \def\beamertemplatetransparentcovereddynamicmedium{}
   \insertnote
 }
 }
-\common
+
+\mode
+<all>
+

File base/beamerbasetitle.sty

 % of the GNU Public License, version 2.
 
 
-\presentation
+\mode<presentation>
 
 
 %
 \def\partpage{{\beamer@partpagetemplate}}
 \long\def\usepartpagetemplate#1{\def\beamer@partpagetemplate{#1}}
 
-\article
+\mode
+<article>
 {
   \def\partpage{}
 }
 
 
 
-\article
+\mode
+<article>
 {
   \let\beamer@origtitle=\title
   \renewcommand{\title}[2][]{\beamer@origtitle{#2}}
   }}
 
 
-\article
+\mode
+<article>
 {
   \let\beamer@origdate=\date
   \renewcommand{\date}[2][]{\beamer@origdate{#2}}
   }}
 
 
-\article
+\mode
+<article>
 {
   \let\beamer@origauthor=\author
   \renewcommand{\author}[2][]{\beamer@origauthor{#2}}
 
 
 
-\article
+\mode
+<article>
 {
   \ifx\institute\@undefined
     \newcommand{\institute}[2][]{}
 \def\logo#1{\def\insertlogo{\normalcolor#1}}
 \logo{}
 
-\article
+\mode
+<article>
 {
   \ifx\logo\@undefined
     \def\logo#1{}
 }
 
 
-\common
+\mode
+<all>
 
 
 %%% Local Variables: 

File base/beamerbasetoc.sty

 % of the GNU Public License, version 2.
 
 
-\presentation
+\mode<presentation>
 
 %
 % Local counters/ifs/dimensions
   \gdef\beamer@subsectiontemplateshaded{\def\beamer@breakhere{\\}#2}}
 
 
-\article
+\mode
+<article>
 {
   \AtBeginDocument{
     \let\beamer@origtableofcontents=\tableofcontents
 
 
 
-\common
+\mode
+<all>
 
 %%% Local Variables: 
 %%% mode: latex

File examples/beamerexample1.tex

-\documentclass[notes]{beamer}
+\documentclass[class=article]{beamer}
 
 % Try the class options [notes], [notesonly], [trans], [handout],
 % [red], [compress], [draft] and see what happens!
 % For a green structure color use:
 %\colorlet{structure}{green!50!black}
 
-%\article
-%{
-%  \usepackage{beamerbasearticle}
-%  \usepackage{fullpage}
-%}
+\mode<article>
+{
+  \usepackage{beamerbasearticle}
+  \usepackage{fullpage}
+}
 
 \beamertemplateshadingbackground{red!10}{blue!10}