% Werner's slides class. Based on:
%
% ICA class for LaTeX slides 
%
% filename: icaslides.cls
%
% source: http://lrcwww.epfl.ch/~gauthier/latex
%
% notice: the filename MUST be changed if the content of this file is modified
%
% Option defined ... 
%
% Macros defined ...    
%
% ...before begin{document} :
%
% \leftfoot{<text>},\centerfoot{<text>},\rightfoot{<text>} => modify defaults
%
% ...after begin{document} :
%
% \titleslide =>  makes a title (author,date) slide followed by an empty note.
% \head{<text>} => slide header text.
% \unbreak{<text>} => resize text to fill the whole header line.
%
% \blBOX ... \elBOX => makes a JYL type list.
% \blNUM ... \elNUM => makes an enumerated list.
% \blCIR ... \elCIR => makes a circle list.
% \blBUL ... \elBUL => makes a bullet list.
%
% \blBox ... \elBox => makes a tighter JYL type list.
% \blbox ... \elbox => makes an even tighter JYL type list.
% similarly for the other list types.
%
% Handout printing suggestion : 
% 
% - follows each slide by an odd number of notes.
% - for 2 slides per page : 
%   latex <filename>.tex ; 
%   dvips -t landscape -f <filename>.dvi | psnup -2 -r | lpr
% - for 4 slides per page : ...| psnup -4 -r -c | lpr
%
% Known problems :
%
% - JYL list does not print well if the monochrome option is specified.
% - \and can not be user in \author{}
% - lrclp1 has problem printing color documents.
% - graphpap package not always available
% 
% Eric Gauthier -- last modified December 1, 1997
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%-------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{waslides}[1997/01/12]
%-------------------------------------------------------------------------
\RequirePackage{epic,eepic,graphicx,color}
%-------------------------------------------------------------------------
\definecolor{epflcolor}{rgb}{1,0,0}
\definecolor{icacolor}{rgb}{0,0,1}
%\definecolor{icacolor}{cmyk}{1,0,0,0}
\newlength{\@epflh}
%-------------------------------------------------------------------------
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{slides}}
%-------------------------------------------------------------------------
\ProcessOptions
%-------------------------------------------------------------------------
\LoadClass[a4paper,landscape]{slides}
%-------------------------------------------------------------------------
\newcommand{\@halfarc}{%
\begin{picture}(50.9,0)(0,0)
\put(0,0){\arc{101.8}{0}{.5}}
\end{picture}}
\newcommand{\@smallarc}{%
\begin{picture}(17.125,0)(0,0)
\put(0,0){\arc{34.25}{0}{.8}}
\end{picture}}
%-------------------------------------------------------------------------
\newcommand{\epfllogo}{%
\setlength{\unitlength}{1pt}%
\begin{picture}(154,44)(0,0)
\allinethickness{44pt}%
\color{epflcolor}%
\path(0,22)(50,22)
\path(104,22)(154,22)
\color{white}%
\path(-22,0)(-22,44)
\path(176,0)(176,44)
\path(72,0)(72,44)
\path(82,0)(82,44)
\allinethickness{5pt}%
\color{black}%
\put(77.5,33){\rotatebox{180}{\reflectbox{\makebox(0,0)[tr]{\@smallarc}}}}
\put(77.5,33){\makebox(0,0)[tr]{\@smallarc}}
\path(55,22)(60,22)
\path(87,22)(92,22)
\color{white}%
\path(70,19.5)(78,19.5)
\path(62.5,19.5)(62.5,24.5)
\path(94.5,19.5)(94.5,24.5)
\color{black}%
\path(66.5,0)(66.5,44)
\path(84.5,0)(84.5,22)
\path(96.5,22)(96.5,44)
\put(52.5,22){\rotatebox{180}{\makebox(0,0)[tr]{\@halfarc}}}
\put(52.5,22){\reflectbox{\makebox(0,0)[tr]{\@halfarc}}}
\put(84.5,22){\rotatebox{180}{\makebox(0,0)[tr]{\@halfarc}}}
\put(96.5,22){\reflectbox{\makebox(0,0)[tr]{\@halfarc}}}
\color{white}%
\put(47.5,22){\rotatebox{180}{\makebox(0,0)[tr]{\@halfarc}}}
\put(47.5,22){\reflectbox{\makebox(0,0)[tr]{\@halfarc}}}
\put(101.5,22){\reflectbox{\makebox(0,0)[tr]{\@halfarc}}}
\allinethickness{6pt}%
\path(52,47)(99,47)
\path(52,-3,5)(104,-3.5)
\color{black}%
\settoheight{\@epflh}{\resizebox{154pt}{!}{F\'ED\'ERALE DE LAUSANNE}}%
\put(0,-16){\resizebox{154pt}{\@epflh}{\'ECOLE POLYTECHNIQUE}}
\put(0,-30){\resizebox{154pt}{!}{F\'ED\'ERALE DE LAUSANNE}}
\end{picture}}
\def\epfllogo{}
%------------------------------------------------------------------------------
\newcommand{\@smallsegment}{%
\begin{picture}(26,0)(0,0)
\path(0,0)(26,0)
\end{picture}}
%------------------------------------------------------------------------------
\newcommand{\icalogo}{%
\setlength{\unitlength}{1pt}%
\begin{picture}(154,74)(0,0)
\allinethickness{74pt}%
\color{icacolor}%
\path(0,37)(154,37)
\color{white}%
\path(-37,0)(-37,74)
\path(191,0)(191,74)
\allinethickness{8pt}%
\put(64,37){\arc{44}{.8}{-.8}}
\color{icacolor}
\put(64,37){\rotatebox{45}{\makebox(0,0)[l]{\@smallsegment}}}
\put(64,37){\rotatebox{-45}{\makebox(0,0)[l]{\@smallsegment}}}
\color{white}
\path(25,11)(25,63)
\path(87,11)(109,63)
\path(109,63)(131,11)
\path(98,27)(120,27)
\color{icacolor}
\path(21,7)(135,7)
\path(21,67)(135,67)
\end{picture}}
\def\icalogo{}
%-------------------------------------------------------------------------
\advance \topmargin by \headheight
\advance \topmargin by \headsep
\advance \topmargin by 2mm
\setlength{\headsep}{3mm}
\setlength{\headheight}{0mm}
\setlength{\textheight}{140mm}
\setlength{\textwidth}{250mm}
\advance \oddsidemargin by -2mm
\advance \footskip by 2mm
\newlength{\logoheight}
   \setlength{\logoheight}{18mm}


\newsavebox{\@leftbox}
\newif\if@newleftfoot \@newleftfootfalse
\newcommand{\leftfoot}[1]
  {\@newleftfoottrue\sbox{\@leftbox}{\footnotesize #1}}

\newsavebox{\@centerbox}
\newif\if@newcenterfoot \@newcenterfootfalse
\newcommand{\centerfoot}[1]
  {\@newcenterfoottrue\sbox{\@centerbox}{\footnotesize #1}}

\newsavebox{\@rightbox}
\newif\if@newrightfoot \@newrightfootfalse
\newcommand{\rightfoot}[1]
  {\@newrightfoottrue\sbox{\@rightbox}{\footnotesize #1}}

\newcommand\titleslide{
\titlepage %
{\centering {\color{icacolor}\bf\Huge \@title} %
\par \@author \par \mbox{\epfllogo} \par \@date \par} %
\if@titlepage \break \fi}

\newcommand{\blBOX}{\begin{genlist}{\usebox{\@JYLBbox}}{}}
\newcommand{\elBOX}{\end{genlist}}
\newcommand{\blBUL}{\begin{genlist}{$\bullet$}{}}
\newcommand{\elBUL}{\end{genlist}}
\newcommand{\blCIR}{\begin{genlist}{$\circ$}{}}
\newcommand{\elCIR}{\end{genlist}}
\newcommand{\blNUM}{\begin{enumerate}}
\newcommand{\elNUM}{\end{enumerate}}

\newcommand{\blBox}{\begin{genlist}{\usebox{\@JYLBbox}}{  
\setlength{\itemsep}{\stretch{0}}\setlength{\topsep}{\stretch{0}}}}
\newcommand{\elBox}{\end{genlist}}
\newcommand{\blBul}{\begin{genlist}{$\bullet$}{
  \setlength{\itemsep}{\stretch{0}}\setlength{\topsep}{\stretch{0}}}}
\newcommand{\elBul}{\end{genlist}}
\newcommand{\blCir}{\begin{genlist}{$\circ$}{
  \setlength{\itemsep}{\stretch{0}}\setlength{\topsep}{\stretch{0}}}}
\newcommand{\elCir}{\end{genlist}}
\newcounter{blNum}
\newcommand{\blNum}{\begin{genlist}{\arabic{blNum}.}{\usecounter{blNum}}
  \setlength{\itemsep}{\stretch{0}}\setlength{\topsep}{\stretch{0}}}
\newcommand{\elNum}{\end{genlist}}

\newcommand{\blbox}{\begin{genlist}{\usebox{\@JYLBbox}}{
  \setlength{\topsep}{\stretch{0}} \setlength{\parskip}{\stretch{0}}
  \setlength{\itemsep}{\stretch{0}}  \setlength{\parsep}{\stretch{0}}}}
\newcommand{\elbox}{\end{genlist}}
\newcommand{\blbul}{\begin{genlist}{$\bullet$}{
  \setlength{\topsep}{\stretch{0}} \setlength{\parskip}{\stretch{0}}
  \setlength{\itemsep}{\stretch{0}}  \setlength{\parsep}{\stretch{0}}}}
\newcommand{\elbul}{\end{genlist}}
\newcommand{\blcir}{\begin{genlist}{$\circ$}{
  \setlength{\topsep}{\stretch{0}} \setlength{\parskip}{\stretch{0}}
  \setlength{\itemsep}{\stretch{0}}  \setlength{\parsep}{\stretch{0}}}}
\newcommand{\elcir}{\end{genlist}}
\newcounter{blnum}
\newcommand{\blnum}{\begin{genlist}{\arabic{blnum}.}{\usecounter{blnum}}
  \setlength{\topsep}{\stretch{0}} \setlength{\parskip}{\stretch{0}}
  \setlength{\itemsep}{\stretch{0}}  \setlength{\parsep}{\stretch{0}}}
\newcommand{\elnum}{\end{genlist}}

\newsavebox{\@JYLBbox}
\sbox{\@JYLBbox}{
\makebox[1ex][r]{
\raisebox{.4ex}{
\setlength{\unitlength}{.3ex}
\begin{picture}(5,5)
\put(1,0){\colorbox{black}{$ $}}
\put(0,1){\fcolorbox{black}{white}{$ $}}
\end{picture}}}}

\newenvironment{genlist}[2]
{ \begin{list}{#1}{#2
  \settowidth{\labelwidth}{#1}
  \setlength{\leftmargin}{\labelwidth}
  \addtolength{\leftmargin}{+\labelsep}}}
{\end{list}}

\newsavebox{\headbox}
\newcommand{\head}[1]{
\sbox{\headbox}{\color{icacolor}\parbox[t]{230mm}{\bf\huge\centering #1}}}

\newcommand{\unbreak}[1]{\resizebox{220mm}{!}{#1}}

\def\ps@slide{%
    \def\@evenfoot{}%
    \def\@evenhead{}%

    \def\@oddfoot{\@mainsize 
    \if@newleftfoot\usebox{\@leftbox}\else\mbox{\@author}\fi\hfil
    \if@newcenterfoot\usebox{\@centerbox}\else\mbox{\@title}\fi\hfil
    \if@newrightfoot\usebox{\@rightbox}\else\hbox to3em{\theslide\hss}\fi}%

    \def\@oddhead{\mbox{}\hfil
    \raisebox{-148mm}[0pt][0pt]{\makebox[0pt][c]{
    \setlength{\unitlength}{1mm}
    \begin{picture}(270,170)(-10,-5)
%    \put(-10,163){\makebox(0,0)[tl]{\resizebox{111pt}{!}{\ \icalogo}}}
%    \put(260,163){\makebox(0,0)[tr]{\resizebox{111pt}{!}{\epfllogo\ }}}
    \put(-10,163){\makebox(0,0)[tl]{\resizebox{1pt}{!}{\ \icalogo}}}
    \put(260,163){\makebox(0,0)[tr]{\resizebox{1pt}{!}{\epfllogo\ }}}
    \color{icacolor}
    \put(10,145){\usebox{\headbox}}
    \put(-10,-5){\framebox(270,170){{}}}
    \color{black}
% Provided graphpap package available
%    \ifGin@draft{\color{red} \graphpaper(0,0)(250,140)}\fi
    \end{picture}
    }}\hfil\mbox{}
}}
