Structured writing with LyX

What you see is what you mean?

Download the whole article as PDF

Write a full post in response to this!


In the hubbub over the Open Document Format and competing “what you see is what you get” (WYSIWYG) word processors, a long-standing alternative model of word processing systems, with much deeper roots in the free software world, has been mostly overlooked. The author of LyX, Matthias Ettrich, calls this approach “what you see is what you mean” (WYSIWYM). However, it’s a philosophy that you will find in many “native” free software text-processing systems everywhere, from online “content management systems” to book publishing. You write what you mean, then you use some type of formatter to create presentation layouts. Sometimes it’s called “structured writing” or “structured authoring”, but whatever name it goes by, you’ll see this idea repeated in many places. LyX[1], with its integrated graphical environment, may be the friendliest place to learn it.

Starting an article in LyX

WYSIWYM does take some getting used to if you’ve come fresh from the world of WYSIWYG. The problem is that you get an urge to control details about presentation (rather than meaning or “content”), and you may try to control them too early in the authoring process.

With LyX, you don’t need to do such things. First of all, the general purpose styles that are provided with the program are good enough for everyday writing tasks (so you won’t often have to think about presentation at all). The main point, though, is that once you have the document created, you can apply transformations to the presentation after the fact, and they will be propagated throughout your document with a minimum of fuss.

Let the program do the scutwork for you. Concentrate on what you are writing, not on how you are going to format it

So, my first bit of advice when starting out with LyX has to be “let go”. Let the program do the scutwork for you. Concentrate on what you are writing, not on how you are going to format it. Just start typing. As the need arises, you can add styles to already written text.

Styles

If you take a look at the default “article” template for LyX, you can see what structured writing is all about. The document view in the window looks very much like it would in any WYSIWYG word processor, but you should notice that the style menu is prominent on the upper left. Most of your formatting work is done with this menu, and involves a single step of selecting the style for the current paragraph.

Figure 1: The most commonly used widget in the LyX interface is the style menu
Figure 1: The most commonly used widget in the LyX interface is the style menu

The main style you will use is the “Standard” style, which applies to ordinary paragraph text. After this, the next most frequent types you will deal with are the heading styles, called: “Part”, “Section”, “Subsection”, “Subsubsection”, “Paragraph”, and “Subparagraph”. For most documents, you’ll only need two or three levels of headings, but, as you can see, it is possible for a structure to be quite finely divided. If you use the numbered styles (the ones with no special markings), then section numbers will automatically be generated alongside of the headings, and autogeneration and navigation tools will treat them specially.

If you just want the “look” of a heading, but no numbering or special handling, there are variants of these styles (pre-pended with an asterisk, as in “*Subsection”) provided for that purpose. There are also less-commonly used styles, such as “Quotation” for block quotations.

Layout menus

Styling of individual words is more limited, though there are provisions for bold, emphasis, and noun text on the “Layout” menu. These names may sound a little odd, because they describe the meaning of the typography rather than its implementation. So these terms are preferred to the literal terms for what happens in the standard article template: bold, italic, and small caps. For the feature-hungry, this may seem like sparse pickings, but it reflects the reality that for most writing applications it’s extremely good advice to stick to these simple choices.

If you need more detail than this, however, it is there. Also in the Layout menu are options for the “Character…”, “Paragraph…”, and “Document…” layout characteristics. The character dialog will alter the text you currently have selected, while the paragraph dialog will affect the selected paragraphs or, if there is no selection, just the paragraph you are currently editing. The “Document…” options obviously affect the overall look of your document. Generally you won’t need to worry about document layout until you are ready to print or export your work.

Most properties, such as text size, are indicated in generic or relative terms

One thing you may notice, is that most properties, such as text size, are indicated in generic or relative terms. For example the sizes of text you are presented with have names like “Smaller” and “Larger”, rather than, say, exact point, metric, or pixel sizes. That’s because the sizes are all defined relative to the normal size of text in the document. Later on, this will be convenient, because it will allow you to change all of the sizes up or down for the whole document. So, it shouldn’t be surprising that the default behavior is not some fixed standard size, but simply “No Change”.

Figure 2: Dialogs for characters (left) and paragraphs (right), use relative terms rather than absolute ones, so that global document changes can be made later
Figure 2: Dialogs for characters (left) and paragraphs (right), use relative terms rather than absolute ones, so that global document changes can be made later

