summaryrefslogtreecommitdiff
path: root/report/pyp_clustering/acl09-short/common/jeffe.sty
blob: d2cd2e99133610aaa4b14cd9fe04d789b0fb3548 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
% ============================-*- LaTeX -*-=============================
%
%   jeffe.sty -- macros I use everywhere
%
%   Jeff Erickson (jeffe@cs.uiuc.edu)
%   Last modified 09 Jul 2000
%   This is free; caveat emptor!
%
%   Requirements that may not be part of every TeX distribution: 
%   (1) The standard AMS math packages amsmath and amssymb.  These are
%       absolutely vital to anyone who typesets mathematics of any
%       kind.  If you don't have them, get them NOW!!
%   (2) The textcomp package.  Cosmetic only.
%   (3) Knuth's manual font `manfnt'.  Cosmetic only.
%
% ======================================================================
\RequirePackage{latexsym,amsmath,amssymb}

\hyphenation{co-or-din-ate co-or-din-ates half-space stereo-iso-mers
stereo-iso-mer Round-table}

% ----------------------------------------------------------------------
%  Common abbreviations and words with accents
% ----------------------------------------------------------------------

% ---- LATIN ----
\def\etal{\emph{et~al.}}
\def\ie{\emph{i.e.}}
\def\eg{\emph{e.g.}}
\def\vitae{vit\ae{}}
\def\apriori{\emph{a~priori}}
\def\aposteriori{\emph{a~posteriori}}

