Page 1 of 1

Problem with numbering of appendices

Posted: Tue Jan 23, 2024 9:02 pm
by susannecm
Hi everyone,
we are using Oxygen version 25.1 to create and publish our DITA documents in PDF and WebHelp format. PDF creation is CSS-based. Our opt file contains the following entry:

Code: Select all

<parameter name="args.css.param.numbering" value="deep-chapter-scope-no-page-reset"/>
This is working pretty much the way we want it for documents with parts. With these documents, the first appendix has the number A.
However, we do not like the results if the documents have no parts but do have an appendix. In this case, chapter 10 might be followed by appendix K.
Any ideas on how to resolve this?
Thank you for your help.
Susanne

Re: Problem with numbering of appendices

Posted: Thu Jan 25, 2024 12:35 pm
by andrei_pomacu
Hi,
I tested in Oxygen version 25.1, and the only problem that I found was that in the TOC, the counter for the Appendix is reset. To resolve this issue, you can add the following CSS customization rule:

Code: Select all

*[class ~= "map/map"][numbering ^= 'deep'] *[class ~= "bookmap/chapter"] + *[class ~= "bookmap/appendix"] {
    counter-reset: toc-chapter 0 !important;
}
This is my bookmap structure that I tested with:

Code: Select all

<bookmap id="taskbook">
    <chapter href="topics/installing.dita">
        <topicref href="tasks/installstorage.dita">
            <topicref href="tasks/replacecover.dita"/>
        </topicref>
        <topicref href="tasks/installwebserver.dita">
            <topicref href="tasks/restart.dita"/>
        </topicref>
    </chapter>
    <chapter href="tasks/configuring.dita">
        <topicref href="tasks/configurestorage.dita"/>
        <topicref href="tasks/configurewebserver.dita"/>
        <topicref href="tasks/configuredatabase.dita"/>
    </chapter>
    <chapter href="tasks/troubleshooting.dita">
        <topicref href="tasks/drivetrouble.dita"/>
    </chapter>
    <appendix href="topics/task_appendix.dita"/>
</bookmap>
Please let me know if you have any questions.

Regards,
Andrei

Re: Problem with numbering of appendices

Posted: Thu Jan 25, 2024 1:00 pm
by susannecm
Hi Andrei,
My description wasn't precise enough, sorry about that.
We actually want the appendix counter to be reset; the first appendix should have number A.
This does happen in bookmaps with parts.
However, in bookmaps without parts, the result is inconsistent. In the TOC, the first appendix has the number A, but in the PDF bookmarks and in the topic title, depending on the number of chapters, the same appendix might have the number K.
Kind regards,
Susanne

Re: Problem with numbering of appendices

Posted: Thu Jan 25, 2024 3:45 pm
by andrei_pomacu
Hi,
To reset the appendix chapter number, please add the following CSS customization rule:

Code: Select all

*[class ~= "topic/topic"][topicrefclass ~= "bookmap/part"] + *[topicrefclass ~= "bookmap/appendix"],
*[class ~= "topic/topic"][topicrefclass ~= "bookmap/chapter"] + *[topicrefclass ~= "bookmap/appendix"],
*[class ~= "map/map"][numbering ^= 'deep'] *[class ~= "topic/topic"][topicrefclass ~= "bookmap/part"] + *[topicrefclass ~= "bookmap/appendix"],
*[class ~= "map/map"][numbering ^= 'deep'] *[class ~= "topic/topic"][topicrefclass ~= "bookmap/chapter"] + *[topicrefclass ~= "bookmap/appendix"] {
    counter-reset: chapter 0 chapter-and-sections 0 !important;
}

Re: Problem with numbering of appendices

Posted: Thu Jan 25, 2024 4:04 pm
by susannecm
Much better, thank you!