%%% -*-latex-*-
%%%
%%% Definitions for IPS course

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{ips}[2001/10/02]

%%%----- Document class stuff -----------------------------------------------

\newif\ifipsslides \ipsslidesfalse
\newif\ifipsanswers \ipsanswerstrue
\InputIfFileExists{ips.cfg}\relax\relax

\ifipsslides
  \PassOptionsToClass{a4, slidesonly}{mdwslides}
\else
  \PassOptionsToClass{a4, article, twoside}{mdwslides}
\fi
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{mdwslides}}
\ProcessOptions
\LoadClass{mdwslides}

%%%----- Required packages --------------------------------------------------

\RequirePackage[palatino, helvetica, courier, maths=cmr]{mdwfonts}
\RequirePackage[T1]{fontenc}
\RequirePackage{amssymb}
\RequirePackage{mdwtab, mathenv, crypto, mdwthm, mdwmath}
\RequirePackage[within=section]{exercise}
\RequirePackage{url}

\if0\ifx\pdfoutput\@@undefined0\else\the\pdfoutput\fi
  \PassOptionsToPackage{dvips}{xy}
\else
  \ifarticle
    \pdfpagewidth\paperwidth
    \pdfpageheight\paperheight
  \else
    \setslidelength{\pdfpagewidth}{\paperheight}
    \setslidelength{\pdfpageheight}{\paperwidth}
    \pdfhorigin=1 true in
    \pdfvorigin=1 true in
  \fi
\fi
\RequirePackage[all]{xy}

%%%----- Miscellaneous settings ---------------------------------------------

\errorcontextlines=999

%%%----- Style choices ------------------------------------------------------

\renewcommand{\qedsymbol}{$\square$}
\def\hex#1{\texttt{0x#1}}
\let\emptystring\lambda
\let\epsilon\varepsilon
\let\phi\varphi
\let\emptyset\varnothing
\bibliographystyle{mdwalpha}
\sloppy

%%%----- Exercise typesetting -----------------------------------------------

\exctrcheck{section}{\answrite{\protect\subsection*{Section \thesection}}}

%%%----- Diagram typesetting ------------------------------------------------

\turnradius={4pt}

\def\ocat{
  \setbox\z@\hbox{$\scriptstyle\|$}%
  \dimen8\ht\z@\advance\dimen8\dp\z@%
  \mathbin{\xy *=<\dimen8>[o][F]{\box\z@} \endxy}%
}

%%%----- That's all, folks --------------------------------------------------

\endinput
