Chapter Numbering out-of-sync
Having trouble installing Oxygen PDF Chemistry? Got a bug to report? Post it all here.
-
- Posts: 3
- Joined: Mon May 15, 2023 7:23 pm
Chapter Numbering out-of-sync
Hello,
While building a large PDF manual (in Oxy+Chemistry), I am running into an inconsistency in the chapter numbering (described below). We're using Deep-Chapter-Scope numbering. Here's a simplified version of the ditamap. Within the chapters there are topics and subtopics, sometimes several level of subtopics.
As this project is configured, chapter numbers appear as the first number in multipart section numbers (e.g. 12.2.7 for a subtopic in chap. 12) and also as the prefix to figure and table numbers (e.g. Table 12-5).
So, the problem is this: The chapter number prefix in the section numbering resets when you reach part #2, as I believe it should. However, the chapter numbers that appear as part of the figure and table numbers do not. So, for example, in the Introduction chapter you will find a subtopic 1.2.7, but the figures and tables will be labeled 4-1, 4-2, 4-3, etc. This off-by-three discrepancy persists for every chapter in part #2. The discrepancy becomes even greater in subsequent parts.
There is nothing in our custom CSS that attempts to reset or change the handling of the built-in counters. I've reviewed the relevant settings (parameters tab) and made a few experiments, but nothing I found so far has changed this behavior.
Can anyone explain what's going on here, or what's wrong with our setup?
Thanks,
Robert Miller
While building a large PDF manual (in Oxy+Chemistry), I am running into an inconsistency in the chapter numbering (described below). We're using Deep-Chapter-Scope numbering. Here's a simplified version of the ditamap. Within the chapters there are topics and subtopics, sometimes several level of subtopics.
Code: Select all
<frontmatter> </frontmatter>
<part href="codestructtheory" collection-type="family">
<chapter href="code_structure.dita"> </chapter>
<chapter href="system_modeling.dita"> </chapter>
<chapter href="phenomenology_models.dita"> </chapter>
</part>
<part href="subroutines_and_their_functional_requirements.dita">
<chapter href="introduction.dita"> </chapter>
<chapter href="subroutines_by_module.dita"> </chapter>
<chapter href="account_for_grid.dita" chunk="to-content"> </chapter>
MANY MORE CHAPTERS
</part>
MORE PARTS
So, the problem is this: The chapter number prefix in the section numbering resets when you reach part #2, as I believe it should. However, the chapter numbers that appear as part of the figure and table numbers do not. So, for example, in the Introduction chapter you will find a subtopic 1.2.7, but the figures and tables will be labeled 4-1, 4-2, 4-3, etc. This off-by-three discrepancy persists for every chapter in part #2. The discrepancy becomes even greater in subsequent parts.
There is nothing in our custom CSS that attempts to reset or change the handling of the built-in counters. I've reviewed the relevant settings (parameters tab) and made a few experiments, but nothing I found so far has changed this behavior.
Can anyone explain what's going on here, or what's wrong with our setup?
Thanks,
Robert Miller
-
- Posts: 665
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Chapter Numbering out-of-sync
Post by julien_lacour »
Hello,
You can add the following rules in your custom CSS stylesheet:
The above rules work for Part > Chapter > Topic, if you have figures/images at deeper levels (Part > Chapter > Topic > Subtopic), you need to extend the selectors:
You can use the same logic for section3 and section4 counters if needed.
Regards,
Julien
You can add the following rules in your custom CSS stylesheet:
Code: Select all
*[class ~= "map/map"][numbering ^= 'deep-chapter-scope'] *[class ~= "topic/topic"][is-chapter] {
counter-reset: page 1 chapter section1 tablecount figcount !important;
}
*[class ~= "map/map"][numbering ^= 'deep-chapter-scope'] *[class ~= "topic/topic"] *[class ~= "topic/topic"] *[class ~= "topic/topic"] *[class ~= "topic/table"] > caption > .table--title-label:after {
content: " " counter(chapter) "-" counter(section1) "-" counter(tablecount) " ";
}
*[class ~= "map/map"][numbering ^= 'deep-chapter-scope'] *[class ~= "topic/topic"] *[class ~= "topic/topic"] *[class ~= "topic/topic"] *[class ~= "topic/fig"] > figcaption > .fig--title-label:after {
content: " " counter(chapter) "-" counter(section1) "-" counter(figcount) " ";
}
Code: Select all
*[class ~= "map/map"][numbering ^= 'deep-chapter-scope'] *[class ~= "topic/topic"] *[class ~= "topic/topic"] *[class ~= "topic/topic"] *[class ~= "topic/topic"] *[class ~= "topic/table"] > caption > .table--title-label:after {
content: " " counter(chapter) "-" counter(section1) "-" counter(section2) "-" counter(tablecount) " ";
}
*[class ~= "map/map"][numbering ^= 'deep-chapter-scope'] *[class ~= "topic/topic"] *[class ~= "topic/topic"] *[class ~= "topic/topic"] *[class ~= "topic/topic"] *[class ~= "topic/fig"] > figcaption > .fig--title-label:after {
content: " " counter(chapter) "-" counter(section1) "-" counter(section2) "-" counter(figcount) " ";
}
Regards,
Julien
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service