Forum Feature requests

Arbitrary page selectors

dauwhe
Right now we can use :first, :left, :right, and :blank page selectors to assign properties to pages in various positions in a document. I have several cases where I'd like to be able to target an arbitrary page based on its position.

First use case: In some book designs, the opening page of a chapter is actually a spread (both left and right pages), and we'd need to suppress running heads and folios on the first two pages:

@page chapter:second {
@top-center { content: normal };
@bottom-center { content: normal };
}


Second use case: We need to control widows, orphans, and bad breaks in long runs of justified text. The classic way of doing this is to run an individual spread one line longer than usual, or one line shorter. In Quark/InDesign, you can just make the text box longer on an individual page. I'd like to be able to change the bottom margin on pairs of arbitrary pages:

@page custom {
margin-bottom: 42pt;
}

@page custom:fourth {
margin-bottom: 54pt;
}

@page custom:fifth {
margin-bottom: 54pt;
}

I would imagine such a feature would be useful in many other situations.

Thanks,

Dave Cramer
dauwhe
Another solution might be to allow any element (including inline) to invoke a named page without changing the flow.

So I could do something like <span class="short"/>

and

span.short {
page: short-page
}

And the named page would be used on the page where the span ended up...
mikeday
Okay, the most straightforward solution for us would be to add an :nth page selector that takes an integer argument, so you could so things like this:
@page chapter:nth(2) { ... }

This would make :first a short-cut for :nth(1). How does this sound?
jim_albright
Sounds good to have this option. I am not allowed to do this for a Bible though. My solution is to change the tracking on paragraphs to achieve column balance. There are bound to be some short lines or some very full lines where adjusting the tracking will add or subtract lines on a page. The other place I can add a line is around a picture. Hope this idea helps you.

Jim Albright
Wycliffe Bible Translators

dauwhe
mikeday wrote:
Okay, the most straightforward solution for us would be to add an :nth page selector that takes an integer argument, so you could so things like this:
@page chapter:nth(2) { ... }

This would make :first a short-cut for :nth(1). How does this sound?


That sounds excellent!

Dave
dauwhe
jim_albright wrote:
Sounds good to have this option. I am not allowed to do this for a Bible though. My solution is to change the tracking on paragraphs to achieve column balance. There are bound to be some short lines or some very full lines where adjusting the tracking will add or subtract lines on a page. The other place I can add a line is around a picture. Hope this idea helps you.


We do this quite extensively! There are times where it's very difficult to do, especially in fiction with lots of two-line paragraphs.

I dream of a user interface that will identify how much tracking would be needed to gain or lose a line in a given paragraph...

Dave
jim_albright
I do the tracking interactively. Google
prince xml typesetting
and select Princess-2010.

Jim Albright
Wycliffe Bible Translators

dauwhe
jim_albright wrote:
I do the tracking interactively. Google
prince xml typesetting
and select Princess-2010.


Very interesting... Thanks for the link! We're using on online interface to Prince that also has tracking controls: http://www.infogridpacific.com/igp/Publishing%20Products/IGP:FLIP/

Thanks,

Dave
mikeday
In Prince 8.0 we have implemented the :nth() page selector.
jimbrooking
This leads to a burning (for me) question: Is version 8 documentation available in any form or condition? There seem to be many additions in v.8 that are mentioned in the forum but the documentation page tabs stop with 7.1. A list of additional CSS in v.8 with even a cursory explanation of what and how would be immensely helpful.

Thanks -- Not complaining (well, whining some, I guess). Prince is alone in its class!
mikeday
More documentation is coming with the release, real soon now. :)
emkookmer
so when will the final release of 8.0 be?
the release of 7,1 was 18 month ago.
mikeday
14 months, surely! But yes, it has been far too long, and the release of Prince 8.0 is imminent, for real this time. We're just making the final updates to the website, and it will go out by the end of the week.
adriencater
mikeday wrote:
In Prince 8.0 we have implemented the :nth() page selector.


Mike, did this make it into the 8.0 release? Not working for me, but perhaps I'm not formulating the selector right.

I have a div which flows across 2 pages, and I'd like to adjust the margin on the second independently of the first.

I have some HTML

<div id="BoardReport">


which I have declared as a named page in the CSS

#BoardReport{page:BoardReport;}


and then I'd like to do this:

@page BoardReport:nth(2) {
	margin-top:120mm;
}


As a sanity check, i tried

@page BoardReport{
	background-color:#FC0;
}


which of course colors the background of both pages containing that div in yellow.
mikeday
It also needs "prince-page-group: start" on the div element, otherwise it will only match the second physical page of the document.
adriencater
mikeday wrote:
It also needs "prince-page-group: start" on the div element, otherwise it will only match the second physical page of the document.


perfect, worked like a charm, thanks.