GeneralThe wrapping of email addresses

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
confused-jon
Posts: 3
Joined: Mon Jan 05, 2009 7:44 pm

The wrapping of email addresses

Post by confused-jon »

Hello all,

I have a problem with the wrapping of text when an email address (or similar 'word') needs to be wrapped. I find that the email address extends into the right hand margin of the document. I would like the text to wrap instead of doing this.

Example:

Code: Select all

\documentclass[a4paper,10pt]{article}
\usepackage{times}
\setlength{\parskip}{10pt}

\begin{document}

The first line is just full of normal text.  This should wrap fine.  It is the line underneath that extends into the right hand margin.\\
Start this line with a normal sentence.  Add email address namedperson@longsystemname.domain.net.  More text that is wrapped normally.\\
The last line is just full of normal text like the first.  This should wrap fine.  It is the line above that extends into the right hand margin.\\

Now this is just a whole block of normal text until the email address that I have added.  This email address does not wrap correctly **.  email to namedperson@longsystemname.domain.net.  More text that is wrapped normally.  JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK

If the right margin occurs before the ``@'' symbol of the email address, the line will wrap fine.  Example *** *** *** *** *** *** *** *** ****.  email to namedperson@longsystemname.domain.net.  More text that is wrapped normally.  JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK JUNK

So is it just email addresses?  What if I include a very long non-english word in my text that requires wrapping.  Does it wrap correctly? Letsfindoutwiththisconcatenationofwords.  The very long non-english word wraps correctly.
\end{document}
In case it is helpful, the output generated by the 'latex' command is appended.

How can I change things so that the "namedperson@longsystemname.domain.net" text wraps correctly?
Sorry if this is a stupid question, I'm new to latex!

All help appreciated!
Best wishes,
Jon

Code: Select all

$ latex overflow-example.tex
This is TeX, Version 3.14159 (Web2C 7.4.5)
(./overflow-example.tex
LaTeX2e <2001/06/01>
Babel <v3.7h> and hyphenation patterns for american, french, german, ngerman, n
ohyphenation, loaded.
(/usr/share/texmf/tex/latex/base/article.cls
Document Class: article 2001/04/21 v1.4e Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/size10.clo))
(/usr/share/texmf/tex/latex/psnfss/times.sty) (./overflow-example.aux)
(/usr/share/texmf/tex/latex/psnfss/ot1ptm.fd)
Overfull \hbox (59.71556pt too wide) in paragraph at lines 10--13
\OT1/ptm/m/n/10 Start this line with a nor-mal sen-tence. Add email ad-dress na
med-per-son@longsystemname.domain.net.

Underfull \hbox (badness 10000) in paragraph at lines 10--13


Overfull \hbox (82.87585pt too wide) in paragraph at lines 14--15
\OT1/ptm/m/n/10 added. This email ad-dress does not wrap cor-rectly **. email t
o named-per-son@longsystemname.domain.net.
[1] (./overflow-example.aux) )
(see the transcript file for additional information)
Output written on overflow-example.dvi (1 page, 2044 bytes).
Transcript written on overflow-example.log.

Recommended reading 2024:

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

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

The wrapping of email addresses

Post by localghost »

Try the breakurl or the url package.


Best regards and welcome to the board
Thorsten¹
confused-jon
Posts: 3
Joined: Mon Jan 05, 2009 7:44 pm

Re: The wrapping of email addresses

Post by confused-jon »

Thorsten,

I will look into the suggested packages and let you know how I get on.

Thank you for the help and the welcome.

Regards,
Jon
confused-jon
Posts: 3
Joined: Mon Jan 05, 2009 7:44 pm

The wrapping of email addresses

Post by confused-jon »

Sorry about the delay (someone stole my time). The url package worked well for me. I have put an example below in case anyone is interested.

Thanks very much,
Jon

Code: Select all

\documentclass[a4paper,10pt]{article}
\usepackage{times}
%
\usepackage{url}
%
\setlength{\parskip}{10pt}

\begin{document}
Possible solution using url package.

The first line is just full of normal text.  This should wrap fine.  It is the line underneath that requires use of the url package.\\
Start with normal sentence.  Add email address and use url command: \url{namedperson@name.domain.net}.  More text that is wrapped normally.\\
The last line is just full of normal text like the first.  This should wrap fine.  It is the line above that requires use of the url package.\\
\end{document}
Post Reply