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] Including two title pages in a PDF file and page numbering


Hi Gabriela,
The page number format is handled by the template named 'page.number.format' in fo/pagesetup.xsl. That template is written to set the format attribute value for each page-sequence that calls it. It bases the choice on the element calling the template. Normally an article is a single page sequence, so changing the format would not be an option.

But if you are generating separate title pages, you may be generating a separate page-sequence (certainly the 'front.cover' template that I provided does). Alternatively, your title pages may be in the same article page-sequence but with forced page breaks. Since I don't know which method you are using for your article title pages, I cannot provide much specific advice.

If your title pages are generated with a call to the 'page.sequence' template as I suggested for the half title page, then that template accepts template parameters for page number format and initial page number:

<xsl:call-template name="page.sequence">
 <xsl:with-param name="format">i</xsl:with-param>
 <xsl:with-param name="initial-page-number">auto</xsl:with-param>
 <xsl:with-param name="content">
   ...

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net


From: Gabriela Simonka
Sent: Thursday, December 06, 2012 2:29 PM
To: Bob Stayton
Cc: docbook@lists.oasis-open.org
Subject: Re: [docbook] Including two title pages in a PDF file and page numbering


So now let's tackle the number format (using roman numerals for the titlepages and toc; having the first page start back at 1 ...)

What changes need to be made to the code snippet you provided me before regarding the number format for the titlepages and the toc and the reset of the pagenumber to 1 with the content?

-Gabriela


On Thu, Dec 6, 2012 at 5:07 PM, Bob Stayton <bobs@sagehill.net> wrote:

Sorry, I thought we were talking about a book, not an article. Only the book template automatically calls the 'front.cover' placeholder template.

An article does not normally have separate recto and verso title pages. Your customization must already be producing those, so you may need to extend your customization to add <xsl:call-template name="front.cover"/> to your customization so it produces the extra half title page.


Bob Stayton
Sagehill Enterprises
bobs@sagehill.net


From: Gabriela Simonka

Sent: Thursday, December 06, 2012 1:46 PM
To: Bob Stayton
Cc: docbook@lists.oasis-open.org
Subject: Re: [docbook] Including two title pages in a PDF file and page numbering



Hi Bob,

Thanks for your reply. However, I would need a little more guidance. I'm not sure I follow your suggestion completely.... I will tackle only the extra titlepage for now...



On Thu, Dec 6, 2012 at 1:14 PM, Bob Stayton <bobs@sagehill.net> wrote:


Yes, I've done this kind of half title page before. The book template calls an empty placeholder template named 'front.cover' before any other content. If you add such a template to your customization layer, it will appear before the title page. That template needs to call the template named 'page.sequence' to generate an fo:page-sequence for the extra content. Since you are already doing double sided, the new page sequence will automatically generate the blank verso page.

You put the content of the page-sequence in the 'content' param for the template. Below is an example that puts just the title and subtitle on the extra title page. Those xsl:apply-templates were copied from fo/titlepage.templates.xsl, from the template named 'book.titlepage.recto' which generates the normal title page. If you have customized your title page and generated new title page templates, you will want to copy those instead.



Our print customization layer (myprint.xsl) imports the a few XSL sheets, including a customized titlepage.xsl file called prn-titlepage.xsl, which is generated from prn-titlepage.xml. The 'myprint.xsl' file also includes a customized title page, ironically called 'mybook-titlepage' (with mybook-titlepage-first, mybook-titlepage-even and mybook-titlepage-odd also defined).

To my print customization layer (myprint.xsl) I added the 'front.cover' template as follows, taking the 'content' from the 'article.titlepage.recto' from the generated prn-titlepages.xsl sheet .... It did not give me an extra titlepage ...


<!-- Adding a second title page -->
<xsl:template name="front.cover">
<xsl:call-template name="page.sequence">
 <xsl:with-param name="master-reference">titlepage</xsl:with-param>
 <xsl:with-param name="content">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/mediaobject"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/mediaobject"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/mediaobject"/>
   <xsl:choose>
     <xsl:when test="articleinfo/title">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/subtitle"/>
     </xsl:when>
  <xsl:when test="artheader/subtitle">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/subtitle"/>
  </xsl:when>
     <xsl:when test="info/subtitle">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/subtitle"/>
     </xsl:when>
     <xsl:when test="subtitle">
<xsl:apply-templates mode="subtitle.titlepage.recto.auto.mode" select="subtitle"/>
     </xsl:when>
   </xsl:choose>

<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/abstract"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/abstract"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/abstract"/>

   <xsl:choose>
     <xsl:when test="articleinfo/subtitle">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/subtitle"/>
     </xsl:when>
     <xsl:when test="info/subtitle">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/subtitle"/>
     </xsl:when>
     <xsl:when test="subtitle">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="subtitle"/>
     </xsl:when>
   </xsl:choose>
 </xsl:with-param>
</xsl:call-template>
</xsl:template>

-Gabriela

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