How to remove last dot after chapter and section number in TOC and titles?
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 40
- Joined: Tue Oct 30, 2018 10:49 am
How to remove last dot after chapter and section number in TOC and titles?
Hello,
I am using Oxygen XML Editor version 24.1 and a customized version of the 'DITA Map PDF - based on HTML5 & CSS' publishing template to generate my PDFs. The args.css.param.numbering parameter is set to 'deep'.
The TOC currently looks like this:
I would like to not have the last dot, like this:
The same goes for the titles in the actual content, where I would also like to remove the last dot.
I assume this is a CSS customization and tried to adapt the rules I found in your documentation: https://www.oxygenxml.com/doc/versions/ ... tents.html like this for the TOC entries:
This does not work, though. The dots are still displayed. Can you give me a hint regarding the correct CSS rule to use?
Thanks and best regards,
Tanja
I am using Oxygen XML Editor version 24.1 and a customized version of the 'DITA Map PDF - based on HTML5 & CSS' publishing template to generate my PDFs. The args.css.param.numbering parameter is set to 'deep'.
The TOC currently looks like this:
Code: Select all
1. First level topic
1.1. Second level topic
Code: Select all
1 First level topic
1.1 Second level topic
I assume this is a CSS customization and tried to adapt the rules I found in your documentation: https://www.oxygenxml.com/doc/versions/ ... tents.html like this for the TOC entries:
Code: Select all
*[class ~= "map/topicref"] *[class ~= "topic/navtitle"]:before {
content: counters(toc-chapter-and-sections, ".") " ";
}
Thanks and best regards,
Tanja
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: How to remove last dot after chapter and section number in TOC and titles?
Post by chrispitude »
Hi Tanja,
Try inspecting the list item in your browser, as described here:
https://www.oxygenxml.com/doc/versions/ ... wl_jwq_5cb
(Most browsers have an inspector feature, but I've found Chrome's inspector to be the most useful.)
For the list item markers, take a look at both the HTML elements and containers and the CSS rules that apply to them. Note that the CSS rules also indicate which file they come from, which helps you know if rules from your custom CSS file are being applied.
Please let me know if this helps. If not, I'll make a small testcase and have a look too.
(Also, note that there is a section of the forum dedicated to PDF Chemistry here - common-problems-f26/)
Try inspecting the list item in your browser, as described here:
https://www.oxygenxml.com/doc/versions/ ... wl_jwq_5cb
(Most browsers have an inspector feature, but I've found Chrome's inspector to be the most useful.)
For the list item markers, take a look at both the HTML elements and containers and the CSS rules that apply to them. Note that the CSS rules also indicate which file they come from, which helps you know if rules from your custom CSS file are being applied.
Please let me know if this helps. If not, I'll make a small testcase and have a look too.
(Also, note that there is a section of the forum dedicated to PDF Chemistry here - common-problems-f26/)
-
- Posts: 662
- Joined: Wed Oct 16, 2019 3:47 pm
Re: How to remove last dot after chapter and section number in TOC and titles?
Post by julien_lacour »
Hello Tanja,
You were really close to the solution, try to use the following rules, they must change the numbering as expected:
The first rule applied on Table of Contents elements and the second one applied on the rest of the content.
Regards,
Julien
You were really close to the solution, try to use the following rules, they must change the numbering as expected:
Code: Select all
*[class ~= "map/map"][numbering ^= 'deep'] *[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicmeta"]:before,
*[class ~= "map/map"][numbering ^= 'deep'] *[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicref"] > *[class ~= "map/topicmeta"]:before,
*[class ~= "map/map"][numbering ^= 'deep'] *[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicref"] > *[class ~= "map/topicref"] > *[class ~= "map/topicmeta"]:before,
*[class ~= "map/map"][numbering ^= 'deep'] *[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicref"] > *[class ~= "map/topicref"] > *[class ~= "map/topicref"] > *[class ~= "map/topicmeta"]:before {
content: counters(toc-chapter-and-sections, ".") " ";
}
*[class ~= "map/map"][numbering ^= 'deep'] *[class ~= "topic/topic"][is-chapter]:not([is-part]) > *[class ~= "topic/title"]:before,
*[class ~= "map/map"][numbering ^= 'deep'] *[class ~= "topic/topic"][is-chapter]:not([is-part]) *[class ~= "topic/topic"] > *[class ~= "topic/title"]:before {
content: counters(chapter-and-sections, ".") " ";
}
Regards,
Julien
-
- Posts: 662
- Joined: Wed Oct 16, 2019 3:47 pm
Re: How to remove last dot after chapter and section number in TOC and titles?
Post by julien_lacour »
A smaller variant consists in using the "!important" rule, like this:
Same as before, first rule is for TOC, second for the rest of the content.
Regards,
Julien
Code: Select all
*[class ~= "map/topicref"] > *[class ~= "map/topicmeta"]:before {
content: counters(toc-chapter-and-sections, ".") " " !important;
}
*[class ~= "topic/topic"] > *[class ~= "topic/title"]:before {
content: counters(chapter-and-sections, ".") " " !important;
}
Regards,
Julien
Return to “DITA (Editing and Publishing DITA Content)”
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