[Solved] Hyphenated words recognized as whole words

Writing a book, Automating Document Production - Discuss your special needs here
Post Reply
Mahava
Posts: 2
Joined: Sat Sep 19, 2015 11:50 pm

[Solved] Hyphenated words recognized as whole words

Post by Mahava »

I am putting together a document that has foreign words in it so the pronunciation of those words are spelled out. Is there a way to format the doc so the hyphenated words won't be divided onto two lines?

Example of what is happening:

And the King of Mitz-ra-yim said to the Ha-
iv-rit...

What I would prefer to happen:

And the King of Mitz-ra-yim said to the Ha-iv-rit
...

Or:
And the King of Mitz-ra-yim said to the
Ha-iv-rit...

I have the auto hyphenation turned off - these are hyphens that I am putting in the writing.

Thanks!
Last edited by MrProgrammer on Thu Sep 10, 2020 5:50 am, edited 1 time in total.
Reason: Tagged ✓ [Solved]
Open Office 4.1.1
Windows 8
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Hyphenated words recognized as whole words

Post by acknak »

Greetings and welcome to the community forum!

Sorry, no. There's no simple way of preventing Writer from breaking words at hyphens.

The only way to prevent a word from being broken is to insert a zero width "word joiner" character at any position where Writer would otherwise break the word. In this case, each hyphen needs a WJ character before and after.

You can insert the WJ characters with Insert > Formatting mark > no width, no break. You can then copy/paste to other places.

You can use Edit > Find & Replace to replace hyphens in one operation.
AOO4/LO5 • Linux • Fedora 23
User avatar
MrProgrammer
Moderator
Posts: 4908
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Hyphenated words recognized as whole words

Post by MrProgrammer »

Hi, and welcome to the forum.

Insert → Formatting Mark → Non-breaking hyphen. The menu item may show you a keyboard shortcut. For mass changes, insert one in the document, then copy/paste it into the Edit → Find & Replace dialog thereby changing hyphens to non-breaking hyphens.

If this answered your question please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Hyphenated words recognized as whole words

Post by acknak »

MrProgrammer wrote:... Insert → Formatting Mark → Non-breaking hyphen. ...
Ha! Sitting right there but I never even noticed it. Good catch!

The steps I gave are a general solution: it works to prevent a word break at any position. Mr Programmer's is simpler when you need a hyphen.
AOO4/LO5 • Linux • Fedora 23
Mahava
Posts: 2
Joined: Sat Sep 19, 2015 11:50 pm

Re: Hyphenated words recognized as whole words

Post by Mahava »

Thank you - I will give this a try!
Open Office 4.1.1
Windows 8
Post Reply