September 22, 2004

Hot LyX

Author: Dave Fancella

A common problem with word processors today is that they force users to deal with typesetting, a skill that is about as useful to a writer as metalworking is to a mechanic. This focus on typesetting means that writers have to spend too much time dealing with the way their documents look. To make matters worse, many documents are shared in a variety of different formats requiring additional time wasted in export, conversion, and quality control on the finished product. To help get around these obstacles, Linux users can turn to a document processor called
LyX. LyX is optimized for writing and takes the chores of typesetting out of the writer's hands and places them in a competent professional: LaTeX.By using LaTeX as an interim format LyX is capable of taking a document and exporting it into any format. LyX lets you focus on what you mean rather than what your page looks like. When you're finished writing, you simply inform LyX in what format you would like the document
and LyX delivers it to you. By using LaTeX as an interim format, you can use any command line LaTeX converter to produce your document in any format needed. Out of the box, LyX supports exporting PDF, HTML, PostScript, PlainText, and DVI. In addition, LyX has an excellent GUI constructor for building simple and complex mathematical statements, making it suitable for writing technical theses.

I tried exporting one of the included documents to PDF, figuring an included document would be more likely to be written "correctly" than something I just wrote. Viewing the resulting file I found myself looking at a book with every appearance of having been professionally typeset
and ready to go to press.

Impressed, I wanted to try my own hand at formatting. So I imported a book from Project Gutenberg and spent half a minute telling LyX what the parts were. (LyX is limited in the kids of documents it can import. It handles only plain text, LaTeX, and Noweb.) I inserted a table of contents and placed a title and author at the top of the book. Exporting that to PDF I found that I, too, can lay out professional-looking novels.

Despite all the positive points, my first impressions of LyX were not very good. I started typing and got lost quickly. I kept trying to put two spaces after each period, hitting Return for extra white space, and all the things that I'm used to doing with other word processors. Luckily, I then found the online documentation, which was thorough and helpful. After five minutes' worth of tutorial, I went back and started writing and the interface made sense.

LyX's interface is very minimal, showing a small toolbar with a drop-down menu, a few buttons, and a large editing area. The buttons themselves are a bit different than the common assortment of typesetting-centric buttons, since you won't find Justify, Right-Align, Italic, Bold, or any of the other buttons you're used to seeing. Instead, you find Emphasis, Noun Style, Footnote, Margin, and the Math Editor. The editing area is also a bit different than I was used to seeing, consisting of just a more or less generic edit control rather than the large rendered page you get with standard word processors.

I had a pretty easy time installing LyX, since I just installed it from RPM. LyX comes with most major Linux distributions in whatever format they use, so your distribution's package manager should already make it available. If you build it from source, you really need to worry only about having XForms or Qt. If you're not using KDE, you can build with the XForms interface, just making sure XForms is installed.

LyX uses any command-line utility to make the conversion from LaTeX to your target format, so you will need to make sure you have such a utility available. While this appears at first glance a drawback compared to traditional word processors, it is an extension of the Unix philosophy of building small programs that work well. Using the Reconfigure feature, LyX can discover the programs it already understands on its own. If you have already used LaTeX for any serious
work then you are already familiar with the additional programs you need for your target formats. If you have never used LaTeX, just relax and install anything that converts LaTeX. LyX's online documentation contains a list of LaTeX packages you should have, and if you want to output to any given target format, you can expect to find the right applications by searching through your package manager for "latex" or your target format. If you have never done anything with LaTeX, spend some time reading through LyX's documentation.

LyX has been around for a while. It was originally written by Matthias Ettrich, KDE's founding father, before he had discovered Qt and started the KDE project. Originally a Motif application, LyX was later ported to XForms. Today, LyX supports XForms and Qt, with a GTK interface in development. LyX is now maintained by Lars Gullik BjĂžnnes and more than 20 developers worldwide.

LyX's primary benefit is that it takes the work of typesetting completely out of your hands. Since I spend a lot of time writing without knowing what the target format will be, I found LyX to be exactly the right tool at the right time for me. I find that even after I've written something in one format I frequently have to provide the same stuff in other formats, and LyX handles that beautifully.

LyX's primary drawback is that it doesn't interchange documents well with more traditional word processors. Since I generally don't have to worry about interchanging documents, I've been able to switch all of my important writing to LyX. Just as when I switched to Linux, I'm looking back and thinking, "Why did I waste my time with that other stuff?"

Click Here!