Chapter 2. Use of LyX

Table of Contents

Creating a document
Publishing/exporting a document
DVI, PostScript Format
HTML Format
Publishing a document by hand
Use of sgmltools
Use of jade

Creating a document

Creating a Docbook document with LyX is exactly the same as for any other kind of document: create a new file and select the Docbook layout you wish (Layout->Document->Class->DocBook {article, book, chaper, section} SGML).

Now, write the document (it should take more time ;-).

Publishing/exporting a document

The document can be exported to SGML, DVI, PostScript, text and HMTL, by using File->Export as.

DVI, PostScript Format

Publishing to DVI or to PostScript creates in the directory where the source document is a .dvi or .ps file. LyX does the following operations to produce the exported file:

  1. The document is translated to a temporary SGML file,

  2. A temporary tex file is build by running sgmltools on the SGML temporary file, with tex for backend,

  3. The DVI file is build by running jadetex on the temporary tex file,

  4. The PostScript file is build by running dvips on the DVI file.

HTML Format

Exporting to HTML creates a directory whose name is the file name to export. This directory contains the output HTML files. There is one HTML file by chapter or section.

Publishing a document by hand

Publishing by hand allows you to choose stylesheets or backend not supported by default in LyX. Besides, it is a good exercise to learn how the tools work and to check independently from LyX that everything is well configured. To do this you just need to:

  • Export as SGML,

  • Run sgmltools or jade directly on the outputed SGML file.

The publishing examples in the following sections are given only to show how it works. In fact all of these conversions are possible by using LyX directly.

Use of sgmltools

DVI Format

sgmltools -b dvi mydoc.sgml
    

HTML Format

sgmltools -b html mydoc.sgml
    

Use of jade

DVI Format

jade -t tex -d /usr/lib/sgml/stylesheets/nwalsh-modular/print/docbook.dsl mydoc.sgml
jadetex mydoc.tex
    

HTML Format

jade -t sgml -d /usr/lib/sgml/stylesheets/nwalsh-modular/html/docbook.dsl mydoc.sgml