\ProvidesPackage{beamerbasenotes}[2004/02/05 ver 1.30]
\NeedsTeXFormat{LaTeX2e}[1995/12/01]

% Copyright 2003 by Till Tantau <tantau@users.sourceforge.net>.
%
% This program can be redistributed and/or modified under the terms
% of the GNU Public License, version 2.



\mode<presentation>

\newbox\beamer@frameboxcopy

%
% Notes
%

\define@key{beamernotes}{enumerate}[true]{%
  \def\beamer@noteenvstart{\begin{enumerate}\itemsep=0pt\parskip=0pt}%
  \def\beamer@noteenvend{\end{enumerate}}}
\define@key{beamernotes}{itemize}[true]{%
  \def\beamer@noteenvstart{\begin{itemize}\itemsep=0pt\parskip=0pt}%
  \def\beamer@noteenvend{\end{itemize}}}

\newcommand\beamer@outsideframenote[2][]{%
  \beamer@savemode%
  \def\beamer@noteenvstart{}%
  \def\beamer@noteenvend{}%
  \setkeys{beamernotes}{#1}%
  \ifbeamer@notes
  \begingroup
    \useitemizeitemtemplate{\textbullet}
    \usesubitemizeitemtemplate{--}    
    \useenumerateitemtemplate{\insertenumlabel.}
    \usesubenumerateitemtemplate{\insertenumlabel.\insertsubenumlabel}
    \def\@oddhead{}
    \def\@oddfoot{}
    \let\@evenhead\@oddhead
    \let\@evenfoot\@oddfoot
    \def\beamer@backgroundtemplate{}%
    \nointerlineskip
    \hbox{\hskip-\Gm@lmargin\hskip1cm\vbox to\textheight{%
        %pretend to have in a ``standard'' margins
        \def\Gm@lmargin{1cm}\def\Gm@rmargin{1cm}%
      \textwidth=10.8cm\hsize=\textwidth%
      \vskip-\headheight%
      \def\insertnote{\vbox{}%
        \beamer@noteenvstart#2\beamer@noteenvend%
      }%
      \beamer@notetemplate%
      \vfil%
      \vskip-4pt% foot separator
      \vskip-\footheight}\hskip-\Gm@lmargin\hskip1cm}%
    \clearpage
  \endgroup
  \fi%
  \beamer@resumemode}

%
% Notes in frames
%

\def\beamer@itemtext{item}

\newcommand<>{\beamer@inframenote}[2][]{%
  \only#3{%
    \def\beamer@temp{#1}%
    \ifx\beamer@temp\beamer@itemtext%
      \expandafter\gdef\expandafter\beamer@noteitems%
      \expandafter{\beamer@noteitems\item#2}%
    \else
      \expandafter\gdef\expandafter\beamer@notes%
        \expandafter{\beamer@notes#2}%
    \fi%
  }}    

\def\note{%
  \ifbeamer@inframe%
    \let\next=\beamer@inframenote%
  \else%
    \let\next=\beamer@outsideframenote%
  \fi%
  \next}

\def\beamer@framenotesbegin{% at beginning of slide
  \gdef\beamer@noteitems{}%
  \gdef\beamer@notes{}%
}

\def\beamer@framenotesend
{% at end of slide
  \global\setbox\beamer@frameboxcopy=\copy\beamer@framebox%
  \ifx\beamer@noteitems\@empty%
    \ifx\beamer@notes\@empty% 
      % possibly suppress this slide
      \ifbeamer@frameswithnotesonly
        % suppress frame
        \global\setbox\beamer@framebox=\box\voidb@x%
      \fi%
    \else%
      \beamer@setupnote%
    \fi
  \else%
    \beamer@setupnote%
  \fi
  \ifbeamer@notesnormals%
  \else%
    \global\setbox\beamer@framebox=\box\voidb@x%
  \fi%
}

\def\beamer@setupnote{%
  \gdef\beamer@notesactions{%
    \beamer@outsideframenote{%
      \beamer@notes%
      \ifx\beamer@noteitems\@empty\else
      \begin{enumerate}\itemsep=0pt\parskip=0pt%
        \beamer@noteitems%
      \end{enumerate}%
      \fi
    }%
    \gdef\beamer@notesactions{}%
  }
}

  

\def\beamer@notesactions{}  




%
% Note frame insert
%

\newcommand{\insertslideintonotes}[1]{%
  \begin{pgfpicture}{0cm}{0cm}{#1\paperwidth}{#1\paperheight}
    \begin{pgfmagnify}{#1}{#1}
      \color[gray]{0.8}
      \pgfrect[fill]{\pgforigin}{\pgfpoint{\paperwidth}{\paperheight}}
      \normalcolor
      \pgfputat{\pgfpoint{\Gm@lmargin}{\footheight}}{\pgfbox[left,bottom]{\copy\beamer@frameboxcopy}}
    \end{pgfmagnify}
  \end{pgfpicture}%
  }



%
% Note templates
%

\newcommand{\usetemplatenote}[1]{\def\beamer@notetemplate{#1}}

% Default:
\usetemplatenote{\scriptsize
  \insertvrule{.25\paperheight}{white!90!black}
  \vskip-.25\paperheight
  \nointerlineskip
  \vbox{
    \hfill\insertslideintonotes{0.25}\hskip-\Gm@rmargin\hskip0pt%
    \vskip-0.25\paperheight%
    \nointerlineskip
  \begin{pgfpicture}{0cm}{0cm}{0cm}{0cm}
    \begin{pgfrotateby}{\pgfdegree{90}}
      \pgfputat{\pgfpoint{-2cm}{0.2cm}}%
      {\pgfbox[base,left]{\footnotesize\the\year-\ifnum\month<10\relax0\fi\the\month-\ifnum\day<10\relax0\fi\the\day}}
    \end{pgfrotateby}
  \end{pgfpicture}}
  \nointerlineskip
  \vbox to .25\paperheight{\vskip0.5em
  \hbox{\insertshorttitle[width=8cm]}%
  \setbox\beamer@tempbox=\hbox{\insertsection}%
  \hbox{\ifdim\wd\beamer@tempbox>1pt{\hskip4pt\raise3pt\hbox{\vrule
        width0.4pt height7pt\vrule width 9pt
        height0.4pt}}\hskip1pt\hbox{\begin{minipage}[t]{7.5cm}\def\breakhere{}\insertsection\end{minipage}}\fi%
  }%
  \setbox\beamer@tempbox=\hbox{\insertsubsection}%
  \hbox{\ifdim\wd\beamer@tempbox>1pt{\hskip17.4pt\raise3pt\hbox{\vrule
        width0.4pt height7pt\vrule width 9pt
        height0.4pt}}\hskip1pt\hbox{\begin{minipage}[t]{7.5cm}\def\breakhere{}\insertsubsection\end{minipage}}\fi%
  }%
  \setbox\beamer@tempbox=\hbox{\insertshortframetitle}%
  \hbox{\ifdim\wd\beamer@tempbox>1pt{\hskip30.8pt\raise3pt\hbox{\vrule
        width0.4pt height7pt\vrule width 9pt
        height0.4pt}}\hskip1pt\hbox{\insertshortframetitle[width=7cm]}\fi%
  }%
  \vfil}%
  \small
  \vskip.25em
  \nointerlineskip
  \insertnote
}


\mode
<article>
{
  \newcommand<>\note[2][]{}
}



\mode
<all>


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