Commits

Anonymous committed f166448

restructuring

Comments (0)

Files changed (29)

+2004-01-10 Till Tantau <tantau@users.sourceforge.net>
+
+	- Reorganzed directory structure: new directories base and themes
+	- Added some explanations in user guide on font encodings and
+	  graphic file formats.
+	- Uses version 1.06 of xcolor now.
+	- Added options to include only certain sections in the table of
+	  contents. 
+
 2003-12-09 Till Tantau <tantau@users.sourceforge.net>
 
 	Version 1.10:
  1) Some commands for creating a lecture title page.
  2) Perhaps add an way of showing photos of the authors and the
     institutes in a convenient way.
- 3) Put internal macros in beamer.cls into a namespace
- 4) "Cleanup" beamer.cls
- 5) Document some of the commands for creating headline and footlines.
- 6) Improve \article mode.
- 7) Add options for showing only specific sections in toc.
- 8) Add command for creating a frame "out of order".
- 9) Add more artwork.
-10) Add an faq section.
-11) Better color management.
-12) Options for bigger fonts.
-13) Make \uncover work line-wise in tables.
-14) Add inserts for section and subsection numbers.
+ 3) "Cleanup" beamer.cls
+ 4) Document some of the commands for creating headline and footlines.
+ 5) Improve \article mode.
+ 6) Add command for creating a frame "out of order".
+ 7) Add more artwork.
+ 8) Add an faq section.
+ 9) Better color management.
+10) Options for bigger fonts.
+11) Make \uncover work line-wise in tables.
+12) Add inserts for section and subsection numbers.
+13) Add miniframes and list of frames.
+14) Change \nameslide into normal \label.
+15) Prehaps add zoom interface.
 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
 \ProvidesClass{beamer}
-[2003/12/11 v1.10 Class for Typesetting a Beamer Presentation]
+[2004/01/10 v1.10-dev Class for Typesetting a Beamer Presentation]
 
 % Copyright 2003 by Till Tantau <tantau@users.sourceforge.net>.
 %
 % This program can be redistributed and/or modified under the terms
-% of the LaTeX Project Public License Distributed from CTAN
-% archives in directory macros/latex/base/lppl.txt.
+% of the GNU Public License, version 2.
+
 
 %
-% Presentation/article stuff
+% Versioning stuff
 %
-% Copyright notice: Part of the following code is taken from the
-% package comment.sty by Victor Eijkhout
+\newdimen\beamer@version
+\beamer@version=1.11pt % It is only fitting, that the version should
+                       % be given in points...
+\def\beamer@endinputifotherversion#1{%
+  \let\beamer@next=\relax%
+  \ifdim#1<\beamer@version%
+    \let\beamer@next=\endinput%
+  \else%
+    \ifdim#1>\beamer@version%
+      \let\beamer@next=\endinput%
+    \fi%
+  \fi%
+  \beamer@next}
+
+
+\RequirePackage{beamerbasearticle}
+% Setup article mode
+
+\beamer@transferifnecessary
+
+
+%
+%
+% Declarations used by beamer
+%
 %
 
+% Public
+\newdimen\headheight    % Total height of the headline (including depth)
+\newdimen\headdp        % Depth of the headline
+\newdimen\footheight    % Height of the footline
+\newdimen\sidebarheight % Height of the sidebars
 
-%
-% Comment stuff. This will also be needed, if we switch to another
-% class, so define it here already.
-%
-\newif\ifbeamer@inpresentation
-\beamer@inpresentationtrue
+% Private
+\newdimen\beamer@tempdim
+\newdimen\beamer@finalheight
+\newdimen\beamer@animht
+\newdimen\beamer@animdp
+\newdimen\beamer@animwd
+\newdimen\beamer@leftmargin
+\newdimen\beamer@rightmargin
+\newdimen\beamer@leftsidebar
+\newdimen\beamer@rightsidebar
+\newdimen\beamer@boxsize
+\newdimen\beamer@vboxoffset
+\newdimen\beamer@descdefault
+\newdimen\beamer@descdefaulttemp
 
-\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}
+\newbox\beamer@areabox
+\newbox\beamer@animcurrent
+\newbox\beamer@animshowbox
+\newbox\beamer@tempbox
+\newbox\beamer@sectionbox
+\newbox\beamer@logobox
+\newbox\beamer@linebox
 
-{\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}  
+\newcount\beamer@tempcount
+\newcount\beamer@sectioncount
+\newcount\beamer@subsectionmax
+\newcount\beamer@sectionmax
+\newcount\beamer@totalheads
+\newcount\beamer@headcounter
+\newcount\beamer@partstartpage
+\newcount\beamer@sectionstartpage
+\newcount\beamer@subsectionstartpage
+\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
 
-\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%
-  \pgfimage[#1,page=\csname beamer@slide#2\endcsname]{\jobnamebeamerversion}
-  \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
-  \edef\beamer@classwhat{[\beamer@classoptions]{\beamer@classname}}
-  \expandafter\LoadClass\beamer@classwhat
-  \endinput
-  }
-
-\expandafter\beamer@findclassname\@classoptionslist,=,!
-\ifx\beamer@classname\@empty
-  \let\next=\relax
-\else
-  % Need to transfer to another class soon
-  \let\next=\beamer@transfer
-\fi
-\next
+\newif\ifbeamer@sansmath
+\newif\ifbeamer@altmode
+\newif\ifbeamer@notes
+\newif\ifbeamer@notesnormals
+\newif\ifbeamer@compress
+\newif\ifbeamer@centered
+\newif\ifbeamer@draftmode
+\newif\ifbeamer@compressnotes
+\newif\ifbeamer@anotherslide
+\newif\ifbeamer@localanotherslide
+\newif\ifbeamer@onlycurrent
+\newif\ifbeamer@pausesections
+\newif\ifbeamer@pausesubsections
+\newif\ifbeamer@subsectionshide
+\newif\ifbeamer@subsectionsshaded
 
 
 
 \RequirePackage{keyval}
 % For \tableofcontents parameters
 
-\RequirePackage{beamertemplates}
+\RequirePackage{beamerbasetemplates}
 % For default templates
 
 
+
+
 %
 %
 % Setup of the page size and spacing parameters using geometry.
   papersize={12.80cm,9.60cm},
   hmargin=1cm,%
   vmargin=0cm,%
-  head=0.5cm,%
+  head=0.5cm,% will be changed later
   headsep=0pt,%
-  foot=0.5cm]{geometry}
-
-%
-% Fix for older versions of geometry
-%
-\ifx\ifGm@compatii\@undefined%
-\def\Gm@lmargin{\Geom@lmargin}\def\Gm@rmargin{\Geom@rmargin}
-\else
-\geometry{includeheadfoot}
-\fi
+  foot=0.5cm% will be changed later
+  ]{geometry}
 
 
 %
   pdfhighlight={/N}%
   ]{hyperref}
 
