Page 1 of 1
Chapter and Topic Nesting
Posted: Thu Jan 19, 2023 8:00 am
by SunilCP
There is a map/ ditamap as follows :
image.png
When I add this as a chapter in bookmap and generate the PDF using css transformation, the output is as follows:
image.png
I wanted all the topics nested under the ditamap to be under one chapter "Introduction"
All the topics are set to @is-chapter = true, so all the topics are considered as chapters.
How to change the css to ensure that these topics are not considered as chapters, any thoughts?
Re: Chapter and Topic Nesting
Posted: Thu Jan 19, 2023 11:33 am
by julien_lacour
Hello,
This is a normal behavior, if you take a look at the
DITA Specification for <mapref> element (same as setting format="ditamap") you will find:
The hierarchy of the referenced map is merged into the container map at the position of the reference...
One solution to create an additional level is to add a <topichead> element into the referred map:
Code: Select all
<map>
<topichead navtitle="Introduction">
<topicref href="installation_process_and_deliverables.dita"/>
<topicref href="system_and_bios_requirements.dita"/>
<topicref href="installation_process_and_deliverables.dita"/>
<topicref href="installation_process_and_deliverables.dita"/>
</topichead>
</map>
Regards,
Julien
Re: Chapter and Topic Nesting
Posted: Thu Jan 19, 2023 2:52 pm
by chrispitude
Building on Julien's suggestion, you can place the
in either the submap file:
Code: Select all
<!-- chapter_submap.ditamap -->
<map>
<topichead navtitle="Introduction">
<topicref href="installation_process_and_deliverables.dita"/>
<topicref href="system_and_bios_requirements.dita"/>
<topicref href="installation_process_and_deliverables.dita"/>
<topicref href="installation_process_and_deliverables.dita"/>
</topichead>
</map>
or in the top-level map file:
Code: Select all
<!-- top.ditamap -->
<map>
<topichead navtitle="Introduction">
<mapref href="chapter_submap.ditamap"/>
</topichead>
</map>
In either case (heading in the top-level map or in the submap), you can use a topic file instead of a
<topichead> to provide the heading:
Code: Select all
<!-- chapter_submap.ditamap -->
<map>
<topicref href="introduction.dita">
<topicref href="installation_process_and_deliverables.dita"/>
<topicref href="system_and_bios_requirements.dita"/>
<topicref href="installation_process_and_deliverables.dita"/>
<topicref href="installation_process_and_deliverables.dita"/>
</topicref>
</map>
Code: Select all
<!-- top.ditamap -->
<map>
<topicref href="introduction.dita">
<mapref href="chapter_submap.ditamap"/>
</topicref>
</map>
This provides an opportunity to provide a chapter abstract, brief overview of the content, etc.
Re: Chapter and Topic Nesting
Posted: Mon Jan 23, 2023 2:38 pm
by SunilCP
Thanks for the suggestions. It works.