acmart
acmart copied to clipboard
Weird linebreak for long email addresses
I encountered the problem that long email addresses are broken at a weird position. I tried to add a manual \linebreak[0] to the email address but that does not help as the document no longer compiles. Is it possible to set the email addresses differently or somewhere else?
url.sty tries to break e-mails on a dot, which is probably the least bad option.
I just wonder whether it would make sense as an author to add hints which point would be preferred. Unfortunately, as said, the document no longer compiles when \linebreak[0] is added.
acmart
just use existing packages, so https://tex.stackexchange.com/ might be a better place to ask such questions and get help.
In this case, the documentation for url.sty
(available at http://mirrors.ctan.org/macros/latex/contrib/url/url.pdf, or by running command texdoc url
, or via http://texdoc.net/) gives the following code (that you can add to your document's preamble):
Here is an example to make “!” inside \url force a line break instead of being treated verbatim:
\makeatletter
\g@addto@macro\UrlSpecials{\do\!{\newline}}
\makeatother % Forgot in the docs, but you'll need it.
Then you can use !
inside URL arguments instead of \linebreak
. But not sure then how to escape a literal !
though, in either URLs or in math mode. The docs suggest most non-special characters are fine as alternatives to !
, but I haven't tried.
For follow-ups, better ask on StackExchange.