Forum How do I...?

page numbering that does not start at 1

johnmartirano
I noticed this earlier post:
http://www.princexml.com/bb/viewtopic.php?f=4&t=1169
Is it possible to start the page numbering at a different number than 1? I am formatting articles, which need to be available as seperate pdf's, but the page numbering between articles needs to continue. Also the first article page number needs to be continuing from last months end number...

to which the response:
Try applying "counter-reset: page 83" to the beginning of your document.

I have the same need but with some additional requirements. I find that if I do this above, then the content I have on my @page:first gets moved to the 2nd page.

To make matters more complex, I was originally wanting to only render page #'s on @page:right pages (so even only),
although I was attempting to reset the counter from @page:first or from an element on the first page.
I am flexible on requirements, but so far just getting lots of strange results.

Any ideas?
johnmartirano
After digging a bit more, I figured out that rather than refer to the first page as
@page:first
I can name the element that wraps it as in .wrapper { page: article_body; }
and then refer to it as @page article_body:first
and then I was able to do everything I described above.

New problem, how to use a value stored in the markup to set the page reset ??
I've tried for example:
#output_journal_article { counter-reset: page string(page_start,first); }
where page_start was set in:
#output_journal_article span.page { string-set: page_start content(); }

is something like that possible? All the examples I've seen utilize the string like this instead:
@page { @top-left { content: string(journal_name,first); } }
which is useful for other things.

If I dont get the value from the markup, then I can only imagine I'll have to modify/generate the css on output, which I would like to avoid.
mikeday
At the moment you can't use named strings as counter reset values, but you can use attributes, so you could do something like this:
div.wrapper { counter-reset: page attr(pagenum) }
...
<div class="wrapper" pagenum="17">
johnmartirano
Worked like a charm, thanks so much for your speedy reply!
jim_albright
Love this. I got it to work for my current Diglot Maker project!!!!

Jim Albright
Wycliffe Bible Translators