DITA-OT输出PDF的样式设计

一个section,如果没有title元素,就不会应用title的样式,比如划线 xsl-fo没有专门的换行方法,可以加

<fo:block />

<p /><p /><p /><p /><p />

可以生成一点空白 <p>&#160;</p>这样的空白更大些,没有内容段落会小些。

Fo:block 带有的start-indent会传递到其下级标签中去。

http://www.ibm.com/developerworks/library/x-xslfo2app/#br 这里有一些把html标签转换为xsl-fo的方法

给一个元素使用特定格式的方法: 给该元素加outputclass属性,指定一个名字,如:

    <section id="copyright" outputclass="a_center_section">

override处理该元素的模板,加上这个条件,可写在custom.xsl里面:

    <!-- a centered section -->
    <xsl:template match="*[contains(@class,' topic/section ') and contains(@outputclass, 'a_center_section')]">
        <fo:block xsl:use-attribute-sets="__section__center">
            <xsl:call-template name="commonattributes"/>

            <xsl:apply-templates/>
        </fo:block>
    </xsl:template>

指定这个属性集:xsl:use-attribute-sets="__section__center",可写在custom.xsl里面:

    <!-- attribute-set to center a section -->
    <xsl:attribute-set name="__section__center">
        <xsl:attribute name="text-align">center</xsl:attribute>
    </xsl:attribute-set>

此处,章及节的标题都只是标题,没有真正的dita文件。使用topicheadtopichead也可以嵌套。

    <chapter navtitle="Installation">
        <topichead>
            <topicmeta><navtitle>Software Installation</navtitle></topicmeta>
            <topicref href="software-installation-overview.dita" />
        </topichead>
    </chapter>