OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook] Journal article title pages


Bob

Not seeing any effect. I wonder if I misunderstood what I should do:
  1. copy the initial.page.number template (about 60 lines) from fo/pagesetup.xsl to my customisation layer;
  2. insert your <xsl:when> element as the first child of the <xsl:choose> element inside the <xsl:when test="$double.sided != 0"> element.
I take it that the jump to an odd page is governed by the <xsl:otherwise>auto-odd</xsl:otherwise> that is the last child of the double-sided <xsl:choose>; and I infer that execution is following this path, (a) because I'm getting a gutter on the left of odd pages and the right of even pages and (b) because I have this problem to solve in the first place. 

I've attached my customisation layer in case you can spot something else I'm doing that obstructs your solution.

Once more, deeply grateful for your advice

Stephen



2008/9/11 Bob Stayton <bobs@sagehill.net>
Hi,
This documentation describes how to customize the template named initial.page.number to set the starting page number for a page-sequence (each article is a page-sequence). 
 
 
If you add:
 
<xsl:when test="$element = 'article'">auto</xsl:when>
 
then articles should start on the next available page.
 
Bob Stayton
Sagehill Enterprises
bobs@sagehill.net
 
 
----- Original Message -----
Sent: Thursday, September 11, 2008 8:17 AM
Subject: [docbook] Journal article title pages

My journal is a book, its children articles. Articles start by default on recto pages, but recto or verso both work for me; I don't want the blank pages.

What small intervention can I make to allow articles to start on verso pages when available?

Stephen Taylor


<?xml version="1.0"?>
<xsl:stylesheet
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
     xmlns:fo="http://www.w3.org/1999/XSL/Format";
     xmlns:d="http://docbook.org/ns/docbook";
		 exclude-result-prefixes="d"
     version="1.0">

<!--
			DocBook 5.0 customisation layer for print version of Vector
			Stephen Taylor • sjt@5jt.com
