Table of Contents
The use of DocBook through LyX needs:
To produce DocBook documents LyX needs some packages to be installed:
DocBook: the following features must be installed to make DocBook usable:
The DocBook DTD, that can be dowloaded from DocBook.
The ISO entities, that define some standard SGML entities (e.g. >, <, etc.).
SGMLtools-lite (version 3.0)
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.
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.
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 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 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 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.
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