Publishing Principles

Backend Drivers
XSL Stylesheets
Python Post Processing
LaTeX Style Package

Dblatex transforms a DocBook XML/SGML document to LaTeX. Once transformed into LaTeX, standard LaTeX tools are used to produce DVI, Postcript or PDF files.

Figure 1.1, “Transforming Process” explains the process applied. It shows the tools used and the steps. The emphasized tools are provided by the package.

Figure 1.1. Transforming Process

Transforming Process

Backend Drivers

The main script supports the following LaTeX backend drivers:

dvips

The driver calls latex, and produces DVI, Postscript and at the end PDF files. Latex natively accepts only EPS graphics. The drawback is that converting to PDF can take a while.

pdftex

The driver calls pdflatex, to directly produce PDF files. The conversion is fast, the file size is smaller. Pdflatex natively accepts PDF, PNG, JPEG, and TIFF graphics.

xetex

The driver calls xelatex, to directly produce PDF files through the XeTeX engine. This engine natively supports UTF-8 which improves multilingual support.

XSL Stylesheets

The XSL stylesheets located under xsl/ are used to transform from XML to “raw” LaTeX. The main file is latex_book_fast.xsl, that includes the other stylesheets of the directory.

Python Post Processing

Actually the XSL stylesheets does not produce valid LaTeX. The reason is that some DocBook processing is too complex or too time-consuming for XSL transforming. Besides, some extra actions need sometimes to be done such like figure conversion. Here are the main actions done by Python Post processing:

  • Transform the entities to valid LaTeX characters (e.g.   is transformed to '~'). Python is suited and performant for this task.

  • Convert the figures to be compatible with the backend driver. See the section called “ Figure Inclusion ” for more detail.

  • Force some hyphenation in tables or for typed words.

  • Do the whole LaTeX compilation sequence thanks to the rubber compilation engine.

LaTeX Style Package

Once valid LaTeX is available, the LaTeX style package (docbook.sty) under latex/style/ is used to customize the output rendering. It includes the other files of the directory. You can also provide your own LaTeX style (cf. Chapter 4, Customization).