Text FormattingIs there a package to prevent words being split across lines

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
RiW
Posts: 29
Joined: Wed Sep 01, 2010 12:11 am

Is there a package to prevent words being split across lines

Post by RiW »

Hi,

Quick question which hopefully has a simple answer!

I personally don't like seeing words split across lines; e.g. The quick brown fox jump-
ed over the lazy dog.

I know there are commands to stop this happening for given paragraphs, but is there a package to prevent this outright please?

Many thanks.
Last edited by RiW on Sat Sep 04, 2010 7:27 pm, edited 1 time in total.

Recommended reading 2024:

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

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

CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Is there a package to prevent words being split across lines

Post by CrazyHorse »

RiW wrote:I personally don't like seeing words split across lines; e.g. The quick brown fox jump-
ed over the lazy dog.

I know there are commands to stop this happening for given paragraphs, but is there a package to prevent this outright please?

Code: Select all

\usepackage[none]{hyphenat}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The none option disables all hyphenation. If you use this option you
should also consider using \sloppy (to reduce TeX’s moans about bad
line breaks) or \raggedright (to reduce moans about overfull boxes).

Herbert
RiW
Posts: 29
Joined: Wed Sep 01, 2010 12:11 am

Re: Is there a package to prevent words being split across l

Post by RiW »

Thanks - that seems to work!

As a fairly new Latex user still getting to grips with concepts such as "tolerance" and the way Latex tries to typeset the text, is there any problem with using such a technique? According to various web-searches, the \sloppy technique can result in errors and unexpected formatting problems, and I don't really understand what that and \raggedright does (the help guides seem a little in-depth on these commands).

Is this method likely to be problematic or am I reading into this too much?

Thanks!
johnjamessmith0
Posts: 37
Joined: Sun Mar 29, 2009 1:41 am

Re: Is there a package to prevent words being split across l

Post by johnjamessmith0 »

TeX tries to justify text so that all of it lines up perfectly on both the left and the right. Of course the letter widths won't always add up to a perfect line, so TeX varies the length of the spaces between words so that in lines up. One prefers that these variations aren't too noticeable. So the more options you give LaTeX as places to end the line (e.g., between words, in the middle of words), the more likely you won't have lines that are "overfull" or "underfull".

TeX's default standards for how much stuff goes in a line are pretty strict. If it can't find a way to make everything nice like it wants, then it just gives up completely (cranky personality!) -- it doesn't even try to make the sides line up anymore; it just lets words run completely into the margin or not even to the end of the line at all. So if you make it harder on LaTeX by not allowing it to hyphenate words across lines, then it'll fail more often. \sloppy loosens TeX's standards so that in some cases where it usually gives up trying to line the text up, it now will still line them up for you -- it's just that now, say, you might have lines with extra big spaces in them made just so that the words would line up on the right side.

On the other hand, with \raggedright all of these difficulties are bypassed, if you don't mind having, well, a ragged right.
RiW
Posts: 29
Joined: Wed Sep 01, 2010 12:11 am

Re: Is there a package to prevent words being split across l

Post by RiW »

Thanks JohnJamesSmith; that clears things up.
Post Reply