# Installing the Package

## Content

The package contains the following:

docs/

  Contains the files of this document.

latex/

  Contains all the latex stuff: LaTeX style files, logos, and scripts to compile the LaTeX output.

scripts/

  Several scripts, including the main script of the package.

xsl/

  XSL stylesheets.

tests/

  Test files.

## Installing on Unix like Systems

### Dblatex Packages

Dblatex is packaged for these Systems or Distributions:

- Linux Debian, Ubuntu,

- Linux OpenSUSE (RPM), Linux Fedora (RPM),

- FreeBSD, NetBSD,

- Mac OS X (Fink).

If you are installing on one of these distributions, follow their recommended way of installation, and you can safely ignore the next sections that give details for installing dblatex from the source tarball.

### Dependencies

To work, the following items must be available:

- An XSLT. `xsltproc` is the default XSLT used, but one can also use 4suite.

- The XML DocBook DTD.

- A recent LaTeX distribution. The configure script checks that the needed latex packages are available.

- Python >= 2.4.

### Installation

#### Installing the dependencies

To use the package, install properly the dependencies:

1. Install Python if necessary.

2. Install LaTeX.

3. Install the XSLT. By default `xsltproc` is used.

4. Install the XML DocBook DTD.

5. Create a catalog file, that defines where to find the DTD. Here is an example:

       PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
           "file:///usr/local/share/xml/docbook/dtd/4.1.2/docbookx.dtd"

   If the XML Gnome tools are available, it's a good idea to create an XML catalog by using `xmlcatalog` such like this:

       % xmlcatalog --noout --create mycatalog
       % xmlcatalog --noout --add 'public' '-//OASIS//DTD DocBook XML V4.1.2//EN' \
                                  'file://path/to/4.1.2/docbookx.dtd' mycatalog

6. Add the catalog path to the SGML_CATALOG_FILES variable:

       export SGML_CATALOG_FILES=$SGML_CATALOG_FILES:/path/to/mycatalog

   You can skip this step if you configure the dblatex installation with the `--catalogs` option.

#### Installing from the source tarball

The steps to follow are the following:

1. Untar the ball. For a bzipped release, do as follow:

       % tar xvfj dblatex-x.x.x.tar.bz2

   For a gzipped release, do as follow:

       % tar xvfz dblatex-x.x.x.tar.gz

2. Install the package. The installation script preliminary checks the dependencies. In the example, the `dblatex` script is installed under `/usr/local/bin` and the other files are installed under `/usr/local/share/dblatex`. Besides, the `--catalogs` option tells where to find the catalogs.

       % cd dblatex-x.x.x
       % python ./setup.py install --prefix=/usr/local --catalogs=/path/to/mycatalog

#### Installing from the Python Egg

Since version 0.3.2 dblatex is distributed as a Python Egg in the Python Package Index (PyPI). It requires to have `easy_install` installed.

The procedure to follow is:

1. Call simply easy_install:

       % easy_install dblatex
       Searching for dblatex
       Reading http://pypi.python.org/simple/dblatex/
       Reading http://dblatex.sf.net
       Best match: dblatex 0.3.1.1
       Downloading http://pypi.python.org/packages/2.5/d/dblatex/dblatex-0.3.1.1-py2.5.egg#md5=8520d596e473ff544eb9dcdc5175d7ae
       Processing dblatex-0.3.1.1-py2.5.egg
       creating /path/to/dblatex-0.3.1.1-py2.5.egg
       Extracting dblatex-0.3.1.1-py2.5.egg to /path/to
       Adding dblatex 0.3.1.1 to easy-install.pth file
       Installing dblatex script to /path/to

       Installed /path/to/dblatex-0.3.1.1-py2.5.egg

That's it!

## Installing on Windows

The following packages to install and the procedure is for a native Windows installation. If you want to use dblatex via Cygwin instead, you should consider it like a unix like install.

### Dependencies

The following applications are required:

- An XSLT. `xsltproc` is the default XSLT used, but one can also use 4suite.

- The XML DocBook DTD.

- MiKTeX > 2.5.

- Python >= 2.4.

### Installation

#### Installing xsltproc

You can download the binaries and getting the installation instructions from: .

#### Installing MiKTeX

Install the minimal distribution, and add the following packages: changebar, colortbl, fancybox, fancyhdr, fancyvrb, listings, overpics, rotating, subfigure, titlesec, bibtopic, enumitem, eepic, lm, lastpage, helvetic, times, symbol, courier, footmisc, ifxetex, pdfpages, wasysym.

#### Installing dblatex

From the unpacked package directory just type:

    python setup.py install

If the Python directory is `C:\Python25` you can now try `dblatex` by typing:

    python C:\Python25\Scripts\dblatex file.xml