Alex Assange
Alex Assange

Reputation: 11

How to use navtitle from parent topicref instead of child one during generating pdf by dita-ot

I'm using dita-ot tool to convert dita to pdf.

I have parent ditamap file like this:

<topicref href="111.ditamap" navtitle="Parent title 111" format="ditamap">
...
</topicref>
<topicref href="222.ditamap" navtitle="Parent title 222" format="ditamap">
...
</topicref>

and 2 child ditamap files

111.ditamap:

<topicref navtitle="Child title 111" format="ditamap">
   Child content 111
</topicref>

222.ditamap:

<topicref navtitle="Child title 222" format="ditamap">
   Child content 222
</topicref>

In the result pdf I have somth. like this:

...
Child title 111
   Child content 111
Child title 222
   Child content 222
...

but I'd like to have this:

...
Parent title 111
   Child content 111
Parent title 222
   Child content 222

How can I achieve it?

Upvotes: 1

Views: 210

Answers (2)

Radu Coravu
Radu Coravu

Reputation: 1924

Yes, another possibility would be that in your main DITA map you could refer to your secondary map like:

  <topicref href="secondary.ditamap" format="ditamap">
   ...
  </topicref>

and the secondary.ditamap would have only one first level topicreference like:

   <!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
  <map>
   <title>DITA Topic Map</title>
   <topicref href="installation.dita">
    <topicref href="linux-installation.dita"/>
    ..........
   </topicref>
  </map>

Upvotes: 0

Radu Coravu
Radu Coravu

Reputation: 1924

A reference to a DITA Map is transparent in the table of contents, it does not add an extra title and level to it. What you want could be achieved like:

     <topichead navtitle="Parent title 111">
      <topicref href="111.ditamap" format="ditamap">
       ...
      </topicref>
     </topichead>

Regards, Radu

Upvotes: 1

Related Questions