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


Hello Bob,

Just to let you know that I changed my source file from 'article' to 'book', and I was able to get the numbering without any extra customization.

Thank you for your help.
Gabriela



On Thu, Dec 6, 2012 at 6:12 PM, Gabriela Simonka <gabriela@inrosoftware.com> wrote:
Hi Bob,

On Thu, Dec 6, 2012 at 6:03 PM, Bob Stayton <bobs@sagehill.net> wrote:
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.

That's what I was afraid of.
 
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.


Well, maybe there's hope. The following snippet is from our print customization file, which includes a specification of the page-sequence:
 
 <xsl:template name="select.user.pagemaster">
  <xsl:param name="element"/>
  <xsl:param name="pageclass"/>
  <xsl:param name="default-pagemaster"/>
<!-- Return my customized title page master name if for titlepage,
       otherwise return the default. -->
  <xsl:choose>
   <xsl:when test="$default-pagemaster = 'titlepage'">
    <xsl:value-of select="'mybook-titlepage'" />
   </xsl:when>
   <xsl:otherwise>
    <xsl:value-of select="$default-pagemaster"/>

   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>

<xsl:template name="user.pagemasters">
  <fo:page-sequence-master master-name="mybook-titlepage">
   <fo:repeatable-page-master-alternatives>
    <fo:conditional-page-master-reference master-reference="blank"
                                              blank-or-not-blank="blank"/>
    <fo:conditional-page-master-reference master-reference="mybook-titlepage-first"
                                              page-position="first"/>
    <fo:conditional-page-master-reference master-reference="mybook-titlepage-odd"
                                              odd-or-even="odd"/>
    <fo:conditional-page-master-reference
                                              odd-or-even="even">
     <xsl:attribute name="master-reference">
      <xsl:choose>
       <xsl:when test="$double.sided != 0">mybook-titlepage-even</xsl:when>
       <xsl:otherwise>mybook-titlepage-odd</xsl:otherwise>
      </xsl:choose>
     </xsl:attribute>
    </fo:conditional-page-master-reference>
   </fo:repeatable-page-master-alternatives>
  </fo:page-sequence-master>
  <fo:simple-page-master master-name="mybook-titlepage-first"
                           page-width="{$page.width}"
                           page-height="{$page.height}"
                           margin-top="0pt"
                           margin-bottom="0pt"
                           margin-left="0pt"
                           margin-right="0pt">
   <fo:region-body margin-bottom="0pt"
                      margin-top="0pt"
                      column-gap="{$column.gap.titlepage}"
                      column-count="{$column.count.titlepage}"></fo:region-body>
   <fo:region-before region-name="xsl-region-before-first"
                        extent="0pt"
                        display-align="before"/>
   <fo:region-after region-name="xsl-region-after-first"
                       extent="0pt"
                        display-align="after"/>
  </fo:simple-page-master>
  <fo:simple-page-master master-name="mybook-titlepage-odd"
                           page-width="{$page.width}"
                           page-height="{$page.height}"
                           margin-top="{$page.margin.top}"
                           margin-bottom="{$page.margin.bottom}"
                           margin-left="{$margin.left.inner}"
                           margin-right="{$page.margin.outer}">
  <fo:region-body margin-bottom="{$body.margin.bottom}"
                      margin-top="{$body.margin.top}"
                      column-gap="{$column.gap.titlepage}"
                      column-count="{$column.count.titlepage}"></fo:region-body>
   <fo:region-before region-name="xsl-region-before-odd"
                        extent="0pt"
                        display-align="before"/>
   <fo:region-after region-name="xsl-region-after-odd"
                       extent="0pt"
                        display-align="after"/>
  </fo:simple-page-master>
  <fo:simple-page-master master-name="mybook-titlepage-even"
                           page-width="{$page.width}"
                           page-height="{$page.height}"
                           margin-top="{$page.margin.top}"
                           margin-bottom="{$page.margin.bottom}"
                           margin-left="{$margin.left.outer}"
                           margin-right="{$page.margin.inner}">
   <fo:region-body margin-bottom="0pt"
                      margin-top="{$body.margin.top}"
                      column-gap="{$column.gap.titlepage}"
                      column-count="{$column.count.titlepage}"></fo:region-body>
   <fo:region-before region-name="xsl-region-before-even"
                        extent="0pt"
                        display-align="before"/>
   <fo:region-after region-name="xsl-region-after-even"
                       extent="0pt"
                        display-align="after"/>
  </fo:simple-page-master>
 </xsl:template>


-Gabriela



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