Page 1 of 1

Display title in the line center

Posted: Mon Sep 20, 2021 2:05 pm
by Kot_1977
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!

Re: Display title in the line center

Posted: Tue Sep 21, 2021 12:35 pm
by Kot_1977
I found a solution:
instead of
<xsl:apply-templates/>
insert
<xsl:apply-templates select="." mode="processTopicTitle"/>

Re: Display title in the line center

Posted: Tue Sep 21, 2021 2:17 pm
by Radu
Hi,

Thanks for sharing the solution, sorry for not replying to this sooner.

Regards,
Radu