"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 be 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

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.

This is very interesting, particularly because I created my initial sample from a blank OF document. I will experiment with this a bit and see what I find. Thank you for the tip!

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.

Forgive me; I’m afraid I don’t follow. I wasn’t able to find any “column break” settings in the style options, and turning on 2-column mode didn’t reveal any obvious problems to me. Are you suggesting that this is a characteristic of the font itself, or perhaps a character style rather than a paragraph style? Thanks again for all your help.

Column break is a text flow directive. You’ll find it in the Text Flow tab of either a paragraph style or direct formatting Format>Paragraph. You can also type it directly as Ctl+Shift+Enter (see Insert>More Breaks>Insert Column Break).

Fonts or character styles never play any role in text flow (of course, I don’t speak of their size).

Column break hint is shown if you have enabled View>Formatting Marks.

The problem here is the column break request comes from direct formatting. When @EarnestAl pasted your text as Unformatted in a new blank document, direct formatting was wiped out and he got the expected behaviour.

1 Like

Column break is a text flow directive. You’ll find it in the Text Flow tab of either a paragraph style or direct formatting Format >Paragraph . You can also type it directly as Ctl+Shift+Enter (see Insert >More Breaks >Insert Column Break ).

Ahh, okay; now it makes sense! When I was trying to use direct formatting for everything, I kept using Ctl+Shift+Enter to insert new sections to get the spacing I wanted. Now that I’ve removed all these column breaks that I unintentionally inserted, my documents have the heading/body text orphan behavior that I’d expect.

Thanks a million for your patience and coaching me through all of this!