Page 1 of 1

widow/orphan list items

Posted: Tue Jul 13, 2021 4:28 pm
by Jeff_Reynolds
Does anyone have a suggestion to prevent page breaks from causing single list items to split off from their peers?

Re: widow/orphan list items

Posted: Wed Jul 14, 2021 10:31 am
by Dan
The widows and orphans properties apply only to lines of text, while a list item may have a large text that wraps on multiple lines. These properties control the number of lines of text (not list items) that move to a new page.

Other ways of glueing together list items is to avoid page breaks between them:

Code: Select all

*[class ~= "topic/li"] {
    page-break-before:avoid;
}
You could do it just for the last list item:

Code: Select all

*[class ~= "topic/li"]:last-of-type {
    page-break-before:avoid;
}
Or just for a specific list item, that is marked with an outputclass attribute that contains one of the page-break-before, page-break-after, or page-break-avoid values. See:
https://www.oxygenxml.com/doc/versions/ ... aking.html

Many regards,
Dan

Re: widow/orphan list items

Posted: Wed Jul 14, 2021 10:32 am
by Dan
Note that if the list items are very big and they are glued together, their content can bleed out of the page!

Re: widow/orphan list items

Posted: Wed Jul 14, 2021 7:19 pm
by Jeff_Reynolds
Many thanks!