r1345@opsdev009 (orig r71137): mcslee | 2007-11-21 15:35:52 -0800
[amiethrift.git] / doc / sigplanconf.cls
blobd26f89f5ee7590b799d023f4ebb31f195280debe
1 %-----------------------------------------------------------------------------
3 % LaTeX Class/Style File
5 % Name: sigplanconf.cls
6 % Purpose: A LaTeX 2e class file for SIGPLAN conference proceedings.
7 % This class file supercedes acm_proc_article-sp,
8 % sig-alternate, and sigplan-proc.
10 % Author: Paul C. Anagnostopoulos
11 % Windfall Software
12 % 978 371-2316
13 % paul@windfall.com
15 % Created: 12 September 2004
17 % Revisions: See end of file.
19 %-----------------------------------------------------------------------------
22 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
23 \ProvidesClass{sigplanconf}[2007/03/13 v1.5 ACM SIGPLAN Proceedings]
25 % The following few pages contain LaTeX programming extensions adapted
26 % from the ZzTeX macro package.
28 % Token Hackery
29 % ----- -------
32 \def \@expandaftertwice {\expandafter\expandafter\expandafter}
33 \def \@expandafterthrice {\expandafter\expandafter\expandafter\expandafter
34 \expandafter\expandafter\expandafter}
36 % This macro discards the next token.
38 \def \@discardtok #1{}% token
40 % This macro removes the `pt' following a dimension.
42 {\catcode `\p = 12 \catcode `\t = 12
44 \gdef \@remover #1pt{#1}
46 } % \catcode
48 % This macro extracts the contents of a macro and returns it as plain text.
49 % Usage: \expandafter\@defof \meaning\macro\@mark
51 \def \@defof #1:->#2\@mark{#2}
53 % Control Sequence Names
54 % ------- -------- -----
57 \def \@name #1{% {\tokens}
58 \csname \expandafter\@discardtok \string#1\endcsname}
60 \def \@withname #1#2{% {\command}{\tokens}
61 \expandafter#1\csname \expandafter\@discardtok \string#2\endcsname}
63 % Flags (Booleans)
64 % ----- ----------
66 % The boolean literals \@true and \@false are appropriate for use with
67 % the \if command, which tests the codes of the next two characters.
69 \def \@true {TT}
70 \def \@false {FL}
72 \def \@setflag #1=#2{\edef #1{#2}}% \flag = boolean
74 % IF and Predicates
75 % -- --- ----------
77 % A "predicate" is a macro that returns \@true or \@false as its value.
78 % Such values are suitable for use with the \if conditional. For example:
80 % \if \@oddp{\x} <then-clause> \else <else-clause> \fi
82 % A predicate can be used with \@setflag as follows:
84 % \@setflag \flag = {<predicate>}
86 % Here are the predicates for TeX's repertoire of conditional
87 % commands. These might be more appropriately interspersed with
88 % other definitions in this module, but what the heck.
89 % Some additional "obvious" predicates are defined.
91 \def \@eqlp #1#2{\ifnum #1 = #2\@true \else \@false \fi}
92 \def \@neqlp #1#2{\ifnum #1 = #2\@false \else \@true \fi}
93 \def \@lssp #1#2{\ifnum #1 < #2\@true \else \@false \fi}
94 \def \@gtrp #1#2{\ifnum #1 > #2\@true \else \@false \fi}
95 \def \@zerop #1{\ifnum #1 = 0\@true \else \@false \fi}
96 \def \@onep #1{\ifnum #1 = 1\@true \else \@false \fi}
97 \def \@posp #1{\ifnum #1 > 0\@true \else \@false \fi}
98 \def \@negp #1{\ifnum #1 < 0\@true \else \@false \fi}
99 \def \@oddp #1{\ifodd #1\@true \else \@false \fi}
100 \def \@evenp #1{\ifodd #1\@false \else \@true \fi}
101 \def \@rangep #1#2#3{\if \@orp{\@lssp{#1}{#2}}{\@gtrp{#1}{#3}}\@false \else
102 \@true \fi}
103 \def \@tensp #1{\@rangep{#1}{10}{19}}
105 \def \@dimeqlp #1#2{\ifdim #1 = #2\@true \else \@false \fi}
106 \def \@dimneqlp #1#2{\ifdim #1 = #2\@false \else \@true \fi}
107 \def \@dimlssp #1#2{\ifdim #1 < #2\@true \else \@false \fi}
108 \def \@dimgtrp #1#2{\ifdim #1 > #2\@true \else \@false \fi}
109 \def \@dimzerop #1{\ifdim #1 = 0pt\@true \else \@false \fi}
110 \def \@dimposp #1{\ifdim #1 > 0pt\@true \else \@false \fi}
111 \def \@dimnegp #1{\ifdim #1 < 0pt\@true \else \@false \fi}
113 \def \@vmodep {\ifvmode \@true \else \@false \fi}
114 \def \@hmodep {\ifhmode \@true \else \@false \fi}
115 \def \@mathmodep {\ifmmode \@true \else \@false \fi}
116 \def \@textmodep {\ifmmode \@false \else \@true \fi}
117 \def \@innermodep {\ifinner \@true \else \@false \fi}
119 \long\def \@codeeqlp #1#2{\if #1#2\@true \else \@false \fi}
121 \long\def \@cateqlp #1#2{\ifcat #1#2\@true \else \@false \fi}
123 \long\def \@tokeqlp #1#2{\ifx #1#2\@true \else \@false \fi}
124 \long\def \@xtokeqlp #1#2{\expandafter\ifx #1#2\@true \else \@false \fi}
126 \long\def \@definedp #1{%
127 \expandafter\ifx \csname \expandafter\@discardtok \string#1\endcsname
128 \relax \@false \else \@true \fi}
130 \long\def \@undefinedp #1{%
131 \expandafter\ifx \csname \expandafter\@discardtok \string#1\endcsname
132 \relax \@true \else \@false \fi}
134 \def \@emptydefp #1{\ifx #1\@empty \@true \else \@false \fi}% {\name}
136 \let \@emptylistp = \@emptydefp
138 \long\def \@emptyargp #1{% {#n}
139 \@empargp #1\@empargq\@mark}
140 \long\def \@empargp #1#2\@mark{%
141 \ifx #1\@empargq \@true \else \@false \fi}
142 \def \@empargq {\@empargq}
144 \def \@emptytoksp #1{% {\tokenreg}
145 \expandafter\@emptoksp \the#1\@mark}
147 \long\def \@emptoksp #1\@mark{\@emptyargp{#1}}
149 \def \@voidboxp #1{\ifvoid #1\@true \else \@false \fi}
150 \def \@hboxp #1{\ifhbox #1\@true \else \@false \fi}
151 \def \@vboxp #1{\ifvbox #1\@true \else \@false \fi}
153 \def \@eofp #1{\ifeof #1\@true \else \@false \fi}
156 % Flags can also be used as predicates, as in:
158 % \if \flaga <then-clause> \else <else-clause> \fi
161 % Now here we have predicates for the common logical operators.
163 \def \@notp #1{\if #1\@false \else \@true \fi}
165 \def \@andp #1#2{\if #1%
166 \if #2\@true \else \@false \fi
167 \else
168 \@false
169 \fi}
171 \def \@orp #1#2{\if #1%
172 \@true
173 \else
174 \if #2\@true \else \@false \fi
175 \fi}
177 \def \@xorp #1#2{\if #1%
178 \if #2\@false \else \@true \fi
179 \else
180 \if #2\@true \else \@false \fi
181 \fi}
183 % Arithmetic
184 % ----------
186 \def \@increment #1{\advance #1 by 1\relax}% {\count}
188 \def \@decrement #1{\advance #1 by -1\relax}% {\count}
190 % Options
191 % -------
194 \@setflag \@blockstyle = \@false
195 \@setflag \@copyrightwanted = \@true
196 \@setflag \@explicitsize = \@false
197 \@setflag \@mathtime = \@false
198 \@setflag \@ninepoint = \@true
199 \newcount{\@numheaddepth} \@numheaddepth = 3
200 \@setflag \@onecolumn = \@false
201 \@setflag \@preprint = \@false
202 \@setflag \@reprint = \@false
203 \@setflag \@times = \@false
205 % Note that all the dangerous article class options are trapped.
207 \DeclareOption{9pt}{\@setflag \@ninepoint = \@true
208 \@setflag \@explicitsize = \@true}
210 \DeclareOption{10pt}{\PassOptionsToClass{10pt}{article}%
211 \@setflag \@ninepoint = \@false
212 \@setflag \@explicitsize = \@true}
214 \DeclareOption{11pt}{\PassOptionsToClass{11pt}{article}%
215 \@setflag \@ninepoint = \@false
216 \@setflag \@explicitsize = \@true}
218 \DeclareOption{12pt}{\@unsupportedoption{12pt}}
220 \DeclareOption{a4paper}{\@unsupportedoption{a4paper}}
222 \DeclareOption{a5paper}{\@unsupportedoption{a5paper}}
224 \DeclareOption{b5paper}{\@unsupportedoption{b5paper}}
226 \DeclareOption{blockstyle}{\@setflag \@blockstyle = \@true}
228 \DeclareOption{cm}{\@setflag \@times = \@false}
230 \DeclareOption{computermodern}{\@setflag \@times = \@false}
232 \DeclareOption{executivepaper}{\@unsupportedoption{executivepaper}}
234 \DeclareOption{indentedstyle}{\@setflag \@blockstyle = \@false}
236 \DeclareOption{landscape}{\@unsupportedoption{landscape}}
238 \DeclareOption{legalpaper}{\@unsupportedoption{legalpaper}}
240 \DeclareOption{letterpaper}{\@unsupportedoption{letterpaper}}
242 \DeclareOption{mathtime}{\@setflag \@mathtime = \@true}
244 \DeclareOption{nocopyrightspace}{\@setflag \@copyrightwanted = \@false}
246 \DeclareOption{notitlepage}{\@unsupportedoption{notitlepage}}
248 \DeclareOption{numberedpars}{\@numheaddepth = 4}
250 %%%\DeclareOption{onecolumn}{\@setflag \@onecolumn = \@true}
252 \DeclareOption{preprint}{\@setflag \@preprint = \@true}
254 \DeclareOption{reprint}{\@setflag \@reprint = \@true}
256 \DeclareOption{times}{\@setflag \@times = \@true}
258 \DeclareOption{titlepage}{\@unsupportedoption{titlepage}}
260 \DeclareOption{twocolumn}{\@setflag \@onecolumn = \@false}
262 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
264 \ExecuteOptions{9pt,indentedstyle,times}
265 \@setflag \@explicitsize = \@false
266 \ProcessOptions
268 \if \@onecolumn
269 \if \@notp{\@explicitsize}%
270 \@setflag \@ninepoint = \@false
271 \PassOptionsToClass{11pt}{article}%
273 \PassOptionsToClass{twoside,onecolumn}{article}
274 \else
275 \PassOptionsToClass{twoside,twocolumn}{article}
277 \LoadClass{article}
279 \def \@unsupportedoption #1{%
280 \ClassError{proc}{The standard '#1' option is not supported.}}
282 % This can be used with the 'reprint' option to get the final folios.
284 \def \setpagenumber #1{%
285 \setcounter{page}{#1}}
287 \AtEndDocument{\label{sigplanconf@finalpage}}
289 % Utilities
290 % ---------
293 \newcommand{\setvspace}[2]{%
294 #1 = #2
295 \advance #1 by -1\parskip}
297 % Document Parameters
298 % -------- ----------
301 % Page:
303 \setlength{\hoffset}{-1in}
304 \setlength{\voffset}{-1in}
306 \setlength{\topmargin}{1in}
307 \setlength{\headheight}{0pt}
308 \setlength{\headsep}{0pt}
310 \if \@onecolumn
311 \setlength{\evensidemargin}{.75in}
312 \setlength{\oddsidemargin}{.75in}
313 \else
314 \setlength{\evensidemargin}{.75in}
315 \setlength{\oddsidemargin}{.75in}
318 % Text area:
320 \newdimen{\standardtextwidth}
321 \setlength{\standardtextwidth}{42pc}
323 \if \@onecolumn
324 \setlength{\textwidth}{40.5pc}
325 \else
326 \setlength{\textwidth}{\standardtextwidth}
329 \setlength{\topskip}{8pt}
330 \setlength{\columnsep}{2pc}
331 \setlength{\textheight}{54.5pc}
333 % Running foot:
335 \setlength{\footskip}{30pt}
337 % Paragraphs:
339 \if \@blockstyle
340 \setlength{\parskip}{5pt plus .1pt minus .5pt}
341 \setlength{\parindent}{0pt}
342 \else
343 \setlength{\parskip}{0pt}
344 \setlength{\parindent}{12pt}
347 \setlength{\lineskip}{.5pt}
348 \setlength{\lineskiplimit}{\lineskip}
350 \frenchspacing
351 \pretolerance = 400
352 \tolerance = \pretolerance
353 \setlength{\emergencystretch}{5pt}
354 \clubpenalty = 10000
355 \widowpenalty = 10000
356 \setlength{\hfuzz}{.5pt}
358 % Standard vertical spaces:
360 \newskip{\standardvspace}
361 \setvspace{\standardvspace}{5pt plus 1pt minus .5pt}
363 % Margin paragraphs:
365 \setlength{\marginparwidth}{36pt}
366 \setlength{\marginparsep}{2pt}
367 \setlength{\marginparpush}{8pt}
370 \setlength{\skip\footins}{8pt plus 3pt minus 1pt}
371 \setlength{\footnotesep}{9pt}
373 \renewcommand{\footnoterule}{%
374 \hrule width .5\columnwidth height .33pt depth 0pt}
376 \renewcommand{\@makefntext}[1]{%
377 \noindent \@makefnmark \hspace{1pt}#1}
379 % Floats:
381 \setcounter{topnumber}{4}
382 \setcounter{bottomnumber}{1}
383 \setcounter{totalnumber}{4}
385 \renewcommand{\fps@figure}{tp}
386 \renewcommand{\fps@table}{tp}
387 \renewcommand{\topfraction}{0.90}
388 \renewcommand{\bottomfraction}{0.30}
389 \renewcommand{\textfraction}{0.10}
390 \renewcommand{\floatpagefraction}{0.75}
392 \setcounter{dbltopnumber}{4}
394 \renewcommand{\dbltopfraction}{\topfraction}
395 \renewcommand{\dblfloatpagefraction}{\floatpagefraction}
397 \setlength{\floatsep}{18pt plus 4pt minus 2pt}
398 \setlength{\textfloatsep}{18pt plus 4pt minus 3pt}
399 \setlength{\intextsep}{10pt plus 4pt minus 3pt}
401 \setlength{\dblfloatsep}{18pt plus 4pt minus 2pt}
402 \setlength{\dbltextfloatsep}{20pt plus 4pt minus 3pt}
404 % Miscellaneous:
406 \errorcontextlines = 5
408 % Fonts
409 % -----
412 \if \@times
413 \renewcommand{\rmdefault}{ptm}%
414 \if \@mathtime
415 \usepackage[mtbold,noTS1]{mathtime}%
416 \else
417 %%% \usepackage{mathptm}%
419 \else
420 \relax
423 \if \@ninepoint
425 \renewcommand{\normalsize}{%
426 \@setfontsize{\normalsize}{9pt}{10pt}%
427 \setlength{\abovedisplayskip}{5pt plus 1pt minus .5pt}%
428 \setlength{\belowdisplayskip}{\abovedisplayskip}%
429 \setlength{\abovedisplayshortskip}{3pt plus 1pt minus 2pt}%
430 \setlength{\belowdisplayshortskip}{\abovedisplayshortskip}}
432 \renewcommand{\tiny}{\@setfontsize{\tiny}{5pt}{6pt}}
434 \renewcommand{\scriptsize}{\@setfontsize{\scriptsize}{7pt}{8pt}}
436 \renewcommand{\small}{%
437 \@setfontsize{\small}{8pt}{9pt}%
438 \setlength{\abovedisplayskip}{4pt plus 1pt minus 1pt}%
439 \setlength{\belowdisplayskip}{\abovedisplayskip}%
440 \setlength{\abovedisplayshortskip}{2pt plus 1pt}%
441 \setlength{\belowdisplayshortskip}{\abovedisplayshortskip}}
443 \renewcommand{\footnotesize}{%
444 \@setfontsize{\footnotesize}{8pt}{9pt}%
445 \setlength{\abovedisplayskip}{4pt plus 1pt minus .5pt}%
446 \setlength{\belowdisplayskip}{\abovedisplayskip}%
447 \setlength{\abovedisplayshortskip}{2pt plus 1pt}%
448 \setlength{\belowdisplayshortskip}{\abovedisplayshortskip}}
450 \renewcommand{\large}{\@setfontsize{\large}{11pt}{13pt}}
452 \renewcommand{\Large}{\@setfontsize{\Large}{14pt}{18pt}}
454 \renewcommand{\LARGE}{\@setfontsize{\LARGE}{18pt}{20pt}}
456 \renewcommand{\huge}{\@setfontsize{\huge}{20pt}{25pt}}
458 \renewcommand{\Huge}{\@setfontsize{\Huge}{25pt}{30pt}}
462 % Abstract
463 % --------
466 \renewenvironment{abstract}{%
467 \section*{Abstract}%
468 \normalsize}{%
471 % Bibliography
472 % ------------
475 \renewenvironment{thebibliography}[1]
476 {\section*{\refname
477 \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}}%
478 \list{\@biblabel{\@arabic\c@enumiv}}%
479 {\settowidth\labelwidth{\@biblabel{#1}}%
480 \leftmargin\labelwidth
481 \advance\leftmargin\labelsep
482 \@openbib@code
483 \usecounter{enumiv}%
484 \let\p@enumiv\@empty
485 \renewcommand\theenumiv{\@arabic\c@enumiv}}%
486 \small
487 \softraggedright%%%\sloppy
488 \clubpenalty4000
489 \@clubpenalty \clubpenalty
490 \widowpenalty4000%
491 \sfcode`\.\@m}
492 {\def\@noitemerr
493 {\@latex@warning{Empty `thebibliography' environment}}%
494 \endlist}
496 % Categories
497 % ----------
500 \@setflag \@firstcategory = \@true
502 \newcommand{\category}[3]{%
503 \if \@firstcategory
504 \paragraph*{Categories and Subject Descriptors}%
505 \@setflag \@firstcategory = \@false
506 \else
507 \unskip ;\hspace{.75em}%
509 \@ifnextchar [{\@category{#1}{#2}{#3}}{\@category{#1}{#2}{#3}[]}}
511 \def \@category #1#2#3[#4]{%
512 {\let \and = \relax
513 #1 [\textit{#2}]%
514 \if \@emptyargp{#4}%
515 \if \@notp{\@emptyargp{#3}}: #3\fi
516 \else
517 :\space
518 \if \@notp{\@emptyargp{#3}}#3---\fi
519 \textrm{#4}%
520 \fi}}
522 % Copyright Notice
523 % --------- ------
526 \def \ftype@copyrightbox {8}
527 \def \@toappear {}
528 \def \@permission {}
531 \def \@copyrightspace {%
532 \@float{copyrightbox}[b]%
533 \vbox to 1in{%
534 \vfill
535 \parbox[b]{20pc}{%
536 \scriptsize
537 \if \@preprint
538 [Copyright notice will appear here
539 once 'preprint' option is removed.]\par
540 \else
541 \@toappear
543 \if \@reprint
544 \noindent Reprinted from \@conferencename,
545 \@proceedings,
546 \@conferenceinfo,
547 pp.~\number\thepage--\pageref{sigplanconf@finalpage}.\par
548 \fi}}%
549 \end@float}
551 \long\def \toappear #1{%
552 \def \@toappear {#1}}
554 \toappear{%
555 \noindent \@permission \par
556 \vspace{2pt}
557 \noindent \textsl{\@conferencename}\quad \@conferenceinfo \par
558 \noindent Copyright \copyright\ \@copyrightyear\ ACM \@copyrightdata
559 \dots \$5.00\par}
561 \newcommand{\permission}[1]{%
562 \gdef \@permission {#1}}
564 \permission{%
565 Permission to make digital or hard copies of all or
566 part of this work for personal or classroom use is granted without
567 fee provided that copies are not made or distributed for profit or
568 commercial advantage and that copies bear this notice and the full
569 citation on the first page. To copy otherwise, to republish, to
570 post on servers or to redistribute to lists, requires prior specific
571 permission and/or a fee.}
573 % Here we have some alternate permission statements and copyright lines:
575 \newcommand{\ACMCanadapermission}{%
576 \permission{%
577 Copyright \@copyrightyear\ Association for Computing Machinery.
578 ACM acknowledges that
579 this contribution was authored or co-authored by an affiliate of the
580 National Research Council of Canada (NRC).
581 As such, the Crown in Right of
582 Canada retains an equal interest in the copyright, however granting
583 nonexclusive, royalty-free right to publish or reproduce this article,
584 or to allow others to do so, provided that clear attribution
585 is also given to the authors and the NRC.}}
587 \newcommand{\ACMUSpermission}{%
588 \permission{%
589 Copyright \@copyrightyear\ Association for
590 Computing Machinery. ACM acknowledges that
591 this contribution was authored or co-authored
592 by a contractor or affiliate
593 of the U.S. Government. As such, the Government retains a nonexclusive,
594 royalty-free right to publish or reproduce this article,
595 or to allow others to do so, for Government purposes only.}}
597 \newcommand{\authorpermission}{%
598 \permission{%
599 Copyright is held by the author/owner(s).}
600 \toappear{%
601 \noindent \@permission \par
602 \vspace{2pt}
603 \noindent \textsl{\@conferencename}\quad \@conferenceinfo \par
604 ACM \@copyrightdata.}}
606 \newcommand{\Sunpermission}{%
607 \permission{%
608 Copyright is held by Sun Microsystems, Inc.}%
609 \toappear{%
610 \noindent \@permission \par
611 \vspace{2pt}
612 \noindent \textsl{\@conferencename}\quad \@conferenceinfo \par
613 ACM \@copyrightdata.}}
615 \newcommand{\USpublicpermission}{%
616 \permission{%
617 This paper is authored by an employee(s) of the United States
618 Government and is in the public domain.}%
619 \toappear{%
620 \noindent \@permission \par
621 \vspace{2pt}
622 \noindent \textsl{\@conferencename}\quad \@conferenceinfo \par
623 ACM \@copyrightdata.}}
625 % Enunciations
626 % ------------
629 \def \@begintheorem #1#2{% {name}{number}
630 \trivlist
631 \item[\hskip \labelsep \textsc{#1 #2.}]%
632 \itshape\selectfont
633 \ignorespaces}
635 \def \@opargbegintheorem #1#2#3{% {name}{number}{title}
636 \trivlist
637 \item[%
638 \hskip\labelsep \textsc{#1\ #2}%
639 \if \@notp{\@emptyargp{#3}}\nut (#3).\fi]%
640 \itshape\selectfont
641 \ignorespaces}
643 % Figures
644 % -------
647 \@setflag \@caprule = \@true
649 \long\def \@makecaption #1#2{%
650 \addvspace{4pt}
651 \if \@caprule
652 \hrule width \hsize height .33pt
653 \vspace{4pt}
655 \setbox \@tempboxa = \hbox{\@setfigurenumber{#1.}\nut #2}%
656 \if \@dimgtrp{\wd\@tempboxa}{\hsize}%
657 \noindent \@setfigurenumber{#1.}\nut #2\par
658 \else
659 \centerline{\box\@tempboxa}%
660 \fi}
662 \newcommand{\nocaptionrule}{%
663 \@setflag \@caprule = \@false}
665 \def \@setfigurenumber #1{%
666 {\rmfamily \bfseries \selectfont #1}}
668 % Hierarchy
669 % ---------
672 \setcounter{secnumdepth}{\@numheaddepth}
674 \newskip{\@sectionaboveskip}
675 \setvspace{\@sectionaboveskip}{10pt plus 3pt minus 2pt}
677 \newskip{\@sectionbelowskip}
678 \if \@blockstyle
679 \setlength{\@sectionbelowskip}{0.1pt}%
680 \else
681 \setlength{\@sectionbelowskip}{4pt}%
684 \renewcommand{\section}{%
685 \@startsection
686 {section}%
687 {1}%
688 {0pt}%
689 {-\@sectionaboveskip}%
690 {\@sectionbelowskip}%
691 {\large \bfseries \raggedright}}
693 \newskip{\@subsectionaboveskip}
694 \setvspace{\@subsectionaboveskip}{8pt plus 2pt minus 2pt}
696 \newskip{\@subsectionbelowskip}
697 \if \@blockstyle
698 \setlength{\@subsectionbelowskip}{0.1pt}%
699 \else
700 \setlength{\@subsectionbelowskip}{4pt}%
703 \renewcommand{\subsection}{%
704 \@startsection%
705 {subsection}%
706 {2}%
707 {0pt}%
708 {-\@subsectionaboveskip}%
709 {\@subsectionbelowskip}%
710 {\normalsize \bfseries \raggedright}}
712 \renewcommand{\subsubsection}{%
713 \@startsection%
714 {subsubsection}%
715 {3}%
716 {0pt}%
717 {-\@subsectionaboveskip}
718 {\@subsectionbelowskip}%
719 {\normalsize \bfseries \raggedright}}
721 \newskip{\@paragraphaboveskip}
722 \setvspace{\@paragraphaboveskip}{6pt plus 2pt minus 2pt}
724 \renewcommand{\paragraph}{%
725 \@startsection%
726 {paragraph}%
727 {4}%
728 {0pt}%
729 {\@paragraphaboveskip}
730 {-1em}%
731 {\normalsize \bfseries \if \@times \itshape \fi}}
733 \renewcommand{\subparagraph}{%
734 \@startsection%
735 {subparagraph}%
736 {4}%
737 {0pt}%
738 {\@paragraphaboveskip}
739 {-1em}%
740 {\normalsize \itshape}}
742 % Standard headings:
744 \newcommand{\acks}{\section*{Acknowledgments}}
746 \newcommand{\keywords}{\paragraph*{Keywords}}
748 \newcommand{\terms}{\paragraph*{General Terms}}
750 % Identification
751 % --------------
754 \def \@conferencename {}
755 \def \@conferenceinfo {}
756 \def \@copyrightyear {}
757 \def \@copyrightdata {[to be supplied]}
758 \def \@proceedings {[Unknown Proceedings]}
761 \newcommand{\conferenceinfo}[2]{%
762 \gdef \@conferencename {#1}%
763 \gdef \@conferenceinfo {#2}}
765 \newcommand{\copyrightyear}[1]{%
766 \gdef \@copyrightyear {#1}}
768 \let \CopyrightYear = \copyrightyear
770 \newcommand{\copyrightdata}[1]{%
771 \gdef \@copyrightdata {#1}}
773 \let \crdata = \copyrightdata
775 \newcommand{\proceedings}[1]{%
776 \gdef \@proceedings {#1}}
778 % Lists
779 % -----
782 \setlength{\leftmargini}{13pt}
783 \setlength\leftmarginii{13pt}
784 \setlength\leftmarginiii{13pt}
785 \setlength\leftmarginiv{13pt}
786 \setlength{\labelsep}{3.5pt}
788 \setlength{\topsep}{\standardvspace}
789 \if \@blockstyle
790 \setlength{\itemsep}{1pt}
791 \setlength{\parsep}{3pt}
792 \else
793 \setlength{\itemsep}{1pt}
794 \setlength{\parsep}{3pt}
797 \renewcommand{\labelitemi}{{\small \centeroncapheight{\textbullet}}}
798 \renewcommand{\labelitemii}{\centeroncapheight{\rule{2.5pt}{2.5pt}}}
799 \renewcommand{\labelitemiii}{$-$}
800 \renewcommand{\labelitemiv}{{\Large \textperiodcentered}}
802 \renewcommand{\@listi}{%
803 \leftmargin = \leftmargini
804 \listparindent = 0pt}
805 %%% \itemsep = 1pt
806 %%% \parsep = 3pt}
807 %%% \listparindent = \parindent}
809 \let \@listI = \@listi
811 \renewcommand{\@listii}{%
812 \leftmargin = \leftmarginii
813 \topsep = 1pt
814 \labelwidth = \leftmarginii
815 \advance \labelwidth by -\labelsep
816 \listparindent = \parindent}
818 \renewcommand{\@listiii}{%
819 \leftmargin = \leftmarginiii
820 \labelwidth = \leftmarginiii
821 \advance \labelwidth by -\labelsep
822 \listparindent = \parindent}
824 \renewcommand{\@listiv}{%
825 \leftmargin = \leftmarginiv
826 \labelwidth = \leftmarginiv
827 \advance \labelwidth by -\labelsep
828 \listparindent = \parindent}
830 % Mathematics
831 % -----------
834 \def \theequation {\arabic{equation}}
836 % Miscellaneous
837 % -------------
840 \newcommand{\balancecolumns}{%
841 \vfill\eject
842 \global\@colht = \textheight
843 \global\ht\@cclv = \textheight}
845 \newcommand{\nut}{\hspace{.5em}}
847 \newcommand{\softraggedright}{%
848 \let \\ = \@centercr
849 \leftskip = 0pt
850 \rightskip = 0pt plus 10pt}
852 % Program Code
853 % ------- ----
856 \newcommand{\mono}[1]{%
857 {\@tempdima = \fontdimen2\font
858 \texttt{\spaceskip = 1.1\@tempdima #1}}}
860 % Running Heads and Feet
861 % ------- ----- --- ----
864 \def \@preprintfooter {}
866 \newcommand{\preprintfooter}[1]{%
867 \gdef \@preprintfooter {#1}}
869 \if \@preprint
871 \def \ps@plain {%
872 \let \@mkboth = \@gobbletwo
873 \let \@evenhead = \@empty
874 \def \@evenfoot {\scriptsize \textit{\@preprintfooter}\hfil \thepage \hfil
875 \textit{\@formatyear}}%
876 \let \@oddhead = \@empty
877 \let \@oddfoot = \@evenfoot}
879 \else\if \@reprint
881 \def \ps@plain {%
882 \let \@mkboth = \@gobbletwo
883 \let \@evenhead = \@empty
884 \def \@evenfoot {\scriptsize \hfil \thepage \hfil}%
885 \let \@oddhead = \@empty
886 \let \@oddfoot = \@evenfoot}
888 \else
890 \let \ps@plain = \ps@empty
891 \let \ps@headings = \ps@empty
892 \let \ps@myheadings = \ps@empty
894 \fi\fi
896 \def \@formatyear {%
897 \number\year/\number\month/\number\day}
899 % Special Characters
900 % ------- ----------
903 \DeclareRobustCommand{\euro}{%
904 \protect{\rlap{=}}{\sf \kern .1em C}}
906 % Title Page
907 % ----- ----
910 \@setflag \@addauthorsdone = \@false
912 \def \@titletext {\@latex@error{No title was provided}{}}
913 \def \@subtitletext {}
915 \newcount{\@authorcount}
917 \newcount{\@titlenotecount}
918 \newtoks{\@titlenotetext}
920 \def \@titlebanner {}
922 \renewcommand{\title}[1]{%
923 \gdef \@titletext {#1}}
925 \newcommand{\subtitle}[1]{%
926 \gdef \@subtitletext {#1}}
928 \newcommand{\authorinfo}[3]{% {names}{affiliation}{email/URL}
929 \global\@increment \@authorcount
930 \@withname\gdef {\@authorname\romannumeral\@authorcount}{#1}%
931 \@withname\gdef {\@authoraffil\romannumeral\@authorcount}{#2}%
932 \@withname\gdef {\@authoremail\romannumeral\@authorcount}{#3}}
934 \renewcommand{\author}[1]{%
935 \@latex@error{The \string\author\space command is obsolete;
936 use \string\authorinfo}{}}
938 \newcommand{\titlebanner}[1]{%
939 \gdef \@titlebanner {#1}}
941 \renewcommand{\maketitle}{%
942 \pagestyle{plain}%
943 \if \@onecolumn
944 {\hsize = \standardtextwidth
945 \@maketitle}%
946 \else
947 \twocolumn[\@maketitle]%
949 \@placetitlenotes
950 \if \@copyrightwanted \@copyrightspace \fi}
952 \def \@maketitle {%
953 \begin{center}
954 \@settitlebanner
955 \let \thanks = \titlenote
956 \noindent \LARGE \bfseries \@titletext \par
957 \vskip 6pt
958 \noindent \Large \@subtitletext \par
959 \vskip 12pt
960 \ifcase \@authorcount
961 \@latex@error{No authors were specified for this paper}{}\or
962 \@titleauthors{i}{}{}\or
963 \@titleauthors{i}{ii}{}\or
964 \@titleauthors{i}{ii}{iii}\or
965 \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{}{}\or
966 \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{}\or
967 \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{vi}\or
968 \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{vi}%
969 \@titleauthors{vii}{}{}\or
970 \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{vi}%
971 \@titleauthors{vii}{viii}{}\or
972 \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{vi}%
973 \@titleauthors{vii}{viii}{ix}\or
974 \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{vi}%
975 \@titleauthors{vii}{viii}{ix}\@titleauthors{x}{}{}\or
976 \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{vi}%
977 \@titleauthors{vii}{viii}{ix}\@titleauthors{x}{xi}{}\or
978 \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{vi}%
979 \@titleauthors{vii}{viii}{ix}\@titleauthors{x}{xi}{xii}%
980 \else
981 \@latex@error{Cannot handle more than 12 authors}{}%
983 \vspace{1.75pc}
984 \end{center}}
986 \def \@settitlebanner {%
987 \if \@andp{\@preprint}{\@notp{\@emptydefp{\@titlebanner}}}%
988 \vbox to 0pt{%
989 \vskip -32pt
990 \noindent \textbf{\@titlebanner}\par
991 \vss}%
992 \nointerlineskip
993 \fi}
995 \def \@titleauthors #1#2#3{%
996 \if \@andp{\@emptyargp{#2}}{\@emptyargp{#3}}%
997 \noindent \@setauthor{40pc}{#1}{\@false}\par
998 \else\if \@emptyargp{#3}%
999 \noindent \@setauthor{17pc}{#1}{\@false}\hspace{3pc}%
1000 \@setauthor{17pc}{#2}{\@false}\par
1001 \else
1002 \noindent \@setauthor{12.5pc}{#1}{\@false}\hspace{2pc}%
1003 \@setauthor{12.5pc}{#2}{\@false}\hspace{2pc}%
1004 \@setauthor{12.5pc}{#3}{\@true}\par
1005 \relax
1006 \fi\fi
1007 \vspace{20pt}}
1009 \def \@setauthor #1#2#3{% {width}{text}{unused}
1010 \vtop{%
1011 \def \and {%
1012 \hspace{16pt}}
1013 \hsize = #1
1014 \normalfont
1015 \centering
1016 \large \@name{\@authorname#2}\par
1017 \vspace{5pt}
1018 \normalsize \@name{\@authoraffil#2}\par
1019 \vspace{4pt}
1020 \normalsize{\@name{\@authoremail#2}}\par}}
1022 \def \@maybetitlenote #1{%
1023 \if \@andp{#1}{\@gtrp{\@authorcount}{3}}%
1024 \titlenote{See page~\pageref{@addauthors} for additional authors.}%
1025 \fi}
1027 \newtoks{\@fnmark}
1029 \newcommand{\titlenote}[1]{%
1030 \global\@increment \@titlenotecount
1031 \ifcase \@titlenotecount \relax \or
1032 \@fnmark = {\ast}\or
1033 \@fnmark = {\dagger}\or
1034 \@fnmark = {\ddagger}\or
1035 \@fnmark = {\S}\or
1036 \@fnmark = {\P}\or
1037 \@fnmark = {\ast\ast}%
1039 \,$^{\the\@fnmark}$%
1040 \edef \reserved@a {\noexpand\@appendtotext{%
1041 \noexpand\@titlefootnote{\the\@fnmark}}}%
1042 \reserved@a{#1}}
1044 \def \@appendtotext #1#2{%
1045 \global\@titlenotetext = \expandafter{\the\@titlenotetext #1{#2}}}
1047 \newcount{\@authori}
1049 \iffalse
1050 \def \additionalauthors {%
1051 \if \@gtrp{\@authorcount}{3}%
1052 \section{Additional Authors}%
1053 \label{@addauthors}%
1054 \noindent
1055 \@authori = 4
1056 {\let \\ = ,%
1057 \loop
1058 \textbf{\@name{\@authorname\romannumeral\@authori}},
1059 \@name{\@authoraffil\romannumeral\@authori},
1060 email: \@name{\@authoremail\romannumeral\@authori}.%
1061 \@increment \@authori
1062 \if \@notp{\@gtrp{\@authori}{\@authorcount}} \repeat}%
1063 \par
1065 \global\@setflag \@addauthorsdone = \@true}
1068 \let \addauthorsection = \additionalauthors
1070 \def \@placetitlenotes {
1071 \the\@titlenotetext}
1073 % Utilities
1074 % ---------
1077 \newcommand{\centeroncapheight}[1]{%
1078 {\setbox\@tempboxa = \hbox{#1}%
1079 \@measurecapheight{\@tempdima}% % Calculate ht(CAP) - ht(text)
1080 \advance \@tempdima by -\ht\@tempboxa % ------------------
1081 \divide \@tempdima by 2 % 2
1082 \raise \@tempdima \box\@tempboxa}}
1084 \newbox{\@measbox}
1086 \def \@measurecapheight #1{% {\dimen}
1087 \setbox\@measbox = \hbox{ABCDEFGHIJKLMNOPQRSTUVWXYZ}%
1088 #1 = \ht\@measbox}
1090 \long\def \@titlefootnote #1#2{%
1091 \insert\footins{%
1092 \reset@font\footnotesize
1093 \interlinepenalty\interfootnotelinepenalty
1094 \splittopskip\footnotesep
1095 \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
1096 \hsize\columnwidth \@parboxrestore
1097 %%% \protected@edef\@currentlabel{%
1098 %%% \csname p@footnote\endcsname\@thefnmark}%
1099 \color@begingroup
1100 \def \@makefnmark {$^{#1}$}%
1101 \@makefntext{%
1102 \rule\z@\footnotesep\ignorespaces#2\@finalstrut\strutbox}%
1103 \color@endgroup}}
1105 % LaTeX Modifications
1106 % ----- -------------
1108 \def \@seccntformat #1{%
1109 \@name{\the#1}%
1110 \@expandaftertwice\@seccntformata \csname the#1\endcsname.\@mark
1111 \quad}
1113 \def \@seccntformata #1.#2\@mark{%
1114 \if \@emptyargp{#2}.\fi}
1116 % Revision History
1117 % -------- -------
1120 % Date Person Ver. Change
1121 % ---- ------ ---- ------
1123 % 2004.09.12 PCA 0.1--5 Preliminary development.
1125 % 2004.11.18 PCA 0.5 Start beta testing.
1127 % 2004.11.19 PCA 0.6 Obsolete \author and replace with
1128 % \authorinfo.
1129 % Add 'nocopyrightspace' option.
1130 % Compress article opener spacing.
1131 % Add 'mathtime' option.
1132 % Increase text height by 6 points.
1134 % 2004.11.28 PCA 0.7 Add 'cm/computermodern' options.
1135 % Change default to Times text.
1137 % 2004.12.14 PCA 0.8 Remove use of mathptm.sty; it cannot
1138 % coexist with latexsym or amssymb.
1140 % 2005.01.20 PCA 0.9 Rename class file to sigplanconf.cls.
1142 % 2005.03.05 PCA 0.91 Change default copyright data.
1144 % 2005.03.06 PCA 0.92 Add at-signs to some macro names.
1146 % 2005.03.07 PCA 0.93 The 'onecolumn' option defaults to '11pt',
1147 % and it uses the full type width.
1149 % 2005.03.15 PCA 0.94 Add at-signs to more macro names.
1150 % Allow margin paragraphs during review.
1152 % 2005.03.22 PCA 0.95 Implement \euro.
1153 % Remove proof and newdef environments.
1155 % 2005.05.06 PCA 1.0 Eliminate 'onecolumn' option.
1156 % Change footer to small italic and eliminate
1157 % left portion if no \preprintfooter.
1158 % Eliminate copyright notice if preprint.
1159 % Clean up and shrink copyright box.
1161 % 2005.05.30 PCA 1.1 Add alternate permission statements.
1163 % 2005.06.29 PCA 1.1 Publish final first edition of guide.
1165 % 2005.07.14 PCA 1.2 Add \subparagraph.
1166 % Use block paragraphs in lists, and adjust
1167 % spacing between items and paragraphs.
1169 % 2006.06.22 PCA 1.3 Add 'reprint' option and associated
1170 % commands.
1172 % 2006.08.24 PCA 1.4 Fix bug in \maketitle case command.
1174 % 2007.03.13 PCA 1.5 The title banner only display with the
1175 % 'preprint' option.