Commits

Anonymous committed 4cf2f00

started working on article mode

  • Participants
  • Parent commits 6a526ed

Comments (0)

Files changed (8)

 beamer/base/beamerbaseboxes.sty
 beamer/base/beamerbasecolor.sty
 beamer/base/beamerbasecompatibility.sty
+beamer/base/beamerbasedecode.sty
 beamer/base/beamerbasefont.sty
 beamer/base/beamerbaseframe.sty
 beamer/base/beamerbaseframecomponents.sty
 beamer/base/beamerbaselocalstructure.sty
+beamer/base/beamerbasemodes.sty
 beamer/base/beamerbasemisc.sty
 beamer/base/beamerbasenavigation.sty
 beamer/base/beamerbaseoverlay.sty
   \fi%
   \beamer@next}
 
-
-\RequirePackage{beamerbasearticle}
-% Setup article mode
+\RequirePackage{beamerbasemodes}
+% Setup modes and check for article option
 
 \beamer@transferifnecessary
 
 \newcount\beamer@pausecount
 \newcount\beamer@animationtempa
 \newcount\beamer@animationtempb
-\newcount\beamer@minimum
 \newcount\beamer@xpos
 \newcount\beamer@ypos
 \newcount\beamer@showpartnumber
 \newcount\beamer@currentsubsection
-\newcount\beamer@slideinframe
 \newcount\beamer@coveringdepth
 \newcount\beamer@sectionadjust
 \newcount\beamer@tocsectionnumber
 \newif\ifbeamer@centered
 \newif\ifbeamer@draftmode
 \newif\ifbeamer@compressnotes
-\newif\ifbeamer@anotherslide
-\newif\ifbeamer@localanotherslide
 
 
 
 \RequirePackage{beamerbasecolor}
 % Headlines, sidebars, columns
 
+\RequirePackage{beamerbasedecode}
+% Overlay stuff
+
 \RequirePackage{beamerbaseoverlay}
 % Overlay stuff
 

base/beamerbasearticle.sty

 % This program can be redistributed and/or modified under the terms
 % of the GNU Public License, version 2.
 
+\RequirePackage{beamerbasedecode}
+% Overlay stuff
 
-%
-% Presentation/article stuff
-%
-% Copyright notice: Part of the following code is taken from the
-% package comment.sty by Victor Eijkhout
-%
+\gdef\beamer@currentmode{article}
 
-%
-% Comment stuff. This will also be needed, if we switch to another
-% class, so define it here already.
-%
-\newif\ifbeamer@inpresentation
-\beamer@inpresentationtrue
 
-\def\beamer@makeinnocent#1{\catcode`#1=12 }
-\def\beamer@startcomment{%
-    \begingroup%
-    \let\do\beamer@makeinnocent\dospecials%
-    \beamer@makeinnocent\^^L% and whatever other special cases
-    \endlinechar`\^^M \catcode`\^^M=12 \beamer@ignore}
+\newoverlaycommand{\pgfonly}{\beamer@insp}{\beamer@gobbleis}
+\newoverlaycommand{\only}{}{\@gobble}
+\newoverlaycommand{\uncover}{}{\@gobble}
+\newoverlaycommand{\invisible}{\@gobble}{}
+\renewoverlaycommand{\textbf}{\beameroriginal{\textbf}}{}
+\renewoverlaycommand{\textit}{\beameroriginal{\textit}}{}
+\renewoverlaycommand{\textsl}{\beameroriginal{\textsl}}{}
+\renewoverlaycommand{\textsf}{\beameroriginal{\textsf}}{}
+\renewoverlaycommand{\textrm}{\beameroriginal{\textrm}}{}
+\newoverlayenvironment{uncoverenv}{}{}{\begingroup\setbox0=\hbox\bgroup}{\egroup\endgroup}
+\newoverlayenvironment{onlyenv}{}{}{\begingroup\setbox0=\hbox\bgroup}{\egroup\endgroup}
+\newoverlaycommand{\emph}{\beameroriginal{\emph}}{}
 
