I have a document where ‘C++’ happens to appear at the end of a line. How do I teach Writer that this is a word and it shouldn’t linebreak within it?
I pieced together a workaround: Inserting a ‘ZERO WIDTH NO-BREAK SPACE’ (U+FEFF) as glue between any two charachters of the original string (“C++” in your case). During my test this worked even if the glued-together string (of now 5 logical characters) was posted in a comment here and copied/pasted from there into a Writer document. Try it: [non-breaking C++ with 5 logical characters=] “C++”
As I do not know an easy way to insert U+FEFF, I hope there is someone knowing a much better solution
On Win I don’t know such a method except for Software having installed a proper extension. In LibreOffice I just reinstalled ‘ComposeSpecialCharacter’(.oxt) extension for the purpose and enter e.g. FEFF[Alt]+u (configurable).
(Building an answer from the comments above:)
You may glue the characters together with the help of the unicode character U+FEFF ‘ZERO WIDTH NO_BREAK SPACE’.
You may get this invisible character
-
on most Linuxes with Ctrl+Shift+ufeff as @Karolus has imparted
-
in LibreOffice having installed an appropriate extension, namely ‘Compose Special Characters’, by typing FEFF and suffixing your chosen shortcut.
-
detouring a long way using the formula =UNICHAR(HEX2DEC(“FEFF”)) in Calc and procesing a ‘Copy’ > ‘Paste Special…’
-
simplest, but unflexible copying this string C++ which contains two specimen of the glue drop between the visible characters and taking an invisible zero-width step from it.
Thanks, that’s great, I’d upvote you if I had the reputation