widows and orphans

shudson310
Posts: 137
Joined: Sat Feb 26, 2005 12:09 am
Location: USA
Contact:

widows and orphans

Post by shudson310 » Thu Jul 19, 2018 5:38 pm

The Chemistry documentation describes a style to control page breaks based on widows and orphans. The example only shows <p>, but is this possible with other elements? For example, I don't want an orphaned line from a step.

I tried:

Code: Select all

p, tr, ul, ol, steps, step, substep, li {
orphans: 4;
widows: 2;
}
but I'm still getting orphaned step content.

How can I address this?
Scott Hudson
Content Strategist
Jeppesen
Site: jeppesen.com

Radu
Posts: 6541
Joined: Fri Jul 09, 2004 5:18 pm

Re: widows and orphans

Post by Radu » Fri Jul 20, 2018 9:58 am

Hi Scott,

From what I understand the widows and orphans strategies apply to paragraph-like elements, so only to block elements which contain inside text and inline elements.
So if you have a very large <p> somewhere at the end of the page and its content overflows the page, then these properties are taken into account.
But if you have a step, the step contains in its turn other block elements (cmd, info (maybe inside the info there are other paragraps)) and this set of widow/orphan properties to not apply when deciding if a split between cmd and info should be made or not, or a split between two paragraphs inside the info should be attempted or not.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

bloodnok
Posts: 36
Joined: Mon Jun 27, 2011 10:51 pm

Re: widows and orphans

Post by bloodnok » Wed Jul 25, 2018 9:16 pm

Although it sometimes generates unwanted whitespace, I found using "page-break-after: avoid;" mostly keeps my steps together.

Code: Select all

li.step:before{
content: "Step " counter(item) ": " !important;
counter-increment: item;
font-weight: bold;
page-break-after: avoid;
}

shudson310
Posts: 137
Joined: Sat Feb 26, 2005 12:09 am
Location: USA
Contact:

Re: widows and orphans

Post by shudson310 » Tue Jul 31, 2018 12:13 am

Thanks! That was very helpful. Works well for our tasks, too.
Scott Hudson
Content Strategist
Jeppesen
Site: jeppesen.com

Post Reply