DITA-OT输出PDF的样式设计

这里很乱,有空再整理

基本搞出来 了章节目录编号的问题。

这样的结果是section的标题也有了和topic标题一样的编号,再加一个模板,然后在section.title里调用 这个没有num的标题:

<!-- getNonumTitle template is a copy of the original getTitle template that will be used for titles that should     not be numbered. -->

<xsl:template name="getNonumTitle"><!-- get fully-processed title content by whatever mechanism -->
    <xsl:choose>
        <!-- add keycol here once implemented-->
        <xsl:when test="@spectitle">
            <xsl:value-of select="@spectitle"/>
        </xsl:when>
        <xsl:otherwise>
            <xsl:apply-templates/>
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>
<!-- section title with no num. let it use getNonumTitle, rather than getTitle -->
    <xsl:template match="*[contains(@class,' topic/section ')]/*[contains(@class,' topic/title ')]">
        <fo:block xsl:use-attribute-sets="section.title">
            <xsl:call-template name="commonattributes"/>
            <xsl:apply-templates select="." mode="getNonumTitle"/>
        </fo:block>
    </xsl:template>

改写样式时,应该把原来的样式声明行完全照抄下来,然后再改,否则没用,参见:

<xsl:attribute-set name="topic.topic.title" use-attribute-sets="common.title common.border__bottom">
    <xsl:attribute name="border-bottom-style">none</xsl:attribute>

或者此说也不确,而是bootom-style起作用了?

text-indent 仅为文字的第一行,而start-indent是全部:

    <xsl:attribute-set name="p" use-attribute-sets="common.block">
        <xsl:attribute name="text-indent">0em</xsl:attribute>
        <xsl:attribute name="start-indent">30mm</xsl:attribute>
    </xsl:attribute-set>

space-before是块上面的空间,magine没用,padding是块内与文字间的距离:

<xsl:attribute-set name="section.title" use-attribute-sets="common.title common.border__top">
        <xsl:attribute name="font-weight">bold</xsl:attribute>
        <xsl:attribute name="space-before">5mm</xsl:attribute>
    <xsl:attribute name="padding-top">0pt</xsl:attribute>
    <xsl:attribute name="magin-top">0pt</xsl:attribute>
<!-- section title, add border on top, and space on top 5mm -->
<xsl:attribute-set name="section.title" use-attribute-sets="common.title common.border__top">

<!-- image block start indent -->
    <xsl:attribute-set name="image__block">

<!-- image title start indent -->
    <xsl:attribute-set name="fig.title" use-attribute-sets="base-font common.title">

有关表格的设置在单独的文件中:

DITA-OT1.8\plugins\org.dita.pdf2\cfg\fo\attrs\tables-attr.xsl

有关列表的设置也有单独的文件: DITA-OT1.8\plugins\org.dita.pdf2\cfg\fo\attrs\lists-attr.xsl