%% If not elatex pst option must be passed to the xcolor package
\expandafter \ifx \csname ifdefined\endcsname \relax  
  \message {xcolor=pst}
  \PassOptionsToPackage{pst}{xcolor}
\fi

%% Pass hyperref to document class if whizzytex does not do it
%% automatically? 

\PassOptionsToPackage{hypertex}{hyperref}

\documentclass[compress]{beamer}

%% Beamer settings 
\beamertemplatenavigationsymbolsempty
\usetheme{Warsaw}

\usepackage[usenglish,francais]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}

%% PGF packages (for this file)

\usepackage{pgf,pgfarrows,pgfnodes,pgfautomata,pgfheaps,pgfshade}

%% PStricks packages (for this file)

\usepackage{pst-node}
\usepackage{pst-tree}


\title{Beamer Presentations with Whizzytex}
\author{Didier R{\'{e}}my\inst{1}}
\institute{\inst{1}INRIA-Rocquencourt}

\date{September, 2007}
\subject{ML}

\def \WhizzyTeX {{Whizzy\kern -0.3ex\raise 0.2ex\hbox{\let \@\relax\TeX}}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\frame{\titlepage}
\begin{frame}{Outline}
\tableofcontents
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section[Intro]{Introduction}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{Beamer}
\begin{itemize}
\item Beamer is a powerful latex class for presentations.
\item Beamer is aimed at generating PDF output, even though it can also
  generate Postscript output.
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{Whizzytex}
\begin{itemize}
\item<1-> {\WhizzyTeX} is a useful tool for preparing latex documents
\\   and especially... for preparing presentations.

\item<2->
{\WhizzyTeX} is works with different previewers: ghostview, xpdf, xdvi, 
and, gets even more expressive when used wiht Advi.

\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{Combining the two}
\relax
{\WhizzyTeX} works with the beamer class either 
with xpdf, or  with advi. 


However, previewing with advi requires some minor configuration. 
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Xpdf}
\begin{frame}{Using \WhizzyTeX with Xpdf}
This pauses no major problem.
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Advi}
\begin{frame}{Using \WhizzyTeX with Advi}
Previewing with advi requires some minor configuration. 
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile=singleslide]{Configuration}
\begin{itemize}
\item This requires at least version 1.7.1 of advi.
\item This requires at least version 1.3.1 of whizzytex. 
\end{itemize}
Documentclass should be called with option hypertex:
\begin{verbatim}
        \documentclass[hypertex]{beamer}
\end{verbatim}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Testing}
\begin{frame}[fragile=singleslide]{Using PStricks with advi}

You may need the following option (depending on your version of PStricks). 
\begin{verbatim}
        \documentclass[xcolor=pst]{beamer}
\end{verbatim}

You should also check that 
\texttt{advi} has correctly been installed the
\texttt{pgfsys-dvips.def} in a path that has priority other the original 
file. 

(If need be, adjust your path or rename the original file to
\texttt{pgfsys-dvips.def.orig})



\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile=singleslide]{By the way}
We recommend calling
\begin{verbatim}
        \beamertemplatenavigationsymbolsempty
\end{verbatim}
To get read of useless anchors.

See also 
\href{http://www.giref.ulaval.ca/~ctibirna/work/readings/beamer_pstricks.pdf}
{this document} 

\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{An example with Overlays}

This is overlay (\only<1>{
1
}\only<2>{
2
}\only<3>{
3
}\only<4>{
4
})

\begin{itemize}
\item<1-> This is shown on overlays 1 and greater (thus all)
\item<2> This is shown on overlay 2 only
\item<3-> This is shown on overlay 3 and greater
\item<4-> This is shown on overlay 4 and greater, thus  4 only.
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile=singleslide]{Fragile frame with single slide}

This works well
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
\frametitle{Fragile (with no argument)}
\begin{itemize}

\item <1->
This frame works well written as
 \begin{verbatim}
    \begin{frame}[fragile]
    \frametitle{Fragile (with no argument)}
    ...
\end{verbatim}
\item <2-> 
But it would brake if written as
 \begin{verbatim}
    \begin{frame}[fragile]{Fragile (with no argument)}
    ...
\end{verbatim}
This seems to be a problem with beamer, independant of whizzytex.
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{An example with PStricks}
\begin{block}{Using colors}
Named colors should work fine.
 \ovalnode*[fillcolor=orange]{A}{AAAA} \hfil
  \ovalnode*[fillcolor={red}]{B}{BBB}\ncarc{A}{B}
\end{block}

\begin{block}{Un arbre}
\pstree[treesep=2em,levelsep=2.5em]{\Toval A}
  {\pstree {\Toval B} {
     \Ttri*[fillcolor=blue] x
     \Ttri* y 
     \Ttri*[fillcolor=red] z}}
\end{block}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{An frame with some PGF}

\begin{pgfpicture}
\pgfseteorule
\pgfsetfillcolor{red}
\pgfpathcircle{\pgfpoint{0mm}{0mm}}{1cm}
\pgfusepath{fill}
\pgfsetcolor{green}
\pgfpathcircle{\pgfpoint{5mm}{0mm}}{1cm}
\pgfusepath{fill}
\end{pgfpicture}

\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Testing subsection}
\subsection{aaa}

\begin{frame}{Aaa}
aaa
\end{frame}

\subsection{bb}
\begin{frame}{}
aaa
\end{frame}
\Meaning \Parent

\end{document}
