[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Page before inside title
I have a solution to customize a 'half title' page. This 'book.titlepage.before.recto' generates the book title, and includes a variable 'halftitle' which turns on/off the titlepage.before.recto: <xsl:template name="book.titlepage.before.recto"> <xsl:if test="$halftitle != 0"> <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="booktitleprops"> <xsl:attribute name="space-before"> <xsl:value-of select="$halftitlespacebefore"/> </xsl:attribute> <xsl:apply-templates mode="book.titlepage.recto.mode" select="d:bookinfo/d:title|d:info/d:title|d:title"/> </fo:block> </xsl:if> </xsl:template> And the verso always generates, even if there is no content (I specify content for this with d:cover[@role='halftitle']): <xsl:template name="book.titlepage.before.verso"> <xsl:if test="$halftitle != 0"> <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="book.titlepage.verso.style" break-before="page" break-after="odd-page"> <xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="d:info/d:cover[@role='halftitle']"/> </fo:block> </xsl:if> </xsl:template> But I also had to modify 'book.titlepage' to get the order of templates and page breaks correct - the standard template generates content in 'book.titlepage.before.verso' after 'book.titlepage.recto', which is incorrect order. <xsl:template name="book.titlepage"> <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format"> <!--<xsl:variable name="recto.content"> <xsl:call-template name="book.titlepage.before.recto"/> <xsl:call-template name="book.titlepage.recto"/> </xsl:variable>--> <!--halftitle order added 5/10/12:--> <xsl:variable name="halftitle.content"> <xsl:call-template name="book.titlepage.before.recto"/> <xsl:call-template name="book.titlepage.before.verso"/> </xsl:variable> <!--end mod--> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($halftitle.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($halftitle.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($halftitle.content) != '') or ($recto.elements.count > 0)"> <fo:block><xsl:copy-of select="$halftitle.content"/></fo:block> </xsl:if> <!--<xsl:variable name="verso.content"> <xsl:call-template name="book.titlepage.before.verso"/> <xsl:call-template name="book.titlepage.verso"/> </xsl:variable>--> <!--title order added 5/10/12:--> <xsl:variable name="titlepage.content"> <xsl:call-template name="book.titlepage.recto"/> <fo:block break-after="page"/><!--force titlepage verso to start on next page ****OK 5/10/12--> <xsl:call-template name="book.titlepage.verso"/> </xsl:variable> <!--end mod--> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($titlepage.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($titlepage.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($titlepage.content) != '') or ($verso.elements.count > 0)"> <fo:block><xsl:copy-of select="$titlepage.content"/></fo:block> </xsl:if> <xsl:call-template name="book.titlepage.separator"/> </fo:block> </xsl:template> Dave On 01-10-12 11:50 AM, Bob Stayton wrote: Hi Dick, |
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]