Forum How do I...?

Right, Left, First and Blank Pages

scott_w
I have been searching on the forum trying to find out how do do this but I'm not having any luck.

So when I have a large xml file with div.chapter class elements I can place a right hand page break at each div.chapter and if I prepare the appropriate @page, @page:first and @page:blank, I get what I would expect. (Note: @page has running headers and page numbers, @page:first has only page numbers and @page:blank has no page number or running headers.)

But if I have separate xml files coming in for each chapter and I want the first chapter after the introductory chapter to start on a right hand page, the same @page:first and @page:blank rules do not work. If the new file/chapter needs to start on a right hand page and the previous chapter ended on a right hand page I can get it to skip the left and start on the right but it doesn't see that skipped left as a @page:blank, instead it sees it as a @page:first. It makes sense in a way why it is doing this I'm just trying to figure out the best way to work around this logic.

I have attached the CSS, XML and PDF file showing the results. I'm trying to get page 2 in the PDF file to behave like a @page:blank and page three to behave like a @page:first.

I'm sure this has already been addressed, but I can't find it. Thanks in advance for your help.

Sorry, I attached the wrong file. Now the right one is attached.
  1. sample.zip93.9 kB

Edited by scott_w

mikeday
I think that is the wrong attachment ZIP file?
scott_w
Sorry, I have deleted the wrong files and attached the correct ones.

I also discovered that I have some 1px text in the headers set to white that I'm using for generating running page titles for book and chapters that was throwing things off. They seem to be the largest cause of my problem. I will dig deeper and post more details if this discovery doesn't completely solve my problem. Sorry, I hate it when I get tripped up by things I made invisible.
mikeday
Try putting the page-break-before on the root <document> element:
document {
    display: block;
    page-break-before: right
}

This should get the :blank page selector applying properly in this case.