widow/orphan list items

Jeff_Reynolds
Posts: 10
Joined: Tue Apr 13, 2021 9:48 pm

widow/orphan list items

Post by Jeff_Reynolds » Tue Jul 13, 2021 4:28 pm

Does anyone have a suggestion to prevent page breaks from causing single list items to split off from their peers?

Dan
Posts: 485
Joined: Mon Feb 03, 2003 10:56 am

Re: widow/orphan list items

Post by Dan » Wed Jul 14, 2021 10:31 am

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

Dan
Posts: 485
Joined: Mon Feb 03, 2003 10:56 am

Re: widow/orphan list items

Post by Dan » Wed Jul 14, 2021 10:32 am

Note that if the list items are very big and they are glued together, their content can bleed out of the page!

Jeff_Reynolds
Posts: 10
Joined: Tue Apr 13, 2021 9:48 pm

Re: widow/orphan list items

Post by Jeff_Reynolds » Wed Jul 14, 2021 7:19 pm

Many thanks!

Post Reply