ips.cls: Fix the page size of the PDF output.
[doc/ips] / ips.cls
1 %%% -*-latex-*-
2 %%%
3 %%% Definitions for IPS course
4
5 \NeedsTeXFormat{LaTeX2e}
6 \ProvidesClass{ips}[2001/10/02]
7
8 %%%----- Document class stuff -----------------------------------------------
9
10 \newif\ifipsslides \ipsslidesfalse
11 \newif\ifipsanswers \ipsanswerstrue
12 \InputIfFileExists{ips.cfg}\relax\relax
13
14 \ifipsslides
15 \PassOptionsToClass{a4, slidesonly}{mdwslides}
16 \else
17 \PassOptionsToClass{a4, article, twoside}{mdwslides}
18 \fi
19 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{mdwslides}}
20 \ProcessOptions
21 \LoadClass{mdwslides}
22
23 %%%----- Required packages --------------------------------------------------
24
25 \RequirePackage[palatino, helvetica, courier, maths=cmr]{mdwfonts}
26 \RequirePackage[T1]{fontenc}
27 \RequirePackage{amssymb}
28 \RequirePackage{mdwtab, mathenv, crypto, mdwthm, mdwmath}
29 \RequirePackage[within=section]{exercise}
30 \RequirePackage{url}
31
32 \if0\ifx\pdfoutput\@@undefined0\else\the\pdfoutput\fi
33 \PassOptionsToPackage{dvips}{xy}
34 \else
35 \ifarticle
36 \pdfpagewidth\paperwidth
37 \pdfpageheight\paperheight
38 \else
39 \setslidelength{\pdfpagewidth}{\paperheight}
40 \setslidelength{\pdfpageheight}{\paperwidth}
41 \pdfhorigin=1 true in
42 \pdfvorigin=1 true in
43 \fi
44 \fi
45 \RequirePackage[all]{xy}
46
47 %%%----- Miscellaneous settings ---------------------------------------------
48
49 \errorcontextlines=999
50
51 %%%----- Style choices ------------------------------------------------------
52
53 \renewcommand{\qedsymbol}{$\square$}
54 \def\hex#1{\texttt{0x#1}}
55 \let\emptystring\lambda
56 \let\epsilon\varepsilon
57 \let\phi\varphi
58 \let\emptyset\varnothing
59 \bibliographystyle{mdwalpha}
60 \sloppy
61
62 %%%----- Exercise typesetting -----------------------------------------------
63
64 \exctrcheck{section}{\answrite{\protect\subsection*{Section \thesection}}}
65
66 %%%----- Diagram typesetting ------------------------------------------------
67
68 \turnradius={4pt}
69
70 \def\ocat{
71 \setbox\z@\hbox{$\scriptstyle\|$}%
72 \dimen8\ht\z@\advance\dimen8\dp\z@%
73 \mathbin{\xy *=<\dimen8>[o][F]{\box\z@} \endxy}%
74 }
75
76 %%%----- That's all, folks --------------------------------------------------
77
78 \endinput