Welcome to the UK List of
TeX Frequently Asked Questions
on the Web

Searching

The index of Frequently Asked Questions about TeX is searchable.

Please enter your keyword here:   then press here: ,    or:
Google

Stopping all hyphenation

It may seem an odd thing to want to do (after all, one of TeX’s great advertised virtues is the quality of its hyphenation) but it’s sometimes necessary. The real problem is, that the quality of TeX’s output is by default largely dependent on the presence of hyphenation; if you want to abandon hyphenation, something has to give.

TeX (slightly confusingly) offers four possible mechanisms for suppressing hyphenation (there were only two prior to the extensions that arrived with TeX version 3).

First, one can set the hyphenation penalties \hyphenpenalty and \exhyphenpenalty to an ‘infinite’ value (that is to say, 10000). This means that all hyphenations will sufficiently penalise the line that would contain them, that the hyphenation won’t happen. The disadvantage of this method is that TeX will re-evaluate any paragraph for which hyphenations might help, which will slow TeX down.

Second, one can select a language for which no hyphenation patterns exist. Some distributions create a language nohyphenation, and the hyphenat package uses this technique for its \nohyphens command which sets its argument without any hyphenation. You can load hyphenat with the command

\usepackage[none]{hyphenat}

to prevent any hyphenation in a single-language document. The technique cannot work in a document in which babel controls language selection, since babel incorporates hyphenation change into its language change facilities.

Third, one can set \left- and/or \righthyphenmin to a sufficiently large value that no hyphenation could possibly succeed, since the minimum is larger than the length of the longest word TeX is willing to hyphenate (the appropriate value is 62).

Fourth, one can suppress hyphenation for all text using the current font by the command

\hyphenchar\font=-1

This isn’t a particularly practical way for users to suppress hyphenation — the command has to be issued for every font the document uses — but it’s how LaTeX itself suppresses hyphenation in tt and other fixed-width fonts.

Which of the techniques you should use depends on what you actually want to do. If the text whose hyphenation is to be suppressed runs for less than a paragraph, your only choice is the no-hyphens language: the language value is preserved along with the text (in the same way that the current font is); the values for penalties and hyphen minima active at the end of a paragraph are used when hyphenation is calculated.

Contrariwise, if you are writing a multilanguage document using the babel package, you cannot suppress hyphenation throughout using either the no-hyphens language or the hyphen minima: all those values get changed at a babel language switch: use the penalties instead.

If you simply switch off hyphenation for a good bit of text, the output will have a jagged edge (with many lines seriously overfull), and your (La)TeX run will bombard you with warnings about overfull and underfull lines. To avoid this you have two options.

The simplest route is to use \sloppy (or its environment version sloppypar), and have TeX stretch what would otherwise be underfull lines to fill the space offered, while prematurely wrapping overfull lines and stretching the remainder.

Alternatively, you may set the text ragged right, and at least get rid of the overfull lines; this technique is ‘traditional’ (in the sense that typists do it) and may be expected to appeal to the specifiers of eccentric document layouts (such as those for dissertations), but for once their sense conforms with typographic style. (Or at least, style constrained in this curious way.)

hyphenat.sty
macros/latex/contrib/hyphenat (or browse the directory); catalogue entry


Go to previous question, or next question

Go to FAQ home.

URL for this question: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=hyphoff

Comments, suggestions, or error reports? - see “how to improve the FAQ”.

This is FAQ version 3.27, released on 2013-06-07.