\ProvidesPackage{beamerbaseframe}[2004/01/10 ver 1.20]
\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.


%
% 
%
%
% Special stuff for presentation mode
%
%
% 


\mode<presentation>

\newbox\beamer@framebox
\newbox\beamer@frametitlebox
\newbox\beamer@zoombox
\newcount\beamer@zoomcount
\newcount\beamer@zoomframecount
\newdimen\beamer@frametextheight

\mode
<all>
{
  \newif\ifbeamer@inframe
  \beamer@inframefalse
}


%
% Slide Definitions
%

\newcounter{subsectionslide}[subsection]
\renewcommand\thesubsectionslide{\@arabic\c@subsectionslide}
\def\beamer@entrycode{}
\def\beamer@exitcode{}

\def\beamer@setuplinks{%
  {%
    \def\sectionentry##1##2##3##4##5{}%
    \def\slideentry##1##2##3##4##5##6{}%
    \dohead%
  }%
}

\newenvironment{beamer@frameslide}{%
  \ifx\beamer@againname\@empty
    {\let\@elt\beamer@restorecounter\beamer@overlaycounterresets}%
  \else%
    {\let\@elt\beamer@labelrestorecounter\beamer@overlaycounterresets}%      
  \fi%
  \global\c@beamerpauses=1\relax%
  \expandafter\beamer@ifempty\expandafter{\beamer@framestartpage}{%
    \refstepcounter{subsectionslide}%
    \xdef\beamer@framestartpage{\the\c@page}% only first time
  }{\clearpage\beamer@notesactions}% cleanup from previous slide
  \hypersetup{pdfpagetransition=R}%
  \hypersetup{pdfpageduration=}%
  \xdef\beamer@frameendpage{\the\c@page}% every time
  \beamer@setuplinks%
  \beamer@displaybreak%
  \global\setbox\beamer@zoombox=\box\voidb@x%
  \def\beamer@zoomer{}%
  \beamer@slidehaszoomfalse%
  \gdef\insertframetitle{}%
  \gdef\insertframesubtitle{}%
  \gdef\beamer@frametitle{}%
  \gdef\beamer@shortframetitle{}%
  \gdef\beamer@framesubtitle{}%
  \let\beamer@startcomment=\beamer@startcommentinframe%
  % Start slide:
  \beamer@framenotesbegin%
    \global\setbox\beamer@framebox=\vbox\bgroup%
    \beamer@inframetrue%
    \let\frame=\framelatex% inside frames, use LaTeX's \frame command
    \begin{beamer@framepauses}%
      \ifbeamer@shrink%
        \hsize=\beamer@shrinkfactorinv\hsize%
        \textwidth=\beamer@shrinkfactorinv\textwidth%
        \linewidth=\beamer@shrinkfactorinv\linewidth%
      \fi%
      % Insert labels if necessary:
      \ifx\beamer@againname\@empty\else%
        \nointerlineskip\vbox to0pt{\vss%
        \label<\the\beamer@slideinframe>{\beamer@againname<\the\beamer@slideinframe>}%
        \ifnum\beamer@slideinframe=1\relax%
          \label<1>{\beamer@againname}%
        \fi%
        }\nointerlineskip%
      \fi%
      \vbox{}\ifbeamer@plainframe\nointerlineskip\fi}%
    {\end{beamer@framepauses}%
  \egroup%
  \ifx\beamer@frametitle\@empty%
    \setbox\beamer@frametitlebox=\box\voidb@x%
  \else%
    \setbox\beamer@frametitlebox=\vbox{%
      \vbox{}%
      \beamer@headrenderer%
    }%
  \fi%
  \ifbeamer@plainframe%
    \beamer@frametextheight=\paperheight%
  \else%
    \beamer@frametextheight=\textheight%
  \fi%
  \advance\beamer@frametextheight by-\ht\beamer@frametitlebox%
  \advance\beamer@frametextheight by-\dp\beamer@frametitlebox%
%  \advance\beamer@frametextheight by-\beamer@frametopskip%
%  \advance\beamer@frametextheight by-\beamer@framebottomskip%
  \ifbeamer@shrink%
    \beamer@shrinkframebox%
  \fi%
  \ifx\beamer@zoomer\@empty  
    \setbox\beamer@framebox=\vbox{%
      \nobreak\vbox{}\nobreak\par\nobreak\beamer@entrycode\nobreak%
      \nointerlineskip\unvbox\beamer@frametitlebox%
      \nobreak\vskip\beamer@frametopskip\nobreak%
      \nointerlineskip\box\beamer@zoombox\nointerlineskip%
      \nobreak%
      \ifbeamer@slidehaszoom\box\beamer@framebox\else\unvbox\beamer@framebox\fi%
      % bottom skip is added in autobreakframebox
    }%
    \beamer@autobreakframebox%
  \else%
    \beamer@zoomer%
  \fi%
  \beamer@undolabels%
  \beamer@framenotesend%
  \box\beamer@framebox}