-{\catcode`\^^M=12\endlinechar=-1%
- \gdef\beamer@ignore#1^^M{%
-    \expandafter\beamer@processline}
- \gdef\beamer@processline#1^^M{%
-   \def\beamer@test{#1}%
-    \ifx\beamer@test\beamer@stoparticle%
-      \let\next=\article%
-    \else%
-      \ifx\beamer@test\beamer@stoppresentation%
-        \let\next=\presentation%
-      \else%
-        \ifx\beamer@test\beamer@stopcommon%
-          \let\next=\common%
-        \else%
-          \ifx\beamer@test\beamer@stopdocument%
-            \let\next=\beamer@enddocument%
-          \else
-            \ifx\beamer@test\beamer@begindocument%
-              \let\next=\beamer@startdocument%
-            \else
-              \let\next=\beamer@processline%
-          \fi%  
-          \fi%  
-        \fi%
-      \fi%
-    \fi%
-    \next}
-}
-\def\article{\beamer@closer%
-  \ifbeamer@inpresentation%
-    \let\next=\beamer@startcomment%
-    \gdef\beamer@closer{\endgroup}%
-  \else%
-    \let\next=\relax%
-    \gdef\beamer@closer{}%
-  \fi%
-  \next}  
-
-\def\presentation{\beamer@closer%
-  \ifbeamer@inpresentation%
-    \let\next=\relax%
-    \gdef\beamer@closer{}%
-  \else%
-    \let\next=\beamer@startcomment%
-    \gdef\beamer@closer{\endgroup}%
-  \fi%
-  \next}
-\def\common{\beamer@closer\gdef\beamer@closer{}}
-\def\beamer@enddocument{\beamer@closer\end{document}}
-\def\beamer@startdocument{\beamer@closer\begin{document}\def\beamer@closer{}}
-\def\beamer@closer{}
-{\escapechar=-1\relax%
-  \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\}}
-}
-\newbox\beamer@commentbox
-\def\beamer@startcommentinframe{%
-  \begingroup%
-  \edef\beamer@closer{\egroup\beamer@closer}%
-  \setbox\beamer@commentbox=\vbox\bgroup\leavevmode}
-
-
-
-
-%
-% Stuff needed in both article and presentation version
-%
-\def\jobnamebeamerversion{}%
-
-\def\includeslide{\@ifnextchar[{\@includeslide}{\@includeslide[]}}
-\def\@includeslide[#1]#2{%
-  \ifx\jobnamebeamerversion\@empty%
-  \ClassError{beamer}{Invoke macro "setjobnamebeamerversion" first}{}%
-  \else%
-  \edef\beamer@args{[#1,page=\csname beamer@slide#2\endcsname]{\jobnamebeamerversion}}
-  \expandafter\pgfimage\beamer@args%
-  \fi}
-
-\def\setjobnamebeamerversion#1{%
-  \def\jobnamebeamerversion{#1}%
-  {\makeatletter
-  \@input{\jobnamebeamerversion.snm}}
+\AtBeginDocument{
+  % These have to be done late...
+  \newoverlaycommand{\label}{\beameroriginal{\label}}{}
+  \renewoverlaycommand{\hypertarget}{\beameroriginal{\hypertarget}}{\@gobble}
+  \renewoverlaycommand{\color}{\beameroriginal{\color}}{\beamer@gobbleoptional}
 }
 
+\newcommand\onlyarticle{\only<all:0| article:1>}
+\newcommand\onlypresentation{\only<article:0>}
 
+\def\frame#1{%
+  \beamer@slideinframe=1\relax%
+  \medskip
+  \begin{minipage}{12.6cm}
+    \hrule
+    \smallskip
+    #1
+    \smallskip
+    \par\hrule
+  \end{minipage}%
+  \medskip
+}
 
-%
-% Check whether we should initiate transfer to another class
-%
-
-% Extract class name, if present
-\def\beamer@classname{}
-\def\beamer@classoptions{}
-\def\beamer@classnamename{class}
-\def\beamer@eq{=,}
-\def\beamer@findclassname#1=#2,#3!{
-  \def\beamer@temp{#1}
-  \ifx\beamer@temp\beamer@classnamename
-    \def\beamer@classname{#2}
-    \beamer@stripsign#3!
-  \fi}
-\def\beamer@stripsign#1!{%
-  \def\beamer@temp{#1}
-  \ifx\beamer@temp\beamer@eq
-  % nothing to do
-  \else
-  \beamer@@stripsign#1!
-  \fi
-}
-\def\beamer@@stripsign#1,=,!{
-  \def\beamer@classoptions{#1}
-  }
-
-\def\beamer@transfer{%
-  % Prepare...
-  \def\beamer@slide##1##2{\expandafter\gdef\csname
-    beamer@slide##1\endcsname{##2}}
-
-  \beamer@inpresentationfalse
-  \edef\beamer@classwhat{[\beamer@classoptions]{\beamer@classname}}
-  \expandafter\LoadClass\beamer@classwhat
-  \endinput
-  }
-
-\expandafter\beamer@findclassname\@classoptionslist,=,!
-\ifx\beamer@classname\@empty
-  \let\beamer@transferifnecessary=\relax
-\else
-  % Need to transfer to another class soon
-  \let\beamer@transferifnecessary=\beamer@transfer
-\fi
 \endinput
 
 %%% Local Variables: 

base/beamerbasedecode.sty

+\ProvidesPackage{beamerbasedecode}[2004/01/10 ver 1.30]
+\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+
+
+% Copyright 2003 by Till Tantau <tantau@users.sourceforge.net>.
+%
+% This program can be redistributed and/or modified under the terms
+% of the GNU Public License, version 2.
+
+%
+% News
+%
+\newcount\beamer@slideinframe
+\newcount\beamer@minimum
+\newif\ifbeamer@anotherslide
+\newif\ifbeamer@localanotherslide
+
+
+% 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,... 
+%
+% As a side effect, \@another is called whenever the there is a number
+% in the list that is larger than the current serialnumber
+
+\def\beamer@decode{\global\beamer@minimum=10000\relax\gdef\beamer@decodefound{+}\beamer@@decodefind}
+\def\beamer@@decodefind{\futurelet\beamer@next\beamer@decodeinsertdefault}
+\def\beamer@decodeinsertdefault{\ifcat\beamer@next a%
+  \gdef\beamer@next{}%
+  \else%
+  \gdef\beamer@next{default:}%
+  \fi%
+  \expandafter\beamer@decodefind\beamer@next}
+
+\def\beamer@modestop{stop}
+\def\beamer@modeall{all}
+\def\beamer@decodefind#1:#2| {%
+  \def\beamer@mode{#1}%
+  \ifx\beamer@mode\beamer@modestop%
+    \expandafter\beamer@@decode\beamer@decodefound,!%
+    \let\beamer@next=\relax%
+  \else
+    \ifx\beamer@mode\beamer@currentmode%
+      \gdef\beamer@decodefound{#2}%
+    \else%
+      \ifx\beamer@mode\beamer@modeall%
+        \gdef\beamer@decodefound{#2}%
+      \fi%
+    \fi%
+    \let\beamer@next=\beamer@@decodefind%
+  \fi%
+  \beamer@next}
+
+\def\beamer@doifnotinframe{}
+\def\beamer@@decode{%
+  \@ifnextchar!%
+  {\beamer@decodeend}%
+  {%
+    \@ifnextchar+%
+    {\beamer@decodeall}{%
+      \@ifnextchar-%
+      {\beamer@decodeuntil}%
+      {\beamer@decodenumber}}}}
+\def\beamer@decodeend!{}
+\def\beamer@decodeall+,{%
+  \ifnum1<\beamer@minimum\global\beamer@minimum=1\fi%
+  \ifnum1>\beamer@slideinframe%
+  \global\beamer@anotherslidetrue%
+  \beamer@localanotherslidetrue%
+  \fi%
+  \gdef\beamer@doifnotinframe{\beamer@doifinframe}\beamer@@decode}
+\def\beamer@decodeuntil-#1,{%
+  \ifnum1<\beamer@minimum\global\beamer@minimum=1\fi%
+  \ifnum#1>\beamer@slideinframe\global\beamer@anotherslidetrue\beamer@localanotherslidetrue\fi%
+  \ifnum\beamer@slideinframe>#1\else\gdef\beamer@doifnotinframe{\beamer@doifinframe}\fi%
+  \beamer@@decode}
+\def\beamer@decodenumber#1{%
+  \@ifnextchar,%
+  {\beamer@decodeone{#1}}%
+  {\@ifnextchar-%
+    {\beamer@decodenumberto{#1}}%
+    {\beamer@decodegobble{#1}}}}
+\def\beamer@decodegobble#1#2{%
+  \beamer@decodenumber{#1#2}}
+\def\beamer@decodenumberto#1-{
+  \@ifnextchar,%
+  {\beamer@decodeto{#1}}%
+  {\beamer@decodebetween{#1}}}
+\def\beamer@decodeto#1,{%
+  \ifnum#1<\beamer@minimum\global\beamer@minimum=#1\fi%
+  \ifnum#1>\beamer@slideinframe\global\beamer@anotherslidetrue\beamer@localanotherslidetrue\fi%
+  \ifnum#1>\beamer@slideinframe\else\gdef\beamer@doifnotinframe{\beamer@doifinframe}\fi%
+  \beamer@@decode}
+\def\beamer@decodebetween#1#2,{%
+  \ifnum#1<\beamer@minimum\global\beamer@minimum=#1\fi%
+  \ifnum#1>\beamer@slideinframe\global\beamer@anotherslidetrue\beamer@localanotherslidetrue\fi%
+  \ifnum#2>\beamer@slideinframe\global\beamer@anotherslidetrue\beamer@localanotherslidetrue\fi%
+  \ifnum#1>\beamer@slideinframe\else\ifnum#2<\beamer@slideinframe\else\gdef\beamer@doifnotinframe{\beamer@doifinframe}\fi\fi%
+  \beamer@@decode}
+\def\beamer@decodeone#1,{%
+  \ifnum#1<\beamer@minimum\global\beamer@minimum=#1\fi%
+  \ifnum#1>\beamer@slideinframe\global\beamer@anotherslidetrue\beamer@localanotherslidetrue\fi%
+  \ifnum#1=\beamer@slideinframe\gdef\beamer@doifnotinframe{\beamer@doifinframe}\fi%
+  \beamer@@decode}
+
+\def\beamer@donow{\beamer@doifnotinframe}
+
+\def\beamer@saveanother{\let\beamer@savedif=\ifbeamer@anotherslide}
+\def\beamer@restoreanother{\global\let\ifbeamer@anotherslide=\beamer@savedif}
+
+
+
+
+
+%
+%
+% Basic overlay commands
+%
+%
+
+\def\beamer@parsebr#1{\@ifnextchar<{\beamer@@parsebr#1}{#1}}
+\def\beamer@@parsebr#1{\begingroup\catcode`:=12\catcode`|=12\beamer@parseinner{#1}}%
+\def\beamer@parseinner#1<#2>{\endgroup\edef\beamer@spec{<#2>}%
+  \expandafter#1\beamer@spec}
+
+\def\alt{\beamer@parsebr\@alt}
+\long\def\@alt<#1>#2#3{%
+  \def\beamer@doifnotinframe{#3}\def\beamer@doifinframe{#2}%
+  {\setbox0=\hbox{\beamer@decode#1| stop:| }}\beamer@donow}
+
+\def\temporal{\beamer@parsebr\@temporal}
+\long\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:|
+      \ifbeamer@localanotherslide\gdef\beamer@picked{#2}\else\gdef\beamer@picked{#4}\fi}}\beamer@donow}
+
+\def\beameroriginal#1{\csname @orig\string#1\endcsname}
+
+\long\def\newoverlaycommand#1#2#3{% In slides, #1 does #2, otherwise #3
+  \def#1{\@ifnextchar<{\@overlayparse{#2}{#3}}{#2}}}
+
+\long\def\renewoverlaycommand#1#2#3{% In slides, #1 does #2, otherwise #3
+  \edef\@name{\beameroriginal#1}
+  \expandafter\let\@name=#1\relax%
+  \def#1{\@ifnextchar<{\@overlayparse{#2}{#3}}{#2}}}
+
+\long\def\@overlayparse#1#2<#3>{\alt<#3>{#1}{#2}}
+
+\def\newoverlayenvironment#1{%
+  \@ifnextchar[{\@@newoverlayenvironment{#1}}{\@newoverlayenvironment{#1}}}
+
+\long\def\@newoverlayenvironment#1#2#3#4#5{% In slides, #1 forms an
+% environment with begin #2 and end #3, otherwise an environment with 
+% begin #4 and end #5
+  \newenvironment{#1}{}{}%
+  \expandafter\def\csname #1\endcsname{%
+    \@ifnextchar<{\beamer@parsebegin{#1}{#2}{#3}{#4}{#5}}{%
+      \expandafter\def\csname end#1\endcsname{#3}#2}}%
+  }
+    
+\long\def\beamer@parsebegin#1#2#3#4#5<#6>{%
+  \alt<#6>{% In slide case
+    \expandafter\def\csname end#1\endcsname{#3}%
+    #2}{%
+    \expandafter\def\csname end#1\endcsname{#5}%
+    #4}}
+
+\long\def\renewoverlayenvironment#1#2#3#4#5{%
+  \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
+  \renewenvironment{#1}{}{}%
+  \expandafter\def\csname #1\endcsname{%
+    \@ifnextchar<{\beamer@parsebegin{#1}{#2}{#3}{#4}{#5}}{%
+      \expandafter\def\csname end#1\endcsname{#3}#2}%
+    }%
+  }
+
+\long\def\@@newoverlayenvironment#1[1]#2#3#4#5{% Currently, this works
+% only for a single argument
+  \newenvironment{#1}{}{}%
+  \expandafter\new@command\csname @in#1\endcsname[1]{#2}%
+  \expandafter\new@command\csname @out#1\endcsname[1]{#4}%
+  \expandafter\long\expandafter\def\csname #1\endcsname##1{%
+    \@ifnextchar<{\beamer@parsebegin{#1}{\csname @in#1\endcsname{##1}}{#3}{\csname @out#1\endcsname{##1}}{#5}}{%
+      \expandafter\def\csname end#1\endcsname{#3}#2}}%
+}
+
+
+\long\def\beamer@gobbleoptional{\@ifnextchar[{\beamer@@gobbleoptional}{\beamer@@gobbleoptional[]}}
+\long\def\beamer@@gobbleoptional[#1]#2{}
+
+\long\def\beamer@ignoreoptional{\@ifnextchar[{\beamer@@ignoreoptional}{}}
+\long\def\beamer@@ignoreoptional[#1]{}
+
+\long\def\beamer@insp#1{\ignorespaces#1\ignorespaces}
+\long\def\beamer@gobbleis#1{\ignorespaces}
+
+
+
+%%% Local Variables: 
+%%% mode: latex
+%%% TeX-master: "~/texmf/tex/latex/beamer/examples/beamerexample1.tex"
+%%% End: 

base/beamerbaseframe.sty

 \def\beamer@@frame<#1>{\endgroup%
   \@ifnextchar[{\beamer@@@frame<#1>}{\beamer@@@frame<#1>[]}}
 \def\beamer@@@frame<#1>[#2]{%
+  \beamer@savemode%
   \def\beamer@frametheme{}%
   \def\beamer@resumename{}%
   \setkeys{beamerframe}{#2}%
   \beamer@howtotreatframe}
 \long\def\beamer@donoframe{%
   \beamer@slideinframe=1\relax%
-  \setbox\beamer@tempbox\vbox\bgroup\leavevmode\def\pause{}\afterassignment\beamer@checknoslide\let\beamer@next}
+  \setbox\beamer@tempbox\vbox\bgroup%
+    \leavevmode%
+    \def\pause{}%
+    \afterassignment\beamer@checknoslide\let\beamer@next}
 \def\beamer@checknoslide{%
   \ifcat\bgroup\noexpand\beamer@next%
   \let\beamer@do\beamer@reseteecodes%
     \clearpage%
   }
 }
-\def\beamer@reseteecodes{\gdef\beamer@entrycode{}\gdef\beamer@exitcode{}}
+\def\beamer@reseteecodes{\gdef\beamer@entrycode{}\gdef\beamer@exitcode{}\beamer@resumemode}
 
 
 

base/beamerbasemodes.sty

+\ProvidesPackage{beamerbasemodes}[2004/01/24 ver 1.30]
+\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+
+
+% Copyright 2003 by Till Tantau <tantau@users.sourceforge.net>.
+%
+% This program can be redistributed and/or modified under the terms
+% of the GNU Public License, version 2.
+
+
+%
+% Presentation/article stuff
+%
+% Copyright notice: Part of the following code is taken from the
+% package comment.sty by Victor Eijkhout
+%
+
+%
+% Comment stuff. This will also be needed, if we switch to another
+% class, so define it here already.
+%
+\newif\ifbeamer@inpresentation
+\beamer@inpresentationtrue
+
+\def\beamer@makeinnocent#1{\catcode`#1=12 }
+\def\beamer@startcomment{%
+    \begingroup%
+    \let\do\beamer@makeinnocent\dospecials%
+    \beamer@makeinnocent\^^L% and whatever other special cases
+    \endlinechar`\^^M \catcode`\^^M=12 \beamer@ignore}
+
+{\catcode`\^^M=12\endlinechar=-1%
+ \long\gdef\beamer@ignore#1^^M{%
+    \expandafter\beamer@processline}
+ \long\gdef\beamer@processline#1^^M{%
+   \def\beamer@test{#1}%
+    \ifx\beamer@test\beamer@stoparticle%
+      \let\next=\article%
+    \else%
+      \ifx\beamer@test\beamer@stoppresentation%
+        \let\next=\presentation%
+      \else%
+        \ifx\beamer@test\beamer@stopcommon%
+          \let\next=\common%
+        \else%
+          \ifx\beamer@test\beamer@stopdocument%
+            \let\next=\beamer@enddocument%
+          \else
+            \ifx\beamer@test\beamer@begindocument%
+              \let\next=\beamer@startdocument%
+            \else
+              \let\next=\beamer@processline%
+          \fi%  
+          \fi%  
+        \fi%
+      \fi%
+    \fi%
+    \next}
+}
+
+\def\beamer@enddocument{\beamer@closer\end{document}}
+\def\beamer@startdocument{\beamer@closer\begin{document}\def\beamer@closer{}\common}
+\def\beamer@closer{}
+{\escapechar=-1\relax%
+  \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{%
+  \begingroup%
+  \edef\beamer@closer{\egroup\beamer@closer}%
+  \setbox\beamer@commentbox=\vbox\bgroup\leavevmode}
+
+\def\beamer@outsidemode{\afterassignment\beamer@treat\let\beamer@nexttoken=}
+\def\beamer@treat{%
+  \ifx\beamer@nexttoken\frame\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%
+  \next}
+
+\def\beamer@stopoutsidemode{\beamer@nexttoken}
+\def\beamer@checkenddoc#1{%
+  \def\beamer@temp{#1}%
+  \ifx\beamer@temp\beamer@enddoc%
+    \let\next=\beamer@enddocument%
+  \else%
+    \let\next=\beamer@outsidemode%
+  \fi%
+  \next}
+\def\beamer@enddoc{document}
+
+\def\article{\beamer@closer%
+  \gdef\beamer@mode{\article}
+  \ifbeamer@inpresentation%
+    \let\next=\beamer@startcomment%
+    \gdef\beamer@closer{\endgroup}%
+  \else%
+    \let\next=\relax%
+    \gdef\beamer@closer{}%
+  \fi%
+  \next}  
+
+\def\articleoutsideframe{%
+  \beamer@closer%
+  \gdef\beamer@mode{\articleoutsideframe}
+  \ifbeamer@inpresentation%
+    \let\next=\beamer@outsidemode%
+    \gdef\beamer@closer{}%
+  \else%
+    \let\next=\relax%
+    \gdef\beamer@closer{}%
+  \fi%
+  \next}
+
+\def\presentation{\beamer@closer%
+  \gdef\beamer@mode{\presentation}
+  \ifbeamer@inpresentation%
+    \let\next=\relax%
+    \gdef\beamer@closer{}%
+  \else%
+    \let\next=\beamer@startcomment%
+    \gdef\beamer@closer{\endgroup}%
+  \fi%
+  \next}
+
+\def\common{\beamer@closer%
+  \beamer@closer\gdef\beamer@closer{}%
+  \gdef\beamer@mode{\common}}
+
+
+\common
+
+\def\beamer@savemode{\expandafter\gdef\expandafter\beamer@savedmode\expandafter{\beamer@mode}}
+\def\beamer@resumemode{\beamer@savedmode}
+
+
+
+%
+% Stuff needed in both article and presentation version
+%
+\def\jobnamebeamerversion{}%
+
+\def\includeslide{\@ifnextchar[{\@includeslide}{\@includeslide[]}}
+\def\@includeslide[#1]#2{%
+  \ifx\jobnamebeamerversion\@empty%
+  \ClassError{beamer}{Invoke macro "setjobnamebeamerversion" first}{}%
+  \else%
+  \edef\beamer@args{[#1,page=\csname beamer@slide#2\endcsname]{\jobnamebeamerversion}}
+  \expandafter\pgfimage\beamer@args%
+  \fi}
+
+\def\setjobnamebeamerversion#1{%
+  \def\jobnamebeamerversion{#1}%
+  {\makeatletter
+  \@input{\jobnamebeamerversion.snm}}
+}
+
+
+
+%
+% Check whether we should initiate transfer to another class
+%
+
+% Extract class name, if present
+\def\beamer@classname{}
+\def\beamer@classoptions{}
+\def\beamer@classnamename{class}
+\def\beamer@eq{=,}
+\def\beamer@findclassname#1=#2,#3!{
+  \def\beamer@temp{#1}
+  \ifx\beamer@temp\beamer@classnamename
+    \def\beamer@classname{#2}
+    \beamer@stripsign#3!
+  \fi}
+\def\beamer@stripsign#1!{%
+  \def\beamer@temp{#1}
+  \ifx\beamer@temp\beamer@eq
+  % nothing to do
+  \else
+  \beamer@@stripsign#1!
+  \fi
+}
+\def\beamer@@stripsign#1,=,!{
+  \def\beamer@classoptions{#1}
+  }
+
+\def\beamer@transfer{%
+  % Prepare...
+  \def\beamer@slide##1##2{\expandafter\gdef\csname
+    beamer@slide##1\endcsname{##2}}
+
+  \beamer@inpresentationfalse
+
+  \RequirePackage{beamerbasearticle}
+  
+  \edef\beamer@classwhat{[\beamer@classoptions]{\beamer@classname}}
+  \expandafter\LoadClass\beamer@classwhat
+  \endinput
+  }
+
+\expandafter\beamer@findclassname\@classoptionslist,=,!
+\ifx\beamer@classname\@empty
+  \let\beamer@transferifnecessary=\relax
+\else
+  % Need to transfer to another class soon
+  \let\beamer@transferifnecessary=\beamer@transfer
+\fi
+\endinput
+
+%%% Local Variables: 
+%%% mode: latex
+%%% TeX-master: ../examples/beamerexample1.tex
+%%% End: 

base/beamerbaseoverlay.sty

 % of the GNU Public License, version 2.
 
 
-% 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,... 
-%
-% As a side effect, \@another is called whenever the there is a number
-% in the list that is larger than the current serialnumber
-
-\def\beamer@decode{\global\beamer@minimum=10000\relax\gdef\beamer@decodefound{+}\beamer@@decodefind}
-\def\beamer@@decodefind{\futurelet\beamer@next\beamer@decodeinsertdefault}
-\def\beamer@decodeinsertdefault{\ifcat\beamer@next a%
-  \gdef\beamer@next{}%
-  \else%
-  \gdef\beamer@next{default:}%
-  \fi%
-  \expandafter\beamer@decodefind\beamer@next}
-
-\def\beamer@modestop{stop}
-\def\beamer@modeall{all}
-\def\beamer@decodefind#1:#2| {%
-  \def\beamer@mode{#1}%
-  \ifx\beamer@mode\beamer@modestop%
-    \expandafter\beamer@@decode\beamer@decodefound,!%
-    \let\beamer@next=\relax%
-  \else
-    \ifx\beamer@mode\beamer@currentmode%
-      \gdef\beamer@decodefound{#2}%
-    \else%
-      \ifx\beamer@mode\beamer@modeall%
-        \gdef\beamer@decodefound{#2}%
-      \fi%
-    \fi%
-    \let\beamer@next=\beamer@@decodefind%
-  \fi%
-  \beamer@next}
-
-\def\beamer@doifnotinframe{}
-\def\beamer@@decode{%
-  \@ifnextchar!%
-  {\beamer@decodeend}%
-  {%
-    \@ifnextchar+%
-    {\beamer@decodeall}{%
-      \@ifnextchar-%
-      {\beamer@decodeuntil}%
-      {\beamer@decodenumber}}}}
-\def\beamer@decodeend!{}
-\def\beamer@decodeall+,{%
-  \ifnum1<\beamer@minimum\global\beamer@minimum=1\fi%
-  \ifnum1>\beamer@slideinframe%
-  \global\beamer@anotherslidetrue%
-  \beamer@localanotherslidetrue%
-  \fi%
-  \gdef\beamer@doifnotinframe{\beamer@doifinframe}\beamer@@decode}
-\def\beamer@decodeuntil-#1,{%
-  \ifnum1<\beamer@minimum\global\beamer@minimum=1\fi%
-  \ifnum#1>\beamer@slideinframe\global\beamer@anotherslidetrue\beamer@localanotherslidetrue\fi%
-  \ifnum\beamer@slideinframe>#1\else\gdef\beamer@doifnotinframe{\beamer@doifinframe}\fi%
-  \beamer@@decode}
-\def\beamer@decodenumber#1{%
-  \@ifnextchar,%
-  {\beamer@decodeone{#1}}%
-  {\@ifnextchar-%
-    {\beamer@decodenumberto{#1}}%
-    {\beamer@decodegobble{#1}}}}
-\def\beamer@decodegobble#1#2{%
-  \beamer@decodenumber{#1#2}}
-\def\beamer@decodenumberto#1-{
-  \@ifnextchar,%
-  {\beamer@decodeto{#1}}%
-  {\beamer@decodebetween{#1}}}
-\def\beamer@decodeto#1,{%
-  \ifnum#1<\beamer@minimum\global\beamer@minimum=#1\fi%
-  \ifnum#1>\beamer@slideinframe\global\beamer@anotherslidetrue\beamer@localanotherslidetrue\fi%
-  \ifnum#1>\beamer@slideinframe\else\gdef\beamer@doifnotinframe{\beamer@doifinframe}\fi%
-  \beamer@@decode}
-\def\beamer@decodebetween#1#2,{%
-  \ifnum#1<\beamer@minimum\global\beamer@minimum=#1\fi%
-  \ifnum#1>\beamer@slideinframe\global\beamer@anotherslidetrue\beamer@localanotherslidetrue\fi%
-  \ifnum#2>\beamer@slideinframe\global\beamer@anotherslidetrue\beamer@localanotherslidetrue\fi%
-  \ifnum#1>\beamer@slideinframe\else\ifnum#2<\beamer@slideinframe\else\gdef\beamer@doifnotinframe{\beamer@doifinframe}\fi\fi%
-  \beamer@@decode}
-\def\beamer@decodeone#1,{%
-  \ifnum#1<\beamer@minimum\global\beamer@minimum=#1\fi%
-  \ifnum#1>\beamer@slideinframe\global\beamer@anotherslidetrue\beamer@localanotherslidetrue\fi%
-  \ifnum#1=\beamer@slideinframe\gdef\beamer@doifnotinframe{\beamer@doifinframe}\fi%
-  \beamer@@decode}
-
-\def\beamer@donow{\beamer@doifnotinframe}
-
-\def\beamer@saveanother{\let\beamer@savedif=\ifbeamer@anotherslide}
-\def\beamer@restoreanother{\global\let\ifbeamer@anotherslide=\beamer@savedif}
-
-
-
-
-
-%
-%
-% Basic overlay commands
-%
-%
-
-\def\beamer@parsebr#1{\@ifnextchar<{\beamer@@parsebr#1}{#1}}
-\def\beamer@@parsebr#1{\begingroup\catcode`:=12\catcode`|=12\beamer@parseinner{#1}}%
-\def\beamer@parseinner#1<#2>{\endgroup\edef\beamer@spec{<#2>}%
-  \expandafter#1\beamer@spec}
-
-\def\alt{\beamer@parsebr\@alt}
-\long\def\@alt<#1>#2#3{%
-  \def\beamer@doifnotinframe{#3}\def\beamer@doifinframe{#2}%
-  {\setbox0=\hbox{\beamer@decode#1| stop:| }}\beamer@donow}
-
-\def\temporal{\beamer@parsebr\@temporal}
-\long\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:|
-      \ifbeamer@localanotherslide\gdef\beamer@picked{#2}\else\gdef\beamer@picked{#4}\fi}}\beamer@donow}
-
-\def\beameroriginal#1{\csname @orig\string#1\endcsname}
-
-\long\def\newoverlaycommand#1#2#3{% In slides, #1 does #2, otherwise #3
-  \def#1{\@ifnextchar<{\@overlayparse{#2}{#3}}{#2}}}
-
-\long\def\renewoverlaycommand#1#2#3{% In slides, #1 does #2, otherwise #3
-  \edef\@name{\beameroriginal#1}
-  \expandafter\let\@name=#1\relax%
-  \def#1{\@ifnextchar<{\@overlayparse{#2}{#3}}{#2}}}
-
-\long\def\@overlayparse#1#2<#3>{\alt<#3>{#1}{#2}}
-
-\def\newoverlayenvironment#1{%
-  \@ifnextchar[{\@@newoverlayenvironment{#1}}{\@newoverlayenvironment{#1}}}
-
-\long\def\@newoverlayenvironment#1#2#3#4#5{% In slides, #1 forms an
-% environment with begin #2 and end #3, otherwise an environment with 
-% begin #4 and end #5
-  \newenvironment{#1}{}{}%
-  \expandafter\def\csname #1\endcsname{%
-    \@ifnextchar<{\beamer@parsebegin{#1}{#2}{#3}{#4}{#5}}{%
-      \expandafter\def\csname end#1\endcsname{#3}#2}}%
-  }
-    
-\long\def\beamer@parsebegin#1#2#3#4#5<#6>{%
-  \alt<#6>{% In slide case
-    \expandafter\def\csname end#1\endcsname{#3}%
-    #2}{%
-    \expandafter\def\csname end#1\endcsname{#5}%
-    #4}}
-
-\long\def\renewoverlayenvironment#1#2#3#4#5{%
-  \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
-  \renewenvironment{#1}{}{}%
-  \expandafter\def\csname #1\endcsname{%
-    \@ifnextchar<{\beamer@parsebegin{#1}{#2}{#3}{#4}{#5}}{%
-      \expandafter\def\csname end#1\endcsname{#3}#2}%
-    }%
-  }
-
-\long\def\@@newoverlayenvironment#1[1]#2#3#4#5{% Currently, this works
-% only for a single argument
-  \newenvironment{#1}{}{}%
-  \expandafter\new@command\csname @in#1\endcsname[1]{#2}%
-  \expandafter\new@command\csname @out#1\endcsname[1]{#4}%
-  \expandafter\long\expandafter\def\csname #1\endcsname##1{%
-    \@ifnextchar<{\beamer@parsebegin{#1}{\csname @in#1\endcsname{##1}}{#3}{\csname @out#1\endcsname{##1}}{#5}}{%
-      \expandafter\def\csname end#1\endcsname{#3}#2}}%
-}
-
 
   
 %
 \newoverlayenvironment{onlyenv}{}{}{\begingroup\setbox0=\hbox\bgroup}{\egroup\endgroup}
 \renewoverlaycommand{\hypertarget}{\beameroriginal{\hypertarget}}{\@gobble}
 
+\newcommand\onlyarticle{\only<all:0| article:1>}
+\newcommand\onlypresentation{\only<article:0>}
+
 \newoverlaycommand{\emph}{\@emph}{}
 \def\@emph#1{{\itshape#1}}
 

examples/beamerexample1.pdf

Binary file modified.