Bug 132599 - Option to stop words hyphenating across pages
Summary: Option to stop words hyphenating across pages
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: László Németh
URL:
Whiteboard: target:24.8.0 inReleaseNotes:24.8
Keywords:
Depends on:
Blocks: Hyphenation 160518
  Show dependency treegraph
 
Reported: 2020-05-01 19:14 UTC by R. Green
Modified: 2024-06-03 17:08 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
LibreOffice doc. showing inter-pahe hyphens (24.24 KB, application/vnd.oasis.opendocument.text)
2020-05-01 19:14 UTC, R. Green
Details
unit test document (fo:hyphenate-keep="page") (5.46 KB, application/vnd.oasis.opendocument.text-flat-xml)
2024-02-29 14:31 UTC, László Németh
Details
unit test document (fo:hyphenate-keep="auto") (5.46 KB, application/vnd.oasis.opendocument.text-flat-xml)
2024-02-29 14:32 UTC, László Németh
Details
screenshot of new option “Hyphenate across column and page” (186.61 KB, image/png)
2024-03-05 09:20 UTC, László Németh
Details
screenshot of new options “Hyphenate across” (84.74 KB, image/png)
2024-04-11 08:30 UTC, László Németh
Details
test document (spread, right page) (25.75 KB, application/vnd.oasis.opendocument.text-flat-xml)
2024-04-11 08:32 UTC, László Németh
Details
test document (spread, left page) (27.11 KB, application/vnd.oasis.opendocument.text-flat-xml)
2024-04-11 08:33 UTC, László Németh
Details
test document (column) (20.61 KB, application/vnd.oasis.opendocument.text-flat-xml)
2024-04-11 08:33 UTC, László Németh
Details
test document (page, in not last column) (20.61 KB, application/vnd.oasis.opendocument.text-flat-xml)
2024-04-11 08:34 UTC, László Németh
Details
test document (page, in last column) (21.33 KB, application/vnd.oasis.opendocument.text-flat-xml)
2024-04-11 08:34 UTC, László Németh
Details
flat ODF test document for "Last full line of paragraph". (25.92 KB, application/vnd.oasis.opendocument.text-flat-xml)
2024-05-20 11:12 UTC, László Németh
Details
screenshots of "Hyphenate across last full line of paragraph" (210.94 KB, image/png)
2024-05-20 11:15 UTC, László Németh
Details
screenshots of text documents "Hyphenate across" -> "auto" and "page" (81.41 KB, image/png)
2024-05-20 11:19 UTC, László Németh
Details
test document: In tables, do not hyphenate across spread (3-page document) (23.18 KB, application/vnd.oasis.opendocument.text-flat-xml)
2024-05-20 11:31 UTC, László Németh
Details
test document: Hyphenation across column in linked frames (24.35 KB, application/vnd.oasis.opendocument.text-flat-xml)
2024-05-20 11:44 UTC, László Németh
Details
screenshot: In tables, do not hyphenate across spread (left: before the fix, right: after the fix) (316.79 KB, image/png)
2024-05-20 11:57 UTC, László Németh
Details
screenshot: Hyphenation across column in linked frames (left: before the fix, right: after the fix) (221.17 KB, image/png)
2024-05-20 11:58 UTC, László Németh
Details
test document: In linked frames on right pages, do not hyphenate across spread (25.05 KB, application/vnd.oasis.opendocument.text-flat-xml)
2024-05-20 12:01 UTC, László Németh
Details
screenshot: In linked frames on right pages (left: before the fix, right: after the fix) (218.33 KB, image/png)
2024-05-20 12:03 UTC, László Németh
Details
test document: multiple linked frames, do not hyphenate across spread (25.81 KB, application/vnd.oasis.opendocument.text-flat-xml)
2024-05-20 12:06 UTC, László Németh
Details
screenshot: multiple linked frames, do not hyphenate across spread (59.41 KB, image/png)
2024-05-20 12:08 UTC, László Németh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description R. Green 2020-05-01 19:14:22 UTC
Created attachment 160198 [details]
LibreOffice doc. showing inter-pahe hyphens

