LibreOffice Writer Page Break after last dashed line on the page

I am using Ubuntu 14.04 and LibreOffice 4.3 and 6.3. There is a document in which there are several dashed lines (----) The related information about a single case ends with a dashed line. Sometimes the related information about a single case separates across a page. I wish if there is data after the last dashed line on the page, there should be page break after the last dashed line on the page.

Not clear (probably a problem of fluency in English). Can you attach an example file? Is your question about how to keep the “case” as an atomic block without a page break in it? In this case, it is a matter of tuning the paragraph style. Are you familiar with styles?

Case means 5 lines and a table. You can say data or matter.

Provide an example file and explicitly state if you want both paragraph and table to remain a single block without page break inside.

27-01-2023 Criminal.odt (31.4 KB)

Your document is made up of “blocks”. A block contains:

  1. a case identification
  2. a table
  3. a paragraph with a dashed line separator
    (This paragraph is missing when you happened to be at bottom of page. Since this breaks the regularity of the sequence (and prevents the following fix to work correctly), I inserted a separator where it was missing. This is necessary because the fix may shift down some “blocks” and page breaks are no longer in the same position.)

You want the blocks to remain a single piece without any page break inside.

The first step is to style consistently your text. Your blocks contain three semantically different “objects” as described above. Each object should have a distinct paragraph style. Unfortunately, there is no table style (in a meaning similar to paragraph, character and page styles), but you can work around it with direct formatting.

I created Case (derived from Text Body) for the case title and Separator for the dashed line.

  • Case: in Text Flow tab, both Don’t split paragraph and Keep with next paragraph are ticked so that the paragraph will be a single block of text on the same page as the next paragraph (which happens to be the separator line; the table will be in between and secluded in the “block”)
  • table: in Text Flow tab, Allow table to split across pages and columns is unticked to prevent splitting
  • Separator: nothing special here; it is the final paragraph in the sequence, it must not have Keep with next paragraph ticked so that page break can occur below it.

All you have to to is style your paragraphs adequately and modify the tables manually.

Notes:

  • Your text is plagued with direct formatting. Use settings in paragraph styles to achieve your formatting goal. Also character styles are there to emphasise words within a paragraph. For instance, use built-in Strong Emphasis to embolden words.

  • Also, I question your choice of line breaks in the case title paragraphs. Obviously you try to group several line into an “atomic” block though these lines have different semantic values which could be assigned their own paragraph styles (thus providing you more freedom to format the document).

  • Why do you leave a space before a line break or paragraph break?

Fixed document (at least the first pages): 27-01-2023 Criminal-ajl.odt (50.6 KB)