Description: I am using justified paragraphs in a long document. It often hyphenates the last word in a paragraph. This is typographically incorrect and there is no option to prevent this in the options. Please add this feature to hyphenation options. Steps to Reproduce: Nothing to enter here Actual Results: Nothing to enter here Expected Results: Nothing to enter here Reproducible: Always User Profile Reset: No Additional Info: Nothing to enter here
Could you provide a sample file where this happens? Also, what version of LibreOffice are you using? What operating system?
Which settings do you use in section 'Hyphenation' on tab 'Text Flow' of the paragraph style?
Created attachment 180331 [details] Example file with last word hyphenated
(In reply to Rafael Lima from comment #1) > Could you provide a sample file where this happens? > > Also, what version of LibreOffice are you using? What operating system? Version 7.3.3.2 (x64) O/S Windows 10 Pro 21H2, OS Build 19044.1706 I attached a file for you. It is very easy to reproduce. Just type a paragraph with justified text and slightly manipulate the page size and you will see that you can get the last word to hyphenate.
Created attachment 180334 [details] Text Flow Settings
(In reply to Regina Henschel from comment #2) > Which settings do you use in section 'Hyphenation' on tab 'Text Flow' of the > paragraph style? I attached this as a screenshot for you.
I do not support the idea to have a special rule to prevent hyphenation between second last line and last line. But let's discuss it with UX-team. The lines are so wide here and really long words are so seldom in English, that an automatic hyphenation makes no sense in context of justified alignment. And if you really need automatic hyphenation - for example for small newspaper columns - then it would be more helpful, when the author would decide whether he wants to hyphenate the word or not in this special case of second last line. Excluding hyphenation for single words is requested in bug 106733. You should disable automatic hyphenation in your text and only manually insert a soft hyphen were it is really needed. The hyphenation "at-mosphere" is not nice at all, not only in the second last line.
It's easy to disable hyphenation of the last word, if you really need it, using one of the following workarounds: – Replace the space before the word with a line break (Shift-Enter); – Insert Word Joiners (U+2060) by Insert→Formatting Mark→Word Joiner; – Set language of the word to [None] in Format→Character… See the attached test document. To disable hyphenation of all last words, search them by using the [^ ]*$ regex clicking on the "Find All" button, close Find and Replace, and set language of the selected words to [None] (see the attached screenshot).
Created attachment 180345 [details] Workarounds to disable hyphenation of the last word of the paragraphs
Created attachment 180346 [details] Select all last words by a regex to format their languages to [None] to disable their hyphenation
Created attachment 180361 [details] MSO hyphenation options To avoids the "at-" ugliness we have the option "Characters at line end" (known in CSS as hyphenate-limit-chars [1]; set it to 3 to keep "atmosphere" together), "...line begin", and "consecutive lines" (probably hyphenate-limit-lines [2]). These options are badly indented looking as if belonging to CAPS. The actual numbers depend on the language- two characters might be too low for English but good for other. CSS does also define hyphenate-limit-last [3] "This property indicates hyphenation behavior at the end of elements, column, pages, and spreads." (and more). We should add such an option, also with the idea that a hyphenation should not happen at the page/column break. Attaching also what options MSO offers. The example breaks here at "atmos-phere". [1] https://www.w3.org/TR/css-text-4/#hyphenate-char-limits [2] https://www.w3.org/TR/css-text-4/#hyphenate-line-limits [3] https://www.w3.org/TR/css-text-4/#hyphenate-size-limits
Ok, ignoring the bad 2 character hyphenation in the example I gave, there should be no hyphenation of the last word in a paragraph. It is a typographic standard and I think you should support it, regardless of the alignment. Please see attachment - Adobe InDesign (pretty much the standard for publishing) offers that option.
Created attachment 180366 [details] Example from Adobe Indesign Please see this image from Indesign. Last word paragraph hyphenation should be an option.
Proposed fix: https://gerrit.libreoffice.org/c/core/+/134985 See the attached screenshot about the new option
Created attachment 180398 [details] screenshot: new option "Don't hyphenate the last word" in Text Flow page of paragraph settings
(In reply to László Németh from comment #14) > Proposed fix: https://gerrit.libreoffice.org/c/core/+/134985 > > See the attached screenshot about the new option A) How is this handled at DOCX/DOC export code? Or is this an incompatible feature (off-topic: is there a incompatibility list for DOCX/DOC. I thought Justin L keeping track of that somewhere on a wikipage) B) Does the setting also appear in the Style Inspector (yes, I can also check it myself after the patch is merged). I assume the code being genetic enough, but checking never hurts)
László Németh committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/8c018910ae4d8701b1ce2a95727b9baed4016da3 tdf#149248 sw offapi xmloff: add option to not hyphenate last word It will be available in 7.4.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Commit description: tdf#149248 sw offapi xmloff: add option to not hyphenate last word Add option to disable automatic hyphenation of the last word of paragraphs for better typography. Note: the same option used e.g. in Adobe InDesign, and a similar one in CSS Text Module Level 4 (hyphenate-limit-last). * Add checkbox to Text Flow in paragraph dialog * Store property in paragraph model (com::sun::star::style::ParagraphProperties::ParaHyphenationNoLastWord) * Add ODF import/export * Add ODF unit test * Add layout test Follow-up to commit 72bd0df107ee47c4d54fa88b4960d32ea03e9f69 "tdf#121658 Add option to not hyphenate words in CAPS".
(In reply to Telesto from comment #16) > (In reply to László Németh from comment #14) > > Proposed fix: https://gerrit.libreoffice.org/c/core/+/134985 > > > > See the attached screenshot about the new option > > A) How is this handled at DOCX/DOC export code? Or is this an incompatible > feature (off-topic: is there a incompatibility list for DOCX/DOC. I thought > Justin L keeping track of that somewhere on a wikipage) If Word will implement the similar CSS settings, it will be possible to support those immediately. Also it's possible to add this to the HTML/CSS export (first, start with the missing hyphenation). > B) Does the setting also appear in the Style Inspector (yes, I can also > check it myself after the patch is merged). I assume the code being genetic > enough, but checking never hurts) Yes, it's generic. Moreover, it needed to fix the style inspector tests, which contain direct property count, so it works well See also tdf#149324 for the similar typographic option, the paragraph-level limit for the min. word length for hyphenation.
@rferraro@sccoast.net, Heiko, Regina: thanks for the report! (In reply to Regina Henschel from comment #7) > I do not support the idea to have a special rule to prevent hyphenation > between second last line and last line. But let's discuss it with UX-team. Likely the requirement related to the easier work-flow: accessing to the paragraph-level settings i.e. trying different hyphenation options is much more comfortable for adjusting errors of the automatic hyphenation: you can try a lot of combinations with a few click or short cuts, than selecting words and text parts, which less productive, especially if the problematic word occurs more in the document. Interestingly, CSS 4 has got line-level rule, but Adobe InDesign has a word-level, limiting the prevention only for the last word. I think, it's really important to give similarly rich options for hyphenation, than DTP software and future web browsers. My next plan to implement hyphenation zone, which is a Word/OOXML feature. I have long term plan to give some settings for better hyphenation for compound words, e.g. for German/Hungarian. Maybe Better Spacing / Fewer Hyphens slider of InDesign is a good user interface for that. But ODF don't hyphenate character property is a nice feature, especially if we could add a shortcut for that. In fact, if this is not for adjustment of the paragraph text flow, but a bad or unwanted automatic hyphenation, Writer has already supported to disable the hyphenation of a specific word, by adding an equal mark to the plain word ("word=") in the custom hyphenation dictionary: https://help.libreoffice.org/latest/lo/text/swriter/guide/hyphen_prevent.html?&DbPAR=SHARED&System=UNIX
(In reply to László Németh from comment #20) > My next plan to implement hyphenation zone, which is a Word/OOXML feature. :thumbs-up: The on/off solution for the last word seems a bit unflexible to me, I'd have appreciated something like n words/lines. But thanks for the patch, fixes the issue efficiently! Hope you enabled the option by default.
Also, if you want to be strictly typographically correct you should also disallow hyphenation across columns (Indesign has that feature) and even more important would be to disallow hyphenation across pages. It makes for nicer typography.
(In reply to Heiko Tietze from comment #21) > (In reply to László Németh from comment #20) > > My next plan to implement hyphenation zone, which is a Word/OOXML feature. > > :thumbs-up: > > The on/off solution for the last word seems a bit unflexible to me, I'd have > appreciated something like n words/lines. But thanks for the patch, fixes > the issue efficiently! Hope you enabled the option by default. @Heiko: Thanks for your feedback! For interoperability, it's better to avoid of to use this, as a default option, because OOXML doesn't contain such a thing.
(In reply to rferraro from comment #22) > Also, if you want to be strictly typographically correct you should also > disallow hyphenation across columns (Indesign has that feature) and even > more important would be to disallow hyphenation across pages. It makes for > nicer typography. @Rferraro: you are right! Moreover, it seems, it needs for for interoperability, too, because from Word 2013, this is the default behavior there: https://docs.microsoft.com/en-us/openspecs/office_standards/ms-docx/e0c0663e-a5e7-4a44-8360-b0b5df1f43e6 See tdf#132599 for that bug.
*** Bug 58178 has been marked as a duplicate of this bug. ***