Paragraphs have a similar variety of style factors affecting alignment, spacing, and indentation. The inter-paragraph spacing is controlled, for example, by defining a “Vertical space” in the “Above” or “Below” paragraph settings. Furthermore, you have a range of choices, from internally-defined relative spacings such as “BigSkip” or “SmallSkip” to specified lengths, which may be in physical (absolute) units such as inches or millimeters, or in typographical units, such as “ex” or “sp” which are based on the size of font used (an “ex” is the height of the letter “x” in the font, while a “sp” or “space” is the full pitch between lines of typeset text). You will also note that you can choose to force a page break behind a certain paragraph or a horizontal line (these are good ways to layout chapter beginnings, for example).

One thing you will find missing, though, are the “natural” page breaks in the document. That’s because the editing interface doesn’t give them any special treatment—the handling of page breaks (aside from forced breaks) is handled as part of “document generation”, not “document editing”.

Generating output

Once you’ve finished your document, or even a first draft, you will probably want to look at the result. Most likely, you’ll simply print it out on paper, which is easy enough to do. LyX actually accomplishes this, however, by converting the contents to LaTeX, then using the LaTeX interpreter to make a “Device Independent” DVI file, then a Postscript file, and possibly a Portable Document Format (PDF) file. The details of what kind of transformation is possible will vary according to what your system has installed on it. For example, figure 3 shows the LyX export menu on the system I am using to write this article.

Don't miss out on the other pages!
123next ›last »

Write a full post in response to this!

Similar articles

0

Do you like this post?
Vote for it!

Copyright information

This article is made available under the "Attribution-Sharealike" Creative Commons License 3.0 available from http://creativecommons.org/licenses/by-sa/3.0/.

Biography

Terry Hancock: Terry Hancock is co-owner and technical officer of Anansi Spaceworks, dedicated to the application of free software methods to the development of space.

Tyler's picture

Great article!

Submitted by Tyler on Tue, 2006-07-25 15:35.

Vote!
0

Wow, that's just what I was looking for. I've been meaning to look into TeX and LaTeX for a while, but was put off by their apparent complexity. Reading your article and skimming the LyX site reassures me that mere mortals are capable of using it! One question for you: one of the last things keeping me from doing away with the Windows partition on my desktop is my reliance on Word/Endnote for my writing needs - is LyX/BibTex a suitable replacement? It sounds like it might be, but I'm facing a thesis deadline and I can't spend more than a few days getting started with new software at this point.

Thanks!

Tyler

Terry Hancock's picture

LyX and BibTeX

Submitted by Terry Hancock on Mon, 2006-07-31 17:15.

Vote!
0

Well, I'm using it for the book I'm writing, but I haven't been using it long enough to be sure about it. This is the first time I've ever used BibTeX, and I'm not entirely sure how to make it do what I want. When I use it in LyX, I get a particular notation style (So-and-so, 199x) -- that is, "author-date" notation. That might be just what you need for a thesis, but I think it's a little heavy for my project (I may just have to do some reorganizing or not use academic-style point-by-point citations).

I may have some special problems because something like 90% of my references are to websites, and they don't necessarily have an attributed author to credit or a specific year. They're just on-going concerns, which I'm using as primary references. So I wind up with (?, ?) as the credit! Yuck. There must be a way to fix that, but I haven't figured it out yet. It works fine for the conventional paper and book references, though.

In general, I wouldn't recommend that anyone change any critical piece of software when they have "only a few days" to spend adjusting to it, so if I were in your shoes, I'd probably finish my thesis, then figure out how to use LyX/BibTeX for my dissertation! However, I'm equally sure that it can do the job if you can take the time to figure it out, and in my experience, writing in LyX is much more relaxing than using more conventional word processors.

Raghu Kodali's picture

Lyx

Submitted by Raghu Kodali on Wed, 2007-01-03 15:09.

Vote!
0

I started using Lyx for serious work a few days back. Before that I was playing around with it. I could not get a feel of what it is while playing around. But once I started doing serious work, I can feel the differece between conventional wordprocessors & Lyx. I feel that LYX is much better to express yourself instead of concentrating on formatting, colors etc.

I think I finally found a nice tool to do my documentation.

Anonymous visitor's picture

missing classes

Submitted by Anonymous visitor on Wed, 2007-02-14 18:11.

Vote!
0

I am unable to learn how to use lyx . Even when I open templates I can not figure out how to produce a dvi or any other output.Can any body help
ako@gmail.com