How can I make a non-breaking space in reStructuredText?
An obvious but problematic solution is:
`word A`
But it might be treated differently by different implementations, such as rst2latex or rst2pdf. Plus it is rendered in italics.
How to work with non-breaking spaces. Non-breaking spaces are easy to add. The quickest way is to press Ctrl+Shift+Spacebar (or on a Mac, type Option+Spacebar). Alternatively, you can select 'Non-breaking Space' from the Insert>Special Characters menu.
You have seen that with the ,   , and the   character entities, you can display blank spaces in the browser. This isn't possible just using the spacebar key. You can also use the character entity in specific places to prevent words that should stay together from breaking into the next line.
  in WordPress WordPress's Gutenberg editor offers an easy way of inserting non-breaking spaces into articles. Instead of a space, press Option+Space on Mac or Ctrl+Shift+Space on Windows.
Your word processor assumes that a word space marks a safe place to flow text onto a new line or page. A nonbreaking space is the same width as a word space, but it prevents the text from flowing to a new line or page. It's like invisible glue between the words on either side.
You need the unicode directive, but it can only be used in substitutions. So you need to define a substitution like this:
.. |nbsp| unicode:: 0xA0 :trim:
and then use it like this:
xx |nbsp| xx
:trim:
is there to get rid of those spaces around the substitution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With