~, \nobreakspace ¶Synopsis:
before~after
The tie character, ~, produces a normal word space
between before and after at which the line will not be
broken. The command \nobreakspace and the Unicode input
character U+00A0 are synonyms. The character is also included in
Latin 1 and other 8-bit encodings.
The amount of space inserted is exactly the same interword glue as
that inserted by a space character between two regular words or the
‘\ ’ command (see Backslash-space: ‘\ ’), which is normally defined by the
current font. It can stretch or shrink as usual. The difference is
that TeX will not break a line at that space.
The word ‘tie’ has the above meaning in the TeX community; this differs from the typographic term “tie”, which is a diacritic in the shape of an arc, called a “tie-after” accent in the TeX world: o͡o (see Accents).
Here LaTeX will not break the line between “Donald” and “E.”:
Thanks to Donald~E. Knuth.
In addition, despite the period, LaTeX does not use end-of-sentence
spacing (see \@).
Ties prevent a line break where that could cause confusion. They still
allow hyphenation (of either of the tied words), so they are generally
preferable to putting consecutive words in an \mbox
(see \mbox & \makebox).
Exactly where ties should be used is something of a matter of taste, sometimes alarmingly dogmatic taste, among readers. If you are using a particular style guide, then of course you should use its particular recommendations. Here are some widely accepted examples, many of them from The TeXbook.
Chapter~12, or Theorem~\ref{th:Wilsons}, or
Figure~\ref{fig:KGraph}.
Typography involves
(1)~technology, and (2)~art.
See figures~1, 2, and~3; including math:
$1$,~$2$, or~$3$.
October~12 or
12~Oct. In general, in any expressions where numbers and
abbreviations or symbols are separated by a space: 565~CE, or
2:50~pm, or Boeing~747, or 268~Plains Road, or
\$$60$~kW. Some people prefer a thin space
(see \thinspace & \negthinspace) in some of these cases, or no
space at all. Whether a tie is used when a unit is spelled out in
full, as in 100 meters, is a judgement call, and may depend on
context.
D.~E. Knuth. Here
again some people prefer thin spaces or no space.
Donald~E. Knuth or Luis~I. Trabb~Pardo or
Charles~XII—but you must give TeX places to break the line
so you might do Charles Louis Xavier~Joseph de~la
Vall\'ee~Poussin.
equals~$n$, or
less than~$\epsilon$, or given~$X$, or
modulo~$p^e$ for all large~$n$ (but compare is~$15$ with
is $15$~times the height).
of~$x$, or from
$0$ to~$1$, or in common with~$m$.
dimension~$d$.
If in doubt, you might ask yourself whether the reader would be confused or startled (probably only momentarily, but still) if the space in question became a line break. If yes, use a tie.
Some non-English typesetting traditions have additional strong rules
for using ties: in Czech, for example, ties must be placed after
single-letter conjunctions; in French, before “high” punctuation
marks such as ‘:’; and conventions for breakable vs.
unbreakable spaces around em-dashes vary widely. LaTeX can take
care of some of these language-specific typesetting with the
babel, polyglossia, or other packages, but it can’t do
everything.