acmart: ugly email addresses -- how to avoid line breaking?

acmart is creating very ugly line breaks in some of my colleagues' email addresses, and I don't know how to fix this since things like \small (to reduce font size) and \hbox (to avoid line breaking) don't work here. Is there a way I can convince LaTeX to avoid breaking the email addresses?

Here's an example of the code:

\documentclass[sigconf]{acmart}

\begin{document}

\title{Paper Title}

\author{Author 1}
\email{email@domain.com}
\affiliation{Affiliation}

\author{Author 2}
\email{email@domain.com}
\affiliation{Affiliation}

\author{Author 3}
\email{email@domain.com}
\affiliation{Affiliation}

\author{Author With Long Email 1}
\email{long\_long\_long\_address@domain.com}
\affiliation{Affiliation}

\author{Author With Long Email 2}
\email{long\_long\_long\_address@domain.com}
\affiliation{Affiliation}

\maketitle

\end{document}


And here's the result:

1 Answer

You can make all emails smaller by redefining \UrlFont. You can avoid the break by redefining \UrlBreakPenalty:

\documentclass[sigconf]{acmart}

\begin{document}

\title{Paper Title}

\author{Author 1}
\email{email@domain.com}
\affiliation{Affiliation}

\author{Author 2}
\email{email@domain.com}
\affiliation{Affiliation}

\author{Author 3}
\email{email@domain.com}
\affiliation{Affiliation}

\author{Author With Long Email 1}
\email{long\_long\_long\_address@domain.com}
\affiliation{Affiliation}

\author{Author With Long Email 2}
\email{long\_long\_long\_address@domain.com}
\affiliation{Affiliation}

\begingroup
%\def\UrlFont{\ttfamily\scriptsize} %smaller email
\mathchardef\UrlBreakPenalty=10000
\maketitle

\endgroup
\end{document}


• Awesome, exactly what I was looking for! Thanks! Sep 13 '17 at 10:31
• Are there any other ways to do this? It didn't work for my use case (possibly because the email domain contains a hyphen). Aug 27 '21 at 18:55
• @ElliottSlaughter if you have a new question ask a new question (with a full example). Don't ping individual people. Aug 27 '21 at 18:56