The \LyX{} Tutorial

The LYX Tutorial

by Amir Karger and the LYX Team

Chapter 1
Introduction

1.1  Welcome to LYX!

This file is designed for all of you who have never heard of LATEX, or don't know it very well. Now, don't panic - you won't need to learn LATEX to use LYX. That is, after all, the whole point of LYX: to provide an almost-WYSIWYG interface to LATEX. There are some things you will need to learn, however, in order to use LYX effectively.

Some of you probably found your way to this document because you tried to put two spaces after a ``.'' or tried to put 3 blank lines between paragraphs. After much frustration, you found you couldn't. In fact, you'll find that most of the little tricks you're accustomed to using in other word processors just won't work in LYX. That's because most word processors you've used before require you to manually put in all spacings, font changes, and so on. So you end up not only writing a document but typesetting it, too. LYX does the typesetting for you, in a consistent fashion, letting you focus on the important things, like the content of your writing.

So, bear with us and read on. Reading this tutorial is definitely worth the time.

1.2  What the Tutorial is and What it isn't

Before we get started with this section, we want to make a quick note of something. The Tutorial uses the notation outlined in the Introduction. If you came to this manual first, go read the Introduction. Yes, we mean now.

Now that you know which fonts mean what, we want to talk a bit about what this Tutorial is for.

1.2.1  Getting the Most out of the Tutorial

This tutorial consists of examples and exercises. To get the most out of this document, you should read through the document, typing all the silly little things we're telling you to type and trying out all of the exercises to see if you get them right. For convenience, you might want to print out the PostScript« version of this document.

If you are familiar with LATEX, you'll probably be able to read the Tutorial somewhat faster, since many LYX ideas are just LATEX ideas in disguise. However, LYX does have idiosyncrasies1 you'll want to learn about. Even if you don't feel like reading the rest of the Tutorial, you should definitely check out Section , which is specifically written for experienced LATEX users.

Section is a holdover from an earlier version of the Tutorial, and is a bit pithy. Still it's a nice ``at-a-distance'' introduction to LYX, so you might want to glance over it to get a feel for what LYXis all about.

1.2.2  What You won't Find:

So, brave soul, it's time to move onward. You can take a brief excursion through the next section, or you can go on to section .

1.3  What is LYX?

1.3.1  Overview

Part of the initial challenge of using LYX comes from the change in thinking that you, the user, must make. At one time, all we had for creating documents were typewriters, so we all learned certain tricks to get around their limitations. Underlining, which is little more than overstriking with the ``_'' character, became a way to emphasize text. To create a table, you figured out beforehand how big each column was to be and set the appropriate tab stops. The same applied for letters and other right justified text. Hyphenation at the end of a line required a careful eye and a lot of foresight.

In other words, we've all been trained to worry about the little details of which character goes where.

Consequently, almost all word processors have this mentality. They still use tab stops for adding whitespace. You still need to worry about exactly where on the page something will appear. Emphasizing text means changing a font, similar to changing the typewriter wheel. You get the idea.

This is where LYX differs from an ordinary word processor. You don't concern yourself with what character goes where. You tell LYX what you're doing and LYX takes care of the rest, following a set of rules called a style. Let's look at a little example:

Suppose you're writing a report. To begin your report, you want a section called ``Introduction.'' So, you go into whatever menu it is in your word processor that changes font sizes and decide on a new font size. Then you turn on bold face. Then you type, ``1.__Introduction''. Of course, if you later decide that this section belongs someplace else in the document, or if you insert a new section before it, you need to change the numbering for this and all following sections, as well as any entry in the table of contents.

In LYX, you go to the pull-down on the far left of the button bar and select Section, and type ``Introduction.''

Yes, that's all. If you cut and paste the section, it will automatically be renumbered - everywhere. There's even a way to make LYX automatically update any references to the section inside the file.

Then there's the problem of consistency. Five days later, you reopen your report and start section 4. However, you forget that you were using 18pt bold instead of 16pt, so you type in the heading for section 4 in a different font that what you used for section 1. That problem doesn't even exist in LYX. The computer takes care of all that silly bookkeeping about which thing has what size font, not you. After all, that's what a computer is good at.

Here's another example. Suppose you're making a list. In other word processors, a list is just a bunch of tab stops and newlines. You need to figure out where to put the label for each list item, what that label should be, how many blank lines to put between each item, and so on. Under LYX, you have only two concerns: what kind of list is this, and what do I want to put in it. That's it.

So, the basic idea behind LYX is: specify what you're doing, not how to do it. Instead of ``what you see is what you get,'' the LYX model is ``what you see is what you mean'' (WYSIWYM).

1.3.2  Differences between LYX and Word Processors2

Here's a list of things you won't find in LYX:

Tab stops, along with a ruler showing you the position of things on the page, are useless in LYX. The program worries about where things go on the page, not you. Extra whitespace is similar; LYX adds them where necessary, depending on context. Not being able to type two blank lines in a row will be annoying at first, but it makes more sense once you're thinking in WYSIWYM terms.

Here are some things that exist in LYX, but aren't used as you might think:

Although they exist in LYX, you generally don't need them. LYX will take care of these things for you, depending on what you're doing. Different parts of the document are automatically set in a different typeface and font size. Paragraph indenting is context dependent; different types of paragraphs get indented differently. Page breaks get handled automatically, as well. In general, the space between lines, between words, and between paragraphs is variable, set by LYX.3

Lastly, there are a few areas where LYX [and LATEX] surpasses many word processors:

Granted, many modern word processors can handle mathematical symbols, tables, and hyphenation, and some are even moving towards style definitions and the WYSIWYM concept. However, they've only recently been able to do so, whereas LYX is built upon the LATEX document preparation system. LATEX has been around for over 10 years, and works. All of the bugs have been long since ironed out.4

1.3.3  What the heck is LATEX?

LATEX is a document preparation system designed by Leslie Lamport in 1985.5 It, in turn, was built up from a typesetting language called TEX, created by Donald Knuth in 1984. ``TEX'' is pronounced like ``blech!'' which is how many people feel about it. However, most folks don't understand just what TEX is. TEX takes a sequence of typesetting commands, written in a script in an ASCII file, and executes them. It's a bit more complicated than a typewriter, but not nearly as involved as an actual printing press. In any case, what comes out of TEX is the so-called ``device independent'' format file, or dvi for short. You can then feed the dvi file to anything that understands dvi, or converts dvi to other formats like PostScript«.

If it weren't for one other feature, all TEX would be is a typesetting engine. However, TEX also allows you to define macros. This is where the action begins.

Most people who use TEX are actually using a macro package which Knuth created to hide a lot of the typesetting details. This is what most people think of when they think of TEX. Ordinary users don't work with raw TEX, which are the bare-bones typesetting commands. People creating new macro-packages do that. And here's where Leslie Lamport enters our story. He wanted a macro package that was more user-oriented and less typesetter-oriented, a set of commands that consistently typeset things like sections or tables or math formulae in a uniform, consistent fashion with as little fuss as possible. This is how LATEX was born.

