Display title in the line center
Posted: Mon Sep 20, 2021 2:05 pm
I use:
oXygen XML Editor 22.1, build 2020100710
transformation scenario - DITA Map PDF - based on XSL-FO
customization directory - according to oXygen's instructions
I want some topic titles to be displayed in the line center, for this purpose I use the @base attribute and this code in custom.xsl file:
<xsl:template match="title[@base='center']">
<fo:block xsl:use-attribute-sets="common.title common.border__bottom">
<xsl:attribute name="text-align">center</xsl:attribute>
<xsl:attribute name="break-before">page</xsl:attribute>
<xsl:attribute name="border-after-width">0pt</xsl:attribute>
<xsl:attribute name="space-before">0pt</xsl:attribute>
<xsl:attribute name="space-after">16pt</xsl:attribute>
<xsl:attribute name="font-size">18pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="padding-top">16pt</xsl:attribute>
<xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
But in this case toc links to the topics do not work, and page numbers are missing.
How to fix it?
Thanks in advance!
oXygen XML Editor 22.1, build 2020100710
transformation scenario - DITA Map PDF - based on XSL-FO
customization directory - according to oXygen's instructions
I want some topic titles to be displayed in the line center, for this purpose I use the @base attribute and this code in custom.xsl file:
<xsl:template match="title[@base='center']">
<fo:block xsl:use-attribute-sets="common.title common.border__bottom">
<xsl:attribute name="text-align">center</xsl:attribute>
<xsl:attribute name="break-before">page</xsl:attribute>
<xsl:attribute name="border-after-width">0pt</xsl:attribute>
<xsl:attribute name="space-before">0pt</xsl:attribute>
<xsl:attribute name="space-after">16pt</xsl:attribute>
<xsl:attribute name="font-size">18pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="padding-top">16pt</xsl:attribute>
<xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
But in this case toc links to the topics do not work, and page numbers are missing.
How to fix it?
Thanks in advance!