[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook] How do I center <bridgehead> text?
[I'm redirecting this to the docbook-apps mailing list where such questions are usually handled] The bridgehead template calls the same "section.heading" template that is used by other section titles. You can customize it for centering bridgeheads as follows: <xsl:template name="section.heading"> <xsl:param name="level" select="1"/> <xsl:param name="marker" select="1"/> <xsl:param name="title"/> <xsl:param name="marker.title"/> <fo:block xsl:use-attribute-sets="section.title.properties"> <xsl:if test="$marker != 0"> <fo:marker marker-class-name="section.head.marker"> <xsl:copy-of select="$marker.title"/> </fo:marker> </xsl:if> <xsl:choose> <xsl:when test="$level=1"> <fo:block xsl:use-attribute-sets="section.title.level1.properties"> <xsl:if test="self::bridgehead"> <xsl:attribute name="text-align">center</xsl:attribute> </xsl:if> <xsl:copy-of select="$title"/> </fo:block> </xsl:when> <xsl:when test="$level=2"> <fo:block xsl:use-attribute-sets="section.title.level2.properties"> <xsl:if test="self::bridgehead"> <xsl:attribute name="text-align">center</xsl:attribute> </xsl:if> <xsl:copy-of select="$title"/> </fo:block> </xsl:when> <xsl:when test="$level=3"> <fo:block xsl:use-attribute-sets="section.title.level3.properties"> <xsl:if test="self::bridgehead"> <xsl:attribute name="text-align">center</xsl:attribute> </xsl:if> <xsl:copy-of select="$title"/> </fo:block> </xsl:when> <xsl:when test="$level=4"> <fo:block xsl:use-attribute-sets="section.title.level4.properties"> <xsl:if test="self::bridgehead"> <xsl:attribute name="text-align">center</xsl:attribute> </xsl:if> <xsl:copy-of select="$title"/> </fo:block> </xsl:when> <xsl:when test="$level=5"> <fo:block xsl:use-attribute-sets="section.title.level5.properties"> <xsl:if test="self::bridgehead"> <xsl:attribute name="text-align">center</xsl:attribute> </xsl:if> <xsl:copy-of select="$title"/> </fo:block> </xsl:when> <xsl:otherwise> <fo:block xsl:use-attribute-sets="section.title.level6.properties"> <xsl:if test="self::bridgehead"> <xsl:attribute name="text-align">center</xsl:attribute> </xsl:if> <xsl:copy-of select="$title"/> </fo:block> </xsl:otherwise> </xsl:choose> </fo:block> </xsl:template> </xsl:stylesheet> For each section level, after starting an fo:block with the section level properties, it tests to see if the current context element is a bridgehead, and if so, adds a text-align="center" property. Bob Stayton Sagehill Enterprises DocBook Consulting bobs@sagehill.net ----- Original Message ----- From: Sheldon Plankton To: docbook@lists.oasis-open.org Sent: Monday, September 10, 2007 9:07 AM Subject: [docbook] How do I center <bridgehead> text? I am using docbook to generate PDFs. I was wondering if anyone could help customize a style sheet that would center the text of my bridgehead templates? Do I need to make and modifiy a copy of the bridgehead template or should I modify the title template or a <sectN> template and use my the renderas attribute with my bridgehead template? Thanks! BTW. I hope this is not a cross post as I thought I had sent this email yesterday but I only got a OOO response from someone at Transitive ???
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]