-%
-% Fix for implict=false for hyperref
-%
-\def\WriteBookmarks{0}
-\expandafter\def\csname Parent-1\endcsname{}
-\expandafter\def\csname Parent0\endcsname{}
-\def\phantomsection{}
-
-%
-% Bugfix for old versions of pdfmark
-%
-\begingroup
-  \catcode`P=12
-  \catcode`T=12
-  \lowercase{\endgroup
-  \gdef\rem@ptetc#1.#2PT#3!{#1\ifnum#2>\z@.#2\fi}%
-}
-\def\strip@pt@and@otherjunk#1{\expandafter\rem@ptetc\the#1!}
-
-%
-% Make the effect of pdfpagetransition and duration global, not local
-%
-\define@key{Hyp}{pdfpagetransition}{\gdef\@pdfpagetransition{#1}}
-\define@key{Hyp}{pdfpageduration}{\gdef\@pdfpageduration{#1}}
-
-%
-%
-% Fix for babel (will have an effect only, if babel is loaded)
-%
-%
-\def\textlatin{}
-
 
 %
 %
 % Ifs for document options
 %
 %
-\newif\if@altmode
-\@altmodefalse
-\newif\if@notes
-\@notesfalse
-\newif\if@notesnormals
-\@notesnormalstrue
-
-\newif\ifbeamer@compress
+\beamer@altmodefalse
+\beamer@notesfalse
+\beamer@notesnormalstrue
 \beamer@compressfalse
-
-\newif\ifbeamer@centered
-
-\newif\ifbeamer@draftmode
 \beamer@draftmodefalse
-
-\newif\ifbeamer@compressnotes
 \beamer@compressnotesfalse
 
 %
 \DeclareOption{leqno}{\input{leqno.clo}}
 \DeclareOption{fleqn}{\input{fleqn.clo}}
 
-\def\@currentmode{default}
-\DeclareOption{handout}{\gdef\@currentmode{handout}}
-\DeclareOption{trans}{\gdef\@currentmode{trans}}
+\def\beamer@currentmode{default}
+\DeclareOption{handout}{\gdef\beamer@currentmode{handout}}
+\DeclareOption{trans}{\gdef\beamer@currentmode{trans}}
 
-\DeclareOption{notes}{\@notestrue}
-\DeclareOption{notesonly}{\@notestrue\@notesnormalsfalse}
-
-\newif\if@sansmath
+\DeclareOption{notes}{\beamer@notestrue}
+\DeclareOption{notesonly}{\beamer@notestrue\beamer@notesnormalsfalse}
 
 \DeclareOption{sans}{%
   \def\familydefault{\sfdefault}
   \def\mathfamilydefault{\sfdefault}
-  \@sansmathtrue
+  \beamer@sansmathtrue
 }
 \DeclareOption{serif}{%
   \def\familydefault{\rmdefault}
   \def\mathfamilydefault{\rmdefault}
-  \@sansmathfalse
+  \beamer@sansmathfalse
 }
 
-\DeclareOption{mathsans}{\def\mathfamilydefault{\sfdefault}\@sansmathtrue}
-\DeclareOption{mathserif}{\def\mathfamilydefault{\rmdefault}\@sansmathfalse}
+\DeclareOption{mathsans}{\def\mathfamilydefault{\sfdefault}\beamer@sansmathtrue}
+\DeclareOption{mathserif}{\def\mathfamilydefault{\rmdefault}\beamer@sansmathfalse}
 
 \DeclareOption{pdftex}{}% Used by hyperref
 \DeclareOption{nativepdf}{}% Used by hyperref
 \DeclareOption{draft}{\beamer@draftmodetrue}
 \AtBeginDocument{
   \ifbeamer@draftmode
-  \gdef\@foottemplate{%
+  \gdef\beamer@foottemplate{%
     \color{black!25}%
     \kern-\Gm@lmargin\vrule width\paperwidth
     height\footheight\kern-\Gm@rmargin}
-  \gdef\@headtemplate{%
+  \gdef\beamer@headtemplate{%
     \color{black!25}%
     \kern-\Gm@lmargin\vrule width\paperwidth
     height\headheight\kern-\Gm@rmargin}
 \geometry{headsep=0pt}
 
 
-%
-% Font size stuff
-%
-\def\EC@family#1#2#3#4#5{%
-  \DeclareFontShape{#1}{#2}{#3}{#4}%
-  {<5><6><7><8><9><10><10.95><12><14.4>%
-   <17.28><20.74><24.88><29.86><35.83><42.99><51.59>genb*#5}{}}
-\EC@family{T1}{cmr}{m}{n}{ecrm}
-\EC@family{T1}{cmr}{m}{sl}{ecsl}
-\EC@family{T1}{cmr}{m}{it}{ecti}
-\EC@family{T1}{cmr}{m}{sc}{eccc}
-\EC@family{T1}{cmr}{bx}{n}{ecbx}
-\EC@family{T1}{cmr}{b}{n}{ecrb}
-\EC@family{T1}{cmr}{bx}{it}{ecbi}
-\EC@family{T1}{cmr}{bx}{sl}{ecbl}
-\EC@family{T1}{cmr}{bx}{sc}{ecxc}
-\EC@family{T1}{cmr}{m}{ui}{ecui}
-\DeclareFontShape{OT1}{cmr}{m}{n}%
-     {<5><6><7><8><9><10><12>gen*cmr%
-      <10.95>cmr10%
-      <14.4>cmr12%
-      <17.28><20.74><24.88><29.86><35.83><42.99><51.59>cmr17}{}
-\DeclareFontShape{OT1}{cmr}{m}{sl}%
-     {<5><6><7>cmsl8%
-      <8><9>gen*cmsl%
-      <10><10.95>cmsl10%
-      <12><14.4><17.28><20.74><24.88><29.86><35.83><42.99><51.59>cmsl12%
-      }{}
-\DeclareFontShape{OT1}{cmr}{m}{it}%
-     {<5><6><7>cmti7%
-      <8>cmti8%
-      <9>cmti9%
-      <10><10.95>cmti10%
-      <12><14.4><17.28><20.74><24.88><29.86><35.83><42.99><51.59>cmti12%
-      }{}
-\DeclareFontShape{OT1}{cmr}{m}{sc}%
-     {<5><6><7><8><9><10><10.95><12>%
-      <14.4><17.28><20.74><24.88><29.86><35.83><42.99><51.59>cmcsc10%
-      }{}
-\DeclareFontShape{OT1}{cmr}{m}{ui}
-   {<5><6><7><8><9><10><10.95><12>%
-      <14.4><17.28><20.74><24.88><29.86><35.83><42.99><51.59>cmu10%
-      }{}
-\DeclareFontShape{OT1}{cmr}{b}{n}
-     {<5><6><7><8><9><10><10.95><12>%
-      <14.4><17.28><20.74><24.88><29.86><35.83><42.99><51.59>cmb10%
-      }{}
-\DeclareFontShape{OT1}{cmr}{bx}{n}
-   {<5><6><7><8><9>gen*cmbx%
-      <10><10.95>cmbx10%
-      <12><14.4><17.28><20.74><24.88><29.86><35.83><42.99><51.59>cmbx12%
-      }{}
-\DeclareFontShape{OT1}{cmr}{bx}{sl}
-      {<5><6><7><8><9>%
-      <10><10.95><12><14.4><17.28><20.74><24.88><29.86><35.83><42.99><51.59>cmbxsl10%
-      }{}
-\DeclareFontShape{OT1}{cmr}{bx}{it}
-      {<5><6><7><8><9>%
-      <10><10.95><12><14.4><17.28><20.74><24.88><29.86><35.83><42.99><51.59>cmbxti10%
-    }{}
-\DeclareFontFamily{T1}{cmss}{}
-\EC@family{T1}{cmss}{m}{n}{ecss}
-\EC@family{T1}{cmss}{m}{sl}{ecsi}
-\EC@family{T1}{cmss}{m}{it}{ecsi}
-\EC@family{T1}{cmss}{bx}{n}{ecsx}
-\EC@family{T1}{cmss}{bx}{it}{ecso}
-\EC@family{T1}{cmss}{bx}{sl}{ecso}
-\DeclareFontShape{T1}{cmss}{sbc}{n}{%
-      <5><6><7><8><9><10><10.95><12><14.4><17.28>%
-      <20.74><24.88><29.86><35.83><42.99><51.59>%
-      ecssdc10
-       }{}
-\DeclareFontShape{OT1}{cmss}{m}{n}
-     {%
-      <5><6><7><8>cmss8%
-      <9>cmss9%
-      <10><10.95>cmss10%
-      <12><14.4>cmss12%
-      <17.28><20.74><24.88><29.86><35.83><42.99><51.59>cmss17%
-      }{}
-\DeclareFontShape{OT1}{cmss}{m}{sl}
-    {%
-      <5><6><7><8>cmssi8<9>cmssi9%
-      <10><10.95>cmssi10%
-      <12><14.4>cmssi12%
-      <17.28><20.74><24.88><29.86><35.83><42.99><51.59>cmssi17%
-      }{}
-\DeclareFontShape{OT1}{cmss}{sbc}{n}
-     {%
-      <5><6><7><8><9>cmssdc10%
-       <10><10.95><12><14.4><17.28><20.74><24.88><29.86><35.83><42.99><51.59>cmssdc10%
-       }{}
-\DeclareFontShape{OT1}{cmss}{bx}{n}
-     {%
-      <5><6><7><8><9>cmssbx10%
-      <10><10.95><12><14.4><17.28><20.74><24.88><29.86><35.83><42.99><51.59>cmssbx10%
-      }{}
 
-%
-%
-% Declarations used by beamer
-%
-%
+\RequirePackage{beamerbasecompatibility}
+% Fixes other packages
 
-% Public
-\newdimen\headheight    % Total height of the headline (including depth)
-\newdimen\headdp        % Depth of the headline
-\newdimen\footheight    % Height of the footline
-\newdimen\sidebarheight % Height of the sidebars
-
-% Private (will all have prefix beamer@ in the future)
-\newdimen\beamer@tempdim
-\newdimen\beamer@finalheight
-\newdimen\beamer@animht
-\newdimen\beamer@animdp
-\newdimen\beamer@animwd
-\newdimen\beamer@leftmargin
-\newdimen\beamer@rightmargin
-\newdimen\beamer@leftsidebar
-\newdimen\beamer@rightsidebar
-\newdimen\tempheight
-\newdimen\beamer@boxsize
-\newdimen\vboxoffset
-\newdimen\postemp
-\newdimen\originalbaselineskip
-\newdimen\@descdefault
-\newdimen\@descdefaulttemp
-\newdimen\bibindent
-\newbox\beamer@areabox
-\newbox\beamer@animcurrent
-\newbox\beamer@animshowbox
-\newbox\beamer@tempbox
-\newbox\sectionbox
-\newbox\tempbox
-\newbox\navigationbox
-\newbox\logobox
-\newbox\linebox
-\newcount\beamer@tempcount
-
-
-%
-%
-% Hyperlink fix for problem with empty test in pdfmark.def
-%
-%
-\let\beamer@orighyperlink\hyperlink
-\def\hyperlink#1#2{\beamer@orighyperlink{#1}{\relax#2}}
-
-
-% Hyperlinks must be suspended until document starts - they are used
-% inside \usetemplate commands before the beginning of the document,
-% but there we do not want them to have an effect.
-\let\suspendedhyperlink\hyperlink
-\let\suspendedAcrobatmenu\Acrobatmenu
-\def\hyperlink#1#2{#2}
-\def\Acrobatmenu#1#2{#2}
-\providecommand\hyper@pagetransition{}
-\providecommand\hyper@pageduration{}
-\providecommand\hyper@pagehidden{}
-
-\AtBeginDocument{%
-\if@notesnormals\let\hyperlink\suspendedhyperlink\let\Acrobatmenu\suspendedAcrobatmenu\fi%
-
-\if@sansmath
-\SetSymbolFont{operators}{normal}{OT1}{cmss}{m}{n}
-\ifx\mv@bold\@undefined\else
-\SetSymbolFont{operators}{bold}{OT1}{cmss}{bx}{n}
-\fi
-\fi
-
-\newif\if@suppressreplacements % decides whether fonts should be substituted
-\@suppressreplacementsfalse
-\def\@cmr{cmr}
-\edef\@fmdef{\mathfamilydefault}
-
-% supress for standard cm
-\ifx\@fmdef\@cmr\@suppressreplacementstrue\fi
-
-% supress for mathtime serif
-\@ifpackageloaded{mathtime}{\if@sansmath\else\@suppressreplacementstrue\fi}{}
-
-\if@suppressreplacements\else
-  \DeclareSymbolFont{numbers}{OT1}{\mathfamilydefault}{m}{n}
-  \DeclareSymbolFont{pureletters}{OT1}{\mathfamilydefault}{m}{it}
-  \ifx\mv@bold\@undefined\else
-  \SetSymbolFont{numbers}{bold}{OT1}{\mathfamilydefault}{bx}{n}
-  \SetSymbolFont{pureletters}{bold}{OT1}{\mathfamilydefault}{bx}{it}
-  \fi
-
-  \def\operator@font{\mathgroup\symnumbers}
-
-  \DeclareMathSymbol{0}\mathalpha{numbers}{"30}
-  \DeclareMathSymbol{1}\mathalpha{numbers}{"31}
-  \DeclareMathSymbol{2}\mathalpha{numbers}{"32}
-  \DeclareMathSymbol{3}\mathalpha{numbers}{"33}
-  \DeclareMathSymbol{4}\mathalpha{numbers}{"34}
-  \DeclareMathSymbol{5}\mathalpha{numbers}{"35}
-  \DeclareMathSymbol{6}\mathalpha{numbers}{"36}
-  \DeclareMathSymbol{7}\mathalpha{numbers}{"37}
-  \DeclareMathSymbol{8}\mathalpha{numbers}{"38}
-  \DeclareMathSymbol{9}\mathalpha{numbers}{"39}
-
-  \DeclareMathSymbol{A}\mathalpha{pureletters}{"41}
-  \DeclareMathSymbol{B}\mathalpha{pureletters}{"42}
-  \DeclareMathSymbol{C}\mathalpha{pureletters}{"43}
-  \DeclareMathSymbol{D}\mathalpha{pureletters}{"44}
-  \DeclareMathSymbol{E}\mathalpha{pureletters}{"45}
-  \DeclareMathSymbol{F}\mathalpha{pureletters}{"46}
-  \DeclareMathSymbol{G}\mathalpha{pureletters}{"47}
-  \DeclareMathSymbol{H}\mathalpha{pureletters}{"48}
-  \DeclareMathSymbol{I}\mathalpha{pureletters}{"49}
-  \DeclareMathSymbol{J}\mathalpha{pureletters}{"4A}
-  \DeclareMathSymbol{K}\mathalpha{pureletters}{"4B}
-  \DeclareMathSymbol{L}\mathalpha{pureletters}{"4C}
-  \DeclareMathSymbol{M}\mathalpha{pureletters}{"4D}
-  \DeclareMathSymbol{N}\mathalpha{pureletters}{"4E}
-  \DeclareMathSymbol{O}\mathalpha{pureletters}{"4F}
-  \DeclareMathSymbol{P}\mathalpha{pureletters}{"50}
-  \DeclareMathSymbol{Q}\mathalpha{pureletters}{"51}
-  \DeclareMathSymbol{R}\mathalpha{pureletters}{"52}
-  \DeclareMathSymbol{S}\mathalpha{pureletters}{"53}
-  \DeclareMathSymbol{T}\mathalpha{pureletters}{"54}
-  \DeclareMathSymbol{U}\mathalpha{pureletters}{"55}
-  \DeclareMathSymbol{V}\mathalpha{pureletters}{"56}
-  \DeclareMathSymbol{W}\mathalpha{pureletters}{"57}
-  \DeclareMathSymbol{X}\mathalpha{pureletters}{"58}
-  \DeclareMathSymbol{Y}\mathalpha{pureletters}{"59}
-  \DeclareMathSymbol{Z}\mathalpha{pureletters}{"5A}
-
-  \DeclareMathSymbol{a}\mathalpha{pureletters}{"61}
-  \DeclareMathSymbol{b}\mathalpha{pureletters}{"62}
-  \DeclareMathSymbol{c}\mathalpha{pureletters}{"63}
-  \DeclareMathSymbol{d}\mathalpha{pureletters}{"64}
-  \DeclareMathSymbol{e}\mathalpha{pureletters}{"65}
-  \DeclareMathSymbol{f}\mathalpha{pureletters}{"66}
-  \DeclareMathSymbol{g}\mathalpha{pureletters}{"67}
-  \DeclareMathSymbol{h}\mathalpha{pureletters}{"68}
-  \DeclareMathSymbol{i}\mathalpha{pureletters}{"69}
-  \DeclareMathSymbol{j}\mathalpha{pureletters}{"6A}
-  \DeclareMathSymbol{k}\mathalpha{pureletters}{"6B}
-  \DeclareMathSymbol{l}\mathalpha{pureletters}{"6C}
-  \DeclareMathSymbol{m}\mathalpha{pureletters}{"6D}
-  \DeclareMathSymbol{n}\mathalpha{pureletters}{"6E}
-  \DeclareMathSymbol{o}\mathalpha{pureletters}{"6F}
-  \DeclareMathSymbol{p}\mathalpha{pureletters}{"70}
-  \DeclareMathSymbol{q}\mathalpha{pureletters}{"71}
-  \DeclareMathSymbol{r}\mathalpha{pureletters}{"72}
-  \DeclareMathSymbol{s}\mathalpha{pureletters}{"73}
-  \DeclareMathSymbol{t}\mathalpha{pureletters}{"74}
-  \DeclareMathSymbol{u}\mathalpha{pureletters}{"75}
-  \DeclareMathSymbol{v}\mathalpha{pureletters}{"76}
-  \DeclareMathSymbol{w}\mathalpha{pureletters}{"77}
-  \DeclareMathSymbol{x}\mathalpha{pureletters}{"78}
-  \DeclareMathSymbol{y}\mathalpha{pureletters}{"79}
-  \DeclareMathSymbol{z}\mathalpha{pureletters}{"7A}
-\fi
-
-  }
-\let\beamer@origdocument\document
-\def\document{%
-  \endgroup%
-  \recalculatefoot%
-  \recalculatehead%
-  \AtBeginDocument{% fix french.ldf's meddling with \itemize and \trivlist
-    \ifx\bbl@nonfrenchitemize\@undefined\else\bbl@nonfrenchitemize\fi%
-    \ifx\bbl@nonfrenchlistspacing\@undefined\else\bbl@nonfrenchlistspacing\fi}%
-  \AtBeginDocument{% fix spanish.ldf's meddling with < and > 
-    \@ifundefined{deactivatequoting}{}{\deactivatequoting}}
-  \begingroup\beamer@origdocument}
-
-\definecolor{alert}{rgb}{1,0,0}
-
-\AtBeginDocument{\def\es@itemize#1#2#3#4{}}% fix spanish.ldf's with \itemize 
-
-
-% fix deluxetabular floats
-\AtBeginDocument{
-  \def\@plano@float@#1{\begin{table}}
-  \def\end@plano@float@{\end{table}}
-}
+\RequirePackage{beamerbasefont}
+% Font stuff
 
 % Setup normal font (for calculation of head sizes)
 \normalfont
 
+\RequirePackage{beamerbasetoc}
+% Table of Contents Format
+
+
+%
+% Color stuff
+%
+\definecolor{alert}{rgb}{1,0,0}
+
 %
 %
 % Empty test
 %
 %
-\long\def\@ifempty#1{\beamer@xifempty#1@@..\@nil}
+\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}
 
-
-
+\addtocontents{toc}{\protect\beamer@endinputifotherversion{\the\beamer@version}}
+\addtocontents{nav}{\protect\beamer@endinputifotherversion{\the\beamer@version}}
 
 % Calculate maximum number of sections/subsections per part
-\newcount\beamer@sectioncount
-\newcount\subsection@max
-\newcount\section@max
-\subsection@max=0\relax
-\section@max=0\relax
+\beamer@subsectionmax=0\relax
+\beamer@sectionmax=0\relax
 \beamer@sectioncount=0\relax
 
-\newcount\totalheads
-\def\headcommand#1{\global\advance\totalheads by1\relax\expandafter\gdef\csname
-  head\the\totalheads\endcsname{#1}}
+\def\headcommand#1{\global\advance\beamer@totalheads by1\relax\expandafter\gdef\csname
+  head\the\beamer@totalheads\endcsname{#1}}
 \beamer@activecjk
-\@input{\jobname.head}
-\newcount\headcounter
-\def\dohead{\headcounter=0\loop\ifnum\headcounter<\totalheads%
-  \advance\headcounter by1\relax%
-  \csname head\the\headcounter\endcsname\repeat}
+\@input{\jobname.nav}
+\def\dohead{\beamer@headcounter=0\loop\ifnum\beamer@headcounter<\beamer@totalheads%
+  \advance\beamer@headcounter by1\relax%
+  \csname head\the\beamer@headcounter\endcsname\repeat}
 
 \def\beamer@startpageofframe{1}
 \def\beamer@endpageofframe{1}
 
 \def\partentry#1#2{\beamer@sectioncount=0}
 \def\sectionentry#1#2#3#4#5{\advance\beamer@sectioncount by1\relax%
-  \ifnum\section@max<\beamer@sectioncount\section@max=\beamer@sectioncount\fi}
-\def\slideentry#1#2#3#4#5#6{\ifnum\subsection@max<#2\relax\subsection@max=#2\fi}
+  \ifnum\beamer@sectionmax<\beamer@sectioncount\beamer@sectionmax=\beamer@sectioncount\fi}
+\def\slideentry#1#2#3#4#5#6{\ifnum\beamer@subsectionmax<#2\relax\beamer@subsectionmax=#2\fi}
 \def\beamer@framepages#1#2{}
 \def\beamer@subsectionpages#1#2{}
 \def\beamer@sectionpages#1#2{}
 % The \titlepage and \usetitlepagetemplate command
 %
 %
-\newcommand\titlepage{{\beamer@titlepagetemplate}}
+\def\titlepage{{\beamer@titlepagetemplate}}
 \long\def\usetitlepagetemplate#1{\def\beamer@titlepagetemplate{#1}}
 
 %
 % The \partpage and \usepartpagetemplate command
 %
 %
-\newcommand\partpage{{\beamer@partpagetemplate}}
+\def\partpage{{\beamer@partpagetemplate}}
 \long\def\usepartpagetemplate#1{\def\beamer@partpagetemplate{#1}}
 
 %
 % The \logo command
 %
 %
-\newcommand\logo[1]{\def\insertlogo{#1}}
+\def\logo#1{\def\insertlogo{#1}}
 \logo{}
 
 
 %
 \newcounter{part}
 \renewcommand\thepart{\@arabic\c@part}
-\newcount\beamer@partstartpage
 \beamer@partstartpage=1
 
 \def\part{\@ifnextchar[\@part\@@part}
 \long\def\@@part#1{\@part[#1]{#1}}
 \long\def\@part[#1]#2{%
   \refstepcounter{part}%
-  \def\@partname{#2}%
-  \def\@partnameshort{#1}%
+  \def\beamer@partname{#2}%
+  \def\beamer@partnameshort{#1}%
   \addtocontents{head}{\protect\headcommand{\protect\partentry{#2}{\thepart}}}%
-  \xdef\partlink{{Navigation\thepage}{\noexpand\@partname}}%
-  \xdef\partlinkshort{{Navigation\thepage}{\noexpand\@partnameshort}}%
+  \xdef\partlink{{Navigation\thepage}{\noexpand\beamer@partname}}%
+  \xdef\partlinkshort{{Navigation\thepage}{\noexpand\beamer@partnameshort}}%
   \beamer@tempcount=\c@page\advance\beamer@tempcount by -1%
   \addtocontents{head}{\protect\headcommand{\protect\beamer@partpages{\the\beamer@partstartpage}{\the\beamer@tempcount}}}%
   \addtocontents{head}{\protect\headcommand{\protect\beamer@sectionpages{\the\beamer@sectionstartpage}{\the\beamer@tempcount}}}%
 \def\sectionname{Section}
 \newcounter{section}
 \renewcommand\thesection{\@arabic\c@section}
-\newcount\beamer@sectionstartpage
-\beamer@sectionstartpage=1
+\beamer@sectionstartpage=1\relax
+\beamer@tocsectionnumber=0\relax
 
 \def\section{\@ifnextchar[\@section\@@section}
 \long\def\@@section#1{\@section[#1]{#1}}
 \long\def\@section[#1]#2{%
   \refstepcounter{section}%
-  \@ifempty{#2}%
+  \beamer@ifempty{#2}%
   {\long\def\secname{#1}}%
-  {\long\def\secname{#2}\addtocontents{toc}{\protect\sectionintoc{\thesection}{#2}{\thepage}{\thepart}}}%
+  {\advance\beamer@tocsectionnumber by 1\relax%
+   \long\def\secname{#2}\addtocontents{toc}{\protect\beamer@sectionintoc{\thesection}{#2}{\thepage}{\thepart}%
+      {\the\beamer@tocsectionnumber}}}%
   \addtocontents{head}{\protect\headcommand{\protect\sectionentry{\thesection}{#1}{\thepage}{\secname}{\thepart}}}%
   {\let\\=\relax\xdef\sectionlink{{Navigation\thepage}{\noexpand\secname}}}%
   \beamer@tempcount=\c@page\advance\beamer@tempcount by -1%
 \def\insertsection{}
 \def\lastsubsection{}
 
-\def\breakhere{\protect\@breakhere}
-\def\@breakhere{}
+\def\breakhere{\protect\beamer@breakhere}
+\def\beamer@breakhere{}
 
 
 
 \newcounter{subsection}[section]
 \renewcommand\thesubsection{\@arabic\c@subsection}
 
-\newcount\beamer@subsectionstartpage
 \beamer@subsectionstartpage=1
 
 \def\subsection{\@ifnextchar[\@subsection\@@subsection}
 
 \def\@subsection[#1]#2{%
   \refstepcounter{subsection}%
-  \@ifempty{#2}{\long\def\subsecname{#1}\long\def\lastsubsection{#1}}
+  \beamer@ifempty{#2}{\long\def\subsecname{#1}\long\def\lastsubsection{#1}}
   {%
     \long\def\subsecname{#2}%
     \long\def\lastsubsection{#1}%
-    \addtocontents{toc}{\protect\subsectionintoc{\thesection}{\thesubsection}{#2}{\thepage}{\thepart}}%
+    \addtocontents{toc}{\protect\beamer@subsectionintoc{\thesection}{\thesubsection}{#2}{\thepage}{\thepart}{\the\beamer@tocsectionnumber}}%
   }%
   \beamer@tempcount=\c@page\advance\beamer@tempcount by -1%
   \addtocontents{head}{\protect\headcommand{\protect\beamer@subsectionpages{\the\beamer@subsectionstartpage}{\the\beamer@tempcount}}}%
   \Hy@writebookmark{\thesubsection}{#1}{Outline\thesection.\thesubsection.\thepage}{2}{toc}%
   \hyper@anchorstart{Outline\thesection.\thesubsection.\thepage}\hyper@anchorend}
 
-
-
 \def\untitledsubsection{%
   \refstepcounter{subsection}%
   \def\insertsubsection{}%
 \def\insertsubsection{}
 
 
+
+
 %
 % Slide Definitions
 %
   }%
 }
 
-\newenvironment{frameslide}[1][1]{%
-  {\let\@elt\@restorecounter\@overlaycounterresets}%
+\newenvironment{beamer@frameslide}{%
+  {\let\@elt\beamer@restorecounter\beamer@overlaycounterresets}%
   \global\beamer@pausecount=1\relax%
-  \serialnumber=#1\relax%
-  \expandafter\@ifempty\expandafter{\beamer@framestartpage}{%
+  \expandafter\beamer@ifempty\expandafter{\beamer@framestartpage}{%
     \refstepcounter{subsectionslide}%
     \xdef\beamer@framestartpage{\thepage}% only first time
   }{\clearpage}% cleanup from previous slide
   {\beamer@exitcode\vskip0pt plus 1.5fill\end{pauses}}
 
 \def\frametitle#1{%
-  \@ifempty{#1}{}{%
+  \beamer@ifempty{#1}{}{%
   \vskip0pt plus -1fill%
-  {\gdef\insertframetitle{#1}\@headrenderer}
+  {\gdef\insertframetitle{#1}\beamer@headrenderer}
   \vskip0.25em%
   \ifbeamer@centered
   \vfill%
   \fi}%
 }
 
-\long\def\useframetitletemplate#1{\def\@headrenderer{#1}}
+\long\def\useframetitletemplate#1{\def\beamer@headrenderer{#1}}
 
 
 
 %
 %
 
-\let\origverb@egroup=\verb@egroup
+\let\beamer@verb@egroup=\verb@egroup
 
-\def\@setb{\setbox0=\copy}
+\def\beamer@setb{\setbox0=\copy}
 \long\def\defverb#1{%
   \expandafter\newbox\csname @verb\string#1\endcsname%
-  \def#1{{\expandafter\@setb\csname
+  \def#1{{\expandafter\beamer@setb\csname
       @verb\string#1\endcsname\unhbox0}}%
-  \def\verb@egroup{\global\let\verb@balance@group\@empty\egroup\egroup\let\verb@egroup=\origverb@egroup}
+  \def\verb@egroup{\global\let\verb@balance@group\@empty\egroup\egroup\let\verb@egroup=\beamer@verb@egroup}
   \expandafter\setbox\csname @verb\string#1\endcsname=\hbox\bgroup
   \verb}
 
 
 \long\def\defverbatim#1{%
   \expandafter\newbox\csname @verb\string#1\endcsname%
-  \def#1{{\expandafter\@setb\csname @verb\string#1\endcsname\unvbox0}}%
+  \def#1{{\expandafter\beamer@setb\csname @verb\string#1\endcsname\unvbox0}}%
   \expandafter\setbox\csname @verb\string#1\endcsname=\vbox\bgroup
   \def\set@color{}\def\reset@color{}\let\@next=}
 
 
 \def\alt{\beamer@parsebr\@alt}
 \long\def\@alt<#1>#2#3{%
-  \def\dowhat{#3}\def\doit{#2}%
-  {\setbox0=\hbox{\decode#1| stop:| }}\dowhat}
+  \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\dowhat{\@picked}\def\doit{#3}%
-  {\setbox0=\hbox{\@localanotherslidefalse\decode#1| stop:|
-      \if@localanotherslide\gdef\@picked{#2}\else\gdef\@picked{#4}\fi}}\dowhat}
+  \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\original#1{\csname @orig\string#1\endcsname}
 
 % begin #4 and end #5
   \newenvironment{#1}{}{}%
   \expandafter\def\csname #1\endcsname{%
-    \@ifnextchar<{\@parsebegin{#1}{#2}{#3}{#4}{#5}}{%
+    \@ifnextchar<{\beamer@parsebegin{#1}{#2}{#3}{#4}{#5}}{%
       \expandafter\def\csname end#1\endcsname{#3}#2}}%
   }
     
-\long\def\@parsebegin#1#2#3#4#5<#6>{%
+\long\def\beamer@parsebegin#1#2#3#4#5<#6>{%
   \alt<#6>{% In slide case
     \expandafter\def\csname end#1\endcsname{#3}%
     #2}{%
     #4}}
 
 \long\def\renewoverlayenvironment#1#2#3#4#5{%
-  \edef\@do{\csname original#1\endcsname=\expandafter\noexpand\csname#1\endcsname}
-  \expandafter\let\@do
-  \edef\@do{\csname endoriginal#1\endcsname=\expandafter\noexpand\csname end#1\endcsname}
-  \expandafter\let\@do
+  \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<{\@parsebegin{#1}{#2}{#3}{#4}{#5}}{%
+    \@ifnextchar<{\beamer@parsebegin{#1}{#2}{#3}{#4}{#5}}{%
       \expandafter\def\csname end#1\endcsname{#3}#2}%
     }%
   }
   \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<{\@parsebegin{#1}{\csname @in#1\endcsname{##1}}{#3}{\csname @out#1\endcsname{##1}}{#5}}{%
+    \@ifnextchar<{\beamer@parsebegin{#1}{\csname @in#1\endcsname{##1}}{#3}{\csname @out#1\endcsname{##1}}{#5}}{%
       \expandafter\def\csname end#1\endcsname{#3}#2}}%
 }
 
 %  
 
 \def\resetcounteronoverlays#1{%
-  \@cons\@overlaycounterresets{{c@#1}}%  
+  \@cons\beamer@overlaycounterresets{{c@#1}}%  
 }
 
 \def\resetcountonoverlays#1{%
-  \@cons\@overlaycounterresets{{#1}}%  
+  \@cons\beamer@overlaycounterresets{{#1}}%  
 }
 
-\def\@overlaycounterresets{}
+\def\beamer@overlaycounterresets{}
   
 \resetcounteronoverlays{equation}
 \resetcounteronoverlays{parentequation}
 \resetcounteronoverlays{figure}
 \resetcounteronoverlays{table}
 
-\def\@savecounter#1{%
+\def\beamer@savecounter#1{%
   \@ifundefined{#1}{}%
   {\expandafter\xdef\csname saved@#1\endcsname%
     {\expandafter\the\csname #1\endcsname}}%
 }
-\def\@restorecounter#1{%
+\def\beamer@restorecounter#1{%
   \@ifundefined{#1}{}%
   {\edef\temp{\csname saved@#1\endcsname}%
   \expandafter\global\csname #1\endcsname=\temp}%
 }
 
+
+
   
 %
 % Uncovering management
 \def\beamer@startcovered{%
   \gdef\beamer@do{\aftergroup\pgfsys@endinvisible\pgfsys@begininvisible}%
   \def\mixinon<##1>##2{\only<##1>{\gdef\beamer@do{\colormixin{##2}}}\ignorespaces}%
+  \def\opaqueness<##1>##2{\only<##1>{%
+      \gdef\beamer@do{%
+        \advance\beamer@coveringdepth by 1\relax%
+        \colorlet{beamer@freeze\the\beamer@coveringdepth}{averagebackgroundcolor}
+        \edef\beamer@colorhook{!##2!beamer@freeze\the\beamer@coveringdepth\beamer@colorhook}%
+        \def\beamer@pgfextension{##2opaque}\color{.}%
+        }}%
+      \ignorespaces}%
   \def\invisibleon<##1>{\only<##1>{\gdef\beamer@do{\aftergroup\pgfsys@endinvisible\pgfsys@begininvisible}}\ignorespaces}%
-  \ifnum\serialnumber<\beamer@minimum%ok, at beginning
+  \ifnum\beamer@slideinframe<\beamer@minimum%ok, at beginning
   {%
     \beamer@saveanother%
-    \advance\beamer@minimum by-\serialnumber%
-    \serialnumber=\beamer@minimum%
+    \advance\beamer@minimum by-\beamer@slideinframe%
+    \beamer@slideinframe=\beamer@minimum%
     \beamer@uncoverbeforeactions%
     \beamer@restoreanother%
   }%
   \else%
   {%
     \beamer@saveanother%
-    \advance\serialnumber by-\beamer@minimum%
+    \advance\beamer@slideinframe by-\beamer@minimum%
     \beamer@uncoverafteractions%
     \beamer@restoreanother%
   }%
   \fi%
   \begingroup\beamer@do}
 \def\beamer@endcovered{\endgroup}%
-\def\beamer@saveanother{\let\beamer@savedif=\if@anotherslide}
-\def\beamer@restoreanother{\global\let\if@anotherslide=\beamer@savedif}
 
 \def\beamersetuncovermixins#1#2{%
   \gdef\beamer@uncoverbeforeactions{\ignorespaces#1}%
 
 \beamersetuncovermixins{}{}
 
+\def\colorhook{\edef\beamer@args{{@hookcolor}{@hookcolor\colorcurrentmixin\beamer@colorhook}}\expandafter\colorlet\beamer@args}
+\def\pgfalternateextension{\colorcurrentmixin\beamer@pgfextension}
 
+\def\beamer@colorhook{}
+\def\beamer@pgfextension{}
 
-  
+\beamer@coveringdepth=0
+
 %
 % Pausing environment
 %
 
-\newcount\beamer@pausecount%
 \def\pauses{\@ifnextchar[{\@pauses}{\@@pauses}}
 \def\@pauses[#1]{\global\beamer@pausecount=#1\relax%
   \@@pauses}
 % Make item overlays
 %
 
-\let\@origitem=\item
+\let\beamer@origitem=\item
 \def\item{%
-  \@closeitem\gdef\@closeitem{}%
-  \@ifnextchar<{\@parseitem}{\@origitem}}
-\def\@closeitem{}
-\def\@parseitem<#1>{%
+  \beamer@closeitem\gdef\beamer@closeitem{}%
+  \@ifnextchar<{\beamer@parseitem}{\beamer@origitem}}
+\def\beamer@closeitem{}
+\def\beamer@parseitem<#1>{%
   \alt<#1>{\beamer@spacingcover%for spacing reasons
-    \gdef\@closeitem{\beamer@spacingcover}\@origitem}%
-  {\beamer@startcovered\gdef\@closeitem{\beamer@endcovered}\@origitem}%
+    \gdef\beamer@closeitem{\beamer@spacingcover}\beamer@origitem}%
+  {\beamer@startcovered\gdef\beamer@closeitem{\beamer@endcovered}\beamer@origitem}%
   }
 
-\let\@origendtrivlist=\endtrivlist
-\def\endtrivlist{\@closeitem\global\let\@closeitem=\@sci\global\let\@sci=\@ssci\global\let\@ssci=\@sssci\@origendtrivlist}
-\let\@orig@trivlist=\@trivlist
-\def\@trivlist{\global\let\@sssci=\@ssci\global\let\@ssci=\@sci\global\let\@sci=\@closeitem\gdef\@closeitem{}\@orig@trivlist}
-\def\@closeitem{}
+\let\beamer@origendtrivlist=\endtrivlist
+\def\endtrivlist{%
+  \beamer@closeitem%
+  \global\let\beamer@closeitem=\beamer@sci%
+  \global\let\beamer@sci=\beamer@ssci%
+  \global\let\beamer@ssci=\beamer@sssci\beamer@origendtrivlist}
+\let\beamer@orig@trivlist=\@trivlist
+\def\@trivlist{%
+  \global\let\beamer@sssci=\beamer@ssci%
+  \global\let\beamer@ssci=\beamer@sci\global%
+  \let\beamer@sci=\beamer@closeitem%
+  \gdef\beamer@closeitem{}%
+  \beamer@orig@trivlist}
+\def\beamer@closeitem{}
 
-\newcount\serialnumber
-\newcount\@serialnumber
-\newcount\maxserialnumber
 
-\newif\if@anotherslide
-\newif\if@localanotherslide
 
 \newcounter{framenumber}
 \def\insertframenumber{\@arabic\c@framenumber}
 \def\beamer@frame{\begingroup\catcode`:=12\catcode`|=12\beamer@@frame}% Hackery for french style
 \def\beamer@@frame[#1]{\endgroup%
   \refstepcounter{framenumber}%
-  {\let\@elt\@savecounter\@overlaycounterresets}
+  {\let\@elt\beamer@savecounter\beamer@overlaycounterresets}
   \gdef\insertframetitle{}%
   \gdef\beamer@framestartpage{}%
-  \gdef\@whichframes{#1}%
-  \serialnumber=0\relax%
-  \@anotherslidefalse%
-  {\setbox0=\hbox{\expandafter\decode\@whichframes| stop:| }}%
-  \if@anotherslide%
-  \serialnumber=2\relax%
-  \def\dowhat{}%
-  \def\doit{\let\howtotreatframe\doseveralframes}%
-  \@anotherslidefalse%
-  {\setbox0=\hbox{\expandafter\decode\@whichframes| stop:| }}%
-  \if@anotherslide%
+  \gdef\beamer@whichframes{#1}%
+  \beamer@slideinframe=0\relax%
+  \beamer@anotherslidefalse%
+  {\setbox0=\hbox{\expandafter\beamer@decode\beamer@whichframes| stop:| }}%
+  \ifbeamer@anotherslide%
+  \beamer@slideinframe=2\relax%
+  \def\beamer@doifnotinframe{}%
+  \def\beamer@doifinframe{\let\howtotreatframe\doseveralframes}%
+  \beamer@anotherslidefalse%
+  {\setbox0=\hbox{\expandafter\beamer@decode\beamer@whichframes| stop:| }}%
+  \ifbeamer@anotherslide%
   \let\howtotreatframe\doseveralframes\else%
   \let\howtotreatframe\dosingleframe%
   \fi%
-  \dowhat%
+  \beamer@donow%
   \else%
   \let\howtotreatframe\donoframe%
   \fi%
-  \if@notesnormals\else\let\howtotreatframe\donoframe\fi%
+  \ifbeamer@notesnormals\else\let\howtotreatframe\donoframe\fi%
   \howtotreatframe}
 \long\def\donoframe{%
-  \serialnumber=1\relax%
-  \@serialnumber=1\relax%
-  \setbox\tempbox\vbox\bgroup\leavevmode\def\pause{}\afterassignment\@checknoslide\let\@next}
-\def\@checknoslide{%
-  \ifcat\bgroup\noexpand\@next%
-  \let\@do\beamer@reseteecodes%
-  \else\let\@do\beamer@noframesingletoken\fi%
-  \@do}
-\def\beamer@noframesingletoken{\@next\egroup\beamer@reseteecodes}
+  \beamer@slideinframe=1\relax%
+  \beamer@slideinframe=1\relax%
+  \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%
+  \else\let\beamer@do\beamer@noframesingletoken\fi%
+  \beamer@do}
+\def\beamer@noframesingletoken{\beamer@next\egroup\beamer@reseteecodes}
 
 \long\def\doseveralframes#1{%
-  \@serialnumber=1\relax%
+  \beamer@slideinframe=1\relax%
   \loop%
-  \@anotherslidefalse%
-  \def\dowhat{}%
-  \def\doit{\begin{frameslide}[\@serialnumber]%
+  \beamer@anotherslidefalse%
+  \def\beamer@doifnotinframe{}%
+  \def\beamer@doifinframe{\begin{beamer@frameslide}%
     #1%
-  \end{frameslide}}%
-  \serialnumber=\@serialnumber%
-  {\setbox0=\hbox{\expandafter\decode\@whichframes| stop:| }}%
-  \dowhat%
-  \if@anotherslide
-  \advance\@serialnumber by 1\relax
+  \end{beamer@frameslide}}%
+  \beamer@slideinframe=\beamer@slideinframe%
+  {\setbox0=\hbox{\expandafter\beamer@decode\beamer@whichframes| stop:| }}%
+  \beamer@donow%
+  \ifbeamer@anotherslide
+  \advance\beamer@slideinframe by 1\relax
   \repeat%
   \beamer@writeslidentry%
   \beamer@reseteecodes}
 
-\def\dosingleframe{\begin{frameslide}[1]\bgroup\aftergroup\@endslide\afterassignment\@checkslide\let\@next}
-\def\@checkslide{%
-  \ifcat\bgroup\noexpand\@next%
-  \let\@do\relax%
-  \else\let\@do\beamer@singletoken\fi%
-  \@do}
-\def\@endslide{\end{frameslide}\beamer@writeslidentry\beamer@reseteecodes}
-\def\beamer@singletoken{\@next\egroup}
+\def\dosingleframe{\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\@ifempty\expandafter{\beamer@framestartpage}{}% nothing to do ...
+  \expandafter\beamer@ifempty\expandafter{\beamer@framestartpage}{}% nothing to do ...
   {%else
     \addtocontents{head}%
       {\protect\headcommand{%
   \def\beamer@entrycode{\vspace*{-\headheight}}%
   \def\beamer@exitcode{\vspace*{-\footheight}\thispagestyle{empty}}\frame}
 
-% Sets dowhat to doif, if \serialnumber is in the specified
+% 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\decode{\global\beamer@minimum=10000\relax\gdef\@decodefound{+}\@@decodefind}
-\def\@@decodefind{\futurelet\@next\@decodeinsertdefault}
-\def\@decodeinsertdefault{\ifcat\@next a%
-  \gdef\@next{}%
+\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\@next{default:}%
+  \gdef\beamer@next{default:}%
   \fi%
-  \expandafter\@decodefind\@next}
+  \expandafter\beamer@decodefind\beamer@next}
 
-\def\@modestop{stop}
-\def\@modeall{all}
-\def\@decodefind#1:#2| {%
-  \def\@mode{#1}%
-  \ifx\@mode\@modestop%
-    \expandafter\@decode\@decodefound,!%
-    \let\@next=\relax%
+\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\@mode\@currentmode%
-      \gdef\@decodefound{#2}%
+    \ifx\beamer@mode\beamer@currentmode%
+      \gdef\beamer@decodefound{#2}%
     \else%
-      \ifx\@mode\@modeall%
-        \gdef\@decodefound{#2}%
+      \ifx\beamer@mode\beamer@modeall%
+        \gdef\beamer@decodefound{#2}%
       \fi%
     \fi%
-    \let\@next=\@@decodefind%
+    \let\beamer@next=\beamer@@decodefind%
   \fi%
-  \@next}
+  \beamer@next}
 
-\newcount\beamer@minimum
-
-\def\dowhat{}
-\def\@decode{%
+\def\beamer@doifnotinframe{}
+\def\beamer@@decode{%
   \@ifnextchar!%
-  {\@decodeend}%
+  {\beamer@decodeend}%
   {%
     \@ifnextchar+%
-    {\@decodeall}{%
+    {\beamer@decodeall}{%
       \@ifnextchar-%
-      {\@decodeuntil}%
-      {\@decodenumber}}}}
-\def\@decodeend!{}
-\def\@decodeall+,{%
+      {\beamer@decodeuntil}%
+      {\beamer@decodenumber}}}}
+\def\beamer@decodeend!{}
+\def\beamer@decodeall+,{%
   \ifnum1<\beamer@minimum\global\beamer@minimum=1\fi%
-  \ifnum1>\serialnumber%
-  \global\@anotherslidetrue%
-  \@localanotherslidetrue%
+  \ifnum1>\beamer@slideinframe%
+  \global\beamer@anotherslidetrue%
+  \beamer@localanotherslidetrue%
   \fi%
-  \gdef\dowhat{\doit}\@decode}
-\def\@decodeuntil-#1,{%
+  \gdef\beamer@doifnotinframe{\beamer@doifinframe}\beamer@@decode}
+\def\beamer@decodeuntil-#1,{%
   \ifnum1<\beamer@minimum\global\beamer@minimum=1\fi%
-  \ifnum#1>\serialnumber\global\@anotherslidetrue\@localanotherslidetrue\fi%
-  \ifnum\serialnumber>#1\else\gdef\dowhat{\doit}\fi%
-  \@decode}
-\def\@decodenumber#1{%
+  \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,%
-  {\@decodeone{#1}}%
+  {\beamer@decodeone{#1}}%
   {\@ifnextchar-%
-    {\@decodenumberto{#1}}%
-    {\@decodegobble{#1}}}}
-\def\@decodegobble#1#2{%
-  \@decodenumber{#1#2}}
-\def\@decodenumberto#1-{
+    {\beamer@decodenumberto{#1}}%
+    {\beamer@decodegobble{#1}}}}
+\def\beamer@decodegobble#1#2{%
+  \beamer@decodenumber{#1#2}}
+\def\beamer@decodenumberto#1-{
   \@ifnextchar,%
-  {\@decodeto{#1}}%
-  {\@decodebetween{#1}}}
-\def\@decodeto#1,{%
+  {\beamer@decodeto{#1}}%
+  {\beamer@decodebetween{#1}}}
+\def\beamer@decodeto#1,{%
   \ifnum#1<\beamer@minimum\global\beamer@minimum=#1\fi%
-  \ifnum#1>\serialnumber\global\@anotherslidetrue\@localanotherslidetrue\fi%
-  \ifnum#1>\serialnumber\else\gdef\dowhat{\doit}\fi%
-  \@decode}
-\def\@decodebetween#1#2,{%
+  \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>\serialnumber\global\@anotherslidetrue\@localanotherslidetrue\fi%
-  \ifnum#2>\serialnumber\global\@anotherslidetrue\@localanotherslidetrue\fi%
-  \ifnum#1>\serialnumber\else\ifnum#2<\serialnumber\else\gdef\dowhat{\doit}\fi\fi%
-  \@decode}
-\def\@decodeone#1,{%
+  \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>\serialnumber\global\@anotherslidetrue\@localanotherslidetrue\fi%
-  \ifnum#1=\serialnumber\gdef\dowhat{\doit}\fi%
-  \@decode}
-                                
+  \ifnum#1>\beamer@slideinframe\global\beamer@anotherslidetrue\beamer@localanotherslidetrue\fi%
+  \ifnum#1=\beamer@slideinframe\gdef\beamer@doifnotinframe{\beamer@doifinframe}\fi%
+  \beamer@@decode}
 
-\long\def\@gobbleoptional{\@ifnextchar[{\@@gobbleoptional}{\@@gobbleoptional[]}}
-\long\def\@@gobbleoptional[#1]#2{}
+\def\beamer@donow{\beamer@doifnotinframe}
 
-\long\def\@ignoreoptional{\@ifnextchar[{\@@ignoreoptional}{}}
-\long\def\@@ignoreoptional[#1]{}
+\def\beamer@saveanother{\let\beamer@savedif=\ifbeamer@anotherslide}
+\def\beamer@restoreanother{\global\let\ifbeamer@anotherslide=\beamer@savedif}
 
-\long\def\@insp#1{\ignorespaces#1\ignorespaces}
-\long\def\@gobbleis#1{\ignorespaces}
+\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}
 
 \long\def\makeinvisible#1{\beamer@startcovered#1\beamer@endcovered}
 \long\def\fakeinvisible#1{\beamer@spacingcover#1\beamer@spacingcover}
 % Overlay commands
 %
 
-\newoverlaycommand{\pgfonly}{\@insp}{\@gobbleis}
+\newoverlaycommand{\pgfonly}{\beamer@insp}{\beamer@gobbleis}
 \newoverlaycommand{\only}{}{\@gobble}
 \newoverlaycommand{\uncover}{\fakeinvisible}{\makeinvisible}
 \newoverlaycommand{\invisible}{\beamer@reallymakeinvisible}{\fakeinvisible}
 \renewoverlaycommand{\textsl}{\original{\textsl}}{}
 \renewoverlaycommand{\textsf}{\original{\textsf}}{}
 \renewoverlaycommand{\textrm}{\original{\textrm}}{}
-\renewoverlaycommand{\color}{\original{\color}}{\@gobbleoptional}
+\renewoverlaycommand{\color}{\original{\color}}{\beamer@gobbleoptional}
 \newoverlayenvironment{uncoverenv}{}{}{\beamer@startcovered}{\beamer@endcovered}
 \newoverlayenvironment{onlyenv}{}{}{\begingroup\setbox0=\hbox\bgroup}{\egroup\endgroup}
 \renewoverlaycommand{\hypertarget}{\original{\hypertarget}}{\@gobble}
 \newoverlaycommand{\emph}{\@emph}{}
 \def\@emph#1{{\itshape#1}}
 
-\newoverlaycommand{\nameslide}{\@nameslide}{\@gobble}
+\newoverlaycommand{\nameslide}{\beamer@nameslide}{\@gobble}
 
 
 
 % Names slides
 %
 
-\def\@nameslide#1{%
+\def\beamer@nameslide#1{%
   \addtocontents{snm}{\protect\beamer@slide{#1}{\thepage}}%
   \hypertarget{#1}{}}
 \def\beamer@slide#1#2{\expandafter\def\csname beamer@hyperlink#1\endcsname{%
 %
 
 \newoverlaycommand{\alert}{\@alert}{}
-\def\@alert#1{\def\insertalert{#1}\@alerttemplate}
+\def\@alert#1{\def\insertalert{#1}\beamer@alerttemplate}
 
 \newoverlaycommand{\structure}{\@structure}{}
-\def\@structure#1{\def\insertstructure{#1}\@structuretemplate}
+\def\@structure#1{\def\insertstructure{#1}\beamer@structuretemplate}
 
 \long\def\usealerttemplate#1{%
-  \gdef\@alerttemplate{#1}}
+  \gdef\beamer@alerttemplate{#1}}
 \long\def\usestructuretemplate#1{%
-  \gdef\@structuretemplate{#1}}
+  \gdef\beamer@structuretemplate{#1}}
 
 \usealerttemplate{{\begin{colormixin}{15!alert}\insertalert\end{colormixin}}}
 \usestructuretemplate{{\color{structure}\insertstructure}}
   \beamer@animwd=#1\relax%
   \setbox\beamer@animcurrent=\box\beamer@animshowbox% makes animshowbox empty
   \setbox\beamer@animcurrent=\hbox{}%
-  \def\@endaction{}%
+  \def\beamer@endaction{}%
 }
 \def\endoverprint{%
-  \@endaction%
+  \beamer@endaction%
   \ifvoid\beamer@animshowbox\setbox\beamer@animshowbox=\hbox{}\fi%
   \ht\beamer@animshowbox=\beamer@animht%
   \dp\beamer@animshowbox=\beamer@animdp%
 }
 
 \def\onslide<#1>{%
-  \@endaction%
+  \beamer@endaction%
   \alt<#1>{%
     \ifvoid\beamer@animshowbox\else\ClassError{beamer}{Overprints may not overlap}{}\fi%
-    \def\@endaction{%
+    \def\beamer@endaction{%
     \end{minipage}%
     \egroup%
       \ifdim\beamer@animht<\ht\beamer@animcurrent\beamer@animht=\ht\beamer@animcurrent\fi%
       \ifdim\beamer@animdp<\dp\beamer@animcurrent\beamer@animdp=\dp\beamer@animcurrent\fi%
       \setbox\beamer@animshowbox=\copy\beamer@animcurrent}
   }%
-  {\def\@endaction{%
+  {\def\beamer@endaction{%
     \end{minipage}%
     \egroup%
       \ifdim\beamer@animht<\ht\beamer@animcurrent\beamer@animht=\ht\beamer@animcurrent\fi%
 }
 
 
+
+
 %
 %
 % Setting the left and right margin
 %
 %
 \long\def\usebackgroundtemplate#1{%
-  \gdef\@backgroundtemplate{#1}}
+  \gdef\beamer@backgroundtemplate{#1}}
 
 \def\beamersetaveragebackground#1{%
   \colorlet{averagebackgroundcolor}{#1}}
 \let\@mkboth\@gobbletwo
 \def\ps@navigation{
   \def\@oddhead{%
-    \setbox\tempbox=\hbox{\@backgroundtemplate\hyper@pagetransition\hyper@pageduration}%
-    \tempheight=\ht\tempbox%
-    \setbox\tempbox=\hbox{\lower\tempheight\hbox{\box\tempbox}}\wd\tempbox=0pt\ht\tempbox=0pt\dp\tempbox=0pt%
-    \vbox{\hbox{\hskip-\Gm@lmargin\box\tempbox}%
+    \setbox\beamer@tempbox=\hbox{\beamer@backgroundtemplate\hyper@pagetransition\hyper@pageduration}%
+    \beamer@tempdim=\ht\beamer@tempbox%
+    \setbox\beamer@tempbox=\hbox{\lower\beamer@tempdim\hbox{\box\beamer@tempbox}}%
+    \wd\beamer@tempbox=0pt\ht\beamer@tempbox=0pt\dp\beamer@tempbox=0pt%
+    \vbox{\hbox{\hskip-\Gm@lmargin\box\beamer@tempbox}%
       \hbox{%
         {%
-          \setbox\tempbox=\hbox{\hskip-\Gm@lmargin%
-            {\setbox\tempbox=\hbox{\beamer@leftsidebarbackground}%
-              \wd\tempbox=0pt\ht\tempbox=0pt\dp\tempbox=0pt%
-              \box\tempbox}%
+          \setbox\beamer@tempbox=\hbox{\hskip-\Gm@lmargin%
+            {\setbox\beamer@tempbox=\hbox{\beamer@leftsidebarbackground}%
+              \wd\beamer@tempbox=0pt\ht\beamer@tempbox=0pt\dp\beamer@tempbox=0pt%
+              \box\beamer@tempbox}%
             \beamer@leftsidebartemplate}%
-          \tempheight=\ht\tempbox%
-          \setbox\tempbox=\hbox{{\lower\tempheight\hbox{\box\tempbox}}}%
-          \wd\tempbox=0pt\ht\tempbox=0pt\dp\tempbox=0pt%
-          \box\tempbox%
+          \beamer@tempdim=\ht\beamer@tempbox%
+          \setbox\beamer@tempbox=\hbox{{\lower\beamer@tempdim\hbox{\box\beamer@tempbox}}}%
+          \wd\beamer@tempbox=0pt\ht\beamer@tempbox=0pt\dp\beamer@tempbox=0pt%
+          \box\beamer@tempbox%
         }%        
         {% print right sidebar first, since it should be overwritten by headline
-          \setbox\tempbox=\hbox{\hskip\textwidth\hskip\beamer@rightmargin%
-            {\setbox\tempbox=\hbox{\beamer@rightsidebarbackground}%
-              \wd\tempbox=0pt\ht\tempbox=0pt\dp\tempbox=0pt%
-              \box\tempbox}%
+          \setbox\beamer@tempbox=\hbox{\hskip\textwidth\hskip\beamer@rightmargin%
+            {\setbox\beamer@tempbox=\hbox{\beamer@rightsidebarbackground}%
+              \wd\beamer@tempbox=0pt\ht\beamer@tempbox=0pt\dp\beamer@tempbox=0pt%
+              \box\beamer@tempbox}%
             \beamer@rightsidebartemplate}%
-          \tempheight=\ht\tempbox%
-          \setbox\tempbox=\hbox{{\lower\tempheight\hbox{\box\tempbox}}}%
-          \wd\tempbox=0pt\ht\tempbox=0pt\dp\tempbox=0pt%
-          \box\tempbox%
+          \beamer@tempdim=\ht\beamer@tempbox%
+          \setbox\beamer@tempbox=\hbox{{\lower\beamer@tempdim\hbox{\box\beamer@tempbox}}}%
+          \wd\beamer@tempbox=0pt\ht\beamer@tempbox=0pt\dp\beamer@tempbox=0pt%
+          \box\beamer@tempbox%
         }%
-        \@headtemplate\hfil%
+        \beamer@headtemplate\hfil%
       }%
       \hfil}}
-  \def\@oddfoot{\@foottemplate\hypertarget{Navigation\thepage}{}\hfil}
+  \def\@oddfoot{\beamer@foottemplate\hypertarget{Navigation\thepage}{}\hfil}
   \let\@evenhead\@oddhead
   \let\@evenfoot\@oddfoot}
 \pagestyle{navigation}
 %
 \def\ps@empty{%
   \let\@mkboth\@gobbletwo%
-  \def\@oddhead{\setbox\tempbox=\hbox{\@backgroundtemplate\hyper@pagetransition\hyper@pageduration}%
-    \tempheight=\ht\tempbox%
-    \setbox\tempbox=\hbox{\lower\tempheight\hbox{\box\tempbox}}\wd\tempbox=0pt\ht\tempbox=0pt\dp\tempbox=0pt%
-    \vbox{\hbox{\hskip-\Gm@lmargin\raise\headheight\box\tempbox}\hfil}}
+  \def\@oddhead{\setbox\beamer@tempbox=\hbox{\beamer@backgroundtemplate\hyper@pagetransition\hyper@pageduration}%
+    \beamer@tempdim=\ht\beamer@tempbox%
+    \setbox\beamer@tempbox=\hbox{\lower\beamer@tempdim\hbox{\box\beamer@tempbox}}%
+    \wd\beamer@tempbox=0pt\ht\beamer@tempbox=0pt\dp\beamer@tempbox=0pt%
+    \vbox{\hbox{\hskip-\Gm@lmargin\raise\headheight\box\beamer@tempbox}\hfil}}
   \def\@oddfoot{\hypertarget{Navigation\thepage}{}\hfil}
   \let\@evenhead\@oddhead\let\@evenfoot\@oddfoot}
 
 \def\recalculatefoot{%
   \beamer@activecjk%
-  \setbox\tempbox=\hbox{\@foottemplate}%
-  \footheight=\ht\tempbox%
-  \advance\footheight by \dp\tempbox%
+  \setbox\beamer@tempbox=\hbox{\beamer@foottemplate}%
+  \footheight=\ht\beamer@tempbox%
+  \advance\footheight by \dp\beamer@tempbox%
   \advance\footheight by 4pt%
   \geometry{foot=\the\footheight}%
   \advance\footheight by -4pt%
   \advance\sidebarheight by-\footheight}
 \def\recalculatehead{%
   \beamer@activecjk%
-  \setbox\tempbox=\hbox{\@headtemplate}%
-  \headheight=\ht\tempbox%
-  \headdp=\dp\tempbox%
+  \setbox\beamer@tempbox=\hbox{\beamer@headtemplate}%
+  \headheight=\ht\beamer@tempbox%
+  \headdp=\dp\beamer@tempbox%
   \advance\headheight by\headdp%
   \geometry{head=\the\headheight}%
   \sidebarheight=\paperheight%
   \advance\sidebarheight by-\footheight}%
 
 \long\def\usefoottemplate#1{%
-  \gdef\@foottemplate{\offinterlineskip\reset@font\def\\{,}#1}%
+  \gdef\beamer@foottemplate{\offinterlineskip\reset@font\def\\{,}#1}%
   \recalculatefoot}
 \def\insertpagenumber{\thepage}
 
 \long\def\useheadtemplate#1{%
-  \gdef\@headtemplate{\offinterlineskip\reset@font#1}%
+  \gdef\beamer@headtemplate{\offinterlineskip\reset@font#1}%
   \recalculatehead} 
 
 \def\insertvrule#1#2{%
 % Inserting navigation bars
 %
 
-\newcount\beamer@xpos
-\newcount\beamer@ypos
-
 \def\insertnavigation#1{%
   \vbox{\tiny%
     \beamer@xpos=0\relax%
     \beamer@ypos=1\relax%
-    \hbox to #1{\hskip.3cm\setbox\sectionbox=\hbox{\kern1sp}%
-      \ht\sectionbox=1.875ex%
-      \dp\sectionbox=0.75ex%
+    \hbox to #1{\hskip.3cm\setbox\beamer@sectionbox=\hbox{\kern1sp}%
+      \ht\beamer@sectionbox=1.875ex%
+      \dp\beamer@sectionbox=0.75ex%
         \hskip-1.875ex plus-1fill\dohead%
-      \box\sectionbox\hfil\hskip.3cm}%
+      \box\beamer@sectionbox\hfil\hskip.3cm}%
   }}
 
 \def\sectionentry#1#2#3#4#5{% section name, section title, page
   \ifnum#5=\c@part%
-  \box\sectionbox\hskip1.875ex plus 1fill%
+  \box\beamer@sectionbox\hskip1.875ex plus 1fill%
   \beamer@xpos=0\relax%
   \beamer@ypos=1\relax%
-  \setbox\sectionbox=
+  \setbox\beamer@sectionbox=
   \hbox{\def\insertsectionhead{#2}%
     \ifnum\thesection=#1%
-    \hyperlink{Navigation#3}{\@sectionheadhilight}\else%
-    \hyperlink{Navigation#3}{\@sectionheadnohilight}\fi}%
-  \ht\sectionbox=1.875ex%
-  \dp\sectionbox=0.75ex%
+    \hyperlink{Navigation#3}{\beamer@sectionheadhilight}\else%
+    \hyperlink{Navigation#3}{\beamer@sectionheadnohilight}\fi}%
+  \ht\beamer@sectionbox=1.875ex%
+  \dp\beamer@sectionbox=0.75ex%
   \fi\ignorespaces}
 
-\def\usesectionheadtemplate#1#2{\gdef\@sectionheadhilight{#1}\gdef\@sectionheadnohilight{#2}}
-\def\usesectionsidetemplate#1#2{\gdef\@sectionsidehilight{#1}\gdef\@sectionsidenohilight{#2}}
+\def\usesectionheadtemplate#1#2{\gdef\beamer@sectionheadhilight{#1}\gdef\beamer@sectionheadnohilight{#2}}
+\def\usesectionsidetemplate#1#2{\gdef\beamer@sectionsidehilight{#1}\gdef\beamer@sectionsidenohilight{#2}}
 
 
 \def\insertverticalnavigation#1{%
       \hbox{\hyperlink{Navigation##3}{%
           \ifnum\thesection=##1%
             \ifnum\thesubsection=0\relax%
-              \@sectionsidehilight%
+              \beamer@sectionsidehilight%
             \else%
-              \@sectionsidenohilight%
+              \beamer@sectionsidenohilight%
             \fi%
           \else
-            \@sectionsidenohilight%
+            \beamer@sectionsidenohilight%
           \fi}}%
       \currentsubsection=1\relax\fi}%
     \def\slideentry##1##2##3##4##5##6{%
       \hbox{\beamer@link(##4){%
           \ifnum\thesection=##1%
             \ifnum\thesubsection=##2%
-              \@subsectionsidehilight%
+              \beamer@subsectionsidehilight%
             \else%
-              \@subsectionsidenohilight%
+              \beamer@subsectionsidenohilight%
             \fi%
           \else%
-            \@subsectionsidenohilight%
+            \beamer@subsectionsidenohilight%
           \fi}}%
       \fi\fi}%
     \currentsubsection=1\relax%
   \beamer@ypos=#2\relax%
   \fi
   \hbox to 0pt{%
-    \postemp=-\vboxoffset%
-    \advance\postemp by-\beamer@boxsize%
-    \multiply\postemp by\beamer@ypos%
-    \advance\postemp by -.05cm%
-    \raise\postemp\hbox{%
-      \postemp=\beamer@boxsize%
-      \multiply\postemp by\beamer@xpos%
-      \advance\postemp by -\beamer@boxsize%
-      \advance\postemp by 1pt%
-      \kern\postemp\hbox{\beamer@link(#4){%
+    \beamer@tempdim=-\beamer@vboxoffset%
+    \advance\beamer@tempdim by-\beamer@boxsize%
+    \multiply\beamer@tempdim by\beamer@ypos%
+    \advance\beamer@tempdim by -.05cm%
+    \raise\beamer@tempdim\hbox{%
+      \beamer@tempdim=\beamer@boxsize%
+      \multiply\beamer@tempdim by\beamer@xpos%
+      \advance\beamer@tempdim by -\beamer@boxsize%
+      \advance\beamer@tempdim by 1pt%
+      \kern\beamer@tempdim\hbox{\beamer@link(#4){%
         \ifnum\thesection=#1\ifnum\thesubsection=#2\ifnum\thesubsectionslide=#3%
-        \@minislidehilight\else\@minisliderowhilight\fi\else\@minislide\fi\else\@minislide\fi%
+        \beamer@minislidehilight\else\beamer@minisliderowhilight\fi\else\beamer@minislide\fi\else\beamer@minislide\fi%
         }}}\hskip-10cm plus 1fil
   }\fi\fi%
   \else%
   \beamer@xpos=#3\relax%
   \beamer@ypos=#2\relax%
   \fi%
-  \hbox to 0pt{\postemp=-\vboxoffset%
-    \advance\postemp by -\beamer@boxsize%
-    \multiply\postemp by\beamer@ypos%
-    \advance\postemp by -.05cm%
-    \raise\postemp\hbox{}}\fi\fi\ignorespaces}
+  \hbox to 0pt{\beamer@tempdim=-\beamer@vboxoffset%
+    \advance\beamer@tempdim by -\beamer@boxsize%
+    \multiply\beamer@tempdim by\beamer@ypos%
+    \advance\beamer@tempdim by -.05cm%
+    \raise\beamer@tempdim\hbox{}}\fi\fi\ignorespaces}
   
 
 \def\beamer@link(#1/#2){%
   \expandafter\hyperlink\beamer@goto}
 
 
-\def\useminislidetemplate#1#2#3#4#5{\gdef\@minislidehilight{#1}\gdef\@minisliderowhilight{#2}\gdef\@minislide{#3}
-\beamer@boxsize=#4\vboxoffset=#5}
+\def\useminislidetemplate#1#2#3#4#5{%
+  \gdef\beamer@minislidehilight{#1}%
+  \gdef\beamer@minisliderowhilight{#2}%
+  \gdef\beamer@minislide{#3}%
+  \beamer@boxsize=#4%
+  \beamer@vboxoffset=#5}
 
 \def\insertsectionnavigation#1{%
   \hbox to #1{%
      \def\sectionentry##1##2##3##4##5{%
        \ifnum##5=\c@part%
        \def\insertsectionhead{##2}%
-       \setbox\tempbox=\hbox{%
+       \setbox\beamer@tempbox=\hbox{%
          \hyperlink{Navigation##3}{\hbox to #1{%
            \hskip0.3cm\ifnum\thesection=##1%
-           \@sectionheadhilight\else\@sectionheadnohilight\fi\hskip0.3cm}}}%
-       \ht\tempbox=1.6875ex\dp\tempbox=0.75ex%        
-       \box\tempbox\fi}%
+           \beamer@sectionheadhilight\else\beamer@sectionheadnohilight\fi\hskip0.3cm}}}%
+       \ht\beamer@tempbox=1.6875ex\dp\beamer@tempbox=0.75ex%        
+       \box\beamer@tempbox\fi}%
      \dohead\vskip0.5625ex}\hfil}}
 
 \def\insertsectionnavigationhorizontal#1#2#3{%
   \hbox to #1{%
      \def\slideentry##1##2##3##4##5##6{}%
-     #2\hskip.3cm\tiny\setbox\sectionbox=\hbox{}%
-     \ht\sectionbox=1.875ex%
-     \dp\sectionbox=0.75ex%
+     #2\hskip.3cm\tiny\setbox\beamer@sectionbox=\hbox{}%
+     \ht\beamer@sectionbox=1.875ex%
+     \dp\beamer@sectionbox=0.75ex%
      \hskip-1.875ex plus-1fill\dohead%
-     \box\sectionbox\hfil\hskip.3cm%
+     \box\beamer@sectionbox\hfil\hskip.3cm%
      #3}}
 
-\newcount\currentsubsection
 \def\insertsubsectionnavigation#1{%
   \hbox to #1{%
     \vbox{\tiny%
       \vskip0.5625ex%
-      \currentsubsection=1%
+      \beamer@currentsubsection=1%
       \def\sectionentry##1##2##3##4##5{}%
       \def\slideentry##1##2##3##4##5##6{\ifnum##6=\c@part\ifnum##1=\thesection%
-        \ifnum##2=\currentsubsection%
-        \advance\currentsubsection by1%
+        \ifnum##2=\beamer@currentsubsection%
+        \advance\beamer@currentsubsection by1%
         \def\insertsubsectionhead{##5}%
-        \setbox\tempbox=\hbox{\beamer@link(##4){%
+        \setbox\beamer@tempbox=\hbox{\beamer@link(##4){%
           \hbox to #1{\hskip0.3cm\ifnum\thesubsection=##2%
-          \@subsectionheadhilight\else\@subsectionheadnohilight\fi\hfil\hskip0.3cm}}}%
-        \ht\tempbox=1.6875ex\dp\tempbox=0.75ex%
-        \box\tempbox\fi\fi\fi}%
+          \beamer@subsectionheadhilight\else\beamer@subsectionheadnohilight\fi\hfil\hskip0.3cm}}}%
+        \ht\beamer@tempbox=1.6875ex\dp\beamer@tempbox=0.75ex%
+        \box\beamer@tempbox\fi\fi\fi}%
       \dohead\vskip0.5625ex}\hfil}}
 
 \def\insertsubsectionnavigationhorizontal#1#2#3{%
   \hbox to #1{\tiny%
-    \currentsubsection=1%
+    \beamer@currentsubsection=1%
     \def\sectionentry##1##2##3##4##5{}%
     \def\slideentry##1##2##3##4##5##6{\ifnum##6=\c@part\ifnum##1=\thesection%
-      \ifnum##2=\currentsubsection%
-      \advance\currentsubsection by1%
-      \box\sectionbox\hskip1.875ex plus1fill%
-      \setbox\sectionbox=
+      \ifnum##2=\beamer@currentsubsection%
+      \advance\beamer@currentsubsection by1%
+      \box\beamer@sectionbox\hskip1.875ex plus1fill%
+      \setbox\beamer@sectionbox=
       \hbox{\def\insertsubsectionhead{##5}%
         \ifnum\thesubsection=##2%
-        \beamer@link(##4){\@subsectionheadhilight}\else%
-        \beamer@link(##4){\@subsectionheadnohilight}\fi}%
-      \ht\sectionbox=1.875ex%
-      \dp\sectionbox=0.75ex%
+        \beamer@link(##4){\beamer@subsectionheadhilight}\else%
+        \beamer@link(##4){\beamer@subsectionheadnohilight}\fi}%
+      \ht\beamer@sectionbox=1.875ex%
+      \dp\beamer@sectionbox=0.75ex%
       \fi\fi\fi\ignorespaces}%
-    #2\hskip.3cm\tiny\setbox\sectionbox=\hbox{}%
+    #2\hskip.3cm\tiny\setbox\beamer@sectionbox=\hbox{}%
     \hskip-1.875ex plus-1fill\dohead%
-    \box\sectionbox\hfil\hskip.3cm%
+    \box\beamer@sectionbox\hfil\hskip.3cm%
     #3}}
 
-\def\usesubsectionheadtemplate#1#2{\gdef\@subsectionheadhilight{#1}\gdef\@subsectionheadnohilight{#2}}
-\def\usesubsectionsidetemplate#1#2{\gdef\@subsectionsidehilight{#1}\gdef\@subsectionsidenohilight{#2}}
+\def\usesubsectionheadtemplate#1#2{\gdef\beamer@subsectionheadhilight{#1}\gdef\beamer@subsectionheadnohilight{#2}}
+\def\usesubsectionsidetemplate#1#2{\gdef\beamer@subsectionsidehilight{#1}\gdef\beamer@subsectionsidenohilight{#2}}
 
 
 
 %
 
 \long\def\useblocktemplate#1#2{%
-  \gdef\@beginblocktemplate{#1}
-  \gdef\@endblocktemplate{#2}}
+  \gdef\beamer@beginblocktemplate{#1}
+  \gdef\beamer@endblocktemplate{#2}}
 
 \long\def\usealertblocktemplate#1#2{%
-  \gdef\@beginalertblocktemplate{#1}
-  \gdef\@endalertblocktemplate{#2}}
+  \gdef\beamer@beginalertblocktemplate{#1}
+  \gdef\beamer@endalertblocktemplate{#2}}
 
 \long\def\useexampleblocktemplate#1#2{%
-  \gdef\@beginexampleblocktemplate{#1}
-  \gdef\@endexampleblocktemplate{#2}}
+  \gdef\beamer@beginexampleblocktemplate{#1}
+  \gdef\beamer@endexampleblocktemplate{#2}}
 
 \newoverlayenvironment{block}[1]{%
   \def\insertblockname{#1}%
   \par%
-  \@beginblocktemplate}{\par\@endblocktemplate}%
+  \beamer@beginblocktemplate}{\par\beamer@endblocktemplate}%
   {\beamer@startcovered%
   \def\insertblockname{#1}%
   \par%
-  \@beginblocktemplate}{\par\@endblocktemplate\beamer@endcovered}
+  \beamer@beginblocktemplate}{\par\beamer@endblocktemplate\beamer@endcovered}
 
 \newoverlayenvironment{alertblock}[1]{%
   \def\insertblockname{#1}%
   \par%
-  \@beginalertblocktemplate}{\par\@endalertblocktemplate}%
+  \beamer@beginalertblocktemplate}{\par\beamer@endalertblocktemplate}%
   {\beamer@startcovered%
   \def\insertblockname{#1}%
   \par%
-  \@beginalertblocktemplate}{\par\@endalertblocktemplate\beamer@endcovered}
+  \beamer@beginalertblocktemplate}{\par\beamer@endalertblocktemplate\beamer@endcovered}
 
 \newoverlayenvironment{exampleblock}[1]{%
   \def\insertblockname{#1}%
   \par%
-  \@beginexampleblocktemplate}{\par\@endexampleblocktemplate}%
+  \beamer@beginexampleblocktemplate}{\par\beamer@endexampleblocktemplate}%
   {\beamer@startcovered%
   \def\insertblockname{#1}%
   \par%
-  \@beginexampleblocktemplate}{\par\@endexampleblocktemplate\beamer@endcovered}
+  \beamer@beginexampleblocktemplate}{\par\beamer@endexampleblocktemplate\beamer@endcovered}
 
 \newenvironment{Problem}{\begin{block}{Problem}}{\end{block}}
 \newenvironment{Loesung}{\begin{block}{L\"osung}}{\end{block}}
 
 
 
-%
-%
-% Table of Contents Format
-%
-%
-
-\newif\if@onlycurrent
-\newif\if@pausesections
-\newif\if@pausesubsections
-\newif\if@subsectionshide
-\newif\if@subsectionsshaded
-\newcount\beamer@showpartnumber
-
-\define@key{beamertoc}{current}[true]{\@onlycurrenttrue}
-\define@key{beamertoc}{pausesections}[true]{\@pausesectionstrue}
-\define@key{beamertoc}{pausesubsections}[true]{\@pausesubsectionstrue}
-\define@key{beamertoc}{hidesubsections}[true]{\@subsectionshidetrue}
-\define@key{beamertoc}{shadesubsections}[true]{\@subsectionsshadedtrue}
-\define@key{beamertoc}{part}{\beamer@showpartnumber=#1\relax}
-
-\def\tableofcontents{\@ifnextchar[{\@tableofcontents}{\@tableofcontents[]}}
-\def\@tableofcontents[#1]{%
-  \beamer@showpartnumber=\c@part%
-  \@onlycurrentfalse%
-  \@pausesectionsfalse%
-  \@pausesubsectionsfalse%
-  \@subsectionshidefalse%
-  \@subsectionsshadedfalse%
-  \setkeys{beamertoc}{#1}%
-  \vspace*{-.5em}{\makeatletter%
-    \begin{pauses}[0]%
-      \@input{\jobname.toc}%
-    \end{pauses}\vfill}%
-  \normalcolor
-  }
-
-\def\tableofcontentscurrent{\tableofcontents[current]}
-
-\def\sectionintoc#1#2#3#4{%
-  \ifnum#4=\beamer@showpartnumber%
-  \if@pausesections\pause\fi%
-    \def\inserttocsection{\hyperlink{Navigation#3}{#2}}%
-    \if@subsectionshide
-    \vskip1.5em
-    \else
-    \vfill
-    \fi
-    \if@onlycurrent%
-      \ifnum\thesection=#1%
-        \hbox{\vbox{\sectiontemplate}}%
-      \else%
-        \hbox{\vbox{\sectiontemplateshaded}}%
-      \fi%
-    \else%
-      \hbox{\vbox{\sectiontemplate}}%
-    \fi
-    \par\fi}
-
-\def\usetemplatetocsection{\@ifnextchar[\@@usetemplatetocsection\@usetemplatetocsection}
-\long\def\@@usetemplatetocsection[#1]#2{
-  \@usetemplatetocsection{#2}{\begin{colormixin}{#1}#2\end{colormixin}}}
-\long\def\@usetemplatetocsection#1#2{
-  \gdef\sectiontemplate{\def\@breakhere{\\}#1}
-  \gdef\sectiontemplateshaded{\def\@breakhere{\\}#2}}
-
-\long\def\subsectionintoc#1#2#3#4#5{%
-  \ifnum#5=\beamer@showpartnumber%
-  \if@pausesubsections\pause\fi%
-    \def\inserttocsubsection{\hyperlink{Navigation#4}{#3}}%
-    \if@subsectionshide
-      \ifnum\thesection=#1
-        {\@subsectiontemplate}
-      \fi
-    \else
-      \if@onlycurrent
-        \ifnum\thesection=#1
-          {\@subsectiontemplate}
-        \else
-          {\@subsectiontemplateshaded}
-        \fi
-      \else
-        \if@subsectionsshaded
-          {\@subsectiontemplateshaded}
-        \else
-          {\@subsectiontemplate}
-        \fi
-      \fi
-    \fi%
-  \fi%  
-}
-
-\def\usetemplatetocsubsection{\@ifnextchar[\@@usetemplatetocsubsection\@usetemplatetocsubsection}
-\long\def\@@usetemplatetocsubsection[#1]#2{
-  \@usetemplatetocsubsection{#2}{\begin{colormixin}{#1}#2\end{colormixin}}}
-\long\def\@usetemplatetocsubsection#1#2{
-  \gdef\@subsectiontemplate{\def\@breakhere{\\}#1}
-  \gdef\@subsectiontemplateshaded{\def\@breakhere{\\}#2}}
 
   
-\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
-\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
-\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
-\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
-\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
-\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
-\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
-\DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}
-\DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}
-
 \newcommand\contentsname{Contents}
 \newcommand\listfigurename{List of Figures}
 \newcommand\listtablename{List of Tables}
 \setlength\columnseprule{0\p@}
 \pagenumbering{arabic}
 \onecolumn
-\clubpenalty=2000
-\widowpenalty=900
-\originalbaselineskip=\baselineskip
 
 \def\enumerate{%
   \ifnum\@enumdepth>1\relax\@toodeep\else
   \gdef\itemiiendtemplate{#2}}
 
 
-\def\description{\@ifnextchar[{\@description}{\@descdefault\@descdefaulttemp\@@description}}
-\def\@description[#1]{\setbox\tempbox=\hbox{\def\insertdescriptionitem{#1}\descriptionitemtemplate}%
-  \@descdefault\wd\tempbox\advance\@descdefault by \labelsep\@@description}
-\def\@@description{\list{}{\labelwidth\@descdefault\leftmargin\@descdefault\let\makelabel\@descriptionitem}%
+\def\description{\@ifnextchar[{\@description}{\beamer@descdefault\beamer@descdefaulttemp\@@description}}
+\def\@description[#1]{\setbox\beamer@tempbox=\hbox{\def\insertdescriptionitem{#1}\descriptionitemtemplate}%
+  \beamer@descdefault\wd\beamer@tempbox\advance\beamer@descdefault by \labelsep\@@description}
+\def\@@description{\list{}{\labelwidth\beamer@descdefault\leftmargin\beamer@descdefault\let\makelabel\beamer@descriptionitem}%
   \begin{pauses}\raggedright}
 \def\enddescription{\end{pauses}\endlist}
-\long\def\@descriptionitem#1{\def\insertdescriptionitem{#1}%
+\long\def\beamer@descriptionitem#1{\def\insertdescriptionitem{#1}%
   \hfil\hspace\labelsep\normalfont\descriptionitemtemplate}
 
-\def\usedescriptionitemtemplate#1#2{\gdef\descriptionitemtemplate{#1}\global\@descdefaulttemp=#2%
-  \global\advance\@descdefaulttemp by \labelsep}
+\def\usedescriptionitemtemplate#1#2{\gdef\descriptionitemtemplate{#1}\global\beamer@descdefaulttemp=#2%
+  \global\advance\beamer@descdefaulttemp by \labelsep}
 \usedescriptionitemtemplate{\color{structure}\insertdescriptionitem}{2cm}
 
 
     {\noexpand\headcommand{\noexpand\def\noexpand\inserttotalframenumber{\the\c@framenumber}}}}
     \if@filesw
       \newwrite\tf@head
-      \immediate\openout\tf@head\jobname.head\relax
+      \immediate\openout\tf@head\jobname.nav\relax
       \newwrite\tf@toc
       \immediate\openout\tf@toc\jobname.toc\relax
       \newwrite\tf@snm
 \raggedright
 
 \def\tinyline#1{%
-  {\tiny\setbox\linebox=\hbox to\textwidth{\hskip-\Gm@lmargin\hskip0.3cm{#1}\hskip-\Gm@rmargin\hskip0.3cm}%
-  \ht\linebox=2.06ex%
-  \dp\linebox=0pt%
-  \box\linebox%
+  {\tiny\setbox\beamer@linebox=\hbox to\textwidth{\hskip-\Gm@lmargin\hskip0.3cm{#1}\hskip-\Gm@rmargin\hskip0.3cm}%
+  \ht\beamer@linebox=2.06ex%
+  \dp\beamer@linebox=0pt%
+  \box\beamer@linebox%
   \vskip1.125ex}}
 \def\tinycolouredline#1#2{%
   \hbox{\tiny%
-    \setbox\linebox=\hbox to\textwidth{\hskip-\Gm@lmargin\hskip0.3cm{#2}\hskip-\Gm@rmargin\hskip0.3cm}%
-    \ht\linebox=2.625ex%
-    \dp\linebox=0pt%
-    \setbox\linebox=\vbox{\box\linebox\vskip1.125ex}%
+    \setbox\beamer@linebox=\hbox to\textwidth{\hskip-\Gm@lmargin\hskip0.3cm{#2}\hskip-\Gm@rmargin\hskip0.3cm}%
+    \ht\beamer@linebox=2.625ex%
+    \dp\beamer@linebox=0pt%
+    \setbox\beamer@linebox=\vbox{\box\beamer@linebox\vskip1.125ex}%
     {\color{#1}\hskip-\Gm@lmargin\vrule width\paperwidth
-      height\ht\linebox\hskip-\paperwidth\hskip\Gm@lmargin}%
-    \box\linebox}%
+      height\ht\beamer@linebox\hskip-\paperwidth\hskip\Gm@lmargin}%
+    \box\beamer@linebox}%
   }
 \def\colouredline#1#2{%
   \hbox{%
-    \setbox\linebox=\hbox to\textwidth{\hskip-\Gm@lmargin\hskip0.3cm{#2}\hskip-\Gm@rmargin\hskip0.3cm}%
-    \setbox\linebox=\vbox{\vskip2pt\box\linebox\vskip2pt}%
+    \setbox\beamer@linebox=\hbox to\textwidth{\hskip-\Gm@lmargin\hskip0.3cm{#2}\hskip-\Gm@rmargin\hskip0.3cm}%
+    \setbox\beamer@linebox=\vbox{\vskip2pt\box\beamer@linebox\vskip2pt}%
     {\color{#1}\hskip-\Gm@lmargin\vrule width\paperwidth
-      height\ht\linebox\hskip-\paperwidth\hskip\Gm@lmargin}%
-    \box\linebox}%
+      height\ht\beamer@linebox\hskip-\paperwidth\hskip\Gm@lmargin}%
+    \box\beamer@linebox}%
   }
 \def\beamerline#1{%
   \hbox{\hskip-\Gm@lmargin#1\hskip-\Gm@rmargin}}
 %
 % Bibliography code
 %
-
-\setlength\bibindent{1.5em}
 \newenvironment{thebibliography}[1]
 {%\leavevmode\unskip%
   \list{\@biblabel{\@arabic\c@enumiv}}%
-           {\settowidth\labelwidth{\@biblabeltemplate{\@biblabel{#1}}}%
+           {\settowidth\labelwidth{\beamer@biblabeltemplate{\@biblabel{#1}}}%
             \leftmargin\labelwidth
             \advance\leftmargin\labelsep
             \itemsep=0pt%
             \usecounter{enumiv}%
             \let\p@enumiv\@empty
             \renewcommand\theenumiv{\@arabic\c@enumiv}
-            \let\makelabel\@biblabeltemplate}%
+            \let\makelabel\beamer@biblabeltemplate}%
       \begin{pauses}%
       \sloppy\raggedright
       \clubpenalty10000
        {\@latex@warning{Empty `thebibliography' environment}}%
       \end{pauses}\endlist}
 
-\long\def\@biblabeltemplate#1{\def\insertbiblabel{#1}\biblabeltemplate\hfil}
+\long\def\beamer@biblabeltemplate#1{\def\insertbiblabel{#1}\biblabeltemplate\hfil}
 
 \def\bibitem{\@ifnextchar<{\beamer@bibitem@store}{\gdef\beamer@bibstore{}\beamer@plainbibitem}}
 \def\beamer@bibitem@store<#1>{\gdef\beamer@bibstore{<#1>}\beamer@plainbibitem}