Non-breaking space in LaTeX (tilde, thin space, mbox)

A tilde ~ is a space at which LaTeX does not break the line: Figure~3. \, is a thin space that does not break either, and \mbox{...} keeps a whole expression in one line.

Keep two words together

Write ~ in place of the space. It has the width of a normal space and stretches with the line. Use it between a word and its number, between a title and a name and in front of \ref and \cite.

Dr.~Meyer explains this in Chapter~3 on page~12.
Result
The compiled example

Open in the editor

Thin space

\, is a space of one sixth of an em, about half a normal space, and LaTeX does not break the line at it. Use it between a number and its unit, inside abbreviations such as the German "z. B." and to group the digits of long numbers.

A weight of 10\,kg, z.\,B. 1\,000\,000 pieces
Result
The compiled example

Open in the editor

Keep an expression in one line

\mbox{...} sets its content in a box that is neither broken nor hyphenated. Use it for numbers with hyphens, phone numbers and names that must not be split.

The book has the number \mbox{ISBN 978-3-16-148410-0}.
Result
The compiled example

Open in the editor

Space after an abbreviation

In English text LaTeX treats a full stop after a lowercase letter as the end of a sentence and sets a wider space after it. After an abbreviation, write \ (a backslash and a space) for a normal space, or ~ for a normal space without a line break. With babel and a language such as ngerman all spaces have the same width, and this is not needed.

Citrus fruits, e.g.\ lemons, limes etc.\ are sour.
Result
The compiled example

Open in the editor

Pitfalls

Compiled with pdfLaTeX from TeX Live 2023.

Related pages