【问题标题】:How to use navtitle from parent topicref instead of child one during generating pdf by dita-ot如何在通过dita-ot生成pdf时使用父topicref中的navtitle而不是child one
【发布时间】:2015-07-08 23:32:11
【问题描述】:

我正在使用dita-ot工具将dita转换为pdf。

我有这样的父 ditamap 文件:

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

和 2 个子 ditamap 文件

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>

在结果 pdf 中我有 somth。像这样:

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

但我想要这个:

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

我怎样才能实现它?

【问题讨论】:

    标签: dita dita-ot


    【解决方案1】:

    是的,另一种可能性是在您的主 DITA 映射中,您可以参考您的辅助映射,例如:

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

    secondary.ditamap 将只有一个一级主题引用,例如:

       <!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>
    

    【讨论】:

      【解决方案2】:

      对 DITA 映射的引用在目录中是透明的,它不会为其添加额外的标题和级别。 你想要的可以像这样实现:

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

      问候, 拉度

      【讨论】:

      • 感谢您的回答。您的意思是我必须将 topicref 包装在 topichead 的父 ditamap 文件中吗?
      猜你喜欢
      • 1970-01-01
      • 2016-10-18
      • 2021-05-19
      • 2017-12-04
      • 2014-04-16
      • 1970-01-01
      • 2016-06-16
      • 2017-06-01
      • 2015-06-07
      相关资源
      最近更新 更多