summaryrefslogtreecommitdiffstats
path: root/acmart.cls
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2021-09-08 18:55:41 +0100
committerYann Herklotz <git@yannherklotz.com>2021-09-08 18:55:41 +0100
commita68d9b19756801fb1633edd17aec2ac9c22d8444 (patch)
tree5deb0f398621309decd0c106ef7b9b67eb06b0dc /acmart.cls
parentaf5b7dd0370e7f0087b5bc58042baa71288c59bb (diff)
downloadoopsla21_fvhls-a68d9b19756801fb1633edd17aec2ac9c22d8444.tar.gz
oopsla21_fvhls-a68d9b19756801fb1633edd17aec2ac9c22d8444.zip
Some initial changes towards the final submission
Diffstat (limited to 'acmart.cls')
-rw-r--r--acmart.cls180
1 files changed, 142 insertions, 38 deletions
diff --git a/acmart.cls b/acmart.cls
index 239698b..393d65a 100644
--- a/acmart.cls
+++ b/acmart.cls
@@ -37,7 +37,7 @@
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{acmart}
-[2020/04/30 v1.71 Typesetting articles for the Association for Computing Machinery]
+[2021/04/16 v1.77 Typesetting articles for the Association for Computing Machinery]
\def\@classname{acmart}
\InputIfFileExists{acmart-preload-hook.tex}{%
\ClassWarning{\@classname}{%
@@ -120,6 +120,10 @@
\PackageError{\@classname}{The option balance can be either true or
false}}
\ExecuteOptionsX{balance}
+\define@boolkey+{acmart.cls}[@ACM@]{pbalance}[true]{}{%
+ \PackageError{\@classname}{The option pbalance can be either true or
+ false}}
+\ExecuteOptionsX{pbalance=false}
\define@boolkey+{acmart.cls}[@ACM@]{natbib}[true]{%
\if@ACM@natbib
\PackageInfo{\@classname}{Explicitly selecting natbib mode}%
@@ -487,6 +491,7 @@
\rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
\color@endgroup}}
\def\@makefnmark{\hbox{\@textsuperscript{\normalfont\@thefnmark}}}
+\RequirePackage{hyperxmp}
\let\@footnotemark@nolink\@footnotemark
\let\@footnotetext@nolink\@footnotetext
\RequirePackage[bookmarksnumbered,unicode]{hyperref}
@@ -698,7 +703,6 @@
\flushbottom
\or % sigchi-a
\fi
-\RequirePackage{iftex}
\ifPDFTeX
\input{glyphtounicode}
\pdfglyphtounicode{f_f}{FB00}
@@ -709,34 +713,40 @@
\pdfglyphtounicode{f_t}{0066 0074}
\pdfglyphtounicode{T_h}{0054 0068}
\pdfgentounicode=1
-\fi
\RequirePackage{cmap}
+\fi
\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
+ have the inconsolata (zi4.sty) 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}
+ % Note that the order in which packages are loaded matters,
+ % and the correct order depends on the LaTeX engine used.
+ % See https://github.com/borisveytsman/acmart/issues/402
+ % and https://github.com/borisveytsman/acmart/issues/410
\ifxetex
+ \RequirePackage[libertine]{newtxmath}
\RequirePackage[tt=false]{libertine}
\setmonofont[StylisticSet=3]{inconsolata}
\else
\ifluatex
+ \RequirePackage[libertine]{newtxmath}
\RequirePackage[tt=false]{libertine}
\setmonofont[StylisticSet=3]{inconsolata}
\else
\RequirePackage[tt=false, type1=true]{libertine}
\RequirePackage[varqu]{zi4}
+ \RequirePackage[libertine]{newtxmath}
\fi
\fi
- \RequirePackage[libertine]{newtxmath}
\fi
\let\liningnums\@undefined
\AtEndPreamble{%
@@ -775,6 +785,14 @@
\let\@vspacer\@vspacer@orig}
\AtBeginEnvironment{lstlisting*}{\let\@vspace\@vspace@orig
\let\@vspacer\@vspacer@orig}
+\AtBeginEnvironment{minted}{\let\@vspace\@vspace@orig
+ \let\@vspacer\@vspacer@orig}
+\AtBeginEnvironment{minted*}{\let\@vspace\@vspace@orig
+ \let\@vspacer\@vspacer@orig}
+\AtBeginEnvironment{listing}{\let\@vspace\@vspace@orig
+ \let\@vspacer\@vspacer@orig}
+\AtBeginEnvironment{listing*}{\let\@vspace\@vspace@orig
+ \let\@vspacer\@vspacer@orig}
\RequirePackage{caption, float}
\captionsetup[table]{position=top}
@@ -1254,9 +1272,12 @@
DC, USA}%
\fi
\def\acmBooktitle#1{\gdef\@acmBooktitle{#1}}
+\acmBooktitle{}
+\ifx\acmConference@name\@undefined\else
\acmBooktitle{Proceedings of \acmConference@name
\ifx\acmConference@name\acmConference@shortname\else
- \ (\acmConference@shortname)\fi}
+ \ (\acmConference@shortname)\fi}
+\fi
\def\@editorsAbbrev{(Ed.)}
\def\@acmEditors{}
\def\editor#1{\ifx\@acmEditors\@empty
@@ -1274,7 +1295,7 @@
\newif\if@insideauthorgroup
\@insideauthorgroupfalse
\renewcommand\author[2][]{%
- \IfSubStr{#2}{,}{\ClassWarning{\@classname}{Do not put several
+ \IfSubStr{\detokenize{#2}}{,}{\ClassWarning{\@classname}{Do not put several
authors in the same \string\author\space macro!}}{}%
\global\advance\num@authors by 1\relax
\if@insideauthorgroup\else
@@ -1288,12 +1309,16 @@
\@acmSubmissionID\fi}}%
\gdef\authors{Anonymous Author(s)}%
\else
- \gdef\addresses{\@author{#2}}%
+ \expandafter\gdef\expandafter\addresses\expandafter{%
+ \expandafter\@author\expandafter{%
+ \csname typeset@author\the\num@authors\endcsname{#2}}}%
\gdef\authors{#2}%
\fi
\else
\if@ACM@anonymous\else
- \g@addto@macro\addresses{\and\@author{#2}}%
+ \expandafter\g@addto@macro\expandafter\addresses\expandafter{%
+ \expandafter\and\expandafter\@author\expandafter{%
+ \csname typeset@author\the\num@authors\endcsname{#2}}}%
\g@addto@macro\authors{\and#2}%
\fi
\fi
@@ -1344,7 +1369,14 @@
\if@ACM@anonymous\else
\g@addto@macro\addresses{\email{#1}{#2}}%
\fi}
-\def\orcid#1{\unskip\ignorespaces}
+\def\orcid#1{\unskip\ignorespaces%
+ \IfBeginWith{#1}{http}{%
+ \expandafter\gdef\csname
+ typeset@author\the\num@authors\endcsname##1{%
+ \href{#1}{##1}}}{%
+ \expandafter\gdef\csname
+ typeset@author\the\num@authors\endcsname##1{%
+ \href{https://orcid.org/#1}{##1}}}}
\def\authorsaddresses#1{\def\@authorsaddresses{#1}}
\authorsaddresses{\@mkauthorsaddresses}
\def\@titlenotes{}
@@ -1764,8 +1796,12 @@
\else
\g@addto@macro\thankses{\thanks{#1}}%
\fi}}
+\ifx\@beginmaketitlehook\@undefined
+ \let\@beginmaketitlehook\@empty
+\fi
+\def\AtBeginMaketitle{\g@addto@macro\@beginmaketitlehook}
\newbox\mktitle@bx
-\def\maketitle{%
+\def\maketitle{\@beginmaketitlehook
\@ACM@maketitle@typesettrue
\if@ACM@anonymous
% Anonymize omission of \author-s
@@ -1869,17 +1905,13 @@
\else
\@specialsection{Keywords}%
\fi
- \noindent\@keywords}\par\egroup
+ \noindent\@keywords\par}\egroup
\fi
- \andify\authors
- \andify\shortauthors
- \global\let\authors=\authors
- \global\let\shortauthors=\shortauthors
- \if@ACM@printacmref
- \@mkbibcitation
- \fi
+ \let\metadata@authors=\authors
+ \nxandlist{, }{, }{, }\metadata@authors
+ \def\@ACM@checkaffil{}%
\hypersetup{%
- pdfauthor={\authors},
+ pdfauthor={\metadata@authors},
pdftitle={\@title},
pdfsubject={\@concepts},
pdfkeywords={\@keywords},
@@ -1887,6 +1919,13 @@
\csname ver@acmart.cls\endcsname\space
and hyperref
\csname ver@hyperref.sty\endcsname}}%
+ \andify\authors
+ \andify\shortauthors
+ \global\let\authors=\authors
+ \global\let\shortauthors=\shortauthors
+ \if@ACM@printacmref
+ \@mkbibcitation
+ \fi
\global\@topnum\z@ % this prevents floats from falling
% at the top of page 1
\global\@botnum\z@ % we do not want them to be on the bottom either
@@ -2097,19 +2136,22 @@
\def\postcode#1{\unskip\ignorespaces}
\if@ACM@journal
\def\position#1{\unskip\ignorespaces}
- \def\institution#1{\unskip~#1\ignorespaces}
- \def\city#1{\unskip\ignorespaces}
+ \def\institution#1{\global\@ACM@instpresenttrue
+ \unskip~#1\ignorespaces}
+ \def\city#1{\global\@ACM@citypresenttrue\unskip\ignorespaces}
\def\state#1{\unskip\ignorespaces}
\newcommand\department[2][0]{\unskip\ignorespaces}
- \def\country#1{\if@ACM@affiliation@obeypunctuation\else, \fi#1\ignorespaces}
+ \def\country#1{\global\@ACM@countrypresenttrue
+ \if@ACM@affiliation@obeypunctuation\else, \fi#1\ignorespaces}
\else
\def\position#1{\if@ACM@affiliation@obeypunctuation#1\else#1\par\fi}%
- \def\institution#1{\if@ACM@affiliation@obeypunctuation#1\else#1\par\fi}%
+ \def\institution#1{\global\@ACM@instpresenttrue
+ \if@ACM@affiliation@obeypunctuation#1\else#1\par\fi}%
\newcommand\department[2][0]{\if@ACM@affiliation@obeypunctuation
#2\else#2\par\fi}%
- \let\city\@ACM@addtoaddress
+ \def\city#1{\global\@ACM@citypresenttrue\@ACM@addtoaddress{#1}}%
\let\state\@ACM@addtoaddress
- \let\country\@ACM@addtoaddress
+ \def\country#1{\global\@ACM@countrypresenttrue\@ACM@addtoaddress{#1}}%
\fi
\def\@mkauthors{\begingroup
\hsize=\textwidth
@@ -2170,6 +2212,29 @@
\unskip, {\@currentaffiliations}\par
\fi
\def\@currentaffiliations{}}
+\newif\if@ACM@instpresent
+\@ACM@instpresenttrue
+\newif\if@ACM@citypresent
+\@ACM@citypresenttrue
+\newif\if@ACM@countrypresent
+\@ACM@countrypresenttrue
+\def\@ACM@resetaffil{%
+ \global\@ACM@instpresentfalse
+ \global\@ACM@citypresentfalse
+ \global\@ACM@countrypresentfalse
+}
+\def\@ACM@checkaffil{%
+ \if@ACM@instpresent\else
+ \ClassWarningNoLine{\@classname}{No institution present for an affiliation}%
+ \fi
+ \if@ACM@citypresent\else
+ \ClassWarningNoLine{\@classname}{No city present for an affiliation}%
+ \fi
+ \if@ACM@countrypresent\else
+ \ClassError{\@classname}{No country present for an affiliation}{ACM
+ requires each author to indicate their country using country macro.}%
+ \fi
+}
\def\@mkauthors@i{%
\def\@currentauthors{}%
\def\@currentaffiliations{}%
@@ -2188,11 +2253,13 @@
\gdef\@currentaffiliations{%
\setkeys{@ACM@affiliation@}{obeypunctuation=false}%
\setkeys{@ACM@affiliation@}{##1}%
- \@affiliationfont##2}%
+ \@ACM@resetaffil
+ \@affiliationfont##2\@ACM@checkaffil}%
\else
\g@addto@macro{\@currentaffiliations}{\and
\setkeys{@ACM@affiliation@}{obeypunctuation=false}%
- \setkeys{@ACM@affiliation@}{##1}##2}%
+ \setkeys{@ACM@affiliation@}{##1}\@ACM@resetaffil
+ ##2\@ACM@checkaffil}%
\fi
\fi
\global\let\and\@typeset@author@line}%
@@ -2250,11 +2317,13 @@
\def\affiliation##1##2{\ifx\@currentaffiliation\@empty
\gdef\@currentaffiliation{%
\setkeys{@ACM@affiliation@}{obeypunctuation=false}%
- \setkeys{@ACM@affiliation@}{##1}##2}%
+ \setkeys{@ACM@affiliation@}{##1}\@ACM@resetaffil
+ ##2\@ACM@checkaffil}%
\else
\g@addto@macro\@currentaffiliation{\par
\setkeys{@ACM@affiliation@}{obeypunctuation=false}%
- \setkeys{@ACM@affiliation@}{##1}##2}%
+ \setkeys{@ACM@affiliation@}{##1}\@ACM@resetaffil
+ ##2\@ACM@checkaffil}%
\fi
\global\let\and\@typeset@author@bx
}%
@@ -2293,11 +2362,13 @@
\def\affiliation##1##2{\ifx\@currentaffiliation\@empty
\gdef\@currentaffiliation{%
\setkeys{@ACM@affiliation@}{obeypunctuation=false}%
- \setkeys{@ACM@affiliation@}{##1}##2}%
+ \setkeys{@ACM@affiliation@}{##1}\@ACM@resetaffil
+ ##2\@ACM@checkaffil}%
\else
\g@addto@macro\@currentaffiliation{\par
\setkeys{@ACM@affiliation@}{obeypunctuation=false}%
- \setkeys{@ACM@affiliation@}{##1}##2}%
+ \setkeys{@ACM@affiliation@}{##1}\@ACM@resetaffil
+ ##2\@ACM@checkaffil}%
\fi
\global\let\and\@typeset@author@bx}%
\bgroup\hsize=\columnwidth
@@ -2313,12 +2384,13 @@
\def\streetaddress##1{\unskip, ##1}%
\def\postcode##1{\unskip, ##1}%
\def\position##1{\unskip\ignorespaces}%
- \def\institution##1{\unskip, ##1}%
+ \gdef\@ACM@institution@separator{, }%
+ \def\institution##1{\unskip\@ACM@institution@separator ##1\gdef\@ACM@institution@separator{ and }}%
\def\city##1{\unskip, ##1}%
\def\state##1{\unskip, ##1}%
\renewcommand\department[2][0]{\unskip\@addpunct, ##2}%
\def\country##1{\unskip, ##1}%
- \def\and{\unskip; }%
+ \def\and{\unskip; \gdef\@ACM@institution@separator{, }}%
\def\@author##1{##1}%
\def\email##1##2{\unskip, \nolinkurl{##2}}%
\addresses
@@ -2534,7 +2606,10 @@
\fancyfoot[C]{\if@ACM@printfolios\footnotesize\thepage\fi}%
\fancyhead[LO]{\ACM@linecountL\@headfootfont\shorttitle}%
\fancyhead[RE]{\@headfootfont\@shortauthors\ACM@linecountR}%
- \if@ACM@nonacm\else%
+ \if@ACM@nonacm
+ \fancyhead[LE]{\ACM@linecountL}%
+ \fancyhead[RO]{\ACM@linecountR}%
+ \else%
\fancyhead[LE]{\ACM@linecountL\@headfootfont\footnotesize
\acmConference@shortname,
\acmConference@date, \acmConference@venue}%
@@ -2547,7 +2622,10 @@
\fancyfoot[C]{\if@ACM@printfolios\footnotesize\thepage\fi}%
\fancyhead[LO]{\ACM@linecountL\@headfootfont\shorttitle}%
\fancyhead[RE]{\@headfootfont\@shortauthors\ACM@linecountR}%
- \if@ACM@nonacm\else%
+ \if@ACM@nonacm
+ \fancyhead[LE]{\ACM@linecountL}%
+ \fancyhead[RO]{\ACM@linecountR}%
+ \else%
\fancyhead[LE]{\ACM@linecountL\@headfootfont
\acmConference@shortname,
\acmConference@date, \acmConference@venue}%
@@ -2878,6 +2956,25 @@
\popQED\endtrivlist\@endpefalse
}
\AtEndPreamble{%
+ \if@ACM@pbalance
+ \global\@ACM@balancefalse
+ \ifcase\ACM@format@nr
+ \relax % manuscript
+ \or % acmsmall
+ \or % acmlarge
+ \or % acmtog
+ \RequirePackage{pbalance}%
+ \or % sigconf
+ \RequirePackage{pbalance}%
+ \or % siggraph
+ \RequirePackage{pbalance}%
+ \or % sigplan
+ \RequirePackage{pbalance}%
+ \or % sigchi
+ \RequirePackage{pbalance}%
+ \or % sigchi-a
+ \fi
+ \fi
\if@ACM@balance
\ifcase\ACM@format@nr
\relax % manuscript
@@ -2935,8 +3032,15 @@
\def\@tempa{#1}%
\ifx\@tempa\@empty\def\@tempa{arxiv}\fi
\def\@tempb{arxiv}%
- \ifx\@tempa\@tempb
- arXiv:\href{https://arxiv.org/abs/#2}{#2}\else arXiv:#2%
+ \ifx\@tempa\@tempb\relax
+ arXiv:\href{https://arxiv.org/abs/#2}{#2}%
+ \else
+ \def\@tempb{arXiv}%
+ \ifx\@tempa\@tempb\relax
+ arXiv:\href{https://arxiv.org/abs/#2}{#2}%
+ \else
+ arXiv:#2%
+ \fi
\fi}
\let\@vspace@orig=\@vspace
\let\@vspacer@orig=\@vspacer