Display title in the line center

Kot_1977
Posts: 15
Joined: Thu Dec 10, 2020 11:00 am

Display title in the line center

Post by Kot_1977 » 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!

Kot_1977
Posts: 15
Joined: Thu Dec 10, 2020 11:00 am

Re: Display title in the line center

Post by Kot_1977 » Tue Sep 21, 2021 12:35 pm

I found a solution:
instead of
<xsl:apply-templates/>
insert
<xsl:apply-templates select="." mode="processTopicTitle"/>

Radu
Posts: 7620
Joined: Fri Jul 09, 2004 5:18 pm

Re: Display title in the line center

Post by Radu » Tue Sep 21, 2021 2:17 pm

Hi,

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

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply