Page 1 of 1

page counter reset issue

Posted: Wed Jun 26, 2019 4:32 pm
by stulis
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)

Re: page counter reset issue

Posted: Thu Jun 27, 2019 12:19 pm
by Costin
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

Re: page counter reset issue

Posted: Thu Jul 04, 2019 6:08 pm
by stulis
thanks Costin

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

did it :-)