Forum Feature requests

Alternative Widow Control

Hi there,

nowadays every implementation of widow control will leave the last line of the previous page empty and glue this text as first line to the following page in order to avoid a widow on the following page. Althought this is common practice, I don't like this way of handeling widows. In all books I'm setting (and yes, it's more a book setting thing) I use another way:

If there is no chance for the author or editor, to make content changes to eliminate widows, I plan enough space below the type area or the page (the page number must be »out of the way«). If a widow occurs, I enlarge the type area of the previous page by one line, so this line »hangs out« of the type area. IMHO (and not only my opinion) this handling of widows is less disturbing.

Take it as a new idea for this problem. I personally would love to see both variants of widow control implemented in prince.

There are a few ways of responding to widows. I must say that having the occasional page run long is not common among books I've seen (mostly english-language, and mostly recent). In the sole example that springs to mind (possibly Bruce Rogers' "Paragraphs on Printing", hand-set), the spread was left uneven: the recto page was run long to keep its last paragraph intact, so that it was longer than the facing page -- though only "partly longer", in the sense that the extra line is only a partial line, being the last line of a paragraph.

Can I confirm that this is what you do? If no widow/orphan problem arises near the end of the facing page, then is it left uneven regardless of whether the extra line is on verso or recto page, and regardless of the length of that last line?

[Incidentally, I seem to recall that in the case I'm thinking of, the page numbers were centred at the bottoms of pages, with less than one line's worth of gap from the main text: the only reason it worked was that this extra last line was significantly less than half a line long, which is a judgement well outside of what I'd hope to express in CSS. Of course, one could avoid that problem by putting page numbers in the tops of pages.]

There are lots of design questions in what CSS syntax to use and what the behaviour in general would be, and I suspect that the first implementation will be distasteful in some way. Suggested syntax & behaviour are welcome.
A few thoughts on CSS:

As this is just one of several ways of responding to widows (and not a very common one), I'd like to look at whether it's practical to have a single property that can express which of several approaches to use.

In terms of geometry, there's a question of whether widows make the text overflow the page content box as defined by @page size,margin,border,padding, or whether instead the text should usually stop more than a line short of the end of the page content box, and widow constraints never cause overflow. Both behaviours are surprising in one way or another. My current preference is for never overflowing, and the author specifying how much extra space to ensure on most pages.

A concrete first proposal: prince-page-fill: prefer-short(<length>).

thanks for your thoughts on my post. To illustrate the behaviour I added some photos (top: normal spread; middle: spread with one »hanging« line to prevent a widow; bottom: tranlucency view).

But you made me curious: What are those multiple ways to (automatically!) handle widows?

  1. widows-prevention-by-expanding.jpg550.6 kB
As for your concrete first CSS proposal: Wouldn't it be better to cite the name of the paged media content area (page area)? Maybe something like this:
prince-page-area-fill: prefer-short(<length>)

Alternatively I could either think of something like:
widows: 2; /* behaves as today */
widows: -2; /* behaves as I described */
As for your annotation »[This method] is not common among books I've seen [...]«:

I checked two standard works for German book typography: 1. Hans Peter Willberg/Friedrich Forssman, Lesetypografie and 2. Friedrich Forssman/Ralf de Jong, Detailtypografie. The former only talks about extending page area height temporarily to avoid a widow, the latter describes both: extending and shortening of page area height.

So for German typography my »workflow« is not unusual. I think that most type setters prefer the shortening of page area height, because InDesign (and other programs) has implemented that way. Extending is manual work (maybe even lost knowledge nowadays).
Thanks for the comment on recommended practice.
I like non-proliferation of properties... I like the possibility of negative values to widows (nicely backwards compatible) - or how about adding a possible modifier to widows?

(widows: 2 defer; /* works as today, i.e. it moves some content to the next page in order not to have one lonely line */ )
widows: 2 append; /* appends max 2 lines to extend the page area height */
Uneven spreads are the greatest possible sin in my world :)

Having both pages in a spread a line short or a line long would be great, but now you're looking at a quite complex problem.

I'd never have dared to ask for actions, that affect spread-wide objects, but: yes. Even such a handling would be great ...
Current Prince for Books builds do have a simple-minded mechanism for running a whole spread short rather than just a page, when necessary for widows/orphans or other cases with a larger than usual distance between successive break opportunities. This is especially beneficial to publishers that readily accept for a spread to run short, and especially for the common case of orphans:1.

A slight tangent while on the topic of widows and recent Prince for Books builds: we now also allow "widows:<percentage>", e.g. "widows:80%" to allow a widow if the widow line is at least 80% full. That syntax isn't particularly clear as to its meaning; any suggestions? Would adding a keyword somewhere in the value be helpful?
I found the download for Prince for Books, but nothing more. Are there any further information available what the exact differences between the two versions are? Is a documentation included inside the download?
"widows:<percentage>", e.g. "widows:80%" to allow a widow if the widow line is at least 80% full.

I haven't totally understood what »widows: 80%« exactly does. Is this correct?:
»widows: 80%« = 
IF ( widow line coverage of »widows:1« < 80% ) THEN »widows:2« ELSE »widows:1«

Then how do I declare, that I like »widows:3« and accept »widows:2«, if line coverage < 80%?

Maybe you could combine the two properties into a shorthand property as it is done with »margin«:
prince-widows: 3 80%;

That would also leave the pure CSS »widows« property untouched, which I'd strongly prefer. IMHO it is better to not mix prince specifics with pure CSS properties.
Prince for Books doesn't yet have all of the features we'd like to offer people who aren't already using Prince, so there isn't a flashy website for it yet, but does outline the changes.

I'm not certain that I understand "widow line coverage of widows:1", so I'll try again: widows:80% means that it is permitted to have a last line of a multi-line paragraph occur at the start of a new page or column (separated from the rest of its paragraph) iff that last line's text has a width that is at least 80% of the content width of its block box. Thus, widows:101% behaves much like widows:2, while widows:0% behaves like widows:1.

(The rest of this comment might only make sense if the above is the same as what you understood.)

I did consider extending this to allow requesting "require at least 2 lines together if the last has width at least 80%, or require 3 lines together if the last line has width less than 80%", but I'm not aware of any cases where such a policy is used. Do you have a use case in mind?

I also don't understand the advantages of using a different property. I will say that putting the word "prince" in either the property name or value makes it clearer that this is an experimental, Prince-related feature. If this is what you were thinking of, what about combining this with the "use more explicit syntax" idea? In any case, this does seem like a feature that other UAs might be interested in adopting, so it's something we could take to the CSS WG and work towards it becoming what you might call "pure CSS".

With a single property, a stylesheet can use CSS error fallback for software (such as other versions of Prince) that doesn't support the widows:<percentage> syntax: e.g. writing "widows:80%; widows 2;" to approximate the effect of widows:80% on such software, or else ...widows:1 if you intend to manually achieve the effect of widows:80% by applying widows:2 on individual paragraphs. I think that using a single property actually makes it easier to work with a mix of formatting software, because the usual cascading rules apply for one widows declaration to override another widows declaration.

[I might not be able to reply for the next few days.]