Resetting the Figure Numbering

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
santhudev123
Posts: 9
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: 688
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: 45
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: 688
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

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

Re: Resetting the Figure Numbering

Post by Manohar_1024 » Mon Oct 21, 2019 3:07 pm

Hello,

Thanks for your reply and actually i am not finding that parameter which u have suggesting. So may be i am using an older version.
If it is like that, then can you share the css file of p-numbering-deep-chapter-scope.css and p-numbering-deep-chapter-scope-no-page-reset.css.
So that i will replace this in my custum css file for publishing.

Thank you,
Manohar.

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

Re: Resetting the Figure Numbering

Post by Costin » Tue Oct 22, 2019 11:23 am

Hi Manohar,

Please follow my advice and download the latest oXygen installation kit from our website. I already provided the download link in my previous reply, so you should just download it, install it in a separate folder, then use the predefined DITA Map PDF based on HTML5 and CSS scenario.
Please use the scenario as is, without any customization CSS, without a publishing template, or any other changes.

If you edit the predefined transformation scenario and go to the Parameters tab, you should have the "args.css.param.numbering" parameter and you could set any value you need (the default value is set on Shallow numbering) Please see the attachment:
defaultScenario.png
defaultScenario.png (97.73 KiB) Viewed 574 times
If the version that you are using is older than v21, the parameter is not available, as it has been implemented starting with version 21.0.
However, for version 20 for example, a default CSS files that controls deep numbering (but only deep, not also "deep chapter scope" or "deep-chapter-scope-no-page-reset" ) should be present in the oXygen installation directory (oxygenV20_install_dir\frameworks\dita\DITA-OT2.x\plugins\com.oxygenxml.pdf.css\css\print\p-optional-numbering-deep.css). So you could either use it as-is, by setting the path to the CSS file in the args.css parameter from the transformation scenario configuration, or use it as a starting point in your own CSS customization.
You could use your own customization CSS and import that default CSS, then write your own rules that override the ones from the default files.

We always recommend keeping oXygen up-to-date at the latest version, as a lot of improvements and bug fixes are implemented from one version to the other.

Best Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support

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

Re: Resetting the Figure Numbering

Post by Manohar_1024 » Mon Nov 04, 2019 10:03 am

Hello ,

Due some reasons we are not able to update to the current version. So what i have done is i have taken Deep numbering with figure numbering CSS code which is present in the new version and update that in the place of at current DEEP numbering CSS code which i am having in my version.(version 21.0) .

It is working almost fine like i am able to get now figure 1.0
But here the problem is only the chapter number is getting incremented, where as figure number is not incremented. So for entire chapter the figure number is same.

CSS code is attached below please have look at it and help me in this .

Code: Select all

@namespace p "http://www.oxygenxml.com/extensions/publishing/dita/css/params"; 

*[class ~= "map/map"][p|numbering^='deep'] *[class ~= "topic/topic"][is-chapter]{
  counter-reset:page 1 section1 tablecount figcount !important;
}  

/* Links and titles */
*[class ~= "map/map"][p|numbering^='deep'] .table--title-label-number,
*[class ~= "map/map"][p|numbering^='deep'] .fig--title-label-number {
	display:none;
}

/* Titles */
*[class ~= "map/map"][p|numbering^='deep'] *[class ~= "topic/table"] > caption > .table--title-label:after{
  content: counter(chapter) "." counter(tablecount) "  ";
}

*[class ~= "map/map"][p|numbering^='deep'] *[class ~= "topic/fig"] > figcaption >.fig--title-label:after {
  content:counter(chapter) "." counter(figcount) "  " ;
} 				

/* Links */
*[class ~= "map/map"][p|numbering^='deep'] .table--title-label-number-placeholder {
  content:  target-counter(attr(href), chapter, decimal) "-" target-counter(attr(href), tablecount, decimal) "  ";
}
*[class ~= "map/map"][p|numbering^='deep'] .fig--title-label-number-placeholder {
  content:  target-counter(attr(href), chapter, decimal) "-" target-counter(attr(href), figcount, decimal) "  ";
}

/* List of Tables and List of Figures */
*[class ~= "map/map"][p|numbering^='deep'] *[class ~= "placeholder/tablelist"] *[class ~= "listentry/number"],
*[class ~= "map/map"][p|numbering^='deep'] *[class ~= "placeholder/figurelist"] *[class ~= "listentry/number"]{
	display:none;
}

*[class ~= "map/map"][p|numbering^='deep'] *[class ~= "placeholder/tablelist"] *[class ~= "listentry/prefix"]:after{
  content: " "  target-counter(attr(href), chapter, decimal)  "-"  target-counter(attr(href), tablecount, decimal) "  ";
}

*[class ~= "map/map"][p|numbering^='deep'] *[class ~= "placeholder/figurelist"] *[class ~= "listentry/prefix"]:after{
  content: " "  target-counter(attr(href), chapter, decimal)  "-"  target-counter(attr(href), figcount, decimal) "  ";
}

Thank you,
Manohar.

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

Re: Resetting the Figure Numbering

Post by Costin » Mon Nov 04, 2019 5:27 pm

Hello,

It is not so simple to make an older version work like the latest one, just by modifying some CSS rules.
Under the hood, the latest version / maintenance build comes with improvements implemented through code lines and additional files.

Therefore, it is recommended to update your oXygen XML software to the latest version available on our website (v21.1), in order to benefit of all the current functionality.
However, if you want to test, I could provide you access to the latest internal nightly build of a publishing engine - containing the latest chemistry engine and a customized DITA-OT, that we tailored around it.

Note that the nightly build is meant for testing and evaluation purposes only, it should not be used for production work, as it is not an official stable release.
Also, you should keep it confidential and use it at your own discretion for the purpose of testing specifically the features / improvements in discussion.

If you decide to test it in a non-production environment, you should send us an email to support@oxygenxml.com and request access to the latest nightly build of the publishing engine.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support

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

Re: Resetting the Figure Numbering

Post by Manohar_1024 » Tue Jan 21, 2020 9:00 am

Hello,

I have upgraded to the latest version. I want to reset the page numbers and figure numbering according to subchapter wise.
I have also used parameter "numbering-deep-chapter-scope" and i am able to get chapterwise page and fig.no reset. But i need to get it done for subchapter level. Is there any way to do that?

I am using DITA transformation using CSS.
Please help me in achieving this.

Thank you,
Manohar.

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

Re: Resetting the Figure Numbering

Post by Costin » Tue Jan 21, 2020 2:46 pm

Hello,

There is no sub-chapter level numbering that you could use by default in oXygen / Chemistry.
The only available options are the ones mentioned in the Numbering Types section from the User-Guide.

However, most probably you could perform your own CSS customization to obtain that.
As a starting point, you could take a look over the default CSS files that come built-in with oXygen and which control numbering.
See the Numbering Built-in CSS.

Starting from that, you could try to perform your own CSS customization to achieve what you need.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support

Post Reply