# How to prevent extra spaces between two specific words when justification occurs?

My document contains many short, justified lines, so the lines often appear with many spaces between words, e.g.:

These    words    have    a    space
so that they can fit nicely into the
available line.


In most situations, this is no problem, however, there are some select situations where I want a group of two or more words to appear together, even if other words in the lines are pulled apart, e.g., with "these words" linked:

These words     have     a     space
so that they can fit nicely into the
available line.


How can this be done?

I'm looking for either a ConTeXt or TeX solution.

-

## 1 Answer

\hbox{These words} will do. Or, if you prefer a macro,

\def\nespace{\hskip\fontdimen2\font\relax}


and

These\nespace words


This space has no stretch or shrink component, but is the same as the normal interword space. If you want to add shrinkability:

\def\nespace{\hskip\fontdimen2\font minus\fontdimen4\font\relax}


The main difference between the \hbox approach and \nespace is that a line break can be taken at \nespace. Shouldn't you want it, just add \nobreak before \hskip as glue is not a feasible break point if preceded by discardable items and \nobreak adds a penalty, which is discardable.

-
How about line breaks? Are they permitted at \nespace? – lockstep Apr 14 '12 at 12:19
@lockstep Yes, of course: any glue is a feasible line break point if it's not preceded by discardable items. In order not to break, one can add \nobreak before \hskip. – egreg Apr 14 '12 at 12:21
In that case, please point out the difference to \hbox in your answer. – lockstep Apr 14 '12 at 12:22