Now, in parallel with the development and growth of LATEX, other folks were creating their own custom macro packages for TEX, ones to make slides or articles for math journals and so on. Some used the raw TEX to do this, others began modifying LATEX. To try and unify this mess, a team of LATEX-nicians, [including Lamport, of course] began to work on LATEX2e, the current version of LATEX, during the late 1980's. This new version of LATEX has commands which provide an easier-to-use interface to TEX's macro-creating commands [remember TEX?], aid in the using of new fonts, and so on. In fact, LATEX is quite an extensive language in its own right! Users around the world have been creating their own add-ons for LATEX beyond the standard ones.

There are two ways to extend LATEX: classes and styles. A class is a set of LATEX [and TEX] macros describing a new type of document, like a book, or an article. There are classes for slides, for physics and math journals... some universities even have a class for their thesis format! A style differs from a class in that it doesn't define a new type of document, but a different type of behavior that any document can use. For example, LYX controls page margins and line spacing using two different LATEX style-files designed for these purposes. There are style-files for a whole slew of things: printing labels or envelopes, changing indentation behavior, adding new fonts, manipulating graphics, designing fancy page headings, customizing bibliographies, altering the location and appearance of footnotes, tables, and figures, customizing lists, et cetera, et cetera, et cetera.

Here's a summary:

[TEX:]Typesetting language with macro capability.
[LATEX:]Macro package built upon TEX.
[classes:]Descriptions of a type of document, using LATEX.
[styles:]Alters the default behavior of LATEX in some way.
[LYX:]Visual, WYSIWYM word-processor that uses LATEX in all its glory to do its printing.

The idea of this section was to try and explain why LYX works somewhat differently from other word processors. The reason is simple: LYX uses LATEX as its printing backend. Just like LATEX, LYX focuses on the context of your writing - what you are typing. The computer then handles how it should look.

Oh - one last thing. LATEX is pronounced like TEX is. It rhymes with ``hey blech.''6 Usually. Lamport says in his book, though, that ``lay-tecks is also possible''. ``LYX,'' on the other hand, is pronounced ``licks.'' Or ``lucks,'' or ``looks,'' depending on what country you're from...

Chapter 2
Getting Started with LYX

2.1  Your First LYX Document

OK. You're ready to start writing. Before you do, though, there are a few things we need to mention, which will hopefully make the Tutorial more instructive, useful, and fun.

Because there's lots of information that we won't be giving you, the first thing that you need to do is find the other help files. Luckily, this is very simple. Start up LYX. Choose the User's Guide from the Help menu. You may want to load the Tutorial as well (if you're not reading it on screen already). This way, you can read them while you're writing your own file7. Note that once you've got more than one document open, you can use the Documents menu to switch between them. The Tutorial will not cover in detail subjects which are described in the other LYX manuals. This may make life a bit harder for you at the beginning, but it will keep the Tutorial short. It will also get you in the habit of using the other manuals, which - in the long run - will save you a lot of time.

In this Tutorial, we're going to assume that you have a fully working version of LYX, as well as LATEX, xdvi or some other dvi viewer, dvips or some other way of converting dvi documents to PostScript« documents, and a working printer. This is a lot to assume. If any of this is not true, you (or a friendly system administrator) will need to set up your system. You can find information on setup in other manuals.

Finally, we've written a file to let you practice your LYX skills on. It's called example_raw.lyx. Imagine that it was typed by someone who didn't know about any of LYX's great features. As you learn new LYX functions, we'll suggest that you fix those parts of example_raw.lyx. It also contains ``subtle'' hints about how to fix things8. If you want to cheat (or check what you've done), there's also a file called example_lyxified.lyx which contains the same text as written and typeset by a LYX master.

The example files can be found in the examples/ directory, which you can get to by selecting File-Open and then clicking on the Examples button. Open the raw document, and use File-Save As to save a copy in your own directory for you to work on. As you fix parts of the raw document, check to see how those changes affect the dvi output.

By the way, the examples/ directory contains lots of other examples files. They will show you how to do various fancy things with LYX. They are especially useful to display things that (due to length or other reasons) won't fit in the documentation. After you read the Tutorial, or when you're confused about how to do something fancy in LYX, take a look at these files.

2.1.1  Typing, Viewing, and Printing

Congratulations! You've written and printed your first LYX document. All of the rest is just details, which is covered in the rest of the Tutorial, the User's Guide, and the Reference.

2.1.2  Simple Operations

LYX can of course do most of the things you're used to doing with a word processor. It will word-wrap and indent paragraphs automatically. Pull down a couple menus now9 and you'll see that most of the simple commands (e.g., File-Exit, Edit-Paste, File-Print) have the name you expect them to have, are in the menu you'd expect them to be in, and work as you expect them to work. Here's a quick description of how to do some other simple actions.

[Undo]LYX has capacity for ``infinite undo'', which means you can undo everything you've done since your current editing session started, by selecting Edit-Undo over and over again. If you undo too much, just select Edit-Redo to get it back. Currently, undo is limited to 100 steps. Undo also doesn't work for everything, not for changes to the document layout for instance.
[Cut/Paste/Copy]Use Edit-Cut, Edit-Paste, and Edit-Copy to cut, paste, and copy. Or automatically paste selected text with the middle button.
[Find/Replace]Use Edit-Find & Replace for a case-sensitive search. In the resulting popup, search with the forward and backward arrows, and use the Replace button to replace a word you've found.

