%\iffalse
% ====================================================================
%  @LaTeX-style-file{
%     filename        = "acmart.dtx",
%     version         = "1.6 beta",
%     date            = "30 October 1997",
%     time            = "12:52:52 EST",
%     author          = "David M. Jones",
%     address         = "MIT Laboratory for Computer Science
%                        Room NE43-316
%                        545 Technology Square
%                        Cambridge, MA 02139
%                        USA",
%     telephone       = "(617) 253-5936",
%     FAX             = "(617) 253-3480",
%     checksum        = "08790 3015 6779 76997",
%     email           = "dmjones@theory.lcs.mit.edu",
%     codetable       = "ISO/ASCII",
%     keywords        = "",
%     supported       = "yes",
%     docstring       = "This is a rewrite of acmtrans.sty to add a
%                        couple of new features and fix a number of
%                        bugs.
%
%                        Unfortunately, the copy of acmtrans.sty I'm
%                        working from doesn't have any attributions,
%                        so I can't credit the original authors,
%                        although the original style seems to have
%                        been written by Leslie Lamport, with later
%                        modifications by Andrew Appel and Rebecca
%                        Davies.
%
%                        The checksum field above contains a CRC-16
%                        checksum as the first value, followed by the
%                        equivalent of the standard UNIX wc (word
%                        count) utility output of lines, words, and
%                        characters.  This is produced by Robert
%                        Solovay's checksum utility.",
%  }
% ====================================================================
%\fi
%
% \CheckSum{2812}
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%
\def\fileversion{v1.6 beta}
\def\filedate{1997/10/30}
\def\docdate {23 August 1995}
%
%\iffalse
%<*driver>
\documentclass{ltxdoc}
%
%    We don't want everything to appear in the index
%    \begin{macrocode}
\DoNotIndex{\',\.,\@M,\@@input,\@addtoreset,\@arabic,\@badmath}
\DoNotIndex{\@centercr,\@cite}
\DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue}
\DoNotIndex{\@input,\@ixpt,\@m}
\DoNotIndex{\@minus,\@mkboth,\@ne,\@nil,\@nomath,\@plus,\@set@topoint}
\DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb}
\DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt}
\DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt}
\DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace}
\DoNotIndex{\advance,\Alph,\alph}
\DoNotIndex{\arabic,\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
\DoNotIndex{\bullet}
\DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption}
\DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass}
\DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist}
\DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
\DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter}
\DoNotIndex{\fbox}
\DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef}
\DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
\DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi}
\DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi}
\DoNotIndex{\input}
\DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark}
\DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright}
\DoNotIndex{\month,\newcommand,\newcounter,\newenvironment}
\DoNotIndex{\NeedsTeXFormat,\newdimen}
\DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number}
\DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@}
\DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip}
\DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
\DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright}
\DoNotIndex{\refstepcounter,\relax,\renewcommand,\reset@font}
\DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily,\roman}
\DoNotIndex{\Roman,\secdef,\selectfont,\setbox,\setcounter,\setlength}
\DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space}
\DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase}
\DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt}
\DoNotIndex{\viipt,\vipt,\vskip,\vspace}
\DoNotIndex{\wd,\xiipt,\year,\z@}
%    \end{macrocode}
\EnableCrossrefs
\setcounter{StandardModuleDepth}{3}
\newcommand*{\Lopt}[1]{\textsf {#1}}
\newcommand*{\Lenv}[1]{\texttt {#1}}
\newcommand*{\cls}[1]{\texttt {#1}}
\newcommand*{\cnt}[1]{\texttt {#1}}
\newcommand*{\pck}[1]{\texttt {#1}}
\newcommand*{\file}[1]{\texttt {#1}}
\CodelineIndex
\begin{document}
\DocInput{acmart.dtx}
\PrintIndex
% ^^A\PrintChanges
\end{document}
%</driver>
%    \end{macrocode}
%\fi
%
%    \title{The \cls{acmart} document class}
%
%    \author{David M. Jones}
%
%    \date{30 October 1997 \\
%    Version 1.6 $\beta$}
%
%    \maketitle
%
%    \tableofcontents
%
%    \StopEventually{}
%
%    \section{Introduction}
%
%    This is the \cls{acmart} document class, which is based upon the
%    earlier \cls{acmtrans} document style.  Unfortunately, the copy
%    of \file{acmtrans.sty} I'm working from doesn't contain any
%    attributions, so I can't properly credit the original authors,
%    although the original style seems to have been written by Leslie
%    Lamport, with later modifications by Andrew Appel and Rebecca
%    Davies.
%
%    The ACM class has two new options:
%    \begin{description}
%
%    \item[\Lopt{preprint}]
%    for producing a version of the paper suitable for distribution as
%    a preprint (this is the default)
%
%    \item[\Lopt{faircopy}]
%    for producing a version of the paper suitable for submission to
%    the ACM for publication.  Currently the only difference is that
%    figures will automatically be put on pages by themselves with
%    appropriate labels at the bottom of the page.  In the future,
%    this may also produce other differences to facilitate
%    copy-editing, such as typesetting the text \cs{raggedright}
%    instead of fully justified.
%
%    \end{description}
%
%
%    \section{The \textsc{docstrip} modules}
%
%    This code uses the following modules:
%    \begin{center}
%    \begin{tabular}{ll}
%
%    2e     & generate code for \LaTeXe \\
%
%    209    & generate code for \LaTeX~2.09 \\
%
%    cls    & generate a document class \\
%
%    trans  & generate the \pck{acmtrans} class \\
%
%    bib    & generate the \pck{acmbib} package \\
%
%    driver & generate a driver file for the documentation
%
%    \end{tabular}
%    \end{center}
%
%    \section{The code}
%
%    First we output the appropriate header information.
%
%    \begin{macrocode}
%<*cls>
%<*209>
% %<*trans>
%\typeout{Document Style `acmtrans' \fileversion\space <\filedate>
%(dmj).}
% %</trans>
% %<*!trans>
\typeout{Document Style `acmart' \fileversion\space <\filedate>
(dmj).}
% %</!trans>
%</209>
%
%<*2e>
\NeedsTeXFormat{LaTeX2e}
% %<*trans>
% \ProvidesClass{acmart}[\filedate\space\fileversion\space ACM
% transactions class (dmj)]
% %</trans>
% %<*!trans>
\ProvidesClass{acmart}[\filedate\space\fileversion\space ACM
article class (dmj)]
% %</!trans>
%</2e>
%    \end{macrocode}
%
%    \begin{macro}{\@height}
%    \begin{macro}{\@width}
%    \begin{macro}{\@minus}
%    \begin{macro}{\@plus}
%    Next we add some useful abbreviations from the \LaTeXe\ kernel to
%    the \LaTeX~2.09 version of the document class.
%    \begin{macrocode}
%<*209>
\def\@height{height}
\def\@width{width}
\def\@minus{minus}
\def\@plus{plus}
\def\hb@xt@{\hbox to}
%</209>
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%    \begin{macro}{\if@faircopy}
%    \begin{macrocode}
\newif\if@faircopy
\@faircopyfalse
%<*2e>

\DeclareOption{faircopy}{\@faircopytrue}

\DeclareOption{preprint}{\@faircopyfalse}

\DeclareOption{twocolumn}{%
    \PackageWarningNoLine{acmart}{twocolumn mode is not supported}%
}
%    \end{macrocode}
%    \end{macro}
%
%    All other options are passed to the article class for processing.
%
%    \begin{macrocode}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}

\ProcessOptions\relax

\LoadClass{article}
%</2e>
%    \end{macrocode}
%
%    \begin{macro}{\ds@faircopy}
%    \begin{macro}{\ds@preprint}
%    \begin{macro}{\ds@twocolumn}
%    \begin{macrocode}
%<*209>
\def\ds@faircopy{\@faircopytrue}

\def\ds@preprint{\@faircopyfalse}

\def\ds@twocolumn{%
    \typeout{Warning! twocolumn mode is not supported by acmart}%
}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \begin{macrocode}
\@twosidetrue
\@mparswitchtrue
\def\ds@draft{\overfullrule 5\p@}
\@options

\lineskip \p@
\normallineskip \p@
\def\baselinestretch{1}
\def\@ptsize{0} %needed for amssymbols.sty
%</209>
%    \end{macrocode}
%
%    \begin{macro}{\@normalsize}
%    \begin{macro}{\normalsize}
%    \begin{macrocode}
%<*209>
\def\@normalsize{%
    \@setsize\normalsize{12\p@}\xpt\@xpt
%</209>
%<*2e>
\renewcommand{\normalsize}{%
    \@setfontsize\normalsize\@xpt\@xiipt
%</2e>
    \abovedisplayskip 6\p@ \@plus2\p@ \@minus\p@
    \belowdisplayskip \abovedisplayskip
    \abovedisplayshortskip 6\p@ \@minus 3\p@
    \belowdisplayshortskip 6\p@ \@minus 3\p@
    \let\@listi\@listI
}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%
%    \begin{macro}{\small}
%    \begin{macrocode}
%<*209>
\def\small{%
    \@setsize\small{11\p@}\ixpt\@ixpt
%</209>
%<*2e>
\renewcommand{\small}{%
    \@setfontsize\small\@ixpt{11}%
%</2e>
    \abovedisplayskip 5\p@ \@plus 2\p@ \@minus \p@
    \belowdisplayskip \abovedisplayskip
    \abovedisplayshortskip 5\p@ \@minus 2\p@
    \belowdisplayshortskip 5\p@ \@minus 2\p@
    \def\@listi{%
        \leftmargin\leftmargini
        \topsep 5\p@ \@plus 2\p@ \@minus \p@
        \parsep \z@ \@plus .7\p@
        \itemsep 1.6\p@ \@plus .8\p@
    }%
}
%    \end{macrocode}
%    \end{macro}

%    \begin{macro}{\footnotesize}
%    \begin{macrocode}
%<*209>
\def\footnotesize{%
    \@setsize\footnotesize{10pt}\viiipt\@viiipt
%</209>
%<*2e>
\renewcommand{\footnotesize}{%
    \@setfontsize\footnotesize\@viiipt{9.5}%
%</2e>
    \abovedisplayskip 4\p@ \@plus \p@
    \belowdisplayskip \abovedisplayskip
    \abovedisplayshortskip 4\p@ \@minus \p@
    \belowdisplayshortskip 4\p@ \@minus \p@
    \def\@listi{%
        \leftmargin\leftmargini
        \topsep 4\p@ \@plus \p@
        \parsep \z@ \@plus .5\p@
        \itemsep \p@ \@plus .7\p@
    }%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\scriptsize}
%    \begin{macro}{\tiny}
%    \begin{macro}{\large}
%    \begin{macro}{\Large}
%    \begin{macro}{\LARGE}
%    \begin{macro}{\huge}
%    \begin{macro}{\Huge}
%    \begin{macrocode}
%<*209>
\def\scriptsize{\@setsize\scriptsize{8\p@}\viipt\@viipt}
\def\tiny{\@setsize\tiny{6\p@}\vpt\@vpt}
\def\large{\@setsize\large{14\p@}\xiipt\@xiipt}
\def\Large{\@setsize\Large{18\p@}\xivpt\@xivpt}
\def\LARGE{\@setsize\LARGE{20\p@}\xviipt\@xviipt}
\def\huge{\@setsize\huge{25\p@}\xxpt\@xxpt}
\def\Huge{\@setsize\Huge{30\p@}\xxvpt\@xxvpt}
%</209>
%<*2e>
\renewcommand{\scriptsize}{\@setfontsize\scriptsize\@viipt\@viipt}
\renewcommand{\tiny}{\@setfontsize\tiny\@vpt\@vpt}
\renewcommand{\large}{\@setfontsize\large\@xiipt\@xiipt}
\renewcommand{\Large}{\@setfontsize\Large\@xivpt\@xivpt}
\renewcommand{\LARGE}{\@setfontsize\LARGE\@xviipt\@xviipt}
\renewcommand{\huge}{\@setfontsize\huge\@xxpt\@xxpt}
\renewcommand{\Huge}{\@setfontsize\Huge\@xxvpt\@xxvpt}
%</2e>
%    \end{macrocode}
%    Added \cs{rom} for producing upright parens and numerals in
%    italic text. The 2.09 definition of \cs{rom} is taken from
%    \file{amsart.sty}, version~1.1b, 31 July 1991. -- dmj, 4/19/96
%    \begin{macrocode}
%<*209>
\def\rom#1{%
    \leavevmode
    \skip@\lastskip
    \unskip\/%
    \ifdim\skip@=\z@\else\hskip\skip@\fi
    {\rm#1}%
}
%</209>
%<2e>\let\rom\textup
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \begin{macrocode}
\normalsize

\oddsidemargin .75in
\evensidemargin .75in
\marginparwidth .5in
\marginparsep .125in
\topmargin .25in
\headheight 12pt
\headsep 16pt
%<209>\footheight 10pt
\footskip 15pt

\textheight 47pc
\textwidth 30pc
\columnsep 10pt
\columnseprule 0pt

\footnotesep 7pt
\skip\footins 15pt plus 4pt minus 3pt

\floatsep 12pt plus 2pt minus 2pt
\textfloatsep \floatsep

\intextsep 1pc plus 1pc

%<209>\@maxsep 1pc

\dblfloatsep 12pt plus 2pt minus 2pt

\dbltextfloatsep 20pt plus 2pt minus 4pt

%<209>\@dblmaxsep 20pt

\@fptop 0pt plus 1fil

\@fpsep 1pc plus 2fil

\@fpbot 0pt plus 1fil

\@dblfptop 0pt plus 1fil

\@dblfpsep 8pt plus 2fil

\@dblfpbot 0pt plus 1fil

\marginparpush 6pt

\parskip 0pt plus .1pt

% \parindent moved to end

% \parindent 10pt

\partopsep 0pt
%    \end{macrocode}
%    Set \cs{clubpenalty} and \cs{widowpenalty} to their maximum
%    values to inhibit widows and orphans.  -- dmj, 4/17/96
%    \begin{macrocode}
\clubpenalty\@M
\widowpenalty\@M

%<*209>
\@lowpenalty 51
\@medpenalty 151
\@highpenalty 301

\@beginparpenalty -\@lowpenalty
\@endparpenalty -\@lowpenalty
\@itempenalty -\@lowpenalty
%</209>
%    \end{macrocode}
%
%
%    \subsection{Section headings}
%
%    \begin{macro}{\c@part}
%    \begin{macro}{\c@section}
%    \begin{macro}{\c@subsection}
%    \begin{macro}{\c@subsubsection}
%    \begin{macro}{\c@paragraph}
%    \begin{macrocode}
%<*209>
\newcounter {part}
\newcounter {section}
\newcounter {subsection}[section]
\newcounter {subsubsection}[subsection]
\newcounter {paragraph}[subsubsection]
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%    \begin{macro}{\thepart}
%    \begin{macro}{\thesection}
%    \begin{macro}{\thesubsection}
%    \begin{macro}{\thesubsubsection}
%    \begin{macro}{\theparagraph}
%    \begin{macrocode}
\def\thepart{\Roman{part}}
\def\thesection{\arabic{section}}
\def\thesubsection{\thesection.\arabic{subsection}}
\def\thesubsubsection{\thesubsection.\arabic{subsubsection}}
\def\theparagraph{\thesubsubsection.\arabic{paragraph}}
%</209>
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%
%
%    \begin{macro}{\if@uchead}
%    \begin{macrocode}
\newif\if@uchead
\@ucheadfalse

%<209>\setcounter{secnumdepth}{3}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\part}
%    \begin{macrocode}
\def\part{%
    \@startsection{part}{9}{\z@}{-10\p@ \@plus -4\p@ \@minus -2\p@}
        {4\p@}{\normalsize\sf\@ucheadtrue}%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\section}
%    \begin{macrocode}
\def\section{%
    \@startsection{section}{1}{\z@}{-10\p@ \@plus -4\p@ \@minus -2\p@}%
    {4\p@}{\normalsize\sf\@ucheadtrue}%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\subsection}
%    \begin{macrocode}
\def\subsection{%
    \@startsection{subsection}{2}{\z@}{-8\p@ \@plus -2\p@ \@minus -\p@}
    {4\p@}{\normalsize\sf}%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\subsubsection}
%    \begin{macrocode}
\def\subsubsection{%
    \@startsection{subsubsection}{3}{\parindent}{6\p@ \@plus \p@}%
    {-5\p@}{\normalsize\it}%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\paragraph}
%    \begin{macrocode}
\def\paragraph{%
    \@startsection{paragraph}{3}{\parindent}{6\p@ \@plus \p@}%
    {-5\p@}{\normalsize\it}%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@period}
%    \cs{subsubsection}s and \cs{paragraph}s are set as run-in
%    headings, with a period added after the heading.  However, if the
%    text immediately following the \cs{subsubsection} or
%    \cs{paragraph} is either another section header or (more likely)
%    a list of some sort, then the period should be ommitted, since
%    the heading will be put on a line by itself.  This is implemented
%    in a rather grotty way using \cs{@period} and modifying
%    \cs{@startsection}, \cs{@xsect}, and \cs{@trivlist}.
%    \begin{macrocode}
\let\@period=.
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@startsection}
%    \begin{macrocode}
\def\@startsection#1#2#3#4#5#6{%
    \if@noskipsec
        \global\let\@period\@empty
        \leavevmode
        \global\let\@period.%
    \fi
    \par
    \@tempskipa #4\relax
    \@afterindenttrue
    \ifdim \@tempskipa <\z@
        \@tempskipa -\@tempskipa
        \@afterindentfalse
    \fi
    \if@nobreak
        \everypar{}%
    \else
        \addpenalty\@secpenalty
        \addvspace\@tempskipa
    \fi
    \@ifstar
        {\@ssect{#3}{#4}{#5}{#6}}
        {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@sect}
%    \begin{macrocode}
\def\@sect#1#2#3#4#5#6[#7]#8{%
    \ifnum #2>\c@secnumdepth
        \let\@svsec\@empty
    \else
        \refstepcounter{#1}%
%<*209>
        \edef\@svsec{%
            \begingroup
                \ifnum#2>2 \noexpand\rm \fi
                \csname the#1\endcsname
            \endgroup
            \ifnum #2=1\relax .\fi
            \hskip .5em
        }%
%</209>
%<*2e>
        \protected@edef\@svsec{%
            \textup{\csname the#1\endcsname}%
            \ifnum #2=1\relax .\fi
            \hskip .5em
        }%
%</2e>
    \fi
    \@tempskipa #5\relax
    \ifdim \@tempskipa>\z@
        \begingroup
            #6\relax
            \@hangfrom{\hskip #3\relax\@svsec}%
            \begingroup
                \interlinepenalty \@M
%    \end{macrocode}
%
%    Unfortunately, we're probably stuck with this.  (Or we could
%    redefine \cs{@M} :-)
%
%    It might be worthwhile defining a variant of \cs{@startsection}
%    that first uppercases the title and then just passes everything
%    along to \cs{@startsection}.  That would make us a little more
%    bullet-proof, since we wouldn't have to worry about tracking
%    future changes in \cs{@sect}.  But it might be more trouble than
%    it's really worth.
%
%    \begin{macrocode}
                \if@uchead
                    \uppercase{#8}%
                \else
                    #8%
                \fi
                \par
            \endgroup
        \endgroup
        \csname #1mark\endcsname{#7}%
        \addcontentsline{toc}{#1}{%
            \ifnum #2>\c@secnumdepth \else
                \protect\numberline{\csname the#1\endcsname}%
            \fi
            #7%
        }%
    \else
        \def\@svsechd{%
            #6%
            \hskip #3\relax
            \@svsec
            \if@uchead
                \uppercase{#8}%
            \else
                #8%
            \fi
            \csname #1mark\endcsname{#7}%
            \addcontentsline{toc}{#1}{%
                \ifnum #2>\c@secnumdepth \else
                    \protect\numberline{\csname the#1\endcsname}%
                \fi
                #7%
            }%
        }%
    \fi
    \@xsect{#5}%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@xsect}
%    \begin{macrocode}
\def\@xsect#1{%
    \@tempskipa #1\relax
    \ifdim \@tempskipa>\z@
        \par
        \nobreak
        \vskip \@tempskipa
        \@afterheading
    \else
        \global\@nobreakfalse
        \global\@noskipsectrue
        \everypar{%
            \if@noskipsec
                \global\@noskipsecfalse
                \clubpenalty\@M
                \hskip -\parindent
                \begingroup
                    \@svsechd
%    \end{macrocode}
%
%    Can't we decide here whether to put the period in?  Might have to
%    introduce a new flag, though.  How unpleasant.
%
%    \begin{macrocode}
                    \@period
                \endgroup
                \unskip
                \@tempskipa #1\relax
                \hskip -\@tempskipa
            \else
                \clubpenalty \@clubpenalty
                \everypar{}%
            \fi
        }%
    \fi
    \ignorespaces
}
%    \end{macrocode}
%    \end{macro}
%
%    Q. What is \cs{@period} doing in \cs{@trivlist}?
%
%    A. To handle the case where a \Lenv{trivlist} is the first item
%       after a \cs{subsubsection} or \cs{paragraph}.
%
%    Surely there has to be a better way of handling this.
%
%    \begin{macro}{\@trivlist}
%    \begin{macrocode}
\def\@trivlist{%
    \@topsepadd\topsep
    \if@noskipsec
        \global\let\@period\@empty
        \leavevmode
        \global\let\@period.%
    \fi
    \ifvmode
        \advance\@topsepadd\partopsep
    \else
        \unskip
        \par
    \fi
    \if@inlabel
        \@noparitemtrue
        \@noparlisttrue
    \else
        \@noparlistfalse
        \@topsep\@topsepadd
    \fi
    \advance\@topsep \parskip
    \leftskip\z@skip
    \rightskip\@rightskip
    \parfillskip\@flushglue
%<*2e>
    \par@deathcycles\z@
    \@setpar{%
        \if@newlist
            \advance\par@deathcycles\@ne
            \ifnum\par@deathcycles>\@m
                \@noitemerr{\@@par}%
            \fi
        \else
            {\@@par}%
        \fi
    }%
%</2e>
%<209>    \@setpar{\if@newlist\else{\@@par}\fi}
    \global\@newlisttrue
    \@outerparskip\parskip
}
%    \end{macrocode}
%    \end{macro}
%
%
%    \subsection{Appendices}
%
%    \begin{macrocode}
%<*trans>
\newcommand{\apbf}{\small\bf}
%% \newfont{\apbf}{cmbx9}
%    \end{macrocode}
%
%    \begin{macro}{\@withappendix}
%    Page numbering style for appendices
%    \begin{macrocode}
\def\@withappendix#1{\rm A--\number #1}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{environment}{appenheader}
%    \begin{macrocode}
\def\appenheader{%
%<209>    \global\@topnum\z@
%<209>    \global\@botroom \textheight
%<2e>    \suppressfloats[t]%
%<209>    \begin{@float}{figure}[b]
%<2e>    \begin{@float}{figure}[!b]
        \footnotesize
        \newfont{\sc}{cmcsc10}% %%* ACK!
        \parindent\z@
        \null
        \vskip -\textfloatsep
        \vskip 11\p@
        \hrule \@height .2\p@ \@width 30pc
        \vskip 2\p@
        \rule{\z@}{10\p@}%
        \ignorespaces
}

\def\endappenheader{%
    \end{@float}
    \global\let\appendixhead\@empty
}
%    \end{macrocode}
%    \end{environment}
%
%    \begin{macro}{\appendixhead}
%    \begin{macrocode}
\long\def\appendixhead#1#2#3#4{%
    \section*{Appendix}

    An appendix to this paper is available in electronic form
    (PostScript$^{\mbox{\tiny TM}}$).  Any of the following methods
    may be used to obtain it; or see the inside back cover of a
    current issue for up-to-date instructions.

    \begin{itemize}
    \item By anonymous ftp from {\apbf acm.org}, file
    {\apbf [pubs.journals.#1.append]p#2.ps}
    \item Send electronic mail to {\apbf mailserve@acm.org} containing
    the line\\ {\apbf send~[anonymous.pubs.journals.#1.append]p#2.ps}
    \item By {\it Gopher} from {\apbf acm.org}
    \item By anonymous ftp from {\apbf ftp.cs.princeton.edu},
    file {\apbf pub/#1/append/p#2.ps}
    \item Hardcopy from {\it Article Express}, for a fee: phone
    800-238-3458, fax 201-216-8526, or write P.O.~Box~1801, Hoboken NJ
    07030; and request {\sc acm-#1-appendix-{\small #2}}.
    \end{itemize}

    \clearpage
    \pagenumbering{withappendix}
    \appendix
    \par
    \noindent{\sc this document is the appendix to the following
    paper:}
    \hfill
    \vskip 1em
    \vbox{\sf \parindent\z@\@title}%
    \vskip .5em
    \vbox{\sf \parindent\z@\@author}%
    \vskip .5em\noindent
    \vskip 10\p@\noindent #4
    \vskip 11\p@\noindent
    \hrule \@height .2\p@
    \par
    \begin{bottomstuff}
    \permission
    \copyright #3 ACM
    \par
    \end{bottomstuff}
}
%</trans>
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\appendix}
%    \begin{macrocode}
\def\appendix{%
    \par
    \part{Appendix}%
    \par
    \setcounter{section}{0}%
    \setcounter{subsection}{0}%
    \def\thesection{\Alph{section}}%
    \def\thesubsection{\thesection.\arabic{subsection}}%
}
%    \end{macrocode}
%    \end{macro}
%
%
%    \subsection{Lists}
%
%    \begin{macrocode}
\labelsep 5pt

\settowidth{\leftmargini}{(9)}
\addtolength\leftmargini\labelsep

\settowidth{\leftmarginii}{(b)}
\addtolength\leftmarginii\labelsep

\leftmarginiii  \leftmarginii
\leftmarginiv   \leftmarginii
\leftmarginv    \leftmarginii
\leftmarginvi   \leftmarginii
\leftmargin     \leftmargini

\labelwidth\leftmargini
\advance\labelwidth-\labelsep
%    \end{macrocode}
%
%    \begin{macro}{\@listI}
%    \begin{macro}{\@listi}
%    \begin{macrocode}
\def\@listI{%
    \leftmargin\leftmargini
    \parsep \z@ \@plus \p@
    \topsep 6\p@ \@plus 2\p@ \@minus 2\p@
    \itemsep 2\p@ \@plus \p@ \@minus .5\p@
}

\let\@listi\@listI

\@listi
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%
%    \begin{macro}{\@listii}
%    \begin{macrocode}
\def\@listii{%
    \leftmargin\leftmarginii
    \labelwidth\leftmarginii
    \advance\labelwidth-\labelsep
    \topsep \z@ \@plus \p@
    \parsep \z@ \@plus .5\p@
    \itemsep \parsep
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@listiii}
%    \begin{macrocode}
\def\@listiii{%
    \leftmargin\leftmarginiii
    \labelwidth\leftmarginiii
    \advance\labelwidth-\labelsep
    \topsep \z@ \@plus \p@
    \parsep \z@ \@plus .5\p@
    \itemsep \parsep
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@listiv}
%    \begin{macrocode}
\def\@listiv{%
    \leftmargin\leftmarginiv
    \labelwidth\leftmarginiv
    \advance\labelwidth-\labelsep
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@listv}
%    \begin{macrocode}
\def\@listv{%
    \leftmargin\leftmarginv
    \labelwidth\leftmarginv
    \advance\labelwidth-\labelsep
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@listvi}
%    \begin{macrocode}
\def\@listvi{%
    \leftmargin\leftmarginvi
    \labelwidth\leftmarginvi
    \advance\labelwidth-\labelsep
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{environment}{enumerate}
%    \begin{macrocode}
\def\enumerate{%
    \ifnum \@enumdepth >3
        \@toodeep
    \else
        \advance\@enumdepth \@ne
        \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
        \list{\csname label\@enumctr\endcsname}{%
            \usecounter{\@enumctr}%
            \def\makelabel##1{##1\hss}%
        }%
    \fi
}

\let\endenumerate\endlist
%    \end{macrocode}
%    \end{environment}
%
%    \begin{environment}{longenum}
%    \begin{macrocode}
%<*trans>
\def\longenum{%
    \ifnum \@enumdepth >3
        \@toodeep
    \else
        \advance\@enumdepth \@ne
        \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
        \list{\csname label\@enumctr\endcsname}{%
            \usecounter{\@enumctr}%
            \labelwidth\z@
        }%
    \fi
}
%\leftmargin\z@ \itemindent\parindent}\fi} - this indents each item in
%    enumerate

\let\endlongenum\endlist
%</trans>
%    \end{macrocode}
%    \end{environment}
%    Added \cs{rom} around all list labels. -- dmj, 4/19/96
%    \begin{macrocode}
\def\labelenumi{\rom{(\arabic{enumi})}}
\def\theenumi{\arabic{enumi}}
\def\labelenumii{\rom{(\alph{enumii})}}
\def\theenumii{\alph{enumii}}
\def\p@enumii{\rom{\theenumi}}
\def\labelenumiii{\rom{\roman{enumiii}.}}
\def\theenumiii{\roman{enumiii}}
\def\p@enumiii{\rom{\theenumi(\theenumii)}}
\def\labelenumiv{\rom{\Alph{enumiv}.}}
\def\theenumiv{\Alph{enumiv}}
\def\p@enumiv{\rom{\p@enumiii\theenumiii}}
%    \end{macrocode}
%
%    \begin{environment}{itemize}
%    \begin{macrocode}
\def\itemize{%
    \list{---\hskip -\labelsep}{%
        \settowidth{\leftmargin}{---}%
        \labelwidth\leftmargin
        \addtolength{\labelwidth}{-\labelsep}%
    }%
}

\let\enditemize\endlist
%    \end{macrocode}
%    \end{environment}
%
%    \begin{environment}{longitem}
%    \begin{macrocode}
%<*trans>
\def\longitem{%
    \list{---}{%
        \labelwidth\z@
        \leftmargin\z@
        \itemindent\parindent
        \advance\itemindent\labelsep
    }%
}

\let\endlongitem\endlist
%</trans>
%    \end{macrocode}
%    \end{environment}
%
%    \begin{environment}{verse}
%    \begin{macrocode}
\def\verse{%
    \let\\=\@centercr
    \list{}{%
        \leftmargin 2pc
        \itemindent -1.5em
        \listparindent \itemindent
        \rightmargin\leftmargin
        \advance\leftmargin 1.5em
    }%
    \item[]
}

\let\endverse\endlist
%    \end{macrocode}
%    \end{environment}
%
%    \begin{environment}{quotation}
%    \begin{macrocode}
\def\quotation{%
    \list{}{%
        \leftmargin 2pc
        \listparindent .5em
        \itemindent\listparindent
        \rightmargin\leftmargin
        \parsep \z@ \@plus \p@
    }%
    \item[]
}

\let\endquotation=\endlist
%    \end{macrocode}
%    \end{environment}
%
%    \begin{environment}{quote}
%    \begin{macrocode}
\def\quote{%
    \list{}{%
        \leftmargin 2pc
        \rightmargin\leftmargin
    }%
    \item[]
}

\let\endquote=\endlist
%    \end{macrocode}
%    \end{environment}
%
%    \begin{environment}{description}
%    \begin{macrocode}
\def\description{%
    \list{}{%
        \listparindent\parindent
        \labelwidth\z@
        \leftmargin\z@
        \itemindent\parindent
        \advance\itemindent\labelsep
        \def\makelabel##1{\it ##1.}%
    }%
}

\let\enddescription\endlist
%    \end{macrocode}
%    \end{environment}
%
%    \begin{environment}{describe}
%    \begin{macrocode}
\def\describe#1{%
    \list{}{%
        \listparindent\parindent
        \settowidth{\labelwidth}{#1}%
        \leftmargin\labelwidth
        \addtolength\leftmargin\labelsep
        \def\makelabel##1{##1\hfil}%
    }%
}

\let\enddescribe\endlist
%    \end{macrocode}
%    \end{environment}

%    \begin{environment}{program}
%    There must be a more robust way of doing this.  Should really do
%    it by checking we are in a figure, but that would require some
%    added bookkeeping.
%    \begin{macrocode}
\def\program{%
%<209>    \ifx\@currsize\normalsize
%<2e>    \ifdim\f@size pt=10pt
        \small
    \else
        \rm
    \fi
    \tabbing
}

\let\endprogram\endtabbing
%    \end{macrocode}
%    \end{environment}
%
%
%    \subsection{Theorems and proofs}
%
%    \begin{macro}{\@begintheorem}
%    \begin{macrocode}
\def\@begintheorem#1#2{%
    \trivlist
    \item[%
%    \end{macrocode}
%    The following two lines seem a little peculiar (repeated 5
%    times).
%    \begin{macrocode}
        \hskip \parindent
        \hskip \labelsep
        {\sc #1\enskip #2.}%
    ]\it
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@opargbegintheorem}
%    \begin{macrocode}
\def\@opargbegintheorem#1#2#3{%
    \trivlist
    \item[%
        \hskip \parindent
        \hskip \labelsep
        \begingroup
            \savebox\@tempboxa{\sc #3}%
            {\sc #1}%
            \enskip #2%
            \ifdim \wd\@tempboxa>\z@
                \enskip
%    \end{macrocode}
%    Added parentheses around subtitle of lemma. -- dmj, 4/19/96
%    \begin{macrocode}
                (\box\@tempboxa)%
            \fi.%
        \endgroup
    ]\it
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\if@qeded}
%    \begin{macrocode}
\newif\if@qeded
\global\@qededfalse
%    \end{macrocode}
%    \end{macro}
%
%    \begin{environment}{proof}
%    \begin{macrocode}
\def\proof{%
    \global\@qededfalse
    \@ifnextchar[{\@xproof}{\@proof}%
}

\def\endproof{%
    \if@qeded\else\qed\fi
    \endtrivlist
}
%    \end{macrocode}
%    \begin{macro}{\@proof}
%    \begin{macrocode}
\def\@proof{%
    \trivlist
    \item[%
        \hskip \parindent
        \hskip \labelsep
        {\sc Proof.}%
    ]
    \ignorespaces
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@xproof}
%    \begin{macrocode}
\def\@xproof[#1]{%
    \trivlist
    \item[\hskip\parindent \hskip\labelsep{\sc Proof #1.}]%
    \ignorespaces
}
%    \end{macrocode}
%    \end{macro}
%    \end{environment}
%
%    \begin{macro}{\qed}
%    \begin{macrocode}
\def\qed{%
    \unskip
    \kern 10\p@
    \begingroup
        \unitlength\p@
        \linethickness{.4\p@}%
        \framebox(6,6){}%
    \endgroup
    \global\@qededtrue
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\newdef}
%    \begin{macrocode}
\def\newdef#1#2{%
    \expandafter\@ifdefinable\csname #1\endcsname
        {\@definecounter{#1}%
         \expandafter\xdef\csname the#1\endcsname{\@thmcounter{#1}}%
         \global\@namedef{#1}{\@defthm{#1}{#2}}%
         \global\@namedef{end#1}{\@endtheorem}%
    }%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@defthm}
%    \begin{macrocode}
\def\@defthm#1#2{%
    \refstepcounter{#1}%
    \@ifnextchar[{\@ydefthm{#1}{#2}}{\@xdefthm{#1}{#2}}%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@xdefthm}
%    \begin{macrocode}
\def\@xdefthm#1#2{%
    \@begindef{#2}{\csname the#1\endcsname}%
    \ignorespaces
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@ydefthm}
%    \begin{macrocode}
\def\@ydefthm#1#2[#3]{%
    \trivlist
    \item[%
        \hskip \parindent
        \hskip \labelsep
        \begingroup
            \savebox\@tempboxa{\it #3}%
            {\it #2}%
            \enskip \csname the#1\endcsname
            \ifdim \wd\@tempboxa>\z@
                \enskip
%    \end{macrocode}
%    The following is inconsistent with the corresponding line in
%    \cs{opargbegintheorem}.
%    \begin{macrocode}
                \rom(\box\@tempboxa\rom)%
            \fi.%
        \endgroup
    ]%
    \ignorespaces
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@begindef}
%    \begin{macrocode}
\def\@begindef#1#2{%
    \trivlist
    \item[%
        \hskip \parskip
        \hskip \labelsep
%    \end{macrocode}
%    The following is inconsistent with the corresponding line in
%    \cs{opargbegintheorem}.
%    \begin{macrocode}
        {\it #1\enskip \rom{#2}.}%
    ]%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\theequation}
%    \begin{macrocode}
\def\theequation{\arabic{equation}}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{environment}{titlepage}
%    \begin{macrocode}
\def\titlepage{%
    \@restonecolfalse
    \if@twocolumn
        \@restonecoltrue
        \onecolumn
    \else
        \newpage
    \fi
    \thispagestyle{empty}%
    \c@page\z@
}

\def\endtitlepage{%
    \if@restonecol
        \twocolumn
    \else
        \newpage
    \fi
}
%    \end{macrocode}
%    \end{environment}
%
%    \begin{macrocode}
\arraycolsep 2.5pt

%<*209>
\tabcolsep 6pt
\arrayrulewidth .4pt
\doublerulesep 2pt
\tabbingsep \labelsep

\skip\@mpfootins = \skip\footins
\fboxsep = 3pt \fboxrule = .4pt
%</209>
%    \end{macrocode}
%
%
%    \subsection{Tables of contents}
%
%    \begin{macro}{\@pnumwidth}
%    \begin{macro}{\@tocrmarg}
%    \begin{macro}{\@dotsep}
%    \begin{macro}{\c@tocdepth}
%    \begin{macrocode}
%<*209>
\def\@pnumwidth{1.55em}
\def\@tocrmarg {2.55em}
\def\@dotsep{4.5}
\setcounter{tocdepth}{3}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%    \begin{macro}{\tableofcontents}
%    \begin{macrocode}
\def\tableofcontents{%
    \section*{Contents\@mkboth{CONTENTS}{CONTENTS}}
    \@starttoc{toc}%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\l@part}
%    \begin{macrocode}
\def\l@part#1#2{%
    \addpenalty\@secpenalty
    \addvspace{2.25em \@plus \p@}%
    \begingroup
        \@tempdima 3em
        \parindent \z@
        \rightskip \@pnumwidth
        \parfillskip -\@pnumwidth
        \begingroup
            \large
            \bf
            \leavevmode
            #1%
            \hfil
            \hb@xt@\@pnumwidth{\hss #2}%
        \endgroup
        \par
        \nobreak
        \endgroup
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\l@section}
%    \begin{macrocode}
\def\l@section#1#2{%
    \addpenalty\@secpenalty
    \addvspace{1.0em \@plus \p@}%
    \@tempdima 1.5em
    \begingroup
        \parindent \z@
        \rightskip \@pnumwidth
        \parfillskip -\@pnumwidth
        \bf
        \leavevmode
        #1%
        \hfil
        \hb@xt@\@pnumwidth{\hss #2}%
        \par
    \endgroup
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\l@subsection}
%    \begin{macro}{\l@subsubsection}
%    \begin{macrocode}
\def\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}

\def\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%
%    \begin{macro}{\listoffigures}
%    \begin{macro}{\l@figure}
%    \begin{macrocode}
\def\listoffigures{%
    \section*{List of Figures\@mkboth{LIST OF FIGURES}{LIST OF FIGURES}}
    \@starttoc{lof}%
}

\def\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%
%    \begin{macro}{\listoftables}
%    \begin{macro}{\l@table}
%    \begin{macrocode}
\def\listoftables{%
    \section*{List of Tables\@mkboth{LIST OF TABLES}{LIST OF TABLES}}
    \@starttoc{lot}%
}

\let\l@table\l@figure
%</209>
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%
%
%    \subsection{Bibliographies and indexes}
%
%    \begin{environment}{thebibliography}
%    Which is the correct definition, this one or the one at the end
%    of the file?
%    \begin{macrocode}
\def\thebibliography#1{%
    \par
    \footnotesize
    \@startsection{subsection}{2}{\z@}{16\p@ \@plus 2\p@ \@minus \p@}
        {2\p@}{\sf}*{\uppercase{\refname}}
    \list{\arabic{enumi}.}{%
        \settowidth\labelwidth{99.}%
        \leftmargin\labelwidth
        \advance\leftmargin\labelsep
        \topsep \z@
        \parsep \z@ \@plus .1\p@
        \itemsep \parsep
        \usecounter{enumi}%
    }%
    \def\newblock{\hskip .11em \@plus .33em \@minus .07em}%
    \sloppy
    \widowpenalty4500
    \clubpenalty4500
    \sfcode`\.=1000
    \relax
}

\let\endthebibliography=\endlist
%    \end{macrocode}
%    \end{environment}
%
%    \begin{macro}{\if@restonecol}
%    \begin{macrocode}
%<*209>
\newif\if@restonecol
%    \end{macrocode}
%    \end{macro}
%
%    \begin{environment}{theindex}
%    \begin{macrocode}
\def\theindex{%
    \@restonecoltrue
    \if@twocolumn \@restonecolfalse \fi
    \columnseprule \z@
    \columnsep 35\p@
    \twocolumn[\section*{Index}]
    \@mkboth{INDEX}{INDEX}%
    \thispagestyle{plain}%
    \parindent\z@
    \parskip\z@ \@plus .3\p@\relax
    \let\item\@idxitem
}

\def\endtheindex{%
    \if@restonecol
        \onecolumn
    \else
        \clearpage
    \fi
}
%    \end{macrocode}
%    \end{environment}
%
%    \begin{macro}{\@idxitem}
%    \begin{macro}{\subitem}
%    \begin{macro}{\subsubitem}
%    \begin{macro}{\indexspace}
%    \begin{macrocode}
\def\@idxitem{\par\hangindent 40\p@}
\def\subitem{\par\hangindent 40\p@ \hspace*{20\p@}}
\def\subsubitem{\par\hangindent 40\p@ \hspace*{30\p@}}
\def\indexspace{\par \vskip 10\p@ \@plus 5\p@ \@minus 3\p@\relax}
%</209>
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%    \begin{macro}{\footnoterule}
%    This is supposed to be of 0 overall height.
%
%    Wait a minute.  Height .004 points?  Surely joking.
%    \begin{macrocode}
\def\footnoterule{%
    \kern-3\p@
    \hrule \@width 47\p@ %\@height .004\p@
    \kern 2.6\p@
}
%    \end{macrocode}
%    \end{macro}
%
%
%    \subsection{Floats and captions}
%
%    \begin{macro}{\@makefntext}
%    \begin{macrocode}
\long\def\@makefntext#1{%
    \parindent 1em
    \noindent $^{\@thefnmark}$#1%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\c@topnumber}
%    \begin{macro}{\topfraction}
%    \begin{macro}{\c@bottomnumber}
%    \begin{macro}{\bottomfraction}
%    \begin{macro}{\c@totalnumber}
%    \begin{macro}{\textfraction}
%    \begin{macro}{\floatpagefraction}
%    \begin{macro}{\c@dbltopnumber}
%    \begin{macro}{\dbltopfraction}
%    \begin{macro}{\dblfloatpagefraction}
%
%    Changed float placement parameters in an attempt to enforce the
%    ACM's styles.  In particular, set \cnt{bottomnumber} and
%    \cs{bottomfraction} to~0 to inhibit floats from appearing at the
%    bottom of a page.  There should be a minimum of four lines of
%    text on a page, so \cs{texfraction} should be set to
%    \[
%       4 \times \left(\frac{\cs{baselineskip}}{\cs{textheight}}\right)
%           = 4 \times \left(\frac{1\,\mathrm{pc}}{47\,\mathrm{pc}}\right)
%           \approx .085106
%    \]
%    We'll round this up to .086 since it's probably better to require
%    a little more than we need than to risk allowing less than we
%    want.  Finally, we set \cs{topfraction} to~.92 so that floats at
%    the top of a page will be allowed to take up as much as $1 -
%    \cs{textfraction}$ of the page.  [Note: need to check what value
%    of \cs{floatpagefraction} should be.] -- dmj, 4/17/96
%
%    \begin{macrocode}
%<209>\setcounter{topnumber}{2}
\def\topfraction{.92}
\setcounter{bottomnumber}{0}
\def\bottomfraction{0}
%<209>\setcounter{totalnumber}{3}
\def\textfraction{.086}
\def\floatpagefraction{.6}
%<209>\setcounter{dbltopnumber}{2}
%<209>\def\dbltopfraction{.7}
%<209>\def\dblfloatpagefraction{.5}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%    \begin{macro}{\@makecaption}
%    Changed colon to period in ``long caption'' case. [8/14/95--dmj]
%
%    We should think about consolidating and/or merging some of the
%    numerous caption macros.  For example, \cs{nocaption} would be
%    unnecessary if \cs{caption} did something sensible when handed an
%    empty argument.  Also, much of \cs{@makecaption} is identical to
%    code found elsewhere, and should probably be shared.
%    \begin{macrocode}
\long\def\@makecaption#1#2{%
    \vskip 1pc
    \setbox\@tempboxa\hbox{#1.\quad #2}%
    \ifdim \wd\@tempboxa >\hsize
        #1.\quad #2\par
    \else
        \centerline{\box\@tempboxa}%
    \fi
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\nocaption}
%    \begin{macrocode}
\def\nocaption{%
    \refstepcounter\@captype
    \par
    \vskip 1pc
    \centerline{\footnotesize \csname fnum@\@captype \endcsname}%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\c@figure}
%    \begin{macro}{\thefigure}
%    \begin{macro}{\fps@figure}
%    \begin{macro}{\ftype@figure}
%    \begin{macro}{\ext@figure}
%    \begin{macro}{\figurename}
%    \begin{macro}{\fnum@figure}
%    \begin{macrocode}
%<209>\newcounter{figure}
\def\thefigure{\@arabic\c@figure}
%    \end{macrocode}
%    Changed \cs{fps@figure} from ``tbp'' to ``tp'' so that tables will
%    only occur at the top of pages by default.  Note that the author
%    can still override this with an explicit optional argument on a
%    figure or table environment, but that case should be taken care
%    of by having \cnt{bottomnumber} and \cs{bottomfraction} both set
%    to~0.  Also changed \cs{fps@table} accordingly. -- dmj, 4/17/96
%    \begin{macrocode}
\def\fps@figure{tp}
\def\ftype@figure{1}
\def\ext@figure{lof}
\def\figurename{Fig.}
\def\fnum@figure{\figurename~\thefigure}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%    \begin{macro}{\figfilename}
%    \begin{macro}{\@figfilename}
%    \begin{macrocode}
\def\figfilename{\gdef\@figfilename}
\let\@figfilename\@empty
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%
%    \begin{environment}{figure}
%    If producing fair copy, we force each figure onto a page by
%    itself by (a) forcing a placement specifier of ``p'' and (b)
%    resizing the figure to be a full page in height.
%    \begin{macrocode}
\if@faircopy
%<209>    \newenvironment{figure}{%
%<2e>    \renewenvironment{figure}[1][p]{%
        \let\normalsize\footnotesize
        \normalsize
%<209>        \@ifnextchar[{\@figure}{\@figure[]}%
%<2e>        \@float{figure}[p]%
    }{\end@float
        \global\setbox\@currbox\vbox to\textheight{%
            \vskip\@fptop
            \unvbox\@currbox
            \vskip\@fpbot
%    \end{macrocode}
%    What to do about figures with no numbers?  Should we issue a
%    warning?  Should check with ACM to make sure that a caption
%    number is always required.
%    \begin{macrocode}
            \noindent \fnum@figure
            \ifx\@figfilename\@empty\else
                : {\tt \@figfilename}%
                \global\let\@figfilename\@empty
            \fi
        }%
    }
\else
%<209>    \newenvironment{figure}{%
%<2e>    \renewenvironment{figure}{%
        \let\normalsize\footnotesize
        \normalsize
        \@float{figure}
    }{\end@float}
\fi
%    \end{macrocode}
%
%    \begin{macro}{\@figure}
%    \begin{macrocode}
%<209>\def\@figure[#1]{\@float{figure}[p]}
%    \end{macrocode}
%    \end{macro}
%    \end{environment}
%
%    \begin{environment}{figure*}
%    We don't support twocolumn mode, so \Lenv{figure*} is identical
%    to \Lenv{figure}.
%    \begin{macrocode}
\expandafter\let\csname figure*\endcsname\figure
\expandafter\let\csname endfigure*\endcsname\endfigure
%    \end{macrocode}
%    \end{environment}
%
%    \begin{environment}{table}
%    \begin{macrocode}
%<209>\newenvironment{table}{%
%<2e>\renewenvironment{table}{%
    \let\normalsize\footnotesize
    \normalsize
    \@float{table}%
}{\end@float}
%    \end{macrocode}
%    \end{environment}
%
%    \begin{environment}{table*}
%    \begin{macrocode}
\expandafter\let\csname table*\endcsname\table
\expandafter\let\csname endtable*\endcsname\endtable
%    \end{macrocode}
%    \end{environment}
%
%    \begin{macro}{\thetable}
%    \begin{macro}{\c@table}
%    \begin{macro}{\fps@table}
%    \begin{macro}{\ftype@table}
%    \begin{macro}{\ext@table}
%    \begin{macro}{\tablename}
%    \begin{macro}{\fnum@table}
%    See documentation of \cs{fps@figure}. -- dmj, 4/17/96
%    \begin{macrocode}
%<209>\newcounter{table}
\def\thetable{\@Roman\c@table}
\def\fps@table{tp}
\def\ftype@table{2}
\def\ext@table{lot}
\def\tablename{Table}
\def\fnum@table{\tablename~\thetable}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%    \begin{macro}{\@narrowfig}
%    \begin{macro}{\@nfigbox}
%    \begin{macro}{\@nfcapbox}
%    \begin{macro}{\if@nfeven}
%    \begin{macrocode}
\newdimen\@narrowfig
\newbox\@nfigbox
\newbox\@nfcapbox
\newif\if@nfeven
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%    \begin{environment}{acmtable}
%    \begin{macrocode}
\def\acmtable#1{%
    \@narrowfig #1\relax
    \let\caption\@atcap
    \let\nocaption\@atnocap
    \@ifnextchar[{\@ntab}{\@ntab[\fps@table]}%
}

\def\@ntab[#1]{%
    \expandafter\table\expandafter[#1]%
    \setbox\@nfigbox\vbox\bgroup
        \hsize \@narrowfig
        \@parboxrestore
}

\def\endacmtable{%
    \hb@xt@\textwidth{%
        \hfil
        \vbox{%
            \hsize \@narrowfig
            \box\@nfcapbox{%
                \baselineskip 4\p@
                \hbox{\vrule \@height .4\p@ \@width \hsize}%
            }%
            \vskip -\p@
            \box\@nfigbox
            \vskip -\p@
            \begingroup
                \baselineskip 4\p@
                \hbox{\vrule \@height .4\p@ \@width \hsize}%
            \endgroup
        }%
        \hfil
    }%
    \end@float
}
%    \end{macrocode}
%    \end{environment}
%
%    \begin{macro}{\@atmakecap}
%    \begin{macrocode}
\def\@atmakecap#1#2{%
    \setbox\@tempboxa\hbox{#1.\quad #2}%
    \ifdim \wd\@tempboxa >\hsize
        \sloppy #1.\quad #2 \par
    \else
        \centerline{\box\@tempboxa}%
    \fi
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@atcap}
%    \begin{macrocode}
\def\@atcap{%
        \par
    \egroup
    \refstepcounter\@captype
    \@dblarg{\@atcapx\@captype}%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@atcapx}
%    \begin{macrocode}
\long\def\@atcapx#1[#2]#3{%
    \addcontentsline{\csname ext@#1\endcsname}{#1}{%
        \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}%
    }%
    \setbox\@nfcapbox\vbox{%
        \hsize \wd\@nfigbox
        \@parboxrestore
        \@atmakecap{\csname fnum@#1\endcsname}{\ignorespaces #3}%
        \par
    }%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@atnocap}
%    \begin{macrocode}
\def\@atnocap{%
    \egroup
    \refstepcounter\@captype
    \setbox\@nfcapbox\vbox{%
        \hsize \wd\@nfigbox
        \centerline{\footnotesize \fnum@table}
    }%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{environment}{narrowfig}
%    \begin{macro}{\@nfig}
%    \begin{macrocode}
\def\narrowfig#1{%
    \@narrowfig #1\relax
    \let\caption\@nfcap
    \let\nocaption\@nfnocap
    \@ifnextchar[{\@nfig}{\@nfig[\fps@figure]}%
}

\def\@nfig[#1]{%
    \expandafter\figure\expandafter[#1]%
    \setbox\@nfigbox\vbox\bgroup
        \hsize\@narrowfig
        \@parboxrestore
}

\def\endnarrowfig{%
    \hb@xt@\textwidth{%
        \if@nfeven
            \box\@nfcapbox  \hfil   \box\@nfigbox
        \else
            \box\@nfigbox   \hfil   \box\@nfcapbox
        \fi
    }%
%    \end@float
    \endfigure
}
%    \end{macrocode}
%    \end{macro}
%    \end{environment}
%
%    Ah ha!  So captions have to go at end of figure, not before.
%    Seems a little unfriendly.  Actually, it's necessary for
%    \Lenv{narrowfig}, but doesn't seem to be necessary for
%    \Lenv{acmtable}.
%
%    \begin{macro}{\@nfcap}
%    \begin{macrocode}
\def\@nfcap{%
        \par
    \egroup
    \refstepcounter\@captype
    \@dblarg{\@nfcapx\@captype}%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@nfmakecap}
%    \begin{macrocode}
\def\@nfmakecap #1#2{%
    \setbox\@tempboxa\hbox{#1.\quad #2}%
    \ifdim \wd\@tempboxa >\hsize
        \sloppy #1.\quad #2 \par
    \else
        \@@line{%
            \if@nfeven\else\hfil\fi
            \box\@tempboxa
            \if@nfeven\hfil\fi
        }%
    \fi
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@nfcapx}
%    \begin{macrocode}
\long\def\@nfcapx#1[#2]#3{%
    \addcontentsline{\csname ext@#1\endcsname}{#1}{%
        \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}%
    }%
    \@seteven
    \setbox\@nfcapbox\vbox to \ht\@nfigbox{%
        \hsize \textwidth
        \advance\hsize -2pc
        \advance\hsize -\wd\@nfigbox
        \@parboxrestore
        \vfil
        \@nfmakecap{\csname fnum@#1\endcsname}{\ignorespaces #3}%
        \par
        \vfil
    }%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@nfnocap}
%    \begin{macrocode}
\def\@nfnocap{%
    \egroup
    \refstepcounter\@captype
    \@seteven
    \setbox\@nfcapbox\vbox to \ht\@nfigbox{%
        \hsize \textwidth
        \advance\hsize -2pc
        \advance\hsize -\wd\@nfigbox
        \@parboxrestore
        \vfil
        \@@line{%
            \if@nfeven\else\hfil\fi
            \footnotesize \fnum@figure
            \if@nfeven\hfil\fi
        }%
        \vfil
    }%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@seteven}
%    \begin{macro}{\@nfmsg}
%    \begin{macrocode}
\def\@seteven{%
    \@nfeventrue
    \@ifundefined{r@@nf\thefigure}{}{%
        \edef\@tmpnf{\csname r@@nf\thefigure\endcsname}%
        \edef\@tmpnf{\expandafter\@cdr\@tmpnf\@nil}%
        \ifodd\@tmpnf\relax
            \@nfevenfalse
        \fi
    }%
    \label{@nf\thefigure}%
    \edef\@tmpnfx{\if@nfeven e\else o\fi}%
    \edef\@tmpnf{%
        \write\@unused{%
            \noexpand\ifodd \noexpand\c@page
                \noexpand\if \@tmpnfx e%
                    \noexpand\@nfmsg{\thefigure}
                \noexpand\fi
            \noexpand\else
                \noexpand\if \@tmpnfx o%
                    \noexpand\@nfmsg{\thefigure}%
                \noexpand\fi
            \noexpand\fi
        }%
    }%
    \@tmpnf
}

%<209>\def\@nfmsg#1{Bad narrowfig: Figure #1 on page \thepage}
%<*2e>
\def\@nfmsg#1{%
    \PackageWarning{acmart}{Bad narrowfig: Figure #1 on page \thepage}%
}
%</2e>
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%
%    \begin{macro}{\@narrowfig}
%    \begin{macro}{\@nfigbox}
%    \begin{macro}{\@nfcapbox}
%    \begin{macro}{\if@nfeven}
%    \begin{macrocode}
\newdimen\@narrowfig
\newbox\@nfigbox
\newbox\@nfcapbox
\newif\if@nfeven
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%    \begin{environment}{authinfo}
%    Could be redone so that order isn't important.  But maybe not
%    worth effort.
%    \begin{macrocode}
\newenvironment{authinfo}{%
    \newcommand{\name}[1] {Name: ##1\newline }
    \newcommand{\address}[1] {Address: ##1\newline }
    \newcommand{\affiliation}[1]  {Affiliation: ##1\newline }
    \newcommand{\biography}[1]  {Biography: ##1\newline}
}{}
%    \end{macrocode}
%    \end{environment}
%
%    \begin{environment}{sponsor}
%    \Lenv{sponsor} should be redone as a real environment.  But this
%    has to await clarification from ACM about what they want the
%    markup to be.
%    \begin{macrocode}
\newenvironment{sponsor}[2]{%
    Sponsor: #1\strut\newline
    \parbox{3.in}{#2}%
}{\newline}
%    \end{macrocode}
%    \end{environment}
%
%    \begin{macro}{\and}
%    \begin{macro}{\maketitle}
%    \begin{macrocode}
\def\and{\\ and\\}

%* Probably still needs more work

\def\maketitle{%
    \newpage
    \thispagestyle{titlepage}%
%<209>    \global\@topnum\z@
%<*2e>
    \suppressfloats[t]%
%</2e>
%    \par
    \begingroup
        \lineskip \z@
        \null
        \vskip -30\p@\relax
        \parindent\z@
        \begingroup
            \LARGE
            \raggedright
            \hyphenpenalty\@M
            \sf \@title
            \par
        \endgroup
        \vskip 13.5\p@
%        \normalsize
%        \sf
        %vskip 13.5pt between title and author
        \begingroup
            \addtolength{\baselineskip}{2\p@}%
            \sf
            \@author\par
%            \vskip -2pt
        \endgroup
        \begingroup
            \footnotesize
%            \baselineskip 17pt\relax
            \medskip
%            \hbox{\vrule height .2pt width 30pc}%
            \rule{\textwidth}{.2\p@}%
%    \end{macrocode}
%    The space around the abstract doesn't look quite right.  Should
%    investigate and fix.  Maybe change \cs{parskip} in front matter
%    to get uniform spacing (if that's what's desired).
%    \begin{macrocode}
            \ifvoid\@abstract
%<2e>                \PackageWarning{acmart}{an abstract is required}%
%<*209>
                \typeout{^^JPackage acmart Warning: an abstract
                         is required^^J}%
%</209>
            \else
                \vskip 8.5\p@
                \box\@abstract
            \fi
            \ifx\@categories\@empty \else
                \vskip 4\p@\relax %vskip8.5 space above abstract
%<209>                \def\and{\unskip{\rm;} }%
%<2e>                \def\and{\unskip\textup; }%
                Categories and Subject Descriptors: \@categories\par
            \fi
            \ifx\@terms\@empty\else
                \vskip 4\p@
                General Terms: \ignorespaces
                \@terms
                \par
            \fi
            \ifx\@keywords\@empty\else
                \vskip 4\p@
                Additional Key Words and Phrases: \ignorespaces
                \@keywords
                \par
            \fi
        \endgroup
        \label{@firstpg}%
%        {\baselineskip 14pt\relax
%         \hbox{\vrule height .2pt width 30pc}%
        \rule{\textwidth}{.2\p@}%
%        }%
        \vskip 23\p@
    \endgroup
    \let\maketitle\relax
%    \end{macrocode}
%    Now we empty out a few temporary variables.  However, note that
%    we don't clear out \cs{@author} and \cs{@title}, since we
%    need those later for \cs{appendixhead}.
%    \begin{macrocode}
    \global\let\@categories\@empty
    \global\let\@terms\@empty
    \global\let\@keywords\@empty
}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%
%    \begin{environment}{abstract}
%    \begin{macro}{\@abstract}
%    \begin{macrocode}
\newbox\@abstract
%    \end{macrocode}
%    \end{macro}
%    \begin{macrocode}
\def\abstract{%
    \everypar{}%
    \global\setbox\@abstract\vbox\bgroup
        \footnotesize
        \trivlist\item[]\ignorespaces
}

\def\endabstract{%
        \endtrivlist
    \egroup
    \ifx\maketitle\relax
%<*2e>
        \PackageWarning{acmart}{%
            the abstract must be specified before the \MessageBreak
            \string\maketitle\space command%
        }%
%</2e>
%<*209>
       \typeout{^^JPackage acmart Warning:
            the abstract must be specified before the^^J%
            \string\maketitle\space command^^J%
        }%
%</209>
        \box\@abstract
    \fi
}
%    \end{macrocode}
%    \end{environment}
%
%    \begin{macro}{\terms}
%    \begin{macro}{\@terms}
%    \begin{macrocode}
\def\terms{\gdef\@terms}

\let\@terms\@empty
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%
%    \begin{macro}{\keywords}
%    \begin{macro}{\@keywords}
%    \begin{macrocode}
\def\keywords{\gdef\@keywords}

\let\@keywords\@empty
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%
%    \begin{macro}{\category}
%    \begin{macro}{\@category}
%    \begin{macro}{\@categories}
%    \begin{macrocode}
\def\category#1#2#3{%
    \@ifnextchar [{\@category{#1}{#2}{#3}}{\@category{#1}{#2}{#3}[]}%
}
%    \end{macrocode}
%    Should probably issue some sort of warning if the first or second
%    arguments are empty.
%    \begin{macrocode}
\def\@category#1#2#3[#4]{%
    \edef\@tempa{\ifx \@categories\@empty \else ; \fi}%
    \begingroup
%<209>        \def\protect{\noexpand\protect\noexpand}%
%<2e>        \let\protect\@unexpandable@protect
        \let\and\relax
        \xdef\@categories{%
            \@categories
            \@tempa
            #1 [{\bf #2}]%
            \if!#4!%
                \if!#3!\else : #3\fi
            \else
                :\space
                \if!#3!\else #3\kern\z@---\hskip\z@\fi
                {\it #4}%
            \fi
        }%
    \endgroup
}

\let\@categories\@empty
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%    \begin{environment}{bottomstuff}
%    \begin{macrocode}
\def\bottomstuff{%
%<*209>
    \global\@topnum\z@
    \global\@botroom \textheight
    \@float{figure}[b]
%</209>
%<*2e>
    \enlargethispage{-\baselineskip}%
    \suppressfloats[t]%
    \@float{figure}[!b]
%</2e>
        \footnotesize
        \parindent\z@
        \null
        \vskip -\textfloatsep
        \vskip 10\p@
        \hrule \@height .2\p@ \@width 30pc
%        \vskip 2\p@
%    \end{macrocode}
%
%    Changed this to 4pt to make up for lack of 10pt strut which used
%    to be here in place of the 0pt strut.  Could put 10pt strut back
%    in, but then we'd get extra space if there is a blank line after
%    the |\begin{bottomstuff}|.
%
%    \begin{macrocode}
        \vskip 4\p@
%    \end{macrocode}
%    Took this out since a 0pt rule isn't very useful
%    \begin{macrocode}
%        \rule{\z@}{\z@}%
        \ignorespaces
}
%    \end{macrocode}
%    For \LaTeXe, all we need at the end is \cs{end@float}.  For
%    \LaTeX~2.09, we also put in a strut to put in a little extra
%    space at the bottom of the first page.
%    \begin{macrocode}
%<2e>\let\endbottomstuff\end@float
%<*209>
\def\endbottomstuff{%
    \par
    \strut
    \end@float
}
%</209>
%    \end{macrocode}
%    \end{environment}
%
%    \begin{macro}{\permission}
%
%    Removed final line (``Permissions may be requested from
%    Publications Dept, ACM Inc., 1515 Broadway, New York, NY 10036
%    USA, fax +1 (212) 869-0481, or {\tt permissions@acm.org}.'') at
%    request of G. Criscione. -- 5/12/96
%
%    \begin{macrocode}
\long\def\permission{\par
    Permission to make digital or hard copies of part or all of this
    work for personal or classroom use is granted without fee provided
    that copies are not made or distributed for profit or direct
    commercial advantage and that copies show this notice on the first
    page or initial screen of a display along with the full citation.
    Copyrights for components of this work owned by others than ACM
    must be honored. Abstracting with credit is permitted. To copy
    otherwise, to republish, to post on servers, to redistribute to
    lists, or to use any component of this work in other works,
    requires prior specific permission and/or a fee.
    \par
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{environment}{acks}
%    Should this use small-caps instead?
%    \begin{macrocode}
\newenvironment{acks}{%
    \@startsection{subsection}{2}{\z@}{-16\p@ \@plus -2\p@ \@minus -\p@}
        {2\p@}{\sf}*{\footnotesize ACKNOWLEDGMENTS}%
}{\par}
%    \end{macrocode}
%    \end{environment}
%
%    \begin{environment}{received}
%    \begin{macrocode}
\newenvironment{received}{%
    \par
    \footnotesize
    \addvspace{18\p@ \@minus 4\p@}%
    \parindent\z@
}{%
    \label{@lastpg}%
    \par
}
%    \end{macrocode}
%    \end{environment}
%
%    \begin{macrocode}
\mark{{}{}}
%    \end{macrocode}
%
%    \begin{macro}{\ps@myheadings}
%    \begin{macrocode}
\def\ps@myheadings{%
    \let\@mkboth\@gobbletwo
    \def\@oddhead{%
%        \null
        \hfill\small\sf\rightmark
        \hskip 19\p@
        {\Large$\cdot$}%
        \hskip 17\p@
        \thepage
    }%
    \def\@oddfoot{\null\hfill\tiny\@runningfoot}
    \def\@evenhead{%
        \small\sf\thepage
        \hskip 17\p@
        {\Large$\cdot$}%
        \hskip 19\p@
        \leftmark
        \hfill
%        \null
    }%
    \def\@evenfoot{\tiny\@runningfoot \hfill\null}%
    \let\partmark\@gobble
    \let\sectionmark\@gobble
    \let\subsectionmark\@gobble
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\runningfoot}
%    \begin{macro}{\@runningfoot}
%    \begin{macro}{\firstfoot}
%    \begin{macro}{\@firstfoot}
%    \begin{macro}{\pages}
%    \begin{macrocode}
\def\runningfoot#1{\def\@runningfoot{#1}}

\let\@runningfoot\@empty

\def\firstfoot#1{\def\@firstfoot{#1}}

\let\@firstfoot\@empty

\def\pages{\pageref{@firstpg}--\pageref{@lastpg}}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%    \begin{macro}{\ps@titlepage}
%    \begin{macrocode}
\def\ps@titlepage{%
    \let\@mkboth\@gobbletwo
    \let\@oddhead\@empty
    \def\@oddfoot{\null\hfill\tiny\@firstfoot}%
    \let\@evenhead\@empty
    \def\@evenfoot{\tiny\@firstfoot\hfill\null}%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\today}
%    \begin{macrocode}
\def\today{%
    \ifcase\month \or
    January\or
    February\or
    March\or
    April\or
    May\or
    June\or
    July\or
    August\or
    September\or
    October\or
    November\or
    December
    \fi
    \space\number\day, \number\year
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{environment}{marray}
%    \Lenv{marray} is a variant of array where every entry is in
%    \cs{displaystyle} rather than \cs{textstyle}
%    \begin{macrocode}
\def\marray{%
    \arraycolsep 2.5\p@
    \let\@acol\@arrayacol
    \let\@classz\@marrayclassz
    \let\@classiv\@marrayclassiv
    \let\\\@arraycr
    \let\@halignto\@empty
    \@tabarray
}

\let\endmarray\endarray
%    \end{macrocode}
%    \begin{macro}{\@marrayclassiv}
%    \begin{macro}{\@marrayclassz}
%    \begin{macrocode}
\def\@marrayclassiv{\@addtopreamble{$\displaystyle \@nextchar$}}

\def\@marrayclassz{%
    \ifcase \@lastchclass
    \@acolampacol
    \or \@ampacol
    \or
    \or
    \or \@addamp
    \or \@acolampacol
    \or \@firstampfalse \@acol
    \fi
    \edef\@preamble{%
        \@preamble
        \ifcase \@chnum
            \hfil$\relax\displaystyle\@sharp$\hfil
            \or $\relax\displaystyle\@sharp$\hfil
            \or \hfil$\relax\displaystyle\@sharp$%
        \fi
    }%
}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{environment}
%
%    \begin{macrocode}
\ps@myheadings

\pagenumbering{arabic}

\onecolumn

%\if@faircopy \raggedright \fi

\parindent 10pt
%</cls>
%    \end{macrocode}
%
%    \section{Bibliography stuff}
%
%    The following code was adapted from version 4 of
%    \file{chicago.sty} by Glenn Paulley
%    $\langle$\texttt{gnpaulle@bluebox.uwaterloo.ca}$\rangle$ for the
%    new ACM bibliography style, which is similar (but not identical)
%    to the ``Chicago'' style.  It should be used with the
%    \file{acmtrans} \BibTeX\ style.  The code was originally adapted
%    by Andrew Appel and Rebecca Davies and later reworked by David M.
%    Jones.  Most of the prehistory of \file{chicago.sty} has been
%    removed from the comments below, and the code has been modernized
%    and reorganized somewhat in the interests of efficiency and
%    (hopefully) maintainability.
%
%    The \file{acmtrans} \BibTeX\ style has support for abbreviated
%    author lists and for year-only citations.  This is implemented by
%    having the citations actually look like
%    \begin{quote}
%
%    \cs{citeauthoryear}\ignorespaces
%    \verb+{+\meta{full-author-info}\verb+}+\ignorespaces
%    \verb+{+\meta{abbrev-author-info}\verb+}+\ignorespaces
%    \verb+{+\meta{year}\verb+}+
%    \end{quote}
%    These labels are processed by the following \LaTeX\ commands.
%    \begin{description}
%
%    \item[\cs{cite}]
%    produces citations with full author list and year, e.g., ``[Brown
%    1978; Jarke, Turner, Stohl, et al. 1985]''
%
%    \item[\cs{citeA}]
%    produces citations with only the full author list, e.g.,
%    ``[Brown; Jarke, Turner and Stohl]''
%
%    \item[\cs{shortcite}]
%    produces citations with an abbreviated author list and year.
%
%    \item[\cs{shortciteA}]
%    produces only the abbreviated author list.
%
%    \item[\cs{citeyear}]
%    produces the year information only, within brackets.
%
%    \item[\cs{citeN}]
%    produces citations with the full author list and year, but can be
%    used as nouns in a sentence; parentheses appear only around the
%    year, not around the author names, e.g., ``Shneiderman [1978]
%    states that\ldots''.  If given multiple citekeys, the items
%    referred to should all have the same author; otherwise, an error
%    is signaled.
%
%    \item[\cs{shortciteN}]
%    is a variant of \cs{citeN} that uses an abbreviated author list.
%
%    \end{description}
%    Each of these macros also has a $*$-form, which suppresses the
%    brackets that would normally surround the citation.  (For
%    \cs{citeN} and \cs{shortciteN}, the $*$-forms are identical to
%    the normal forms.)
%
%    Abbreviated author lists use the ``et al.'' construct.
%
%    This \LaTeX\ style file must be used a \textbf{modern} (1995 or
%    later) version of the \file{acmtrans} \BibTeX\ style.
%
%    \begin{macrocode}
%<*bib>
%<cls>\typeout{Using ACM bibliography style}
%
%<*!cls&2e>
\ProvidesPackage{acmbib}{\filedate\space\fileversion\space
ACM bibliography style}
%</!cls&2e>
%
%<!cls&209>\typeout{Package `acmbib' \fileversion\space <\filedate>.}
%
%    \end{macrocode}
%
%
% \subsection{Citation macros}
%
%    Removed |\def\@citeseppen{-1000}| from beginning of all cite
%    macros, since that was left over from named.sty and not actually
%    used anywhere, although it might not be a bad idea to incorporate
%    something of that sort into our code. -- dmj 8/8/95
%
%    Each \cs{cite}-like macro must do three things:
%    \begin{enumerate}
%
%    \item
%    Define \cs{@cite}, which will be used to format the in-text
%    citation.  Typically, this must decide whether to put brackets
%    around the reference, and handles the optional argument to
%    \cs{cite}.
%
%    \item
%    Define \cs{citeauthoryear}, which determinines which part of the
%    citation information is used in the citation.
%
%    \item
%    Call the appropriate low-level citation command, which should be
%    essentially identical to the standard \LaTeX\ \cs{cite} command.
%    In this style, this is either \cs{@citenormal}, which separates
%    multiple citations by semi-colons, or \cs{@citeyear}, which uses
%    a comma to separate multiple references.  The latter is used
%    whenever the output consists of a series of years.
%
%    \end{enumerate}
%
%
%    \begin{macro}{\bibyear}
%    See the description of \texttt{output.year.check} in
%    \file{acmtrans.dtx} for an explanation of why this is necessary.
%    The \cs{unskip}s and \cs{ignorespaces} are to eliminate any extra
%    space that might creep in otherwise.  (The first \cs{unskip} is
%    the only one that should be necessary, but the others don't
%    hurt.)
%    \begin{macrocode}
\newcommand\bibyear[2]{%
    \unskip\quad\ignorespaces#1\unskip
    \if#2..\quad \else \quad#2\relax \fi
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\bibemph}
%    \begin{macro}{\bibemphic}
%    \begin{macro}{\bibemphsc}
%    \begin{macrocode}
%<*2e>
\let\bibemph\emph
\let\bibemphic\emph
\let\bibsc\textsc
%</2e>
%<*209>
\newcommand{\bibemph}[1]{{\em#1}}
\newcommand{\bibemphic}[1]{{\em#1\/}}
\newcommand{\bibsc}[1]{{\sc#1}}
%</209>
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%    \begin{macro}{\@normalcite}
%    \cs{@normalcite} is used for any citation commands that should
%    surround their output with square brackets.
%    \begin{macrocode}
\def\@normalcite{%
    \def\@cite##1##2{[##1\if@tempswa , ##2\fi]}%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@citeNB}
%    \cs{@citeNB} puts in no brackets at all.
%    \begin{macrocode}
\def\@citeNB{%
    \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@citeRB}
%    \cs{@citeRB} just produces a right bracket; the left bracket will
%    be supplied by \cs{citeauthoryear}.  This is used by \cs{citeN}
%    and \cs{shortciteN}, which only put brackets around the years,
%    not around the authors.
%    \begin{macrocode}
\def\@citeRB{%
    \def\@cite##1##2{##1\if@tempswa , ##2\fi]}%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\start@cite}
%    Should explain this.
%    \begin{macrocode}
\def\start@cite#1#2{%
    \edef\citeauthoryear##1##2##3{%
        ###1%
        \ifnum#2=\z@ \else\ ###2\fi
    }%
    \ifnum#1=\thr@@
        \let\@@cite\@citeyear
    \else
        \let\@@cite\@citenormal
    \fi
    \@ifstar{\@citeNB\@@cite}{\@normalcite\@@cite}%
}
%    \end{macrocode}
%    \end{macro}
%
%
%    \begin{macro}{\cite}
%
%    This is using the abbreviated author list, rather than the full
%    author list.  Is this correct?  At any rate, it should be
%    consistent with \cs{citeNP}.
%    \begin{macrocode}
\def\cite{\start@cite13}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\citeNP}
%    \begin{macrocode}
\def\citeNP{\cite*}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\citeA}
%    \begin{macrocode}
\def\citeA{\start@cite10}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\citeANP}
%    \begin{macrocode}
\def\citeANP{\citeA*}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\shortcite}
%    \begin{macrocode}
\def\shortcite{\start@cite23}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\shortciteNP}
%    \begin{macrocode}
\def\shortciteNP{\shortcite*}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\shortciteA}
%    \begin{macrocode}
\def\shortciteA{\start@cite20}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\shortciteANP}
%    \begin{macrocode}
\def\shortciteANP{\shortciteA*}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\citeyear}
%    \begin{macrocode}
\def\citeyear{\start@cite30}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\citeyearNP}
%    \begin{macrocode}
\def\citeyearNP{\citeyear*}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\citeN}
%    \begin{macrocode}
\def\citeN{%
    \@citeRB
    \def\citeauthoryear##1##2##3{##1\ [##3%
        \def\reserved@a{##1}%
        \def\citeauthoryear####1####2####3{%
            \def\reserved@b{####1}%
            \ifx\reserved@a\reserved@b
                ####3%
            \else
%<*2e>
                \PackageError{acmart}{author mismatch in \string\citeN}%
%</2e>
%<*209>
                \errmessage{Package acmart Error: author mismatch
                         in \string\citeN^^J^^J%
                    See the acmart package documentation for explanation}%
%</209>
            \fi
        }%
    }%
    \@ifstar\@citeyear\@citeyear
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\shortciteN}
%    \begin{macrocode}
\def\shortciteN{%
    \@citeRB
    \def\citeauthoryear##1##2##3{##2\ [##3%
%    \end{macrocode}
%    Should \cs{shortciteN} compare the full author lists or the
%    abbreviated author lists (as it currently does)?
%    \begin{macrocode}
        \def\reserved@a{##2}%
        \def\citeauthoryear####1####2####3{%
            \def\reserved@b{####2}%
            \ifx\reserved@a\reserved@b
                ####3%
            \else
%<*2e>
                \PackageError{acmart}{%
                    author mismatch in \string\shortciteN
                }%
%</2e>
%<*209>
                \errmessage{Package acmart Error: author mismatch
                         in \string\shortciteN^^J^^J%
                    See the acmart package documentation for explanation}%
%</209>
            \fi
        }%
    }%
    \@ifstar\@citeyear\@citeyear
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@citenormal}
%    \begin{macro}{\@citeyear}
%
%    \begin{macrocode}
\def\@citenormal{%
    \@ifnextchar [{\@tempswatrue\@citex;}
                  {\@tempswafalse\@citex;[]}%
}
%
\def\@citeyear{%
    \@ifnextchar [{\@tempswatrue\@citex,}%
                  {\@tempswafalse\@citex,[]}%
}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%
%    \begin{macro}{\@citex}
%    Although multiple citations within a single cite command should
%    normally be separated by semi-colons, there are times when commas
%    should be used instead.  So, we modify the \cs{@citex} macro to
%    take the delimiter as a parameter.
%    \begin{macrocode}
\def\@citex#1[#2]#3{%
    \let\@citea\@empty
    \@cite{%
        \@for\@citeb:=#3\do{%
            \@citea
            \def\@citea{#1 }%
            \edef\@citeb{\expandafter\@iden\@citeb}%
            \if@filesw
                \immediate\write\@auxout{\string\citation{\@citeb}}%
            \fi
            \@ifundefined{b@\@citeb}{%
%<2e>                {\reset@font\bfseries ?}%
%<209>                {\bf ?}%
%<2e>                \G@refundefinedtrue
%<2e>                \@latex@warning{%
%<209>                \@warning{%
                    Citation `\@citeb' on page \thepage\space undefined%
                }%
            }%
            {\csname b@\@citeb\endcsname}%
        }%
    }{#2}%
}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\@biblabel}
%    (from apalike.sty)
%    No labels in the bibliography.
%    \begin{macrocode}
\let\@biblabel\@gobble
%</bib>
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\bibindent}
%    Indent second and subsequent lines of bibliographic entries.
%    Stolen from openbib.sty: \cs{newblock} is set to \cs{@empty}.
%    (???)
%    \begin{macrocode}
%<*cls>
\newdimen\bibindent
\bibindent=1.5em
%    \end{macrocode}
%    \end{macro}
%
%    \begin{macro}{\refname}
%    \begin{macrocode}
%<209>\def\refname{References}
%    \end{macrocode}
%    \end{macro}
%
%    \begin{environment}{thebibliography}
%    Which is the correct definition of \Lenv{thebibliography}, this
%    one or the earlier one?
%    \begin{macrocode}
\def\thebibliography#1{%
    \footnotesize
    \section*{%
        \refname
        \@mkboth{\uppercase{\refname}}{\uppercase{\refname}}%
    }%
    \list{[\arabic{enumi}]}{%
        \settowidth\labelwidth{[#1]}%
        \leftmargin\labelwidth
        \advance\leftmargin\labelsep
        \advance\leftmargin\bibindent
        \itemindent -\bibindent
        \listparindent \itemindent
        \parsep \z@
        \usecounter{enumi}%
    }%
    \let\newblock\@empty
    \sloppy
    \sfcode`\.=1000\relax
}
%</cls>
%    \end{macrocode}
%    \end{environment}
%
% \Finale
%
\endinput