-->

	<!-- use local copies of DocBook 5.0 stylesheets -->
	<xsl:import href="../../docbook-xsl-ns-1.74.0/fo/docbook.xsl"/>
	<!-- use custom titlepage templates -->
	<xsl:import href="titlepages.xsl"/>


	<!-- LAYOUT -->
	<!-- page size, orientation and layout -->
	<xsl:param name="paper.type">A5</xsl:param>

	<xsl:param name="double.sided" select="1"></xsl:param>
	<xsl:param name="page.margin.inner">0.75in</xsl:param>
	<xsl:param name="page.margin.outer">0.5in</xsl:param>

	<xsl:param name="page.margin.top">0.25in</xsl:param>
	<xsl:param name="page.margin.bottom">0.25in</xsl:param>

	<xsl:param name="body.start.indent">0pt</xsl:param>

	<!-- 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>


	<!-- TYPEFACES -->

	<!-- body type -->
	<xsl:param name="body.font.family">Palatino</xsl:param>
	<xsl:param name="body.font.master">9.23</xsl:param>
	<xsl:param name="line-height">1.25</xsl:param>

	<xsl:param name="body.font.size">
		<xsl:value-of select="$body.font.master"></xsl:value-of><xsl:text>pt</xsl:text>
	</xsl:param>

	<xsl:param name="monospace.font.family">APL385 Unicode</xsl:param>
	<xsl:param name="monospace.font.size">
		<xsl:value-of select="$body.font.master"></xsl:value-of><xsl:text>pt</xsl:text>
	</xsl:param>

	<xsl:param name="title.font.family">Palatino</xsl:param>

	<!-- HEADERS -->
	<xsl:attribute-set name="header.content.properties">
	  <xsl:attribute name="font-family">Arial</xsl:attribute>
	  <xsl:attribute name="font-weight">bold</xsl:attribute>
	  <xsl:attribute name="margin-left">
	    <xsl:value-of select="$title.margin.left"></xsl:value-of>
	  </xsl:attribute>
	</xsl:attribute-set>

	<!-- monospace -->
	<xsl:attribute-set name="monospace.properties">
	  <xsl:attribute name="font-family">
	    <xsl:value-of select="$monospace.font.family"></xsl:value-of>
	  </xsl:attribute>
		<!-- WATCH OUT: fixes size of ALL monospace type throughout document -->
	  <xsl:attribute name="font-size">8pt</xsl:attribute>
	</xsl:attribute-set>

	<xsl:attribute-set name="normal.para.spacing">
	  <xsl:attribute name="space-before.optimum">0em</xsl:attribute>
	  <xsl:attribute name="space-before.minimum">0em</xsl:attribute>
	  <xsl:attribute name="space-before.maximum">0em</xsl:attribute>
	  <xsl:attribute name="space-after.optimum">0.8em</xsl:attribute>
	  <xsl:attribute name="space-after.minimum">0.5em</xsl:attribute>
	  <xsl:attribute name="space-after.maximum">1.0em</xsl:attribute>
	</xsl:attribute-set>

	<xsl:attribute-set name="blockquote.properties">
		<xsl:attribute name="margin-left">0.25in</xsl:attribute>
		<xsl:attribute name="margin-right">0.25in</xsl:attribute>
		<xsl:attribute name="space-after.minimum">0.5em</xsl:attribute>
		<xsl:attribute name="space-after.optimum">0.8em</xsl:attribute>
		<xsl:attribute name="space-after.maximum">2em</xsl:attribute>
	</xsl:attribute-set>

	<xsl:attribute-set name="verbatim.properties">
		<xsl:attribute name="margin-left">0.10in</xsl:attribute>
	  <xsl:attribute name="space-before.minimum">0em</xsl:attribute>
	  <xsl:attribute name="space-before.optimum">0em</xsl:attribute>
	  <xsl:attribute name="space-before.maximum">0.2em</xsl:attribute>
	  <xsl:attribute name="space-after.minimum">0.8em</xsl:attribute>
	  <xsl:attribute name="space-after.optimum">1em</xsl:attribute>
	  <xsl:attribute name="space-after.maximum">1.2em</xsl:attribute>
	  <xsl:attribute name="hyphenate">false</xsl:attribute>
	  <xsl:attribute name="wrap-option">no-wrap</xsl:attribute>
	  <xsl:attribute name="white-space-collapse">false</xsl:attribute>
	  <xsl:attribute name="white-space-treatment">preserve</xsl:attribute>
	  <xsl:attribute name="linefeed-treatment">preserve</xsl:attribute>
	  <xsl:attribute name="text-align">start</xsl:attribute>
	</xsl:attribute-set>

	<!-- FIXME
	<xsl:attribute-set name="abstract.properties">
	  <xsl:attribute name="margin-left">0.0in</xsl:attribute>
	  <xsl:attribute name="margin-right">0.0in</xsl:attribute>
	</xsl:attribute-set>

	<xsl:attribute-set name="abstract.title.properties">
	  <xsl:attribute name="font-family"><xsl:value-of select="$title.fontset"></xsl:value-of></xsl:attribute>
	  <xsl:attribute name="font-weight">bold</xsl:attribute>
	  <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
	  <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
	  <xsl:attribute name="space-before.optimum"><xsl:value-of select="concat($body.font.master, 'pt')"></xsl:value-of></xsl:attribute>
	  <xsl:attribute name="space-before.minimum"><xsl:value-of select="concat($body.font.master, 'pt * 0.8')"></xsl:value-of></xsl:attribute>
	  <xsl:attribute name="space-before.maximum"><xsl:value-of select="concat($body.font.master, 'pt * 1.2')"></xsl:value-of></xsl:attribute>
	  <xsl:attribute name="hyphenate">false</xsl:attribute>
	  <xsl:attribute name="text-align">center</xsl:attribute>
	</xsl:attribute-set>
	-->

	<!-- TITLING -->
	<!-- from http://docbook.sourceforge.net/release/xsl/current/doc/fo/component.title.properties.html -->
	<xsl:attribute-set name="component.title.properties">
	  <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
	  <xsl:attribute name="space-before.optimum"><xsl:value-of select="concat($body.font.master, 'pt')"></xsl:value-of></xsl:attribute>
	  <xsl:attribute name="space-before.minimum"><xsl:value-of select="concat($body.font.master, 'pt * 0.8')"></xsl:value-of></xsl:attribute>
	  <xsl:attribute name="space-before.maximum"><xsl:value-of select="concat($body.font.master, 'pt * 1.2')"></xsl:value-of></xsl:attribute>
	  <xsl:attribute name="hyphenate">false</xsl:attribute>
	  <xsl:attribute name="text-align">
	    <!-- FIXME
	    <xsl:choose>
	      <xsl:when test="parent::article">center</xsl:when>
	      <xsl:otherwise>left</xsl:otherwise>
	    </xsl:choose>
	    -->
	    center
	  </xsl:attribute>
	  <xsl:attribute name="start-indent"><xsl:value-of select="$title.margin.left"></xsl:value-of></xsl:attribute>
	</xsl:attribute-set>

	<!-- from http://docbook.sourceforge.net/release/xsl/current/doc/fo/section.title.properties.html -->
	<xsl:attribute-set name="section.title.properties">
	  <xsl:attribute name="font-family">
	    <xsl:value-of select="$title.font.family"></xsl:value-of>
	  </xsl:attribute>
	  <xsl:attribute name="font-weight">bold</xsl:attribute>
	  <!-- font size is calculated dynamically by section.heading template -->
	  <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
	  <xsl:attribute name="space-before.minimum">1.0em</xsl:attribute>
	  <xsl:attribute name="space-before.optimum">1.3em</xsl:attribute>
	  <xsl:attribute name="space-before.maximum">1.5em</xsl:attribute>
	  <xsl:attribute name="space-after.minimum">0em</xsl:attribute>
	  <xsl:attribute name="space-after.optimum">0.3em</xsl:attribute>
	  <xsl:attribute name="space-after.maximum">0.5em</xsl:attribute>
	  <xsl:attribute name="text-align">left</xsl:attribute>
	  <xsl:attribute name="start-indent"><xsl:value-of select="$title.margin.left"></xsl:value-of></xsl:attribute>
	</xsl:attribute-set>

	<xsl:attribute-set name="section.title.level1.properties">
	  <xsl:attribute name="font-size">
	    <xsl:value-of select="$body.font.master * 1.1538"></xsl:value-of>
	    <xsl:text>pt</xsl:text>
	  </xsl:attribute>
	  <!-- FIXME - overriden?
	  <xsl:attribute name="space-before">1.3em</xsl:attribute>
	  <xsl:attribute name="space-after">0.3em</xsl:attribute>
	  -->
	</xsl:attribute-set>

	<xsl:attribute-set name="section.title.level2.properties">
	  <xsl:attribute name="font-size">
	    <xsl:value-of select="$body.font.master * 1.0"></xsl:value-of>
	    <xsl:text>pt</xsl:text>
	  </xsl:attribute>
	  <!-- FIXME - overriden?
	  <xsl:attribute name="space-before">1.3em</xsl:attribute>
	  <xsl:attribute name="space-after">0.3em</xsl:attribute>
	  -->
	</xsl:attribute-set>

	<!-- TABLES -->
	<xsl:attribute-set name="table.table.properties">
	  <xsl:attribute name="border-before-width.conditionality">retain</xsl:attribute>
	  <xsl:attribute name="border-collapse">collapse</xsl:attribute>
	  <xsl:attribute name="font-size">8pt</xsl:attribute>
	</xsl:attribute-set>


