Chapter 4. Customization

Table of Contents

XSL Parameters
imagedata.default.scale
latex.hyperparam
Setting Command line Parameters
XSL User Stylesheet
Changing the XSL parameter values
Overriding some templates
Customized LaTeX style
Reusing an existing LaTeX style
Package options
Needed packages
DocBook interface
Debugging your Style
Latex post process script
Post latex compilations
Dblatex Configuration File
Configuration File Format
Configuration Paths
Customization Precedence

The transformation process (and thus the output rendering) can be heavily customized by:

All these customization methods can be used independently and in exceptional cases, but it can also be combined and registered in a master configuration file, called a specification file (cf. the section called “Dblatex Configuration File”) to create a new tool dedicated to your needs.

XSL Parameters

The PDF rendering can be customised by using some XSL configuration parameters. The available configuration parameters are the following:

ParameterRoleDefault Value
annotation.supportSet to 1 the experimental DocBook 5 annotation support is enabled.0
callout.markup.circledSet to 1 the callouts references in a calloutlist are white numbers in black circles, like the markups in the listing (or graphic). Set to 0 the references are simple numbers. 1
callout.linkends.hotThe callouts referenced in a callout list are hot links if the parameter is set to 1. Then, the references are in red such like any other cross-reference link in the document.1
calloutlist.styleDefines how the callout list items are displayed. The value must be some valid enumitem description list options."leftmargin=1cm,style=sameline"
citation.default.styleDefault natbib citation style to apply when natbib is used. See the section called “Natbib Citations”.Empty
citation.natbib.optionsOptions to pass to the natbib package when it is loaded. See also the section called “Natbib Citations”.Empty
citation.natbib.useLoad the natbib package, and allows the use of natbib citation styles. The package is loaded if the parameter is set to 1. See the section called “Natbib Citations”.0
co.linkends.showNext to a callout markup the links to the corresponding calloutlist items are shown when the parameter is set to 1. Set to 0 the links are not shown.1
colophon.tocdepthSame than preface.tocdepth for colophon sections. 0
dedication.tocdepthSame than preface.tocdepth for dedication sections. 0
doc.alignmentDefines the text alignment for the whole document. The valid values are: "left", "center", "right", "justify". An empty string is equivalent to "justify".Empty
doc.collab.showShow the collaborators (authors, contributors) defined in the document information block.1
doc.lot.showSpecifies which Lists of Titles should be printed after the Table of Content. The value is a comma separated list of the LoTs to show. The supported LoTs are "figure", "table", "equation", and "example". The list order represents the LoTs order in the output document."figure,table"
doc.pdfcreator.showFill the Creator field of the PDF document information section with "DBLaTeX-<version>" if the parameter is set to 1. Set to 0 this field is keep untouched.1
doc.publisher.showPrint the dblatex logo on the cover page for the native docbook style if the parameter is set to 1.0
doc.section.depthDepth of the section numbering. Used to set the latex secnumdepth counter.5
doc.toc.showPrint the table of contents when set to 1.1
draft.modePrint releaseinfo in a framed box in the header, when the parameter is set to 'yes'. The releaseinfo is ignored if the parameter is set to 'no', or if the releaseinfo content is empty. When the parameter is set to 'maybe', the draft mode is deduced from the status attribute of the root element if set to 'draft'. maybe
draft.watermarkPrint the draft text (that is, "DRAFT") as a watermark on each page, if the document is in draft mode and if the parameter is set to '1'. 1
figure.cautionFigure to use to render a caution block. This parameter is added to allow new latex styles to use their own figures in admonitions."warning"
figure.default.positionDefault figure float placement algorithm to apply. The default parameter value is [htbp] meaning that latex tries to place the figure where it occurs first (h, here), then at the top of the page (t), at the bottom of the page (b), and finally on the next page (p).[htbp]
figure.importantFigure to use to render a important block. This parameter is added to allow new latex styles to use their own figures in admonitions."warning"
figure.noteFigure to use to render a note block. This parameter is added to allow new latex styles to use their own figures in admonitions.Empty
figure.tipFigure to use to render a tip block. This parameter is added to allow new latex styles to use their own figures in admonitions.Empty
figure.title.topSet to 1 the figure float title position is above the image. Set to 0 the title is under the image.0
figure.warningFigure to use to render a warning block. This parameter is added to allow new latex styles to use their own figures in admonitions."warning"
filename.as.urlSet to 1 the filenames are handled as URLs, with the same hyphenation rules. Set to 0 the filename hyphenation is forced for each character.1
glossterm.auto.linkWhen set to 1, the glossterms in the document are linked to their definition in the glossary.0
imagedata.boxedIf set to 1, put the images into a framed box.0
imagedata.default.scalecf. the section called “imagedata.default.scale”pagebound
imageobjectco.hideWhen set to 1 the callout numbered circles are not drawn on the image. Only the anchors are put, allowing callout list items to jump at the referenced position on the image. The purpose of this parameter is to allow the use of images that already contain the callout numbers (like for GIMP manual).0
latex.babel.useSet to 1 the babel package corresponding to the document language is included. Set to 0 no babel package is included whatever the document language is.1
latex.babel.languageThis parameter forces the use of the specified babel language whatever the document language is.Empty
latex.biblio.outputDefines how the BibTeX bibliographic entries are printed out. The available values are defined in the section called “Using BibTeX Databases”. all
latex.biblio.styleDefines the default BibTeX style to apply. Meaningful when not empty, only for the used bibtex databases. See the section called “Using BibTeX Databases”. Empty
latex.class.articleThis parameter sets the document class to use for article documents.article
latex.class.bookThis parameter sets the document class to use for book documents.report
latex.class.optionsOptions passed to the \documentclass command.Empty
latex.encodingEncoding of the latex document to produce. The supported values are: "latin1" and "utf8". See the section called “Document Encoding” for more details about how to use it."latin1"
latex.hyperparamSee the section called “latex.hyperparam”empty
latex.unicode.useSet to 1 the passivetex unicode support is included, allowing to handle a wider range of Unicode characters (like cyrillic).0
literal.layout.optionsOverwrite the default options passed to the \lstset command.Empty
literal.lines.showallSet to 1, all the lines in a verbatim environment like programlisting or screen are printed, even if they are empty. Set to 0, the last empty lines are not printed. It is set to 1 by default.1
literal.width.ignoreWhen set to 1 the programlisting and screen width attribute is ignored. In this case all the verbatim environment widths are equal to the enclosing environment width. 0
make.year.rangesIf non-zero, copyright years will be collated into ranges. Parameter taken from the DocBook XSL stylesheets. 0
make.single.year.rangesIf non-zero, year ranges that span a single year will be printed in range notation (1998-1999) instead of discrete notation (1998, 1999). Parameter taken from the DocBook XSL stylesheets. 0
mediaobject.caption.styleFont style of the mediaobject caption text. Its value can be any valid latex font style command combinations. By default this parameter put the caption text to italics.\slshape
newtbl.autowidthDefines if the table column widths must be automatically sized by latex. See ???.Empty
newtbl.default.colsepSet to 1, print the column separators when no colspec attribute is specified.1
newtbl.default.rowsepSet to 1, print the row separators when no rowspec attribute is specified.1
newtbl.format.theadLaTeX formatting for head table cells.\bfseries%
newtbl.format.tbodyLaTeX formatting for body table cells.Empty
newtbl.format.tfootLaTeX formatting for foot table cells.Empty
newtbl.use.hhlineSet to 1, use the hhline package to draw the table row separators instead of cline. Using hhline seems more suited for colored tables.0
pdf.annot.optionsOptions to change how the PDF text annotations should look. The supported options are width, height, depth. The options must be comma separated like: width=5cm,depth=10cm.Empty
preface.tocdepthWhen greater than 0, the preface headings appear in the TOC. The parameter value define the preface section depth appearing in the TOC and in the bookmarks. If set to 0, none of the sections are put in the TOC. If set to 1, only the chapter level appears in the TOC and bookmarks, and so on. When the parameter is negative, it behaves like with 0, but it uses the previous implementation (use of unnumbered sections, that is, with latex heading commands ending with '*').0
qandaset.defaultlabelDefines the default label to use in a qandadet when the defaultlabel attribute is not specified."number"
seg.item.separatorDefines the separator to use between several segitems.", "
set.book.numWhen the document root element is a set this parameter can be used to select the book to print, because dblatex can output only one book from the set.1
table.default.positionDefault table float placement algorithm to apply. The default parameter value is [htbp] meaning that latex tries to place the table where it occurs first (h, here), then at the top of the page (t), at the bottom of the page (b), and finally on the next page (p).[htbp]
table.in.floatSet to 0 the formal tables are no more put in table floats. They are displayed with the longtable package, allowing to have formal tables covering several pages (which is not possible with floats). The limitation is that the title must necessarily be on the top of the table.1
table.title.topSet to 1 the table float title position is above the table. Set to 0 the title is under the table.0
term.breaklineSet to 1 the item following a term in a variable list is put on the next line.0
titleabbrev.in.tocSet to 1 the titleabbrev content is put in the TOC instead of the title.1
toc.section.depthDepth of the TOC. Used to set the latex tocdepth counter.5

imagedata.default.scale

Default scale to apply to every imagedata that does not contain any scaling attribute.

By default this parameter is set to `pagebound` so that the included images keep their natural size up to the page boundaries.

Two other special parameters are available: 'maxwidth=width' and 'maxheight=height' where width and height define the maximum image dimensions, i.e. the image keeps its natural size up to the specified maximum dimension. Both 'maxwidth' and 'maxheight' settings can be combined in a comma separated list.

Example:

dblatex -P imagedata.default.scale=maxwidth=10cm,maxheight=8cm file.xml

Except these special reserved values, the expected value of the parameter must be some valid options passed to the \includegraphics command.

latex.hyperparam

This parameter gives the options to pass to the LaTeX hyperref package. No validity check is done.

For instance, the Table of Content rendering (link color, etc.) can be changed. Look at the hyperref.sty documentation to know all the hyperref options available.

Example 4.1. Configuring with latex.hyperparam

<?xml version='1.0' encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
 
<!-- We want TOC links in the titles (not in the page numbers), and blue. 
 -->
<xsl:param name="latex.hyperparam">colorlinks,linkcolor=blue</xsl:param>

</xsl:stylesheet>