% ---- FRENCH ----
\def\naive{na\"{\i}ve}
\def\Naive{Na\"{\i}ve}
\def\naively{na\"{\i}vely}	% Okay, I know, this isn't French.
\def\Naively{Na\"{\i}vely}
\def\cafe{caf\'e}

% ---- GERMAN ----
\def\fur{f\"ur}
\def\Universitat{Universit\"at}
\def\Saarbrucken{Saar\-br\"ucken}	% Bypass TeX hyphenation
\def\Zurich{Z\"urich}

% ---- PORTUGESE (Hi Jorge!) ----
\def\Computacao{Computa\c{c}\~ao}

% ---- PROPER NAMES (because I'm lazy) ----
\def\Benes{Bene\v{s}}		% ...network
\def\Bezier{B\'ezier}		% ...spline/curve/surface
\def\Bjorner{Bj\"orner}
\def\Bochis{Bochi\c{s}}		% Daciana
\def\Boruvka{Bor\.uvka}		% ...'s MST algorithm
\def\Bragger{Br\"agger}
\def\Bronnimann{Br\"onnimann}   \def\Herve{Herv\'e}
\def\Bruckner{Br\"uckner}
\def\Caratheodory{Carath\'eodory}	% Constantin
\def\Chvatal{Chv\'atal}         \def\Vasek{Va\v{s}ek}
				\def\Joao{Jo\~ao}	% Compa
\def\Cortes{Cort\'es}		% Carmen
\def\Dujmovic{Dujmovi\'c}	% Vida
				\def\Fredo{Fr\'edo}	% Durand
\def\Erdos{Erd\H{o}s}           \def\Pal{P\'al}
\def\Furedi{F\"uredi}           \def\Zoltan{Zolt\'an}
\def\Grobner{Gr\"obner}		% ... basis
\def\Grunbaum{Gr\"unbaum}	% Branko
\def\Hanoi{Hano\"\i}		% Tower of...
\def\Jarnik{Jarn\a'{\i}k}	% ...'s (`Prim's') MST algorithm
\def\Komlos{Koml\'os}
\def\Kovari{K\"ov\'ari}
\def\Lovasz{Lov\'asz}           \def\Laszlo{L\'aszl\'o}
\def\Matousek{Matou\v{s}ek}     \def\Jiri{Ji\v{r}\'\i}
\def\Mnev{Mn\"ev}
\def\Mobius{M\"obius}		% ... strip/transformation/function
\def\Mucke{M\"ucke}		% Ernst
\def\ODunliang{\'O'D\'unliang}
\def\Oleinik{Ole\u{\i}nik}
                                \def\Janos{J\'anos}     % Pach
\def\Palasti{Pal\'asti}
				\def\Belen{Bel\'en}	% Palop
\def\Petrovskii{Petrovski\u{\i}}
\def\Pinar{P\i nar}		% Ali
\def\Plucker{Pl\"ucker}		% ... coordinates
\def\Poincare{Poincar\'e}	% ... duality/halfplane
                                \def\Gunter{G\"unter}   % Rote, Ziegler
\def\Sacristan{Sacrist\'an}	% Vera
\def\Saskin{\v{S}a\v{s}kin}
\def\Schomer{Sch\"omer}
\def\Schonhardt{Sch\"onhardt}	% ... polyhedron
\def\Sos{S\'os}
\def\Stackel{St\"ackel}		% Paul
\def\Szekely{Sz\'ekely}
\def\Szemeredi{Szemer\'edi}
\def\Toth{T\'{o}th}		% Geza
\def\Turan{Tur\'an}
\def\Ungor{\"Ung\"or}		% Alper
\def\Voronoi{Vorono\"i}		% ... diagram [for francophile pedants only]

% Other
\def\Cplusplus{C\raisebox{0.5ex}{\tiny\bf++}}

% ----------------------------------------------------------------------
%  Simple math stuff
% ----------------------------------------------------------------------

% ---- SYMBOLS ----
\let\e\varepsilon               % a ``real'' epsilon

\def\Integer{\mathsf{Z\hspace{-0.4em}Z}}
\def\Natural{\mathrm{I\!N}}
\def\Real{\mathrm{I\!R}}
\def\Proj{\mathrm{I\!P}}	% projective space
\def\Hyper{\mathrm{I\!H}}	% hyperbolic space

%
%  These two look okay in Computer Modern 11pt, or Concrete Roman
%  12pt, but they need serious work in other sizes.  I need to figure
%  out how to draw a vertical bar, or better yet a shallow arc, inside
%  the bowls.  Or maybe I need to learn METAFONT.
%
\def\Complex{\mathrm{\,\raise 0.33ex\hbox{\scriptsize\bf(}\!\!\!C}}
\def\Rational{\mathrm{\,\raise 0.33ex\hbox{\scriptsize\bf(}\!\!\!Q}}

%
%  Here are more standard, but uglier, versions of these symbols.
%  They stick out, because they're all in Times Roman Bold Outline!
%  I *really* want a Concrete Blackboard or Euler Blackboard font, but
%  I'd settle for Computer Modern Blackboard.
%
%\def\Real{\mathbb{R}}
%\def\Proj{\mathbb{P}}
%\def\Hyper{\mathbb{H}}
%\def\Integer{\mathbb{Z}}
%\def\Natural{\mathbb{N}}
%\def\Complex{\mathbb{C}}
%\def\Rational{\mathbb{Q}}

\let\N\Natural
\let\Q\Rational
\let\R\Real
\let\Z\Integer
\def\Rd{\Real^d}
\def\RP{\Real\Proj}
\def\CP{\Complex\Proj}

% ---- OPERATORS (requires amsmath) ----
\def\aff{\operatorname{aff}}		% (\Line is better!)
\def\area{\operatorname{area}}
\def\argmax{\operatornamewithlimits{arg\,max}}
\def\argmin{\operatornamewithlimits{arg\,min}}
\def\Aut{\operatorname{Aut}}		% Automorphism group
\def\card{\operatorname{card}}		% cardinality, deprecated for \abs
\def\conv{\operatorname{conv}}		% (\overline is better!)
\def\E{\operatorname{E}}		% Expectation: $\E[X]$ (like \Pr)
\def\EE{\operatornamewithlimits{E}}
\def\Hom{\operatorname{Hom}}		% Homomorphism group
\def\id{\operatorname{id}}		% identity
\def\im{\operatorname{im}}		% image
\def\lcm{\operatorname{lcm}}
\def\lfs{\operatorname{lfs}}		% local feature size
\def\poly{\operatorname{poly}}
\def\polylog{\operatorname{polylog}}
\def\rank{\operatorname{rank}}
\def\rel{\operatorname{rel\,}}		% relative (interior, boundary, etc.)
\def\sgn{\operatorname{sgn}}
\def\vol{\operatorname{vol}}		% volume

\def\fp#1{^{\underline{#1}}}            % falling powers: $n\fp{d}$
\def\rp#1{^{\overline{#1}}}             % rising powers:  $n\rp{d}$

% --- Cheap displaystyle operators ---
\def\Frac#1#2{{\displaystyle\frac{#1}{#2}}}
\def\Sum{\sum\limits}
\def\Prod{\prod\limits}
\def\Union{\bigcup\limits}
\def\Inter{\bigcap\limits}
\def\Lor{\bigvee\limits}
\def\Land{\bigwedge\limits}
\def\Lim{\lim\limits}
\def\Max{\max\limits}
\def\Min{\min\limits}

% ---- RELATORS ----
\def\deq{\stackrel{\scriptscriptstyle\triangle}{=}}
\def\mapsfrom{\leftarrow\!\mapstochar\,}
\let\into\hookrightarrow		% = one-to-one
\let\onto\twoheadrightarrow

% ---- DELIMITER PAIRS ----
\def\floor#1{\lfloor #1 \rfloor}
\def\ceil#1{\lceil #1 \rceil}
\def\seq#1{\langle #1 \rangle}
\def\set#1{\{ #1 \}}
\def\abs#1{\mathopen| #1 \mathclose|}	% use instead of $|x|$ 
\def\norm#1{\mathopen\| #1 \mathclose\|}% use instead of $\|x\|$ 
\def\indic#1{\big[#1\big]}		% indicator variable; Iverson notation
					% e.g., Kronecker delta = [x=0]

% --- Self-scaling delmiter pairs ---
\def\Floor#1{\left\lfloor #1 \right\rfloor}
\def\Ceil#1{\left\lceil #1 \right\rceil}
\def\Seq#1{\left\langle #1 \right\rangle}
\def\Set#1{\left\{ #1 \right\}}
\def\Abs#1{\left| #1 \right|}
\def\Norm#1{\left\| #1 \right\|}
\def\Paren#1{\left( #1 \right)}		% need better macro name!
\def\Brack#1{\left[ #1 \right]}		% need better macro name!
\def\Indic#1{\left[ #1 \right]}		% indicator variable; Iverson notation

%
%  Macros to typeset sets like {foo|bar} with all three delimiters
%  correctly scaled to fit.  What I *really* want is a \middle macro
%  that acts just like \left and \right.  Grumble.
%
\def\Bigbar#1{\mathrel{\left|\vphantom{#1}\right.\n@space}}
\def\Setbar#1#2{\Set{#1 \Bigbar{#1 #2} #2}}
\def\Seqbar#1#2{\Seq{#1 \Bigbar{#1 #2} #2}}
\def\Brackbar#1#2{\Brack{#1 \Bigbar{#1 #2} #2}}

%  C-style arithmetic if-then-else
\def\arithif#1#2#3{#1 \mathbin? #2 \mathbin: #3}

%  Math mode fbox
\def\mfbox#1{\mathchoice{{\fbox{\ensuremath{\displaystyle #1}}}}
			{{\fbox{\ensuremath{\textstyle #1}}}}
			{{\fbox{\ensuremath{\scriptstyle #1}}}}
			{{\fbox{\ensuremath{\scriptscriptstyle #1}}}}}

% ---- ``ACCENTS'' ----
%   NB: Commands equivalent to \lrarrowfill and \overlrarrow are
%       already defined in amstex!
\def\lrarrowfill{$\m@th\mathord\leftarrow\mkern-6mu%
  \cleaders\hbox{$\mkern-2mu\mathord-\mkern-2mu$}\hfill
  \mkern-6mu\mathord\rightarrow$}
\def\overlrarrow#1{\vbox{\ialign{##\crcr
      \lrarrowfill\crcr\noalign{\kern-\p@\nointerlineskip}
      $\hfil\displaystyle{#1}\hfil$\crcr}}}

\def\Line#1{\!\overlrarrow{\vphantom{t}\smash{\,#1\,}}\!}
\def\Ray#1{\overrightarrow{\vphantom{t}#1\,}\!}
\def\Seg#1{\overline{\vphantom{t}#1}}

% --- TEXT STYLES ---
\def\mathsc#1{\text{\textsc{#1}}}
\def\mathbs#1{\text{\boldmath\ensuremath{#1}}}

% ----------------------------------------------------------------------
%  \begin{bigabstract}...\end{bigabstract}
%  For use in documents with title pages.  Use normal-sized text in
%  the abstract!
% ----------------------------------------------------------------------
\newenvironment{bigabstract}%
{\medskip\noindent\centerline{\textbf{\large\abstractname}}\begin{quotation}}%
{\end{quotation}}

% ----------------------------------------------------------------------
%  Make captions smaller than the text, make their titles bold.
%  Arguments:   #1 == figure name: "Figure 5"
%               #2 == caption: "Papers by \Erdos, 1900--2000 (projected)"
%  Less space after floats and before caption, since captions are smaller
% ----------------------------------------------------------------------
\@ifundefined{abovecaptionskip}{\newlength\abovecaptionskip}
\long\def\@makecaption#1#2{
   \vskip \abovecaptionskip
   \setbox\@tempboxa\hbox{{\sf\footnotesize \textbf{#1.} #2}}
   \ifdim \wd\@tempboxa >\hsize         % IF longer than one line:
       {\sf\footnotesize \textbf{#1.} #2\par}% THEN set as ordinary paragraph.
     \else                              %   ELSE  center.
       \hbox to\hsize{\hfil\box\@tempboxa\hfil}
   \fi}
\dbltextfloatsep 18pt plus 2pt minus 4pt% was 20pt plus 2pt minus 4pt
\textfloatsep 18pt plus 2pt minus 4pt   % was 20pt plus 2pt minus 4pt
\abovecaptionskip 6pt			% was 10pt

% ----------------------------------------------------------------------
%  Revised theorem environment:
%  Add a period after the theorem number, and make theorems slanted
%  instead of italic to help distinguish text from math.  Use
%  \boldmath in theorem label in case it includes math.
% ----------------------------------------------------------------------
\def\@opargbegintheorem#1#2#3{\trivlist
	\item[\hskip\labelsep{\bf\boldmath #1\ #2\ (#3).}]\sl}
\def\@begintheorem#1#2{\trivlist
	\item[\hskip\labelsep{\bf\boldmath #1\ #2.}]\sl}

% ----------------------------------------------------------------------
%  \newproof{type}{text}(style)[post]:
%  Define a new type of unnumbered ``theorem'' environment.  The last
%  two arguments are optional; most environments will not use them.
%
%  To change label style, put new style command in label:
%       \newproof{comment}{\sf Comment}
% ----------------------------------------------------------------------
\def\newproof#1#2{\@ifnextchar({\@snproof{#1}{#2}}{\@snproof{#1}{#2}(\rm)}}
\def\@snproof#1#2(#3){\@ifnextchar[{\@xnproof{#1}{#2}{#3}}
                                   {\@xnproof{#1}{#2}{#3}[]}}

\def\@xnproof#1#2#3[#4]{%\expandafter\@ifdefinable\csname #1\endcsname
{\global\@namedef{#1}{\@prf{#2}{#3}}\global\@namedef{end#1}{\@endprf{#4}}}}

\def\@prf#1#2{\@ifnextchar[{\@xprf{#1}{#2}}{\@yprf{#1}{#2}}}
\def\@xprf#1#2[#3]{\@yprf{#1\ (#3)}{#2}}
\def\@yprf#1#2{\begin{trivlist}\item[\hskip\labelsep{\bf\boldmath #1:}]#2}

\def\@endprf#1{#1\end{trivlist}}

%
%  Standard proof envrionment: last line has a halmos at the right margin.
%
\@ifundefined{square}{\let\square\Box}{}	% grumble latex2e 
\def\QED{\ensuremath{{\square}}}
\def\markatright#1{\leavevmode\unskip\nobreak\quad\hspace*{\fill}{#1}}
\def\qed{\markatright{\QED}}
\newproof{proof}{Proof}[\qed]
\newproof{sketch}{Proof Sketch}[\qed]

\newenvironment{rawproof}%
   {\begin{trivlist}\item[\hskip\labelsep\textbf{Proof:}]}%
   {\qed\end{trivlist}}

%
%  If the proof ends with a displayed equation, use \aftermath just
%  before \end{proof} to put the halmos in the ``right'' place.  This
%  may not work near page boundaries. 
%
\def\aftermath{\par\vspace{-\belowdisplayskip}\vspace{-\parskip}\vspace{-\baselineskip}}

% ----------------------------------------------------------------------
%  One-shot theoremish environment.  For named things like ``Zorn's
%  Lemma'' or ``The Death Leap Principle'' or ``The Zone Theorem''.
%  To get one-shot proofish environment, put \rm inside.
%  New improved version stolen from Erik Demaine.
% ----------------------------------------------------------------------
\newenvironment{oneshot}[1]{\@begintheorem{#1}{\unskip}}{\@endtheorem}

% ----------------------------------------------------------------------
%  Algorithm and code environments -- Algorithms are set in normal
%  text, with 2em indenting, surrounded by a box.  Code is set in
%  typewriter text, with 4 space indenting, and no box.
%
%  NOTE!  The true width of the minipage environment is determined by
%  the contents of the longest line, but ONLY because the minipage
%  contains a tabbing environment, and nothing else.  It's a HaX!
%
%  Both environments need optional line numbering and comment macros,
%  but bold keywords are just distracting.
% ----------------------------------------------------------------------
\def\begin@lgo{\begin{minipage}{1in}\begin{tabbing}
        \quad\=\qquad\=\qquad\=\qquad\=\qquad\=\qquad\=\qquad\=\kill}
\def\end@lgo{\end{tabbing}\end{minipage}}

\newenvironment{algorithm}
{\begin{tabular}{|l|}\hline\begin@lgo}
{\end@lgo\\\hline\end{tabular}}

\newenvironment{algo}
{\begin{center}\begin{algorithm}}
{\end{algorithm}\end{center}}

\def\Comment#1{\textsf{\textsl{$\langle\!\langle$#1\/$\rangle\!\rangle$}}}

\def\beginc@de{\noindent\begin{center}\begin{minipage}{1in}\tt
        \begin{tabbing}~~~~\=~~~~\=~~~~\=~~~~\=~~~~\=~~~~\=~~~~\=\kill}
\def\endc@de{\end{tabbing}\end{minipage}\end{center}}

\newenvironment{code}{\beginc@de}{\endc@de}

%
% I think these only work with <1 line of text.  Use sparingly!!
%
\def\textul#1{\underline{\smash{#1}\vphantom{,}}}
\def\strike#1{\ensuremath{\overline{\text{\smash{#1}\vphantom{.}}}}}

% ----------------------------------------------------------------------
%  Include a file verbatim.  Searches the TEXINPUTS path for the file,
%  even though that's probably not what you really want.  Stolen from
%  ``verbatimfiles.sty'' by Chris Rowley and others.  [Don't use their 
%  \vertbatimlisting macro; it has some bizarre side-effects!]
% ----------------------------------------------------------------------
\def\verbinput#1{
\begingroup\@verbatim\frenchspacing\@vobeyspaces\input#1\endgroup
}

% ----------------------------------------------------------------------
%  \now  -- Current time in h:mm AM/PM format
%  \mdyy -- Today's date in m/d/yy format.  Forget Y2K; this is for humans!
% ----------------------------------------------------------------------
\newcount\timehh\timehh=\time
\divide\timehh by 60
\newcount\timemm\timemm=\time
\count255=\timehh
\multiply\count255 by -60
\advance\timemm by \count255
\newif\iftimePM
\ifnum\timehh>11 \timePMtrue\else\timePMfalse\fi
\ifnum\timehh<1 \advance\timehh by 12\fi
\ifnum\timehh>12 \advance\timehh by -12\fi
\def\now{\number\timehh:\ifnum\timemm<10 0\fi\number\timemm
         \iftimePM pm\else am\fi}
\newcount\mdYY\mdYY=\year
\count255=\year
\divide\count255 by 100
\multiply\count255 by 100
\advance\mdYY by -\count255
\def\mdyy{\number\month/\number\day/\ifnum\mdYY<10 0\fi\number\mdYY}

% ----------------------------------------------------------------------
%  Notes to myself
% ----------------------------------------------------------------------
\def\n@te#1{\textsf{$\langle\!\langle$#1$\rangle\!\rangle$}\leavevmode}
\def\n@tew@rn{\GenericWarning{}{AUTHOR WARNING: Unresolved \protect\note}}

\def\n@ten@te#1{\marginpar
	[\hfill\llap{\textcircled{\small#1}$\!\Longrightarrow$}]
	{\rlap{$\Longleftarrow\!$\textcircled{\small#1}}}}

\def\n@tedingb@t{\@ifundefined{textmusicalnote}
			{$\circledcirc$}	% if you don't have textcomp
			{\textmusicalnote}}	% if you do have textcomp

\def\note#1{\n@tew@rn\n@te{\n@ten@te{\n@tedingb@t}#1}}

\def\sidenote#1{\marginpar{\tiny\sf #1}}


%----------------------------------------------------------------------
%  Bibliography aliases, so I can use mnemonic citation keys and
%  geom.bib at the same time.  \bibalias{foo}{bar} makes \cite{foo}
%  act (almost) exactly like \cite{bar}.
%----------------------------------------------------------------------
\def\bibalias#1#2{%
    \global\@namedef{b@#1}{%
        {\@ifundefined{b@#2}{\textsf{?}}{}\csname b@#2\endcsname}}}

%----------------------------------------------------------------------
%  Flag bad citations and refernces in the margin.  Dangerous if you
%  have lots of undefined refs; use batchmode the first time.
%  Incompatible with some document classes.
%----------------------------------------------------------------------
\DeclareOption{flagerrors}
{
\def\badcite{\ifinner\else\n@ten@te{\textcent}\fi}

\def\badref{\ifinner\else\n@ten@te{$\Join$}\fi}

\def\bibalias#1#2{%
    \global\@namedef{b@#1}{%
        {\@ifundefined{b@#2}{\textsf{>>#1??}}{}\csname b@#2\endcsname}}}

\def\@citex[#1]#2{%
  \let\@citea\@empty
  \@cite{\@for\@citeb:=#2\do
    {\@citea\def\@citea{,\penalty\@m\ }%
     \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
     \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
     \@ifundefined{b@\@citeb}{\mbox{\reset@font\sffamily>\@citeb?}%
       \badcite%
       \G@refundefinedtrue%
       \@latex@warning
         {Citation `\@citeb' on page \thepage \space undefined}}%
       {\hbox{\csname b@\@citeb\endcsname}}}}{#1}}

\def\@setref#1#2#3{
  \ifx#1\relax
   \protect\G@refundefinedtrue
   \badref\mbox{\reset@font\sffamily >#3?}
   \@latex@warning{Reference `#3' on page \thepage \space undefined}%
  \else
   \expandafter#2#1\null
  \fi}
}


% ----------------------------------------------------------------------
%  Draft notice.  Put \DRAFT on the title page, in place of \date.
% ----------------------------------------------------------------------
\def\draftnotice{Preliminary draft --- \mdyy\ --- Not for distribution}

\def\DRAFT{
\date{\fbox{\textsf{\textbf{\draftnotice}}}}
\def\@oddfoot{\footnotesize\hss\fbox{\textbf{\textsf{\draftnotice}}}\hss}
\let\@evenfoot\@oddfoot
}

% ----------------------------------------------------------------------
%  Dingbats from the TeX/METAFONT-book manual font
%  Use only with 11 or 12 pt text.
%  Doesn't work with TeXtures, which doesn't know about manfnt.
% ----------------------------------------------------------------------
\font\manual=manfnt
\def\goodcube{{\manual\char28}}	% possible cube from MF-book
\def\badcube{{\manual\char29}}	% impossible cube from MF-book
\def\starknot{{\manual\char30}}	% 2,5 torus knot from MF-book
\def\target{{\manual\char36}}	% concentric circles from MF-book
\def\xflower{{\manual\char38}}	% X flower dingbat from MF-book
\def\tflower{{\manual\char39}}	% + flower dingbat from MF-book
\def\changeto{{\manual\char121}}% change arrow
\def\dbend{{\manual\char127}}   % dangerous bend sign

% ----------------------------------------------------------------------
%  Dangerous bend environments, stolen from TeXbook and slightly
%  massaged.
%
%  Invoke as \begin{[d]danger}...\end{[d]danger}.  The enclosed text
%  is offset just like any other list (theorem, proof, etc.)  Puts
%  sign[s] in front of first two lines of first paragraph, which are
%  (supposedly) never split by a page boundary.  Does NOT shrink or
%  otherwise modify the text.
% ----------------------------------------------------------------------
%  The dangerous bend signs are the correct size to match two lines of
%  Computer Modern 9pt type.  I really ought to scale them up to
%  fit whatever size we're using, but I won't.  Unfortunately, manfnt
%  thinks it's a 10pt font, so if we want to match 11pt Computer
%  Modern, we have to scale manfnt to 12.222222pt!  Thanks, Don.
%
%  TeX is a HaX.
% ----------------------------------------------------------------------

% Single danger
\def\danger{\begin{trivlist}\item[]\noindent%
\begingroup\hangindent=2.5pc\hangafter=-2\clubpenalty=10000%
\def\par{\endgraf\endgroup}%
\hbox to 0pt{\hskip-\hangindent\dbend\hfill}\ignorespaces}
\def\enddanger{\end{trivlist}}

% Double danger
\def\ddanger{\begin{trivlist}\item[]\noindent%
\begingroup\hangindent=4pc\hangafter=-2\clubpenalty=10000%
\def\par{\endgraf\endgroup}%
\hbox to 0pt{\hskip-\hangindent\dbend\kern2pt\dbend\hfill}\ignorespaces}
\def\endddanger{\end{trivlist}}

%----------------------------------------------------------------------
% 'cramped' list style, stolen from Jeff Vitter
%----------------------------------------------------------------------
\def\cramped
  {\parskip\@outerparskip\@topsep\parskip
  \@topsepadd2pt\itemsep0pt
%  \settowidth{\labelwidth}{\@itemlabel}
%  \advance\leftmargin-\labelsep
%  \advance\leftmargin-\labelwidth
%  \advance\@totalleftmargin-\leftmargin
%  \advance\linewidth\leftmargin
%  \parshape1\@totalleftmargin\linewidth
}

%----------------------------------------------------------------------
%  More footnote symbols, please.
%----------------------------------------------------------------------
\def\@fnsymbol#1{\ensuremath{\ifcase#1\or *\or \dagger\or \ddagger\or
   \mathsection\or \mathparagraph\or \|\or **\or \dagger\dagger
   \or \ddagger\ddagger \or \mathsection\mathsection \or
   \mathparagraph\mathparagraph \else\@ctrerr\fi}}

%----------------------------------------------------------------------
%  TeXbook style quotations -- I should really use the right font, tho.
%----------------------------------------------------------------------
\newenvironment{rightquote}[1]
{\flushright\begin{minipage}{#1\textwidth}
\parskip0pt\footnotesize\sffamily\slshape}
{\end{minipage}\par\bigskip}
\def\quotee#1{\par\vspace{0.5ex}\flushright\unskip\textup{--- #1}}

\ProcessOptions