%
% Resetting counters
%  
\def\resetcounteronoverlays#1{%
  \@cons\beamer@overlaycounterresets{{c@#1}}%  
}

\def\resetcountonoverlays#1{%
  \@cons\beamer@overlaycounterresets{{#1}}%  
}

\def\beamer@overlaycounterresets{}
  
\resetcounteronoverlays{equation}
\resetcounteronoverlays{parentequation}
\resetcounteronoverlays{footnote}
\resetcounteronoverlays{mpfootnote}
\resetcounteronoverlays{figure}
\resetcounteronoverlays{table}
\resetcountonoverlays{beamer@zoomframecount}

\def\beamer@savecounter#1{%
  \@ifundefined{#1}{}%
  {\expandafter\xdef\csname saved@#1\endcsname%
    {\expandafter\the\csname #1\endcsname}}%
}
\def\beamer@restorecounter#1{%
  \@ifundefined{#1}{}%
  {\edef\temp{\csname saved@#1\endcsname}%
  \expandafter\global\csname #1\endcsname=\temp}%
}

\def\beamer@labelsavecounter#1{%
  \@ifundefined{#1}{}%
  {\expandafter\xdef\csname saved@\beamer@againname @#1\endcsname%
    {\expandafter\the\csname #1\endcsname}}%
}
\def\beamer@labelrestorecounter#1{%
  \@ifundefined{#1}{}%
  {\edef\temp{\csname saved@\beamer@againname @#1\endcsname}%
  \expandafter\global\csname #1\endcsname=\temp}%
}



%
% Skips
%
\newskip\beamer@frametopskip
\newskip\beamer@framebottomskip


%
% Keys
%
\define@key{beamerframe}{label}{\def\beamer@againname{#1}%
  {\let\@elt\beamer@labelsavecounter\beamer@overlaycounterresets}%
}
\define@key{beamerframe}{relabel}{\def\beamer@againname{#1}%
  \def\beamer@undolabels{{\let\@elt\beamer@restorecounter\beamer@overlaycounterresets}}%
}
\define@key{beamerframe}{plain}[true]{%
  \beamer@plainframetrue%
  \def\beamer@frametemplate{\beamer@frametemplate@plain}}
%\define@key{beamerframe}{template}{%
%  \edef\beamer@frametemplate{\expandafter\noexpand\csname beamer@frametemplate@#1\endcsname}}
\define@key{beamerframe}{containsverbatim}[true]{\csname beamer@containsverbatim#1\endcsname}
\define@key{beamerframe}{c}[true]{% centered
  \beamer@frametopskip=0pt plus 1fill\relax%
  \beamer@framebottomskip=0pt plus 1.5fill\relax%
}
\define@key{beamerframe}{t}[true]{% top
  \beamer@frametopskip=.2cm plus 8cm\relax%
  \beamer@framebottomskip=0pt plus 1fill\relax%
}
\define@key{beamerframe}{b}[true]{% bottom
  \beamer@frametopskip=0pt plus 1fill\relax%
  \beamer@framebottomskip=0pt\relax%
}
\define@key{beamerframe}{allowdisplaybreaks}[4]{%
  \def\beamer@displaybreak{\allowdisplaybreaks[#1]}}
\define@key{beamerframe}{allowframebreaks}[0.95]{%
  \def\beamer@autobreakfactor{#1}\beamer@autobreaktrue}
\define@key{beamerframe}{squeeze}[]{%
  \def\beamer@cramped{\itemsep0pt\topsep0.5pt\relax}}
\define@key{beamerframe}{shrink}[0]{%
  \def\beamer@shrinkpercentage{#1}%
  \@tempdima=-#1pt%
  \@tempdima=0.01\@tempdima%
  \advance\@tempdima by1pt%
  \edef\beamer@shrinkfactor{\strip@pt\@tempdima}%
  \@tempcnta=\@tempdima%
  \divide\@tempcnta by256\relax%
  \@tempdima=256pt%
  \divide\@tempdima by\@tempcnta%
  \edef\beamer@shrinkfactorinv{\strip@pt\@tempdima}%
  \beamer@shrinktrue%
  \def\beamer@cramped{\itemsep0pt\topsep0.5pt\relax}}

\newif\ifbeamer@containsverbatim
\newif\ifbeamer@autobreak
\newif\ifbeamer@shrink
\newif\ifbeamer@plainframe
\newif\ifbeamer@slidehaszoom

% Check for old version:

% Save!
\let\framelatex=\frame

\def\frame{%
  \def\beamer@defaultospec{<*>}%
  \@ifnextchar<\beamer@frame\beamer@checkoldframe}
\def\beamer@checkoldframe{\@ifnextchar[\beamer@@checkoldframe{\beamer@frame<*>}}
\def\beamer@@checkoldframe[{\@ifnextchar<{\beamer@frame<*>[}{\beamer@@@checkoldframe[}}
\def\beamer@@@checkoldframe[#1#2]{%
  \let\beamer@next=\beamer@newframesyntax%
  \ifcat#11% a number-like first letter in argument
    \let\beamer@next=\beamer@oldframesyntax%
  \else%
    \beamer@checkforcolon#2:.%
  \fi%
  \beamer@next{#1#2}}
\def\beamer@checkforcolon#1:#2.{%
  \beamer@ifempty{#2}{}{\let\beamer@next=\beamer@oldframesyntax}}
\def\beamer@newframesyntax#1{\beamer@@@frame<*>[#1]}
\def\beamer@oldframesyntax#1{\beamer@@@frame<#1>[]}

\def\beamer@framedefaultospec<#1>[#2]{%
  \def\beamer@defaultospec{#2}%
  \@ifnextchar[{\beamer@@@@frame<#1>}{\beamer@@@@frame<#1>[]}}

\def\beamer@frame<#1>{
  \@ifnextchar[{\beamer@@@frame<#1>}{\beamer@@@frame<#1>[]}}
\def\beamer@@@frame<#1>[{\@ifnextchar<{\beamer@framedefaultospec<#1>[}{\beamer@@@@frame<#1>[}}
\def\beamer@@@@frame<#1>[#2]{%
  \beamer@savemode%
  \def\beamer@mode{\mode<all>}%
  \def\beamer@frametemplate{}%
  \def\beamer@againname{}%
  \def\beamer@undolabels{}%
  \def\beamer@cramped{}%
  \def\beamer@displaybreak{}%
  \beamer@autobreakcount=0\relax%
  \beamer@zoomcount=0\relax%
  \beamer@containsverbatimfalse%
  \beamer@autobreakfalse%
  \beamer@shrinkfalse%
  \beamer@plainframefalse%
  \ifbeamer@centered\setkeys{beamerframe}{c}\else\setkeys{beamerframe}{t}\fi%
  \setkeys{beamerframe}{#2}%
  \beamer@frametemplate%
  \refstepcounter{framenumber}%
  \advance\beamer@zoomframecount by1\relax%
  {\let\@elt\beamer@savecounter\beamer@overlaycounterresets}
  \gdef\beamer@framestartpage{}%
  \gdef\beamer@whichframes{#1}%
  \ifx\beamer@framerestriction\@undefined\else% restriction stuff
    \expandafter\beamer@checkifinlist\beamer@framerestriction\relax%
  \fi%
  \ifbeamer@inlecture%
  \else%
    \gdef\beamer@whichframes{all:0}%
  \fi%
  \ifx\beamer@againname\@empty%
    \beamer@slideinframe=0\relax%
    \beamer@anotherslidefalse%
    {\setbox0=\hbox{\expandafter\beamer@decode\beamer@whichframes| stop:0| }}%
    \ifbeamer@anotherslide%
      \beamer@slideinframe=2\relax%
      \def\beamer@doifnotinframe{}%
      \def\beamer@doifinframe{\let\beamer@howtotreatframe\beamer@doseveralframes}%
      \beamer@anotherslidefalse%
      {\setbox0=\hbox{\expandafter\beamer@decode\beamer@whichframes| stop:0| }}%
      \ifbeamer@anotherslide%
        \let\beamer@howtotreatframe\beamer@doseveralframes%
      \else% single slide in frame
        \let\beamer@howtotreatframe\beamer@dosingleframe%
      \fi%
      \beamer@donow%
      \ifbeamer@containsverbatim%
        \let\beamer@howtotreatframe\beamer@dosingleframe%
      \fi%
      \ifbeamer@autobreak%
        \let\beamer@howtotreatframe\beamer@autobreakframe%
      \fi%
    \else% no slides in frame
      \let\beamer@howtotreatframe\beamer@donoframe%
    \fi%
  \else% again mode
    \let\beamer@howtotreatframe\beamer@doseveralframes%
  \fi%  
  \beamer@howtotreatframe}
\long\def\beamer@donoframe{%
  \beamer@slideinframe=1\relax%
  \setbox\beamer@tempbox\vbox\bgroup%
    \beamer@inframetrue%
    \leavevmode%
    \def\pause{}%
    \afterassignment\beamer@checknoslide\let\beamer@next}
\def\beamer@checknoslide{%
  \ifcat\bgroup\noexpand\beamer@next%
    \let\beamer@do\relax%
    \aftergroup\beamer@reseteecodes%
  \else%
    \let\beamer@do\beamer@noframesingletoken%
  \fi%
  \beamer@do}
\def\beamer@noframesingletoken{\beamer@next\egroup\beamer@reseteecodes}

\long\def\beamer@doseveralframes#1{%
  \ifx\beamer@againname\@empty\else%
    % Again stuff
    \expandafter \gdef\csname beamer@again@\beamer@againname\endcsname{{#1}}%
  \fi%
  \beamer@slideinframe=1\relax%
  \loop%
  \beamer@anotherslidefalse%
  \def\beamer@doifnotinframe{}%
  \def\beamer@doifinframe{\begin{beamer@frameslide}%
    #1%
  \end{beamer@frameslide}}%
  {\setbox0=\hbox{\expandafter\beamer@decode\beamer@whichframes| stop:0| }}%
  \beamer@donow%
  \ifbeamer@anotherslide
  \advance\beamer@slideinframe by 1\relax
  \repeat%
  \beamer@writeslidentry%
  \beamer@reseteecodes}

\def\beamer@dosingleframe{%
  \beamer@slideinframe=1\relax%
  \begin{beamer@frameslide}%
    \bgroup\aftergroup\beamer@endslide\afterassignment\beamer@checkslide\let\beamer@next}
\def\beamer@checkslide{%
  \ifcat\bgroup\noexpand\beamer@next%
  \let\beamer@do\relax%
  \else\let\beamer@do\beamer@singletoken\fi%
  \beamer@do}
\def\beamer@endslide{\end{beamer@frameslide}\beamer@writeslidentry\beamer@reseteecodes}
\def\beamer@singletoken{\beamer@next\egroup}


\def\beamer@writeslidentry{%
  \expandafter\beamer@ifempty\expandafter{\beamer@framestartpage}{}% does not happen normally
  {%else
    \addtocontents{nav}%
      {\protect\headcommand{%
          \protect\slideentry{\the\c@section}{\the\c@subsection}{\the\c@subsectionslide}%
          {\beamer@framestartpage/\beamer@frameendpage}{\lastsubsection}{\the\c@part}}}%
    \addtocontents{nav}%
      {\protect\headcommand{% 
        \protect\beamer@framepages{\beamer@framestartpage}{\beamer@frameendpage}}}%
    \clearpage\beamer@notesactions%
  }
}
\def\beamer@reseteecodes{\gdef\beamer@entrycode{}\gdef\beamer@exitcode{}%
  \beamer@slideinframe=1\relax\beamer@resumemode}



%
% Zoom stuff
%

\define@key{beamerzoom}{border}[1]{\def\beamer@zoomborderwidth{#1}}

\def\framezoom<#1><#2>{\@ifnextchar[{\beamer@framezoom<#1><#2>}{\beamer@framezoom<#1><#2>[]}}
\def\beamer@framezoom<#1><#2>[#3](#4,#5)(#6,#7){%
  \par\nointerlineskip%
  \global\beamer@slidehaszoomtrue%
  \advance\beamer@zoomcount by1\relax%
  \def\beamer@zoomborderwidth{0}%
  \edef\beamer@labelzoomed{beamer@labelzoomed@\the\beamer@zoomframecount @\the\beamer@zoomcount}%
  \setkeys{beamerzoom}{#3}%
  \only<#1>{%
    {\hypersetup{pdfhighlight={/P},pdfborder={0 0 \beamer@zoomborderwidth}}%
    \global\setbox\@tempboxa=\vbox{\hyperlink{\beamer@labelzoomed}{\vbox to #7{\hbox
          to#6{\hfil}\vfil}}}}%
    \ht\@tempboxa=0pt%
    \wd\@tempboxa=0pt%
    \dp\@tempboxa=0pt%
    \setbox\@tempboxa=\vbox{\moveright#4\hbox{\lower#5\vbox{\box\@tempboxa}}}%
    \ht\@tempboxa=0pt%
    \wd\@tempboxa=0pt%
    \dp\@tempboxa=0pt%
    \global\setbox\beamer@zoombox=\vbox to0pt{\unvbox\beamer@zoombox\box\@tempboxa}%
  }%
  \only<#2>{%
    \@ifundefined{\beamer@labelzoomed}%
    {%
      \hypertarget{\beamer@labelzoomed}{}%
      \expandafter\gdef\csname\beamer@labelzoomed\endcsname{}%
    }{}%
    \gdef\beamer@zoomer{%
      % compute zoom factor
      \@tempdima=\beamer@frametextheight%
      \@tempdimb=#7\relax%
      \@tempcnta=\@tempdimb%
      \divide\@tempcnta by4096\relax%
      \multiply\@tempdima by16\relax%
      \divide\@tempdima by\@tempcnta%
      \@tempdimb=\paperwidth%
      \ifbeamer@plainframe%
      \else%
        \advance\@tempdimb by-\beamer@leftsidebar%
        \advance\@tempdimb by-\beamer@rightsidebar\relax%
      \fi%
      \@tempdimc=#6\relax%
      \@tempcntb=\@tempdimc%
      \divide\@tempcntb by4096\relax%
      \multiply\@tempdimb by16\relax%
      \divide\@tempdimb by\@tempcntb%
      \ifdim\@tempdimb<\@tempdima%
        \@tempdima=\@tempdimb%
      \fi%
      \edef\beamer@temp{\strip@pt\@tempdima}%  
      \@tempdimc=\beamer@frametextheight%
      \advance\@tempdimc by4pt%
      \@tempdimb=\paperwidth%
      \ifbeamer@plainframe%
      \else%
        \advance\@tempdimb by-\beamer@leftsidebar%
        \advance\@tempdimb by-\beamer@rightsidebar\relax%
      \fi%
      \setbox\@tempboxa=\vbox{\hsize=\@tempdimb\Acrobatmenu{GoBack}{\vbox to
          \beamer@frametextheight{\hbox to\@tempdimb{\hfil}\vfil}}}%
      \ht\@tempboxa=0pt%
      \wd\@tempboxa=0pt%
      \dp\@tempboxa=0pt%
      \setbox\beamer@framebox=\vbox to\beamer@frametextheight{{%
          \ifbeamer@plainframe\beamer@leftmargin=\Gm@lmargin\fi%
          \begin{pgfpicture}{\beamer@leftmargin}{-\beamer@frametextheight}{\beamer@leftmargin}{0pt}
            \pgfbox[left,top]{\box\@tempboxa}
            \pgfrect[clip]{\pgfpoint{0pt}{-\@tempdimc}}{\pgfpoint{\@tempdimb}{\@tempdimc}}%
            \begin{pgfmagnify}{\beamer@temp}{\beamer@temp}
              \@tempdima=#4\relax%
              \@tempdimb=#5\relax%
              \pgftranslateto{\pgfpoint{-\@tempdima}{\@tempdimb}}
              \pgfbox[left,top]{\vbox{\vbox{}\nointerlineskip\unvbox\beamer@framebox}}
            \end{pgfmagnify}
          \end{pgfpicture}%
        }}%
      \setbox\beamer@framebox=\vbox{%
        \nobreak\vbox{}\nobreak\par\nobreak\beamer@entrycode\nobreak%
        \nointerlineskip\unvbox\beamer@frametitlebox%
        \nobreak%
        \box\beamer@framebox%
        \nobreak%
        \vss%
        \beamer@exitcode%
      }%
      \global\setbox\beamer@footins=\box\voidb@x% no footnotes in zoomed slides
    }%
  }%
}

\mode
<article>
{
  \def\framezoom<#1><#2>{\@ifnextchar[{\beamer@framezoom<#1><#2>}{\beamer@framezoom<#1><#2>[]}}
  \def\beamer@framezoom<#1><#2>[#3](#4,#5)(#6,#7){}
}



%
% Auto break stuff
%

\splittopskip=10pt
\newbox\beamer@splitbox
\newcount\beamer@autobreakcount

\def\beamer@autobreakframe{%
  \beamer@slideinframe=1\relax%
  \advance\beamer@autobreakcount by1\relax%
  \begin{beamer@frameslide}%
    \bgroup\aftergroup\beamer@endautobreak\let\beamer@next% gobble opening brace
  }
\def\beamer@endautobreak{\end{beamer@frameslide}%
  \beamer@writeslidentry%
  \ifvoid\beamer@splitbox%
    \beamer@reseteecodes%
    \let\beamer@next=\relax%  
  \else%
    \let\beamer@next=\beamer@continueautobreak%
  \fi%      
  \beamer@next%  
}

\def\beamer@autobreakframebox{%
  \global\setbox\beamer@splitbox=\box\voidb@x%
  \ifbeamer@autobreak%
    % Ok, frame was overful -> split it!
    \setbox\@tempboxa=\vsplit\beamer@framebox to\beamer@autobreakfactor\textheight%
    \global\setbox\beamer@splitbox=\box\beamer@framebox%
    \setbox\beamer@framebox=\vbox to\textheight{\unvbox\@tempboxa%
      \vskip\beamer@framebottomskip\vfil%
      \ifvoid\beamer@splitbox%
        \ifvoid\beamer@footins%
        \else%
          \normalcolor%
          \footnoterule%
          \unvbox \beamer@footins%
          \global\setbox\beamer@footins=\box\voidb@x%
        \fi%
      \fi%       
      \beamer@exitcode%
    }%
  \else%
    \setbox\beamer@framebox=\vbox to\textheight{\unvbox\beamer@framebox%
      \vskip\beamer@framebottomskip%
      \ifvoid\beamer@footins%
      \else%
        \normalcolor%
        \footnoterule%
        \unvbox \beamer@footins%
        \global\setbox\beamer@footins=\box\voidb@x%
      \fi%
      \beamer@exitcode}%
    \global\setbox\beamer@footins=\box\voidb@x%
  \fi%
  }

\def\beamer@continueautobreak{%
  \refstepcounter{framenumber}%
  \expandafter\def\expandafter\beamer@savedframetitle\expandafter{\beamer@frametitle}%
  \expandafter\def\expandafter\beamer@savedshortframetitle\expandafter{\beamer@shortframetitle}%
  \beamer@autobreakframe{%
    \frametitle[\beamer@savedshortframetitle]{\beamer@savedframetitle}%
    \expandafter\framesubtitle\expandafter{\insertframesubtitle}%
    \unvbox\beamer@splitbox}%
}


\newcommand\usecontinuationtemplate[1]{\def\beamer@autobreaktemplate{\ifnum\beamer@autobreakcount>0\relax{#1}\fi}}
\newcommand\insertcontinuationcount{\the\beamer@autobreakcount}
\newcommand\insertcontinuationcountroman{\@Roman\beamer@autobreakcount}
\newcommand\insertcontinuationtext{(cont.)}




%
% Shrink stuff
%

\def\beamer@shrinkframebox{%
  \@tempdima=\ht\beamer@framebox%
  \ifdim\@tempdima>\beamer@frametextheight%
    \@tempcnta=\@tempdima%
    \divide\@tempcnta by 65536\relax%
    \@tempdimc=\beamer@frametextheight%
    \divide\@tempdimc by\@tempcnta\relax%
    \ifdim\@tempdimc>\beamer@shrinkfactor pt%
      \@tempdimc=\beamer@shrinkfactor pt%
    \else%
      \@tempdima=-100\@tempdimc%
      \advance\@tempdima by100pt%
      \ClassWarning{beamer}{Frame text is shrunk by a factor of %
      \strip@pt\@tempdima\space percent instead of
      \beamer@shrinkpercentage\space percent}%
    \fi%
    \edef\beamer@factortemp{\strip@pt\@tempdimc}%
    \setbox\beamer@framebox=\vbox to\beamer@frametextheight{%
      \begin{pgfpicture}{0pt}{-\beamer@frametextheight}{0pt}{0pt}
        \begin{pgfmagnify}{\beamer@factortemp}{\beamer@factortemp}
          \pgfbox[left,top]{\box\beamer@framebox}
        \end{pgfmagnify}
      \end{pgfpicture}%
    }%
  \fi%
}


%
% \includeonlyframes
%

\def\beamer@checkifinlist#1,#2\relax{
  \def\beamer@temp{#1}%
  \ifx\beamer@temp\beamer@againname\else
    \def\beamer@temp{#2}%
    \ifx\beamer@temp\@empty
      \gdef\beamer@whichframes{all:0}%
    \else%
      \beamer@checkifinlist#2\relax%
    \fi%
  \fi%
}

\def\includeonlyframes#1{\def\beamer@framerestriction{#1,}}



%
% Frames in article mode
%

\mode
<article>
{
  \def\frame{\@ifnextchar<\beamer@frame{\beamer@frame<*>}}
  \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%
    \beamer@anotherslidefalse%
    {\setbox0=\hbox{\expandafter\beamer@decode#1| stop:0| }}%
    \ifbeamer@anotherslide%
      \let\beamer@howtotreatframe\beamer@dosingleframe%
    \else% no slides in frame
      \let\beamer@howtotreatframe\beamer@donoframe%
    \fi%
    \beamer@slideinframe=1\relax%
    \beamer@howtotreatframe}

  \long\def\beamer@donoframe{%
    \setbox\beamer@tempbox\vbox\bgroup%
    \beamer@inframetrue%
    \beamer@templateframestart%
    \bgroup%
    \aftergroup\beamer@endframe%
    \let\beamer@next}
  \def\beamer@dosingleframe{%
    \bgroup%
    \beamer@inframetrue%
    \beamer@templateframestart%
    \bgroup\aftergroup\beamer@endframe%
    \let\beamer@next}
  \def\beamer@endframe{%
    \beamer@templateframeend\egroup}

  \def\includeonlyframes#1{}% no effect
}


\mode
<all>
{
  \beamer@slideinframe=1\relax%

  \long\def\useframetemplate#1#2{\gdef\beamer@templateframestart{#1}\gdef\beamer@templateframeend{#2}}
  \useframetemplate{}{}
}



%
% Frame counter
%
\mode
<all>
{
  \newcounter{framenumber}
  \def\insertframenumber{\@arabic\c@framenumber}
}


%
% Pagebreak command
%
\mode
<all>
{
  \renewcommand<>{\pagebreak}[1][4]{\only#2{\beameroriginal\pagebreak[#1]}}
  \renewcommand<>{\nopagebreak}[1][4]{\only#2{\beameroriginal\nopagebreak[#1]}}
  \def\framebreak{\pagebreak<presentation>}
  \def\noframebreak{\nopagebreak<presentation>}
}


%
% Linebreak command
%
\renewcommand<>{\\}{\only#1{\beameroriginal\\}}
\renewcommand<>{\@centercr}{\only#1{\beameroriginal\@centercr}}

\mode
<article>
{
  \expandafter\let\expandafter\beamer@origbreak\expandafter=%
    \csname\expandafter\@gobble\string\\ \endcsname% evil trickery to add a space to the name
  \DeclareRobustCommand\\{\beamer@ifnextcharospec{\beamer@breaker}{\beamer@@breaker}}
  \def\beamer@breaker<#1>{\only<#1>{\beamer@origbreak}}
  \def\beamer@@breaker{\ifbeamer@inframe\else\expandafter\beamer@origbreak\fi}

  \let\beamer@origbreakcenter=\@centercr
  \def\@centercr{\beamer@ifnextcharospec{\beamer@breakercenter}{\beamer@@breakercenter}}
  \def\beamer@breakercenter<#1>{\only<#1>{\beamer@origbreakcenter}}
  \def\beamer@@breakercenter{\ifbeamer@inframe\else\expandafter\beamer@origbreakcenter\fi}
}



%
% Plain frames
%

\def\beamer@frametemplate@plain{%
  \def\beamer@entrycode{\vspace*{-\headheight}}%
  \def\beamer@exitcode{\vspace*{-\footheight}\thispagestyle{empty}}}


%
% Again frame
%

\def\againframe{\@ifnextchar<{\beamer@againframe}{\beamer@againframe<*>}}
\def\beamer@againframe<#1>{\@ifnextchar[{\beamer@@againframe<#1>}{\beamer@@againframe<#1>[]}}
\def\beamer@@againframe<#1>[{\@ifnextchar<{\beamer@@@@againframe<#1>[}{\beamer@@@againframe<#1>[<*>][}}
\def\beamer@@@@againframe<#1>[#2]{\@ifnextchar[{\beamer@@@againframe<#1>[#2]}{\beamer@@@againframe<#1>[#2][]}}
\def\beamer@@@againframe<#1>[#2][#3]#4{%
  \@ifundefined{beamer@again@#4}%
  {\ClassError{beamer}{No frame has been designated to resume under
      the name "#4"}{}}%
  {%
  \def\beamer@temp{\frame<#1>[#2][#3,relabel=#4]}%
  \expandafter\let\expandafter\beamer@templet\csname beamer@again@#4\endcsname%
  \expandafter\beamer@temp\beamer@templet}%
}

\mode
<article>
{
  \def\againframe{\@ifnextchar<{\beamer@againframe}{\beamer@againframe<>}}
  \def\beamer@againframe<#1>{\@ifnextchar[{\beamer@@againframe<#1>}{\beamer@@againframe<#1>[]}}
  \def\beamer@@againframe<#1>[{\@ifnextchar<{\beamer@@@@againframe<#1>[}{\beamer@@againframe<#1>[<*>][}}
  \def\beamer@@@@againframe<#1>[#2]{\@ifnextchar[{\beamer@@@againframe<#1>[#2]}{\beamer@@@againframe<#1>[#2][]}}
  \def\beamer@@@againframe<#1>[#2][#3]#4{} % do nothing
}



\mode
<all>
% End in common mode


%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "~/texmf/tex/latex/beamer/examples/beamerexample1.tex"
%%% End: 