[Character Formatting]You can emphasize text (which will generally put characters in italics), put it in bold face, or in NOUN STYLE (usually small caps, used for people's names) from the toggle buttons in the Layout menu.
[Toolbar]There are buttons on the toolbar (just below the menus) which allow you to do some of the more popular functions, such as Paste and Print. If you hold the mouse above one of the buttons on the toolbar, a little yellow note will tell you that button's function.
[Minibuffer]The gray line at the very bottom of the LYX window is called the minibuffer. This line will show all sorts of useful information. For example, when you save, it will tell you the name of the file you just saved. Some error messages may show up here, too. Note that you can type in the minibuffer too. This gives you access to all sorts of interesting functionality, including functionality which could break your document. In other words, don't type in the minibuffer unless you know what you're doing.

Of course, you haven't yet written enough to make most of these functions useful. As you write more, though, try undoing, pasting, etc.

2.1.3  WYSIWYM: Whitespace in LYX

One of the hardest things for new users to get used to is the way that LYX handles whitespace. As many times as you hit Return, you'll only get one blank line. As many times as you hit Space, you'll only get one space. On a blank line, LYX won't let you type even one space. The Tab key won't move you forward one tab stop; in fact there are no tab stops! There's no ruler at the top of the page to let you set tabs or margins, either.

Many commercial word processors are based on the WYSIWYG principle: ``What You See Is What You Get.'' LYX, on the other hand, is based on the principle that ``What You See Is What You Mean.'' You type what you mean, and LYX will take care of typesetting it for you, so that the output looks nice. A Return grammatically separates paragraphs, and a Space grammatically separates words, so there is no reason to have several of them in a row; a Tab has no grammatical function at all, so LYX does not support it. Using LYX, you'll spend more of your time worrying about the content of your document, and less time worrying about the format. See Section 1.3 for more information on the WYSIWYM concept.

LYX does have (many) ways to fine-tune the formatting of your document. After all, LYX might not typeset exactly what you mean. The User's Guide has information about all that. It includes HFills and vertical space - which are more powerful and versatile than multiple spaces or blank lines - and ways to change font sizes, character styles, and paragraph alignments by hand. The idea, though, is that you can write your whole document, focusing on content, and just worry about that fine-tuning at the end. With standard word processors, you'll be distracted by document formatting throughout the writing process.

2.2  Environments

Different parts of a document have different purposes; we call these parts environments. Most of a document is made up of regular text. Section (chapter, subsection, etc.) titles let the reader know that a new topic or subtopic will be discussed. Certain types of documents have special environments. A journal article will have an abstract, and a title. A letter will have neither of these, but will probably have an environment that gives the writer's address.

Environments are a major part of the ``What You See Is What You Mean'' philosophy of LYX. A given environment may require a certain font style, font size, indenting, line spacing, and more. This problem is aggravated, because the exact formatting for a given environment may change: one journal may use boldface, 18 point, centered type for section titles while another uses italicized, 15 point, left justified type; different languages may have different standards for indenting; and bibliography formats can vary widely. LYX lets you avoid learning all the different formatting styles.

The Environment box is located on the left end of the toolbar (just under the File menu). It indicates which environment you're currently writing in. While you were writing your first document, it said ``Standard,'' which is the default environment for text. Now you will put a number of environments in your new document so that you can see how they work. You'll do so with the Environment menu, which you open by clicking on the ``down arrow'' icon just to the right of the Environment box.

2.2.1  Sections and Subsections

Type the word Introduction on the first line of your LYX file, and select Section from the Environment menu10. LYX numbers the section ``1'' and typesets the section heading (title) in a larger font. (Of course, the section heading will also be typeset correctly in the dvi or printed document.) Now hit Return. Note that the Environment box changes from ``Section'' back to ``Standard''. Section headings, like most environments, are assumed to end when you type Return.11 Type the document introduction:

This is an introduction to my first LyX document.

Hit Return again, and select Section from the Environment menu again. LYX writes a ``2'' and waits for you to type a title. Type More Stuff, and you'll see that LYX again sets it as a section title.

It gets better. Go to the end of section one again (after ``my first LYXdocument'') and hit Return again, and select Section from the Environment menu again. Again, LYX writes ``2'' and waits for you to type a title. Type About This Document. Section ``More Stuff'', which used to be section 2, has been automatically renumbered to section 3! In true WYSIWYM fashion, you just need to identify the text that makes up the section titles, and LYX takes care of numbering the sections and typesetting them.

Hit Return to get back to the Standard environment, and type the following five lines:

Sections and subsections are described below.

Section Description

Sections are bigger than subsections.

Subsection description

Subsections are smaller than sections.

Click on the second line and select Subsection from the Environment menu. LYX numbers the subsection ``2.1'', and typesets it in a font which is bigger than regular text but smaller than the section title. Change the fourth line Subsection environment as well. As you probably expected, LYXautomatically numbered the section ``2.2''. If you put yet another section before section 2, section 2 will be renumbered as section 3, and the subsections will be renumbered to ``3.1'' and ``3.2''.

Further levels of sectioning include Subsubsection, Paragraph, and Subparagraph. We'll let you play with these on your own. You may notice that paragraph and subparagraph headings are not numbered by default, and that subparagraphs are indented; see the User's Guide to change this. Chapter headings are actually the highest level of sectioning, above Sections, but you're only allowed to use them in certain types (textclasses) of LYX documents (see Section ).

Finally, you may want to have sections or subsections that are not numbered. There are environments for this as well. If you change one of your section headings to the Section* environment (you may have to scroll down in the Environment menu to find it), LYX will use the same font size for the heading as it uses for a regular section, but it won't number that section. There are corresponding ``starred'' heading environments for Subsection and Subsubsection. Try changing some of your sections or subsections to the starred environments, and note how the other sections' numbers are updated.

Exercise: Fix the section and subsection headings in example_raw.lyx.

2.2.2  Lists and sublists

LYX has several different environments for typesetting lists. The various list environments free you from hitting Tab a million times when writing an outline, or from renumbering a whole list when you want to add a point in the middle of the list, and lets you concentrate on the list content.12 Different types of documents logically require different list environments:

Let's write a list of reasons why LYX is better than other word processors. Somewhere in your document, type:

Lyx is better than other word processors because: 

and hit Return. Now select Itemize from the Environment menu. LYX writes a ``bullet'' (actually, an asterisk, which will be converted to a round circle on output) on the line. Type in your reasons:

Typesetting is done for you.

Math is WYSIWYG

Lists are very easy to create!

List environments, unlike headings, do not end when you type Return. Instead, LYX assumes you're going on to the next item in the list. The above will therefore result in a three-item list. If you want more than one paragraph within one list item, one way is to use the Protected Return, which you get by typing C-Return. In order to get out of the list, you need to reselect the Standard environment (or just use the keybinding, M-p s).

You've got a beautiful itemized list. You might want to run LATEX to see how the list looks when printed out. But what if you wanted to number the reasons? Well, just select the whole list13 and choose Enumerate from the Environment menu. Pow! As we mentioned, if you add or delete a list item, LYX will fix the numbering.

While the list is still selected, you can change to the other two list environments, Description and List, in order to see what they look like. For those two environments, each list item is made up of a term, which is the item's first word, followed by a definition, which is the rest of the paragraph (until you hit Return.) The term is either typeset in boldface (Description) or separated by a ``Tab''14 (List) from the rest of the paragraph. If you want to have more than one word in the definition, then separate the words with Protected Spaces, which are made by typing C-Space and show up as small pink ``u''s.

Exercise: Typeset the list in example_raw.lyx

You can nest lists within each other in all sorts of interesting ways. An obvious example would be writing outlines. Numbered and bulleted lists will have different numbering and bulleting schemes for sublists. See the User's Guide for details on the different sorts of lists, as well as examples which use a lot of nesting.

2.2.3  Other Environments: Verses, Quotations, and More

There are two environments for setting quotations apart from surrounding text: Quote for short quotes and Quotation for longer ones. Computer code (the LYX-Code environment, also used in the Tutorial for the long typing examples) is written in a typewriter font; this environment is the only place in LYX where you're allowed to use multiple spaces to allow code indenting. You can even write poetry15 using the Verse style, using Return to separate stanzas, and C-Return to separate lines within a stanza. See the User's Guide for more complete descriptions of all of the available LYX environments.

Exercise: Correctly typeset the Quote, LYX-Code, and Verse inexample_raw.lyx

Chapter 3
Writing Documents

The previous chapter hopefully allowed you to get used to writing in LYX. It introduced you to the basic editing operations in LYX, as well as the powerful method of writing with environments. Most people who use LYX, though, will want to write documents: papers, articles, books, manuals, or letters. This chapter is meant to take you from simply writing text with LYX to writing a complete document. It will introduce you to textclasses, which allow you to write different sorts of documents. It will then describe many of the additions that turn text into a document, such as titles, footnotes, cross references, bibliographies, and tables of contents.

3.1  Textclasses and Templates: Writing Letters

Different sorts of documents should be typeset differently. For example, books are generally printed double-sided, while articles are single-sided. In addition, many documents contain special environments: letters contain some environments - such as the sender's address and the signature - which do not make sense in a book or article. The LYX textclass16 takes care of these large scale differences between different sorts of documents. This Tutorial, for example, was written in the Book textclass. Textclasses are another major part of the WYSIWYM philosophy; they tell LYXhow to typeset the document, so you don't need to know how.

Your document is probably being written in the Article textclass17. Try changing to other textclasses (using the Class menu in the Layout-Document popup) to see how they are typeset differently. If you change your document to the Book textclass and look at the Environment menu, you'll see that most of the allowed environments are the same. However, you can now use the Chapter environment. If you're ever unsure about which environments you can use in a given textclass, just consult the Environment menu.

Font sizes, one- or two-column printing, and page headings are just some of the ways journals' typesettings differ from one another. As the Computer Age continues to mature, journals have begun accepting electronic submissions, creating LATEX ``style files'' so that authors can submit correctly typeset articles. LYX is set up to support this as well. For example, LYX supports typesetting (and extra environments) for the American Mathematics Society journals using the Article (AMS) textclass.

Here's a very quick reference to some of the textclasses. As usual, see the User's Guide for details.

NameNotes
articleone-sided, no chapters
article (AMS)layout & environments for American Math Society
reportlonger than article, two-sided
bookreport + front and back matter
slidestransparencies (also including FoilTEX)
letterlots of extra environments for address, signature...

3.2  Templates: Writing a Letter

One of the most popular textclasses is Letter. One way to write a letter would be to open a New file, and choose Letter from the Class menu in the Layout-Document popup. While this is the most obvious way to write a letter, it seems like extra work. Every time you write a business letter, you want to have your address, the address you're sending to, a body, a signature, etc. LYX therefore has a template for letters, which contains a sample letter; once you have a template, you can just replace a couple parts of the letter with your text each time you write a letter.

Open a new file with File-New from template. After choosing a new filename, select latex_letter.lyx from the Choose Template popup. Save and print the file to see how the various environments are typeset.

When you look at the Environment menu, you'll see several environments, like the My Address environment, which don't even exist in most other textclasses. Others, like Quote and Description, are familiar. You can play around for a while to figure out how the various environments work. You'll notice for example that the Signature environment has the word ``Signature:`` in red before the actual text of the signature. This word doesn't show up in the actual letter, as you'll see if you try printing the file. It's just there to let you know where the signature goes. Also, note that it doesn't matter where in the file the Signature line is placed. Remember, LYXis WYSIWYM; you can put the Signature environment anywhere you want, but LYX knows that in the printout, the signature should be at the end.

A template is just a regular LYX file. This means you can fill in your address and signature and save the file as a new template. From now on, any time you want to write a letter, you can use the new template to save time. We probably don't have to suggest an actual ``exercise'' here; just write a letter to someone18!

Templates can be a huge time-saver, and we urge you to use them whenever possible. In addition, they can help a person learn how to use some of the fancier textclasses. Finally, they may be useful for a person who is configuring LYX for a bunch of less computer-aware users. When they're first learning LYX, it will be much less intimidating if they have a letter template customized for their company, for example.

3.3  Document Titles

LYX (like LATEX) considers the title - which may contain the actual title, the author, the date, and even an abstract of a paper - to be a separate part of the document.

Go back to your newfile.lyx document and make sure it's using the Article textclass.19 Type a title on the first line, and change the line to the Title environment. On the next line, type your name and change it to the Author environment. On the next line, write the date in the Date environment. Type a paragraph or two summarizing your document using the Abstract environment. Now see how it looks when printed.

Exercise: Fix the title, date, and author in example_raw.lyx

3.4  Labels and Cross-References

You can label a section (or subsubsection, or, more rarely, just a random piece of text) in your document. Once you do so, you can refer to this section in other parts of the document, using cross-references. You can refer either to the section's number, or to the page that the section appears on. As with sections and footnotes, LYX worries about the cross-references for you. Automatic labels and cross-references are one of the best advantages of LYX (and LATEX) over conventional word processors.

Your first label

Let's mark our second section, whose title is ``About This Document''. Click at the end of the section title line, and select Insert-Label. A popup asks you for a section name. Type sec:aboutdocument, which seems like a good descriptive label that won't get confused with other labels we might add.20 When you click on OK, the label name will be placed in a box next to the section title.

By the way, you could have put the label right anywhere within the section as well; section references will refer to the last section or subsection whose heading comes before the label. However, putting it on the same line as the section title (or, perhaps, on the first line of the section's text) ensures that page references will reference the beginning of the section.

So far you haven't done anything - the dvi file will look exactly the same, since labels don't show up in the printed document. However, now that you've added a label, you can refer to that label with cross-references. We'll do that next.

Your first cross-references

Place the cursor somewhere in section 2 of your document. Type

If you want to know more about this document, then see  
section , which can be found on page .

Now - with the cursor after the word ``section'' - choose Insert-Cross-Reference. The Insert Reference popup pops up. It shows a list of the possible labels you can reference. At the moment, there should be only one, ``sec:aboutdocument''. Select it (it may be selected by default) and click on Insert Reference. Now put the cursor after the word ``page'', and click on Insert Page Number from the Insert Reference popup.

LYX puts the references in a box right where the cursor was. In the printed document, this reference marker will be replaced with either the page or section number (depending on what you selected in the Insert Reference popup). Conveniently, a cross-reference acts a hyperlink when you're editing a document in LYX; clicking on it will move the cursor to the referenced label. Use File-Update dvi, and you'll see that on the last page we refer to ``section 2'' and ``page 1'' (or whatever page section 2's title is on).

More fun with labels

We told you that LYX worries about numbering cross-references; now you can test that. Add a new section before section 2. Now rerun LATEX, and - voilÓ! - the section cross reference changed to 3! Change ``About this Document'' to a subsection, and the cross-reference will reference subsection 2.1 instead of section 3. The page reference won't change unless you add a whole page of text before the label, of course.

If you want some more practice with labels, then try putting a label, ``sec:myfirstlabel'', where your first cross-reference was, and refer to that label from elsewhere in the document. If you'll be inserting cross-references often (if, for example, you're writing a journal article), it may be convenient to leave the Insert Reference window open.

If you want to make sure that the cross-referencing gets the pages right even for larger documents, Copy a couple pages of text from the User's Guide to the clipboard, and Paste the stolen text into your document21.

Exercise: Fix the references in example_raw.lyx

3.5  Footnotes and Margin Notes

Footnotes can be added using the Insert Footnote button in the toolbar22 or Insert-Footnote. Click at the end of the word ``LYX'' somewhere in your document and hit the Insert Footnote button. A footnote line opens underneath the line you are currently typing on. At the left end of the line, you'll see the word ``foot'' written in red on a gray background. The rest of the line is outlined in red; that's where you write your footnote. LYX should place the cursor at the beginning of the line. Type

LyX is a typesetting word processor.

Now click on the word ``foot.'' The footnote line disappears, leaving the word ``foot'', superscripted in red, showing where the footnote marker will be in the printed text; this is called ``folding'' the footnote. You can unfold the footnote at any time - and re-edit its text, if you want - by clicking on the red ``foot'' marker.

You may wonder why the footnote marker is a word instead of a number. The answer is that LYX worries about the footnote numbering for you in the printed text. You can see this yourself by looking at the dvi file (or printout). If you add other footnotes, LYX will renumber the footnotes. Since LYX(well, LATEX, actually) takes care of the footnote numbering, there's really no need to put the numbers in the LYX file.

A footnote can be cut and pasted like normal text. Go ahead; try it! All you need to do is select the footnote marker23 and Cut and Paste it. In addition, you can change regular text to a footnote, by selecting it and hitting the Insert Footnote button; change a footnote to regular text by clicking the Insert Footnote button when the cursor is in a footnote.

Margin notes can be added using the Insert Margin Note button24 or Insert-Margin Note. Margin notes are like footnotes, except that:

Change your LYX footnote back to text, then select and change it to a margin note. Run LATEX again to see what the margin note looks like.

Exercise: Fix the footnote in example_raw.lyx

3.6  Bibliographies

Bibliographies are similar to cross references. The bibliography contains a list of references at the end of the document, and they can be referenced from within the document. Like section titles, LYX and LATEX make your job easier by automatically numbering the bibliography items and changing citations when the items' numbers change.

Go to the end of the document and switch to the Bibliography environment. Now, each paragraph you type will be a reference. Type The Lyx Tutorial, by the LyX DocTeam as your first reference. Note that LYX automatically puts a number in a box before each reference. Click on the boxed reference number, and a Bibliography item popup appears. You use the first field, the Key, to refer to this reference within the LYX document. By default, it is a number. Change the Key field to ``lyxtutorial'' to make it easy to remember.

Now pick somewhere in your document that you would like to insert a reference. Do so with Insert-Citation Reference. LYX draws a gray box with three question marks surrounded by brackets, and a Citation popup appears. The first field in this popup is also called Key, and this field allows you to choose which bibliography item you want to cite25. Using the arrow pulldown menu at the right of the Key field, select ``lyxtutorial'' (right now, that's the only item in the bibliography). Now run LATEX, and you'll see that the citation appears in brackets in the text, referring to the bibliography at the end of the document.

How are the other fields used? The Remark field in the Citation popup will put a remark (such as a reference to a page or chapter within the referenced book or article) in the brackets after the reference. If you want the references to have labels instead of numbers in the printed output (for example, some journals would use ``[Smi95]'' to refer to a paper written by Smith in 1995), use the Label field in the Bibliography item popup. As usual, you can see the User's Guide for details.

Exercise: Fix the bibliography and citation in example_raw.lyx

3.7  Table of Contents

You may want to put a table of contents at the beginning of your document. LYXmakes this very easy to do. Just hit Return after your document title and before your first section title26 and choose Insert-Lists & TOC-Table of Contents. The words ``Table of Contents'' will appear in a box (otherwise known as an inset) on the first line of the document.

This may not appear to be very useful. However, if you look at your dvi file, you will see that a table of contents has been generated, listing the various sections and subsections in your document. As usual, if you reorder sections or create new ones, you will see those changes in the dvi file when you update it.

The table of contents is not printed in the on-screen version of the document, because you can't edit it anyway. However, you can display the table of contents in a separate window by clicking on the table of contents inset, or by using Edit-Table of Contents27. This is a very useful tool. You can use the Table of Contents window to move around your document. Clicking on a (sub)section title in the Table of Contents window will highlight that line and move the cursor (in the LYX editing window) to that place in the document. You can also use the arrow keys to move up and down in the table of contents. You may therefore find it convenient to leave this window open throughout editing sessions.

To get rid of the Table of Contents, you can delete the table of contents marker just like any other character.

Exercise: Fix the table of contents in example_raw.lyx

Chapter 4
Using Math

LATEX is used by many scientists because it outputs great looking equations, avoiding the control characters used by word processors and their equation editors. Many of these scientists are frustrated, however, because writing equations in LATEX is more like programming than writing. Happily, LYX has WYSIWYM support for equations. If you are used to LATEX, you'll find that all of the usual LATEX math commands can be typed in normally, but they will show up in a WYSIWYM fashion. If, on the other hand, you've never written in LATEX, then the Math Panel will allow you to write professional-looking math quickly and easily28.

4.1  Math Mode

Somewhere in your LYX document, type:

I like what Einstein said, E=mc^2, because it's so simple. 

Now, that equation doesn't look very good, even in the dvi file; there's no space between the letters and the equals sign, and you'd like to write an actual superscript for the ``2''. That bad typesetting happened because we didn't tell LYX that we were writing a mathematical expression, so it typeset the equation like regular old text.

Math is written in Mathed, otherwise known as math mode. In order to enter math mode, just click the toolbar button with [(a+b)/ c] written on it in blue. LYX will open a little blue square, with a purple rectangle around it. The blue square is an insertion point, telling you that Mathed is waiting for you to insert something, and the rectangle indicates that you are in Mathed. LYX has placed the cursor in the blue square, so just type E=mc^2 again. The expression is typed in blue, and the blue square disappears as soon as the insertion point is not empty. Now type Esc to leave Mathed (Note: clicking on the math button again will not get you out of Mathed). The purple rectangle disappears, leaving the cursor to the right of the expression, and now if you type something, it will be regular text.

Run LATEX and look at the dvi file. Notice that the expression was typeset nicely, with spaces between the letters and the equals sign, and a superscript ``2''. Letters in math mode are assumed to be variables, and come out in italics. Numbers are just numbers.

Mathed is another example of the WYSIWYM philosophy. In LATEX, you write a mathematical expression using text and commands like sqrt; this can be frustrating, because you can't see what an expression looks like until you LATEX the file, and may have to spend time to find missing brackets or other ``bugs''. On the other hand, LYX doesn't attempt to get the expression to look perfect (WYSIWYG), but it gives you an extremely good idea of what the expression will look like. LATEX then takes care of the professional typesetting. 99% of the time, you won't have to make any changes to the font sizes or spacing that LATEX outputs. This way (sorry to be so repetitive) you can focus on the content of your mathematical expressions, not their format.

4.2  Navigating an Equation

Now let's change E = mc2 to E = 1+mc2 . Use the arrow keys to move the cursor into the expression. Note that when you enter the expression, the purple rectangle appears to let you know you're back in Mathed. Now you can use Left and Right to move the cursor past the equals sign, and just type ``1+''. Again, you can use the arrow keys or Esc to exit the expression, at which point the purple rectangle will disappear again. Many people find the arrows convenient, but you can also just click somewhere on the expression to put the cursor there and start Mathed.

Other than the special keys described below, typing in math mode is like editing regular text. Use Delete (or Backspace) to delete things. Select text either with the arrow keys or with the mouse. Edit-Undo works in math mode, as does cutting and pasting. One thing to be careful of: if you're right outside a Mathed expression and you type Delete (or Backspace), it will delete the whole expression. Luckily, you can just use Undo to get it back.

What if you want to change E = mc2 to E = mc2.5+1 ? Again, you can use the mouse to click in the right place. However, you can also use the arrow keys. If the cursor is just after the ``c'' but before the ``2'', then typing Up will move the cursor to the level of the superscript, just before the ``2''. Add the ``.5''. Now, hitting Down will move the cursor back to the regular level. In fact, if you hit Down from anywhere within the superscript, the cursor will be placed just after the superscript (so that you can then type the ``+1'').

You can also use Space in navigating an expression. If you are currently within a Mathed structure (a subscript, superscript, fraction, square root, delimiters, or matrix, all of which are described in following sections), pressing Space will move the cursor past that structure, but will stay within Mathed. So, if the cursor is anywhere in the superscript, typing Space will move the cursor down to the regular level and just after the superscript. This means you can type E = mc1+x-2 without using the mouse or the arrow keys, a method you'll probably prefer once you're more experienced. Just be careful not to type Space between the one and the plus sign, or you will exit the superscript. In places where these actions don't make sense (say, between the ``m'' and the ``c''), Space will do nothing29.

Note that if you type your expression and exit with Esc, there will be no space after the expression. This is fine if you're typing a period or comma, but if you want to type a word after the formula, you need to explicitly type Space after you exit Mathed. As a shortcut, though, if you are at the very end of a Mathed expression, then pressing Space will exit Mathed and print a space after the expression. That way you can write `` f = ma is my favorite equation'' instead of `` f = ma is my favorite equation.''

4.3  Exponents and Indices

An exponent can be entered from the Math menu, but it's actually simpler just to type the caret key, ``^''. LYX will place an insertion point (the blue square, remember?) in the superscript, so that whatever you write next will be superscripted, and in a smaller font size. Everything you type until you hit a Space (or Esc to exit Mathed entirely) will be in the superscript.

Writing a subscript (index) is just as easy - start one by typing the underscore key, ``_``. You can subscript and superscript both subscripts and superscripts like this: Aa0+b2+Ca0+b2 .

Exercise: Put equation 1 of example_raw.lyx into math mode.

4.4  The Math Panel

The Math Panel is a convenient way to enter symbols or to perform many complicated Mathed functions. Many of these functions can be accomplished from the keyboard or the Math menu. However, we're going to concentrate on using the Math Panel, just to let you know what's out there; you can learn keyboard shortcuts later, from other manuals (hint, hint). So open up the Math Panel now and leave it open while reading this section.

4.4.1  Greek and symbols

If you click on the button marked `` Greek'', you'll get a menu from which you can choose a Greek letter, which will show up at the cursor. Note that there are a couple variants of epsilon, pi, phi, theta, and sigma. As a shortcut, if you are typing text, you can choose something from the Math Panel, and Mathed will automatically be opened.

Four other buttons at the bottom of the Math Panel allow you to choose from a large array of symbols used in math: various arrows, relations, operators, and sums and integrals. Note that subscripting and superscripting allow you to put lower and upper limits on sums and integrals. The last button is the dreaded miscellaneous. ``Nothing you can do that can't be done... All you need is ę.''

4.4.2  Square roots, accents, and delimiters

To type a square root, just click on the button with a square root sign on it. The square root appears, and the cursor is in a new insertion point inside the square root. You can type variables, numbers, other square roots, fractions, whatever you want. LYX will automatically resize the square root to fit what's inside.

Accenting a character (v ) or group of characters (a+b ) is done the same way. Hit the Decoration button , which has a blue square with a black tilde (~) over it, to open the Decoration window. Click on a decoration, and LYX will print that decoration with an insertion point under (or over) it. Just type what you want in the insertion point, and type Space to ``exit'' the decoration.

Delimiters such as parentheses, brackets, and braces work similarly, but are a bit more complicated. Hit the Delimiter button, which features a blue square surrounded by brackets, to pop up the Delimiter window. Click on a left delimiter with the left mouse button and a right delimiter with the right mouse button. (Alternatively, use the radio buttons labeled ``Left'' and ``Right'' and then click on delimiters with the left mouse button.) Your current selection of delimiters is displayed in a box at the top of the window. It's a pair of parentheses by default, but with this general selection method you can choose a pair of braces, a brace and a parenthesis, or even choose the empty square to have something like `` a = á 7 '' (the empty delimiter is displayed as a broken black line in LYX, but won't show up in the output).

Once you've chosen your delimiters, click on OK to put them into your expression (or hit Apply if you want to leave the window open for next time). If you're lazy, you can type actual parentheses in math mode, rather than using the Delimiter window. However, those parentheses will be the same size as regular text, which will look bad if you have a big fraction or matrix inside the parentheses. Using the Delimiter window will guarantee that the delimiters are sized based on what's inside them.

You can also put delimiters or a square root sign or a decoration on already existing text. Select the portion of the formula that you want to adjust, and then click on the button you want from the Math Panel. Try using this to change Newton's second law from scalar to vector form ( f = ma to f = ma ). Once you've learned about matrices, this is how you'll put parentheses or brackets around them.

4.4.3  Fractions

Fractions are simple in Mathed. Just click on the fraction button in the Math Panel, which shows a fraction with blue squares in the numerator and the denominator. LYX writes two insertion points in a fraction. As you would expect, you can use arrow keys or the mouse to move around a fraction. Click on the top square and type ``1''. Now hit Down and type ``2''. You've made a fraction! Of course you can type anything within each of the two boxes: variables with exponents, square roots, other fractions, whatever.

Exercise: Put equation 2 of example_raw.lyx into math mode.

4.4.4  TEX mode: Limits, log, sin and others

Because letters in math mode are considered to be variables, if you type ``sin'' in math mode, LYX thinks you're typing the product of the three variables s , i , and n . The three letters will be typeset in italics, when what you really wanted was the word ``sin'' typeset in Roman. In addition, LYX won't put a space between the word ``sin'' and the ``x'' (typing Space will just exit math mode). So how do you get `` sinx '' instead of `` sinx ''?

Click on ``sin'' in the Functions listbox in the Math Panel. The word ``sin'' is written in red, in Roman type, otherwise known as TEX mode. The whole word is treated as one symbol, so if you type Backspace, it will delete the whole word. Now type ``x'', which will be written in blue italics, like you expect in Mathed. In the dvi file, the expression will be correctly typeset. Try it.

Other commands you need to type in TEX mode using the Functions listbox include other trigonometric functions and their inverses, hyperbolic functions, logarithms, limits, and quite a few others. These functions can take subscripts and superscripts, important for typing `` cos2q'' or `` limn« ą ''.

Exercise: Put equation 3 of example_raw.lyx into math mode.

4.4.5  Matrices

Click on the matrix button in the Math Panel. The Matrix popup has two sliding bars which allow you to choose how many rows and columns you want in your matrix. Choose 2 rows and 3 columns and hit Apply or OK. LYX prints 6 insertion points in a 2×3 matrix. As usual, you can put any sort of Mathed expression (a square root, another matrix, etc.) in each insertion point. You can also leave some of the insertion points empty if you want.

Tab can be used to move horizontally between the columns of a matrix. Alternatively, you can use the arrow keys to move around - hitting Right at the end of one box will move to the next box, Down will move to the next row, etc.

See the User's Guide for information on how to change the horizontal alignment of each column, and how to change the vertical position of the whole matrix. Note that if you want to write a table containing text, you should use LYX' wonderful table support, rather than trying to write text in a matrix.

4.4.6  Display mode

All of the expressions we have written so far have been on the same line as the text that came before and after them, otherwise known as inline expressions. This is fine for short, simple expressions, but if you want to write larger ones, or if you want your expressions to stand out from the text, you need to write them in display mode. In addition, only displayed expressions can be labeled and numbered (see the User's Guide), and multi-line equations (see Sec. ) must be in display mode.

Click on the display button in the Math Panel, which represents a couple lines of text before and after a centered blue box. LYX opens up an insertion point, but the insertion point is on a new line, and it's centered within that line. Now type an expression and run LATEX to see how it looks. The display button is actually a toggle; use it now to change a couple of your expressions to display mode and back.

Display mode has a couple differences from regular Mathed:

Other than these differences, though, displayed expressions and inline expressions are very similar.

One final note about the way displayed equations are typeset: be careful about whether you're putting your equation into a new paragraph or not. If your equation is in the middle of a sentence or paragraph, then don't press Return. Doing so will cause the text after the equation to start a new paragraph. That text will therefore be indented, which is probably not what you want.

Exercise: Put the various equations in example_raw.lyx into display mode, and see how they're typeset differently.

Exercise: Using various tools you've learned in this section, you should be able to write an equation like:

f(x) = ý
´
´
´
´
´
Ý
´
´
´
´
´
ţ
log8x
x > 0
0
x = 0
5
ň
i = 1 
ai+   Š
Í

- 1
x
 
x < 0

4.5  Multi-Line Equations

Try writing the following equations and looking at the resulting dvi file. You will need to enter two separate equations in display mode.

x = y+y+y+y+y

= 5y

This doesn't look good at all! If you write two or more equations in succession, they look much better if their equals signs are aligned; this is especially true if the second equation has no left side. LYX allows you to write multi-line equations with some control over the alignment.

x
=
y+y+y+y+y
=
5y

This looks much better! The equals signs are aligned, and there is less vertical space between the equations.

In order to start a multi-line equation, open a displayed Mathed expression and type C-Return. LYX will print two lines, each with three empty insertion points. Like with matrices, you can use the mouse, arrow keys, or Tab to move between insertion points. Try to reproduce the above multi-line equation. Note that it's legal to leave one or more insertion points empty in a multi-line equation. This can be useful either for examples like the one above, or for splitting very long equations, like:

x
=
a+b+c+d
+e+f+g

LYX will line up the second (central) field of each line, so usually you'll put equals signs or other relational operators in that field; in fact, though, you can put whatever you want in there. But don't use a multi-line equation to print an array; use a matrix for that (see Sec. 4.4.5).

If you want an even longer set of equations, use C-Return to get a new line with three empty insertion points. If you aren't at the end of the line when you do it, the remaining stuff on the current line will be carried to the new line. If you hit C-Return when you've already written a (one-line) equation, the whole equation will be in the first field. Place the cursor before the equals sign and hit C-Tab to move it to the second field. Then move past the equals sign, and C-Tab again to move the right side of the equation to the third field. Try changing your E = mc2 equation to

E
=
mc2
=
mc×c

If you've written too many lines, put the cursor at the end of a line and use M-e k to delete the following line. It will delete the linefeed and concatenate (all three insertion points of) the next line onto the end of the current one. If the following line is empty, it will effectively just delete it. Warning: using M-e k when you're not at the end of the line can lead to strange behavior.

4.6  More Math Stuff

Mathed can do plenty more. By now, you're familiar with the basics, so we'll just refer to the User's Guide for tips on how to:

Chapter 5
Miscellaneous

5.1  Other Major LYX Features

We haven't gone through all the possible commands in LYX, and we aren't planning on it. As usual, see the User's Guide for more information. The exact function of every menu command is described in the Reference Manual. We'll just mention a couple more major things LYX can do...

5.2  LYX for LATEX Users

If you don't know anything about LATEX, you don't have to read this section. Actually, you might want to learn about LATEX, and then read this chapter. However, many people who begin to use LYX will be familiar with LATEX. If you are such a person, you may be wondering if LYX can really do everything LATEX can do. The short answer is that LYXcan do pretty much everything LATEX can do in one form or another, and it definitely simplifies most parts of writing a LATEX document. Currently, there may be some annoyance in converting old LATEX documents and in a couple other areas, but later releases of LYX will get rid of these problems.

Because this is just a tutorial, we are only going to mention things that new LYX users will most likely be interested in. In the interests of keeping the Tutorial short, we will give only minimal information here. The User's Guide has a great deal of information on differences between LYX and LATEX, and how to do various LATEX tricks in LYX.

5.2.1  TEX Mode

Anything that you enter in Tex mode will be passed straight to LATEX, and will be displayed in red on the screen. Enter TEX mode with Layout-Tex Style or by clicking on the red TEX toggle button in the toolbar.

In Mathed, TEX mode is handled a bit differently. Enter TEX mode by typing a backslash. The backslash is not written out, but anything you type afterwards will be in red. You exit TEX mode by typing Space or some other non-alphabetic character, like a number, underscore, caret, or parenthesis. Once you exit TEX mode, if LYX knows the TEX command you've typed in, it will convert it to WYSIWYM. So if, in Mathed, you type gamma, then when you type Space, LYX will change the red ``gamma'' to a blue `` g''. This will work for almost all, non-complicated math macros (although note that functions like sin will remain in red, since that is already WYSIWYM). This may be faster than using the Math Panel, and will be especially convenient for experienced LATEX users.

As a special case, if you type a brace in Mathed's TEX mode, then Mathed will type the beginning and ending braces in red, then take you out of TEX mode and place the cursor between the braces. This makes it more convenient to type commands that Mathed doesn't know which take an argument.

LYX can't do absolutely everything that LATEX can do (yet?). Some fancy functions are not supported at all, while some work but aren't WYSIWYG. TEX mode allows users to get the full flexibility of LATEX, while having all the convenient features of LYX, like WYSIWYG math, tables, and editing. LYXcould never support every LATEX package. However, by typing usepackage{foo} in the preamble (see Section ), you can use any package you want - although you won't have WYSIWYG support for that package's features.

5.2.2  Importing LATEX Documents- reLyX

You can import a LATEX file into LYX by using the File-Import-LATEX command in LYX. This will call a Perl script called reLyX-which will create a file foo.lyx from the file foo.tex-and then open that file. If the translation doesn't work, you can try calling reLyX from the command line30, possibly using fancier options.

reLyX will translate most legal LATEX, but not everything. It will leave things it doesn't understand in TEX mode, so after translating a file with reLyX, you can look for red text and hand-edit it to look right.

reLyX has its own manpage. Read it to find out about which LATEX commands and environments aren't supported, bugs (and how to get around them), and how to use the various options.

5.2.3  Converting LYX Documents to LATEX

You might wish to convert a LYX Document to a LATEX file. For example, a co-worker or co-author who doesn't have LYX might want to read it. This is very easy to do with LYX. Select File-Export-as LATEX. This will create a file whatever.tex from the whatever.lyx file you are editing. LYX always creates temporary LATEX files when viewing or printing files, so it is very good at generating LATEX.

5.2.4  LATEX Preamble

5.2.4.1  Document Class

The Layout-Document popup takes care of many of the options that you would input in a documentclass command. Change the class, default font size and paper size here. Put any extra options to the documentclass command in the Extra Options area.

5.2.4.2  Other Preamble Matter

If you have special commands to put in the preamble of a LATEX file, you can use them in a LYX document as well. Select Layout-Latex Preamble and type in the popup window. Anything you type will (like TEX mode) be sent directly to LATEX.

5.2.5  BibTEX

LYX has good but not full support for BibTEX, which allows you to build databases of bibliographical references to be used in multiple documents. Select Insert-Lists & TOC-BibTEX Reference to include a bib file. Click on the resulting ``BibTEX Generated References'' box and you will get a BibTEX popup. In the Database field, type what you would type inside the braces of a bibliography{} command31. In the Style field, type what you would type inside the braces of a bibliographystyle{} command.

After you've done this, you can use citations from any bibliographies you're including with Insert-Citation Reference (see Section 3.6). LYX will take care of running BibTEX. The reason we say that LYX has ``good but not full support'' is that LYXcannot create bib files, and you won't get a list of all the references in your bib file in the Citation popup.

5.2.6  Miscellaneous

Insert a protected space with C-space. This will show up on the screen as a small pink ``u''. There are lots of these throughout this Tutorial. See the Insert-Special Character menu for other special characters, including ellipsis, forced linebreak, and hyphenation point.

5.3  Errors!

Sometimes when you LATEX a document, there will be errors, things that LYXor LATEX can't understand. When this happens, LYX will create an error box (a box with the word ``error'' in it). Clicking on this box will pop up a window showing what the error was. If it was something you did wrong with LYX, it will be a LYX error. These should be very rare. If LATEX had a problem (most often, this happens with things you typed in TEX mode) then LYX will just quote LATEX's error message.


Footnotes:

1 or, more optimistically, ``features''

2 No, we're not trying to start (or win) a word processor holy war here. But we do think it's important to describe LYX's features. And one of LYX's main features, WYSIWYM, is a fundamentally different concept than the one that 99% of people have about word processing.

3 There are ways to adjust all of these [only some of which require knowledge of LATEX], either for a whole document or for a specific location in a document. See the User's Guide for details.

4 Okay, we know nothing is perfect, but LATEX is as close to bug-free as any computer program can get.

5 The source for the info in this section is ``A Guide to LATEX2e,'' by Helmut Kopka and Patrick Daly, which has an entry in the bibliography of the User's Guide.

6 or ``ha blech'', depending on how you pronounce your ``a''s...

7 They can also serve as good examples of how to use the many features of LYX.

8 The hints are located in yellow ``Notes''. Access the text in a note by clicking on it.

9 If you're like many UNIX users, you did so long before starting to read the Tutorial.

10 You don't have to select the line. If nothing is selected, LYX changes the paragraph you are currently in to the selected environment. Alternatively, you can change several paragraphs to a different environment by selecting them before picking an environment.

11 See the User's Guide for ways to write titles with two or more lines. The Standard environment can of course continue for several paragraphs. The various list environments (see below) also don't end when you hit Return. You can always tell what environment you're currently in by looking at the Environment box.

12 Yes, we're overemphasizing this point throughout the Tutorial. But it is the main philosophy of LYX, so please forgive us.

13 LYX won't let you select the first bullet unless you also select the paragraph before the list, which you probably don't want to do. Similarly, you can't select the actual number in a numbered section title. Don't worry about it.

14 But a typesetter's tab, which will change to fit the size of the largest term, not a pathetic, rigid, unchangeable typewriter Tab.

15 ...assuming you're creative enough to come up with poetry in the first place.

16 LATEX users: this is equivalent to the LATEX documentclass

17 That's usually the default textclass, although you can set it in your lyxrc file.

18 One warning, if you're writing from a template. If you erase all of the text in an environment - for example, if you erase the whole My Address field so that you can replace it with your own - and then you move the cursor without writing any text, the environment may disappear. This is because most environments cannot exist without any text in them. Just reselect the environment from the Environment menu to get it back.

19 You should not be using the letter any more, since the Letter textclass doesn't allow titles.

20 We write ``sec:`` because you can also label equations, tables, and figures.

21 By the way, copying a chapter title may cause a LYX error, because chapters aren't allowed in the article class. If this happens, just delete the chapter title. If you want to know why this happens, see section 3.1.

22 The button shows an arrow pointing to red text, which is just below some black text.

23 It may be easier to select it using the keyboard. You might accidentally open the footnote if you're trying to select the marker itself with the mouse.

24 The button shows an arrow pointing to red text next to (i.e., in the margin of) black text, and should be next to the Insert Footnote button in the toolbar.

25 This is why it's a good idea to give the keys unique and logical names, instead of leaving the default numbers in the Key field.

26 Don't frustrate yourself trying to click or backspace before the section number. It won't work. You're not allowed to edit the section number anyway, since LYXtakes care of section numbering.

27 The menu command will work even if you don't have a table of contents inset in your document.

28 LYX can't check if the math you're writing is actually correct. Sorry.

29 Space and Tab are not used for making extra space between parts of an equation. That spacing is a typesetting issue, which means that you should let LYX (LATEX) take care of it (see Sec. 2.1.3). If you're not entirely satisfied, there are ways to fine-tune spacing, for which you can see the User's Guide - but don't bother with fine-tuning until you're done putting all the content into your document.

30 When LYX is installed, a separate executable called reLyX will be placed in the same folder as the lyx executable (e.g., /usr/local/bin/reLyX). reLyX requires Perl (version 5.002 as of this writing).

31 Like in regular LATEX, multiple bibliographies should be separated by commas, with no whitespace.


File translated from TEX by TTH, version 2.01.
On 30 Aug 1999, 13:22.