Desktop Publishing with Linux

Sometimes one forgets how publishing was done before the GUI. Typesetting commands were simply embedded in text files along with the text itself. When the GUI made all those embedded commands invisible on the display, it was tempting to believe they went away; this was called WYSIWYG. The only problem was, those embedded commands were still there, along with a lot of other stuff, only now the entire file format was not ASCII and was no longer easily transportable. So not only did the GUI not show what you get, you got more than you bargained for, in terms of a non-universal file format.

These setbacks are why the Unix world, and therefore Linux, still favors text processing over word processing. In Linux, you embed those typesetting commands in a text file that any editor can read. Since your output is an ascii text file, anyone can edit it. If you want to preview how the typeset file appears, you can use a document previewer such as xdvi or ghostview or something.

Probably the most popular typesetting and document preparation system available for Linux is TeX, which is included with every distribution of Linux on CD-ROM that I have ever seen. TeX is pronounced ``tech'' as in ``technology.'' Don't ask me why, that's just the way Donald Knuth, the developer of TeX, pronounced it. This typesetting system is considered a low-level typesetting language, meaning that you can use TeX to format extremely minute details in the appearance of your document, from the spacing between your elipses to the font of your footnote numbers. You can do everything you can in a word processor and much more, because you have such minute control over your document.

But some people argue that writers don't want to waste time with typesetting intricacies when they should be focusing on content, which is a strong point. So, as with many applications in Unix, along came an extension to the program. Leslie Lamport developed a macro package for TeX, called LaTeX. Now this is actually pronounced like the paint and the plastic. LaTeX builds on the low-level power of TeX\ by consolidating commands into document classes. By specifying overall defaults of a document class, such as a report or an article, you apply standard typesetting defaults uniformly to all instances of that document class. This saves a lot of keystrokes for busy authors.

When you specify that you're typing a letter, that document class has a number of typesetting defaults. These defaults allow for mail merging and form letters and other such features. Likewise, a document of the class ``book chapter'' has macros for table of contents generation, title pages, indexing, and bibliography creation. Not only are document class defaults fully customizable, you're able to create your own document classes from scratch or as modifications of existing document classes.

The challenge to LaTeX is actually learning the language. Unlike word processors with buttons and menus, LaTeX has a syntax that must be learned. But, as with other Linux and Unix conventions, once you have learned it, it's familiar and there seems to be no other natural way to format a document.

Like word processors, you generally don't learn how to do everything all at once. You start with simple documents first, then you graduate to heavily formatted ones, such as mathematics and statistical tables.

Donald Knuth created TeX in order to give scientific and technical authors like himself a way of formatting pages laden with complex mathematics. Knuth wrote a series of college textbooks and needed something beyond existing word processors, which tend to have rather weak equation editing tools. Creating equations is where TeX excels. This accounts for why it is still the first choice for a desktop publishing system among scientists.

But formatting equations is only where TeX begins to excel. The beauty of working with ascii text files like those TeX produces is that you can use a variety of add-on utility programs and post-processing applications. Normally, running the LaTeX macro package on a TeX file produces a DVI file, also known as a device independent file. Since TeX and LaTeX were designed to be extensible, many utilities have been created to build or convert DVI files or TeX files to other formats, such as HTML, RTF (Microsoft's Rich Text Format), postscript, PDF (Adobe's proprietary format), SGML, and many other formats. Therefore, TeX\ documents are highly transportable.

Though they began on the Unix platform, TeX and LaTeX have been ported to nearly every popular platform, including DOS, Windows, and OS/2. Additional tools are widely available to ensure that text files from Unix machines are compatable with DOS/Windows machines. The later oftentimes insert a linefeed that appears as ^ M at the end of each line. This appears unsightly when transported back into a Unix system. Many small utilities exist to fix problems like these, such as dos2unix and unix2dos, and you can even run these from within your favorite editor. emacs has a TeX\ mode, of course. (emacs probably has modes for anything else you can think of.) The X version of emacs--called xemacs--has a visual TeX mode that applies the formatting as you type. Very nice.

In conclusion, TeX and it's LaTeX extension are extremely powerful desktop publishing tools. They're quite different from their GUI-oriented counterparts from Windows and the Macintosh, but once you become comfortable with them, you'll wonder how you ever used any other tools.



David S. Jackson
Mon Jul 14 21:14:49 PDT 1997