Linux DevCenter    
 Published on Linux DevCenter (
 See this if you're having trouble printing code examples

Living Linux

LyX, the Document Processor


Some weeks back, in the Linux word processing road map, I mentioned a new application for writing documents called LyX. In this column I'd like to present an overview, showing what you can use it for, how to get started using it, and where to go to learn more.

LyX has a GUI, but it isn't a traditional WYSIWYG ("What You See Is What You Get") word processor. In contrast to specifying exactly how each character in the document will look -- "make this word Helvetica Bold at 18 points" -- you can specify the structure of the text, such as whether a selection is a chapter heading, part of the body text, an index entry, and so forth.

LyX comes with many document classes already defined -- such as letter, article, report, and book -- containing definitions for the elements these document types may contain. You can change the look of each element and the look of the document as a whole -- and you can change the look of individual selections of text, but with these elements it's rarely necessary. Its authors call the new approach WYSIWYM, or "What You Say Is What You Mean."

Since LyX uses LaTeX as a back-end to do the actual typesetting, and it's capable of exporting documents to LaTeX input format, you can think of it as a way to write LaTeX input files in a GUI without having to know the LaTeX language commands.

But even those who do use LaTeX and related typesetting languages may find LyX useful: Many people find it quick and easy to make documents in LyX that are much harder to do in LaTeX -- such as a multi-column newsletter layout with illustrations. You can also import your LaTeX files (and plain text) into LyX for further layout or manipulation.

If you use Debian, you'll want to install the lyx package; otherwise, see if it is included with your Linux distribution or get it from the LyX Web site,

Features of LyX

When editing you'll see that LyX has all of the commands you'd expect from a word processor -- for example, some of the commands found on the Edit menu include Cut, Copy, Paste, Find and Replace, and Spell Check.

Here are some of its major features:

Writing documents with LyX

LyX runs under X, and you start it in the usual way -- either by choosing it from the applications menu provided by your window manager or by typing lyx in an xterm window.

To start a new document from scratch, you'd choose "New" from the File menu. You can also make a document from one of the many templates included with LyX, which have the basic layout and settings for a particular kind of document all set up for you -- just fill in the elements for your actual document. To make a new document from a template, choose "New from template" from the File menu and then select the name of the template to use.

The following is a list of some of the included template names and the kind of documents they're usually used for:


Documents suitable for submission to IEEE Transactions


Format suitable for papers submitted to Astronomy and Astrophysics


Template for letters formatted according to German conventions


Documents written in the SGML DocBook DTD


Movie scripts as they are formatted in the US film industry


Template for letters formatted according to Italian conventions


Article format suitable for submission to IEEE Conferences


Basic format for letters and correspondence


LinuxDoc-SGML documents as used by the Linux Documentation Project


Article format suitable for submission to publications of the American Physical Society (APS), American Institute of Physics (AIP), and Optical Society of America (OSA)


Format for producing slides and transparencies

To view what the document will look like when you print it, choose "View DVI" from the File menu. This command starts the xdvi tool, which previews the output on the screen.

To print the document, choose "Print" from the File menu. You can also export it to LaTeX, PostScript, DVI, or plain text formats; to do this, choose "Export" from the File menu and then select the format to export to. (If you plan on editing the document again in LyX, be sure to save the actual .lyx document file.)

Learning more about LyX

The LyX Documentation Project has overseen the creation of a great deal of free documentation for LyX -- including hands-on tutorials, user manuals, and example documents.

On the LyX Web site is The LyX Graphical Tour, a Web-based tutorial which shows you how to create and edit a simple LyX file.

LyX has a comprehensive set of built-in manuals, which you can either read inside the LyX editor like any LyX document or print out. All of the manuals are available from the Help menu.

For example, to run LyX's built-in tutorial, choose "Tutorial" from the Help menu. This command opens the LyX tutorial in a new buffer, which you can then read on the screen or print out by selecting "Print" from the File menu.

The following table lists the name of the manual as it appears on the menu, and describes what each contains:


An introduction to using the LyX manuals, describing their contents and how to view and print them


A hands-on tutorial to writing documents with LyX

User's Guide

The main LyX usage manual, describing all of the commonly-used commands, options, and features

Extended Features

This is "part ii" of the User's Guide, describing advanced features such as bibliographies, indices, and documents with multiple files, and techniques used in special-case situations, such as fax support, SGML-Tools support, and using version control with LyX documents.


Shows which elements of LyX can be customized, and how to go about doing that

Reference Manual

Describes all of the menu entries and internal functions

Known Bugs

LyX is in active development and, as with any large application, bugs have been found. They are listed and described here.

LaTeX Configuration

This document is automatically generated by LyX when it is installed on your system. It lists an inventory of your LaTeX configuration, including the version of LaTeX in use, available fonts, document classes available, and other related packages that may be installed on your system.

Finally, LyX installs some example documents in the /usr/X11R6/share/lyx/examples directory. Here's a partial listing of these files with a description of what each contains:


Describes how to make 'foils' (slides or overhead transparencies) with the FoilTeX package


Examples of the various bullet styles for itemized lists


An example of using LyX as a composition environment for literate programming


Techniques for numbering and labeling equations


Making your own macros in Math mode


Writing two-column bilingual documents


Examples of using tables in LyX


These files discuss and show the use of LyX in the field of astronomy.


Examples of documents written in the format used by the American Mathematical Society


Example of a DocBook document


Example of multi-column format


Example of a Hollywood script

Next week: how Linux can help manage your appointments.

Michael Stutz was one of the first reporters to cover Linux and the free software movement in the mainstream press.

Read more Living Linux columns.

Copyright © 2009 O'Reilly Media, Inc.