How to reset chapter number for the first topic?

Post here questions and problems related to editing and publishing DITA content.
santhudev123
Posts: 9
Joined: Thu Apr 11, 2019 1:57 pm

How to reset chapter number for the first topic?

Post by santhudev123 »

We want the first chapter number as "Chapter 4" in the project, as we are splitting the whole project of 8 chapters into three parts as requested by customer. How to reset the chapter number by using CSS, Below is the code that we are using.

Code: Select all

*
[class ~= "map/map"]  {
counter-reset:chapter 4;
}
*[class ~= "map/map"] *[class ~= "topic/topic"][is-chapter]:not([is-part]) {
    counter-increment: chapter;
    counter-reset:section1;
}
Costin
Posts: 833
Joined: Mon Dec 05, 2011 6:04 pm

Re: How to reset chapter number for the first topic?

Post by Costin »

Hello,

If you are using shallow numbering, you should try:

Code: Select all

*[class ~= "map/map"] {
	counter-reset: chapter 3
	toc-chapter 3
	figcount 0
	tablecount 0
}

*[class ~= "topic/topic"][is-chapter]:not([is-part]):not([is-index]){
    counter-increment:chapter toc-chapter;
    counter-reset: section1;
}
The built-in CSS files that manage the numbering in the PDF output are located in Oxygen_install_dir\frameworks\dita\DITA-OT3.x\plugins\com.oxygenxml.pdf.css\css\print
Look for "p-numbering-" ones and use them as a starting point, performing your customization based starting from the CSS corresponding to the numbering type you are using (shallow/deep/etc.)

I hope this helps.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
santhudev123
Posts: 9
Joined: Thu Apr 11, 2019 1:57 pm

Re: How to reset chapter number for the first topic?

Post by santhudev123 »

Hello Costin,

Thank you for the reply, it worked :D

Regards
Santhosh M
Post Reply