Hi Critobal,
Although the DocBook stylesheet has empty placeholder templates named 
'front.cover' and 'back.cover', those are only called when processing a book 
element.

I can think of three approaches to this problem. 

1.  Create a book that contains just a book title and an article, where the 
book title matches the article title. That's valid DocBook, but it might 
produce artifacts like a table of contents and verso title page that you would 
need to turn off in the XSL, neither of which is difficult.

2.  Copy the template with match="d:article" from fo/component.xsl to your 
customization layer, add a call to 'article.front.cover' before the main 
page-sequence, and write a template by that name that generates an 
fo:page-sequence prior to the main article page-sequence.  Something like:

<xsl:template match="d:article">
  ...
  <!-- add just this line -->
  <xsl:call-template name="article.front.cover"/>
  
  <fo:page-sequence [existing sequence for the main article]
  ...
</xsl:template>

and write this template:

<xsl:template name="article.front.cover">
  <xsl:call-template name="page.sequence">
    <xsl:with-param name="content">
        [the fo:blocks that make up the content of the cover page]
    </xsl:with-param>
  </xsl:call-template>
</xsl:template> 

3.  The titlepage system for article automatically calls an empty placeholder 
template named 'article.titlepage.before.recto' that is called before the 
regular title page, but within the main page-sequence.  You could customize 
that template:

<xsl:template name="article.titlepage.before.recto">
  [the fo:blocks that make up the content of the cover page]
  <fo:block break-after="page"/>
</xsl:template>

This one needs the forced page break after it because it is included in the 
main article page-sequence.

In either case, the content needs to be specified.  The simplest would be to 
copy the article titlepage content:

<xsl:call-template name="article.titlepage.recto"/>

If you need less than that, then copy just the contents of that template from 
fo/titlepage.templates.xsl to your customized template and remove the elements 
you don't want on the cover.

Bob Stayton
Sagehill Enterprises
b...@sagehill.net


From: Cristobal Vio 
Sent: Monday, February 04, 2013 10:51 AM
To: docbook-apps@lists.oasis-open.org 
Subject: [docbook-apps] docbook article with cover


Hi there!

I'm learning to use DocBook and I was trying to figure out how to make an 
article with coverpage... Or alternatively a book without the need of chapters 
(although i think I'd prefer the first thing) The xsl stylesheet scheme seems 
so flexible that I thought it must be possible... but i was lost in tons of 
sites on xsl stylesheet discussions... 


I will continue my search, but I thought maybe i could just ask you (since you 
are the one person that surely knows that already) if it was possible and maybe 
if you had the appropriate reference for me :)

many, many thanks in advance,


Cristóbal Vio



Update: 

I've continued my search and it still isn't clear to me if I need to do a new 
xsl style or alter the dtd part concerning the article type. 


Still hoping you can answer.


Thanks in advance,


Cristóbal

Reply via email to