This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] page jumps


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday June 28 2004 18:17, Pupeno wrote:
> On Wednesday June 23 2004 04:59, Bob Stayton wrote:
> > Take a look at the match="book" template in fo/division.xsl.  You will
> > see that it starts a page sequence for each kind of contents listing. 
> > You'll have to copy that template and remove those fo:page-sequence
> > wrappers to prevent new page sequences.  And you thought the "chapter"
> > template was long.  8^)
>
> oK, trying to achieve this I've found this:
At the end, I managed to do it.
Here's how if anyone care (and for the record):
	<!-- Start code to avoid page jumps between tables -->
	<xsl:template match="book">
		<xsl:variable name="id">
			<xsl:call-template name="object.id"/>
		</xsl:variable>
	
		<xsl:variable name="preamble"
									select="title|subtitle|titleabbrev|bookinfo"/>
	
		<xsl:variable name="content"
									select="*[not(self::title or self::subtitle
															or self::titleabbrev
															or self::bookinfo)]"/>
	
		<xsl:variable name="titlepage-master-reference">
			<xsl:call-template name="select.pagemaster">
				<xsl:with-param name="pageclass" select="'titlepage'"/>
			</xsl:call-template>
		</xsl:variable>
	
		<xsl:variable name="lot-master-reference">
			<xsl:call-template name="select.pagemaster">
				<xsl:with-param name="pageclass" select="'lot'"/>
			</xsl:call-template>
		</xsl:variable>
	
		<xsl:if test="$preamble">
			<fo:page-sequence hyphenate="{$hyphenate}"
												master-reference="{$titlepage-master-reference}"
												initial-page-number="1">
				<xsl:attribute name="language">
					<xsl:call-template name="l10n.language"/>
				</xsl:attribute>
				<xsl:attribute name="format">
					<xsl:call-template name="page.number.format"/>
				</xsl:attribute>
				<xsl:if test="$double.sided != 0">
					<xsl:attribute name="initial-page-number">auto-odd</xsl:attribute>
				</xsl:if>
	
				<xsl:attribute name="hyphenation-character">
					<xsl:call-template name="gentext">
						<xsl:with-param name="key" select="'hyphenation-character'"/>
					</xsl:call-template>
				</xsl:attribute>
				<xsl:attribute name="hyphenation-push-character-count">
					<xsl:call-template name="gentext">
						<xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
					</xsl:call-template>
				</xsl:attribute>
				<xsl:attribute name="hyphenation-remain-character-count">
					<xsl:call-template name="gentext">
						<xsl:with-param name="key" 
select="'hyphenation-remain-character-count'"/>
					</xsl:call-template>
				</xsl:attribute>
	
				<xsl:apply-templates select="." mode="running.head.mode">
					<xsl:with-param name="master-reference" 
select="$titlepage-master-reference"/>
				</xsl:apply-templates>
	
				<xsl:apply-templates select="." mode="running.foot.mode">
					<xsl:with-param name="master-reference" 
select="$titlepage-master-reference"/>
				</xsl:apply-templates>
	
				<fo:flow flow-name="xsl-region-body">
					<fo:block id="{$id}">
						<xsl:call-template name="book.titlepage"/>
					</fo:block>
				</fo:flow>
			</fo:page-sequence>
		</xsl:if>
	
		<xsl:apply-templates select="dedication" mode="dedication"/>
	
		<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>
		
		<!-- HERE STARTS THE REAL CHANGES -->
		<fo:page-sequence hyphenate="{$hyphenate}" format="i" 
master-reference="{$lot-master-reference}">
			<xsl:attribute name="language">
				<xsl:call-template name="l10n.language"/>
			</xsl:attribute>
			<xsl:attribute name="format">
				<xsl:call-template name="page.number.format">
					<xsl:with-param name="element" select="'toc'"/>
				</xsl:call-template>
			</xsl:attribute>
			<xsl:if test="$double.sided != 0">
				<xsl:attribute name="initial-page-number">auto-odd</xsl:attribute>
			</xsl:if>
	
			<xsl:attribute name="hyphenation-character">
				<xsl:call-template name="gentext">
					<xsl:with-param name="key" select="'hyphenation-character'"/>
				</xsl:call-template>
			</xsl:attribute>
			<xsl:attribute name="hyphenation-push-character-count">
				<xsl:call-template name="gentext">
					<xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
				</xsl:call-template>
			</xsl:attribute>
			<xsl:attribute name="hyphenation-remain-character-count">
				<xsl:call-template name="gentext">
					<xsl:with-param name="key" 
select="'hyphenation-remain-character-count'"/>
				</xsl:call-template>
			</xsl:attribute>

			<!-- Note: this were custom templates for the table of contents, but now, 
they'll be used for all the tables -->
			<xsl:apply-templates select="." mode="running.head.mode">
				<xsl:with-param name="master-reference" select="$lot-master-reference"/>
				<xsl:with-param name="gentext-key" select="'TableofContents'"/>
			</xsl:apply-templates>
	
			<xsl:apply-templates select="." mode="running.foot.mode">
				<xsl:with-param name="master-reference" select="$lot-master-reference"/>
				<xsl:with-param name="gentext-key" select="'TableofContents'"/>
			</xsl:apply-templates>
			
			<fo:flow flow-name="xsl-region-body">			
				<xsl:if test="contains($toc.params, 'toc')">
					<xsl:call-template name="division.toc"/>
				</xsl:if>
				<xsl:if test="contains($toc.params,'figure') and .//figure">
					<xsl:call-template name="list.of.titles">
						<xsl:with-param name="titles" select="'figure'"/>
						<xsl:with-param name="nodes" select=".//figure"/>
					</xsl:call-template>
				</xsl:if>
				<xsl:if test="contains($toc.params,'table') and .//table">
					<xsl:call-template name="list.of.titles">
						<xsl:with-param name="titles" select="'table'"/>
						<xsl:with-param name="nodes" select=".//table"/>
					</xsl:call-template>
				</xsl:if>
				<xsl:if test="contains($toc.params,'example') and .//example">
					<xsl:call-template name="list.of.titles">
						<xsl:with-param name="titles" select="'example'"/>
						<xsl:with-param name="nodes" select=".//example"/>
					</xsl:call-template>
				</xsl:if>	
				<xsl:if test="contains($toc.params,'equation') and .//equation">
					<xsl:call-template name="list.of.titles">
						<xsl:with-param name="titles" select="'equation'"/>
						<xsl:with-param name="nodes" select=".//equation[title]"/>
					</xsl:call-template>
				</xsl:if>	
				<xsl:if test="contains($toc.params,'procedure') and .//procedure">
					<xsl:call-template name="list.of.titles">
						<xsl:with-param name="titles" select="'procedure'"/>
						<xsl:with-param name="nodes" select=".//procedure[title]"/>
					</xsl:call-template>
				</xsl:if>
			</fo:flow>
		</fo:page-sequence>	
		<xsl:apply-templates select="$content"/>
	</xsl:template>

I'll make my whole xsl customization layer public when I make public my doc.
- -- 
Pupeno: pupeno@pupeno.com - http://www.pupeno.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA4JMPfW48a9PWGkURAgVaAKCJMLvX9lJ32XchyaRQQd3s22/EbQCeMw6y
IrifuxalcF0QUZBiouMDgrs=
=RfQZ
-----END PGP SIGNATURE-----

To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]