3 %%% Definitions for IPS course
5 %%%----- Required packages --------------------------------------------------
7 \RequirePackage[palatino, helvetica, courier, maths=cmr]{mdwfonts}
8 \RequirePackage{fancyhdr}
9 \RequirePackage[T1]{fontenc}
10 \RequirePackage{mdwtab, mathenv, crypto, mdwthm, mdwmath}
11 \RequirePackage[within=section]{exercise}
12 \RequirePackage{amssymb}
15 \ifx\pdfoutput\@@undefined
16 \def\next{\RequirePackage[all, dvips]{xy}}
18 \def\next{\RequirePackage[all]{xy}}
20 \pdfpagewidth\paperwidth
21 \pdfpageheight\paperheight
23 \pdfpagewidth\paperheight
24 \pdfpageheight\paperwidth
29 %%%----- Miscellaneous settings ---------------------------------------------
31 \errorcontextlines=999
33 %%%----- Style choices ------------------------------------------------------
35 \renewcommand{\qedsymbol}{$\square$}
36 \def\hex#1{\texttt{0x#1}}
37 \let\emptystring\lambda
38 \let\epsilon\varepsilon
40 \let\emptyset\varnothing
41 \bibliographystyle{mdwalpha}
44 %%%----- Exercise typesetting -----------------------------------------------
46 \exctrcheck{section}{\answrite{\protect\subsection*{Section \thesection}}}
48 %%%----- Diagram typesetting ------------------------------------------------
53 \setbox\z@\hbox{$\scriptstyle\|$}%
54 \dimen8\ht\z@\advance\dimen8\dp\z@%
55 \mathbin{\xy *=<\dimen8>[o][F]{\box\z@} \endxy}%
58 %%%------ Sectioning and headings -------------------------------------------
62 \fancyhead[LE]{\textbf{\nouppercase{\leftmark}}}
63 \fancyhead[RO]{\textbf{\nouppercase{\rightmark}}}
64 \fancyfoot[LE, RO]{\thepage}
65 \def\headrulewidth{\z@}
66 \fancypagestyle{plain}{\fancyhead{}}
67 \def\sectionmark#1{\markboth{\thesection.\ #1}{}}
68 \def\subsectionmark#1{\markright{\thesubsection.\ #1}}
73 \def\sectionmark#1{\markboth{#1}{}}
74 \def\subsectionmark#1{\markright{ -- #1}}
77 {\ifnum\@emptyslide=\c@slide\else\textbf{\thetitle}\hfil\fi}%
78 {\ifnum\@emptyslide=\c@slide\else\leftmark\rightmark\hfil\theslide\fi}
79 \slidepagestyle{slide}
80 \def\emptyslide{\global\@emptyslide\c@slide}%
81 \def\@sect#1#2#3#4#5#6[#7]#8{%
82 \ifnum #2>\c@secnumdepth\else%
85 \csname #1mark\endcsname{#7}%
86 \csname #1summary\endcsname{#7}%
88 \def\@ssect#1#2#3#4#5{\relax}
91 \def\sm@auxwrite#1#2{\immediate\write\@auxout
92 {\noexpand\sm@entry{\the\sm@count}{#1}{#2}}}
94 \global\advance\sm@count\@ne%
95 \expandafter\let\expandafter\@next%
96 \csname sm@summary@\the\sm@count\endcsname%
97 \ifx\@next\relax\else\@next\sm@endsummary\fi%
98 \sm@auxwrite{section}%
100 \def\subsectionsummary{\sm@auxwrite{subsection}}
101 \def\sm@entry#1#2#3{%
103 \let\protect\@unexpandable@protect%
104 \expandafter\ifx\csname sm@summary@#1\endcsname\relax%
105 \expandafter\let\csname sm@summary@#1\endcsname\@empty%
107 \expandafter\xdef\csname sm@summary@#1\endcsname{%
108 \csname sm@summary@#1\endcsname%
109 \expandafter\protect\csname sm@do#2\endcsname{#3}%
113 \def\sm@dosection#1{%
118 \centerline{\sffamily\bfseries\Large #1 -- overview}
122 \def\sm@endsummary{\enditemize\endgroup\endslide\endgroup}
123 \def\sm@dosubsection#1{\item\relax\@tempswatrue#1}
124 \def\sm@dotopic#1{\if@tempswa:\@tempswafalse\else;\fi\space#1}
125 \def\topic{\sm@auxwrite{topic}}
128 \def\head#1{{\sffamily\bfseries\large #1}\par}
130 %%%------ Page layout for notes ---------------------------------------------
134 \def\slide@clearpage{\if@nobreak\else\par\penalty\z@\fi}
137 %%%----- Slide layout -------------------------------------------------------
142 \slideplacement{here}
148 \def\slideleftmargin{15mm} \let\sliderightmargin=\slideleftmargin
149 \def\slidetopmargin{15mm} \let\slidebottommargin=\slidetopmargin
151 \def\slidearraystretch{1}
153 %%%----- Hacking xcomment ---------------------------------------------------
155 %%% Supports \xcalways...\x which is an escape from the usual commenting.
158 \catcode`\!=12\catcode`\[=12\catcode`\]=12\catcode`\"=12
159 \lccode`\!=`\\\lccode`\[=`\{\lccode`\]=`\}\lccode`\"=`\%
160 \catcode`\~=\active\lccode`\~=`\^^M
163 %% Hack the main loop code
165 \gdef\xcomment@@@#1\@nil{%
170 \def\next{\xcomment@@#1\@nil}%
172 \xc@checkbegin#1\relax begin[]\relax\relax
174 \xc@checkend#1\relax end[]\relax\relax
176 \xc@checkinput#1\relax input[]\relax\relax
178 \xc@checkinclude#1\relax include[]\relax\relax
180 \xc@checkendinput#1\relax endinputss\relax\relax
182 \xc@checkalways#1\relax xcalwaysfoo!x\relax\relax
186 %% New command support
188 \gdef\xc@checkalways#1xcalways#2!x#3\relax#4\relax{%
193 \toks@{#2}\rescan\toks@%
194 \def\next{\the\toks@\xc@always#3\@nil}%
200 \def\xc@always#1\@nil{\xc@begin#1}
201 \def\xcalways#1\x{#1}
203 %%%----- Bugfix -------------------------------------------------------------
205 \def\@bugfix#1\let\@listi#2#3\@@%
206 {\def\normalsize{#1#3}}
207 \expandafter\@bugfix\normalsize\@@
209 \toks@\expandafter{\slidebox@restore}
210 \edef\slidebox@restore{\the\toks@\advance\topsep\parskip}
213 \def\@bugfix#1\penalty\z@#2\@@{\def\outputloop@savedslides{#1#2}}
214 \expandafter\@bugfix\outputloop@savedslides\@@
215 \toks@\expandafter{\output@savedslide}
216 \def\@strange@hack{\begingroup\output{\unvbox\@cclv}\penalty-\@M\endgroup}
217 \edef\output@savedslide{\noexpand\@strange@hack\the\toks@}
221 \setbox\@slidebox\vbox{%
222 \@begindvi % added 1997/04/15 SPQR
224 \ifvoid\slide@footins\else
225 \vskip\skip\slide@footins
228 \unvbox\slide@footins
234 \setbox\@outputbox \box\@cclv
235 \xdef\@freelist{\@freelist\@midlist}%
236 \global \let \@midlist \@empty
238 \ifvoid\footins \else
239 \setbox\@outputbox \vbox {%
240 \boxmaxdepth \@maxdepth
252 \setbox\@outputbox \vbox to\@colht {%
254 \dimen@ \dp\@outputbox
260 \global \maxdepth \@maxdepth
263 %%%----- That's all, folks --------------------------------------------------