[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook] Journal article title pages
[I'm also copying this to the docbook-apps mailing
list so it gets into the mail archive there]
Sorry, I forgot that there was more to it than that
when you are using double.sided output. Two other changes are needed
in that case:
- the force.page.count template must also be
customized, since it causes each article to end on an even page by default.
- the body page master must be customized to turn
off the selection of the 'body-first' simple page master when
page-position="first", because it will use the right-hand page margins for the
first page, even if it is evenly numbered. This requires defining a new
page master without the "first" page, and then customizing the template named
"select.user.pagemaster" to select it.
So here is a complete customization that does what
you need.
<xsl:template name="user.pagemasters">
<fo:page-sequence-master
master-name="body-article">
<fo:repeatable-page-master-alternatives> <fo:conditional-page-master-reference master-reference="blank" blank-or-not-blank="blank"/> <!-- <fo:conditional-page-master-reference master-reference="body-first" page-position="first"/> --> <fo:conditional-page-master-reference master-reference="body-odd" odd-or-even="odd"/> <fo:conditional-page-master-reference odd-or-even="even"> <xsl:attribute name="master-reference"> <xsl:choose> <xsl:when test="$double.sided != 0">body-even</xsl:when> <xsl:otherwise>body-odd</xsl:otherwise> </xsl:choose> </xsl:attribute> </fo:conditional-page-master-reference> </fo:repeatable-page-master-alternatives> </fo:page-sequence-master> </xsl:template>
<xsl:template name="select.user.pagemaster">
<xsl:param name="element"/> <xsl:param name="pageclass"/> <xsl:param name="default-pagemaster"/> <!-- by default, return the default. But if you've created your
own
pagemasters in user.pagemasters, you might want to select one here. --> <xsl:choose> <xsl:when test="$element = 'article'"> <xsl:value-of select="'body-article"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$default-pagemaster"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="force.page.count"> <xsl:param name="element" select="local-name(.)"/> <xsl:param name="master-reference" select="''"/> <xsl:choose>
<xsl:when test="$element = 'article'">auto</xsl:when> <!-- double-sided output --> <xsl:when test="$double.sided != 0">end-on-even</xsl:when> <!-- single-sided output --> <xsl:otherwise>no-force</xsl:otherwise> </xsl:choose> </xsl:template> <!-- from fo/pagesetup.xsl -->
<xsl:template name="initial.page.number"> <xsl:param name="element" select="local-name(.)"/> <xsl:param name="master-reference" select="''"/> <!-- Select the first content that the stylesheet
places
after the TOC --> <xsl:variable name="first.book.content" select="ancestor::d:book/*[ not(self::d:title or self::d:subtitle or self::d:titleabbrev or self::d:bookinfo or self::d:info or self::d:dedication or self::d:preface or self::d:toc or self::d:lot)][1]"/> <xsl:choose> <!-- double-sided output --> <xsl:when test="$double.sided != 0"> <xsl:choose> <!-- customisation to start article on next available page, odd or even: begin --> <xsl:when test="$element = 'article'">auto</xsl:when> <!-- customisation end --> <xsl:when test="$element = 'toc'">auto-odd</xsl:when> <xsl:when test="$element = 'book'">1</xsl:when> <!-- preface typically continues TOC roman numerals --> <!-- Change page.number.format if not --> <xsl:when test="$element = 'preface'">auto-odd</xsl:when> <xsl:when test="($element = 'dedication' or $element = 'article') and not(preceding::d:chapter or preceding::d:preface or preceding::d:appendix or preceding::d:article or preceding::d:dedication or parent::d:part or parent::d:reference)">1</xsl:when> <xsl:when test="generate-id($first.book.content) = generate-id(.)">1</xsl:when> <xsl:otherwise>auto-odd</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 = 'dedication' or $element = 'article') and not(preceding::d:chapter or preceding::d:preface or preceding::d:appendix or preceding::d:article or preceding::d:dedication or parent::d:part or parent::d:reference)">1</xsl:when> <xsl:when test="generate-id($first.book.content) = generate-id(.)">1</xsl:when> <xsl:otherwise>auto</xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:template>
|
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]