A few of the typographical specs used by the DocBook XSL stylesheets can be changed with individual parameters on the command line. Because there are so many possible specs, however, most are contained in XSL
attribute-set elements that bundle together many specs. Changing such specs requires a customization layer.
Here is an example of several typography changes using parameters:
xsltproc --output myfile.fo \ --stringparam body.font.family Helvetica \ --stringparam body.font.master 11 \ --stringparam title.font.family "Times Roman" \ --stringparam footnote.font.size 9 \ fo/docbook.xsl myfile.xml
To change the font family for the body text, use the
body.font.family parameter. The default value is
serif, which most FO processors render as Times Roman. Although
you can specify any font name in the parameter,
there is no guarantee that the XSL-FO processor can produce that
font. You need to consult the documentation of the current version of
the processor to see what fonts it supports. As installed, FOP
supports only Times Roman, Helvetica, and Courier. These are the
fonts supported by the Adobe PDF files. To configure a new font into
your FO processor, see the section “Adding a font”.
For elements such as
programlisting that require a monospace font, the
monospace.font.family parameter provides the font family name. By default it
monospace, which maps to Courier in most FO processors.
To change the body font size, use the
body.font.master parameter. That parameter is a pure number representing
point size, but specified without units. That parameter is then used
to compute the actual font size values relative to the master size.
So you need not set the
body.font.size parameter, because it is computed from the
The title font sizes cannot be set with parameter values, and must be set using a customization file. See the section “Title fonts and sizes”.
The DocBook DTD defines a strict hierarchy of section elements. Unlike HTML, you can't put a level 3 heading directly under a level 1 heading. However, sometimes the content doesn't fit well into this strict hierarchy when being formatted. For example, you may have a level 1 section that has a great many short level 2 sections. When formatted, the level 2 section titles may appear too large relative to their small section content. If you were writing in HTML, you might just break the hierarchy and resort to
h3 titles to reduce their size.
The creators of DocBook recognized this problem, and provided a solution in the
renderas (“render as”) attribute. Its value can be
sect2, etc. You can use the
renderas attribute to tell the stylesheet to render a particular section title as if it were a different section level.
<sect1> <title>Options</title> <para>This section describes a lot of options</para> <sect2 renderas="sect3"> <title>The A option</title ...
The section level 2 element has a
renderas="sect3" attribute. The stylesheet will then format the title “The A option” in the type size and style of a level 3 section. If you have several such
sect2 sections, you have to add the attribute to each to keep the headings consistent. The attribute has no other effect on how the section in handled. It is still numbered as a level 2 section, and it appears as a level 2 section in the table of contents.
|DocBook XSL: The Complete Guide - 3rd Edition||PDF version available|
Copyright © 2002-2005 Sagehill Enterprises