DITA OT中更容易的主题编号?

时间:2013-02-26 22:37:15

标签: dita dita-ot

如何在DITA OT中添加PDF输出中的主题部分编号?我的意思是这样编号:

1. Heading

     Some content

1.2. Heading

     Some more content

1.2.1. Heading

     Some further content
编辑:我意识到,我的问题有点不清楚。我的意思是说主题编号(意思是比一般意义上的部分而不是作为DITA元素的部分)。另外,我知道如何在代码中执行此操作,但是想知道我是否通过DITA OT中的简单配置错过了一些更简单的方法 - 比如打开或关闭参数或其他东西。这是一个常见的请求,它应该比不断修改这样的样式表更容易:

http://tech.groups.yahoo.com/group/dita-users/message/18417

2 个答案:

答案 0 :(得分:2)

您可以使用DITA-OT PDF plug-in generator,它有一个用于对所有层次结构级别进行编号的开关。 DITA-OT没有为此提供单独的配置属性,因为将内置配置集保持较小更有意义。

答案 1 :(得分:1)

这就是我的工作。 CSS:

body { counter-reset: H1; }     /* Create the counter for H1 */
h1:before {
  content: counter(H1) ". ";    /* Print the H1 number */
  counter-increment: H1;    /* Add 1 to next H1 */
 }
h1 { counter-reset: H2; }
h2:before {
  content: counter(H1) "." counter(H2) " ";
  counter-increment: H2;
}
h2 { counter-reset: H3; }
h3:before {
  content: counter(H1) "." counter(H2) "." counter(H3) " ";
  counter-increment:H3;

然后渲染到XHTML(分块到单个页面)并将网页转换为PDF。可能不是规范方法,但它有效。

相关问题