GeneralLatex makes a line break in an email address

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Florian
Posts: 16
Joined: Sat Mar 15, 2008 7:14 pm

Latex makes a line break in an email address

Post by Florian »

Hello all of you,

I have a terrible problem in one of my documents: In a footnote, the email addresses of the authors are given. Unfortunately, latex does hyphenate them. This is really bad, because the reader does not know whether the hyphenation sign is part of the email address or it was just inserted due to the line break. I installed the hyphenat package and forbade latex to hyphenate the addresses. But in one of the email addresses, there is indeed a hyphenation sign (as part of the email address), and at this point latex still makes a line break. Is it somehow possible to prevent latex from making a line break inside the email addresses alltogether?

Thank you very much for your generous help,
Florian :roll:

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Latex makes a line break in an email address

Post by Stefan Kottwitz »

Hi Florian,

perhaps demonstrate the problem by a minimal working example so that we are able to see what you are exactly doing, how you are writing email adresses, if you are using the url or hyperref package etc. It shouldn't be much work to show compilable code with this footnote and used packages.

Stefan
LaTeX.org admin
Florian
Posts: 16
Joined: Sat Mar 15, 2008 7:14 pm

Re: Latex makes a line break in an email address

Post by Florian »

Hi Stefan,

thanks for your answer. This is an anonymized version of what I have in my document:

\title{The Deployment of Conditional Probability Distributions for ...\footnote{The first mentioned author is grateful for generous financial support from ....}}
\author{Florian\footnote{University A. Contact email: \nohyphens{florian@university-A.com}}}
\begin{document}
\maketitle

Although I have loaded the hyphenat package, the computer still breaks the line inside the email address, i.e. in the output I have

florian@university-
A.com

The reason is probably that the email address already contains a hyphen. So the "nohyphen" command does not apply to that hyphen, because in the manual of the hyphenat package it says that only new hyphenations, which are done by the computer, are prevented through the command.

Is there any other way to get rid of that ugly line break?

Best regards and thanks again,
Florian
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Latex makes a line break in an email address

Post by Stefan Kottwitz »

Hi Florian,

of course it can be anonymized. But a minimal working example should be compilable and showing the problem, such that helping forum users can compile it and test their ideas for correction. The link I gave above helps to create a mwe and explaines why.

I cannot see what packages other than hyphenat you're using but a simple way preventing hyphenation is \mbox:

Code: Select all

Contact email: \mbox{florian@university-A.com}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Stefan
LaTeX.org admin
Florian
Posts: 16
Joined: Sat Mar 15, 2008 7:14 pm

Re: Latex makes a line break in an email address

Post by Florian »

Hi Stefan,

many thanks for your helpful reply.
I guess you are right, my minimal working example was not optimal.

Your "mbox" hint was great and solved my problem!

Best,
Florian
Post Reply