[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Force TOC and Chapter 1 on odd pages with $double.sided=0
On 10/2/06, Jerry Janofsky <JanofskyJ@comcast.net> wrote:
> Right now I have a single page title page and a single page table of
> contents. The TOC gets placed on the back of the title page. Is there a
> template I can override to force the TOC and chapter 1 to begin on an odd
> page?
Here's how I do it, by rewriting the initial-page-number template:
[look for the 'toc' line]
<xsl:template name="initial.page.number">
<xsl:param name="element" select="local-name(.)"/>
<xsl:param name="master-reference" select="''"/>
<xsl:choose>
<!-- double-sided output -->
<xsl:when test="$double.sided != 0">
<xsl:choose>
<xsl:when test="$element = 'toc'">5</xsl:when>
<xsl:when test="$element = 'book'">1</xsl:when>
<xsl:when test="$element = 'preface'">auto-odd</xsl:when>
<xsl:when test="$element = 'part'
and not(preceding::chapter)
and not(preceding::part)">1</xsl:when>
<xsl:when test="($element = 'dedication' or $element = 'article')
and not(preceding::chapter
or preceding::preface
or preceding::appendix
or preceding::article
or preceding::dedication
or parent::part
or parent::reference)">1</xsl:when>
<xsl:when test="($element = 'chapter' or $element = 'appendix')
and not(preceding::chapter
or preceding::appendix
or preceding::article
or preceding::dedication
or parent::part
or parent::reference)">1</xsl:when>
<xsl:otherwise>auto</xsl:otherwise>
</xsl:choose>
</xsl:when>
<!-- single-sided output -->
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$element = 'toc'">auto</xsl:when>
<xsl:when test="$element = 'book'">1</xsl:when>
<xsl:when test="$element = 'preface'">auto</xsl:when>
<xsl:when test="$element = 'part'
and not(preceding::chapter)
and not(preceding::part)">1</xsl:when>
<xsl:when test="($element = 'dedication' or $element = 'article')
and not(preceding::chapter
or preceding::preface
or preceding::appendix
or preceding::article
or preceding::dedication
or parent::part
or parent::reference)">1</xsl:when>
<xsl:when test="($element = 'chapter' or $element = 'appendix')
and not(preceding::chapter
or preceding::appendix
or preceding::article
or preceding::dedication
or parent::part
or parent::reference)">1</xsl:when>
<xsl:otherwise>auto</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
HTH,
Keith
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]