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] Blank pages and title formatting in XSL-FO


> 1) How to remove blank pages from double-sided output

Blank pages in FO are typically created to satisfy constraints set on the
<fo:page-sequence/> objects by the initial-page-number and force-page-count
attributes (IIRC, the DocBook stylesheets typically use initial-page-number
rather than force-page-count).  The stylesheets make <fo:page-sequence/>
objects for chapters, articles, and the "front-matter" (titlepage, TOC,
etc.) for books or parts (maybe refentry, too).  So, the easiest way for you
to customize this is probably to find the template (in division.xsl or
component.xsl) that sets the attribute 'initial-page-number', copy it into
your customization layer, and remove the part that sets that attribute.

> 
> 2)How to modify the way chapter and section titles
> appear. If possible, I'd like them to look something
> like this:
> 
> 				Chapter 1
> _________________________________________
> Introduction
> 
> 1.1
> ___
> Assumptions 

This is a little tricky.  The titlepages are all created using a pretty
nifty customization method documented at
http://www.sagehill.net/docbookxsl/HtmlCustomEx.html#HTMLTitlePage.  The
default titlepage template for a 'chapter' in the FO stylesheets calls a
named template called 'component.title'.  This named template eventually
accesses the gentext mechanism to pull out 'Chapter <number/>. <title/>'.  I
think your best bet (for chapter) is to change that to call a different
named template (such as chapter.title instead of component.title) and to
have that template be something like this:

<xsl:template name="chapter.title">
 <fo:block text-align="center">
  <xsl:apply-templates mode="label.markup"/>
 </fo:block>
 <fo:block border-top-style="solid">
  <xsl:copy-of select="title"/>
 </fo:block>
</xsl:template>

Your other option for chapter is to modify the component.title template to
include a test for the node parameter being a chapter, then doing the above.
Unfortunately, you can't use apply-imports inside of a named template, so
you have to copy the existing component.title template (from component.xsl)
and put the existing part inside of an xsl:choose, as in:

<xsl:template name="component.title">
 <!-- copy variable definition from existing -->
 <xsl:choose>
  <xsl:when test="local-name($node) = 'chapter'">
   <!-- Do what I did above in chapter.title -->
  </xsl:when>
  <xsl:otherwise>
   <!-- Copy remainder of existing template -->
  </xsl:otherwise>
 </xsl:choose>
</xsl:template>

Doing what you want for sections is *much* easier because there isn't the
extra confusion caused by the named template.  You can just write a template
that matches section in the titlepage.mode and have it look like the
chapter.title above.

> I'm using Epic Editor 4.3.1, which uses a slightly
> outdated version of DocBook (most of the files date
> from 2002).

That shouldn't be a problem.  I'm using a much older version of Epic (3.1)
with a much more outdated version of the DTD and haven't had any problems
with the stylesheets.

> Any help would be much appreciated.
> 
> Thanks,
> kary
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
> 
> To unsubscribe from this list, send a post to 
> docbook-apps-unsubscribe@lists.oasis-open.org.
> 
> 
> 

To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org.


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