https://bugs.documentfoundation.org/show_bug.cgi?id=167278

--- Comment #3 from ajlittoz <[email protected]> ---
(In reply to Telesto from comment #1)
> @Justin
> Are you able to give some insights on functioning of the "Keep with next
> paragraph" property?

I assume you want details on what I expect from _Keep with next paragraph_.

The goal is to avoid a page break from occurring between this paragraph and the
next one.

In the majority of cases it is used to group together on the same page some
heading with the corresponding argumentation. Headings being relatively short,
it is sufficient to detect that the page break occurs after the heading, i.e.
the heading paragraph is the last one in the page (as stated in the
documentation). Then, the whole paragraph (once again: a heading is short,
frequently a single line) is flushed on next page, preceding the next
paragraph.

When a heading needs several lines, it is easy to make sure nothing weird can
happen by unticking _Allow to split paragraph_ so that the heading is an atomic
block. We have _Keep with next_ enabled and _Allow to split_ disabled and this
corresponds perfectly to the expected layout.

Now, question author is perhaps in a corner case, but its request is IMHO
legitimate.

His book is made of narrative paragraphs organised in scenes and "sub-scenes"
(leading to transitions he calls "minor scene changes"). The scene changes can
be handled in the usual manner because they have a dedicated "boundary
paragraph" similar to a (short) heading.

However, the "minor scene" end is only shown as an increased spacing between
two otherwise "ordinary-looking" narrative paragraphs. The minor-scene-end
style has _Keep with next_ enabled so that the increased spacing does not get
visually lost should the paragraph be the last one in the page. Three cases
must be considered:

- CASE 1
The end paragraph is large enough to span the page break (there is not enough
remaining space in the current page to hold the whole paragraph, so the last
lines spill over on the next page). Where to break the paragraph can be
"modulated" by the widow/orphan parameters, but this does not change the fact
that the paragraph is both the last one in the current page and the first one
on next page. Since there is already some text on the next page, the condition
_Keep with next_ is automatically satisfied.

But, if the implementation only looks at the state when the page break is
created, without taking into account the unprocessed, not-yet-flown remaining
text in the paragraph, it will asset 'this paragraph is the last one in the
page' and, according to documentation, will shift the whole paragraph without
taking into account _Allow to split_.

IMHO, there are two flaws:

a - unprocessed text makes (part of) the paragraph the first one on next page,
not simply the last one on current page; this should cancel transferring the
paragraph on next page
Note that the amount of text on next page can be controlled by widow/orphan
parameters and these should be taken into account BEFORE _Keep with next_.

b - _Keep with next_ and _Allow to split_ are independent from each other
To get the present monolithic behaviour, author can untick _Allow to split_.
When both boxes are ticked, a more subtle layout is possible, in particular in
cases where inter-paragraph spacing is important in the layout and should not
be "swallowed" by page breaks.

- CASE 2
The end paragraph is large but can be laid out in the remaining space while the
widow/orphan parameters of the next paragraph force it to next page.

If _Allow to split_ is enabled in the end paragraph, its orphan and widow
parameters should be examined to determine a potential break to send some
contents to next page. If this is impossible (not enough text), revert to
present full-paragraph flush.

- CASE 3
The end paragraph is "short" (smaller than the sum of orphan + widow lines);
the paragraph is flushed to next page, as is done presently.


I have not experimented to have an aesthetic opinion about the result. The main
goal is to avoid ambiguity about the location of the "minor scene transition".
It is likely that this leads to erratic white space at bottom of pages and this
may be rejected as undesirable by users. However, no "end of minor scene"
paragraphs should end at bottom of page. It is author's responsibility to avoid
widow lines by adjusting his parameters.

Do you consider this as acceptable insights? Should I elaborate more? (But what
about, because I am not the requester for the layout ?)

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to