[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Deleting blank pages in chapters
Hi Dave,
I might suggest a different approach that requires
less customization. In this approach, the first chapter creates a page-sequence,
and all chapter content is placed in that single page-sequence, with just forced
page breaks in between. That lets you use the standard 'body' page-master
without modification. It would still put a blank even page at the end of
the last chapter, though. Here is what I tried:
<?xml version="1.0"
encoding="UTF-8"?>
<xsl:stylesheet xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:d="http://docbook.org/ns/docbook" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:import href=""/> <xsl:template
match="d:chapter[not(preceding-sibling::d:chapter)]">
<xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable
name="master-reference">
<xsl:call-template name="select.pagemaster"/> </xsl:variable> <xsl:call-template
name="page.sequence">
<xsl:with-param name="master-reference" select="$master-reference"/> <xsl:with-param name="content"> <!-- This
chapter's content -->
<fo:block id="{$id}" xsl:use-attribute-sets="component.titlepage.properties"> <xsl:call-template name="chapter.titlepage"/> </fo:block> <xsl:variable
name="toc.params">
<xsl:call-template name="find.path.params"> <xsl:with-param name="table" select="normalize-space($generate.toc)"/> </xsl:call-template> </xsl:variable> <xsl:if test="contains($toc.params, 'toc')"> <xsl:call-template name="component.toc"> <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/> </xsl:call-template> <xsl:call-template name="component.toc.separator"/> </xsl:if>
<xsl:apply-templates/>
<!-- and
subsequent chapters included in this page sequence
-->
<xsl:apply-templates select="following-sibling::d:chapter"/> </xsl:with-param> </xsl:call-template> </xsl:template> <!-- include subsequent chapters in first
chapter's page-sequence -->
<xsl:template match="d:chapter[preceding-sibling::d:chapter]"> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <fo:block break-before="page"/> <fo:block id="{$id}" xsl:use-attribute-sets="component.titlepage.properties"> <xsl:call-template name="chapter.titlepage"/> </fo:block> <xsl:variable
name="toc.params">
<xsl:call-template name="find.path.params"> <xsl:with-param name="table" select="normalize-space($generate.toc)"/> </xsl:call-template> </xsl:variable> <xsl:if test="contains($toc.params, 'toc')"> <xsl:call-template name="component.toc"> <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/> </xsl:call-template> <xsl:call-template name="component.toc.separator"/> </xsl:if> <xsl:apply-templates/> </xsl:template> </xsl:stylesheet>
|
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]