Resetting the Figure Numbering

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
santhudev123
Posts: 5
Joined: Thu Apr 11, 2019 1:57 pm

Resetting the Figure Numbering

Post by santhudev123 » Thu Jun 20, 2019 4:30 pm

Hi,

Just want to reset figure numbering on each sub-topic/sub-chapter. we used the code which is available at help files, but we are not getting output as required.

Here is the code

*[class ~= "topic/topic"][is-chapter] {
counter-reset: figcount;
}

.fig--title-label{
display:none;
}

*[class ~= "topic/fig"] > .figcap:before{
/* Add more styling or change the content if needed */
content: "Figure " counter(figcount) ". ";
counter-increment: figcount;
}

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

Re: Resetting the Figure Numbering

Post by Costin » Fri Jun 21, 2019 10:29 am

Hi santhudev123,

It is not clear if you want to reset the numbering for figures/titles at subchapter level or at chapter level.
At a first glance, your CSS rules look OK, but I noticed that you are using

Code: Select all

*[class ~= "topic/topic"][is-chapter] {
and this is used to for chapter-level.

I want to make sure you are aware that there is a dedicated transformation scenario parameter - "args.css.param.numbering", which you could use out-of-the-box from oXygen scenario configuration dialog.
You could just set its value to
- "deep-chapter-scope" (to reset both the page numbers and the figures/tables numbers, at each chapter)
- "deep-chapter-scope-no-page-reset" (to reset only the figures/tables numbering, but not the page numbers)

So far, there is no out-of-the-box value that you could use for subchapter-level numbering resets. The parameter works only for chapter scope.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support

Manohar_1024
Posts: 34
Joined: Wed Mar 27, 2019 10:12 am

Re: Resetting the Figure Numbering

Post by Manohar_1024 » Tue Jun 25, 2019 8:08 am

hello,
i am also facing the same problemand i have checked the parameters but still i am not able to achieve chapter wise figure numbering.
I am also using the same css code as above mentioned.Please give me any css code to perform this action.
I am using DITA using CSS transformation
Thank you.

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

Re: Resetting the Figure Numbering

Post by Costin » Tue Jun 25, 2019 11:00 am

Hello,

If you use the latest version of oXygen available on the website and edit the default DITA Map PDF - based on HTML5 & CSS scenario, go to the Parameters tab and set the "deep-chapter-scope" value for the "args.css.param.numbering" (if you use the latest version, the args.css.param.numbering has to be in the parameters list), the figures are numbered in chapter scope.
Most probably you are either using an older version of oXygen, when this functionality was not available, or you have your own customization CSS that breaks the numbering (case in which you should try without your CSS and if it works, you should then debug your own CSS).

I have just tested this and couldn't see anything wrong with this functionality. I tested by publishing the flowers.ditamap from the oXgen sample project, without any customization CSS. The only modification to the predefined DITA Map PDF - based on HTML5 & CSS that I made was to set the numbering parameter to deep.

To test, I've also added some figures in the document, so make sure that you have figures that contain images, not plain images)
The figures are correctly numbered in the resulted PDF, in chapter scope. See the images I attached below:

Image Image Image Image

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support

Post Reply