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.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 piecesKeep 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}.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.Pitfalls
- A non-breaking space pasted from a word processor (the character U+00A0) works with pdfLaTeX; it is read as
~. - Every
~and every\mboxremoves a place where the line could break. Too many of them lead to lines that stick out into the margin, see Overfull \hbox (263.664pt too wide) in paragraph at lines 3--6. - For numbers with units,
\qtyfromsiunitxsets the space and prevents the break itself; see Units and numbers in LaTeX with siunitx.
Compiled with pdfLaTeX from TeX Live 2023.