widows and orphans

Having trouble installing Oxygen PDF Chemistry? Got a bug to report? Post it all here.
shudson310
Posts: 156
Joined: Sat Feb 26, 2005 12:09 am
Location: USA
Contact:

widows and orphans

Post by shudson310 »

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
Staff Content Engineer
Site: docs.servicenow.com
Radu
Posts: 9054
Joined: Fri Jul 09, 2004 5:18 pm

Re: widows and orphans

Post by Radu »

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: 54
Joined: Mon Jun 27, 2011 10:51 pm

Re: widows and orphans

Post by bloodnok »

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: 156
Joined: Sat Feb 26, 2005 12:09 am
Location: USA
Contact:

Re: widows and orphans

Post by shudson310 »

Thanks! That was very helpful. Works well for our tasks, too.
Scott Hudson
Staff Content Engineer
Site: docs.servicenow.com
Post Reply