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"] {
bookmark-label:none;
}
/* 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.