# Introduction

## What about DB2LaTeX?

`Dblatex` started as a DB2LaTeX clone, but since then many things have changed and new features have been added or (hopefully) improved. Now, the portion of shared code is small if any, and the dblatex purpose is different from DB2LaTeX on these points:

- The project is end-user oriented, that is, it tries to hide as much as possible the latex compiling stuff by providing a single clean script to produce directly DVI, PostScript and PDF output.

- The actual output rendering is done not only by the XSL stylesheets transformation, but also by a dedicated LaTeX package. The goal is to allow a deep LaTeX customisation without changing the XSL stylesheets.

- Post-processing is done by Python, to make publication faster, convert the images if needed, and do the whole compilation.

## Features

With `dblatex` you can:

- transform a DocBook XML/SGML book or article to pure LaTeX,

- compile the temporary LaTeX file with `latex`, `pdflatex`, or `xelatex` to produce DVI, PostScript and PDF files,

- publish a set of books,

- convert on the fly the figures included in the document,

- have cross references with hot links,

- olink to other documents built with `dblatex`,

- write complex tables,

- write several bibliographies,

- reuse BibTeX bibliographies,

- use callouts on program listings or on images,

- create an index with `makeindex` or `xindy`,

- write mathematical equations in LaTeX,

- write mathematical equations in MathML,

- have revision bars,

- customise the output rendering with an XSL configuration file,

- use your own LaTeX style package.

## Version

This manual is for dblatex version .

## Change History

See the Release Notes Release Notes to have the dblatex change history.

## Publishing Principles

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.

explains the process applied. It shows the tools used and the steps. The emphasized tools are provided by the package.

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. &nbsp; is transformed to '~'). Python is suited and performant for this task.

- Convert the figures to be compatible with the backend driver. See 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. ).