PDF Page Numbers Restart at One in Each Chapter

Post here questions and problems related to editing and publishing DITA content.
patjporter
Posts: 53
Joined: Sat May 22, 2021 6:04 pm

PDF Page Numbers Restart at One in Each Chapter

Post by patjporter »

Hello,
Sorry for another question!
My page numbers are starting over at 1 in each chapter. I am trying to figure out where in the css this is controlled. I am thinking it may be caused by this additional css I added that I got via a forum on Stackoverflow, where I was trying to start each level 2 heading on a new page, but yet keep the first level 2 heading together with the 1st level (chapter heading) as shown below:
1st instance:
image.png
image.png (21.05 KiB) Viewed 710 times
2nd instance:
image.png
image.png (35.47 KiB) Viewed 710 times
Here is something very weird though...I do not get the page breaking in the first chapter...only in Chapter 2 and subsequent:
image.png
image.png (21.64 KiB) Viewed 710 times
Here is the css that was provided to get the page breaking at the level 2 heading for all but the first instance (I put it in a custom.css file):

Code: Select all

/* BREAK MAIN TOPICS TO NEW PAGE */
article h2 {
page-break-before: always;
}
article:first-of-type h2 {
page-break-before: avoid;
}
Any ideas on how to keep my page numbers from restarting at 1 in each chapter?
Thanks!
Pat
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: PDF Page Numbers Restart at One in Each Chapter

Post by chrispitude »

Here is information on controlling the numbering:

https://www.oxygenxml.com/doc/versions/ ... intro.html

You will probably want to set the args.css.param.numbering parameter to deep-chapter-scope-no-page-reset.

(By the way, there is a dedicated "PDF Chemistry" section of this forum that is specific to the PDF-CSS-HTML5 transformation here.)
patjporter
Posts: 53
Joined: Sat May 22, 2021 6:04 pm

Re: PDF Page Numbers Restart at One in Each Chapter

Post by patjporter »

Thank you very much!
I will move to that forum if I have further questions. You tip corrected the issue and now my document is publishing exactly as I would like it.
Pat
Post Reply