If Hyphenation is set to "Automatically" (in Paragraph Style > Text Flow), there is a problem with words hyphenating from one page to another.

According to New Harts Rules (OUP, 2005, "Line Endings", p. 40), a recto (right-hand) page should not end with a hyphen (probably the same rule in the Chicago Manual of Style). This rule obviously applies to hard copy in  book format; but for PC documents it also makes sense to apply the restriction on hyphenation to "verso" (left-hand) pages.

For example, open the attached document. Look at the hyphenation from pp. 1-2, and 5-6. This is awkward to read. In a long document, you have to turn off hyphenation for each hyphenated "inter-page" word : this is time-consuming, and a document update may require you to do the whole thing over again.

SUGGESTION: Add two tick-box options to the Paragraph Style > Text Flow TAB:

1. Don't hyphenate words from recto to verso pages.
2. Don't hyphenate words across any pages.

Instead of hypenation, the last word will be moved, automatically, to the next page.
Comment 1 Ming Hua 2020-05-02 15:52:04 UTC
Reproduced the inter-page hyphenation with attached example in 6.4.4 RC1 on Windows.

The enchancement request sounds very reasonable, setting to NEW.
Comment 2 László Németh 2022-06-06 15:02:42 UTC
It seems, this is also an interoperability problem, too:


https://docs.microsoft.com/en-us/openspecs/office_standards/ms-docx/e0c0663e-a5e7-4a44-8360-b0b5df1f43e6
Comment 3 László Németh 2023-05-23 09:25:06 UTC
Also it's part of the OpenDocument standard, as fo:hyphenation-keep, but not implemented by LibreOffice yet: 

https://ask.libreoffice.org/t/in-writer-is-there-a-setting-to-allow-hyphenation-but-restrict-hyphens-across-pages/49622
Comment 4 László Németh 2024-02-29 14:31:37 UTC
Created attachment 192862 [details]
unit test document (fo:hyphenate-keep="page")

Typeset bottom hyphenated line on the next page, resulting 3-page document.
Comment 5 László Németh 2024-02-29 14:32:18 UTC
Created attachment 192863 [details]
unit test document (fo:hyphenate-keep="auto")

Typeset bottom hyphenated line on the first page, resulting 2-page document.
Comment 6 Commit Notification 2024-03-04 22:40:04 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9574a62add8e4901405e12117e75c86c2d2c2f21

tdf#132599 cui offapi sw xmloff: implement hyphenate-keep

It will be available in 24.8.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.
Comment 7 László Németh 2024-03-05 08:33:57 UTC
Commit description:

tdf#132599 cui offapi sw xmloff: implement hyphenate-keep

Both parts of a hyphenated word shall lie within a single
page with ODF paragraph setting fo:hyphenation-keep="page".
The implementation follows the default page layout of
MSO 2016 and newer by shifting the bottom hyphenated line
to the next page (and to the next column, see last note).

Note: this is a MSO DOCX interoperability feature, used
also in DTP software, XSL and CSS.

* Add checkbox/combobox to Text Flow in paragraph dialog
* Store property in paragraph model (com::sun::star::style::ParagraphProperties::ParaHyphenationKeep)
* Add ODF import/export
* Add ODF unit tests

New constants of com::sun::star::text::ParagraphHyphenationKeepType,
containing ODF AUTO and PAGE (borrowed from XSL), and for the
planned extension ParaHyphenationKeepType of ParagraphProperties:

