Your new title page templates handle the format and sequence of elements on title pages, but do not alter the handling of the individual elements that are included. For example, an author
element can have many child elements that need arrangement. The way to change an individual element on title pages is to modify a template which uses a title page mode on that element. There are two levels of such templates:
A mode such as book.titlepage.recto.mode
is applied only to an element being output to a destination specified in the mode name, which in this case is a recto
(front side) titlepage of a book
.
The titlepage.mode
is applied to the element on all types of title pages, except when it is overridden by a more specific mode such as book.titlepage.recto.mode
.
If you want a customization to be applied to a given element when it appears on any type of title page, then customize its template in mode="titlepage.mode
. Such templates can be copied from the stylesheet module fo/titlepage.xsl
or html/titlepage.xsl
, depending on your output type, and modified in your customization layer as needed.
If you want a customization only applied to a specific title page destination, then use a more specific mode such as that shown in the first list item above. You follow a similar process, in that you copy the template for that element with mode="titlepage.mode"
from fo/titlepage.xsl
or html/titlepage.xsl
, and then change the name of the mode to the more specific name, such as book.titlepage.recto.mode
, before making your customization changes. That custom template will be used in place of the mode="titlepage.mode"
template.
The original templates are in html/titlepage.xsl
or fo/titlepage.xsl
, depending on your output type. For example, here is the HTML template for affiliation
in that mode:
<xsl:template match="affiliation" mode="titlepage.mode"> <div> <xsl:apply-templates select="." mode="class.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> </div> </xsl:template>
The template for handle author
and editor
elements in HTML calls a template named credits.div
, a template that is also shared by othercredit
elements.
<xsl:template match="author|editor" mode="titlepage.mode"> <xsl:call-template name="credits.div"/> </xsl:template> <xsl:template name="credits.div"> <div> <xsl:apply-templates select="." mode="class.attribute"/> <xsl:if test="self::editor[position()=1] and not($editedby.enabled = 0)"> <h4 class="editedby"><xsl:call-template name="gentext.edited.by"/></h4> </xsl:if> <h3> <xsl:apply-templates select="." mode="class.attribute"/> <xsl:call-template name="person.name"/> </h3> <xsl:if test="not($contrib.inline.enabled = 0)"> <xsl:apply-templates mode="titlepage.mode" select="contrib"/> </xsl:if> <xsl:apply-templates mode="titlepage.mode" select="affiliation"/> <xsl:apply-templates mode="titlepage.mode" select="email"/> <xsl:if test="not($blurb.on.titlepage.enabled = 0)"> <xsl:choose> <xsl:when test="$contrib.inline.enabled = 0"> <xsl:apply-templates mode="titlepage.mode" select="contrib|authorblurb|personblurb"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates mode="titlepage.mode" select="authorblurb|personblurb"/> </xsl:otherwise> </xsl:choose> </xsl:if> </div> </xsl:template>
If you do not want your author and editor names output as H3
headings, then copy this template to your customization layer and modify it as needed. If you want your author
elements handled differently from your editor
elements, then create a new template in mode="titlepage.mode"
instead of using the shared credits.div
named template.
At another level, perhaps you want author names on article
title pages to be different from author names on book
title pages. The DocBook XSL stylesheets are set up to use a more specific mode first. So instead of the above template, you would create two new templates, one using mode article.titlepage.recto.mode
and the other using book.titlepage.recto.mode
. Modify each according to your needs. If your author names are on the verso side (as specified in your title page spec file), you need to specify verso
in the mode name instead. See the section “Title page element templates” for an example.
Following is the sequence of modes that are tried for each element on an article recto title page. This arrangement provides control of each element in any context on each side of each kind of title page. You cannot ask for more control than that.
article.titlepage.recto.auto.mode Defined in the generated stylesheet article.titlepage.recto.mode Generic template just applies titlepage.mode, but can be customized. titlepage.mode Defined in titlepage.xsl [no mode] Default handling of the element
DocBook XSL: The Complete Guide - 4th Edition | PDF version available | Copyright © 2002-2007 Sagehill Enterprises |