<!-- TABLE OF CONTENTS -->
<!-- from http://docbook.sourceforge.net/release/xsl/current/doc/fo/generate.toc.html -->
<xsl:param name="generate.toc">
book      toc,title
</xsl:param>

	<!-- BIBLIOGRAPHY -->
	<xsl:attribute-set name="biblioentry.properties" use-attribute-sets="normal.para.spacing">
	  <xsl:attribute name="start-indent">0.5in</xsl:attribute>
	  <xsl:attribute name="text-indent">-0.2in</xsl:attribute>
	  <xsl:attribute name="font-size">8pt</xsl:attribute>
	  <xsl:attribute name="text-align">left</xsl:attribute>
	</xsl:attribute-set>

	<!-- MISCELLANEOUS -->
	<xsl:param name="bibliography.numbered">1</xsl:param>
	<xsl:param name="chapter.autolabel">0</xsl:param>
	<xsl:param name="draft.watermark.image">C:\pub\draft.png</xsl:param>
	<xsl:param name="default.image.width">4.5in</xsl:param>
	<xsl:param name="sidebar.float.type">left</xsl:param>

	<!-- HEADERS & FOOTERS -->

	<!-- from http://docbook.sourceforge.net/release/xsl/current/doc/fo/header.rule.html -->
	<xsl:param name="header.rule">1</xsl:param>
	<!-- from fo/pagesetup.xsl -->
	<xsl:template name="header.content">
	  <xsl:param name="pageclass" select="''"/>
	  <xsl:param name="sequence" select="''"/>
	  <xsl:param name="position" select="''"/>
	  <xsl:param name="gentext-key" select="''"/>

	  <fo:block>

	    <!-- sequence can be odd, even, first, blank -->
	    <!-- position can be left, center, right -->
	    <xsl:choose>
        <!-- same for odd, even, empty, and blank sequences -->
	      <xsl:when test="$position='left'">Vector</xsl:when>
	      <xsl:when test="$position='center'">
	        <xsl:call-template name="draft.text"/>
	      </xsl:when>
	      <xsl:when test="$position='right'">Vol.23 N°4</xsl:when>
	    </xsl:choose>
	  </fo:block>
	</xsl:template>

	<!-- from http://docbook.sourceforge.net/release/xsl/current/doc/fo/footer.rule.html -->
	<xsl:param name="footer.rule">0</xsl:param>
	<!-- from fo/pagesetup.xsl -->
	<xsl:template name="footer.content">
	  <xsl:param name="pageclass" select="''"/>
	  <xsl:param name="sequence" select="''"/>
	  <xsl:param name="position" select="''"/>
	  <xsl:param name="gentext-key" select="''"/>

	  <fo:block>
	    <!-- pageclass can be front, body, back -->
	    <!-- sequence can be odd, even, first, blank -->
	    <!-- position can be left, center, right -->

	    <xsl:choose>
	      <xsl:when test="$pageclass = 'titlepage'">
	        <!-- nop; no footer on title pages -->
	      </xsl:when>
        <!-- same for odd, even, empty, and blank sequences -->
	      <xsl:when test="$position='left'"></xsl:when>
	      <xsl:when test="$position='center'"><fo:page-number/></xsl:when>
	      <xsl:when test="$position='right'"></xsl:when>
	    </xsl:choose>
	  </fo:block>
	</xsl:template>


	<xsl:template match="d:caption">
	  <fo:block>
	    <xsl:if test="@align = 'right' or @align = 'left' or @align='center'">
	      <xsl:attribute name="text-align"><xsl:value-of select="@align"/></xsl:attribute>
	    </xsl:if>
      <xsl:attribute name="font-size">
				<xsl:value-of select="$body.font.master"></xsl:value-of><xsl:text>pt</xsl:text>
      </xsl:attribute>
      <xsl:attribute name="font-style">italic</xsl:attribute>
	    <xsl:apply-templates/>
	  </fo:block>
	</xsl:template>

	<xsl:attribute-set name="sidebar.properties" use-attribute-sets="formal.object.properties">
	  <xsl:attribute name="border-style">none</xsl:attribute>
	  <xsl:attribute name="border-width">0pt</xsl:attribute>
	  <xsl:attribute name="border-color">#FFFFFF</xsl:attribute>
	  <xsl:attribute name="background-color">#DDDDDD</xsl:attribute>
	  <xsl:attribute name="padding-left">12pt</xsl:attribute>
	  <xsl:attribute name="padding-right">12pt</xsl:attribute>
	  <xsl:attribute name="padding-top">6pt</xsl:attribute>
	  <xsl:attribute name="padding-bottom">6pt</xsl:attribute>
	  <xsl:attribute name="margin-left">0pt</xsl:attribute>
	  <xsl:attribute name="margin-right">0pt</xsl:attribute>
	<!--
	  <xsl:attribute name="margin-top">6pt</xsl:attribute>
	  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
	-->
	</xsl:attribute-set>

</xsl:stylesheet>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]