Merge commit '695c71e20f5a068757525453e76792914b15b2bd'
[aquarium] / doc / arch / sigplanconf.cls
1 %-----------------------------------------------------------------------------
2 %
3 %               LaTeX Class/Style File
4 %
5 % Name:         sigplanconf.cls
6 %
7 % Purpose:      A LaTeX 2e class file for SIGPLAN conference proceedings.
8 %               This class file supercedes acm_proc_article-sp,
9 %               sig-alternate, and sigplan-proc.
10 %
11 % Author:       Paul C. Anagnostopoulos
12 %               Windfall Software
13 %               978 371-2316
14 %               paul [atsign] windfall.com
15 %
16 % Created:      12 September 2004
17 %
18 % Revisions:    See end of file.
19 %
20 % This work is licensed under the Creative Commons Attribution License.
21 % To view a copy of this license, visit
22 %   http://creativecommons.org/licenses/by/3.0/
23 % or send a letter to Creative Commons, 171 2nd Street, Suite 300,
24 % San Francisco, California, 94105, U.S.A.
25 %
26 %-----------------------------------------------------------------------------
27
28
29 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
30 \ProvidesClass{sigplanconf}[2011/11/08 v2.5 ACM SIGPLAN Proceedings]
31
32 % The following few pages contain LaTeX programming extensions adapted
33 % from the ZzTeX macro package.
34 \f
35 %                       Token Hackery
36 %                       ----- -------
37
38
39 \def \@expandaftertwice {\expandafter\expandafter\expandafter}
40 \def \@expandafterthrice {\expandafter\expandafter\expandafter\expandafter
41                           \expandafter\expandafter\expandafter}
42
43 % This macro discards the next token.
44
45 \def \@discardtok #1{}%                                  token
46
47 % This macro removes the `pt' following a dimension.
48
49 {\catcode `\p = 12 \catcode `\t = 12
50
51 \gdef \@remover #1pt{#1}
52
53 } % \catcode
54
55 % This macro extracts the contents of a macro and returns it as plain text.
56 % Usage: \expandafter\@defof \meaning\macro\@mark
57
58 \def \@defof #1:->#2\@mark{#2}
59 \f
60 %                       Control Sequence Names
61 %                       ------- -------- -----
62
63
64 \def \@name #1{%                                        {\tokens}
65   \csname \expandafter\@discardtok \string#1\endcsname}
66
67 \def \@withname #1#2{%                                  {\command}{\tokens}
68   \expandafter#1\csname \expandafter\@discardtok \string#2\endcsname}
69 \f
70 %                       Flags (Booleans)
71 %                       ----- ----------
72
73 % The boolean literals \@true and \@false are appropriate for use with
74 % the \if command, which tests the codes of the next two characters.
75
76 \def \@true {TT}
77 \def \@false {FL}
78
79 \def \@setflag #1=#2{\edef #1{#2}}%              \flag = boolean
80 \f
81 %                       IF and Predicates
82 %                       -- --- ----------
83
84 % A "predicate" is a macro that returns \@true or \@false as its value.
85 % Such values are suitable for use with the \if conditional.  For example:
86 %
87 %   \if \@oddp{\x} <then-clause> \else <else-clause> \fi
88
89 % A predicate can be used with \@setflag as follows:
90 %
91 %   \@setflag \flag = {<predicate>}
92
93 % Here are the predicates for TeX's repertoire of conditional
94 % commands.  These might be more appropriately interspersed with
95 % other definitions in this module, but what the heck.
96 % Some additional "obvious" predicates are defined.
97
98 \def \@eqlp   #1#2{\ifnum #1 = #2\@true \else \@false \fi}
99 \def \@neqlp  #1#2{\ifnum #1 = #2\@false \else \@true \fi}
100 \def \@lssp   #1#2{\ifnum #1 < #2\@true \else \@false \fi}
101 \def \@gtrp   #1#2{\ifnum #1 > #2\@true \else \@false \fi}
102 \def \@zerop  #1{\ifnum #1 = 0\@true \else \@false \fi}
103 \def \@onep   #1{\ifnum #1 = 1\@true \else \@false \fi}
104 \def \@posp   #1{\ifnum #1 > 0\@true \else \@false \fi}
105 \def \@negp   #1{\ifnum #1 < 0\@true \else \@false \fi}
106 \def \@oddp   #1{\ifodd #1\@true \else \@false \fi}
107 \def \@evenp  #1{\ifodd #1\@false \else \@true \fi}
108 \def \@rangep #1#2#3{\if \@orp{\@lssp{#1}{#2}}{\@gtrp{#1}{#3}}\@false \else
109                                                           \@true \fi}
110 \def \@tensp  #1{\@rangep{#1}{10}{19}}
111
112 \def \@dimeqlp   #1#2{\ifdim #1 = #2\@true \else \@false \fi}
113 \def \@dimneqlp  #1#2{\ifdim #1 = #2\@false \else \@true \fi}
114 \def \@dimlssp   #1#2{\ifdim #1 < #2\@true \else \@false \fi}
115 \def \@dimgtrp   #1#2{\ifdim #1 > #2\@true \else \@false \fi}
116 \def \@dimzerop  #1{\ifdim #1 = 0pt\@true \else \@false \fi}
117 \def \@dimposp   #1{\ifdim #1 > 0pt\@true \else \@false \fi}
118 \def \@dimnegp   #1{\ifdim #1 < 0pt\@true \else \@false \fi}
119
120 \def \@vmodep     {\ifvmode \@true \else \@false \fi}
121 \def \@hmodep     {\ifhmode \@true \else \@false \fi}
122 \def \@mathmodep  {\ifmmode \@true \else \@false \fi}
123 \def \@textmodep  {\ifmmode \@false \else \@true \fi}
124 \def \@innermodep {\ifinner \@true \else \@false \fi}
125
126 \long\def \@codeeqlp #1#2{\if #1#2\@true \else \@false \fi}
127
128 \long\def \@cateqlp #1#2{\ifcat #1#2\@true \else \@false \fi}
129
130 \long\def \@tokeqlp  #1#2{\ifx #1#2\@true \else \@false \fi}
131 \long\def \@xtokeqlp #1#2{\expandafter\ifx #1#2\@true \else \@false \fi}
132
133 \long\def \@definedp #1{%
134   \expandafter\ifx \csname \expandafter\@discardtok \string#1\endcsname
135                    \relax \@false \else \@true \fi}
136
137 \long\def \@undefinedp #1{%
138   \expandafter\ifx \csname \expandafter\@discardtok \string#1\endcsname
139                    \relax \@true \else \@false \fi}
140
141 \def \@emptydefp #1{\ifx #1\@empty \@true \else \@false \fi}%       {\name}
142
143 \let \@emptylistp = \@emptydefp
144
145 \long\def \@emptyargp #1{%                               {#n}
146   \@empargp #1\@empargq\@mark}
147 \long\def \@empargp #1#2\@mark{%
148   \ifx #1\@empargq \@true \else \@false \fi}
149 \def \@empargq {\@empargq}
150
151 \def \@emptytoksp #1{%                                   {\tokenreg}
152   \expandafter\@emptoksp \the#1\@mark}
153
154 \long\def \@emptoksp #1\@mark{\@emptyargp{#1}}
155
156 \def \@voidboxp #1{\ifvoid #1\@true \else \@false \fi}
157 \def \@hboxp #1{\ifhbox #1\@true \else \@false \fi}
158 \def \@vboxp #1{\ifvbox #1\@true \else \@false \fi}
159
160 \def \@eofp #1{\ifeof #1\@true \else \@false \fi}
161
162
163 % Flags can also be used as predicates, as in:
164 %
165 %   \if \flaga <then-clause> \else <else-clause> \fi
166
167
168 % Now here we have predicates for the common logical operators.
169
170 \def \@notp #1{\if #1\@false \else \@true \fi}
171
172 \def \@andp #1#2{\if #1%
173                   \if #2\@true \else \@false \fi
174                 \else
175                   \@false
176                 \fi}
177
178 \def \@orp #1#2{\if #1%
179                  \@true
180                \else
181                  \if #2\@true \else \@false \fi
182                \fi}
183
184 \def \@xorp #1#2{\if #1%
185                   \if #2\@false \else \@true \fi
186                 \else
187                   \if #2\@true \else \@false \fi
188                 \fi}
189 \f
190 %                       Arithmetic
191 %                       ----------
192
193 \def \@increment #1{\advance #1 by 1\relax}%             {\count}
194
195 \def \@decrement #1{\advance #1 by -1\relax}%            {\count}
196 \f
197 %                       Options
198 %                       -------
199
200
201 \@setflag \@authoryear = \@false
202 \@setflag \@blockstyle = \@false
203 \@setflag \@copyrightwanted = \@true
204 \@setflag \@explicitsize = \@false
205 \@setflag \@mathtime = \@false
206 \@setflag \@natbib = \@true
207 \@setflag \@ninepoint = \@true
208 \newcount{\@numheaddepth} \@numheaddepth = 3
209 \@setflag \@onecolumn = \@false
210 \@setflag \@preprint = \@false
211 \@setflag \@reprint = \@false
212 \@setflag \@tenpoint = \@false
213 \@setflag \@times = \@false
214
215 % Note that all the dangerous article class options are trapped.
216
217 \DeclareOption{9pt}{\@setflag \@ninepoint = \@true
218                     \@setflag \@explicitsize = \@true}
219
220 \DeclareOption{10pt}{\PassOptionsToClass{10pt}{article}%
221                      \@setflag \@ninepoint = \@false
222                      \@setflag \@tenpoint = \@true
223                      \@setflag \@explicitsize = \@true}
224
225 \DeclareOption{11pt}{\PassOptionsToClass{11pt}{article}%
226                      \@setflag \@ninepoint = \@false
227                      \@setflag \@explicitsize = \@true}
228
229 \DeclareOption{12pt}{\@unsupportedoption{12pt}}
230
231 \DeclareOption{a4paper}{\@unsupportedoption{a4paper}}
232
233 \DeclareOption{a5paper}{\@unsupportedoption{a5paper}}
234
235 \DeclareOption{authoryear}{\@setflag \@authoryear = \@true}
236
237 \DeclareOption{b5paper}{\@unsupportedoption{b5paper}}
238
239 \DeclareOption{blockstyle}{\@setflag \@blockstyle = \@true}
240
241 \DeclareOption{cm}{\@setflag \@times = \@false}
242
243 \DeclareOption{computermodern}{\@setflag \@times = \@false}
244
245 \DeclareOption{executivepaper}{\@unsupportedoption{executivepaper}}
246
247 \DeclareOption{indentedstyle}{\@setflag \@blockstyle = \@false}
248
249 \DeclareOption{landscape}{\@unsupportedoption{landscape}}
250
251 \DeclareOption{legalpaper}{\@unsupportedoption{legalpaper}}
252
253 \DeclareOption{letterpaper}{\@unsupportedoption{letterpaper}}
254
255 \DeclareOption{mathtime}{\@setflag \@mathtime = \@true}
256
257 \DeclareOption{natbib}{\@setflag \@natbib = \@true}
258
259 \DeclareOption{nonatbib}{\@setflag \@natbib = \@false}
260
261 \DeclareOption{nocopyrightspace}{\@setflag \@copyrightwanted = \@false}
262
263 \DeclareOption{notitlepage}{\@unsupportedoption{notitlepage}}
264
265 \DeclareOption{numberedpars}{\@numheaddepth = 4}
266
267 \DeclareOption{numbers}{\@setflag \@authoryear = \@false}
268
269 %%%\DeclareOption{onecolumn}{\@setflag \@onecolumn = \@true}
270
271 \DeclareOption{preprint}{\@setflag \@preprint = \@true}
272
273 \DeclareOption{reprint}{\@setflag \@reprint = \@true}
274
275 \DeclareOption{times}{\@setflag \@times = \@true}
276
277 \DeclareOption{titlepage}{\@unsupportedoption{titlepage}}
278
279 \DeclareOption{twocolumn}{\@setflag \@onecolumn = \@false}
280
281 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
282
283 \ExecuteOptions{9pt,indentedstyle,times}
284 \@setflag \@explicitsize = \@false
285 \ProcessOptions
286
287 \if \@onecolumn
288   \if \@notp{\@explicitsize}%
289     \@setflag \@ninepoint = \@false
290     \PassOptionsToClass{11pt}{article}%
291   \fi
292   \PassOptionsToClass{twoside,onecolumn}{article}
293 \else
294   \PassOptionsToClass{twoside,twocolumn}{article}
295 \fi
296 \LoadClass{article}
297
298 \def \@unsupportedoption #1{%
299   \ClassError{proc}{The standard '#1' option is not supported.}}
300
301 % This can be used with the 'reprint' option to get the final folios.
302
303 \def \setpagenumber #1{%
304   \setcounter{page}{#1}}
305
306 \AtEndDocument{\label{sigplanconf@finalpage}}
307 \f
308 %                       Utilities
309 %                       ---------
310
311
312 \newcommand{\setvspace}[2]{%
313   #1 = #2
314   \advance #1 by -1\parskip}
315 \f
316 %                       Document Parameters
317 %                       -------- ----------
318
319
320 % Page:
321
322 \setlength{\hoffset}{-1in}
323 \setlength{\voffset}{-1in}
324
325 \setlength{\topmargin}{1in}
326 \setlength{\headheight}{0pt}
327 \setlength{\headsep}{0pt}
328
329 \if \@onecolumn
330   \setlength{\evensidemargin}{.75in}
331   \setlength{\oddsidemargin}{.75in}
332 \else
333   \setlength{\evensidemargin}{.75in}
334   \setlength{\oddsidemargin}{.75in}
335 \fi
336
337 % Text area:
338
339 \newdimen{\standardtextwidth}
340 \setlength{\standardtextwidth}{42pc}
341
342 \if \@onecolumn
343   \setlength{\textwidth}{40.5pc}
344 \else
345   \setlength{\textwidth}{\standardtextwidth}
346 \fi
347
348 \setlength{\topskip}{8pt}
349 \setlength{\columnsep}{2pc}
350 \setlength{\textheight}{54.5pc}
351
352 % Running foot:
353
354 \setlength{\footskip}{30pt}
355
356 % Paragraphs:
357
358 \if \@blockstyle
359   \setlength{\parskip}{5pt plus .1pt minus .5pt}
360   \setlength{\parindent}{0pt}
361 \else
362   \setlength{\parskip}{0pt}
363   \setlength{\parindent}{12pt}
364 \fi
365
366 \setlength{\lineskip}{.5pt}
367 \setlength{\lineskiplimit}{\lineskip}
368
369 \frenchspacing
370 \pretolerance = 400
371 \tolerance = \pretolerance
372 \setlength{\emergencystretch}{5pt}
373 \clubpenalty = 10000
374 \widowpenalty = 10000
375 \setlength{\hfuzz}{.5pt}
376
377 % Standard vertical spaces:
378
379 \newskip{\standardvspace}
380 \setvspace{\standardvspace}{5pt plus 1pt minus .5pt}
381
382 % Margin paragraphs:
383
384 \setlength{\marginparwidth}{36pt}
385 \setlength{\marginparsep}{2pt}
386 \setlength{\marginparpush}{8pt}
387
388
389 \setlength{\skip\footins}{8pt plus 3pt minus 1pt}
390 \setlength{\footnotesep}{9pt}
391
392 \renewcommand{\footnoterule}{%
393   \hrule width .5\columnwidth height .33pt depth 0pt}
394
395 \renewcommand{\@makefntext}[1]{%
396   \noindent \@makefnmark \hspace{1pt}#1}
397
398 % Floats:
399
400 \setcounter{topnumber}{4}
401 \setcounter{bottomnumber}{1}
402 \setcounter{totalnumber}{4}
403
404 \renewcommand{\fps@figure}{tp}
405 \renewcommand{\fps@table}{tp}
406 \renewcommand{\topfraction}{0.90}
407 \renewcommand{\bottomfraction}{0.30}
408 \renewcommand{\textfraction}{0.10}
409 \renewcommand{\floatpagefraction}{0.75}
410
411 \setcounter{dbltopnumber}{4}
412
413 \renewcommand{\dbltopfraction}{\topfraction}
414 \renewcommand{\dblfloatpagefraction}{\floatpagefraction}
415
416 \setlength{\floatsep}{18pt plus 4pt minus 2pt}
417 \setlength{\textfloatsep}{18pt plus 4pt minus 3pt}
418 \setlength{\intextsep}{10pt plus 4pt minus 3pt}
419
420 \setlength{\dblfloatsep}{18pt plus 4pt minus 2pt}
421 \setlength{\dbltextfloatsep}{20pt plus 4pt minus 3pt}
422
423 % Miscellaneous:
424
425 \errorcontextlines = 5
426 \f
427 %                       Fonts
428 %                       -----
429
430
431 \if \@times
432   \renewcommand{\rmdefault}{ptm}%
433   \if \@mathtime
434     \usepackage[mtbold,noTS1]{mathtime}%
435   \else
436 %%%    \usepackage{mathptm}%
437   \fi
438 \else
439   \relax
440 \fi
441
442 \if \@ninepoint
443
444 \renewcommand{\normalsize}{%
445   \@setfontsize{\normalsize}{9pt}{10pt}%
446   \setlength{\abovedisplayskip}{5pt plus 1pt minus .5pt}%
447   \setlength{\belowdisplayskip}{\abovedisplayskip}%
448   \setlength{\abovedisplayshortskip}{3pt plus 1pt minus 2pt}%
449   \setlength{\belowdisplayshortskip}{\abovedisplayshortskip}}
450
451 \renewcommand{\tiny}{\@setfontsize{\tiny}{5pt}{6pt}}
452
453 \renewcommand{\scriptsize}{\@setfontsize{\scriptsize}{7pt}{8pt}}
454
455 \renewcommand{\small}{%
456   \@setfontsize{\small}{8pt}{9pt}%
457   \setlength{\abovedisplayskip}{4pt plus 1pt minus 1pt}%
458   \setlength{\belowdisplayskip}{\abovedisplayskip}%
459   \setlength{\abovedisplayshortskip}{2pt plus 1pt}%
460   \setlength{\belowdisplayshortskip}{\abovedisplayshortskip}}
461
462 \renewcommand{\footnotesize}{%
463   \@setfontsize{\footnotesize}{8pt}{9pt}%
464   \setlength{\abovedisplayskip}{4pt plus 1pt minus .5pt}%
465   \setlength{\belowdisplayskip}{\abovedisplayskip}%
466   \setlength{\abovedisplayshortskip}{2pt plus 1pt}%
467   \setlength{\belowdisplayshortskip}{\abovedisplayshortskip}}
468
469 \renewcommand{\large}{\@setfontsize{\large}{11pt}{13pt}}
470
471 \renewcommand{\Large}{\@setfontsize{\Large}{14pt}{18pt}}
472
473 \renewcommand{\LARGE}{\@setfontsize{\LARGE}{18pt}{20pt}}
474
475 \renewcommand{\huge}{\@setfontsize{\huge}{20pt}{25pt}}
476
477 \renewcommand{\Huge}{\@setfontsize{\Huge}{25pt}{30pt}}
478
479 \else\if \@tenpoint
480
481 \relax
482
483 \else
484
485 \relax
486
487 \fi\fi
488 \f
489 %                       Abstract
490 %                       --------
491
492
493 \renewenvironment{abstract}{%
494   \section*{Abstract}%
495   \normalsize}{%
496   }
497 \f
498 %                       Bibliography
499 %                       ------------
500
501
502 \renewenvironment{thebibliography}[1]
503      {\section*{\refname
504         \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}}%
505       \list{\@biblabel{\@arabic\c@enumiv}}%
506            {\settowidth\labelwidth{\@biblabel{#1}}%
507             \leftmargin\labelwidth
508             \advance\leftmargin\labelsep
509             \@openbib@code
510             \usecounter{enumiv}%
511             \let\p@enumiv\@empty
512             \renewcommand\theenumiv{\@arabic\c@enumiv}}%
513       \bibfont
514       \clubpenalty4000
515       \@clubpenalty \clubpenalty
516       \widowpenalty4000%
517       \sfcode`\.\@m}
518      {\def\@noitemerr
519        {\@latex@warning{Empty `thebibliography' environment}}%
520       \endlist}
521
522 \if \@natbib
523
524 \if \@authoryear
525   \typeout{Using natbib package with 'authoryear' citation style.}
526   \usepackage[authoryear,square]{natbib}
527   \bibpunct{[}{]}{;}{a}{}{,}    % Change citation separator to semicolon,
528                                 % eliminate comma between author and year.
529   \let \cite = \citep
530 \else
531   \typeout{Using natbib package with 'numbers' citation style.}
532   \usepackage[numbers,sort&compress,square]{natbib}
533 \fi
534 \setlength{\bibsep}{3pt plus .5pt minus .25pt}
535
536 \fi
537
538 \def \bibfont {\small}
539 \f
540 %                       Categories
541 %                       ----------
542
543
544 \@setflag \@firstcategory = \@true
545
546 \newcommand{\category}[3]{%
547   \if \@firstcategory
548     \paragraph*{Categories and Subject Descriptors}%
549     \@setflag \@firstcategory = \@false
550   \else
551     \unskip ;\hspace{.75em}%
552   \fi
553   \@ifnextchar [{\@category{#1}{#2}{#3}}{\@category{#1}{#2}{#3}[]}}
554
555 \def \@category #1#2#3[#4]{%
556   {\let \and = \relax
557    #1 [\textit{#2}]%
558    \if \@emptyargp{#4}%
559      \if \@notp{\@emptyargp{#3}}: #3\fi
560    \else
561      :\space
562      \if \@notp{\@emptyargp{#3}}#3---\fi
563      \textrm{#4}%
564    \fi}}
565 \f
566 %                       Copyright Notice
567 %                       --------- ------
568
569
570 \def \ftype@copyrightbox {8}
571 \def \@toappear {}
572 \def \@permission {}
573 \def \@reprintprice {}
574
575 \def \@copyrightspace {%
576   \@float{copyrightbox}[b]%
577   \vbox to 1in{%
578     \vfill
579     \parbox[b]{20pc}{%
580       \scriptsize
581       \if \@preprint
582         [Copyright notice will appear here
583          once 'preprint' option is removed.]\par
584       \else
585         \@toappear
586       \fi
587       \if \@reprint
588         \noindent Reprinted from \@conferencename,
589         \@proceedings,
590         \@conferenceinfo,
591         pp.~\number\thepage--\pageref{sigplanconf@finalpage}.\par
592       \fi}}%
593   \end@float}
594
595 \long\def \toappear #1{%
596   \def \@toappear {#1}}
597
598 \toappear{%
599   \noindent \@permission \par
600   \vspace{2pt}
601   \noindent \textsl{\@conferencename}\quad \@conferenceinfo \par
602   \noindent Copyright \copyright\ \@copyrightyear\ ACM \@copyrightdata
603     \dots \@reprintprice\par}
604
605 \newcommand{\permission}[1]{%
606   \gdef \@permission {#1}}
607
608 \permission{%
609   Permission to make digital or hard copies of all or
610   part of this work for personal or classroom use is granted without
611   fee provided that copies are not made or distributed for profit or
612   commercial advantage and that copies bear this notice and the full
613   citation on the first page.  To copy otherwise, to republish, to
614   post on servers or to redistribute to lists, requires prior specific
615   permission and/or a fee.}
616
617 % Here we have some alternate permission statements and copyright lines:
618
619 \newcommand{\ACMCanadapermission}{%
620   \permission{%
621     Copyright \@copyrightyear\ Association for Computing Machinery.
622     ACM acknowledges that
623     this contribution was authored or co-authored by an affiliate of the
624     National Research Council of Canada (NRC).
625     As such, the Crown in Right of
626     Canada retains an equal interest in the copyright, however granting
627     nonexclusive, royalty-free right to publish or reproduce this article,
628     or to allow others to do so, provided that clear attribution
629     is also given to the authors and the NRC.}}
630
631 \newcommand{\ACMUSpermission}{%
632   \permission{%
633     Copyright \@copyrightyear\ Association for
634     Computing Machinery. ACM acknowledges that
635     this contribution was authored or co-authored
636     by a contractor or affiliate
637     of the U.S. Government. As such, the Government retains a nonexclusive,
638     royalty-free right to publish or reproduce this article,
639     or to allow others to do so, for Government purposes only.}}
640
641 \newcommand{\authorpermission}{%
642   \permission{%
643     Copyright is held by the author/owner(s).}
644   \toappear{%
645     \noindent \@permission \par
646     \vspace{2pt}
647     \noindent \textsl{\@conferencename}\quad \@conferenceinfo \par
648     ACM \@copyrightdata.}}
649
650 \newcommand{\Sunpermission}{%
651   \permission{%
652     Copyright is held by Sun Microsystems, Inc.}%
653   \toappear{%
654     \noindent \@permission \par
655     \vspace{2pt}
656     \noindent \textsl{\@conferencename}\quad \@conferenceinfo \par
657     ACM \@copyrightdata.}}
658
659 \newcommand{\USpublicpermission}{%
660   \permission{%
661     This paper is authored by an employee(s) of the United States
662     Government and is in the public domain.}%
663   \toappear{%
664     \noindent \@permission \par
665     \vspace{2pt}
666     \noindent \textsl{\@conferencename}\quad \@conferenceinfo \par
667     ACM \@copyrightdata.}}
668
669 \newcommand{\reprintprice}[1]{%
670   \gdef \@reprintprice {#1}}
671
672 \reprintprice{\$10.00}
673
674 \newcommand{\authorversion}[4]{%
675   \permission{%
676   Copyright \copyright\ ACM, #1. This is the author's version of the work.
677   It is posted here by permission of ACM for your personal use.
678   Not for redistribution. The definitive version was published in
679   #2, #3, http://doi.acm.org/10.1145/#4.}}
680 \f
681 %                       Enunciations
682 %                       ------------
683
684
685 \def \@begintheorem #1#2{%                      {name}{number}
686   \trivlist
687   \item[\hskip \labelsep \textsc{#1 #2.}]%
688   \itshape\selectfont
689   \ignorespaces}
690
691 \def \@opargbegintheorem #1#2#3{%               {name}{number}{title}
692   \trivlist
693   \item[%
694     \hskip\labelsep \textsc{#1\ #2}%
695     \if \@notp{\@emptyargp{#3}}\nut (#3).\fi]%
696   \itshape\selectfont
697   \ignorespaces}
698 \f
699 %                       Figures
700 %                       -------
701
702
703 \@setflag \@caprule = \@true
704
705 \long\def \@makecaption #1#2{%
706   \addvspace{4pt}
707   \if \@caprule
708     \hrule width \hsize height .33pt
709     \vspace{4pt}
710   \fi
711   \setbox \@tempboxa = \hbox{\@setfigurenumber{#1.}\nut #2}%
712   \if \@dimgtrp{\wd\@tempboxa}{\hsize}%
713     \noindent \@setfigurenumber{#1.}\nut #2\par
714   \else
715     \centerline{\box\@tempboxa}%
716   \fi}
717
718 \newcommand{\nocaptionrule}{%
719   \@setflag \@caprule = \@false}
720
721 \def \@setfigurenumber #1{%
722   {\rmfamily \bfseries \selectfont #1}}
723 \f
724 %                       Hierarchy
725 %                       ---------
726
727
728 \setcounter{secnumdepth}{\@numheaddepth}
729
730 \newskip{\@sectionaboveskip}
731 \setvspace{\@sectionaboveskip}{10pt plus 3pt minus 2pt}
732
733 \newskip{\@sectionbelowskip}
734 \if \@blockstyle
735   \setlength{\@sectionbelowskip}{0.1pt}%
736 \else
737   \setlength{\@sectionbelowskip}{4pt}%
738 \fi
739
740 \renewcommand{\section}{%
741   \@startsection
742     {section}%
743     {1}%
744     {0pt}%
745     {-\@sectionaboveskip}%
746     {\@sectionbelowskip}%
747     {\large \bfseries \raggedright}}
748
749 \newskip{\@subsectionaboveskip}
750 \setvspace{\@subsectionaboveskip}{8pt plus 2pt minus 2pt}
751
752 \newskip{\@subsectionbelowskip}
753 \if \@blockstyle
754   \setlength{\@subsectionbelowskip}{0.1pt}%
755 \else
756   \setlength{\@subsectionbelowskip}{4pt}%
757 \fi
758
759 \renewcommand{\subsection}{%
760   \@startsection%
761     {subsection}%
762     {2}%
763     {0pt}%
764     {-\@subsectionaboveskip}%
765     {\@subsectionbelowskip}%
766     {\normalsize \bfseries \raggedright}}
767
768 \renewcommand{\subsubsection}{%
769   \@startsection%
770     {subsubsection}%
771     {3}%
772     {0pt}%
773     {-\@subsectionaboveskip}
774     {\@subsectionbelowskip}%
775     {\normalsize \bfseries \raggedright}}
776
777 \newskip{\@paragraphaboveskip}
778 \setvspace{\@paragraphaboveskip}{6pt plus 2pt minus 2pt}
779
780 \renewcommand{\paragraph}{%
781   \@startsection%
782     {paragraph}%
783     {4}%
784     {0pt}%
785     {\@paragraphaboveskip}
786     {-1em}%
787     {\normalsize \bfseries \if \@times \itshape \fi}}
788
789 \renewcommand{\subparagraph}{%
790   \@startsection%
791     {subparagraph}%
792     {4}%
793     {0pt}%
794     {\@paragraphaboveskip}
795     {-1em}%
796     {\normalsize \itshape}}
797
798 % Standard headings:
799
800 \newcommand{\acks}{\section*{Acknowledgments}}
801
802 \newcommand{\keywords}{\paragraph*{Keywords}}
803
804 \newcommand{\terms}{\paragraph*{General Terms}}
805 \f
806 %                       Identification
807 %                       --------------
808
809
810 \def \@conferencename {}
811 \def \@conferenceinfo {}
812 \def \@copyrightyear {}
813 \def \@copyrightdata {[to be supplied]}
814 \def \@proceedings {[Unknown Proceedings]}
815
816
817 \newcommand{\conferenceinfo}[2]{%
818   \gdef \@conferencename {#1}%
819   \gdef \@conferenceinfo {#2}}
820
821 \newcommand{\copyrightyear}[1]{%
822   \gdef \@copyrightyear {#1}}
823
824 \let \CopyrightYear = \copyrightyear
825
826 \newcommand{\copyrightdata}[1]{%
827   \gdef \@copyrightdata {#1}}
828
829 \let \crdata = \copyrightdata
830
831 \newcommand{\proceedings}[1]{%
832   \gdef \@proceedings {#1}}
833 \f
834 %                       Lists
835 %                       -----
836
837
838 \setlength{\leftmargini}{13pt}
839 \setlength\leftmarginii{13pt}
840 \setlength\leftmarginiii{13pt}
841 \setlength\leftmarginiv{13pt}
842 \setlength{\labelsep}{3.5pt}
843
844 \setlength{\topsep}{\standardvspace}
845 \if \@blockstyle
846   \setlength{\itemsep}{1pt}
847   \setlength{\parsep}{3pt}
848 \else
849   \setlength{\itemsep}{1pt}
850   \setlength{\parsep}{3pt}
851 \fi
852
853 \renewcommand{\labelitemi}{{\small \centeroncapheight{\textbullet}}}
854 \renewcommand{\labelitemii}{\centeroncapheight{\rule{2.5pt}{2.5pt}}}
855 \renewcommand{\labelitemiii}{$-$}
856 \renewcommand{\labelitemiv}{{\Large \textperiodcentered}}
857
858 \renewcommand{\@listi}{%
859   \leftmargin = \leftmargini
860   \listparindent = 0pt}
861 %%%  \itemsep = 1pt
862 %%%  \parsep = 3pt}
863 %%%  \listparindent = \parindent}
864
865 \let \@listI = \@listi
866
867 \renewcommand{\@listii}{%
868   \leftmargin = \leftmarginii
869   \topsep = 1pt
870   \labelwidth = \leftmarginii
871   \advance \labelwidth by -\labelsep
872   \listparindent = \parindent}
873
874 \renewcommand{\@listiii}{%
875   \leftmargin = \leftmarginiii
876   \labelwidth = \leftmarginiii
877   \advance \labelwidth by -\labelsep
878   \listparindent = \parindent}
879
880 \renewcommand{\@listiv}{%
881   \leftmargin = \leftmarginiv
882   \labelwidth = \leftmarginiv
883   \advance \labelwidth by -\labelsep
884   \listparindent = \parindent}
885 \f
886 %                       Mathematics
887 %                       -----------
888
889
890 \def \theequation {\arabic{equation}}
891 \f
892 %                       Miscellaneous
893 %                       -------------
894
895
896 \newcommand{\balancecolumns}{%
897   \vfill\eject
898   \global\@colht = \textheight
899   \global\ht\@cclv = \textheight}
900
901 \newcommand{\nut}{\hspace{.5em}}
902
903 \newcommand{\softraggedright}{%
904   \let \\ = \@centercr
905   \leftskip = 0pt
906   \rightskip = 0pt plus 10pt}
907 \f
908 %                       Program Code
909 %                       ------- ----
910
911
912 \newcommand{\mono}[1]{%
913   {\@tempdima = \fontdimen2\font
914    \texttt{\spaceskip = 1.1\@tempdima #1}}}
915 \f
916 %                       Running Heads and Feet
917 %                       ------- ----- --- ----
918
919
920 \def \@preprintfooter {}
921
922 \newcommand{\preprintfooter}[1]{%
923   \gdef \@preprintfooter {#1}}
924
925 \if \@preprint
926
927 \def \ps@plain {%
928   \let \@mkboth = \@gobbletwo
929   \let \@evenhead = \@empty
930   \def \@evenfoot {\scriptsize
931                    \rlap{\textit{\@preprintfooter}}\hfil
932                    \thepage \hfil
933                    \llap{\textit{\@formatyear}}}%
934   \let \@oddhead = \@empty
935   \let \@oddfoot = \@evenfoot}
936
937 \else\if \@reprint
938
939 \def \ps@plain {%
940   \let \@mkboth = \@gobbletwo
941   \let \@evenhead = \@empty
942   \def \@evenfoot {\scriptsize \hfil \thepage \hfil}%
943   \let \@oddhead = \@empty
944   \let \@oddfoot = \@evenfoot}
945
946 \else
947
948 \let \ps@plain = \ps@empty
949 \let \ps@headings = \ps@empty
950 \let \ps@myheadings = \ps@empty
951
952 \fi\fi
953
954 \def \@formatyear {%
955   \number\year/\number\month/\number\day}
956 \f
957 %                       Special Characters
958 %                       ------- ----------
959
960
961 \DeclareRobustCommand{\euro}{%
962   \protect{\rlap{=}}{\sf \kern .1em C}}
963 \f
964 %                       Title Page
965 %                       ----- ----
966
967
968 \@setflag \@addauthorsdone = \@false
969
970 \def \@titletext {\@latex@error{No title was provided}{}}
971 \def \@subtitletext {}
972
973 \newcount{\@authorcount}
974
975 \newcount{\@titlenotecount}
976 \newtoks{\@titlenotetext}
977
978 \def \@titlebanner {}
979
980 \renewcommand{\title}[1]{%
981   \gdef \@titletext {#1}}
982
983 \newcommand{\subtitle}[1]{%
984   \gdef \@subtitletext {#1}}
985
986 \newcommand{\authorinfo}[3]{%           {names}{affiliation}{email/URL}
987   \global\@increment \@authorcount
988   \@withname\gdef {\@authorname\romannumeral\@authorcount}{#1}%
989   \@withname\gdef {\@authoraffil\romannumeral\@authorcount}{#2}%
990   \@withname\gdef {\@authoremail\romannumeral\@authorcount}{#3}}
991
992 \renewcommand{\author}[1]{%
993   \@latex@error{The \string\author\space command is obsolete;
994                 use \string\authorinfo}{}}
995
996 \newcommand{\titlebanner}[1]{%
997   \gdef \@titlebanner {#1}}
998
999 \renewcommand{\maketitle}{%
1000   \pagestyle{plain}%
1001   \if \@onecolumn
1002     {\hsize = \standardtextwidth
1003      \@maketitle}%
1004   \else
1005     \twocolumn[\@maketitle]%
1006   \fi
1007   \@placetitlenotes
1008   \if \@copyrightwanted \@copyrightspace \fi}
1009
1010 \def \@maketitle {%
1011   \begin{center}
1012   \@settitlebanner
1013   \let \thanks = \titlenote
1014   {\leftskip = 0pt plus 0.25\linewidth
1015    \rightskip = 0pt plus 0.25 \linewidth
1016    \parfillskip = 0pt
1017    \spaceskip = .7em
1018    \noindent \LARGE \bfseries \@titletext \par}
1019   \vskip 6pt
1020   \noindent \Large \@subtitletext \par
1021   \vskip 12pt
1022   \ifcase \@authorcount
1023     \@latex@error{No authors were specified for this paper}{}\or
1024     \@titleauthors{i}{}{}\or
1025     \@titleauthors{i}{ii}{}\or
1026     \@titleauthors{i}{ii}{iii}\or
1027     \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{}{}\or
1028     \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{}\or
1029     \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{vi}\or
1030     \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{vi}%
1031                   \@titleauthors{vii}{}{}\or
1032     \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{vi}%
1033                   \@titleauthors{vii}{viii}{}\or
1034     \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{vi}%
1035                   \@titleauthors{vii}{viii}{ix}\or
1036     \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{vi}%
1037                   \@titleauthors{vii}{viii}{ix}\@titleauthors{x}{}{}\or
1038     \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{vi}%
1039                   \@titleauthors{vii}{viii}{ix}\@titleauthors{x}{xi}{}\or
1040     \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{vi}%
1041                   \@titleauthors{vii}{viii}{ix}\@titleauthors{x}{xi}{xii}%
1042   \else
1043     \@latex@error{Cannot handle more than 12 authors}{}%
1044   \fi
1045   \vspace{1.75pc}
1046   \end{center}}
1047
1048 \def \@settitlebanner {%
1049   \if \@andp{\@preprint}{\@notp{\@emptydefp{\@titlebanner}}}%
1050     \vbox to 0pt{%
1051       \vskip -32pt
1052       \noindent \textbf{\@titlebanner}\par
1053       \vss}%
1054     \nointerlineskip
1055   \fi}
1056
1057 \def \@titleauthors #1#2#3{%
1058   \if \@andp{\@emptyargp{#2}}{\@emptyargp{#3}}%
1059     \noindent \@setauthor{40pc}{#1}{\@false}\par
1060   \else\if \@emptyargp{#3}%
1061     \noindent \@setauthor{17pc}{#1}{\@false}\hspace{3pc}%
1062               \@setauthor{17pc}{#2}{\@false}\par
1063   \else
1064     \noindent \@setauthor{12.5pc}{#1}{\@false}\hspace{2pc}%
1065               \@setauthor{12.5pc}{#2}{\@false}\hspace{2pc}%
1066               \@setauthor{12.5pc}{#3}{\@true}\par
1067     \relax
1068   \fi\fi
1069   \vspace{20pt}}
1070
1071 \def \@setauthor #1#2#3{%                       {width}{text}{unused}
1072   \vtop{%
1073     \def \and {%
1074       \hspace{16pt}}
1075     \hsize = #1
1076     \normalfont
1077     \centering
1078     \large \@name{\@authorname#2}\par
1079     \vspace{5pt}
1080     \normalsize \@name{\@authoraffil#2}\par
1081     \vspace{2pt}
1082     \textsf{\@name{\@authoremail#2}}\par}}
1083
1084 \def \@maybetitlenote #1{%
1085   \if \@andp{#1}{\@gtrp{\@authorcount}{3}}%
1086     \titlenote{See page~\pageref{@addauthors} for additional authors.}%
1087   \fi}
1088
1089 \newtoks{\@fnmark}
1090
1091 \newcommand{\titlenote}[1]{%
1092   \global\@increment \@titlenotecount
1093   \ifcase \@titlenotecount \relax \or
1094     \@fnmark = {\ast}\or
1095     \@fnmark = {\dagger}\or
1096     \@fnmark = {\ddagger}\or
1097     \@fnmark = {\S}\or
1098     \@fnmark = {\P}\or
1099     \@fnmark = {\ast\ast}%
1100   \fi
1101   \,$^{\the\@fnmark}$%
1102   \edef \reserved@a {\noexpand\@appendtotext{%
1103                        \noexpand\@titlefootnote{\the\@fnmark}}}%
1104   \reserved@a{#1}}
1105
1106 \def \@appendtotext #1#2{%
1107   \global\@titlenotetext = \expandafter{\the\@titlenotetext #1{#2}}}
1108
1109 \newcount{\@authori}
1110
1111 \iffalse
1112 \def \additionalauthors {%
1113   \if \@gtrp{\@authorcount}{3}%
1114     \section{Additional Authors}%
1115     \label{@addauthors}%
1116     \noindent
1117     \@authori = 4
1118     {\let \\ = ,%
1119      \loop 
1120        \textbf{\@name{\@authorname\romannumeral\@authori}},
1121        \@name{\@authoraffil\romannumeral\@authori},
1122        email: \@name{\@authoremail\romannumeral\@authori}.%
1123        \@increment \@authori
1124      \if \@notp{\@gtrp{\@authori}{\@authorcount}} \repeat}%
1125     \par
1126   \fi
1127   \global\@setflag \@addauthorsdone = \@true}
1128 \fi
1129
1130 \let \addauthorsection = \additionalauthors
1131
1132 \def \@placetitlenotes {
1133   \the\@titlenotetext}
1134 \f
1135 %                       Utilities
1136 %                       ---------
1137
1138
1139 \newcommand{\centeroncapheight}[1]{%
1140   {\setbox\@tempboxa = \hbox{#1}%
1141    \@measurecapheight{\@tempdima}%         % Calculate ht(CAP) - ht(text)
1142    \advance \@tempdima by -\ht\@tempboxa   %           ------------------
1143    \divide \@tempdima by 2                 %                   2
1144    \raise \@tempdima \box\@tempboxa}}
1145
1146 \newbox{\@measbox}
1147
1148 \def \@measurecapheight #1{%                            {\dimen}
1149   \setbox\@measbox = \hbox{ABCDEFGHIJKLMNOPQRSTUVWXYZ}%
1150   #1 = \ht\@measbox}
1151
1152 \long\def \@titlefootnote #1#2{%
1153   \insert\footins{%
1154     \reset@font\footnotesize
1155     \interlinepenalty\interfootnotelinepenalty
1156     \splittopskip\footnotesep
1157     \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
1158     \hsize\columnwidth \@parboxrestore
1159 %%%    \protected@edef\@currentlabel{%
1160 %%%       \csname p@footnote\endcsname\@thefnmark}%
1161     \color@begingroup
1162       \def \@makefnmark {$^{#1}$}%
1163       \@makefntext{%
1164         \rule\z@\footnotesep\ignorespaces#2\@finalstrut\strutbox}%
1165     \color@endgroup}}
1166 \f
1167 %                       LaTeX Modifications
1168 %                       ----- -------------
1169
1170 \def \@seccntformat #1{%
1171   \@name{\the#1}%
1172   \@expandaftertwice\@seccntformata \csname the#1\endcsname.\@mark
1173   \quad}
1174
1175 \def \@seccntformata #1.#2\@mark{%
1176   \if \@emptyargp{#2}.\fi}
1177 \f
1178 %                       Revision History
1179 %                       -------- -------
1180
1181
1182 %  Date         Person  Ver.    Change
1183 %  ----         ------  ----    ------
1184
1185 %  2004.09.12   PCA     0.1--5  Preliminary development.
1186
1187 %  2004.11.18   PCA     0.5     Start beta testing.
1188
1189 %  2004.11.19   PCA     0.6     Obsolete \author and replace with
1190 %                               \authorinfo.
1191 %                               Add 'nocopyrightspace' option.
1192 %                               Compress article opener spacing.
1193 %                               Add 'mathtime' option.
1194 %                               Increase text height by 6 points.
1195
1196 %  2004.11.28   PCA     0.7     Add 'cm/computermodern' options.
1197 %                               Change default to Times text.
1198
1199 %  2004.12.14   PCA     0.8     Remove use of mathptm.sty; it cannot
1200 %                               coexist with latexsym or amssymb.
1201
1202 %  2005.01.20   PCA     0.9     Rename class file to sigplanconf.cls.
1203
1204 %  2005.03.05   PCA     0.91    Change default copyright data.
1205
1206 %  2005.03.06   PCA     0.92    Add at-signs to some macro names.
1207
1208 %  2005.03.07   PCA     0.93    The 'onecolumn' option defaults to '11pt',
1209 %                               and it uses the full type width.
1210
1211 %  2005.03.15   PCA     0.94    Add at-signs to more macro names.
1212 %                               Allow margin paragraphs during review.
1213
1214 %  2005.03.22   PCA     0.95    Implement \euro.
1215 %                               Remove proof and newdef environments.
1216
1217 %  2005.05.06   PCA     1.0     Eliminate 'onecolumn' option.
1218 %                               Change footer to small italic and eliminate
1219 %                               left portion if no \preprintfooter.
1220 %                               Eliminate copyright notice if preprint.
1221 %                               Clean up and shrink copyright box.
1222
1223 %  2005.05.30   PCA     1.1     Add alternate permission statements.
1224
1225 %  2005.06.29   PCA     1.1     Publish final first edition of guide.
1226
1227 %  2005.07.14   PCA     1.2     Add \subparagraph.
1228 %                               Use block paragraphs in lists, and adjust
1229 %                               spacing between items and paragraphs.
1230
1231 %  2006.06.22   PCA     1.3     Add 'reprint' option and associated
1232 %                               commands.
1233
1234 %  2006.08.24   PCA     1.4     Fix bug in \maketitle case command.
1235
1236 %  2007.03.13   PCA     1.5     The title banner only displays with the
1237 %                               'preprint' option.
1238
1239 %  2007.06.06   PCA     1.6     Use \bibfont in \thebibliography.
1240 %                               Add 'natbib' option to load and configure
1241 %                                 the natbib package.
1242
1243 %  2007.11.20   PCA     1.7     Balance line lengths in centered article
1244 %                                 title (thanks to Norman Ramsey).
1245
1246 %  2009.01.26   PCA     1.8     Change natbib \bibpunct values.
1247
1248 %  2009.03.24   PCA     1.9     Change natbib to use the 'numbers' option.
1249 %                               Change templates to use 'natbib' option.
1250
1251 %  2009.09.01   PCA     2.0     Add \reprintprice command (suggested by
1252 %                                 Stephen Chong).
1253
1254 %  2009.09.08   PCA     2.1     Make 'natbib' the default; add 'nonatbib'.
1255 %               SB              Add 'authoryear' and 'numbers' (default) to
1256 %                               control citation style when using natbib.
1257 %                               Add \bibpunct to change punctuation for
1258 %                               'authoryear' style.
1259
1260 %  2009.09.21   PCA     2.2     Add \softraggedright to the thebibliography
1261 %                               environment. Also add to template so it will
1262 %                               happen with natbib.
1263
1264 %  2009.09.30   PCA     2.3     Remove \softraggedright from thebibliography.  
1265 %                               Just include in the template.
1266
1267 %  2010.05.24   PCA     2.4     Obfuscate author's email address.
1268
1269 %  2011.11.08   PCA     2.5     Add copyright notice to this file.
1270 %                               Remove 'sort' option from natbib when using
1271 %                                 'authoryear' style.
1272 %                               Add the \authorversion command.