Suggestions
Search:

Custom LaTeX Styles

Introduction

DB2LaTeX uses a variety of standard LaTeX commands and environments. Most of these are provided by a LaTeX document-class or by style files that are part of the LaTeX software distribution. In some cases, DB2LaTeX must supplement these commands with its own LaTeX instructions. Most of this occurs within the ‘preamble’ of your LaTeX file (that is, the file created by transforming your source document with the DB2LaTeX stylesheets).

The preamble of books and articles is provided by DB2LaTeX templates and parameters described in the Reference section:

The preamble can be heavily customised in a number of ways. All of these methods are enabled through the use of stylesheet parameters (described in the main customization guide).

  1. You can provide your own LaTeX style file.This can be selected by the $latex.documentclass parameter.

  2. You can select which LaTeX packages are used by DB2LaTeX.This can be done by changing the values of the $latex.use.* series of stylesheet parameters. In some cases, the options for these packages can be controlled by you.

  3. You can provide your own code for the preamble.This can be done by inserting your own code (see the Reference documentation for preamble templates). You may also wish to load packages of your own choosing.

  4. You can provide your own XSL templates.You can use <xsl:apply-imports> to “wrapDB2LaTeX output with your own LaTeX code.

There is no single ‘best’ way to achieve this --- you will need to use whatever methods are best for your circumstances. You can see demonstrations of all techniques in the DB2LaTeX sample files.

[Tip] Essential Preamble

There are a great many differences between the default behaviour of LaTeX and the semantics of DocBook. To bridge the gap, DB2LaTeX requires certain commands that we have invented ourselves. These form the “essential” preamble --- your documents will fail to work with LaTeX without these commands. As such, DB2LaTeX does not allow you to remove these commands from the preamble. Other commands may be removed. We have not yet placed all the essential commands into the essential preamble --- it is a “work in progress”.

Standard LaTeX Customisation

If you use BibTeX or makeindex, you can customise them using regular .bst or .ist files.

Required Packages

In future, we will provide a list of packages that DB2LaTeX uses. For the time being, you may wish to look at the list of packages in the Reference index. It is known that the teTeX distribution of LaTeX is sufficient. (In fact, most DB2LaTeX development is conducted using teTeX versions 1 and 2.) There are some extra packages, such as truncate.sty, that are beneficial but not supplied with teTeX 1 (see the CTAN search facility).

The Effect of DB2LaTeX Upon Standard LaTeX

In future, we will provide a description of the LaTeX commands that DB2LaTeX relies upon or modifies. For the time being, you will need to inspect preamble.mod.xsl (and any other modules that contain ‘essential’ sections of the preamble).