Next / Previous / Contents / NM Tech homepage

13.2. Title page for a book

When the root element is book, the title occupies two pages: the recto page, with the main title, and the verso page, with the abstract and other front matter.

The t:titlepage element wraps all this content. Its attributes include:

t:element="book"

Specifies the DocBook element to which this format applies.

t:wrapper="fo:block"

The content of this title page will be wrapped in a FO block element.

font-family="{$title.fontset}"

Specifies a set of font attributes to be used to display the title. Defined in fo/pagesetup.xsl in the DocBook-XSL Stylesheets.

fo-titlepage.xml
<!--Specify the title font-->
<t:titlepage t:element="book" t:wrapper="fo:block"
             font-family="{$title.fontset}">

The t:titlepage-content element specifies what to put on the right-hand (recto) page.

fo-titlepage.xml
  <t:titlepage-content t:side="recto">

Next is the title element, which describes how to format the DocBook title element.

t:named-template="book.title"

This attribute tells the XSL processor to use the template named book.title to format the title. This is a local customization; see Section 11.2, “Templates for title elements”. The stock template calls the uncustomized component.title here.

param:node="ancestor-or-self::book[1]"

The created template will match the first (and typically the only) article element in the DocBook source.

font-size="&hsize5;"

Set the title in the largest-size font.

font-weight="bold"

Set the title in boldface font.

fo-titlepage.xml
    <title t:named-template="book.title"
        param:node="ancestor-or-self::book[1]"
        space-before="1in"
        font-size="&hsize5;"
        font-weight="bold"/>

The remainder of this file is exactly as it looks in the stock fo/titlepage.templates.xml file.

fo-titlepage.xml
    <subtitle/>

    <corpauthor space-before="0.5em"
                font-size="&hsize2;"/>
    <authorgroup space-before="0.5em"
                 font-size="&hsize2;"/>
    <author space-before="0.5em" 
            font-size="&hsize2;" break-after="page"/>
  </t:titlepage-content>

  <t:titlepage-content t:side="verso" break-before="page">
    <othercredit space-before="0.5em"/>
    <releaseinfo space-before="0.5em"/>
    <copyright space-before="0.5em"/>
    <legalnotice text-align="start"
                 margin-left="0.5in"
                 margin-right="0.5in"
                 font-family="{$body.fontset}"/>
    <pubdate space-before="0.5em"/>
    <revhistory space-before="0.5em"/>
    <revision space-before="0.5em"/>
    <abstract space-before="0.5em"
        text-align="start"
        margin-left="0.5in"
        margin-right="0.5in"
        font-family="{$body.fontset}"/>
  </t:titlepage-content>

  <t:titlepage-separator>
  </t:titlepage-separator>

  <t:titlepage-before t:side="recto">
  </t:titlepage-before>

  <t:titlepage-before t:side="verso">
  </t:titlepage-before>
</t:titlepage>