"Keep with Next Paragraph" for Multiple Sections

Similar to Fr3sh, I’m noticing that the “keep with next paragraph” text flow option doesn’t seem to respect “next paragraphs” that are in different sections. Here’s a very simple document demonstrating this behavior (observe: “Test Subheading” (style: Heading 2) is split from the following paragraph (style: Body Text)): demo

If I want to keep a “Heading” section with a subsequent “Body Text” section (in the example, “Text Subheading” should appear on page 2), what should I be doing? Thank you!

What you get is what to be expected.

You configured Body Text for Keep with next paragraph. You did the same on Heading 2. Consequently, your whole text is requested to be kept as a single group as much as possible.

Since the total text is way larger than what can be laid out in a page, Writer is now free to split anywhere since there is no longer any “preferred” split point.

Fix: remove Keep with next paragraph from Body Text. This attribute must not be systematically set. It must be reserved for specific contexts, such as headings.

Advice: don’t space your paragraphs with empty ones. This is a particularly pernicious form of direct formatting. It is much better to tune above and below spacing in the paragraph style.

PS: when asking here, always mention OS name, LO version and save format (.odt here according to the sample file).

Ah yes, that makes sense. Thanks for the explanation!

I’ve disabled Keep with next paragraph for Body Text and removed all my empty paragraphs, but I still see the issue when I have Heading 2 near a page break: demo Is there anything else I can do to fix this?

Also, forgive me for not including my usage details. Here’s what I’m working with:

  • OS Name: Arch Linux
  • LO Version: 24.8.6.2 (libreoffice-still)
  • Save Format: .odt

EDIT: I figured it out: I just needed to allow Body Text splits at the beginning of each paragraph. I think I’ll probably introduce a Titled Body Text rule for paragraphs like this. Thanks a lot for your help!

There is something peculiar with your sample that I cannot identify and cannot find how to remove.

If I copy your text and paste into a new document as either RTF or Unformatted text and apply any styles as needed then the heading stays with the paragraph below, splitting according to the Keep with and the orphan/widow settings.
8y8jPasteUnformatted.odt (45.6 KB)

Direct formatting strikes again!

Many paragraphs have a request for column (!) break Before. Since it is “only” a column break, the “formatting mark” does not show because your page style is 1-column. Switch to 2-column and the problem becomes obvious.

Text flow direct formatting can’t usually by eliminated by Format>Clear direct formatting (Ctl+M) because it mainly operates on typographical attributes.


I was quite surprised that such a simple sample file weighs 1.1MB. It appears it contains an unused inline SVG drawing not referenced in the text.

1 Like

And 4 embedded fonts