LibreOffice is treating all hyphens as nonbreaking. Is this a bug?

The problem is easy for me to reproduce consistently in either Writer or Draw. Simply type text with hyphens (no spaces) until you come to the end of a line. The line should always break at a hyphen, but it does not. A sample you can try:

Simply-type-text-with-hyphens-(no-spaces)-until-you-come-to-the-end-of-a-line-the-line-should-always-break-at-a-hyphen-but-it-does-not.

If it always breaks at a hyphen for you, then you’re not affected by the problem, in which case what am I doing wrong?

I’m using Linux Mint 15 with LibreOffice 4.0.2.2 on two different computers. I had the same problem with the LibreOffice version in Xubuntu 12.10 on one of the computers before I switched to Mint.

Odd. I don’t have much call for hyphenation, but I can confirm that my experience tallies with yours. On this machine I’m using LibO 4.0.5.2 on Ubuntu 13.04, the font active at the moment is PT Serif, but not sure that would make a difference. It’s also odd that CTRL-[hyphen] (as @mariosv points out below) has no effect at all on hyphenation. I tried toggling on/off the hyphenation options I could find under Tools > Customize, but it made no difference.

Hi Mr, Bailey,

I use Libreoffice 4.1.4 via ppa. I used version 4.0.4 and other versions before (3.5…). Ubuntu is version 12.04 LTS. Libreoffice doesn’t break as you described. I need a blank to break the expression. Now I will try your suggestion…

no evidence: fonts, with unity or gnome classic

Success! I uninstalled the Kubuntu package (version 4.1.2.3) and installed version 4.1.3.2 from the Web site. Lines break at hyphens. The birds are singing and the sun is shining.

Many thanks to “oweng” above for giving me that hint. Ubuntu users should make sure to download the deb version (the Web site offered me rpm by default). Once you’ve uninstalled the old version of LibreOffice, extract the downloaded archive and follow the instructions in the README file.

I am not sure about Kubuntu, but Ubuntu seems to have headed down a distinctly unique path where user now apparently need the PPA version if Unity integration etc. is required. Good to hear you got it working.

I’ve been using Ubuntu with MATE instead of Unity, so I haven’t tried this for stock Ubuntu with Unity. It did work in Ubuntu 13.10 with MATE, Kubuntu 13.10, and Mint 15 with MATE.

In the help:

Manual Hyphenation
You can insert a hyphen where you want on a line, or let LibreOffice search for the words to hyphenate, and then offer a suggested hyphenation.
To Manually Hyphenate Single Words
To quickly insert a hyphen, click in the word where you want to add the hyphen, and then press Ctrl+Hyphen(-).
If you insert a manual hyphen in a word, the word is only hyphenated at the manual hyphen. No additional automatic hyphenation is applied for this word. A word with a manual hyphen will be hyphenated without regard to the settings on the Text Flow tab page.

This answer doesn’t address the problem. I know how to insert hyphens and how to use auto-hyphenation. The problem is, whether I insert a normal hyphen (-) or a non-breaking hyphen (Ctrl + -), LO treats it as non-breaking; so, if the hyphenated word goes past the end of a line, LO moves the whole word to the next line. What I (and I’m fairly certain C. Bailey) want is for LO to move only the part of the word following the hyphen to the next line (just as Word and OO do; just as LO used to do).

What language are you typing in? Also which font are you using? There are a pair of bugs fdo#56392 (hyphenation) and fdo#58477 (hyphen treatment) that indicate problems for German. I think the second bug may be what you are experiencing. If I had to guess I would say it may be a locale-related issue. The example document provided in the second bug hyphenates as expected for me using v4.1.0.4 under Crunchbang for en-AU locale, even though the language remains set in German (Germany).

The language is English (US). The font is irrelevant; the problem occurs with any font I use, including Times New Roman, Free Serif, Droid Sans, and a bunch of fonts I designed myself.

The second bug—fdo#58477 (hyphen treatment)—seems to be the same as the problem I’ve noticed. it’s not a problem with hyphenation; it’s a problem with recognizing a typed hyphen as one of the characters after which the line can be broken. Writer does correctly recognize that it can break a line after an em dash, for example.

I’m hoping version 4.1 (which isn’t in Mint 15 repositories yet) will fix the problem, because it’s truly catastrophic in using Writer to lay out books (which is something it’s very good at, except for the hyphen problem). The only workaround is to insert a space or a line break after the hyphen, which introduces errors if the text is revised.

Update, October 23, 2013: The problem still occurs in LibreOffice 4.1.2.3 in a fresh installation of Ubuntu 13.10: LibreOffice still doesn’t know that it can break a line after a hyphen.

That is very strange. Do you have the libhyphen0 package installed? Under Tools > Options… > Language Settings > Writing Aids > Available language modules list (click the Edit… button) do you have “Libhyphen Hyphenator” checked? Does the language at the top of this dialog read “English (US)”? There is also an Options section/list on the prior dialog that contains settings for hyphenation however in my experience they do not have the effect you indicate.

Yes, libhyphen0 is installed, “Libhyphen Hyphenator” is checked, and “English (USA)” is the language chosen.

But once again, it’s not a problem of hyphenation. Hyphenation—automatically breaking long words with a hyphen—works fine. What doesn’t work is recognizing that a line can be broken after a typed hyphen, which is fundamental. If I write “record-breaking heat,” the word processor has to know that the line can break after “record-” if that’s the obvious place to break it.

I’ve now tried LibreOffice in fresh installs of Ubuntu 13.10 and Kubuntu 13.10 as well as Mint 15, on three different computers. The version I’m using right now is 4.1.2.3. In all of them, the same easily reproduced bug happens: just type a long line of random letters with no spaces, but occasional hyphens, and the line will not break at the hyphen.

This indicates a problem with the line-breaking algorithm in LO. I have no problem with v4.1.3.2 (website variant) here under Crunchbang 11, so it may be a problem with the PPA-supplied variants.