Page 1 of 1

Avoid Chapter numbering of some topics

Posted: Wed Jul 04, 2018 1:53 pm
by dpksaini89
In the user manual, I do not wish to count topics such as Acronyms, Glossary, About Us, Admonishments Used, General Safety Instructions as Chapters.
Ideally the above named topics should be present after TOC and before actual Chapters start from System Overview.
Kindly suggest how can we achieve this.

Re: Avoid Chapter numbering of some topics

Posted: Thu Jul 05, 2018 11:38 am
by Costin
As your document contains chapters, I suppose you are using a Bookmap specialization, not a general DITA Map.
If you aren't using it already, then it is recommended to work on a Bookmap.

You could set the toc="no" attribute on the specific topics you want to hide from the TOC.
However, as this would just hide them from the table of contents, they will still appear in the bookmarks view.
That's is why more complex customization is required for your use-case.

Besides the toc="no" attribute, you should also set a custom outputclass attribute on those specific topics.
In your custom .css, you could then filter the topics by the specific outputclass name you would set (the outputclass will actually translate in a "class" attribute in the HTML output), then apply additional rules only on those topics, to also hide them from bookmarks and omit them from chapter counting in your PDF.

More exactly, on each of the source topics you need to hide from TOC/bookmarks, you should set the attributes: toc="no" and outputclass="hide-bm-labels", then add the below rules in your custom CSS (the rules also make the bookmarks counter disconsider those topics):

Code: Select all

/* Remove the labels from the bookmarks view */
*[class~="topic/topic"][outputclass ~= "hide-bm-labels"] *[class~="topic/title"] {
/* Make sure the chapter counter is not altered by these topics */
*[class ~= "topic/topic"][outputclass ~= "hide-bm-labels"] {
counter-increment:none !important;
/* No Chapter NN before the titles of these topics in the main content. */
*[class ~= "topic/topic"][outputclass ~= "hide-bm-labels"] *[class ~= "topic/title"]:before {
content: none !important;
/* No Chapter NN in the page headings for these topics. */
*[class ~= "topic/topic"][outputclass ~= "hide-bm-labels"] *[class ~= "topic/title"] {
string-set: chaptertitle content();
Regarding the position where they would appear in the output, they can only be displayed in the order they appear in your bookmap.
If you need them to appear in a specific place, you should move their corresponding topicrefs in that specific position in your map.

Re: Avoid Chapter numbering of some topics

Posted: Fri Jul 06, 2018 10:36 am
by dpksaini89
I am a newbie, please bear with me.
But how to create Bookmap, How is it different from Ditamap. How to decide which is apt for our requirement.
Can you direct me to right resources in this regard.

Can my requirement be catered through front matter? What is front matter and how does it output look like.

Re: Avoid Chapter numbering of some topics

Posted: Fri Jul 06, 2018 11:49 am
by Radu

If you have parts in your PDF output that you consider to be "chapter"'s then indeed you should probably use a DITA bookmap because a bookmap is more oriented towards book-like publications, it contains various specific DITA elements like front-matter, backmatter, index and so on..
The DITA 1.3 specification showing what a bookmap is: ... okmap.html

and a link to the Oxygen user's manual about creating a bookmap: ... k-map.html

The frontmatter is the part of the book which comes before the actual book contents: ... atter.html

The front matter usually has a structure like this:

Code: Select all

<bookabstract href="MyBookAbstract.dita"/>
<preface href="preface.dita"></preface>
The <toc> element specifies where the table of contents will appear, you can for example move the reference to the preface before the table of contents.
There is also a bookmap example in the OXYGEN_INSTALL_DIR\samples\dita\it-book\taskbook.ditamap which you can analyze.


Re: Avoid Chapter numbering of some topics

Posted: Tue Jul 10, 2018 9:05 pm
by paulkhillier

I am in the midst of customizing our CSS and used the following methods to hide labels from Body/TOC/PDF Bookmarks:

Code: Select all

/* Hide Part and Chapter Label/Number */

*[class ~= "topic/topic"] > *[class ~= "topic/title"]:before {

/* Hide Figure and Table Label/Number */

*[class ~= "topic/table"] > *[class ~= "topic/title"]:before {

*[class~="topic/fig"] > *[class~="topic/title"]:before {

/* Hide Table of Contents Label/Number */

*[class ~= "map/topicmeta"] > *[class ~= "topic/navtitle"]:before {
display:none !important;
Hope this helps, these forums are great.


Paul Hillier

Re: Avoid Chapter numbering of some topics

Posted: Tue Sep 11, 2018 1:54 pm
by Stanislav
How i can to remove only the "chapter" word and leave the chapter numbering.

Re: Avoid Chapter numbering of some topics

Posted: Wed Sep 12, 2018 11:53 am
by Dan
Hello Stanislav,

Please check this topic from the urser-guide: ... ntent.html

Many regards,

Re: Avoid Chapter numbering of some topics

Posted: Fri Sep 14, 2018 3:00 pm
by Stanislav
Hello Dan.
This example does not work. The word Chapter is not removed

Re: Avoid Chapter numbering of some topics

Posted: Mon Sep 17, 2018 10:27 am
by Dan
Can you send us your CSS to our support email address?
Thank you, Dan