Chapter 1. Installation

Table of Contents

Install Overview
Packages to install
Setting SGML_CATALOG_FILES
LyX Reconfiguration
DocBook
The DocBook DTD
The N. Walsh modular stylesheets
Jade/jadetex
SGMLtools
SGMLtools and LyX
SGMLtools and Jade
SGMLtools and DocBook
Environment Variables

Install Overview

The use of DocBook through LyX needs:

  1. The DocBook, jade, and sgmltools packages be installed.

  2. The SGML_CATALOG_FILES variable properly set.

  3. LyX reconfigured.

Packages to install

To produce DocBook documents LyX needs some packages to be installed:

All these features are detailed in the other sections of this chapter. Before downloading each of the packages, check that it is not already installed in your system! For instance, Red Hat provides most of these packages.

Setting SGML_CATALOG_FILES

See section Environment Variables.

LyX Reconfiguration

To reconfigure LyX do as follow:

  1. Start LyX

  2. Reconfigure LyX (Options->Reconfigure)

  3. Exit from LyX

  4. Start LyX again, and open a new document (File->New). If the reconfiguration succeded, the following new document layouts should be available in the Layout->Document->Class list::

    • DocBook article (SGML),

    • DocBook book (SGML),

    • DocBook chapter (SGML),

    • DocBook section (SGML).

DocBook

The DocBook DTD

The DocBook package only provides the template for this kind of document (docbook.dtd). The template includes some description modules (.mod files). The DocBook DTD by itself does not allow to publish a document, because no stylesheet is provided with the package. Untill now the version supported by LyX is V3.1 but it will move to V4.x.

The N. Walsh modular stylesheets

This package provides DSSSL stylesheets by Norman Walsh to publish SGML files at least to tex for jadetex and HTML. All the other stylesheets used suppose that these stylesheets are available, and actually call them.

Jade/jadetex

Jade compiles an SGML document, and produces one or more files according to the expected format (tex for jadetex, rtf, HTML). The expected format is specified by the stylesheet to use. Jadetex compiles the tex file outputed by jade and produces the related DVI file.

SGMLtools

SGMLtools interfaces LyX to jade/jadetex, and provides several stylesheets that customize the standard N. Walsh DocBook stylesheets. Figure below shows the relationship between each feature.

SGMLtools and LyX

SGMLtools must be installed to allow LyX to export a DocBook document to one of the available output format (DVI, PostScript, HTML). The SGMLtools version must be greater than 2.0. SGMLTools version 3.0 provides some stylesheets (.dsl) and some scripts written in python.

Le main script, sgmltools, is called by LyX when the document is exported. LyX runs the command:

sgmltools -b backend mydoc.sgml
   

Where backend depends on the expected output format:

Output format Backend
DVI dvi
PostScript ps
HTML html

SGMLtools and Jade

SGMLtools calls jade and jadetex if necessary. So, these tools must be installed (cf. Jade). When no stylesheet is explicitely specified to sgmltools (option -s) the stylesheet used is deduced from the chosen backend. An alias is created according to the backend, and its syntax is “sglmtools-backend”. The links between the aliases and the stylesheets are defined in the file /etc/sgml/aliases and ˜/.aliases if this file exists. At least one of these files must exist and be correctly initialized to make sgmltools work properly.

SGMLtools and DocBook

SGMLtools provides and uses its own stylesheets, according to the selected backend. These stylesheets define some specific characteristics, and call the N. Walsh stylesheets.

Environment Variables

The environment variable SGML_CATALOG_FILES lists the catalogs where the available stylesheets are. It is used by jade and must refer to all the packages installed (DocBook stuff, jade, sgmltools, etc.). For example SGML_CATALOG_FILES could be set like this:

DBK_CAT=/usr/lib/sgml/docbook.cat 
CMN_CAT=/usr/lib/sgml/sgml-common.cat
NWS_CAT=/usr/lib/sgml/stylesheets/nwalsh-modular/catalog 
JAD_CAT=/usr/doc/jade-1.2.1/dsssl/catalog 
JAD_CAT=$JAD_CAT:/usr/doc/jade-1.2.1/unicode/catalog 
STL_CAT=/usr/local/share/sgml/stylesheets/sgmltool/sgmltools.cat 
export SGML_CATALOG_FILES=$DBK_CAT:$CMN_CAT:$NWS_CAT:$JAD_CAT:$STL_CAT