In Writer, is there a setting to allow hyphenation, but restrict hyphens across pages?

LibreOffice Writer settings?

The ODF spec (both 1.2 and 1.3) list fo:hyphenation-keep with the allowed values “auto” and “page”.

This seems to imply hyphenation should be able to be restricted across page, but it’s not clear exactly what this property controls.

However, the XSL spec is clear:

7.15. Block and Line-related Properties
7.15.1. “hyphenation-keep”

Controls whether hyphenation can be performed on the last line that fits in a given reference-area.

XSL Definition:
Value: auto | column | page | inherit
Initial: auto
Applies to: fo:block
Inherited: yes
Percentages: N/A
Media: visual

Values have the following meanings:

auto
No restriction applies. The word may be hyphenated at the end of any region.

column
Both parts of a hyphenated word shall lie within a single column.

page
Both parts of a hyphenated word shall lie within a single page.

Pages do not exist as primary objects in Writer. They are only a consequence of text flow: they are allocated on demand on text need. Consequently, there is no setting related to line wrap in page styles.

Hyphenation has a heavy impact on justification and text flow. This can be tuned in paragraph styles, Text Flow tab.

This means hyphenation can be enabled per paragraph style: in some styles, like the Heading n family, hyphenation does not make sense and would rather severely affect the look of headings; on the contrary, it could lead to a relative improvement in Text Body.

The available settings are the number of characters before and after the hyphen (to avoid leaving single-letter or very short syllables at end/start of line).

Another setting if the maximum number of consecutive hyphenations. This might be what you are looking for (despite the fact that “restrict hyphens across pages” is rather vague – edit your question, don(t use an answer, to better specify what you mean by that).

Since I write mostly single-column documents, I don’t use hyphenation because justification has enough room to play with the spaces, I don’t know if this parameter is valid only within the paragraph or across consecutive paragraphs with the same attribute setting. Experiment.

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

In case you need clarification, edit your question (not an answer) or comment the relevant answer.

End of lines (EOL) are also allocated as needed, just like the end of pages, and are not objects. So, I’m not exactly sure what you mean stating this? Pages do exist in LO, and there is a setting in the ODF spec which allows for turning off page-spanning hyphenated words.

I mean that EOP and EOL are not user-accessible events. They are internal to LO.

Page Styles only define the geometry of the sequence of pages and have no parameter for text flow or hyphenation.

Paragraph styles provide hyphanation control but this control is local to the paragraph. If page break occurs within the paragraph, it is treated as a standard EOL event. No hyphenation parameter makes reference to page properties or events.

I haven’t yet finished reading ODF but to the best of my knowledge, Writer can’t suppress hyphenation on a page-spanning paragraph or the last-line-in-the-page for such a paragraph. Can you point me the the ODF specification clause?

V1.3 - 20.196

https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part3-schema/OpenDocument-v1.3-os-part3-schema.html#__RefHeading__1419818_253892949

or in V1.2 - 20.189

http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1419818_253892949

But again, There isn’t an explanation of the property, only a link to XSL, so the meaning isn’t clear in the ODF spec. But it’s equivalent and exact spelling in the XSL spec is clear

XSL 7.15

https://www.w3.org/TR/2001/REC-xsl-20011015/slice7.html#hyphenation-keep

Yes. But I don’t know of any way to enable it. Perhaps @Regina can tell.

This file has it enabled.

https://drive.google.com/file/d/1yXibB0s7QTp2apPHu-A2C7vbwsbCpoNU/view?usp=share_link

save the file as .fodt (flat opendocument) and open that file in writer.

However, I’m unable to assess it, because the fresh appimage doesn’t hyphenate, and I’m not ready to lose my Writer 6.4.7.2 reference that’s installed on ubuntu 20.04 LTS.

I lorem’ed your blank document and tried to get hyphenation on last line of first page. After tweeakin right margin, I got one. Then I changed fo:hyphenation-keep alternatively between true and false but the last line remained the same, no matter the value of the attribute, i.e. with hyphenation. Of course I also justified the text to increase the probability of hyphenation.

It is possible that the interpretation of fo:hyphenation-keep is not implemented. ODF states that if a consumer doesn’t know how to interpret a directive, it can ignore it but keep it in the XML encoding.

PS my configuration is LO 7.4.3.2 on Fedora 37 under KDE Plasma desktop. Very delighted by the 7.4 series.

fo:hyphenation-keep would be the right attribute to prevent hyphenation across page breaks. But that attribute is not implemented in LibreOffice. It is worth to write an enhancement request for it.

1 Like

Thanks, Regina :slight_smile: what’s the proper way to submit a feature request for the keep-across column/pages?

File a bug report on Buzilla, but prefix the title with FEATURE REQUEST