Skip to content
Snippets Groups Projects
acmart.cls 86.6 KiB
Newer Older
  • Learn to ignore specific revisions
  • Max New's avatar
    Max New committed
    %%
    %% This is file `acmart.cls',
    %% generated with the docstrip utility.
    %%
    %% The original source files were:
    %%
    %% acmart.dtx  (with options: `class')
    %% 
    %% IMPORTANT NOTICE:
    %% 
    %% For the copyright see the source file.
    %% 
    %% Any modified versions of this file must be renamed
    %% with new filenames distinct from acmart.cls.
    %% 
    %% For distribution of the original source see the terms
    %% for copying and modification in the file acmart.dtx.
    %% 
    %% This generated file may be distributed as long as the
    %% original source files, as listed above, are part of the
    %% same distribution. (The sources need not necessarily be
    %% in the same archive or directory.)
    
    Max New's avatar
    Max New committed
    %% \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         \~}
    \NeedsTeXFormat{LaTeX2e}
    \ProvidesClass{acmart}
    
    [2018/10/20 v1.55 Typesetting articles for the Association for
    Computing Machinery]
    
    Max New's avatar
    Max New committed
    \def\@classname{acmart}
    \InputIfFileExists{acmart-preload-hook.tex}{%
      \ClassWarning{\@classname}{%
        I am loading acmart-preload-hook.tex. You are fully responsible
        for any problems from now on.}}{}
    \RequirePackage{xkeyval}
    \RequirePackage{xstring}
    \define@choicekey*+{acmart.cls}{format}[\ACM@format\ACM@format@nr]{%
      manuscript, acmsmall, acmlarge, acmtog, sigconf, siggraph,
      sigplan, sigchi, sigchi-a}[manuscript]{}{%
      \ClassError{\@classname}{The option format must be manuscript,
        acmsmall, acmlarge, acmtog, sigconf, siggraph,
        sigplan, sigchi or sigchi-a}}
    \def\@DeclareACMFormat#1{\DeclareOptionX{#1}{\setkeys{acmart.cls}{format=#1}}}
    \@DeclareACMFormat{manuscript}
    \@DeclareACMFormat{acmsmall}
    \@DeclareACMFormat{acmlarge}
    \@DeclareACMFormat{acmtog}
    \@DeclareACMFormat{sigconf}
    \@DeclareACMFormat{siggraph}
    \@DeclareACMFormat{sigplan}
    \@DeclareACMFormat{sigchi}
    \@DeclareACMFormat{sigchi-a}
    \ExecuteOptionsX{format}
    \define@boolkey+{acmart.cls}[@ACM@]{screen}[true]{%
      \if@ACM@screen
        \PackageInfo{\@classname}{Using screen mode}%
      \else
        \PackageInfo{\@classname}{Not using screen mode}%
      \fi}{\PackageError{\@classname}{The option screen can be either true or
        false}}
    \ExecuteOptionsX{screen=false}
    \define@boolkey+{acmart.cls}[@ACM@]{acmthm}[true]{%
      \if@ACM@acmthm
        \PackageInfo{\@classname}{Requiring acmthm}%
      \else
        \PackageInfo{\@classname}{Suppressing acmthm}%
      \fi}{\PackageError{\@classname}{The option acmthm can be either true or
        false}}
    \ExecuteOptionsX{acmthm=true}
    \define@boolkey+{acmart.cls}[@ACM@]{review}[true]{%
      \if@ACM@review
        \PackageInfo{\@classname}{Using review mode}%
        \AtBeginDocument{\@ACM@printfoliostrue}%
      \else
        \PackageInfo{\@classname}{Not using review mode}%
      \fi}{\PackageError{\@classname}{The option review can be either true or
        false}}
    \ExecuteOptionsX{review=false}
    \define@boolkey+{acmart.cls}[@ACM@]{authorversion}[true]{%
      \if@ACM@authorversion
        \PackageInfo{\@classname}{Using authorversion mode}%
      \else
        \PackageInfo{\@classname}{Not using authorversion mode}%
      \fi}{\PackageError{\@classname}{The option authorversion can be either true or
        false}}
    \ExecuteOptionsX{authorversion=false}
    
    Max New's avatar
    Max New committed
    \define@boolkey+{acmart.cls}[@ACM@]{nonacm}[true]{%
      \if@ACM@nonacm
        \PackageInfo{\@classname}{Using nonacm mode}%
        \AtBeginDocument{\@ACM@printacmreffalse}%
        % in 'nonacm' mode we disable the "ACM Reference Format"
        % printing by default, but this can be re-enabled by the
        % user using \settopmatter{printacmref=true}
      \else
        \PackageInfo{\@classname}{Not using nonacm mode}%
      \fi}{\PackageError{\@classname}{The option nonacm can be either true or
        false}}
    \ExecuteOptionsX{nonacm=false}
    
    Max New's avatar
    Max New committed
    \define@boolkey+{acmart.cls}[@ACM@]{natbib}[true]{%
      \if@ACM@natbib
        \PackageInfo{\@classname}{Explicitly selecting natbib mode}%
      \else
        \PackageInfo{\@classname}{Explicitly deselecting natbib mode}%
      \fi}{\PackageError{\@classname}{The option natbib can be either true or
        false}}
    \ExecuteOptionsX{natbib=true}
    \define@boolkey+{acmart.cls}[@ACM@]{anonymous}[true]{%
      \if@ACM@anonymous
        \PackageInfo{\@classname}{Using anonymous mode}%
      \else
        \PackageInfo{\@classname}{Not using anonymous mode}%
      \fi}{\PackageError{\@classname}{The option anonymous can be either true or
        false}}
    \ExecuteOptionsX{anonymous=false}
    \define@boolkey+{acmart.cls}[@ACM@]{timestamp}[true]{%
      \if@ACM@timestamp
        \PackageInfo{\@classname}{Using timestamp mode}%
      \else
        \PackageInfo{\@classname}{Not using timestamp mode}%
      \fi}{\PackageError{\@classname}{The option timestamp can be either true or
        false}}
    \ExecuteOptionsX{timestamp=false}
    \define@boolkey+{acmart.cls}[@ACM@]{authordraft}[true]{%
      \if@ACM@authordraft
        \PackageInfo{\@classname}{Using authordraft mode}%
        \@ACM@timestamptrue
        \@ACM@reviewtrue
      \else
        \PackageInfo{\@classname}{Not using authordraft mode}%
      \fi}{\PackageError{\@classname}{The option authordraft can be either true or
        false}}
    \ExecuteOptionsX{authordraft=false}
    \def\ACM@fontsize{}
    \DeclareOptionX{9pt}{\edef\ACM@fontsize{\CurrentOption}}
    \DeclareOptionX{10pt}{\edef\ACM@fontsize{\CurrentOption}}
    \DeclareOptionX{11pt}{\edef\ACM@fontsize{\CurrentOption}}
    \DeclareOptionX{12pt}{\edef\ACM@fontsize{\CurrentOption}}
    \DeclareOptionX{draft}{\PassOptionsToClass{\CurrentOption}{amsart}}
    \DeclareOptionX{*}{\PassOptionsToClass{\CurrentOption}{amsart}}
    \ProcessOptionsX
    \ClassInfo{\@classname}{Using format \ACM@format, number \ACM@format@nr}
    \newif\if@ACM@manuscript
    \newif\if@ACM@journal
    \newif\if@ACM@sigchiamode
    \ifnum\ACM@format@nr=5\relax % siggraph
      \ClassWarning{\@classname}{The format siggraph is now obsolete.
        I am switching to sigconf.}
      \setkeys{acmart.cls}{format=sigconf}
    \fi
    \ifnum\ACM@format@nr=0\relax
      \@ACM@manuscripttrue
    \else
      \@ACM@manuscriptfalse
    \fi
    \@ACM@sigchiamodefalse
    \ifcase\ACM@format@nr
    \relax % manuscript
      \@ACM@journaltrue
    \or % acmsmall
      \@ACM@journaltrue
    \or % acmlarge
      \@ACM@journaltrue
    \or % acmtog
      \@ACM@journaltrue
    \or % sigconf
      \@ACM@journalfalse
    \or % siggraph
      \@ACM@journalfalse
     \or % sigplan
      \@ACM@journalfalse
     \or % sigchi
      \@ACM@journalfalse
    \or % sigchi-a
      \@ACM@journalfalse
      \@ACM@sigchiamodetrue
    \fi
    \ifx\ACM@fontsize\@empty
      \ifcase\ACM@format@nr
      \relax % manuscript
        \def\ACM@fontsize{9pt}%
      \or % acmsmall
        \def\ACM@fontsize{10pt}%
      \or % acmlarge
        \def\ACM@fontsize{10pt}%
      \or % acmtog
        \def\ACM@fontsize{9pt}%
      \or % sigconf
        \def\ACM@fontsize{9pt}%
      \or % siggraph
        \def\ACM@fontsize{9pt}%
       \or % sigplan
        \def\ACM@fontsize{10pt}%
       \or % sigchi
        \def\ACM@fontsize{10pt}%
      \or % sigchi-a
        \def\ACM@fontsize{10pt}%
      \fi
    \fi
    \ClassInfo{\@classname}{Using fontsize \ACM@fontsize}
    \LoadClass[\ACM@fontsize, reqno]{amsart}
    \RequirePackage{microtype}
    \RequirePackage{etoolbox}
    \RequirePackage{refcount}
    \RequirePackage{totpages}
    \RequirePackage{environ}
    \if@ACM@manuscript
    \RequirePackage{setspace}
    \onehalfspacing
    \fi
    \RequirePackage{textcase}
    \if@ACM@natbib
      \RequirePackage{natbib}
      \renewcommand{\bibsection}{%
         \section*{\refname}%
         \phantomsection\addcontentsline{toc}{section}{\refname}%
      }
      \renewcommand{\bibfont}{\bibliofont}
      \renewcommand\setcitestyle[1]{
      \@for\@tempa:=#1\do
      {\def\@tempb{round}\ifx\@tempa\@tempb
         \renewcommand\NAT@open{(}\renewcommand\NAT@close{)}\fi
       \def\@tempb{square}\ifx\@tempa\@tempb
         \renewcommand\NAT@open{[}\renewcommand\NAT@close{]}\fi
       \def\@tempb{angle}\ifx\@tempa\@tempb
         \renewcommand\NAT@open{$<$}\renewcommand\NAT@close{$>$}\fi
       \def\@tempb{curly}\ifx\@tempa\@tempb
         \renewcommand\NAT@open{\{}\renewcommand\NAT@close{\}}\fi
       \def\@tempb{semicolon}\ifx\@tempa\@tempb
         \renewcommand\NAT@sep{;}\fi
       \def\@tempb{colon}\ifx\@tempa\@tempb
         \renewcommand\NAT@sep{;}\fi
       \def\@tempb{comma}\ifx\@tempa\@tempb
         \renewcommand\NAT@sep{,}\fi
       \def\@tempb{authoryear}\ifx\@tempa\@tempb
         \NAT@numbersfalse\fi
       \def\@tempb{numbers}\ifx\@tempa\@tempb
         \NAT@numberstrue\NAT@superfalse\fi
       \def\@tempb{super}\ifx\@tempa\@tempb
         \NAT@numberstrue\NAT@supertrue\fi
       \def\@tempb{nobibstyle}\ifx\@tempa\@tempb
         \let\bibstyle=\@gobble\fi
       \def\@tempb{bibstyle}\ifx\@tempa\@tempb
         \let\bibstyle=\@citestyle\fi
       \def\@tempb{sort}\ifx\@tempa\@tempb
         \def\NAT@sort{\@ne}\fi
       \def\@tempb{nosort}\ifx\@tempa\@tempb
         \def\NAT@sort{\z@}\fi
       \def\@tempb{compress}\ifx\@tempa\@tempb
         \def\NAT@cmprs{\@ne}\fi
       \def\@tempb{nocompress}\ifx\@tempa\@tempb
    
         \def\NAT@cmprs{\z@}\fi
    
    Max New's avatar
    Max New committed
       \def\@tempb{sort&compress}\ifx\@tempa\@tempb
         \def\NAT@sort{\@ne}\def\NAT@cmprs{\@ne}\fi
       \def\@tempb{mcite}\ifx\@tempa\@tempb
         \let\NAT@merge\@ne\fi
       \def\@tempb{merge}\ifx\@tempa\@tempb
         \@ifnum{\NAT@merge<\tw@}{\let\NAT@merge\tw@}{}\fi
       \def\@tempb{elide}\ifx\@tempa\@tempb
         \@ifnum{\NAT@merge<\thr@@}{\let\NAT@merge\thr@@}{}\fi
       \def\@tempb{longnamesfirst}\ifx\@tempa\@tempb
         \NAT@longnamestrue\fi
       \def\@tempb{nonamebreak}\ifx\@tempa\@tempb
         \def\NAT@nmfmt#1{\mbox{\NAT@up#1}}\fi
       \expandafter\NAT@find@eq\@tempa=\relax\@nil
       \if\@tempc\relax\else
         \expandafter\NAT@rem@eq\@tempc
         \def\@tempb{open}\ifx\@tempa\@tempb
          \xdef\NAT@open{\@tempc}\fi
         \def\@tempb{close}\ifx\@tempa\@tempb
          \xdef\NAT@close{\@tempc}\fi
         \def\@tempb{aysep}\ifx\@tempa\@tempb
          \xdef\NAT@aysep{\@tempc}\fi
         \def\@tempb{yysep}\ifx\@tempa\@tempb
          \xdef\NAT@yrsep{\@tempc}\fi
         \def\@tempb{notesep}\ifx\@tempa\@tempb
          \xdef\NAT@cmt{\@tempc}\fi
         \def\@tempb{citesep}\ifx\@tempa\@tempb
          \xdef\NAT@sep{\@tempc}\fi
       \fi
      }%
      \NAT@@setcites
      }
      \renewcommand\citestyle[1]{%
        \ifcsname bibstyle@#1\endcsname%
        \csname bibstyle@#1\endcsname\let\bibstyle\@gobble%
        \else%
        \@latex@error{Undefined `#1' citestyle}%
        \fi
      }%
    \fi
    \newcommand{\bibstyle@acmauthoryear}{%
      \setcitestyle{%
        authoryear,%
        open={[},close={]},citesep={;},%
        aysep={},yysep={,},%
        notesep={, }}}
    \newcommand{\bibstyle@acmnumeric}{%
      \setcitestyle{%
        numbers,sort&compress,%
        open={[},close={]},citesep={,},%
        notesep={, }}}
    \if@ACM@natbib
    \citestyle{acmnumeric}
    \fi
    \def\@startsection#1#2#3#4#5#6{%
      \if@noskipsec \leavevmode \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}}}}
    \def\@sect#1#2#3#4#5#6[#7]#8{%
      \edef\@toclevel{\ifnum#2=\@m 0\else\number#2\fi}%
      \ifnum #2>\c@secnumdepth
        \let\@svsec\@empty
      \else
        \refstepcounter{#1}%
        \protected@edef\@svsec{\@seccntformat{#1}\relax}%
      \fi
      \@tempskipa #5\relax
      \ifdim \@tempskipa>\z@
        \begingroup
          #6{%
            \@hangfrom{\hskip #3\relax\@svsec}%
              \interlinepenalty \@M #8\@@par}%
        \endgroup
        \csname #1mark\endcsname{#7}%
        \ifnum #2>\c@secnumdepth \else
            \@tochangmeasure{\csname the#1\endcsname}%
        \fi
        \addcontentsline{toc}{#1}{%
          \ifnum #2>\c@secnumdepth \else
            \protect\numberline{\csname the#1\endcsname}%
          \fi
          #7}%
      \else
        \def\@svsechd{%
          #6{\hskip #3\relax
          \@svsec #8}%
          \csname #1mark\endcsname{#7}%
          \ifnum #2>\c@secnumdepth \else
            \@tochangmeasure{\csname the#1\endcsname\space}%
          \fi
          \addcontentsline{toc}{#1}{%
            \ifnum #2>\c@secnumdepth \else
              \protect\numberline{\csname the#1\endcsname}%
            \fi
            #7}}%
      \fi
      \@xsect{#5}}
    \def\@xsect#1{%
      \@tempskipa #1\relax
      \ifdim \@tempskipa>\z@
        \par \nobreak
        \vskip \@tempskipa
        \@afterheading
      \else
        \@nobreakfalse
        \global\@noskipsectrue
        \everypar{%
          \if@noskipsec
            \global\@noskipsecfalse
           {\setbox\z@\lastbox}%
            \clubpenalty\@M
            \begingroup \@svsechd \endgroup
            \unskip
            \@tempskipa #1\relax
            \hskip -\@tempskipa
          \else
            \clubpenalty \@clubpenalty
            \everypar{}%
          \fi}%
      \fi
      \ignorespaces}
    \def\@seccntformat#1{\csname the#1\endcsname\quad}
    \def\@ssect#1#2#3#4#5{%
      \@tempskipa #3\relax
      \ifdim \@tempskipa>\z@
        \begingroup
          #4{%
            \@hangfrom{\hskip #1}%
              \interlinepenalty \@M #5\@@par}%
        \endgroup
      \else
        \def\@svsechd{#4{\hskip #1\relax #5}}%
      \fi
      \@xsect{#3}}
    \def\@starttoc#1#2{\begingroup\makeatletter
      \setTrue{#1}%
      \par\removelastskip\vskip\z@skip
      \@startsection{section}\@M\z@{\linespacing\@plus\linespacing}%
        {.5\linespacing}{\centering\contentsnamefont}{#2}%
      \@input{\jobname.#1}%
      \if@filesw
        \@xp\newwrite\csname tf@#1\endcsname
        \immediate\@xp\openout\csname tf@#1\endcsname \jobname.#1\relax
      \fi
      \global\@nobreakfalse \endgroup
      \addvspace{32\p@\@plus14\p@}%
    }
    \def\l@section{\@tocline{1}{0pt}{1pc}{2pc}{}}
    \def\l@subsection{\@tocline{2}{0pt}{1pc}{3pc}{}}
    \def\l@subsubsection{\@tocline{2}{0pt}{1pc}{5pc}{}}
    
    \def\@makefntext{\noindent\@makefnmark}
    \if@ACM@sigchiamode
    \long\def\@footnotetext#1{\marginpar{%
        \reset@font\small
        \interlinepenalty\interfootnotelinepenalty
        \protected@edef\@currentlabel{%
           \csname p@footnote\endcsname\@thefnmark
        }%
        \color@begingroup
          \@makefntext{%
            \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
        \color@endgroup}}%
    \fi
    \long\def\@mpfootnotetext#1{%
      \global\setbox\@mpfootins\vbox{%
        \unvbox\@mpfootins
        \reset@font\footnotesize
        \hsize\columnwidth
        \@parboxrestore
        \protected@edef\@currentlabel
             {\csname p@mpfootnote\endcsname\@thefnmark}%
        \color@begingroup\centering
          \@makefntext{%
            \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
        \color@endgroup}}
    \def\@makefnmark{\hbox{\@textsuperscript{\normalfont\@thefnmark}}}
    
    Max New's avatar
    Max New committed
    \let\@footnotemark@nolink\@footnotemark
    \let\@footnotetext@nolink\@footnotetext
    \RequirePackage[bookmarksnumbered,unicode]{hyperref}
    \pdfstringdefDisableCommands{%
      \def\unskip{}%
      \def\textbullet{- }%
      \def\textrightarrow{ -> }%
      \def\footnotemark{}%
    }
    \urlstyle{rm}
    \ifcase\ACM@format@nr
    \relax % manuscript
    \or % acmsmall
    \or % acmlarge
    \or % acmtog
    \or % sigconf
    \or % siggraph
    \or % sigplan
      \urlstyle{sf}
    \or % sigchi
    \or % sigchi-a
      \urlstyle{sf}
    \fi
    \AtEndPreamble{%
      \if@ACM@screen
        \hypersetup{colorlinks,
    
          linkcolor=ACMPurple,
    
    Max New's avatar
    Max New committed
          citecolor=ACMPurple,
          urlcolor=ACMDarkBlue,
          filecolor=ACMDarkBlue}
        \else
        \hypersetup{hidelinks}
    
      \fi
      \hypersetup{pdflang={English},
        pdfdisplaydoctitle}}
    
    Max New's avatar
    Max New committed
    \if@ACM@natbib
      \let\citeN\cite
      \let\cite\citep
      \let\citeANP\citeauthor
      \let\citeNN\citeyearpar
      \let\citeyearNP\citeyear
      \let\citeNP\citealt
      \DeclareRobustCommand\citeA
         {\begingroup\NAT@swafalse
           \let\NAT@ctype\@ne\NAT@partrue\NAT@fullfalse\NAT@open\NAT@citetp}%
      \providecommand\newblock{}%
    \else
      \AtBeginDocument{%
        \let\shortcite\cite%
        \providecommand\citename[1]{#1}}
    \fi
    \newcommand\shortcite[2][]{%
      \ifNAT@numbers\cite[#1]{#2}\else\citeyearpar[#1]{#2}\fi}
    \def\bibliographystyle#1{%
      \ifx\@begindocumenthook\@undefined\else
        \expandafter\AtBeginDocument
      \fi
        {\if@filesw
           \immediate\write\@auxout{\string\bibstyle{#1}}%
         \fi}}
    \RequirePackage{graphicx}
    \RequirePackage[prologue]{xcolor}
    \definecolor[named]{ACMBlue}{cmyk}{1,0.1,0,0.1}
    \definecolor[named]{ACMYellow}{cmyk}{0,0.16,1,0}
    \definecolor[named]{ACMOrange}{cmyk}{0,0.42,1,0.01}
    \definecolor[named]{ACMRed}{cmyk}{0,0.90,0.86,0}
    \definecolor[named]{ACMLightBlue}{cmyk}{0.49,0.01,0,0}
    \definecolor[named]{ACMGreen}{cmyk}{0.20,0,1,0.19}
    \definecolor[named]{ACMPurple}{cmyk}{0.55,1,0,0.15}
    \definecolor[named]{ACMDarkBlue}{cmyk}{1,0.58,0,0.21}
    \if@ACM@authordraft
      \RequirePackage{draftwatermark}
      \SetWatermarkFontSize{0.5in}
      \SetWatermarkColor[gray]{.9}
      \SetWatermarkText{\parbox{12em}{\centering
          Unpublished working draft.\\
          Not for distribution.}}
    \fi
    \RequirePackage{geometry}
    \ifcase\ACM@format@nr
    \relax % manuscript
       \geometry{letterpaper,head=13pt,
       marginparwidth=6pc,heightrounded}%
    \or % acmsmall
       \geometry{twoside=true,
         includeheadfoot, head=13pt, foot=2pc,
         paperwidth=6.75in, paperheight=10in,
         top=58pt, bottom=44pt, inner=46pt, outer=46pt,
         marginparwidth=2pc,heightrounded
       }%
    \or % acmlarge
       \geometry{twoside=true, head=13pt, foot=2pc,
         paperwidth=8.5in, paperheight=11in,
         includeheadfoot,
         top=78pt, bottom=114pt, inner=81pt, outer=81pt,
         marginparwidth=4pc,heightrounded
         }%
    \or % acmtog
       \geometry{twoside=true, head=13pt, foot=2pc,
         paperwidth=8.5in, paperheight=11in,
         includeheadfoot, columnsep=24pt,
         top=52pt, bottom=75pt, inner=52pt, outer=52pt,
         marginparwidth=2pc,heightrounded
         }%
    \or % sigconf
       \geometry{twoside=true, head=13pt,
         paperwidth=8.5in, paperheight=11in,
         includeheadfoot, columnsep=2pc,
         top=57pt, bottom=73pt, inner=54pt, outer=54pt,
         marginparwidth=2pc,heightrounded
         }%
    \or % siggraph
       \geometry{twoside=true, head=13pt,
         paperwidth=8.5in, paperheight=11in,
         includeheadfoot, columnsep=2pc,
         top=57pt, bottom=73pt, inner=54pt, outer=54pt,
         marginparwidth=2pc,heightrounded
         }%
    \or % sigplan
       \geometry{twoside=true, head=13pt,
         paperwidth=8.5in, paperheight=11in,
         includeheadfoot=false, columnsep=2pc,
         top=1in, bottom=1in, inner=0.75in, outer=0.75in,
         marginparwidth=2pc,heightrounded
         }%
    \or % sigchi
       \geometry{twoside=true, head=13pt,
         paperwidth=8.5in, paperheight=11in,
         includeheadfoot, columnsep=2pc,
         top=66pt, bottom=73pt, inner=54pt, outer=54pt,
         marginparwidth=2pc,heightrounded
         }%
    \or % sigchi-a
       \geometry{twoside=false, head=13pt,
         paperwidth=11in, paperheight=8.5in,
         includeheadfoot, marginparsep=72pt,
         marginparwidth=170pt, columnsep=20pt,
         top=72pt, bottom=72pt, left=314pt, right=72pt
         }%
         \@mparswitchfalse
         \reversemarginpar
    \fi
    \setlength\parindent{10\p@}
    \setlength\parskip{\z@}
    \ifcase\ACM@format@nr
    \relax % manuscript
    \or % acmsmall
    \or % acmlarge
    \or % acmtog
      \setlength\parindent{9\p@}%
    \or % sigconf
    \or % siggraph
    \or % sigplan
    \or % sigchi
    \or % sigchi-a
    \fi
    \setlength\normalparindent{\parindent}
    \def\copyrightpermissionfootnoterule{\kern-3\p@
      \hrule \@width \columnwidth \kern 2.6\p@}
    \RequirePackage{manyfoot}
    \SelectFootnoteRule[2]{copyrightpermission}
    \DeclareNewFootnote{authorsaddresses}
    \SelectFootnoteRule[2]{copyrightpermission}
    \DeclareNewFootnote{copyrightpermission}
    \def\footnoterule{\kern-3\p@
      \hrule \@width 4pc \kern 2.6\p@}
    \def\endminipage{%
        \par
        \unskip
        \ifvoid\@mpfootins\else
          \vskip\skip\@mpfootins
          \normalcolor
          \unvbox\@mpfootins
        \fi
        \@minipagefalse
      \color@endgroup
      \egroup
      \expandafter\@iiiparbox\@mpargs{\unvbox\@tempboxa}}
    \def\@textbottom{\vskip \z@ \@plus 1pt}
    \let\@texttop\relax
    \RequirePackage{iftex}
    \ifPDFTeX
    \input{glyphtounicode}
    \pdfglyphtounicode{f_f}{FB00}
    \pdfglyphtounicode{f_f_i}{FB03}
    \pdfglyphtounicode{f_f_l}{FB04}
    \pdfglyphtounicode{f_i}{FB01}
    
    \pdfglyphtounicode{t_t}{0074 0074}
    \pdfglyphtounicode{f_t}{0066 0074}
    \pdfglyphtounicode{T_h}{0054 0068}
    
    Max New's avatar
    Max New committed
    \pdfgentounicode=1
    \fi
    \RequirePackage{cmap}
    \newif\if@ACM@newfonts
    \@ACM@newfontstrue
    \IfFileExists{libertine.sty}{}{\ClassWarning{\@classname}{You do not
        have the libertine package installed.  Please upgrade your
        TeX}\@ACM@newfontsfalse}
    \IfFileExists{zi4.sty}{}{\ClassWarning{\@classname}{You do not
        have the zi4 package installed.  Please upgrade your
        TeX}\@ACM@newfontsfalse}
    \IfFileExists{newtxmath.sty}{}{\ClassWarning{\@classname}{You do not
        have the newtxmath package installed.  Please upgrade your
        TeX}\@ACM@newfontsfalse}
    \if@ACM@newfonts
    
      \RequirePackage[T1]{fontenc}
    
    \ifxetex
      \RequirePackage[tt=false]{libertine}
    \else
      \RequirePackage[tt=false, type1=true]{libertine}
    \fi
    
    Max New's avatar
    Max New committed
    \RequirePackage[varqu]{zi4}
    \RequirePackage[libertine]{newtxmath}
    \fi
    \let\liningnums\@undefined
    \AtEndPreamble{%
      \DeclareTextFontCommand{\liningnums}{\libertineLF}}
    \if@ACM@sigchiamode
      \renewcommand{\familydefault}{\sfdefault}
    \fi
    \RequirePackage{caption, float}
    \captionsetup[table]{position=top}
    \if@ACM@journal
      \captionsetup{labelfont={sf, small},
        textfont={sf, small}, margin=\z@}
      \captionsetup[figure]{name={Fig.}}
    \else
      \captionsetup{labelfont={bf},
        textfont={bf}, labelsep=colon, margin=\z@}
      \ifcase\ACM@format@nr
      \relax % manuscript
      \or % acmsmall
      \or % acmlarge
      \or % acmtog
      \or % sigconf
      \or % siggraph
        \captionsetup{textfont={it}}
      \or % sigplan
        \captionsetup{labelfont={bf},
          textfont={normalfont}, labelsep=period, margin=\z@}
      \or % sigchi
        \captionsetup[figure]{labelfont={bf, small},
          textfont={bf, small}}
    
        \captionsetup[table]{labelfont={bf, small},
          textfont={bf, small}}
    
    Max New's avatar
    Max New committed
      \or % sigchi-a
        \captionsetup[figure]{labelfont={bf, small},
          textfont={bf, small}}
    
        \captionsetup[table]{labelfont={bf, small},
          textfont={bf, small}}
    
    Max New's avatar
    Max New committed
      \fi
    \fi
    \newfloat{sidebar}{}{sbar}
    \floatname{sidebar}{Sidebar}
    \renewenvironment{sidebar}{\Collect@Body\@sidebar}{}
    \long\def\@sidebar#1{\bgroup\captionsetup{type=sidebar}%
      \marginpar{\small#1}\egroup}
    \newenvironment{marginfigure}{\Collect@Body\@marginfigure}{}
    \long\def\@marginfigure#1{\bgroup\captionsetup{type=figure}%
      \marginpar{\centering\small#1}\egroup}
    \newenvironment{margintable}{\Collect@Body\@margintable}{}
    \long\def\@margintable#1{\bgroup\captionsetup{type=table}%
      \marginpar{\centering\small#1}\egroup}
    \newdimen\fulltextwidth
    \fulltextwidth=\dimexpr(\textwidth+\marginparwidth+\marginparsep)
    \if@ACM@sigchiamode
    \def\@dblfloat{\bgroup\columnwidth=\fulltextwidth
      \let\@endfloatbox\@endwidefloatbox
      \def\@fpsadddefault{\def\@fps{tp}}%
      \@float}
    \fi
    \if@ACM@sigchiamode
    \def\end@dblfloat{%
        \end@float\egroup}
    \fi
    \def\@endwidefloatbox{%
      \par\vskip\z@skip
      \@minipagefalse
      \outer@nobreak
      \egroup
      \color@endbox
      \global\setbox\@currbox=\vbox{\moveleft
        \dimexpr(\fulltextwidth-\textwidth)\box\@currbox}%
      \wd\@currbox=\textwidth
    }
    \ifcase\ACM@format@nr
    \relax % manuscript
    \or % acmsmall
    \or % acmlarge
    \or % acmtog
    \or % sigconf
    \or % siggraph
    \or % sigplan
    \def\labelenumi{\theenumi.}
    \def\labelenumii{\theenumii.}
    \def\labelenumiii{\theenumiii.}
    \def\labelenumiv{\theenumiv.}
    \or % sigchi
    \or % sigchi-a
    \fi
    \newdimen\@ACM@labelwidth
    \AtBeginDocument{%
      \setlength\labelsep{4pt}
      \setlength{\@ACM@labelwidth}{6.5pt}
    
      %% First-level list: when beginning after the first line of an
      %% indented paragraph or ending before an indented paragraph, labels
      %% should not hang to the left of the preceding/following text.
      \setlength\leftmargini{\z@}
      \addtolength\leftmargini{\parindent}
      \addtolength\leftmargini{2\labelsep}
      \addtolength\leftmargini{\@ACM@labelwidth}
    
      %% Second-level and higher lists.
      \setlength\leftmarginii{\z@}
      \addtolength\leftmarginii{0.5\labelsep}
      \addtolength\leftmarginii{\@ACM@labelwidth}
      \setlength\leftmarginiii{\leftmarginii}
      \setlength\leftmarginiv{\leftmarginiii}
      \setlength\leftmarginv{\leftmarginiv}
      \setlength\leftmarginvi{\leftmarginv}
      \@listi}
    \newskip\listisep
    \listisep\smallskipamount
    \def\@listI{\leftmargin\leftmargini
      \labelwidth\leftmargini \advance\labelwidth-\labelsep
      \listparindent\z@
      \topsep\listisep}
    \let\@listi\@listI
    \def\@listii{\leftmargin\leftmarginii
      \labelwidth\leftmarginii \advance\labelwidth-\labelsep
      \topsep\z@skip}
    \def\@listiii{\leftmargin\leftmarginiii
      \labelwidth\leftmarginiii \advance\labelwidth-\labelsep}
    \def\@listiv{\leftmargin\leftmarginiv
      \labelwidth\leftmarginiv \advance\labelwidth-\labelsep}
    \def\@listv{\leftmargin\leftmarginv
      \labelwidth\leftmarginv \advance\labelwidth-\labelsep}
    \def\@listvi{\leftmargin\leftmarginvi
      \labelwidth\leftmarginvi \advance\labelwidth-\labelsep}
    \renewcommand{\descriptionlabel}[1]{\upshape\bfseries #1}
    \renewenvironment{description}{\list{}{%
        \labelwidth\@ACM@labelwidth
        \let\makelabel\descriptionlabel}%
    }{
      \endlist
    }
    \let\enddescription=\endlist % for efficiency
    \define@choicekey*+{ACM}{acmJournal}[\@journalCode\@journalCode@nr]{%
      CIE,%
      CSUR,%
      DTRAP,%
      IMWUT,%
      JACM,%
      JDIQ,%
      JEA,%
      JERIC,%
      JETC,%
      JOCCH,%
    
    Max New's avatar
    Max New committed
      PACMHCI,%
      PACMPL,%
      POMACS,%
      TAAS,%
      TACCESS,%
      TACO,%
      TALG,%
      TALLIP,%
      TAP,%
      TCPS,%
    
    Max New's avatar
    Max New committed
      TEAC,%
      TECS,%
      THRI,%
      TIIS,%
    
    Max New's avatar
    Max New committed
      TISSEC,%
      TIST,%
      TKDD,%
      TMIS,%
      TOCE,%
      TOCHI,%
      TOCL,%
      TOCS,%
      TOCT,%
      TODAES,%
      TODS,%
      TOG,%
      TOIS,%
      TOIT,%
      TOMACS,%
      TOMM,%
      TOMPECS,%
      TOMS,%
      TOPC,%
      TOPS,%
      TOPLAS,%
      TOS,%
      TOSEM,%
      TOSN,%
      TRETS,%
      TSAS,%
      TSC,%
      TSLP,%
      TWEB%
    }{%
    \ifcase\@journalCode@nr
    \relax % CIE
      \def\@journalName{ACM Computers in Entertainment}%
      \def\@journalNameShort{ACM Comput. Entertain.}%
      \def\@permissionCodeOne{1544-3574}%
    \or % CSUR
      \def\@journalName{ACM Computing Surveys}%
      \def\@journalNameShort{ACM Comput. Surv.}%
      \def\@permissionCodeOne{0360-0300}%
    \or % DTRAP
      \def\@journalName{Digital Threats: Research and Practice}%
      \def\@journalNameShort{Digit. Threat. Res. Pract.}%
      \def\@permissionCodeOne{2576-5337}%
    \or % IMWUT
      \def\@journalName{Proceedings of the ACM on Interactive, Mobile,
        Wearable and Ubiquitous Technologies}%
      \def\@journalNameShort{Proc. ACM Interact. Mob. Wearable Ubiquitous Technol.}%
      \def\@permissionCodeOne{2474-9567}%
      \@ACM@screentrue
      \PackageInfo{\@classname}{Using screen mode due to \@journalCode}%
    \or % JACM
      \def\@journalName{Journal of the ACM}%
      \def\@journalNameShort{J. ACM}%
      \def\@permissionCodeOne{0004-5411}%
    \or % JDIQ
      \def\@journalName{ACM Journal of Data and Information Quality}%
      \def\@journalNameShort{ACM J. Data Inform. Quality}%
      \def\@permissionCodeOne{1936-1955}%
    \or % JEA
      \def\@journalName{ACM Journal of Experimental Algorithmics}%
      \def\@journalNameShort{ACM J. Exp. Algor.}%
      \def\@permissionCodeOne{1084-6654}%
    \or % JERIC
      \def\@journalName{ACM Journal of Educational Resources in Computing}%
      \def\@journalNameShort{ACM J. Edu. Resources in Comput.}%
      \def\@permissionCodeOne{1073-0516}%
    \or % JETC
      \def\@journalName{ACM Journal on Emerging Technologies in Computing Systems}%
      \def\@journalNameShort{ACM J. Emerg. Technol. Comput. Syst.}%
      \def\@permissionCodeOne{1550-4832}%
    \or % JOCCH
      \def\@journalName{ACM Journal on Computing and Cultural Heritage}%
      \def\@journalNameShort{ACM J. Comput. Cult. Herit.}%
    
    \or % PACMCGIT
      \def\@journalName{Proceedings of the ACM on Computer Graphics and Interactive Techniques}%
      \def\@journalNameShort{Proc. ACM Comput. Graph. Interact. Tech.}%
      \def\@permissionCodeOne{2577-6193}%
      \@ACM@screentrue
      \PackageInfo{\@classname}{Using screen mode due to \@journalCode}%
    
    Max New's avatar
    Max New committed
    \or % PACMHCI
      \def\@journalName{Proceedings of the ACM on Human-Computer Interaction}%
      \def\@journalNameShort{Proc. ACM Hum.-Comput. Interact.}%
      \def\@permissionCodeOne{2573-0142}%
      \@ACM@screentrue
      \PackageInfo{\@classname}{Using screen mode due to \@journalCode}%
    \or % PACMPL
      \def\@journalName{Proceedings of the ACM on Programming Languages}%
      \def\@journalNameShort{Proc. ACM Program. Lang.}%
      \def\@permissionCodeOne{2475-1421}%
      \@ACM@screentrue
      \PackageInfo{\@classname}{Using screen mode due to \@journalCode}%
    \or % POMACS
      \def\@journalName{Proceedings of the ACM on Measurement and Analysis of Computing Systems}%
      \def\@journalNameShort{Proc. ACM Meas. Anal. Comput. Syst.}%
      \def\@permissionCodeOne{2476-1249}%
      \@ACM@screentrue
      \PackageInfo{\@classname}{Using screen mode due to \@journalCode}%
    \or % TAAS
      \def\@journalName{ACM Transactions on Autonomous and Adaptive Systems}%
      \def\@journalNameShort{ACM Trans. Autonom. Adapt. Syst.}%
      \def\@permissionCodeOne{1556-4665}%
    \or % TACCESS
      \def\@journalName{ACM Transactions on Accessible Computing}%
      \def\@journalNameShort{ACM Trans. Access. Comput.}%
      \def\@permissionCodeOne{1936-7228}%
    \or % TACO
      \def\@journalName{ACM Transactions on Architecture and Code Optimization}%
      \def\@journalNameShort{ACM Trans. Arch. Code Optim.}%
    \or % TALG
      \def\@journalName{ACM Transactions on Algorithms}%
      \def\@journalNameShort{ACM Trans. Algor.}%
      \def\@permissionCodeOne{1549-6325}%
    \or % TALLIP
      \def\@journalName{ACM Transactions on Asian and Low-Resource Language Information Processing}%
      \def\@journalNameShort{ACM Trans. Asian Low-Resour. Lang. Inf. Process.}%
      \def\@permissionCodeOne{2375-4699}%
    \or % TAP
      \def\@journalName{ACM Transactions on Applied Perception}%
    \or % TCPS
      \def\@journalName{ACM Transactions on Cyber-Physical Systems}%
    
    \or % TDSCI
      \def\@journalName{ACM Transactions on Data Science}%
      \def\@journalNameShort{ACM Trans. Data Sci.}%
      \def\@permissionCodeOne{2577-3224}%
    
    Max New's avatar
    Max New committed
    \or % TEAC
      \def\@journalName{ACM Transactions on Economics and Computation}%
    \or % TECS
      \def\@journalName{ACM Transactions on Embedded Computing Systems}%
      \def\@journalNameShort{ACM Trans. Embedd. Comput. Syst.}%
      \def\@permissionCodeOne{1539-9087}%
    \or % THRI
      \def\@journalName{ACM Transactions on Human-Robot Interaction}%
      \def\@journalNameShort{ACM Trans. Hum.-Robot Interact.}%
      \def\@permissionCodeOne{2573-9522}%
    \or % TIIS
      \def\@journalName{ACM Transactions on Interactive Intelligent Systems}%
      \def\@journalNameShort{ACM Trans. Interact. Intell. Syst.}%
      \def\@permissionCodeOne{2160-6455}%
    
    \or % TIOT
      \def\@journalName{ACM Transactions on Internet of Things}%
      \def\@journalNameShort{ACM Trans. Internet Things}%
      \def\@permissionCodeOne{2577-6207}%
    
    Max New's avatar
    Max New committed
    \or % TISSEC
      \def\@journalName{ACM Transactions on Information and System Security}%
      \def\@journalNameShort{ACM Trans. Info. Syst. Sec.}%
      \def\@permissionCodeOne{1094-9224}%
    \or % TIST
      \def\@journalName{ACM Transactions on Intelligent Systems and Technology}%
      \def\@journalNameShort{ACM Trans. Intell. Syst. Technol.}%
      \def\@permissionCodeOne{2157-6904}%
    \or % TKDD
      \def\@journalName{ACM Transactions on Knowledge Discovery from Data}%
      \def\@journalNameShort{ACM Trans. Knowl. Discov. Data.}%
      \def\@permissionCodeOne{1556-4681}%
    \or % TMIS
      \def\@journalName{ACM Transactions on Management Information Systems}%
      \def\@journalNameShort{ACM Trans. Manag. Inform. Syst.}%
      \def\@permissionCodeOne{2158-656X}%
    \or % TOCE
      \def\@journalName{ACM Transactions on Computing Education}%
      \def\@journalNameShort{ACM Trans. Comput. Educ.}%
      \def\@permissionCodeOne{1946-6226}%
    \or % TOCHI
      \def\@journalName{ACM Transactions on Computer-Human Interaction}%
      \def\@journalNameShort{ACM Trans. Comput.-Hum. Interact.}%
      \def\@permissionCodeOne{1073-0516}%
    \or % TOCL
      \def\@journalName{ACM Transactions on Computational Logic}%
      \def\@journalNameShort{ACM Trans. Comput. Logic}%
      \def\@permissionCodeOne{1529-3785}%
    \or % TOCS
      \def\@journalName{ACM Transactions on Computer Systems}%
      \def\@journalNameShort{ACM Trans. Comput. Syst.}%