Forum How do I...?

Page style bug with page-break-before: right?

ikaruga
Sample code:

<html> 
<style type="text/css">
  div#table-of-contents {
  page: toc;
  }

  @page toc { 
  @bottom-left { 
  content: "TOC " counter(page, lower-roman);
  }
  }

  div#chapter1 {
  counter-reset: page 1;
  page: chapter;
  page-break-before: right;
  }

  @page chapter { 
  @bottom-left {
  content: "Text " counter(page);
  }
  }

  @page {
  @bottom-left {
  content: normal;
  }
  }
</style>
</head>
<body>
<div id="table-of-contents">Table of Contents</div>
<div id="chapter1">Chapter 1</div>
</body>
</html>


Desired output:

1st page with footer "TOC i"
2nd page with blank footer
3rd page with footer "Text 1"

The idea is that the table of contents is "front matter" so it gets roman numerals. Each chapter starts on an odd numbered page (a "right" page). Also, the first chapter restarts the numbering at 1. We can do this with page-break-before: right (and counter-reset: page 1). However, this is what I get instead:

1st page with footer "TOC i"
2nd page with footer "Text 2"
3rd page with footer "Text 1"

The filler page (Page 2) seems to be using a combination of the TOC and chapter page styles---it uses the chapter footer but the page numbering from the TOC. This is weird behavior. Ideally, it should be blank (use neither page style) or just use one of the styles. I've also tried using page-break-after: right and still no dice.

Using Prince 7.1.
mikeday
Changing the last @page rule selector to be "@page chapter:blank { ... }" does the trick.