Forum How do I...?

Refer to the penultimate page using content: counter(pages)?

Josh Kinsey
How can I refer to the second-to-last page of my document in a footer?
I need to have something like:
"See pages 18 & 19 for Important Information" where page 19 is the last page and page 18 is the next-to-last page of the document.

I've tried:
See pages <span style='content: counter(pages)-1'></span> & <span style='content: counter(pages)'></span> for Important Information
this just gives me " & 19".

I've also tried:
See pages <span style='content: counter(pages-1)'></span> & <span style='content: counter(pages)'></span> for Important Information
and this gives me "0 & 19".

Thanks!
mikeday
There is no arithmetic possible on counter values at this time, so the easiest way to do this would be to have a unique id attribute on some content that appears on this page and use target-counter to create a cross-reference with that page number.
Josh Kinsey
Okay, this isn't working:

In first Page: <div class="coverReference"></div>

In last Page: <a id="end1">Drat</a>

In next-to-last Page: <a id="end2">Drat</a>

In CSS:
div.coverReference
{
content: "See pages " target-counter("#end1",page) " & " target-counter("#end2",page) " for Important Information"
}

Now, if I do:
content: "See pages " counter(page) " & " counter(pages) " for Important Information and Disclosures"
It works... but that's not what I need.

Oh, and:
"See pages " counter(page) " & " target-counter("#end1" ,page) " for Important Information"
doesn't work either....
Josh Kinsey
And so you will know, I'm using Prince 6.0 rev 5.

Thanks for all your attention!
mikeday
Try target-counter(url("#end1"), page).