[Solved] Don't break here!

Discuss the word processor
Post Reply
JDlugosz
Posts: 19
Joined: Mon Apr 07, 2008 11:58 pm

[Solved] Don't break here!

Post by JDlugosz »

I used the word ::?CLASS in a paragraph, and it was placed in a character style to indicate "code". It happened to be near the end of the line, so Writer decided to break the line between the ::? and the CLASS parts.
That is not correct. How do I tell it not to break here?
On a related note, why can't I get my "language:none/no spellchecking" to stick within the character style? When I apply my code style I want to red wavies to go away.

--John
Last edited by Hagar Delest on Mon Jun 09, 2008 10:17 pm, edited 2 times in total.
Reason: tagged the thread as Solved.
TerryE
Volunteer
Posts: 1401
Joined: Sat Oct 06, 2007 10:13 pm
Location: UK

Re: Don't break here!

Post by TerryE »

The process of deciding when to break lines is called Text Flow. To my knowledge, text flow can only be controlled at a paragraph level. There is no mechanism within Writer to override text flow at a character level to keep an arbitrary character string together in a line. Line breaks are automatically inserted as required at word breaks (and within words if hyphenation is enabled, but that's a separate topic). Your problem is that both : and ? are treated as word-break characters.

The easiest way to circumvent this is to insert a line-break (CTL-Enter) before the ::?.

Please follow the forum rules: One post, one topic. Thx
Ubuntu 11.04-x64 + LibreOffice 3 and MS free except the boss's Notebook which runs XP + OOo 3.3.
JDlugosz
Posts: 19
Joined: Mon Apr 07, 2008 11:58 pm

Re: Don't break here!

Post by JDlugosz »

Is there any proposal on the books for respecting some kind of non-breaking joiner character, or marking a passage as non-breaking?
Flowing the paragraph manually is only a hack for the final printed version, as it will mess up when the paragraph is edited.
TerryE
Volunteer
Posts: 1401
Joined: Sat Oct 06, 2007 10:13 pm
Location: UK

Re: Don't break here!

Post by TerryE »

Maybe the other can comment/correct me but I suspect not. The big pressure from users is to match key areas where Writer doesn't do what MS Word does. Here Word suffers from exactly the same limitations. It's only when you get into DTP packages such as LATEX do you start to get this level of control.
Ubuntu 11.04-x64 + LibreOffice 3 and MS free except the boss's Notebook which runs XP + OOo 3.3.
User avatar
Robert Tucker
Volunteer
Posts: 1250
Joined: Mon Oct 08, 2007 1:34 am
Location: Manchester UK

Re: Don't break here!

Post by Robert Tucker »

JDlugosz wrote: ... some kind of non-breaking joiner character ...
Zero width no-break space Unicode U+FEFF ?

www.fileformat.info/info/unicode/char/feff/index.htm
LibreOffice 7.x.x on Arch and Fedora.
TerryE
Volunteer
Posts: 1401
Joined: Sat Oct 06, 2007 10:13 pm
Location: UK

Re: Don't break here!

Post by TerryE »

Or perhaps U+2060 — apart from the fact that neither seem to work for Writer or Word. Back to the drawing board :-(
Ubuntu 11.04-x64 + LibreOffice 3 and MS free except the boss's Notebook which runs XP + OOo 3.3.
User avatar
Robert Tucker
Volunteer
Posts: 1250
Joined: Mon Oct 08, 2007 1:34 am
Location: Manchester UK

Re: Don't break here!

Post by Robert Tucker »

Both U+FEFF and U+2060 seem to work with Writer on Linux.

video
LibreOffice 7.x.x on Arch and Fedora.
JDlugosz
Posts: 19
Joined: Mon Apr 07, 2008 11:58 pm

Re: Don't break here!

Post by JDlugosz »

Ah, 2060 seems to have worked. It shows a thin highlight like a field, so I think it must be "understanding" the intent rather than just being some character with no special knowledge.
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: [Solved] Don't break here!

Post by acknak »

Insert > Formatting Mark > Non-breaking space (Ctrl+Space)

This still seems like a poor workaround. Wouldn't it be better to have a character (span) attribute that says "don't break this"? Or maybe a span that allowed you to control where it could be broken. E.g. a path could be allowed to break, but only at "/"s, or only where it contained an optional break (U+200C ZERO WIDTH NON-JOINER).
AOO4/LO5 • Linux • Fedora 23
TerryE
Volunteer
Posts: 1401
Joined: Sat Oct 06, 2007 10:13 pm
Location: UK

Re: [Solved] Don't break here!

Post by TerryE »

The problem with non-breaking space is just that — it adds a space. U+2060 is a zero-width non-breaking space. The only problem I found is that I get get it to enter in WinXP, though both Robert and JD got it to work on Linux. As you say acknak, What you would really want is a text style property which disables auto-wrap line break insertion.
Ubuntu 11.04-x64 + LibreOffice 3 and MS free except the boss's Notebook which runs XP + OOo 3.3.
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: [Solved] Don't break here!

Post by acknak »

The problem with non-breaking space is just that — it adds a space.
Oh, duh. No idea what I was thinking there; I just saw "non-breaking" and ran with it.

Thanks for correcting that.
AOO4/LO5 • Linux • Fedora 23
Post Reply