widow/orphan list items

Post here questions and problems related to editing and publishing DITA content.
Jeff_Reynolds
Posts: 37
Joined: Tue Apr 13, 2021 9:48 pm

widow/orphan list items

Post by Jeff_Reynolds »

Does anyone have a suggestion to prevent page breaks from causing single list items to split off from their peers?
Dan
Posts: 501
Joined: Mon Feb 03, 2003 10:56 am

Re: widow/orphan list items

Post 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
Dan
Posts: 501
Joined: Mon Feb 03, 2003 10:56 am

Re: widow/orphan list items

Post by Dan »

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: 37
Joined: Tue Apr 13, 2021 9:48 pm

Re: widow/orphan list items

Post by Jeff_Reynolds »

Many thanks!
Post Reply