3

I'm writing a text on C++. But often the line breaks after the first "+", so I get C+

+

This is just an example. How can I prevent line breaking of arbitrary parts in my odt doc?

DarkTrick
  • 2,447
  • 1
  • 21
  • 39

1 Answers1

3

There is no formatting option at the moment

Use the Unicode Character U+2060. Insert it an every point the line breaks, but it shouldn't. It glues two parts together.

Example for "C++" ( | represents the text cursor )

  • C|++
  • Press Ctrl+Shift+U
  • u will appear on the screen
  • Type in 2060
  • Press Enter
  • Now the line won't break between C and +.
  • Move cursor: C+|+
  • repeat process
DarkTrick
  • 2,447
  • 1
  • 21
  • 39
  • Yes, that is the accepted way to prevent line breaks for characters that would otherwise cause them. It may be convenient to use *Find and Replace* to add the joiner. – Jim K Feb 08 '20 at 17:34
  • 1
    Just tested, and works... The described character sequence can be added to Autocorrect so that Writer will make the change from C++ to C++ as you type. The two pluses will initially split onto separate lines, but will rejoin as soon as the next character after the second plus is typed. – David Yockey Feb 10 '20 at 13:49
  • In my LibreOffice Writer this doesn't seem to work. Instead I found something similar via menu option Insert > Formatting mark > No width, no break. – E. van Putten Dec 05 '22 at 12:15