Non-breaking space in LaTex: How to display the special character
A protected space in LaTeX connects words and characters that should stay together when a line breaks. If, for example, the specification "2 kg" is connected with a protected space, the "2" slides into the new line if the unit "kg" no longer fits the line in front of it. In this article you will learn how to insert a non-breaking space in LaTeX.
Protected spaces in LaTeX - how it works
In my running text useful in using a non-breaking space. Under no circumstances should names (B. Brecht) and physical information (2 m) be separated from one another when a line breaks.
- To insert a non-breaking space in a name, just add a tilde (~) instead of the space: B. ~ Brecht. In this case, make sure that there is no space before and after the tilde.
- For mathematical or physical information, on the one hand, the number should not be separated from the unit (2 kg), on the other hand, the distance between them should be narrower than with a normal space. You can set half a protected empty space with the command "\, ": 2 \, kg.
In the next article we will show you how you can use LaTeX to superscript and subscript numbers.