Mismatch Appendix titles vs ToC

Post here questions and problems related to editing and publishing DITA content.
Silvio
Posts: 2
Joined: Fri May 17, 2024 10:48 am

Mismatch Appendix titles vs ToC

Post by Silvio »

Hello everyone,
I'm on charge of the technical documentation in my department, which includes:
  • user manuals,
  • service manuals,
  • spare parts book.
We recently migrated from un-structured system (with Adobe FrameMaker) into DITA with OxygenXML. I'm quite a newbie on this software.

However, I'm facing an issue with the Appendix numbering and the TOC that I'm totally unable to fix.
The appendix chapters and sections numbering are ok, as well for the PDF bookmarks.
Capture d’écran 2024-05-17 à 09.45.56.png
Capture d’écran 2024-05-17 à 09.45.56.png (33.53 KiB) Viewed 197 times
But in the table of contents, the 4th level is still 0.
Capture d’écran 2024-05-17 à 09.46.05.png
Capture d’écran 2024-05-17 à 09.46.05.png (28.9 KiB) Viewed 197 times

I customized the ToC definition for the appendix in a CSS file.

Code: Select all

/* For appendix - TOC - reset - reset counter section1 */
*[class ~= "map/map"][numbering ^= 'deep'] *[class ~= "bookmap/chapter"] + *[class ~= "bookmap/appendix"] {
    counter-reset: toc-chapter 0 /*toc-section1 0 toc-section2 0 toc-section3 0*/ /*toc-chapter-and-sections 0 !important*/;
}
/* For appendix - TOC */
*[class ~= "map/map"][numbering ^= 'deep'] *[class ~= "map/topicref"][class ~= "bookmap/appendix"][is-chapter]:not([is-part]) > *[class ~= "map/topicmeta"]:before {
    content: "Appendix " counter(toc-chapter, upper-latin) " ";
}
/* For appendix - TOC - level 2 numbering definition */
*[class ~= "map/map"][numbering ^= 'deep'] *[class ~= "map/topicref"][class ~= "bookmap/appendix"][is-chapter]:not([is-part]) > *[class ~= "map/topicref"] > *[class ~= "map/topicmeta"]:before {
    content: counter(toc-chapter, upper-latin) "." counter(toc-section1) " ";
}
/* For appendix - TOC - level 3 numbering definition */
*[class ~= "map/map"][numbering ^= 'deep'] *[class ~= "map/topicref"][class ~= "bookmap/appendix"][is-chapter]:not([is-part]) > *[class ~= "map/topicref"] > *[class ~= "map/topicref"] > *[class ~= "map/topicmeta"]:before {
    content: counter(toc-chapter, upper-latin) "." counter(toc-section1) "." counter(toc-section2) " ";
}
/* For appendix - TOC - level 4 numbering definition */
*[class ~= "map/map"][numbering ^= 'deep'] *[class ~= "map/topicref"][class ~= "bookmap/appendix"][is-chapter]:not([is-part]) > *[class ~= "map/topicref"] > *[class ~= "map/topicref"] > *[class ~= "map/topicref"] > *[class ~= "map/topicmeta"]:before {
    content: counter(toc-chapter, upper-latin) "." counter(toc-section1) "." counter(toc-section2) "." counter(toc-section3) " ";
}
Do you have any clue on what I've done wrong ? Thanks

Best regards
Silvio

OxygenXML 26.1 - macOS Sonoma
julien_lacour
Posts: 529
Joined: Wed Oct 16, 2019 3:47 pm

Re: Mismatch Appendix titles vs ToC

Post by julien_lacour »

Hello Silvio,

The default stylesheet does not increment any counter below level 3, you need to add it in your stylesheet:

Code: Select all

*[class ~= "map/map"][numbering ^= 'deep'] *[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicref"] > *[class ~= "map/topicref"] > *[class ~= "map/topicref"] {
  counter-increment: toc-section3 toc-chapter-and-sections;
}
Regards,
Julien
Silvio
Posts: 2
Joined: Fri May 17, 2024 10:48 am

Re: Mismatch Appendix titles vs ToC

Post by Silvio »

Hi Julien,
Problem fixed ! :D
Great ! Thanks a lot !
Post Reply