Forum How do I...?

Table of contents page span include blank page

barrett777
Hello again :)

So here is part of my Table of Contents CSS, I believe pretty common:

content: leader("" "") target-counter(attr(data-topicidbegin), page) "" - "" target-counter(attr(data-topicidend), page);

Each topic has a 'topicidbegin' and 'topicidend'

The problem is 'topicidbegin' has 'page-break-before: right', which means a blank page is sometimes inserted so it starts on an odd page number.

This results in an output similar to this:

Topic A: Page 1-9
Topic B: Page 11-20

I want Topic A to include the blank page; basically show 1-10.

I have a couple ideas but don't know if any are possible:

Can we increment custom counters on each page? I could just have a custom counter that I increment by 2 on each even page, since my topics should always end on an even page.

Can any math be done in the 'content' CSS property? I tried using 'calc()' there but I don't think that's valid there. If I can do math I could probably find a way to do this, or at least subtract one page from the beginning of the next topic.

Thanks for your help :)

Edited by barrett777

barrett777
Oh nevermind, looks like I can do this with Prince script: http://www.princexml.com/doc/script-func/

I'll try to get it working with that :)

Edit: It works! And this will be helpful for other odd requests, thanks :)

Edited by barrett777