[Tex/LaTex] ACM Sigplan format authorinfo

acm

ACM Sigplan provides \authorinfo for author information. Currently, I have 4 authors. I would like to format in two lines each with two authors. However, by default, it formats in two lines, line 1 with three authors, and line 2 with one author in the middle. How can I change this?

\authorinfo{Author 1}
{Aff 1}
{email 1}
\authorinfo{Author 2}
{Aff 2}
{email 2}
\authorinfo{Author 3}
{Aff 3}
{email 3}
\authorinfo{Author 4}
{Aff 4}
{email 4}

Best Answer

You can redefine \@maketitle to give the desired formatting in case of four authors:

\documentclass[preprint,10pt]{sigplanconf}
\usepackage{amsmath}

\makeatletter
\def\@maketitle{%
  \begin{center}
  \@settitlebanner
  \let \thanks = \titlenote
  {\leftskip = 0pt plus 0.25\linewidth
   \rightskip = 0pt plus 0.25 \linewidth
   \parfillskip = 0pt
   \spaceskip = .7em
   \noindent \LARGE \bfseries \@titletext \par}
  \vskip 6pt
  \noindent \Large \@subtitletext \par
  \vskip 12pt
  \ifcase \@authorcount
    \@latex@error{No authors were specified for this paper}{}\or
    \@titleauthors{i}{}{}\or
    \@titleauthors{i}{ii}{}\or
    \@titleauthors{i}{ii}{iii}\or
    \@titleauthors{i}{ii}{}\@titleauthors{iii}{iv}{}\or% HERE
    \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{}\or
    \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{vi}\or
    \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{vi}%
                  \@titleauthors{vii}{}{}\or
    \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{vi}%
                  \@titleauthors{vii}{viii}{}\or
    \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{vi}%
                  \@titleauthors{vii}{viii}{ix}\or
    \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{vi}%
                  \@titleauthors{vii}{viii}{ix}\@titleauthors{x}{}{}\or
    \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{vi}%
                  \@titleauthors{vii}{viii}{ix}\@titleauthors{x}{xi}{}\or
    \@titleauthors{i}{ii}{iii}\@titleauthors{iv}{v}{vi}%
                  \@titleauthors{vii}{viii}{ix}\@titleauthors{x}{xi}{xii}%
  \else
    \@latex@error{Cannot handle more than 12 authors}{}%
  \fi
  \vspace{1.75pc}
  \end{center}}
\makeatother

\begin{document}

\title{My Title}

\authorinfo{Fname Lname}
           {school}
           {email@edu}
\authorinfo{Fname Lname}
           {school}
           {email@edu}
\authorinfo{Fname Lname}
           {school}
           {email@edu}
\authorinfo{Fname Lname}
           {school}
           {email@edu}

\maketitle

\begin{abstract}

\end{abstract}

\end{document}

The change was made in the line marked % HERE which originally formats four authors using

\@titleauthors{i}{ii}{iii}\@titleauthors{iv}{}{}

that is, three authors in the first line and the fourth, in a separate line. The required formatting can be achieved by changing the above line to

\@titleauthors{i}{ii}{}\@titleauthors{iii}{iv}{}

or to

\@titleauthors{i}{}{ii}\@titleauthors{iii}{}{iv}

for larger separation between the authors (in my code I chose the first possibility, but you can use the one that suits you better).

enter image description here

For ecomony in the code, this can also be done by patching (using etoolbox, for example) the \@maketitle command:

\documentclass[preprint,10pt]{sigplanconf}
\usepackage{etoolbox}

\makeatletter
\patchcmd{\@maketitle}{\@titleauthors{i}{ii}{iii}\@titleauthors{iv}{}{}}{\@titleauthors{i}{ii}{}\@titleauthors{iii}{iv}{}}{}{}
\makeatother

\begin{document}

\title{My Title}

\authorinfo{Fname Lname}
           {school}
           {email@edu}
\authorinfo{Fname Lname}
           {school}
           {email@edu}
\authorinfo{Fname Lname}
           {school}
           {email@edu}
\authorinfo{Fname Lname}
           {school}
           {email@edu}

\maketitle

\begin{abstract}

\end{abstract}

\end{document}

To get bigger separation, one would use

\makeatletter
\patchcmd{\@maketitle}{\@titleauthors{i}{ii}{iii}\@titleauthors{iv}{}{}}{\@titleauthors{i}{}{ii}\@titleauthors{iii}{}{iv}}{}{}
\makeatother