I want the page numbering to begin after the Table of Contents on the PDF export. The Title Page and Table of Contents page(s) should not be counted. For example, I want to export a pair of pages in a small section that total 3 PDF pages. The Title Page and Table of Contents pages add 2 pages, making the PDF itself 5 pages long. The kicker is that the Title Page and Table of Contents pages should not be counted in the page numbering in the footer of the PDF. The layout is as follows:
The content pages are where the numbering should begin. I want those pages to begin at page 1 and not page 3. How can I fix this in the stylesheet? I cannot find any answers. I think I should be able to use a counter-reset, but I cannot get it to work. Thoughts?
P.S. It looks like someone asked a little over a year ago and never received an answer: https://answers.atlassian.com/questions/138335
As already said in the other thread, "counter-reset" seems to be ignored for "counter(page)".
It works for self defined counters, though. For example, if you create your own numbers for headings and want it to start with "42", you can achieve it with this:
body { counter-reset: myOwnHeader 41; } h2:before { content: counter(myOwnHeader) ". "; counter-increment: myOwnHeader; }
You could somewhat recreate that for your case.
1) Add this to your stylesheet:
/* create a counter "myPageNo" and define its initial value 3 */ body { counter-reset: myPageNo 3; } /* create a class "MyPageNoText": set its position and what it will display */ .MyPageNoText { position: running(PageNo); } .MyPageNoText:before { content: "this is page " counter(myPageNo); counter-increment: myPageNo; } /* position the class on the PDF page */ @page { @bottom-right { content: element(PageNo); } }
2) Add an empty "span" or "div" macro to your wiki page and set the "Class" to "MyPageNoText".
This will add a "this is page 4/5/6..." to the bottom of your pages, starting at that point where you include the class (include it on page 3 and the first two pages won't have no page numbers at all).
I tested it. It works!
But nobody would really do it like that .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.