%%% Active-DVI
%%
%% This is the original source file advi-slides.sty
%%
%% Package `advi-slides' is to use with LaTeX 2e
%%
%% Copyright Pierre Weis 2003.
%% All rights reserved.

% % $Id: advi-slides.sty,v 1.10 2004/08/11 22:08:06 weis Exp $
%
% advi-slides.sty: a package to easily write slide-shows with Active-DVI.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Example of a slide-show using advi-slides.sty
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% We propose a simple organisation of the show into two files:
%
% - the main file show.tex that defines the overall aspect of the presentation
% - the auxilliary file slides.tex that define the contents of the slides.
%
% The main file ends by inputing the auxilliary file slides.tex.
% Compilation is just
% $ latex show
% Visualization is just
% $ advi show.dvi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%% File show.tex %%%%%%%%%
%% \documentclass[landscape]{slides}
%%
%% \usepackage{advi-slides}
%%
%% \begin{document}
%%
%% % Definition of header and footer of the presentation
%% % Institution logo
%% \def\thelogo{\includegraphics[width=3EM,height=1EM]{inria.ps}}
%%
%% \def\footer{{\thelogo\hfill \em {Pierre.Weis@inria.fr\hfill 22-05-2003}}}
%%
%% % The title to be written on each page
%% \def\header{Objective Caml}
%%
%% % The explicit new page to go on to the next slide
%% \def \newpage {\vfill\Newpage \advifooter{\footer}\adviheader{\header}}
%% \def\newslide#1{\newpage\advislidetitle{#1}}
%%
%% \input{slides}
%%
%% \end{document}
%%%%%%%%% End of show.tex %%%%%%%%%

%%%%%%%%%% File slides.tex %%%%%%%%%%%%%
%% The minimum slides.tex file could be
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% \newslide{Plan}
%%
%% \begin{itemize}
%% \item Past
%% \item Present
%% \item Future
%% \end{itemize}
%%
%% \newslide{Conclusion}
%%
%% Even if proofs are still to be written, this framework is
%% incredibly promising.
%%
%% Future work: we plan to implement the system.
%%
%% \lastpage
%%
%% That's all !
%%
%%%%%%% End of slides.tex %%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{advi-slides}
         [2003/02/05 v1.40 Active-DVI Slides Package for advi Previewer]

%% Packages to load
\usepackage[latin1]{inputenc}

\RequirePackage {keyval}
\RequirePackage {color}
\RequirePackage {graphicx}
\RequirePackage {advi-graphicx}
\RequirePackage {advi}
\RequirePackage {hyperref}
\RequirePackage {alltt}
\RequirePackage {xwindows-colors}
\RequirePackage {bubble}
\RequirePackage {advi-annot}
\RequirePackage {superpose}

%% Options: same as regular advi style

\DeclareOption {ignore}{\advi@ignoretrue}
\ProcessOptions

% To put a frame around an arbitrary amount of vertical material.
% \begin{frame} ... \end{frame}

\def\frame{%
\setbox0=\vbox\bgroup%
\advance\hsize by -2\fboxsep\advance\hsize by -2\fboxrule}

\def\endframe{%
\egroup\noindent\framebox[\columnwidth]{\box0}}

% An itemize environment with small vertical space between items.
% \begin{citemize} ... \end{citemize}
\newenvironment{citemize}{\begin{list}{$\bullet$}%
{\itemsep 0pt \topsep 5pt}}{\end{list}}

\newenvironment{cenumerate}%
{\begin{list}{-}{\itemsep 0pt \topsep 5pt}}{\end{list}}

% To write the title of the talk if any.
\def\advitalktitle#1{\centerline{{\Huge{\bf #1}}}}

% To write the title of a slide if any.
\def\advislidetitle#1{\centerline{{\Large{\bf #1}}}}

% To write the title of a slide (smaller version).
\def\stitle#1{\centerline{{\large{\bf #1}}}}

% Footer of the slides
\def\advifooter#1{\vfill{\vbox to 0em{\vbox to \vsize {\vfill%
{{\scriptsize{#1}} \hfill\thepage}}%
\vss}}}

% Headers of the slides
\def\adviheader{\vbox to 0em{\vbox to \vsize {\noindent
~\hfill\includegraphics[width=\textwidth,height=2em]{bar.eps}\hfill~%
\vfill
}
\vss
}}

% To preserve the original \newpage macro
\let\Newpage \newpage

% The explicit new page to change slide
\def\defnewpage{\def \newpage {\vfill\Newpage \advifooter{\footer}\adviheader}}

% The newslide macro that also add the title
\def\newslide#1{\defnewpage\newpage\advislidetitle{#1}}

\def\emptyfooter{\vbox to 0em{\vbox to \vsize {\vfill~~\vss}}}

\def\firstslide#1{\vfill\emptyfooter\adviheader\advislidetitle{#1}}

% The last page of the presentation: no footer.
\def\lastslide{\Newpage\emptyfooter}

% Defining a short name alias for advipause.
\def\pause{\advipause}

% Defining softlink and softarget
\edef\hyper@quote{\string"}
\edef\hyper@sharp{\string#}

\def \softlink #1#2{\special 
  {html:<a href=\hyper@quote\hyper@sharp#1\hyper@quote>}#2\special
  {html:</a>}}
\def \softtarget #1#2{{\special
  {html:<a name=\hyper@quote#1\hyper@quote>}{#2}\special
  {html:</a>}}}
