page counter reset issue

stulis
Posts: 5
Joined: Wed Jun 26, 2019 3:58 pm

page counter reset issue

Post by stulis » Wed Jun 26, 2019 4:32 pm

I want a contigious page count from first to last page in my generated pdf file.
However, I get a "counter-reset: page 1" on table-of-contents and chapter pages as per default when generating the pdf file.

How can I dissable this counter-reset?

(I'm running XML Editor 21.0, build 2019022207)

Costin
Posts: 600
Joined: Mon Dec 05, 2011 6:04 pm

Re: page counter reset issue

Post by Costin » Thu Jun 27, 2019 12:19 pm

Hello,

If you use your internet browser's CSS inspector to inspect the intermediate merged.html file resulted in the output folder (as per the method suggested in the Debugging the CSS section from the User-Guide), you should see there is a

Code: Select all

[class~="map/map"] > [class~="toc/toc"] + [class~="topic/topic"] {
    counter-reset: page 1;
}
rule that applies on the very first topic following the TOC and that comes from the default CSS from oxygen_install_dir/frameworks/dita/css/print. For example, in case you are using shallow numbering, the rule comes from the "p-numbering-shallow.css" CSS file.

You could then overwrite that rule in your own customization CSS file, with:

Code: Select all

[class~="map/map"] > [class~="toc/toc"] + [class~="topic/topic"] {
    counter-reset: none;
}
For deep numbering, the default CSS that handles it is "p-numbering-deep.css" and the rule is slightly different (it also has a namespace to control the selected parameter).
So, for deep numbering, in your customization CSS you should add:

Code: Select all

@namespace p "http://www.oxygenxml.com/extensions/publishing/dita/css/params"; 
*[class ~= "map/map"][p|numbering^='deep'] > *[class ~= "toc/toc"] + *[class ~= "topic/topic"]{
    counter-reset: none;
}
Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support

stulis
Posts: 5
Joined: Wed Jun 26, 2019 3:58 pm

Re: page counter reset issue

Post by stulis » Thu Jul 04, 2019 6:08 pm

thanks Costin

[class~="map/map"] > [class~="toc/toc"] + [class~="topic/topic"] {
counter-reset: none;
}

did it :-)

Post Reply