View Full Version : Widows and Orphans


danrodney
12-06-2010, 07:43 PM
In Liz Castro's book she says Adobe Digital Editions and the nook support CSS widows and orphans. I've been testing it out and can't seem to get them to work. Am I doing something wrong or do they not support it?

Here's my CSS:
html, body, p {
widows: 2 !important;
orphans: 2 !important;
}

I added the !important in just to see if that helped but it didn't.

Just to be clear, I want to prevent the last two words in a paragraph from breaking. I don't want one word to be all by itself on a line.

In case you want to see an example .epub I've attached one below. Please note it's a test file so there may be other things I haven't cleaned up from InDesign's ePub export. But I don't think they should affect things. Just didn't want you to think this is finished quality :)

Thanks in advanced for any help.
Dan

wallcraft
12-06-2010, 08:21 PM
Just to be clear, I want to prevent the last two words in a paragraph from breaking. I don't want one word to be all by itself on a line. These refer to the number of lines that can hang at the start or end of a page (a screen's worth of text). So I think you may want 1 rather than 2, and 1 is probably the default. Most of the posts I have seen are on turning them off (set to 0) and this seems to work.

JSWolf
12-06-2010, 08:32 PM
If I am not mistaken, I think 2 is the default for widows and orphans.

In ADE, widows and orphans do work. I set them to 0.

wallcraft
12-06-2010, 08:40 PM
If I am not mistaken, I think 2 is the default for widows and orphans Yes, 2 is what HTML Dog (http://htmldog.com/reference/cssproperties/widows/) lists as the default.

elemenoP
12-06-2010, 09:01 PM
There are two different meanings of "orphan":

* A paragraph-opening line that appears by itself at the bottom of a page/column.
* A word, part of a word, or very short line that appears by itself at the end of a paragraph. Orphans result in too much white space between paragraphs or at the bottom of a page.

You are wanting to control the second meaning (words in a line) but it looks like the css orphan property controls the first meaning (lines of a paragraph at the bottom of the page). I don't know if there is a css property for minimum words in a line.

eP

WillAdams
12-07-2010, 08:30 AM
You can control the latter by using no-break spans and non-breaking spaces (subject to the H&J algorithm used) on the last two words in all paragraphs.

William

HarryT
12-07-2010, 11:59 AM
There are two different meanings of "orphan":

* A paragraph-opening line that appears by itself at the bottom of a page/column.
* A word, part of a word, or very short line that appears by itself at the end of a paragraph. Orphans result in too much white space between paragraphs or at the bottom of a page.

You are wanting to control the second meaning (words in a line) but it looks like the css orphan property controls the first meaning (lines of a paragraph at the bottom of the page). I don't know if there is a css property for minimum words in a line.

eP

I've never come across your second use of the word "orphan" before. It's always meant the first definition to me.

elemenoP
12-07-2010, 01:16 PM
That's from the Chicago Manual of Style (c&p from Wikipedia). What do you call a too-short last line in a paragraph?

eP

HarryT
12-07-2010, 02:03 PM
It's honestly never crossed my mind that it had a name :). To tell you the truth I don't see any particular issue with a paragraph ending in a line containing a single word.

elemenoP
12-07-2010, 02:39 PM
well in pbook publishing it's "not allowed." Another old typesetting rule.

When I first started reading on my Sony, I was surprised to see that it adjusted pages for widows and orphans. I could see other people thinking "how come some pages are longer than others?" And to see that people like to adjust their own widow and orphan settings to 0 bears this out.

eP

danrodney
12-08-2010, 02:08 PM
Now that I read more about them on HTML Dog, I realize I thought orphans did something different. I thought they were controlling the number of words on a line, not the number of lines on a "page." To me an orphan is a word on it's own line. I guess I'll have to look into another option. Too bad CSS doesn't have a specific setting to handle them :(

Like elemenoP said, orphans are not allowed in traditional typesetting. It's a sign of bad typography, unless columns are very narrow.

Thanks again,
Dan