– COLUMN (standard XSL value, defined in
  https://www.w3.org/TR/2001/REC-xsl-20011015/slice7.html#hyphenation-keep)

– SPREAD and ALWAYS (CSS 4 values of hyphenate-limit-last,
  equivalent of hyphenation-keep, defined in
  https://www.w3.org/TR/css-text-4/#hyphenate-line-limits).

Note: the implementation truncates only a single hyphenated
line, like MSO does: the pages can end in hyphenated
lines (i.e. in the case of consecutive hyphenated lines),
but less often, than before.

Clean-up hyphenation dialog by collecting "Don't hyphenate"
options at the end of the hyphenation settings, and negating them
(similar to MSO and DTP), adding also the new option
"Hyphenate across column and page":

[x] Hyphenate words in CAPS
[x] Hyphenate last word
[x] Hyphenate across column and page

Note: ODF fo:hyphenation-keep has got only "auto" and
"page" attributes, while XSL defines also "column".
Because of the interoperability with MSO and DTP,
fo:hyphenation-keep="page" is interpreted as
XSL "column", avoiding hyphenation at the end
of column, not only at the end of page.
Comment 8 László Németh 2024-03-05 09:20:17 UTC
Created attachment 192959 [details]
screenshot of new option “Hyphenate across column and page”
Comment 9 Commit Notification 2024-04-11 08:21:18 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6e8819f29b6051a0e551d77512830539913ec277

tdf#132599 cui offapi sw xmloff: add hyphenation-keep-type

It will be available in 24.8.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.
Comment 10 László Németh 2024-04-11 08:24:20 UTC
Commit description:

tdf#132599 cui offapi sw xmloff: add hyphenation-keep-type

Support XSL attribute "column" and CSS 4 attribute "spread",
stored in loext:hyphenation-keep-type, to give better control
over hyphenation-keep. E.g. spread: both parts of a hyphenated
word shall lie within a single spread, i.e. when the next page
is not visible at the same time (e.g. the next page is not a
right page of a book).

– css::style::ParaHyphenationKeep is a boolean property now,
  importing hyphenation-keep = "page" as true.

– type of ParaHyphenationKeep, including the new non-ODF types
  is stored in the new ParagraphProperties::ParaHyphenationKeepType.

– default value of ParaHyphenationKeepType is COLUMN for
  interoperability.

– Add checkboxes to Text Flow -> Hyphenation Across in
  paragraph dialog:

  * Column (previously: Hyphenate across column and page)
  * Page
  * Spread

  – enabling/disabling them follows XSL/CSS 4/loext, i.e.
    possible combinations:

  * No Hyphenation across
    (hyphenation-keep = "page" and loext:hyphenation-keep-type = "column")

  * Hyphenation across [x] Column
    (hyphenation-keep = "page" and loext:hyphenation-keep-type = "page")

  * Hyphenation across [x] Column [x] Page
    (hyphenation-keep = "page" and loext:hyphenation-keep-type = "spread")

  * Hyphenation across [x] Column [x] Page [x] Spread
    (hyphenation-keep = "auto")

– Add ODF import/export

– Update DOCX import

– Add ODF unit tests

Note: recent implementation depends on widow settings: disabling widow
handling allows hyphenation across columns and pages not only in table
cells.

Note: RTF import-only, but not used bPageEnd has been renamed to bKeep.
Depending on the RTF test results, likely it will need to disable
the layout change, e.g. GetKeepType()=ParagraphHyphenationKeepType::AUTO,
if PageEnd uses obsolete hyphenation rule, i.e. shifting only the
hyphenated word to the next page, not the full line.

More information:

– COLUMN (standard XSL value, defined in
  https://www.w3.org/TR/2001/REC-xsl-20011015/slice7.html#hyphenation-keep)

– SPREAD and ALWAYS (CSS 4 values of hyphenate-limit-last,
  equivalent of hyphenation-keep, defined in
  https://www.w3.org/TR/css-text-4/#hyphenate-line-limits).

Follow-up to commit 9574a62add8e4901405e12117e75c86c2d2c2f21
"tdf#132599 cui offapi sw xmloff: implement hyphenate-keep" and
commit c8ee0e8f581b8a6e41b1a6b8aa4d40b442c1d463
"tdf160518 DOCX: import hyphenation-keep to fix layout".
Comment 11 László Németh 2024-04-11 08:30:51 UTC
Created attachment 193611 [details]
screenshot of new options “Hyphenate across”
Comment 12 László Németh 2024-04-11 08:32:58 UTC
Created attachment 193612 [details]
test document (spread, right page)
Comment 13 László Németh 2024-04-11 08:33:20 UTC
Created attachment 193613 [details]
test document (spread, left page)
Comment 14 László Németh 2024-04-11 08:33:36 UTC
Created attachment 193614 [details]
test document (column)
Comment 15 László Németh 2024-04-11 08:34:14 UTC
Created attachment 193615 [details]
test document (page, in not last column)
Comment 16 László Németh 2024-04-11 08:34:33 UTC
Created attachment 193616 [details]
test document (page, in last column)
Comment 17 Commit Notification 2024-04-11 15:43:22 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/58350a811a8001f72b13f6ca3def5f32ea904e72

tdf#132599 add "Hyphenation across" options
Comment 18 Commit Notification 2024-05-07 11:58:53 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/c8a99cb8dce54de506ba66d1cc0818b9b5f7858b

tdf#132599 sw schema xmloff: add hyphenation-keep-type='always'

It will be available in 24.8.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.
Comment 19 Commit Notification 2024-05-10 07:59:10 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d4304cd0a4fedd0117fea3625dff1fca2945a0e6

tdf132599 sw: fix hyphenation-keep for linked frames, also for spreads

It will be available in 24.8.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.
Comment 20 Commit Notification 2024-05-10 13:25:59 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a4970f4eeb94b8c405c5e3ec094d47061253efac

tdf#132599 sw: fix hyphenation-keep for tables and no widow

It will be available in 24.8.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.
Comment 21 Commit Notification 2024-05-11 11:59:29 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9668c9b8fe1d4afba335ab1f9d3309ad91bd56da

tdf#132599 sw: fix test of "fix hyphenation-keep for tables and no widow"

It will be available in 24.8.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.
Comment 22 Commit Notification 2024-05-11 14:29:47 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/016d61f529f9d9ec2520fb7a808da41cf17d7295

tdf#132599 sw: fix unit tests for hyphenation-keep with frames

It will be available in 24.8.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.
Comment 23 Commit Notification 2024-05-17 22:12:43 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/0d5b1a072e025a692cee803310d2ceff0296b083

tdf#132599 add "Hyphenation across" -> Last full line of paragraph
Comment 24 László Németh 2024-05-20 11:12:00 UTC
Created attachment 194215 [details]
flat ODF test document for "Last full line of paragraph".
Comment 25 László Németh 2024-05-20 11:15:03 UTC
Created attachment 194216 [details]
screenshots of "Hyphenate across last full line of paragraph"

LEFT: missing recognition of hyphenate-keep-type="always" in the last paragraph. RIGHT: correct layout after the implementation: hyphenated word of the last full paragraph was shifted to the last paragraph line.
Comment 26 László Németh 2024-05-20 11:19:41 UTC
Created attachment 194217 [details]
screenshots of text documents "Hyphenate across" -> "auto" and "page"
Comment 27 László Németh 2024-05-20 11:31:38 UTC
Created attachment 194218 [details]
test document: In tables, do not hyphenate across spread (3-page document)
Comment 28 László Németh 2024-05-20 11:44:37 UTC
Created attachment 194219 [details]
test document: Hyphenation across column in linked frames
Comment 29 László Németh 2024-05-20 11:48:29 UTC
Comment on attachment 194218 [details]
test document: In tables, do not hyphenate across spread (3-page document)

Bottom hyphenated line of the first page is shifted to the next page, resulting a 3-page document.
Comment 30 László Németh 2024-05-20 11:57:03 UTC
Created attachment 194221 [details]
screenshot: In tables, do not hyphenate across spread (left: before the fix, right: after the fix)
Comment 31 László Németh 2024-05-20 11:58:32 UTC
Created attachment 194222 [details]
screenshot: Hyphenation across column in linked frames (left: before the fix, right: after the fix)
Comment 32 László Németh 2024-05-20 12:01:33 UTC
Created attachment 194223 [details]
test document: In linked frames on right pages, do not hyphenate across spread
Comment 33 László Németh 2024-05-20 12:03:35 UTC
Created attachment 194224 [details]
screenshot: In linked frames on right pages (left: before the fix, right: after the fix)
Comment 34 László Németh 2024-05-20 12:06:31 UTC
Created attachment 194225 [details]
test document: multiple linked frames, do not hyphenate across spread

hyphenated line on page 2 is allowed, because it is on the left page of its spread.
Comment 35 László Németh 2024-05-20 12:08:19 UTC
Created attachment 194226 [details]
screenshot: multiple linked frames, do not hyphenate across spread