This is the mail archive of the mailing list for the DocBook project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Re: LyX with Docbook

howard mann wrote:
> Bob Stayton wrote:
> >
> > Could someone explain how this latest version of LyX works
> > with Docbook files? I tried to find out more about it, but
> > neither the LyX website nor the referenced mail archive
> > said much about it.
> I second this request. I have the DocBook tools from Mark
> Galassi/Cygnus, and wonder if I can use them with Lyx to write SGML
> using the DocBook DTD.

Apologies for the long reply to those who are not interested in the

Before I begin, I sould point out that, as far as I know, LyX,
unfortunately, cannot import sgml source, as it can, with some
limitations, with TeX source. There is an sgml2lyx utility that worked
for LinuxDoc sgml files but I am not aware of any converters to LyX
format for DocBook sgml files.

Now, I work on an Intel machine with RedHat 6.1 and I have no experience
whatsoever with installation on other OSes or from source files. Being
lazy, I have installed the following *rpm* packages.

From the distribution cd or any mirror of the RedHat ftp site


From the powertools collection from or
any other mirror of the RedHat ftp site


For those who want source files, I guess that they would be available in
the relevant directories of the above links, although I did not check
for all of them.

When I open LyX, I can create a new LyX document choosing "DocBook
article" from the available templates. What I get on the LyX window is a
document with dummy title, date, author, and first section, which I can
of course change. If  I want, for example, a new section, I write the
title of the section and, from a dropdown menu, I choose Section. On my
screen, I see, in a semi-WYSIWYG way, the numbered section formatted in
bold. LyX knows that Section corresponds to sect1. Also available, are
bibliography, subsection, etc.

Now, not all DocBook tags are available. Nevertheless, if I want to
insert a tag, I just write the tag, enclosed in angle brackets, as I
would with any other editor. I then highlight it and choose sgml from
the dropdown menu. LyX now knows that this is markup, not "real" text.

While writing my LyX document, I have various choices. I can preview it
as dvi or postscript without leaving LyX. The latter invokes xdvi or
ghostview for that purpose. I can export my document in dvi, ps, or
Docbook sgml source. If I export it as sgml, I can work with it like
with any other sgml document.

My conclusion is that if I want something simple like an "article", LyX
can do the job quickly and efficiently. For more complex stuff, I tend
to use Emacs with psgml.

Well, this my naive way of creating DocBook articles. Gurus' corrections
and criticism will hurt but are welcome :-).


PS. The masterpiece that follows is newfile.sgml, which was exported by
LyX. Not very nice indentation as you can see, yet it worked: I managed
to create dvi and html versions of it without problems, using the db2dvi
and db2html commands from stylesheets-0.11rh-2

<!doctype article public "-//OASIS//DTD DocBook V3.1//EN"
 [ <!entity header system "header.sgml">

<!-- DocBook file was created by LyX 1.0 (C) 1995-1999
by <prokopis> Fri Nov  5 10:00:03 1999
  First Section


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]