Title: Making a LyX Book

Author: Steve Litt

Date: Copyright (C) 2002 by Steve Litt. All rights reserved.

Part: Using this File

Chapter: How to Use this File

The purpose of this file is to be copied and pasted into LyX, after which each paragraph starting with an environment name followed either by a colon and space or, in the case of the Description environment, an underscore, is converted to the named environment. In other words, if a paragraph starts with "Section:", convert that paragraph to a section. Note that this is true only if the paragraph STARTS WITH "Section:". This paragraph contains several instances of "Section:", but in fact it's not a Section paragraph -- it's a Standard paragraph.

To find all paragraphs needing environment changes, simply search for the colon character within LyX, and change those paragraphs that start with an environment name and a colon. The list of environment names is available by clicking the environment list at the left side of the button bar.

IMPORTANT!!! After finding the above, make sure to search for the string "Description_", and any paragraphs starting with that string should be changed to the Description.

Searching is simple. Just press the Ctrl+F keystroke combination, and you'll be presented with a search dialog box. Put the text you're seeking in the "Find" input, leave the "Replace" input blank, and click either the forward arrow or the backward arrow. NEVER click the replace or replace all buttons, or one or more instances of the sought text will be deleted (actually replaced with nothing). Note that you needn't dismiss the search dialog box, nor click the document. The paragraph containing the highlight found by the search will be changed to any environment you select from the environment list.

Chapter: Cut and Paste

This chapter explains how to get the text from your browser into LyX.

Section: Copying Text

Pull up booktext.htm in a browser. Now highlight it from top to bottom.

Section: Pasting Text

Next click the edit field of your LyX program. The edit field is the yellow part into which all text is typed. Press the middle mouse button to paste.

Subsection: What If the Paste Didn't Work?

First, if you have no middle mouse button, you need to find a way to paste. Sometimes pressing the left and right mouse buttons simultaneously does the trick. Sometimes pressing Ctrl+P does it.

If still no joy, find out whether the copy from the browser went into the clipboard. Try pasting into gvim. Finally, you can try running a clipboard program such as klipper to add advanced cut and paste functionality.

Chapter: Setting the Proper Environments

This chapter details how to set the various environments in your book properly.

Section:  Which Environments to Set

Recognizing the proper environments to set is easy. In this document, all paragraphs for which an environment should be set are labeled by starting the paragraph with the environment name, followed by a colon. So the first three lines should be Title, Author and Date respectively. Any text not starting with a name and a colon should not have its environment set, but instead should remain in the default environment, "Standard".

Subsection: What is a Paragraph?

In LyX, a paragraph is all text bordered on each side by a carriage return. So when you're typing, every time you press the Enter key, you start a new paragraph. Short paragraphs, such as headings, appear as single lines. Longer paragraphs, such as this paragraph, line wrap.

Section: How to Set an Environment

It's simple. Place the cursor anywhere in the paragraph to be set. Then click the Environment dropdown list in at the left of the buttonbar, and select the proper environment from the dropdown list.

So on the first line of this document, note that it starts with "Title:", so click that line, then click the dropdown and select "Title". Notice that the line becomes centered and its size is vastly increased. That's because it's now in the title environment. And please remember, "environment" is LyXese for "paragraph style".

Section: Be Careful

Various section names resemble each other, and it's necessary to pick the right ones. You'll notice that Part, Chapter, Section and Subsection have counterparts that end with asterisks. The ones with asterisks do not show up in a table of contents, so they aren't what you want. Be sure to pick the ones without asterisks.

Another gotcha is the Subsection environment. Read carefully --- there's also a Subsubsection environment. Note the extra "sub". That's not what you want, you want Subsection.

Environments will be discussed more in the next chapter.

Chapter: Environments

As has been mentioned many times before, what we LyX people refer to as an "Environment" is what MS Office and Wordperfect people call a "paragraph style". It's a look and feel assigned to a paragraph, complete with spacing, margins, lines, font, and much, much more. LyX environments are extremely powerful.

Section: Often Used Environments

Environments can be categorized into major groups:

Itemize: Single Use Environments

Itemize: Hierarchical Environments

Itemize: Listing Environments

Itemize: Special Use Environments

The preceding environment categories will be examined in this chapter.

Section: Single Use Environments

We've already used the Title, Author and Date environments. These appear on the title page. There's also the Bibliography environment, which can appear in the back of the book.

Section: Hierarchical Environments

A book is a hierarchy. There are a few parts, and each part has chapters, and each chapter has sections, on down the line. Different document classes have different hierarchies. For instance, the Article document class does not have Part and Chapter environments. Here is a numbered list of the seven hierarchical environments available in a book:

Enumerate: Part

Enumerate: Chapter

Enumerate: Section

Enumerate: Subsection

Enumerate: Subsubsection

Enumerate: Paragraph

Enumerate: Subparagraph

The naming of the "Paragraph" and "Subparagraph" environments is unfortunate. A paragraph is a group of sentences making a single point. From a technical/publishing viewpoint, it's a group of sentences that word wrap together. A run of content contained in a "Paragraph" or "Subparagraph" environment can span many paragraphs. Remember there's NOTHING special about these two environments --- they're simply subservient to the rest.

Each of these hierarchical environments has a counterpart ending in an asterisk. Those counterparts are not listed in the table of contents and other generated lists, and in the case of Part* and Chapter* they do not have their name and number prepended.

Section: Listing Environments

The purpose of listing environments is to create, you guessed it, a list. If you think about the types of lists you see, you'll remember that some are numbered and some not. Further, some resemble tables in that they consist of a word or short phrase to the left, followed by one or more sentences of definition. The following is a non-numeric list of the listing environments:

Itemize: Itemize

Itemize: Enumerate

Itemize: Description

Itemize: List

If you want to see the same list as a numbered list, here it is:

Enumerate: Itemize

Enumerate: Enumerate

Enumerate: Description

Enumerate: List

And the following is a description formatted list explaining each. Note that the usual colon and space is replaced with an underscore, because the Description environment splits the paragraph across the first space encountered:

Description_Itemize is an unnumbered list element. These elements start with a bullet of some kind. The bullet styles can be changed as desired.

Description_Enumerate is a numbered list element. These elements start with a number. The format and type of number can be changed as desired.

Description_Description is a list element consisting of a single word in bold, followed by the rest of the paragraph not bolded. The purpose is as a list of terms and descriptions, such as the list you're now viewing.

Description_List is similar to a Description list, except it has no bold. I don't know why anyone would use it.

Section: Special Use Environments

These are environments used to connote specific types of context. Here is a description list:

Description_Quote is used for short quotes, such as "To be or not to be, that is the question", or "Great minds discuss ideas; Average minds discuss events; Small minds discuss people".

Description_Quotation is used for long quotes that typically consist of several sentences.

Description_Verse is used for poetry and/or song lyrics.

Description_LyX-Code is used to display source code.

Section: Environments are Versatile

Environments are versitile. If you know how to, you can change the appearance of an environment, both in LyX and in the final output. You can also make new environments. For instance, I made environments called Tip, Warning and Note as narrow, shaded areas to display tips, warnings and notes. Naturally, each began with a title line displaying the appropriate word (e.g. "Tip" for the Tip environment).