deep numbering and chapter wise numbering are getting affected simultaneously

Post here questions and problems related to editing and publishing DITA content.
Manohar_1024
Posts: 53
Joined: Wed Mar 27, 2019 10:12 am

deep numbering and chapter wise numbering are getting affected simultaneously

Post by Manohar_1024 »

Hello,
When i am trying to put chapter wise page numbering, then the deep numbering is getting affected as i am getting 2.4,2.5 instead of 2.1,2.2etc.
Here is the css style i have used for chapter wise page numbering.

Code: Select all

*[class ~= "topic/topic"][is-chapter] {
counter-reset: page !important;
}
So please help me in this problem
Costin
Posts: 829
Joined: Mon Dec 05, 2011 6:04 pm

Re: deep numbering and chapter wise numbering are getting affected simultaneously

Post by Costin »

Hi,

Note that starting with version 21, there is a dedicated parameter that you could use to use only the deep numbering style, or only shallow numbering.
More specific, if you edit the DITA Map PDF - based on CSS and HTML5 transformation scenario, in the scenario configuration dialog, under the "Parameters" tab there is a parameter called "args.css.param.numbering". You could use this one and set its value to "deep" to use only deep numbering.

Regarding the instruction you stumbled upon in the User-Guide, with the method to reset the page counter, that applies only to shallow numbering.
For deep numbering, you should try with a slightly different rule, like:

Code: Select all

*[class ~= "topic/topic"][is-chapter]:not([is-part]) {
counter-reset: page 1 !important;
}
You should also look at the default css used for deep numbering technique, in order to better understand what counters are present on which elements.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
Manohar_1024
Posts: 53
Joined: Wed Mar 27, 2019 10:12 am

Re: deep numbering and chapter wise numbering are getting affected simultaneously

Post by Manohar_1024 »

Thanks for the reply.
however i am asking that deep numbering is getting affected when we give chapter wise page numbers, how to modify it. actually it should look like.2.1,2.2,2.3...But it is showing 2.4,2.5,2.6..
The code you have mentioned is for resetting the page number.
But when that is done i am notgetting deep numbering as i wanted to be 3.1,3.2,3.3,3.3.1,3.3.2......
Costin
Posts: 829
Joined: Mon Dec 05, 2011 6:04 pm

Re: deep numbering and chapter wise numbering are getting affected simultaneously

Post by Costin »

Yes, because there is another counter-reset in the default CSS for deep numbering, which is actually overwritten by the "counter-reset" property you use in your custom CSS.
That's why I advised you to take a look at the default css used for deep numbering, in order to identify if there are any other counters reset by the counter-reset for the matched element.
In your case, there is also a "section1" counter that is reset in the default CSS, as you can see, but the counter-reset property from your customization CSS overwrites the counter-reset property from the CSS and leaves the counter as-is.

In short, the correct rule you should use:

Code: Select all

*[class ~= "topic/topic"][is-chapter]:not([is-part]) {
counter-reset: page 1 section1 !important;
}
Costin Sandoi
oXygen XML Editor and Author Support
Manohar_1024
Posts: 53
Joined: Wed Mar 27, 2019 10:12 am

Re: deep numbering and chapter wise numbering are getting affected simultaneously

Post by Manohar_1024 »

Awesome...
Now it is working thank you so much.
Post Reply