TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On the title page of an article I want to insert a paragraph containing keywords. For indexing purposes (e. g. web search engines), I'd like to have the keywords unhyphenated (temporarily, of course). At the same time, the paragraph should be flushed at both sides, even though inter-word spaces may become larger than usual.

How can I achieve that?

share|improve this question
\begin{hyphenrules}{nohyphenation}Text\end{hyphenrules}, if you're using babel. – egreg Jan 11 '13 at 11:41
@egreg: Could you please turn this into an answer? – AlexG Jan 11 '13 at 11:45
@egreg: Placing \begin{sloppypar} and \end{sloppypar} around the non-hyphenated paragraph seems to be necessary, as Herbert and David pointed out. – AlexG Jan 11 '13 at 12:56
up vote 5 down vote accepted

it makes sense to put the text into \begin{sloppypar}...\end{sloppypar} when it is not hyphenated.




enter image description here

share|improve this answer
I tried \foreignlanguage{nohyphenation}{\sloppy\blindtext}. While hyphenation is disabled, there is no justification at the margins. – AlexG Jan 11 '13 at 12:45
yes, see my edit – Herbert Jan 11 '13 at 12:46
Thanks! \begin{sloppypar}\foreignlanguage{nohyphenation}{\blindtext}\end{sloppypar} works. – AlexG Jan 11 '13 at 12:48

You can make hyphens infinitely expensive


or use a language without any hyphenation patterns loaded


Then you might want to use \sloppy or \begin{sloppypar}...\end{sloppypar} so the word spacing can stretch more than usual.

share|improve this answer
Thank you very much for this explanation! I'd prefer @egreg 's approach, though. It is more LaTeX-style. – AlexG Jan 11 '13 at 11:51
Yes but it requires having read the babel manual which is cheating I'm sure:-) Note you may still want to use sloppy(par) to handle white space, the babel declaration just turns off hyphenation I think. – David Carlisle Jan 11 '13 at 11:56
afaict from experimenting with hyphenrules, the paragraph is flushed to both sides. This implies larger inter-word space I guess, right? – AlexG Jan 11 '13 at 12:01
Yes it doesn't change the justification but without relaxing the normal rules so TeX may have to stretch space too much or it may stick text into the margin (both of these are infinitely bad) \sloppy tells tex that stretching white space isn't so bad so it will do that in preference to having over-full boxes (and it will not complain about boxes being underfull due to over-stretched space) – David Carlisle Jan 11 '13 at 12:09
…and then \selectlanguage{english} when ready to resume hyphenation. – John Peyton Oct 7 '14 at 15:51

Hyphenation can be disabled in different ways. One is to set


that assign "infinite" cost to discretionary and explicit hyphens respectively.

Another way is to choose a language with no hyphenation patterns, which is more efficient, because it spares TeX from computing demerits.

All modern TeX distributions have already such a language in their predefined set, and it's called nohyphenation. If you're using babel, then


will allow line breaking only at explicit hyphens. If you want to disable also them, then setting \exhyphenpenalty=10000 is still necessary. However, one has to cope with paragraph setting, allowing larger interword spaces without too many Underfull \hbox messages, which is obtained by saying \sloppy.

A "complete" solution might be to define a nohyphens environment so that one can type

Text not to be hyphenated

in the following way


If babel is loaded we use its features, otherwise we simply set the current language to the "no hyphenation" one, if existent; in the worst case we set the language number to 255, which shouldn't be defined (TeX formats usually assign progressive numbers to the enabled languages and having 256 of them is highly unlikely).

Note that assigning \language=-1 is not a solution: the TeXbook says, at p. 455,

If \language is negative or greater than 255, TeX acts as if \language = 0

share|improve this answer
Thanks for your detailed answer! – AlexG Jan 11 '13 at 13:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.